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.30; | |
| contract Receiver { | |
| string public text; | |
| uint public x; | |
| event Received(string message); | |
| fallback() external payable { |
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.30; | |
| contract hello { | |
| // if-else | |
| function demoif(unit x) external pure returns(uint){ | |
| if (x < 100){ | |
| //code | |
| return 1; | |
| } else if (x < 200){ |
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.30; | |
| contract array{ | |
| uint[] public arr; | |
| uint[] public arr2 = [1,2,3]; | |
| uint[5] public fixarr; //[0,0,0,0,0] | |
| function get(uint i) public view returns(uint){ | |
| return arr2[i]; |
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
| 123 |
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
| // this line is added to create a gist. Empty file is not allowed. |
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
| { | |
| "overrides": [ | |
| { | |
| "files": "*.sol", | |
| "options": { | |
| "printWidth": 80, | |
| "tabWidth": 4, | |
| "useTabs": false, | |
| "singleQuote": false, | |
| "bracketSpacing": false |