This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: Unlicense | |
| pragma solidity >=0.6.0 <0.8.0; | |
| contract week4Exercises { | |
| uint[] public numArray; | |
| constructor() { | |
| numArray = [2,62,10,33,12,9]; | |
| } | |
| // Function that returns the whole numArray | |
| function returnArray() public view returns(uint256[] memory) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: Unlicense | |
| pragma solidity >=0.6.0 <0.8.0; | |
| contract exerciseWeek3 { | |
| uint256 number; | |
| //str is not a valid data type. Use string instead | |
| string word; | |
| // Missing data location for string. Use memory. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity ^0.8.25; | |
| import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
| // Idealy, the input after we click "transact", should match the output once we all the designed function | |
| contract thirdExample is ERC721{ | |
| function getSelector(string memory _function) public view returns(bytes4) { | |
| return bytes4(keccak256(bytes(_function))); |