Skip to content

Instantly share code, notes, and snippets.

@restockflippaz
Created February 2, 2023 21:36
Show Gist options
  • Save restockflippaz/94ab6fd081bb1878de64b92494055e8b to your computer and use it in GitHub Desktop.
Save restockflippaz/94ab6fd081bb1878de64b92494055e8b to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.17+commit.8df45f5f.js&optimize=false&runs=200&gist=
{
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 80,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false
}
},
{
"files": "*.yml",
"options": {}
},
{
"files": "*.yaml",
"options": {}
},
{
"files": "*.toml",
"options": {}
},
{
"files": "*.json",
"options": {}
},
{
"files": "*.js",
"options": {}
},
{
"files": "*.ts",
"options": {}
}
]
}
REMIX DEFAULT WORKSPACE
Remix default workspace is present when:
i. Remix loads for the very first time
ii. A new workspace is created with 'Default' template
iii. There are no files existing in the File Explorer
This workspace contains 3 directories:
1. 'contracts': Holds three contracts with increasing levels of complexity.
2. 'scripts': Contains four typescript files to deploy a contract. It is explained below.
3. 'tests': Contains one Solidity test file for 'Ballot' contract & one JS test file for 'Storage' contract.
SCRIPTS
The 'scripts' folder has four typescript files which help to deploy the 'Storage' contract using 'web3.js' and 'ethers.js' libraries.
For the deployment of any other contract, just update the contract's name from 'Storage' to the desired contract and provide constructor arguments accordingly
in the file `deploy_with_ethers.ts` or `deploy_with_web3.ts`
In the 'tests' folder there is a script containing Mocha-Chai unit tests for 'Storage' contract.
To run a script, right click on file name in the file explorer and click 'Run'. Remember, Solidity file must already be compiled.
Output from script will appear in remix terminal.
Please note, require/import is supported in a limited manner for Remix supported modules.
For now, modules supported by Remix are ethers, web3, swarmgw, chai, multihashes, remix and hardhat only for hardhat.ethers object/plugin.
For unsupported modules, an error like this will be thrown: '<module_name> module require is not supported by Remix IDE' will be shown.
{
"id": "9161e6b64f67b60a41cd2b4b59d727e4",
"_format": "hh-sol-build-info-1",
"solcVersion": "0.8.17",
"solcLongVersion": "0.8.17+commit.8df45f5f",
"input": {
"language": "Solidity",
"sources": {
"Flip.sol": {
"content": "pragma solidity 0.8.17;\n\ncontract Example {\n uint storedData;\n \n function set(uint x) public {\n storedData = x;\n }\n \n function get() public view returns (uint) {\n return storedData;\n }\n}"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"": [
"ast"
],
"*": [
"abi",
"metadata",
"devdoc",
"userdoc",
"storageLayout",
"evm.legacyAssembly",
"evm.bytecode",
"evm.deployedBytecode",
"evm.methodIdentifiers",
"evm.gasEstimates",
"evm.assembly"
]
}
}
}
},
"output": {
"contracts": {
"Flip.sol": {
"Example": {
"abi": [
{
"inputs": [],
"name": "get",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "x",
"type": "uint256"
}
],
"name": "set",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"evm": {
"assembly": " /* \"Flip.sol\":25:221 contract Example {... */\n mstore(0x40, 0x80)\n callvalue\n dup1\n iszero\n tag_1\n jumpi\n 0x00\n dup1\n revert\ntag_1:\n pop\n dataSize(sub_0)\n dup1\n dataOffset(sub_0)\n 0x00\n codecopy\n 0x00\n return\nstop\n\nsub_0: assembly {\n /* \"Flip.sol\":25:221 contract Example {... */\n mstore(0x40, 0x80)\n callvalue\n dup1\n iszero\n tag_1\n jumpi\n 0x00\n dup1\n revert\n tag_1:\n pop\n jumpi(tag_2, lt(calldatasize, 0x04))\n shr(0xe0, calldataload(0x00))\n dup1\n 0x60fe47b1\n eq\n tag_3\n jumpi\n dup1\n 0x6d4ce63c\n eq\n tag_4\n jumpi\n tag_2:\n 0x00\n dup1\n revert\n /* \"Flip.sol\":74:133 function set(uint x) public {... */\n tag_3:\n tag_5\n 0x04\n dup1\n calldatasize\n sub\n dup2\n add\n swap1\n tag_6\n swap2\n swap1\n tag_7\n jump\t// in\n tag_6:\n tag_8\n jump\t// in\n tag_5:\n stop\n /* \"Flip.sol\":143:219 function get() public view returns (uint) {... */\n tag_4:\n tag_9\n tag_10\n jump\t// in\n tag_9:\n mload(0x40)\n tag_11\n swap2\n swap1\n tag_12\n jump\t// in\n tag_11:\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n return\n /* \"Flip.sol\":74:133 function set(uint x) public {... */\n tag_8:\n /* \"Flip.sol\":125:126 x */\n dup1\n /* \"Flip.sol\":112:122 storedData */\n 0x00\n /* \"Flip.sol\":112:126 storedData = x */\n dup2\n swap1\n sstore\n pop\n /* \"Flip.sol\":74:133 function set(uint x) public {... */\n pop\n jump\t// out\n /* \"Flip.sol\":143:219 function get() public view returns (uint) {... */\n tag_10:\n /* \"Flip.sol\":179:183 uint */\n 0x00\n /* \"Flip.sol\":202:212 storedData */\n dup1\n sload\n /* \"Flip.sol\":195:212 return storedData */\n swap1\n pop\n /* \"Flip.sol\":143:219 function get() public view returns (uint) {... */\n swap1\n jump\t// out\n /* \"#utility.yul\":88:205 */\n tag_16:\n /* \"#utility.yul\":197:198 */\n 0x00\n /* \"#utility.yul\":194:195 */\n dup1\n /* \"#utility.yul\":187:199 */\n revert\n /* \"#utility.yul\":334:411 */\n tag_18:\n /* \"#utility.yul\":371:378 */\n 0x00\n /* \"#utility.yul\":400:405 */\n dup2\n /* \"#utility.yul\":389:405 */\n swap1\n pop\n /* \"#utility.yul\":334:411 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":417:539 */\n tag_19:\n /* \"#utility.yul\":490:514 */\n tag_28\n /* \"#utility.yul\":508:513 */\n dup2\n /* \"#utility.yul\":490:514 */\n tag_18\n jump\t// in\n tag_28:\n /* \"#utility.yul\":483:488 */\n dup2\n /* \"#utility.yul\":480:515 */\n eq\n /* \"#utility.yul\":470:533 */\n tag_29\n jumpi\n /* \"#utility.yul\":529:530 */\n 0x00\n /* \"#utility.yul\":526:527 */\n dup1\n /* \"#utility.yul\":519:531 */\n revert\n /* \"#utility.yul\":470:533 */\n tag_29:\n /* \"#utility.yul\":417:539 */\n pop\n jump\t// out\n /* \"#utility.yul\":545:684 */\n tag_20:\n /* \"#utility.yul\":591:596 */\n 0x00\n /* \"#utility.yul\":629:635 */\n dup2\n /* \"#utility.yul\":616:636 */\n calldataload\n /* \"#utility.yul\":607:636 */\n swap1\n pop\n /* \"#utility.yul\":645:678 */\n tag_31\n /* \"#utility.yul\":672:677 */\n dup2\n /* \"#utility.yul\":645:678 */\n tag_19\n jump\t// in\n tag_31:\n /* \"#utility.yul\":545:684 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":690:1019 */\n tag_7:\n /* \"#utility.yul\":749:755 */\n 0x00\n /* \"#utility.yul\":798:800 */\n 0x20\n /* \"#utility.yul\":786:795 */\n dup3\n /* \"#utility.yul\":777:784 */\n dup5\n /* \"#utility.yul\":773:796 */\n sub\n /* \"#utility.yul\":769:801 */\n slt\n /* \"#utility.yul\":766:885 */\n iszero\n tag_33\n jumpi\n /* \"#utility.yul\":804:883 */\n tag_34\n tag_16\n jump\t// in\n tag_34:\n /* \"#utility.yul\":766:885 */\n tag_33:\n /* \"#utility.yul\":924:925 */\n 0x00\n /* \"#utility.yul\":949:1002 */\n tag_35\n /* \"#utility.yul\":994:1001 */\n dup5\n /* \"#utility.yul\":985:991 */\n dup3\n /* \"#utility.yul\":974:983 */\n dup6\n /* \"#utility.yul\":970:992 */\n add\n /* \"#utility.yul\":949:1002 */\n tag_20\n jump\t// in\n tag_35:\n /* \"#utility.yul\":939:1002 */\n swap2\n pop\n /* \"#utility.yul\":895:1012 */\n pop\n /* \"#utility.yul\":690:1019 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":1025:1143 */\n tag_21:\n /* \"#utility.yul\":1112:1136 */\n tag_37\n /* \"#utility.yul\":1130:1135 */\n dup2\n /* \"#utility.yul\":1112:1136 */\n tag_18\n jump\t// in\n tag_37:\n /* \"#utility.yul\":1107:1110 */\n dup3\n /* \"#utility.yul\":1100:1137 */\n mstore\n /* \"#utility.yul\":1025:1143 */\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":1149:1371 */\n tag_12:\n /* \"#utility.yul\":1242:1246 */\n 0x00\n /* \"#utility.yul\":1280:1282 */\n 0x20\n /* \"#utility.yul\":1269:1278 */\n dup3\n /* \"#utility.yul\":1265:1283 */\n add\n /* \"#utility.yul\":1257:1283 */\n swap1\n pop\n /* \"#utility.yul\":1293:1364 */\n tag_39\n /* \"#utility.yul\":1361:1362 */\n 0x00\n /* \"#utility.yul\":1350:1359 */\n dup4\n /* \"#utility.yul\":1346:1363 */\n add\n /* \"#utility.yul\":1337:1343 */\n dup5\n /* \"#utility.yul\":1293:1364 */\n tag_21\n jump\t// in\n tag_39:\n /* \"#utility.yul\":1149:1371 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n\n auxdata: 0xa2646970667358221220e870b662a32cdabdc34dd10e9b370fd188ec08cdcde088a7bdc6d4649974438764736f6c63430008110033\n}\n",
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "608060405234801561001057600080fd5b50610150806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806360fe47b11461003b5780636d4ce63c14610057575b600080fd5b610055600480360381019061005091906100c3565b610075565b005b61005f61007f565b60405161006c91906100ff565b60405180910390f35b8060008190555050565b60008054905090565b600080fd5b6000819050919050565b6100a08161008d565b81146100ab57600080fd5b50565b6000813590506100bd81610097565b92915050565b6000602082840312156100d9576100d8610088565b5b60006100e7848285016100ae565b91505092915050565b6100f98161008d565b82525050565b600060208201905061011460008301846100f0565b9291505056fea2646970667358221220e870b662a32cdabdc34dd10e9b370fd188ec08cdcde088a7bdc6d4649974438764736f6c63430008110033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x150 DUP1 PUSH2 0x20 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x36 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x60FE47B1 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x6D4CE63C EQ PUSH2 0x57 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x55 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x50 SWAP2 SWAP1 PUSH2 0xC3 JUMP JUMPDEST PUSH2 0x75 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x5F PUSH2 0x7F JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x6C SWAP2 SWAP1 PUSH2 0xFF JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST DUP1 PUSH1 0x0 DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0xA0 DUP2 PUSH2 0x8D JUMP JUMPDEST DUP2 EQ PUSH2 0xAB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xBD DUP2 PUSH2 0x97 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xD9 JUMPI PUSH2 0xD8 PUSH2 0x88 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0xE7 DUP5 DUP3 DUP6 ADD PUSH2 0xAE JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0xF9 DUP2 PUSH2 0x8D JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x114 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0xF0 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xE8 PUSH17 0xB662A32CDABDC34DD10E9B370FD188EC08 0xCD 0xCD 0xE0 DUP9 0xA7 0xBD 0xC6 0xD4 PUSH5 0x9974438764 PUSH20 0x6F6C634300081100330000000000000000000000 ",
"sourceMap": "25:196:0:-:0;;;;;;;;;;;;;;;;;;;"
},
"deployedBytecode": {
"functionDebugData": {
"@get_21": {
"entryPoint": 127,
"id": 21,
"parameterSlots": 0,
"returnSlots": 1
},
"@set_13": {
"entryPoint": 117,
"id": 13,
"parameterSlots": 1,
"returnSlots": 0
},
"abi_decode_t_uint256": {
"entryPoint": 174,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"abi_decode_tuple_t_uint256": {
"entryPoint": 195,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"abi_encode_t_uint256_to_t_uint256_fromStack": {
"entryPoint": 240,
"id": null,
"parameterSlots": 2,
"returnSlots": 0
},
"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed": {
"entryPoint": 255,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"allocate_unbounded": {
"entryPoint": null,
"id": null,
"parameterSlots": 0,
"returnSlots": 1
},
"cleanup_t_uint256": {
"entryPoint": 141,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db": {
"entryPoint": null,
"id": null,
"parameterSlots": 0,
"returnSlots": 0
},
"revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b": {
"entryPoint": 136,
"id": null,
"parameterSlots": 0,
"returnSlots": 0
},
"validator_revert_t_uint256": {
"entryPoint": 151,
"id": null,
"parameterSlots": 1,
"returnSlots": 0
}
},
"generatedSources": [
{
"ast": {
"nodeType": "YulBlock",
"src": "0:1374:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "47:35:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "57:19:1",
"value": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "73:2:1",
"type": "",
"value": "64"
}
],
"functionName": {
"name": "mload",
"nodeType": "YulIdentifier",
"src": "67:5:1"
},
"nodeType": "YulFunctionCall",
"src": "67:9:1"
},
"variableNames": [
{
"name": "memPtr",
"nodeType": "YulIdentifier",
"src": "57:6:1"
}
]
}
]
},
"name": "allocate_unbounded",
"nodeType": "YulFunctionDefinition",
"returnVariables": [
{
"name": "memPtr",
"nodeType": "YulTypedName",
"src": "40:6:1",
"type": ""
}
],
"src": "7:75:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "177:28:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "194:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "197:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "187:6:1"
},
"nodeType": "YulFunctionCall",
"src": "187:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "187:12:1"
}
]
},
"name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b",
"nodeType": "YulFunctionDefinition",
"src": "88:117:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "300:28:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "317:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "320:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "310:6:1"
},
"nodeType": "YulFunctionCall",
"src": "310:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "310:12:1"
}
]
},
"name": "revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db",
"nodeType": "YulFunctionDefinition",
"src": "211:117:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "379:32:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "389:16:1",
"value": {
"name": "value",
"nodeType": "YulIdentifier",
"src": "400:5:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "389:7:1"
}
]
}
]
},
"name": "cleanup_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "361:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "371:7:1",
"type": ""
}
],
"src": "334:77:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "460:79:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "517:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "526:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "529:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "519:6:1"
},
"nodeType": "YulFunctionCall",
"src": "519:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "519:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "483:5:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "508:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "490:17:1"
},
"nodeType": "YulFunctionCall",
"src": "490:24:1"
}
],
"functionName": {
"name": "eq",
"nodeType": "YulIdentifier",
"src": "480:2:1"
},
"nodeType": "YulFunctionCall",
"src": "480:35:1"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "473:6:1"
},
"nodeType": "YulFunctionCall",
"src": "473:43:1"
},
"nodeType": "YulIf",
"src": "470:63:1"
}
]
},
"name": "validator_revert_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "453:5:1",
"type": ""
}
],
"src": "417:122:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "597:87:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "607:29:1",
"value": {
"arguments": [
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "629:6:1"
}
],
"functionName": {
"name": "calldataload",
"nodeType": "YulIdentifier",
"src": "616:12:1"
},
"nodeType": "YulFunctionCall",
"src": "616:20:1"
},
"variableNames": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "607:5:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "672:5:1"
}
],
"functionName": {
"name": "validator_revert_t_uint256",
"nodeType": "YulIdentifier",
"src": "645:26:1"
},
"nodeType": "YulFunctionCall",
"src": "645:33:1"
},
"nodeType": "YulExpressionStatement",
"src": "645:33:1"
}
]
},
"name": "abi_decode_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "575:6:1",
"type": ""
},
{
"name": "end",
"nodeType": "YulTypedName",
"src": "583:3:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "591:5:1",
"type": ""
}
],
"src": "545:139:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "756:263:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "802:83:1",
"statements": [
{
"expression": {
"arguments": [],
"functionName": {
"name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b",
"nodeType": "YulIdentifier",
"src": "804:77:1"
},
"nodeType": "YulFunctionCall",
"src": "804:79:1"
},
"nodeType": "YulExpressionStatement",
"src": "804:79:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "777:7:1"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "786:9:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "773:3:1"
},
"nodeType": "YulFunctionCall",
"src": "773:23:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "798:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "slt",
"nodeType": "YulIdentifier",
"src": "769:3:1"
},
"nodeType": "YulFunctionCall",
"src": "769:32:1"
},
"nodeType": "YulIf",
"src": "766:119:1"
},
{
"nodeType": "YulBlock",
"src": "895:117:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "910:15:1",
"value": {
"kind": "number",
"nodeType": "YulLiteral",
"src": "924:1:1",
"type": "",
"value": "0"
},
"variables": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "914:6:1",
"type": ""
}
]
},
{
"nodeType": "YulAssignment",
"src": "939:63:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "974:9:1"
},
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "985:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "970:3:1"
},
"nodeType": "YulFunctionCall",
"src": "970:22:1"
},
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "994:7:1"
}
],
"functionName": {
"name": "abi_decode_t_uint256",
"nodeType": "YulIdentifier",
"src": "949:20:1"
},
"nodeType": "YulFunctionCall",
"src": "949:53:1"
},
"variableNames": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "939:6:1"
}
]
}
]
}
]
},
"name": "abi_decode_tuple_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "726:9:1",
"type": ""
},
{
"name": "dataEnd",
"nodeType": "YulTypedName",
"src": "737:7:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "749:6:1",
"type": ""
}
],
"src": "690:329:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1090:53:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "1107:3:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1130:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "1112:17:1"
},
"nodeType": "YulFunctionCall",
"src": "1112:24:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1100:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1100:37:1"
},
"nodeType": "YulExpressionStatement",
"src": "1100:37:1"
}
]
},
"name": "abi_encode_t_uint256_to_t_uint256_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1078:5:1",
"type": ""
},
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "1085:3:1",
"type": ""
}
],
"src": "1025:118:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1247:124:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1257:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1269:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1280:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1265:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1265:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "1257:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "1337:6:1"
},
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1350:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1361:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1346:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1346:17:1"
}
],
"functionName": {
"name": "abi_encode_t_uint256_to_t_uint256_fromStack",
"nodeType": "YulIdentifier",
"src": "1293:43:1"
},
"nodeType": "YulFunctionCall",
"src": "1293:71:1"
},
"nodeType": "YulExpressionStatement",
"src": "1293:71:1"
}
]
},
"name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "1219:9:1",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "1231:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "1242:4:1",
"type": ""
}
],
"src": "1149:222:1"
}
]
},
"contents": "{\n\n function allocate_unbounded() -> memPtr {\n memPtr := mload(64)\n }\n\n function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {\n revert(0, 0)\n }\n\n function revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() {\n revert(0, 0)\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function validator_revert_t_uint256(value) {\n if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }\n }\n\n function abi_decode_t_uint256(offset, end) -> value {\n value := calldataload(offset)\n validator_revert_t_uint256(value)\n }\n\n function abi_decode_tuple_t_uint256(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_uint256(add(headStart, offset), dataEnd)\n }\n\n }\n\n function abi_encode_t_uint256_to_t_uint256_fromStack(value, pos) {\n mstore(pos, cleanup_t_uint256(value))\n }\n\n function abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed(headStart , value0) -> tail {\n tail := add(headStart, 32)\n\n abi_encode_t_uint256_to_t_uint256_fromStack(value0, add(headStart, 0))\n\n }\n\n}\n",
"id": 1,
"language": "Yul",
"name": "#utility.yul"
}
],
"immutableReferences": {},
"linkReferences": {},
"object": "608060405234801561001057600080fd5b50600436106100365760003560e01c806360fe47b11461003b5780636d4ce63c14610057575b600080fd5b610055600480360381019061005091906100c3565b610075565b005b61005f61007f565b60405161006c91906100ff565b60405180910390f35b8060008190555050565b60008054905090565b600080fd5b6000819050919050565b6100a08161008d565b81146100ab57600080fd5b50565b6000813590506100bd81610097565b92915050565b6000602082840312156100d9576100d8610088565b5b60006100e7848285016100ae565b91505092915050565b6100f98161008d565b82525050565b600060208201905061011460008301846100f0565b9291505056fea2646970667358221220e870b662a32cdabdc34dd10e9b370fd188ec08cdcde088a7bdc6d4649974438764736f6c63430008110033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x36 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x60FE47B1 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x6D4CE63C EQ PUSH2 0x57 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x55 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x50 SWAP2 SWAP1 PUSH2 0xC3 JUMP JUMPDEST PUSH2 0x75 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x5F PUSH2 0x7F JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x6C SWAP2 SWAP1 PUSH2 0xFF JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST DUP1 PUSH1 0x0 DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0xA0 DUP2 PUSH2 0x8D JUMP JUMPDEST DUP2 EQ PUSH2 0xAB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xBD DUP2 PUSH2 0x97 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xD9 JUMPI PUSH2 0xD8 PUSH2 0x88 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0xE7 DUP5 DUP3 DUP6 ADD PUSH2 0xAE JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0xF9 DUP2 PUSH2 0x8D JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x114 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0xF0 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xE8 PUSH17 0xB662A32CDABDC34DD10E9B370FD188EC08 0xCD 0xCD 0xE0 DUP9 0xA7 0xBD 0xC6 0xD4 PUSH5 0x9974438764 PUSH20 0x6F6C634300081100330000000000000000000000 ",
"sourceMap": "25:196:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;74:59;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;143:76;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;74:59;125:1;112:10;:14;;;;74:59;:::o;143:76::-;179:4;202:10;;195:17;;143:76;:::o;88:117:1:-;197:1;194;187:12;334:77;371:7;400:5;389:16;;334:77;;;:::o;417:122::-;490:24;508:5;490:24;:::i;:::-;483:5;480:35;470:63;;529:1;526;519:12;470:63;417:122;:::o;545:139::-;591:5;629:6;616:20;607:29;;645:33;672:5;645:33;:::i;:::-;545:139;;;;:::o;690:329::-;749:6;798:2;786:9;777:7;773:23;769:32;766:119;;;804:79;;:::i;:::-;766:119;924:1;949:53;994:7;985:6;974:9;970:22;949:53;:::i;:::-;939:63;;895:117;690:329;;;;:::o;1025:118::-;1112:24;1130:5;1112:24;:::i;:::-;1107:3;1100:37;1025:118;;:::o;1149:222::-;1242:4;1280:2;1269:9;1265:18;1257:26;;1293:71;1361:1;1350:9;1346:17;1337:6;1293:71;:::i;:::-;1149:222;;;;:::o"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "67200",
"executionCost": "117",
"totalCost": "67317"
},
"external": {
"get()": "2437",
"set(uint256)": "22498"
}
},
"legacyAssembly": {
".code": [
{
"begin": 25,
"end": 221,
"name": "PUSH",
"source": 0,
"value": "80"
},
{
"begin": 25,
"end": 221,
"name": "PUSH",
"source": 0,
"value": "40"
},
{
"begin": 25,
"end": 221,
"name": "MSTORE",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "CALLVALUE",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "DUP1",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "ISZERO",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "PUSH [tag]",
"source": 0,
"value": "1"
},
{
"begin": 25,
"end": 221,
"name": "JUMPI",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 25,
"end": 221,
"name": "DUP1",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "REVERT",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "tag",
"source": 0,
"value": "1"
},
{
"begin": 25,
"end": 221,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "POP",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "PUSH #[$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 25,
"end": 221,
"name": "DUP1",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "PUSH [$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 25,
"end": 221,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 25,
"end": 221,
"name": "CODECOPY",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 25,
"end": 221,
"name": "RETURN",
"source": 0
}
],
".data": {
"0": {
".auxdata": "a2646970667358221220e870b662a32cdabdc34dd10e9b370fd188ec08cdcde088a7bdc6d4649974438764736f6c63430008110033",
".code": [
{
"begin": 25,
"end": 221,
"name": "PUSH",
"source": 0,
"value": "80"
},
{
"begin": 25,
"end": 221,
"name": "PUSH",
"source": 0,
"value": "40"
},
{
"begin": 25,
"end": 221,
"name": "MSTORE",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "CALLVALUE",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "DUP1",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "ISZERO",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "PUSH [tag]",
"source": 0,
"value": "1"
},
{
"begin": 25,
"end": 221,
"name": "JUMPI",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 25,
"end": 221,
"name": "DUP1",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "REVERT",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "tag",
"source": 0,
"value": "1"
},
{
"begin": 25,
"end": 221,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "POP",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "PUSH",
"source": 0,
"value": "4"
},
{
"begin": 25,
"end": 221,
"name": "CALLDATASIZE",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "LT",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "PUSH [tag]",
"source": 0,
"value": "2"
},
{
"begin": 25,
"end": 221,
"name": "JUMPI",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 25,
"end": 221,
"name": "CALLDATALOAD",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "PUSH",
"source": 0,
"value": "E0"
},
{
"begin": 25,
"end": 221,
"name": "SHR",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "DUP1",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "PUSH",
"source": 0,
"value": "60FE47B1"
},
{
"begin": 25,
"end": 221,
"name": "EQ",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "PUSH [tag]",
"source": 0,
"value": "3"
},
{
"begin": 25,
"end": 221,
"name": "JUMPI",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "DUP1",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "PUSH",
"source": 0,
"value": "6D4CE63C"
},
{
"begin": 25,
"end": 221,
"name": "EQ",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "PUSH [tag]",
"source": 0,
"value": "4"
},
{
"begin": 25,
"end": 221,
"name": "JUMPI",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "tag",
"source": 0,
"value": "2"
},
{
"begin": 25,
"end": 221,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 25,
"end": 221,
"name": "DUP1",
"source": 0
},
{
"begin": 25,
"end": 221,
"name": "REVERT",
"source": 0
},
{
"begin": 74,
"end": 133,
"name": "tag",
"source": 0,
"value": "3"
},
{
"begin": 74,
"end": 133,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 74,
"end": 133,
"name": "PUSH [tag]",
"source": 0,
"value": "5"
},
{
"begin": 74,
"end": 133,
"name": "PUSH",
"source": 0,
"value": "4"
},
{
"begin": 74,
"end": 133,
"name": "DUP1",
"source": 0
},
{
"begin": 74,
"end": 133,
"name": "CALLDATASIZE",
"source": 0
},
{
"begin": 74,
"end": 133,
"name": "SUB",
"source": 0
},
{
"begin": 74,
"end": 133,
"name": "DUP2",
"source": 0
},
{
"begin": 74,
"end": 133,
"name": "ADD",
"source": 0
},
{
"begin": 74,
"end": 133,
"name": "SWAP1",
"source": 0
},
{
"begin": 74,
"end": 133,
"name": "PUSH [tag]",
"source": 0,
"value": "6"
},
{
"begin": 74,
"end": 133,
"name": "SWAP2",
"source": 0
},
{
"begin": 74,
"end": 133,
"name": "SWAP1",
"source": 0
},
{
"begin": 74,
"end": 133,
"name": "PUSH [tag]",
"source": 0,
"value": "7"
},
{
"begin": 74,
"end": 133,
"jumpType": "[in]",
"name": "JUMP",
"source": 0
},
{
"begin": 74,
"end": 133,
"name": "tag",
"source": 0,
"value": "6"
},
{
"begin": 74,
"end": 133,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 74,
"end": 133,
"name": "PUSH [tag]",
"source": 0,
"value": "8"
},
{
"begin": 74,
"end": 133,
"jumpType": "[in]",
"name": "JUMP",
"source": 0
},
{
"begin": 74,
"end": 133,
"name": "tag",
"source": 0,
"value": "5"
},
{
"begin": 74,
"end": 133,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 74,
"end": 133,
"name": "STOP",
"source": 0
},
{
"begin": 143,
"end": 219,
"name": "tag",
"source": 0,
"value": "4"
},
{
"begin": 143,
"end": 219,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 143,
"end": 219,
"name": "PUSH [tag]",
"source": 0,
"value": "9"
},
{
"begin": 143,
"end": 219,
"name": "PUSH [tag]",
"source": 0,
"value": "10"
},
{
"begin": 143,
"end": 219,
"jumpType": "[in]",
"name": "JUMP",
"source": 0
},
{
"begin": 143,
"end": 219,
"name": "tag",
"source": 0,
"value": "9"
},
{
"begin": 143,
"end": 219,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 143,
"end": 219,
"name": "PUSH",
"source": 0,
"value": "40"
},
{
"begin": 143,
"end": 219,
"name": "MLOAD",
"source": 0
},
{
"begin": 143,
"end": 219,
"name": "PUSH [tag]",
"source": 0,
"value": "11"
},
{
"begin": 143,
"end": 219,
"name": "SWAP2",
"source": 0
},
{
"begin": 143,
"end": 219,
"name": "SWAP1",
"source": 0
},
{
"begin": 143,
"end": 219,
"name": "PUSH [tag]",
"source": 0,
"value": "12"
},
{
"begin": 143,
"end": 219,
"jumpType": "[in]",
"name": "JUMP",
"source": 0
},
{
"begin": 143,
"end": 219,
"name": "tag",
"source": 0,
"value": "11"
},
{
"begin": 143,
"end": 219,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 143,
"end": 219,
"name": "PUSH",
"source": 0,
"value": "40"
},
{
"begin": 143,
"end": 219,
"name": "MLOAD",
"source": 0
},
{
"begin": 143,
"end": 219,
"name": "DUP1",
"source": 0
},
{
"begin": 143,
"end": 219,
"name": "SWAP2",
"source": 0
},
{
"begin": 143,
"end": 219,
"name": "SUB",
"source": 0
},
{
"begin": 143,
"end": 219,
"name": "SWAP1",
"source": 0
},
{
"begin": 143,
"end": 219,
"name": "RETURN",
"source": 0
},
{
"begin": 74,
"end": 133,
"name": "tag",
"source": 0,
"value": "8"
},
{
"begin": 74,
"end": 133,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 125,
"end": 126,
"name": "DUP1",
"source": 0
},
{
"begin": 112,
"end": 122,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 112,
"end": 126,
"name": "DUP2",
"source": 0
},
{
"begin": 112,
"end": 126,
"name": "SWAP1",
"source": 0
},
{
"begin": 112,
"end": 126,
"name": "SSTORE",
"source": 0
},
{
"begin": 112,
"end": 126,
"name": "POP",
"source": 0
},
{
"begin": 74,
"end": 133,
"name": "POP",
"source": 0
},
{
"begin": 74,
"end": 133,
"jumpType": "[out]",
"name": "JUMP",
"source": 0
},
{
"begin": 143,
"end": 219,
"name": "tag",
"source": 0,
"value": "10"
},
{
"begin": 143,
"end": 219,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 179,
"end": 183,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 202,
"end": 212,
"name": "DUP1",
"source": 0
},
{
"begin": 202,
"end": 212,
"name": "SLOAD",
"source": 0
},
{
"begin": 195,
"end": 212,
"name": "SWAP1",
"source": 0
},
{
"begin": 195,
"end": 212,
"name": "POP",
"source": 0
},
{
"begin": 143,
"end": 219,
"name": "SWAP1",
"source": 0
},
{
"begin": 143,
"end": 219,
"jumpType": "[out]",
"name": "JUMP",
"source": 0
},
{
"begin": 88,
"end": 205,
"name": "tag",
"source": 1,
"value": "16"
},
{
"begin": 88,
"end": 205,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 197,
"end": 198,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 194,
"end": 195,
"name": "DUP1",
"source": 1
},
{
"begin": 187,
"end": 199,
"name": "REVERT",
"source": 1
},
{
"begin": 334,
"end": 411,
"name": "tag",
"source": 1,
"value": "18"
},
{
"begin": 334,
"end": 411,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 371,
"end": 378,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 400,
"end": 405,
"name": "DUP2",
"source": 1
},
{
"begin": 389,
"end": 405,
"name": "SWAP1",
"source": 1
},
{
"begin": 389,
"end": 405,
"name": "POP",
"source": 1
},
{
"begin": 334,
"end": 411,
"name": "SWAP2",
"source": 1
},
{
"begin": 334,
"end": 411,
"name": "SWAP1",
"source": 1
},
{
"begin": 334,
"end": 411,
"name": "POP",
"source": 1
},
{
"begin": 334,
"end": 411,
"jumpType": "[out]",
"name": "JUMP",
"source": 1
},
{
"begin": 417,
"end": 539,
"name": "tag",
"source": 1,
"value": "19"
},
{
"begin": 417,
"end": 539,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 490,
"end": 514,
"name": "PUSH [tag]",
"source": 1,
"value": "28"
},
{
"begin": 508,
"end": 513,
"name": "DUP2",
"source": 1
},
{
"begin": 490,
"end": 514,
"name": "PUSH [tag]",
"source": 1,
"value": "18"
},
{
"begin": 490,
"end": 514,
"jumpType": "[in]",
"name": "JUMP",
"source": 1
},
{
"begin": 490,
"end": 514,
"name": "tag",
"source": 1,
"value": "28"
},
{
"begin": 490,
"end": 514,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 483,
"end": 488,
"name": "DUP2",
"source": 1
},
{
"begin": 480,
"end": 515,
"name": "EQ",
"source": 1
},
{
"begin": 470,
"end": 533,
"name": "PUSH [tag]",
"source": 1,
"value": "29"
},
{
"begin": 470,
"end": 533,
"name": "JUMPI",
"source": 1
},
{
"begin": 529,
"end": 530,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 526,
"end": 527,
"name": "DUP1",
"source": 1
},
{
"begin": 519,
"end": 531,
"name": "REVERT",
"source": 1
},
{
"begin": 470,
"end": 533,
"name": "tag",
"source": 1,
"value": "29"
},
{
"begin": 470,
"end": 533,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 417,
"end": 539,
"name": "POP",
"source": 1
},
{
"begin": 417,
"end": 539,
"jumpType": "[out]",
"name": "JUMP",
"source": 1
},
{
"begin": 545,
"end": 684,
"name": "tag",
"source": 1,
"value": "20"
},
{
"begin": 545,
"end": 684,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 591,
"end": 596,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 629,
"end": 635,
"name": "DUP2",
"source": 1
},
{
"begin": 616,
"end": 636,
"name": "CALLDATALOAD",
"source": 1
},
{
"begin": 607,
"end": 636,
"name": "SWAP1",
"source": 1
},
{
"begin": 607,
"end": 636,
"name": "POP",
"source": 1
},
{
"begin": 645,
"end": 678,
"name": "PUSH [tag]",
"source": 1,
"value": "31"
},
{
"begin": 672,
"end": 677,
"name": "DUP2",
"source": 1
},
{
"begin": 645,
"end": 678,
"name": "PUSH [tag]",
"source": 1,
"value": "19"
},
{
"begin": 645,
"end": 678,
"jumpType": "[in]",
"name": "JUMP",
"source": 1
},
{
"begin": 645,
"end": 678,
"name": "tag",
"source": 1,
"value": "31"
},
{
"begin": 645,
"end": 678,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 545,
"end": 684,
"name": "SWAP3",
"source": 1
},
{
"begin": 545,
"end": 684,
"name": "SWAP2",
"source": 1
},
{
"begin": 545,
"end": 684,
"name": "POP",
"source": 1
},
{
"begin": 545,
"end": 684,
"name": "POP",
"source": 1
},
{
"begin": 545,
"end": 684,
"jumpType": "[out]",
"name": "JUMP",
"source": 1
},
{
"begin": 690,
"end": 1019,
"name": "tag",
"source": 1,
"value": "7"
},
{
"begin": 690,
"end": 1019,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 749,
"end": 755,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 798,
"end": 800,
"name": "PUSH",
"source": 1,
"value": "20"
},
{
"begin": 786,
"end": 795,
"name": "DUP3",
"source": 1
},
{
"begin": 777,
"end": 784,
"name": "DUP5",
"source": 1
},
{
"begin": 773,
"end": 796,
"name": "SUB",
"source": 1
},
{
"begin": 769,
"end": 801,
"name": "SLT",
"source": 1
},
{
"begin": 766,
"end": 885,
"name": "ISZERO",
"source": 1
},
{
"begin": 766,
"end": 885,
"name": "PUSH [tag]",
"source": 1,
"value": "33"
},
{
"begin": 766,
"end": 885,
"name": "JUMPI",
"source": 1
},
{
"begin": 804,
"end": 883,
"name": "PUSH [tag]",
"source": 1,
"value": "34"
},
{
"begin": 804,
"end": 883,
"name": "PUSH [tag]",
"source": 1,
"value": "16"
},
{
"begin": 804,
"end": 883,
"jumpType": "[in]",
"name": "JUMP",
"source": 1
},
{
"begin": 804,
"end": 883,
"name": "tag",
"source": 1,
"value": "34"
},
{
"begin": 804,
"end": 883,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 766,
"end": 885,
"name": "tag",
"source": 1,
"value": "33"
},
{
"begin": 766,
"end": 885,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 924,
"end": 925,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 949,
"end": 1002,
"name": "PUSH [tag]",
"source": 1,
"value": "35"
},
{
"begin": 994,
"end": 1001,
"name": "DUP5",
"source": 1
},
{
"begin": 985,
"end": 991,
"name": "DUP3",
"source": 1
},
{
"begin": 974,
"end": 983,
"name": "DUP6",
"source": 1
},
{
"begin": 970,
"end": 992,
"name": "ADD",
"source": 1
},
{
"begin": 949,
"end": 1002,
"name": "PUSH [tag]",
"source": 1,
"value": "20"
},
{
"begin": 949,
"end": 1002,
"jumpType": "[in]",
"name": "JUMP",
"source": 1
},
{
"begin": 949,
"end": 1002,
"name": "tag",
"source": 1,
"value": "35"
},
{
"begin": 949,
"end": 1002,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 939,
"end": 1002,
"name": "SWAP2",
"source": 1
},
{
"begin": 939,
"end": 1002,
"name": "POP",
"source": 1
},
{
"begin": 895,
"end": 1012,
"name": "POP",
"source": 1
},
{
"begin": 690,
"end": 1019,
"name": "SWAP3",
"source": 1
},
{
"begin": 690,
"end": 1019,
"name": "SWAP2",
"source": 1
},
{
"begin": 690,
"end": 1019,
"name": "POP",
"source": 1
},
{
"begin": 690,
"end": 1019,
"name": "POP",
"source": 1
},
{
"begin": 690,
"end": 1019,
"jumpType": "[out]",
"name": "JUMP",
"source": 1
},
{
"begin": 1025,
"end": 1143,
"name": "tag",
"source": 1,
"value": "21"
},
{
"begin": 1025,
"end": 1143,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 1112,
"end": 1136,
"name": "PUSH [tag]",
"source": 1,
"value": "37"
},
{
"begin": 1130,
"end": 1135,
"name": "DUP2",
"source": 1
},
{
"begin": 1112,
"end": 1136,
"name": "PUSH [tag]",
"source": 1,
"value": "18"
},
{
"begin": 1112,
"end": 1136,
"jumpType": "[in]",
"name": "JUMP",
"source": 1
},
{
"begin": 1112,
"end": 1136,
"name": "tag",
"source": 1,
"value": "37"
},
{
"begin": 1112,
"end": 1136,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 1107,
"end": 1110,
"name": "DUP3",
"source": 1
},
{
"begin": 1100,
"end": 1137,
"name": "MSTORE",
"source": 1
},
{
"begin": 1025,
"end": 1143,
"name": "POP",
"source": 1
},
{
"begin": 1025,
"end": 1143,
"name": "POP",
"source": 1
},
{
"begin": 1025,
"end": 1143,
"jumpType": "[out]",
"name": "JUMP",
"source": 1
},
{
"begin": 1149,
"end": 1371,
"name": "tag",
"source": 1,
"value": "12"
},
{
"begin": 1149,
"end": 1371,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 1242,
"end": 1246,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 1280,
"end": 1282,
"name": "PUSH",
"source": 1,
"value": "20"
},
{
"begin": 1269,
"end": 1278,
"name": "DUP3",
"source": 1
},
{
"begin": 1265,
"end": 1283,
"name": "ADD",
"source": 1
},
{
"begin": 1257,
"end": 1283,
"name": "SWAP1",
"source": 1
},
{
"begin": 1257,
"end": 1283,
"name": "POP",
"source": 1
},
{
"begin": 1293,
"end": 1364,
"name": "PUSH [tag]",
"source": 1,
"value": "39"
},
{
"begin": 1361,
"end": 1362,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 1350,
"end": 1359,
"name": "DUP4",
"source": 1
},
{
"begin": 1346,
"end": 1363,
"name": "ADD",
"source": 1
},
{
"begin": 1337,
"end": 1343,
"name": "DUP5",
"source": 1
},
{
"begin": 1293,
"end": 1364,
"name": "PUSH [tag]",
"source": 1,
"value": "21"
},
{
"begin": 1293,
"end": 1364,
"jumpType": "[in]",
"name": "JUMP",
"source": 1
},
{
"begin": 1293,
"end": 1364,
"name": "tag",
"source": 1,
"value": "39"
},
{
"begin": 1293,
"end": 1364,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 1149,
"end": 1371,
"name": "SWAP3",
"source": 1
},
{
"begin": 1149,
"end": 1371,
"name": "SWAP2",
"source": 1
},
{
"begin": 1149,
"end": 1371,
"name": "POP",
"source": 1
},
{
"begin": 1149,
"end": 1371,
"name": "POP",
"source": 1
},
{
"begin": 1149,
"end": 1371,
"jumpType": "[out]",
"name": "JUMP",
"source": 1
}
]
}
},
"sourceList": [
"Flip.sol",
"#utility.yul"
]
},
"methodIdentifiers": {
"get()": "6d4ce63c",
"set(uint256)": "60fe47b1"
}
},
"metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"x\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"Flip.sol\":\"Example\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"Flip.sol\":{\"keccak256\":\"0x5be8946b96bdbd71d8bf5177b440c5974aaf8ab4bbb406adfea0d65bb4a11a8b\",\"urls\":[\"bzz-raw://28ea5b35a748fca88fca11b757ae2d3a3b7127a9f33bdde9cf7c5bc1337db3d3\",\"dweb:/ipfs/QmV4DiTMSeYZ2BXEbDVtVUjSxjght2GcdecyMTJRMj8Wuv\"]}},\"version\":1}",
"storageLayout": {
"storage": [
{
"astId": 3,
"contract": "Flip.sol:Example",
"label": "storedData",
"offset": 0,
"slot": "0",
"type": "t_uint256"
}
],
"types": {
"t_uint256": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
}
}
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
}
}
},
"errors": [
{
"component": "general",
"errorCode": "1878",
"formattedMessage": "Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: <SPDX-License>\" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.\n--> Flip.sol\n\n",
"message": "SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: <SPDX-License>\" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.",
"severity": "warning",
"sourceLocation": {
"end": -1,
"file": "Flip.sol",
"start": -1
},
"type": "Warning"
}
],
"sources": {
"Flip.sol": {
"ast": {
"absolutePath": "Flip.sol",
"exportedSymbols": {
"Example": [
22
]
},
"id": 23,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"0.8",
".17"
],
"nodeType": "PragmaDirective",
"src": "0:23:0"
},
{
"abstract": false,
"baseContracts": [],
"canonicalName": "Example",
"contractDependencies": [],
"contractKind": "contract",
"fullyImplemented": true,
"id": 22,
"linearizedBaseContracts": [
22
],
"name": "Example",
"nameLocation": "34:7:0",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 3,
"mutability": "mutable",
"name": "storedData",
"nameLocation": "53:10:0",
"nodeType": "VariableDeclaration",
"scope": 22,
"src": "48:15:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "48:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
},
{
"body": {
"id": 12,
"nodeType": "Block",
"src": "102:31:0",
"statements": [
{
"expression": {
"id": 10,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 8,
"name": "storedData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "112:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"id": 9,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5,
"src": "125:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "112:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 11,
"nodeType": "ExpressionStatement",
"src": "112:14:0"
}
]
},
"functionSelector": "60fe47b1",
"id": 13,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "set",
"nameLocation": "83:3:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 6,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5,
"mutability": "mutable",
"name": "x",
"nameLocation": "92:1:0",
"nodeType": "VariableDeclaration",
"scope": 13,
"src": "87:6:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "87:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "86:8:0"
},
"returnParameters": {
"id": 7,
"nodeType": "ParameterList",
"parameters": [],
"src": "102:0:0"
},
"scope": 22,
"src": "74:59:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 20,
"nodeType": "Block",
"src": "185:34:0",
"statements": [
{
"expression": {
"id": 18,
"name": "storedData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "202:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 17,
"id": 19,
"nodeType": "Return",
"src": "195:17:0"
}
]
},
"functionSelector": "6d4ce63c",
"id": 21,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "get",
"nameLocation": "152:3:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 14,
"nodeType": "ParameterList",
"parameters": [],
"src": "155:2:0"
},
"returnParameters": {
"id": 17,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 21,
"src": "179:4:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "179:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "178:6:0"
},
"scope": 22,
"src": "143:76:0",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
}
],
"scope": 23,
"src": "25:196:0",
"usedErrors": []
}
],
"src": "0:221:0"
},
"id": 0
}
}
}
}
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
"ropsten:3": {
"linkReferences": {},
"autoDeployLib": true
},
"rinkeby:4": {
"linkReferences": {},
"autoDeployLib": true
},
"kovan:42": {
"linkReferences": {},
"autoDeployLib": true
},
"goerli:5": {
"linkReferences": {},
"autoDeployLib": true
},
"Custom": {
"linkReferences": {},
"autoDeployLib": true
}
},
"data": {
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "608060405234801561001057600080fd5b50610150806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806360fe47b11461003b5780636d4ce63c14610057575b600080fd5b610055600480360381019061005091906100c3565b610075565b005b61005f61007f565b60405161006c91906100ff565b60405180910390f35b8060008190555050565b60008054905090565b600080fd5b6000819050919050565b6100a08161008d565b81146100ab57600080fd5b50565b6000813590506100bd81610097565b92915050565b6000602082840312156100d9576100d8610088565b5b60006100e7848285016100ae565b91505092915050565b6100f98161008d565b82525050565b600060208201905061011460008301846100f0565b9291505056fea2646970667358221220e870b662a32cdabdc34dd10e9b370fd188ec08cdcde088a7bdc6d4649974438764736f6c63430008110033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x150 DUP1 PUSH2 0x20 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x36 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x60FE47B1 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x6D4CE63C EQ PUSH2 0x57 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x55 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x50 SWAP2 SWAP1 PUSH2 0xC3 JUMP JUMPDEST PUSH2 0x75 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x5F PUSH2 0x7F JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x6C SWAP2 SWAP1 PUSH2 0xFF JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST DUP1 PUSH1 0x0 DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0xA0 DUP2 PUSH2 0x8D JUMP JUMPDEST DUP2 EQ PUSH2 0xAB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xBD DUP2 PUSH2 0x97 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xD9 JUMPI PUSH2 0xD8 PUSH2 0x88 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0xE7 DUP5 DUP3 DUP6 ADD PUSH2 0xAE JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0xF9 DUP2 PUSH2 0x8D JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x114 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0xF0 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xE8 PUSH17 0xB662A32CDABDC34DD10E9B370FD188EC08 0xCD 0xCD 0xE0 DUP9 0xA7 0xBD 0xC6 0xD4 PUSH5 0x9974438764 PUSH20 0x6F6C634300081100330000000000000000000000 ",
"sourceMap": "25:196:0:-:0;;;;;;;;;;;;;;;;;;;"
},
"deployedBytecode": {
"functionDebugData": {
"@get_21": {
"entryPoint": 127,
"id": 21,
"parameterSlots": 0,
"returnSlots": 1
},
"@set_13": {
"entryPoint": 117,
"id": 13,
"parameterSlots": 1,
"returnSlots": 0
},
"abi_decode_t_uint256": {
"entryPoint": 174,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"abi_decode_tuple_t_uint256": {
"entryPoint": 195,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"abi_encode_t_uint256_to_t_uint256_fromStack": {
"entryPoint": 240,
"id": null,
"parameterSlots": 2,
"returnSlots": 0
},
"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed": {
"entryPoint": 255,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"allocate_unbounded": {
"entryPoint": null,
"id": null,
"parameterSlots": 0,
"returnSlots": 1
},
"cleanup_t_uint256": {
"entryPoint": 141,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db": {
"entryPoint": null,
"id": null,
"parameterSlots": 0,
"returnSlots": 0
},
"revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b": {
"entryPoint": 136,
"id": null,
"parameterSlots": 0,
"returnSlots": 0
},
"validator_revert_t_uint256": {
"entryPoint": 151,
"id": null,
"parameterSlots": 1,
"returnSlots": 0
}
},
"generatedSources": [
{
"ast": {
"nodeType": "YulBlock",
"src": "0:1374:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "47:35:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "57:19:1",
"value": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "73:2:1",
"type": "",
"value": "64"
}
],
"functionName": {
"name": "mload",
"nodeType": "YulIdentifier",
"src": "67:5:1"
},
"nodeType": "YulFunctionCall",
"src": "67:9:1"
},
"variableNames": [
{
"name": "memPtr",
"nodeType": "YulIdentifier",
"src": "57:6:1"
}
]
}
]
},
"name": "allocate_unbounded",
"nodeType": "YulFunctionDefinition",
"returnVariables": [
{
"name": "memPtr",
"nodeType": "YulTypedName",
"src": "40:6:1",
"type": ""
}
],
"src": "7:75:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "177:28:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "194:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "197:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "187:6:1"
},
"nodeType": "YulFunctionCall",
"src": "187:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "187:12:1"
}
]
},
"name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b",
"nodeType": "YulFunctionDefinition",
"src": "88:117:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "300:28:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "317:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "320:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "310:6:1"
},
"nodeType": "YulFunctionCall",
"src": "310:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "310:12:1"
}
]
},
"name": "revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db",
"nodeType": "YulFunctionDefinition",
"src": "211:117:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "379:32:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "389:16:1",
"value": {
"name": "value",
"nodeType": "YulIdentifier",
"src": "400:5:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "389:7:1"
}
]
}
]
},
"name": "cleanup_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "361:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "371:7:1",
"type": ""
}
],
"src": "334:77:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "460:79:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "517:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "526:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "529:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "519:6:1"
},
"nodeType": "YulFunctionCall",
"src": "519:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "519:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "483:5:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "508:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "490:17:1"
},
"nodeType": "YulFunctionCall",
"src": "490:24:1"
}
],
"functionName": {
"name": "eq",
"nodeType": "YulIdentifier",
"src": "480:2:1"
},
"nodeType": "YulFunctionCall",
"src": "480:35:1"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "473:6:1"
},
"nodeType": "YulFunctionCall",
"src": "473:43:1"
},
"nodeType": "YulIf",
"src": "470:63:1"
}
]
},
"name": "validator_revert_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "453:5:1",
"type": ""
}
],
"src": "417:122:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "597:87:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "607:29:1",
"value": {
"arguments": [
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "629:6:1"
}
],
"functionName": {
"name": "calldataload",
"nodeType": "YulIdentifier",
"src": "616:12:1"
},
"nodeType": "YulFunctionCall",
"src": "616:20:1"
},
"variableNames": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "607:5:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "672:5:1"
}
],
"functionName": {
"name": "validator_revert_t_uint256",
"nodeType": "YulIdentifier",
"src": "645:26:1"
},
"nodeType": "YulFunctionCall",
"src": "645:33:1"
},
"nodeType": "YulExpressionStatement",
"src": "645:33:1"
}
]
},
"name": "abi_decode_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "575:6:1",
"type": ""
},
{
"name": "end",
"nodeType": "YulTypedName",
"src": "583:3:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "591:5:1",
"type": ""
}
],
"src": "545:139:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "756:263:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "802:83:1",
"statements": [
{
"expression": {
"arguments": [],
"functionName": {
"name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b",
"nodeType": "YulIdentifier",
"src": "804:77:1"
},
"nodeType": "YulFunctionCall",
"src": "804:79:1"
},
"nodeType": "YulExpressionStatement",
"src": "804:79:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "777:7:1"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "786:9:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "773:3:1"
},
"nodeType": "YulFunctionCall",
"src": "773:23:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "798:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "slt",
"nodeType": "YulIdentifier",
"src": "769:3:1"
},
"nodeType": "YulFunctionCall",
"src": "769:32:1"
},
"nodeType": "YulIf",
"src": "766:119:1"
},
{
"nodeType": "YulBlock",
"src": "895:117:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "910:15:1",
"value": {
"kind": "number",
"nodeType": "YulLiteral",
"src": "924:1:1",
"type": "",
"value": "0"
},
"variables": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "914:6:1",
"type": ""
}
]
},
{
"nodeType": "YulAssignment",
"src": "939:63:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "974:9:1"
},
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "985:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "970:3:1"
},
"nodeType": "YulFunctionCall",
"src": "970:22:1"
},
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "994:7:1"
}
],
"functionName": {
"name": "abi_decode_t_uint256",
"nodeType": "YulIdentifier",
"src": "949:20:1"
},
"nodeType": "YulFunctionCall",
"src": "949:53:1"
},
"variableNames": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "939:6:1"
}
]
}
]
}
]
},
"name": "abi_decode_tuple_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "726:9:1",
"type": ""
},
{
"name": "dataEnd",
"nodeType": "YulTypedName",
"src": "737:7:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "749:6:1",
"type": ""
}
],
"src": "690:329:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1090:53:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "1107:3:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1130:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "1112:17:1"
},
"nodeType": "YulFunctionCall",
"src": "1112:24:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1100:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1100:37:1"
},
"nodeType": "YulExpressionStatement",
"src": "1100:37:1"
}
]
},
"name": "abi_encode_t_uint256_to_t_uint256_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1078:5:1",
"type": ""
},
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "1085:3:1",
"type": ""
}
],
"src": "1025:118:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1247:124:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1257:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1269:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1280:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1265:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1265:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "1257:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "1337:6:1"
},
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1350:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1361:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1346:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1346:17:1"
}
],
"functionName": {
"name": "abi_encode_t_uint256_to_t_uint256_fromStack",
"nodeType": "YulIdentifier",
"src": "1293:43:1"
},
"nodeType": "YulFunctionCall",
"src": "1293:71:1"
},
"nodeType": "YulExpressionStatement",
"src": "1293:71:1"
}
]
},
"name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "1219:9:1",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "1231:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "1242:4:1",
"type": ""
}
],
"src": "1149:222:1"
}
]
},
"contents": "{\n\n function allocate_unbounded() -> memPtr {\n memPtr := mload(64)\n }\n\n function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {\n revert(0, 0)\n }\n\n function revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() {\n revert(0, 0)\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function validator_revert_t_uint256(value) {\n if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }\n }\n\n function abi_decode_t_uint256(offset, end) -> value {\n value := calldataload(offset)\n validator_revert_t_uint256(value)\n }\n\n function abi_decode_tuple_t_uint256(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_uint256(add(headStart, offset), dataEnd)\n }\n\n }\n\n function abi_encode_t_uint256_to_t_uint256_fromStack(value, pos) {\n mstore(pos, cleanup_t_uint256(value))\n }\n\n function abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed(headStart , value0) -> tail {\n tail := add(headStart, 32)\n\n abi_encode_t_uint256_to_t_uint256_fromStack(value0, add(headStart, 0))\n\n }\n\n}\n",
"id": 1,
"language": "Yul",
"name": "#utility.yul"
}
],
"immutableReferences": {},
"linkReferences": {},
"object": "608060405234801561001057600080fd5b50600436106100365760003560e01c806360fe47b11461003b5780636d4ce63c14610057575b600080fd5b610055600480360381019061005091906100c3565b610075565b005b61005f61007f565b60405161006c91906100ff565b60405180910390f35b8060008190555050565b60008054905090565b600080fd5b6000819050919050565b6100a08161008d565b81146100ab57600080fd5b50565b6000813590506100bd81610097565b92915050565b6000602082840312156100d9576100d8610088565b5b60006100e7848285016100ae565b91505092915050565b6100f98161008d565b82525050565b600060208201905061011460008301846100f0565b9291505056fea2646970667358221220e870b662a32cdabdc34dd10e9b370fd188ec08cdcde088a7bdc6d4649974438764736f6c63430008110033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x36 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x60FE47B1 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x6D4CE63C EQ PUSH2 0x57 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x55 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x50 SWAP2 SWAP1 PUSH2 0xC3 JUMP JUMPDEST PUSH2 0x75 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x5F PUSH2 0x7F JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x6C SWAP2 SWAP1 PUSH2 0xFF JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST DUP1 PUSH1 0x0 DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0xA0 DUP2 PUSH2 0x8D JUMP JUMPDEST DUP2 EQ PUSH2 0xAB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xBD DUP2 PUSH2 0x97 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xD9 JUMPI PUSH2 0xD8 PUSH2 0x88 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0xE7 DUP5 DUP3 DUP6 ADD PUSH2 0xAE JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0xF9 DUP2 PUSH2 0x8D JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x114 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0xF0 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xE8 PUSH17 0xB662A32CDABDC34DD10E9B370FD188EC08 0xCD 0xCD 0xE0 DUP9 0xA7 0xBD 0xC6 0xD4 PUSH5 0x9974438764 PUSH20 0x6F6C634300081100330000000000000000000000 ",
"sourceMap": "25:196:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;74:59;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;143:76;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;74:59;125:1;112:10;:14;;;;74:59;:::o;143:76::-;179:4;202:10;;195:17;;143:76;:::o;88:117:1:-;197:1;194;187:12;334:77;371:7;400:5;389:16;;334:77;;;:::o;417:122::-;490:24;508:5;490:24;:::i;:::-;483:5;480:35;470:63;;529:1;526;519:12;470:63;417:122;:::o;545:139::-;591:5;629:6;616:20;607:29;;645:33;672:5;645:33;:::i;:::-;545:139;;;;:::o;690:329::-;749:6;798:2;786:9;777:7;773:23;769:32;766:119;;;804:79;;:::i;:::-;766:119;924:1;949:53;994:7;985:6;974:9;970:22;949:53;:::i;:::-;939:63;;895:117;690:329;;;;:::o;1025:118::-;1112:24;1130:5;1112:24;:::i;:::-;1107:3;1100:37;1025:118;;:::o;1149:222::-;1242:4;1280:2;1269:9;1265:18;1257:26;;1293:71;1361:1;1350:9;1346:17;1337:6;1293:71;:::i;:::-;1149:222;;;;:::o"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "67200",
"executionCost": "117",
"totalCost": "67317"
},
"external": {
"get()": "2437",
"set(uint256)": "22498"
}
},
"methodIdentifiers": {
"get()": "6d4ce63c",
"set(uint256)": "60fe47b1"
}
},
"abi": [
{
"inputs": [],
"name": "get",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "x",
"type": "uint256"
}
],
"name": "set",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.17+commit.8df45f5f"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [],
"name": "get",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "x",
"type": "uint256"
}
],
"name": "set",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"Flip.sol": "Example"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"Flip.sol": {
"keccak256": "0x5be8946b96bdbd71d8bf5177b440c5974aaf8ab4bbb406adfea0d65bb4a11a8b",
"urls": [
"bzz-raw://28ea5b35a748fca88fca11b757ae2d3a3b7127a9f33bdde9cf7c5bc1337db3d3",
"dweb:/ipfs/QmV4DiTMSeYZ2BXEbDVtVUjSxjght2GcdecyMTJRMj8Wuv"
]
}
},
"version": 1
}
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
* @custom:dev-run-script ./scripts/deploy_with_ethers.ts
*/
contract Storage {
uint256 number;
/**
* @dev Store value in variable
* @param num value to store
*/
function store(uint256 num) public {
number = num;
}
/**
* @dev Return value
* @return value of 'number'
*/
function retrieve() public view returns (uint256){
return number;
}
}
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
import "hardhat/console.sol";
/**
* @title Owner
* @dev Set & change owner
*/
contract Owner {
address private owner;
// event for EVM logging
event OwnerSet(address indexed oldOwner, address indexed newOwner);
// modifier to check if caller is owner
modifier isOwner() {
// If the first argument of 'require' evaluates to 'false', execution terminates and all
// changes to the state and to Ether balances are reverted.
// This used to consume all gas in old EVM versions, but not anymore.
// It is often a good idea to use 'require' to check if functions are called correctly.
// As a second argument, you can also provide an explanation about what went wrong.
require(msg.sender == owner, "Caller is not owner");
_;
}
/**
* @dev Set contract deployer as owner
*/
constructor() {
console.log("Owner contract deployed by:", msg.sender);
owner = msg.sender; // 'msg.sender' is sender of current call, contract deployer for a constructor
emit OwnerSet(address(0), owner);
}
/**
* @dev Change owner
* @param newOwner address of new owner
*/
function changeOwner(address newOwner) public isOwner {
emit OwnerSet(owner, newOwner);
owner = newOwner;
}
/**
* @dev Return owner address
* @return address of owner
*/
function getOwner() external view returns (address) {
return owner;
}
}
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Ballot
* @dev Implements voting process along with vote delegation
*/
contract Ballot {
struct Voter {
uint weight; // weight is accumulated by delegation
bool voted; // if true, that person already voted
address delegate; // person delegated to
uint vote; // index of the voted proposal
}
struct Proposal {
// If you can limit the length to a certain number of bytes,
// always use one of bytes1 to bytes32 because they are much cheaper
bytes32 name; // short name (up to 32 bytes)
uint voteCount; // number of accumulated votes
}
address public chairperson;
mapping(address => Voter) public voters;
Proposal[] public proposals;
/**
* @dev Create a new ballot to choose one of 'proposalNames'.
* @param proposalNames names of proposals
*/
constructor(bytes32[] memory proposalNames) {
chairperson = msg.sender;
voters[chairperson].weight = 1;
for (uint i = 0; i < proposalNames.length; i++) {
// 'Proposal({...})' creates a temporary
// Proposal object and 'proposals.push(...)'
// appends it to the end of 'proposals'.
proposals.push(Proposal({
name: proposalNames[i],
voteCount: 0
}));
}
}
/**
* @dev Give 'voter' the right to vote on this ballot. May only be called by 'chairperson'.
* @param voter address of voter
*/
function giveRightToVote(address voter) public {
require(
msg.sender == chairperson,
"Only chairperson can give right to vote."
);
require(
!voters[voter].voted,
"The voter already voted."
);
require(voters[voter].weight == 0);
voters[voter].weight = 1;
}
/**
* @dev Delegate your vote to the voter 'to'.
* @param to address to which vote is delegated
*/
function delegate(address to) public {
Voter storage sender = voters[msg.sender];
require(!sender.voted, "You already voted.");
require(to != msg.sender, "Self-delegation is disallowed.");
while (voters[to].delegate != address(0)) {
to = voters[to].delegate;
// We found a loop in the delegation, not allowed.
require(to != msg.sender, "Found loop in delegation.");
}
sender.voted = true;
sender.delegate = to;
Voter storage delegate_ = voters[to];
if (delegate_.voted) {
// If the delegate already voted,
// directly add to the number of votes
proposals[delegate_.vote].voteCount += sender.weight;
} else {
// If the delegate did not vote yet,
// add to her weight.
delegate_.weight += sender.weight;
}
}
/**
* @dev Give your vote (including votes delegated to you) to proposal 'proposals[proposal].name'.
* @param proposal index of proposal in the proposals array
*/
function vote(uint proposal) public {
Voter storage sender = voters[msg.sender];
require(sender.weight != 0, "Has no right to vote");
require(!sender.voted, "Already voted.");
sender.voted = true;
sender.vote = proposal;
// If 'proposal' is out of the range of the array,
// this will throw automatically and revert all
// changes.
proposals[proposal].voteCount += sender.weight;
}
/**
* @dev Computes the winning proposal taking all previous votes into account.
* @return winningProposal_ index of winning proposal in the proposals array
*/
function winningProposal() public view
returns (uint winningProposal_)
{
uint winningVoteCount = 0;
for (uint p = 0; p < proposals.length; p++) {
if (proposals[p].voteCount > winningVoteCount) {
winningVoteCount = proposals[p].voteCount;
winningProposal_ = p;
}
}
}
/**
* @dev Calls winningProposal() function to get the index of the winner contained in the proposals array and then
* @return winnerName_ the name of the winner
*/
function winnerName() public view
returns (bytes32 winnerName_)
{
winnerName_ = proposals[winningProposal()].name;
}
}
pragma solidity 0.8.17;
contract Example {
uint storedData;
function set(uint x) public {
storedData = x;
}
function get() public view returns (uint) {
return storedData;
}
}
// This script can be used to deploy the "Storage" contract using ethers.js library.
// Please make sure to compile "./contracts/1_Storage.sol" file before running this script.
// And use Right click -> "Run" from context menu of the file to run the script. Shortcut: Ctrl+Shift+S
import { deploy } from './ethers-lib'
(async () => {
try {
const result = await deploy('Storage', [])
console.log(`address: ${result.address}`)
} catch (e) {
console.log(e.message)
}
})()
// This script can be used to deploy the "Storage" contract using Web3 library.
// Please make sure to compile "./contracts/1_Storage.sol" file before running this script.
// And use Right click -> "Run" from context menu of the file to run the script. Shortcut: Ctrl+Shift+S
import { deploy } from './web3-lib'
(async () => {
try {
const result = await deploy('Storage', [])
console.log(`address: ${result.address}`)
} catch (e) {
console.log(e.message)
}
})()
import { ethers } from 'ethers'
/**
* Deploy the given contract
* @param {string} contractName name of the contract to deploy
* @param {Array<any>} args list of constructor' parameters
* @param {Number} accountIndex account index from the exposed account
* @return {Contract} deployed contract
*/
export const deploy = async (contractName: string, args: Array<any>, accountIndex?: number): Promise<ethers.Contract> => {
console.log(`deploying ${contractName}`)
// Note that the script needs the ABI which is generated from the compilation artifact.
// Make sure contract is compiled and artifacts are generated
const artifactsPath = `browser/contracts/artifacts/${contractName}.json` // Change this for different path
const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath))
// 'web3Provider' is a remix global variable object
const signer = (new ethers.providers.Web3Provider(web3Provider)).getSigner(accountIndex)
const factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer)
const contract = await factory.deploy(...args)
// The contract is NOT deployed yet; we must wait until it is mined
await contract.deployed()
return contract
}
import Web3 from 'web3'
import { Contract, ContractSendMethod, Options } from 'web3-eth-contract'
/**
* Deploy the given contract
* @param {string} contractName name of the contract to deploy
* @param {Array<any>} args list of constructor' parameters
* @param {string} from account used to send the transaction
* @param {number} gas gas limit
* @return {Options} deployed contract
*/
export const deploy = async (contractName: string, args: Array<any>, from?: string, gas?: number): Promise<Options> => {
const web3 = new Web3(web3Provider)
console.log(`deploying ${contractName}`)
// Note that the script needs the ABI which is generated from the compilation artifact.
// Make sure contract is compiled and artifacts are generated
const artifactsPath = `browser/contracts/artifacts/${contractName}.json`
const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath))
const accounts = await web3.eth.getAccounts()
const contract: Contract = new web3.eth.Contract(metadata.abi)
const contractSend: ContractSendMethod = contract.deploy({
data: metadata.data.bytecode.object,
arguments: args
})
const newContractInstance = await contractSend.send({
from: from || accounts[0],
gas: gas || 1500000
})
return newContractInstance.options
}
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
import "remix_tests.sol"; // this import is automatically injected by Remix.
import "hardhat/console.sol";
import "../contracts/3_Ballot.sol";
contract BallotTest {
bytes32[] proposalNames;
Ballot ballotToTest;
function beforeAll () public {
proposalNames.push(bytes32("candidate1"));
ballotToTest = new Ballot(proposalNames);
}
function checkWinningProposal () public {
console.log("Running checkWinningProposal");
ballotToTest.vote(0);
Assert.equal(ballotToTest.winningProposal(), uint(0), "proposal at index 0 should be the winning proposal");
Assert.equal(ballotToTest.winnerName(), bytes32("candidate1"), "candidate1 should be the winner name");
}
function checkWinninProposalWithReturnValue () public view returns (bool) {
return ballotToTest.winningProposal() == 0;
}
}
// Right click on the script name and hit "Run" to execute
const { expect } = require("chai");
const { ethers } = require("hardhat");
describe("Storage", function () {
it("test initial value", async function () {
const Storage = await ethers.getContractFactory("Storage");
const storage = await Storage.deploy();
await storage.deployed();
console.log('storage deployed at:'+ storage.address)
expect((await storage.retrieve()).toNumber()).to.equal(0);
});
it("test updating and retrieving updated value", async function () {
const Storage = await ethers.getContractFactory("Storage");
const storage = await Storage.deploy();
await storage.deployed();
const storage2 = await ethers.getContractAt("Storage", storage.address);
const setValue = await storage2.store(56);
await setValue.wait();
expect((await storage2.retrieve()).toNumber()).to.equal(56);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment