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: MIT | |
| pragma solidity 0.8.9; | |
| library MathLibrary { | |
| function add(uint a, uint b) external pure returns(uint){ | |
| return a + b; | |
| } | |
| } | |
| contract A { |
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: MIT | |
| pragma solidity 0.8.9; | |
| // GGGF -> Great Grand Grand Father | |
| // GGF -> Great Grand Father | |
| // GF -> Grand Father | |
| // F -> Father | |
| contract GGGF { |
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:MIT | |
| pragma solidity 0.8.5; | |
| contract ATMMachine { | |
| // this is the reserve of the atm machine | |
| address public owner; | |
| constructor () { | |
| owner = msg.sender; | |
| } |
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: MIT | |
| pragma solidity ^0.8.0; | |
| contract ComprehensiveContract { | |
| // State variables with different visibility specifiers | |
| uint256 public publicData; // Public visibility: accessible from outside | |
| uint256 internal internalData; // Internal visibility: accessible within this contract and derived contracts | |
| uint256 private privateData; // Private visibility: accessible only within this contract | |
| // Enum definition |
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.7.0 < 0.9.0; | |
| contract Wallet { | |
| // recieve ether | |
| // send ether | |
| // store ether | |
| // withdrawl ether | |
| // check balance |
OlderNewer