diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 75b4afaaaac..707c380b6e0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -102,7 +102,7 @@ jobs: with: node-version: 14.x - name: Check with Prettier - run: npx prettier --check --ignore-path .gitignore '**/*.(yml|js|ts|json)' + run: npx prettier --check --ignore-path .gitignore '**/*.(yml|js|ts|json)' ####### Building and Testing binaries ####### @@ -176,7 +176,7 @@ jobs: npm install cd ../tests npm install - npm run test; + npm run test -- -j $(($(nproc) / 2)); - name: Save parachain binary run: | mkdir -p build diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000000..488681a2c2d --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,54 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "lldb", + "request": "launch", + "name": "Build & Launch Moonbeam Node (Linux)", + "preLaunchTask": "Build Moonbeam (debug symbols)", + "program": "${workspaceFolder}/target/release/moonbeam", + "args": [ + "--execution=Native", + "--no-telemetry", + "--no-prometheus", + "--dev", + "--ethapi=txpool,debug,trace", + "--sealing=manual", + "-linfo", + "--port=${dbgconfig:port_p2p}", + "--rpc-port=${dbgconfig:port_rpc}", + "--ws-port=${dbgconfig:port_ws}", + "--tmp" + ], + "cwd": "${workspaceFolder}", + "sourceLanguages": ["rust"], + "sourceMap": { + "/rustc/*": "${dbgconfig:rustc_path}" + } + }, + { + "type": "lldb", + "request": "launch", + "name": "Launch Moonbeam Node (Linux)", + "program": "${workspaceFolder}/target/release/moonbeam", + "args": [ + "--execution=Native", + "--no-telemetry", + "--no-prometheus", + "--dev", + "--ethapi=txpool,debug,trace", + "--sealing=manual", + "-linfo", + "--port=${dbgconfig:port_p2p}", + "--rpc-port=${dbgconfig:port_rpc}", + "--ws-port=${dbgconfig:port_ws}", + "--tmp" + ], + "cwd": "${workspaceFolder}", + "sourceLanguages": ["rust"], + "sourceMap": { + "/rustc/*": "${dbgconfig:rustc_path}" + } + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 07c5d0ae143..bde30ef40d4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,5 +12,11 @@ }, "[yaml]": { "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "lldb.dbgconfig": { + "rustc_path": "${env:HOME}/.rustup/toolchains/nightly-2021-01-13-x86_64-unknown-linux-gnu/lib/rustlib/src/rust", + "port_p2p": 19931, + "port_rpc": 19932, + "port_ws": 19933 } } diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000000..c4296e0efea --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,23 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Build Moonbeam (debug symbols)", + "type": "shell", + "command": "RUSTFLAGS=-g cargo build --release", + "presentation": { + "reveal": "always", + "panel": "new" + } + }, + { + "label": "Run single test file in debug mode", + "type": "shell", + "command": "cd tests && DEBUG_MODE=true npm run test-single", + "presentation": { + "reveal": "always", + "panel": "new" + } + } + ] +} diff --git a/Cargo.toml b/Cargo.toml index ba5755c5cea..86a1c0480e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,4 +6,3 @@ members = [ [profile.release] panic = 'unwind' -opt-level = 0 diff --git a/tests/README.md b/tests/README.md index fdac43d323c..13cddee3a26 100644 --- a/tests/README.md +++ b/tests/README.md @@ -27,6 +27,15 @@ and to print more information: npm run test-with-logs ``` +## Write Tests + +### Add a new contract + +- Add contract source code to `contracts/sources.ts` +- Run `npm run pre-build-contracts`=> This will generate the necessary abi and byte code +- Create your contract with + `const { contract, rawTx } = await createContract(context.web3, "TestContract");` + ## Verbose mode You can also add the node's logs to the output using the `MOONBEAM_LOG` env variable. Ex: @@ -35,5 +44,52 @@ You can also add the node's logs to the output using the `MOONBEAM_LOG` env vari MOONBEAM_LOG="warn,rpc=trace" npm run test ``` -The Moonbeam node will be listening for RPC on port 19933, mostly to avoid -conflicts with already running Substrate nodes. +The test script will find available ports above 20000 in order to ensure that it doesn't conflict +with any other running services. + +# Debugging a Moonbeam node + +The repository contains a pre-configured debugger configuration for VSCode with the **CodeLLDB** +(`vadimcn.vscode-lldb`) extension. + +Before debugging, you need to build the node with debug symbols with command +`RUSTFLAGS=-g cargo build --release` (available as a VSCode task). Then go in the **Debug** tab in +the left bar of VSCode and make sure **Launch Moonbeam Node (Linux)** is selected in the top +dropdown. **Build & Launch Moonbeam Node (Linux)** will trigger the build before launching the node. + +To launch the debug session click on the green "play" arrow next to the dropdown. It will take some +time before the node starts, but the terminal containing the node output will appear when it is +really starting. The node is listening on ports 19931 (p2p), 19932 (rpc) and 19933 (ws). + +You can explore the code and place a breakpoint on a line by left clicking on the left of the line +number. The execution will pause the next time this line is reached. The debug toolbar contains the +following buttons : + +- Resume/Pause : Resume the execution if paused, pause the execution at the current location + (pretty random) if running. +- Step over : Resume the execution until next line, or go one level up if the end of the current + scope is reached. +- Step into : Resume the execution to go inside the immediatly next function call if any, otherwise + step to next line. +- Step out : Resume the execution until the end of the scope is reached. +- Restart : Kill the program and start a new debuging session. +- Stop : Kill the program and end debugin session. + +Breakpoints stay between debugging sessions. When multiple function calls are made on the same line, +multiple step into, step out, step into, ... can be requiered to go inside one of the chained +calls. + +When paused, content of variables is showed in the debuging tab of VSCode. Some basic types are +displayed correctly (primitive types, Vec, Arc) but more complex types such as HashMap/BTreeMap +are not "smartly" displayed (content of the struct is shown by mapping is hidden in the complexity +of the implementation). + +## Running Typescript tests with a debug node + +By setting the environement variable `DEBUG_MODE=true`, the Typescript tests will not spawn its +own node and instead will connect to an external node running on ports 19931/19932/19933, which +are the ports used by the debug node. + +A VSCode test allow to quickly run the `test-single` test in debug mode. To run another test, +change the command in the `package.json`. Note that you should restart the node after running +one test file. \ No newline at end of file diff --git a/tests/contracts/compiled/Bn128Addition.json b/tests/contracts/compiled/Bn128Addition.json new file mode 100644 index 00000000000..9f13f5f80c6 --- /dev/null +++ b/tests/contracts/compiled/Bn128Addition.json @@ -0,0 +1,2076 @@ +{ + "byteCode": "0x608060405234801561001057600080fd5b5060008060405180608001604052807f2243525c5efd4b9c3d3c45ac0ca3fe4dd85e830a4ce6b65fa1eeaee20283970381526020017f301d1d33be6da8e509df21cc35964723180eed7532537db9ae5e7d48f195c91581526020017f18b18acfb4c2c30276db5411368e7185b311dd124691610c5d3b74034e093dc981526020017f063c909c4720840cb5134cb9f59fa749755796819658d32efc0d288198f3726681525090506100bf610257565b60408160808460006006600019f192508261010f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610106906102bf565b60405180910390fd5b7f2bd3e6d0f3b142924f5ca7b49ce5b9d54c4703d7ae5648e61d02268b1a0a9fb78160006002811061016a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151146101af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101a6906102df565b60405180910390fd5b7f21611ce0a6af85915e2f1d70300909ce2e49dfad4a4619c8390cae66cefdb2048160016002811061020a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201511461024f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610246906102df565b60405180910390fd5b505050610362565b6040518060400160405280600290602082028036833780820191505090505090565b6000610286601e836102ff565b915061029182610310565b602082019050919050565b60006102a96006836102ff565b91506102b482610339565b602082019050919050565b600060208201905081810360008301526102d881610279565b9050919050565b600060208201905081810360008301526102f88161029c565b9050919050565b600082825260208201905092915050565b7f656c6c6970746963206375727665206164646974696f6e206661696c65640000600082015250565b7f6661696c65640000000000000000000000000000000000000000000000000000600082015250565b603f806103706000396000f3fe6080604052600080fdfea2646970667358221220a18633c4ec2f5fd19918720cc9181bf53e954372785d2b34c64298c5275b4d5264736f6c63430008030033", + "contract": { + "abi": [ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" } + ], + "devdoc": { "kind": "dev", "methods": {}, "version": 1 }, + "evm": { + "assembly": " /* \"main.sol\":34:1326 contract Bn128Addition{... */\n mstore(0x40, 0x80)\n /* \"main.sol\":66:1320 constructor() {... */\n callvalue\n dup1\n iszero\n tag_1\n jumpi\n 0x00\n dup1\n revert\ntag_1:\n pop\n /* \"main.sol\":94:106 bool success */\n 0x00\n /* \"main.sol\":120:143 uint256[4] memory input */\n dup1\n /* \"main.sol\":120:496 uint256[4] memory input = [... */\n mload(0x40)\n dup1\n 0x80\n add\n 0x40\n mstore\n dup1\n /* \"main.sol\":164:230 0x2243525c5efd4b9c3d3c45ac0ca3fe4dd85e830a4ce6b65fa1eeaee202839703 */\n 0x2243525c5efd4b9c3d3c45ac0ca3fe4dd85e830a4ce6b65fa1eeaee202839703\n /* \"main.sol\":120:496 uint256[4] memory input = [... */\n dup2\n mstore\n 0x20\n add\n /* \"main.sol\":248:314 0x301d1d33be6da8e509df21cc35964723180eed7532537db9ae5e7d48f195c915 */\n 0x301d1d33be6da8e509df21cc35964723180eed7532537db9ae5e7d48f195c915\n /* \"main.sol\":120:496 uint256[4] memory input = [... */\n dup2\n mstore\n 0x20\n add\n /* \"main.sol\":332:398 0x18b18acfb4c2c30276db5411368e7185b311dd124691610c5d3b74034e093dc9 */\n 0x18b18acfb4c2c30276db5411368e7185b311dd124691610c5d3b74034e093dc9\n /* \"main.sol\":120:496 uint256[4] memory input = [... */\n dup2\n mstore\n 0x20\n add\n /* \"main.sol\":416:482 0x063c909c4720840cb5134cb9f59fa749755796819658d32efc0d288198f37266 */\n 0x063c909c4720840cb5134cb9f59fa749755796819658d32efc0d288198f37266\n /* \"main.sol\":120:496 uint256[4] memory input = [... */\n dup2\n mstore\n pop\n swap1\n pop\n /* \"main.sol\":510:534 uint256[2] memory result */\n tag_4\n tag_5\n jump\t// in\ntag_4:\n /* \"main.sol\":915:917 64 */\n 0x40\n /* \"main.sol\":907:913 result */\n dup2\n /* \"main.sol\":902:905 128 */\n 0x80\n /* \"main.sol\":895:900 input */\n dup5\n /* \"main.sol\":892:893 0 */\n 0x00\n /* \"main.sol\":886:890 0x06 */\n 0x06\n /* \"main.sol\":882:883 0 */\n 0x00\n /* \"main.sol\":878:884 not(0) */\n not\n /* \"main.sol\":873:918 call(not(0), 0x06, 0, input, 128, result, 64) */\n call\n /* \"main.sol\":862:918 success := call(not(0), 0x06, 0, input, 128, result, 64) */\n swap3\n pop\n /* \"main.sol\":953:960 success */\n dup3\n /* \"main.sol\":945:995 require(success, \"elliptic curve addition failed\") */\n tag_6\n jumpi\n mload(0x40)\n 0x08c379a000000000000000000000000000000000000000000000000000000000\n dup2\n mstore\n 0x04\n add\n tag_7\n swap1\n tag_8\n jump\t// in\ntag_7:\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n revert\ntag_6:\n /* \"main.sol\":1063:1129 0x2bd3e6d0f3b142924f5ca7b49ce5b9d54c4703d7ae5648e61d02268b1a0a9fb7 */\n 0x2bd3e6d0f3b142924f5ca7b49ce5b9d54c4703d7ae5648e61d02268b1a0a9fb7\n /* \"main.sol\":1034:1040 result */\n dup2\n /* \"main.sol\":1041:1042 0 */\n 0x00\n /* \"main.sol\":1034:1043 result[0] */\n 0x02\n dup2\n lt\n tag_9\n jumpi\n mstore(0x00, 0x4e487b7100000000000000000000000000000000000000000000000000000000)\n mstore(0x04, 0x32)\n revert(0x00, 0x24)\ntag_9:\n 0x20\n mul\n add\n mload\n /* \"main.sol\":1034:1129 result[0] ==... */\n eq\n /* \"main.sol\":1009:1152 require(... */\n tag_10\n jumpi\n mload(0x40)\n 0x08c379a000000000000000000000000000000000000000000000000000000000\n dup2\n mstore\n 0x04\n add\n tag_11\n swap1\n tag_12\n jump\t// in\ntag_11:\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n revert\ntag_10:\n /* \"main.sol\":1220:1286 0x21611ce0a6af85915e2f1d70300909ce2e49dfad4a4619c8390cae66cefdb204 */\n 0x21611ce0a6af85915e2f1d70300909ce2e49dfad4a4619c8390cae66cefdb204\n /* \"main.sol\":1191:1197 result */\n dup2\n /* \"main.sol\":1198:1199 1 */\n 0x01\n /* \"main.sol\":1191:1200 result[1] */\n 0x02\n dup2\n lt\n tag_13\n jumpi\n mstore(0x00, 0x4e487b7100000000000000000000000000000000000000000000000000000000)\n mstore(0x04, 0x32)\n revert(0x00, 0x24)\ntag_13:\n 0x20\n mul\n add\n mload\n /* \"main.sol\":1191:1286 result[1] ==... */\n eq\n /* \"main.sol\":1166:1309 require(... */\n tag_14\n jumpi\n mload(0x40)\n 0x08c379a000000000000000000000000000000000000000000000000000000000\n dup2\n mstore\n 0x04\n add\n tag_15\n swap1\n tag_12\n jump\t// in\ntag_15:\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n revert\ntag_14:\n /* \"main.sol\":66:1320 constructor() {... */\n pop\n pop\n pop\n /* \"main.sol\":34:1326 contract Bn128Addition{... */\n jump(tag_16)\ntag_5:\n mload(0x40)\n dup1\n 0x40\n add\n 0x40\n mstore\n dup1\n 0x02\n swap1\n 0x20\n dup3\n mul\n dup1\n calldatasize\n dup4\n calldatacopy\n dup1\n dup3\n add\n swap2\n pop\n pop\n swap1\n pop\n pop\n swap1\n jump\t// out\n /* \"#utility.yul\":7:373 */\ntag_18:\n 0x00\n /* \"#utility.yul\":170:237 */\n tag_20\n /* \"#utility.yul\":234:236 */\n 0x1e\n /* \"#utility.yul\":229:232 */\n dup4\n /* \"#utility.yul\":170:237 */\n tag_21\n jump\t// in\ntag_20:\n /* \"#utility.yul\":163:237 */\n swap2\n pop\n /* \"#utility.yul\":246:339 */\n tag_22\n /* \"#utility.yul\":335:338 */\n dup3\n /* \"#utility.yul\":246:339 */\n tag_23\n jump\t// in\ntag_22:\n /* \"#utility.yul\":364:366 */\n 0x20\n /* \"#utility.yul\":359:362 */\n dup3\n /* \"#utility.yul\":355:367 */\n add\n /* \"#utility.yul\":348:367 */\n swap1\n pop\n /* \"#utility.yul\":153:373 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":379:744 */\ntag_24:\n 0x00\n /* \"#utility.yul\":542:608 */\n tag_26\n /* \"#utility.yul\":606:607 */\n 0x06\n /* \"#utility.yul\":601:604 */\n dup4\n /* \"#utility.yul\":542:608 */\n tag_21\n jump\t// in\ntag_26:\n /* \"#utility.yul\":535:608 */\n swap2\n pop\n /* \"#utility.yul\":617:710 */\n tag_27\n /* \"#utility.yul\":706:709 */\n dup3\n /* \"#utility.yul\":617:710 */\n tag_28\n jump\t// in\ntag_27:\n /* \"#utility.yul\":735:737 */\n 0x20\n /* \"#utility.yul\":730:733 */\n dup3\n /* \"#utility.yul\":726:738 */\n add\n /* \"#utility.yul\":719:738 */\n swap1\n pop\n /* \"#utility.yul\":525:744 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":750:1169 */\ntag_8:\n 0x00\n /* \"#utility.yul\":954:956 */\n 0x20\n /* \"#utility.yul\":943:952 */\n dup3\n /* \"#utility.yul\":939:957 */\n add\n /* \"#utility.yul\":931:957 */\n swap1\n pop\n /* \"#utility.yul\":1003:1012 */\n dup2\n /* \"#utility.yul\":997:1001 */\n dup2\n /* \"#utility.yul\":993:1013 */\n sub\n /* \"#utility.yul\":989:990 */\n 0x00\n /* \"#utility.yul\":978:987 */\n dup4\n /* \"#utility.yul\":974:991 */\n add\n /* \"#utility.yul\":967:1014 */\n mstore\n /* \"#utility.yul\":1031:1162 */\n tag_30\n /* \"#utility.yul\":1157:1161 */\n dup2\n /* \"#utility.yul\":1031:1162 */\n tag_18\n jump\t// in\ntag_30:\n /* \"#utility.yul\":1023:1162 */\n swap1\n pop\n /* \"#utility.yul\":921:1169 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":1175:1594 */\ntag_12:\n 0x00\n /* \"#utility.yul\":1379:1381 */\n 0x20\n /* \"#utility.yul\":1368:1377 */\n dup3\n /* \"#utility.yul\":1364:1382 */\n add\n /* \"#utility.yul\":1356:1382 */\n swap1\n pop\n /* \"#utility.yul\":1428:1437 */\n dup2\n /* \"#utility.yul\":1422:1426 */\n dup2\n /* \"#utility.yul\":1418:1438 */\n sub\n /* \"#utility.yul\":1414:1415 */\n 0x00\n /* \"#utility.yul\":1403:1412 */\n dup4\n /* \"#utility.yul\":1399:1416 */\n add\n /* \"#utility.yul\":1392:1439 */\n mstore\n /* \"#utility.yul\":1456:1587 */\n tag_32\n /* \"#utility.yul\":1582:1586 */\n dup2\n /* \"#utility.yul\":1456:1587 */\n tag_24\n jump\t// in\ntag_32:\n /* \"#utility.yul\":1448:1587 */\n swap1\n pop\n /* \"#utility.yul\":1346:1594 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":1600:1769 */\ntag_21:\n 0x00\n /* \"#utility.yul\":1718:1724 */\n dup3\n /* \"#utility.yul\":1713:1716 */\n dup3\n /* \"#utility.yul\":1706:1725 */\n mstore\n /* \"#utility.yul\":1758:1762 */\n 0x20\n /* \"#utility.yul\":1753:1756 */\n dup3\n /* \"#utility.yul\":1749:1763 */\n add\n /* \"#utility.yul\":1734:1763 */\n swap1\n pop\n /* \"#utility.yul\":1696:1769 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":1775:1955 */\ntag_23:\n /* \"#utility.yul\":1915:1947 */\n 0x656c6c6970746963206375727665206164646974696f6e206661696c65640000\n /* \"#utility.yul\":1911:1912 */\n 0x00\n /* \"#utility.yul\":1903:1909 */\n dup3\n /* \"#utility.yul\":1899:1913 */\n add\n /* \"#utility.yul\":1892:1948 */\n mstore\n /* \"#utility.yul\":1881:1955 */\n pop\n jump\t// out\n /* \"#utility.yul\":1961:2117 */\ntag_28:\n /* \"#utility.yul\":2101:2109 */\n 0x6661696c65640000000000000000000000000000000000000000000000000000\n /* \"#utility.yul\":2097:2098 */\n 0x00\n /* \"#utility.yul\":2089:2095 */\n dup3\n /* \"#utility.yul\":2085:2099 */\n add\n /* \"#utility.yul\":2078:2110 */\n mstore\n /* \"#utility.yul\":2067:2117 */\n pop\n jump\t// out\n /* \"main.sol\":34:1326 contract Bn128Addition{... */\ntag_16:\n dataSize(sub_0)\n dup1\n dataOffset(sub_0)\n 0x00\n codecopy\n 0x00\n return\nstop\n\nsub_0: assembly {\n /* \"main.sol\":34:1326 contract Bn128Addition{... */\n mstore(0x40, 0x80)\n 0x00\n dup1\n revert\n\n auxdata: 0xa2646970667358221220a18633c4ec2f5fd19918720cc9181bf53e954372785d2b34c64298c5275b4d5264736f6c63430008030033\n}\n", + "bytecode": { + "generatedSources": [ + { + "ast": { + "nodeType": "YulBlock", + "src": "0:2120:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "153:220:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "163:74:1", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "229:3:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "234:2:1", + "type": "", + "value": "30" + } + ], + "functionName": { + "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", + "nodeType": "YulIdentifier", + "src": "170:58:1" + }, + "nodeType": "YulFunctionCall", + "src": "170:67:1" + }, + "variableNames": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "163:3:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "335:3:1" + } + ], + "functionName": { + "name": "store_literal_in_memory_0b6c4680c9699354fe09d0e864e370495b9b131fb2b406b5cf2517a420eb7e27", + "nodeType": "YulIdentifier", + "src": "246:88:1" + }, + "nodeType": "YulFunctionCall", + "src": "246:93:1" + }, + "nodeType": "YulExpressionStatement", + "src": "246:93:1" + }, + { + "nodeType": "YulAssignment", + "src": "348:19:1", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "359:3:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "364:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "355:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "355:12:1" + }, + "variableNames": [ + { + "name": "end", + "nodeType": "YulIdentifier", + "src": "348:3:1" + } + ] + } + ] + }, + "name": "abi_encode_t_stringliteral_0b6c4680c9699354fe09d0e864e370495b9b131fb2b406b5cf2517a420eb7e27_to_t_string_memory_ptr_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "141:3:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "end", + "nodeType": "YulTypedName", + "src": "149:3:1", + "type": "" + } + ], + "src": "7:366:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "525:219:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "535:73:1", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "601:3:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "606:1:1", + "type": "", + "value": "6" + } + ], + "functionName": { + "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", + "nodeType": "YulIdentifier", + "src": "542:58:1" + }, + "nodeType": "YulFunctionCall", + "src": "542:66:1" + }, + "variableNames": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "535:3:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "706:3:1" + } + ], + "functionName": { + "name": "store_literal_in_memory_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43", + "nodeType": "YulIdentifier", + "src": "617:88:1" + }, + "nodeType": "YulFunctionCall", + "src": "617:93:1" + }, + "nodeType": "YulExpressionStatement", + "src": "617:93:1" + }, + { + "nodeType": "YulAssignment", + "src": "719:19:1", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "730:3:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "735:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "726:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "726:12:1" + }, + "variableNames": [ + { + "name": "end", + "nodeType": "YulIdentifier", + "src": "719:3:1" + } + ] + } + ] + }, + "name": "abi_encode_t_stringliteral_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43_to_t_string_memory_ptr_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "513:3:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "end", + "nodeType": "YulTypedName", + "src": "521:3:1", + "type": "" + } + ], + "src": "379:365:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "921:248:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "931:26:1", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "943:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "954:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "939:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "939:18:1" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "931:4:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "978:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "989:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "974:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "974:17:1" + }, + { + "arguments": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "997:4:1" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "1003:9:1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "993:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "993:20:1" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "967:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "967:47:1" + }, + "nodeType": "YulExpressionStatement", + "src": "967:47:1" + }, + { + "nodeType": "YulAssignment", + "src": "1023:139:1", + "value": { + "arguments": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "1157:4:1" + } + ], + "functionName": { + "name": "abi_encode_t_stringliteral_0b6c4680c9699354fe09d0e864e370495b9b131fb2b406b5cf2517a420eb7e27_to_t_string_memory_ptr_fromStack", + "nodeType": "YulIdentifier", + "src": "1031:124:1" + }, + "nodeType": "YulFunctionCall", + "src": "1031:131:1" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "1023:4:1" + } + ] + } + ] + }, + "name": "abi_encode_tuple_t_stringliteral_0b6c4680c9699354fe09d0e864e370495b9b131fb2b406b5cf2517a420eb7e27__to_t_string_memory_ptr__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "901:9:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "916:4:1", + "type": "" + } + ], + "src": "750:419:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1346:248:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "1356:26:1", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "1368:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1379:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1364:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1364:18:1" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "1356:4:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "1403:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1414:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1399:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1399:17:1" + }, + { + "arguments": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "1422:4:1" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "1428:9:1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "1418:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1418:20:1" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "1392:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1392:47:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1392:47:1" + }, + { + "nodeType": "YulAssignment", + "src": "1448:139:1", + "value": { + "arguments": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "1582:4:1" + } + ], + "functionName": { + "name": "abi_encode_t_stringliteral_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43_to_t_string_memory_ptr_fromStack", + "nodeType": "YulIdentifier", + "src": "1456:124:1" + }, + "nodeType": "YulFunctionCall", + "src": "1456:131:1" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "1448:4:1" + } + ] + } + ] + }, + "name": "abi_encode_tuple_t_stringliteral_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43__to_t_string_memory_ptr__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "1326:9:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "1341:4:1", + "type": "" + } + ], + "src": "1175:419:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1696:73:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "1713:3:1" + }, + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "1718:6:1" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "1706:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1706:19:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1706:19:1" + }, + { + "nodeType": "YulAssignment", + "src": "1734:29:1", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "1753:3:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1758:4:1", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1749:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1749:14:1" + }, + "variableNames": [ + { + "name": "updated_pos", + "nodeType": "YulIdentifier", + "src": "1734:11:1" + } + ] + } + ] + }, + "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "1668:3:1", + "type": "" + }, + { + "name": "length", + "nodeType": "YulTypedName", + "src": "1673:6:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "updated_pos", + "nodeType": "YulTypedName", + "src": "1684:11:1", + "type": "" + } + ], + "src": "1600:169:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1881:74:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "memPtr", + "nodeType": "YulIdentifier", + "src": "1903:6:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1911:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1899:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1899:14:1" + }, + { + "kind": "string", + "nodeType": "YulLiteral", + "src": "1915:32:1", + "type": "", + "value": "elliptic curve addition failed" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "1892:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1892:56:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1892:56:1" + } + ] + }, + "name": "store_literal_in_memory_0b6c4680c9699354fe09d0e864e370495b9b131fb2b406b5cf2517a420eb7e27", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "memPtr", + "nodeType": "YulTypedName", + "src": "1873:6:1", + "type": "" + } + ], + "src": "1775:180:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "2067:50:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "memPtr", + "nodeType": "YulIdentifier", + "src": "2089:6:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "2097:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "2085:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "2085:14:1" + }, + { + "kind": "string", + "nodeType": "YulLiteral", + "src": "2101:8:1", + "type": "", + "value": "failed" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "2078:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "2078:32:1" + }, + "nodeType": "YulExpressionStatement", + "src": "2078:32:1" + } + ] + }, + "name": "store_literal_in_memory_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "memPtr", + "nodeType": "YulTypedName", + "src": "2059:6:1", + "type": "" + } + ], + "src": "1961:156:1" + } + ] + }, + "contents": "{\n\n function abi_encode_t_stringliteral_0b6c4680c9699354fe09d0e864e370495b9b131fb2b406b5cf2517a420eb7e27_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 30)\n store_literal_in_memory_0b6c4680c9699354fe09d0e864e370495b9b131fb2b406b5cf2517a420eb7e27(pos)\n end := add(pos, 32)\n }\n\n function abi_encode_t_stringliteral_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 6)\n store_literal_in_memory_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43(pos)\n end := add(pos, 32)\n }\n\n function abi_encode_tuple_t_stringliteral_0b6c4680c9699354fe09d0e864e370495b9b131fb2b406b5cf2517a420eb7e27__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_0b6c4680c9699354fe09d0e864e370495b9b131fb2b406b5cf2517a420eb7e27_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n function abi_encode_tuple_t_stringliteral_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n function array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, length) -> updated_pos {\n mstore(pos, length)\n updated_pos := add(pos, 0x20)\n }\n\n function store_literal_in_memory_0b6c4680c9699354fe09d0e864e370495b9b131fb2b406b5cf2517a420eb7e27(memPtr) {\n\n mstore(add(memPtr, 0), \"elliptic curve addition failed\")\n\n }\n\n function store_literal_in_memory_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43(memPtr) {\n\n mstore(add(memPtr, 0), \"failed\")\n\n }\n\n}\n", + "id": 1, + "language": "Yul", + "name": "#utility.yul" + } + ], + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b5060008060405180608001604052807f2243525c5efd4b9c3d3c45ac0ca3fe4dd85e830a4ce6b65fa1eeaee20283970381526020017f301d1d33be6da8e509df21cc35964723180eed7532537db9ae5e7d48f195c91581526020017f18b18acfb4c2c30276db5411368e7185b311dd124691610c5d3b74034e093dc981526020017f063c909c4720840cb5134cb9f59fa749755796819658d32efc0d288198f3726681525090506100bf610257565b60408160808460006006600019f192508261010f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610106906102bf565b60405180910390fd5b7f2bd3e6d0f3b142924f5ca7b49ce5b9d54c4703d7ae5648e61d02268b1a0a9fb78160006002811061016a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151146101af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101a6906102df565b60405180910390fd5b7f21611ce0a6af85915e2f1d70300909ce2e49dfad4a4619c8390cae66cefdb2048160016002811061020a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201511461024f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610246906102df565b60405180910390fd5b505050610362565b6040518060400160405280600290602082028036833780820191505090505090565b6000610286601e836102ff565b915061029182610310565b602082019050919050565b60006102a96006836102ff565b91506102b482610339565b602082019050919050565b600060208201905081810360008301526102d881610279565b9050919050565b600060208201905081810360008301526102f88161029c565b9050919050565b600082825260208201905092915050565b7f656c6c6970746963206375727665206164646974696f6e206661696c65640000600082015250565b7f6661696c65640000000000000000000000000000000000000000000000000000600082015250565b603f806103706000396000f3fe6080604052600080fdfea2646970667358221220a18633c4ec2f5fd19918720cc9181bf53e954372785d2b34c64298c5275b4d5264736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 PUSH1 0x40 MLOAD DUP1 PUSH1 0x80 ADD PUSH1 0x40 MSTORE DUP1 PUSH32 0x2243525C5EFD4B9C3D3C45AC0CA3FE4DD85E830A4CE6B65FA1EEAEE202839703 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x301D1D33BE6DA8E509DF21CC35964723180EED7532537DB9AE5E7D48F195C915 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x18B18ACFB4C2C30276DB5411368E7185B311DD124691610C5D3B74034E093DC9 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x63C909C4720840CB5134CB9F59FA749755796819658D32EFC0D288198F37266 DUP2 MSTORE POP SWAP1 POP PUSH2 0xBF PUSH2 0x257 JUMP JUMPDEST PUSH1 0x40 DUP2 PUSH1 0x80 DUP5 PUSH1 0x0 PUSH1 0x6 PUSH1 0x0 NOT CALL SWAP3 POP DUP3 PUSH2 0x10F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x106 SWAP1 PUSH2 0x2BF JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH32 0x2BD3E6D0F3B142924F5CA7B49CE5B9D54C4703D7AE5648E61D02268B1A0A9FB7 DUP2 PUSH1 0x0 PUSH1 0x2 DUP2 LT PUSH2 0x16A JUMPI PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x32 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x20 MUL ADD MLOAD EQ PUSH2 0x1AF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1A6 SWAP1 PUSH2 0x2DF JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH32 0x21611CE0A6AF85915E2F1D70300909CE2E49DFAD4A4619C8390CAE66CEFDB204 DUP2 PUSH1 0x1 PUSH1 0x2 DUP2 LT PUSH2 0x20A JUMPI PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x32 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x20 MUL ADD MLOAD EQ PUSH2 0x24F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x246 SWAP1 PUSH2 0x2DF JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP POP POP PUSH2 0x362 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2 SWAP1 PUSH1 0x20 DUP3 MUL DUP1 CALLDATASIZE DUP4 CALLDATACOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP POP SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x286 PUSH1 0x1E DUP4 PUSH2 0x2FF JUMP JUMPDEST SWAP2 POP PUSH2 0x291 DUP3 PUSH2 0x310 JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2A9 PUSH1 0x6 DUP4 PUSH2 0x2FF JUMP JUMPDEST SWAP2 POP PUSH2 0x2B4 DUP3 PUSH2 0x339 JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x2D8 DUP2 PUSH2 0x279 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x2F8 DUP2 PUSH2 0x29C JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH32 0x656C6C6970746963206375727665206164646974696F6E206661696C65640000 PUSH1 0x0 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH32 0x6661696C65640000000000000000000000000000000000000000000000000000 PUSH1 0x0 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH1 0x3F DUP1 PUSH2 0x370 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 LOG1 DUP7 CALLER 0xC4 0xEC 0x2F 0x5F 0xD1 SWAP10 XOR PUSH19 0xCC9181BF53E954372785D2B34C64298C5275B 0x4D MSTORE PUSH5 0x736F6C6343 STOP ADDMOD SUB STOP CALLER ", + "sourceMap": "34:1292:0:-:0;;;66:1254;;;;;;;;;;94:12;120:23;:376;;;;;;;;164:66;120:376;;;;248:66;120:376;;;;332:66;120:376;;;;416:66;120:376;;;;;510:24;;:::i;:::-;915:2;907:6;902:3;895:5;892:1;886:4;882:1;878:6;873:45;862:56;;953:7;945:50;;;;;;;;;;;;:::i;:::-;;;;;;;;;1063:66;1034:6;1041:1;1034:9;;;;;;;;;;;;;;;;;;;:95;1009:143;;;;;;;;;;;;:::i;:::-;;;;;;;;;1220:66;1191:6;1198:1;1191:9;;;;;;;;;;;;;;;;;;;:95;1166:143;;;;;;;;;;;;:::i;:::-;;;;;;;;;66:1254;;;34:1292;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;7:366:1:-;;170:67;234:2;229:3;170:67;:::i;:::-;163:74;;246:93;335:3;246:93;:::i;:::-;364:2;359:3;355:12;348:19;;153:220;;;:::o;379:365::-;;542:66;606:1;601:3;542:66;:::i;:::-;535:73;;617:93;706:3;617:93;:::i;:::-;735:2;730:3;726:12;719:19;;525:219;;;:::o;750:419::-;;954:2;943:9;939:18;931:26;;1003:9;997:4;993:20;989:1;978:9;974:17;967:47;1031:131;1157:4;1031:131;:::i;:::-;1023:139;;921:248;;;:::o;1175:419::-;;1379:2;1368:9;1364:18;1356:26;;1428:9;1422:4;1418:20;1414:1;1403:9;1399:17;1392:47;1456:131;1582:4;1456:131;:::i;:::-;1448:139;;1346:248;;;:::o;1600:169::-;;1718:6;1713:3;1706:19;1758:4;1753:3;1749:14;1734:29;;1696:73;;;;:::o;1775:180::-;1915:32;1911:1;1903:6;1899:14;1892:56;1881:74;:::o;1961:156::-;2101:8;2097:1;2089:6;2085:14;2078:32;2067:50;:::o;34:1292:0:-;;;;;;;" + }, + "deployedBytecode": { + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "6080604052600080fdfea2646970667358221220a18633c4ec2f5fd19918720cc9181bf53e954372785d2b34c64298c5275b4d5264736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 LOG1 DUP7 CALLER 0xC4 0xEC 0x2F 0x5F 0xD1 SWAP10 XOR PUSH19 0xCC9181BF53E954372785D2B34C64298C5275B 0x4D MSTORE PUSH5 0x736F6C6343 STOP ADDMOD SUB STOP CALLER ", + "sourceMap": "34:1292:0:-:0;;;;;" + }, + "gasEstimates": { + "creation": { + "codeDepositCost": "12600", + "executionCost": "infinite", + "totalCost": "infinite" + } + }, + "legacyAssembly": { + ".code": [ + { + "begin": 34, + "end": 1326, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 34, + "end": 1326, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 1326, "name": "MSTORE", "source": 0 }, + { "begin": 66, "end": 1320, "name": "CALLVALUE", "source": 0 }, + { "begin": 66, "end": 1320, "name": "DUP1", "source": 0 }, + { "begin": 66, "end": 1320, "name": "ISZERO", "source": 0 }, + { + "begin": 66, + "end": 1320, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 66, "end": 1320, "name": "JUMPI", "source": 0 }, + { + "begin": 66, + "end": 1320, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 66, "end": 1320, "name": "DUP1", "source": 0 }, + { "begin": 66, "end": 1320, "name": "REVERT", "source": 0 }, + { + "begin": 66, + "end": 1320, + "name": "tag", + "source": 0, + "value": "1" + }, + { "begin": 66, "end": 1320, "name": "JUMPDEST", "source": 0 }, + { "begin": 66, "end": 1320, "name": "POP", "source": 0 }, + { + "begin": 94, + "end": 106, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 120, "end": 143, "name": "DUP1", "source": 0 }, + { + "begin": 120, + "end": 496, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 120, "end": 496, "name": "MLOAD", "source": 0 }, + { "begin": 120, "end": 496, "name": "DUP1", "source": 0 }, + { + "begin": 120, + "end": 496, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { "begin": 120, "end": 496, "name": "ADD", "source": 0 }, + { + "begin": 120, + "end": 496, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 120, "end": 496, "name": "MSTORE", "source": 0 }, + { "begin": 120, "end": 496, "name": "DUP1", "source": 0 }, + { + "begin": 164, + "end": 230, + "name": "PUSH", + "source": 0, + "value": "2243525C5EFD4B9C3D3C45AC0CA3FE4DD85E830A4CE6B65FA1EEAEE202839703" + }, + { "begin": 120, "end": 496, "name": "DUP2", "source": 0 }, + { "begin": 120, "end": 496, "name": "MSTORE", "source": 0 }, + { + "begin": 120, + "end": 496, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 120, "end": 496, "name": "ADD", "source": 0 }, + { + "begin": 248, + "end": 314, + "name": "PUSH", + "source": 0, + "value": "301D1D33BE6DA8E509DF21CC35964723180EED7532537DB9AE5E7D48F195C915" + }, + { "begin": 120, "end": 496, "name": "DUP2", "source": 0 }, + { "begin": 120, "end": 496, "name": "MSTORE", "source": 0 }, + { + "begin": 120, + "end": 496, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 120, "end": 496, "name": "ADD", "source": 0 }, + { + "begin": 332, + "end": 398, + "name": "PUSH", + "source": 0, + "value": "18B18ACFB4C2C30276DB5411368E7185B311DD124691610C5D3B74034E093DC9" + }, + { "begin": 120, "end": 496, "name": "DUP2", "source": 0 }, + { "begin": 120, "end": 496, "name": "MSTORE", "source": 0 }, + { + "begin": 120, + "end": 496, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 120, "end": 496, "name": "ADD", "source": 0 }, + { + "begin": 416, + "end": 482, + "name": "PUSH", + "source": 0, + "value": "63C909C4720840CB5134CB9F59FA749755796819658D32EFC0D288198F37266" + }, + { "begin": 120, "end": 496, "name": "DUP2", "source": 0 }, + { "begin": 120, "end": 496, "name": "MSTORE", "source": 0 }, + { "begin": 120, "end": 496, "name": "POP", "source": 0 }, + { "begin": 120, "end": 496, "name": "SWAP1", "source": 0 }, + { "begin": 120, "end": 496, "name": "POP", "source": 0 }, + { + "begin": 510, + "end": 534, + "name": "PUSH [tag]", + "source": 0, + "value": "4" + }, + { + "begin": 510, + "end": 534, + "name": "PUSH [tag]", + "source": 0, + "value": "5" + }, + { + "begin": 510, + "end": 534, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 510, + "end": 534, + "name": "tag", + "source": 0, + "value": "4" + }, + { "begin": 510, "end": 534, "name": "JUMPDEST", "source": 0 }, + { + "begin": 915, + "end": 917, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 907, "end": 913, "name": "DUP2", "source": 0 }, + { + "begin": 902, + "end": 905, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { "begin": 895, "end": 900, "name": "DUP5", "source": 0 }, + { + "begin": 892, + "end": 893, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { + "begin": 886, + "end": 890, + "name": "PUSH", + "source": 0, + "value": "6" + }, + { + "begin": 882, + "end": 883, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 878, "end": 884, "name": "NOT", "source": 0 }, + { "begin": 873, "end": 918, "name": "CALL", "source": 0 }, + { "begin": 862, "end": 918, "name": "SWAP3", "source": 0 }, + { "begin": 862, "end": 918, "name": "POP", "source": 0 }, + { "begin": 953, "end": 960, "name": "DUP3", "source": 0 }, + { + "begin": 945, + "end": 995, + "name": "PUSH [tag]", + "source": 0, + "value": "6" + }, + { "begin": 945, "end": 995, "name": "JUMPI", "source": 0 }, + { + "begin": 945, + "end": 995, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 945, "end": 995, "name": "MLOAD", "source": 0 }, + { + "begin": 945, + "end": 995, + "name": "PUSH", + "source": 0, + "value": "8C379A000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 945, "end": 995, "name": "DUP2", "source": 0 }, + { "begin": 945, "end": 995, "name": "MSTORE", "source": 0 }, + { + "begin": 945, + "end": 995, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 945, "end": 995, "name": "ADD", "source": 0 }, + { + "begin": 945, + "end": 995, + "name": "PUSH [tag]", + "source": 0, + "value": "7" + }, + { "begin": 945, "end": 995, "name": "SWAP1", "source": 0 }, + { + "begin": 945, + "end": 995, + "name": "PUSH [tag]", + "source": 0, + "value": "8" + }, + { + "begin": 945, + "end": 995, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 945, + "end": 995, + "name": "tag", + "source": 0, + "value": "7" + }, + { "begin": 945, "end": 995, "name": "JUMPDEST", "source": 0 }, + { + "begin": 945, + "end": 995, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 945, "end": 995, "name": "MLOAD", "source": 0 }, + { "begin": 945, "end": 995, "name": "DUP1", "source": 0 }, + { "begin": 945, "end": 995, "name": "SWAP2", "source": 0 }, + { "begin": 945, "end": 995, "name": "SUB", "source": 0 }, + { "begin": 945, "end": 995, "name": "SWAP1", "source": 0 }, + { "begin": 945, "end": 995, "name": "REVERT", "source": 0 }, + { + "begin": 945, + "end": 995, + "name": "tag", + "source": 0, + "value": "6" + }, + { "begin": 945, "end": 995, "name": "JUMPDEST", "source": 0 }, + { + "begin": 1063, + "end": 1129, + "name": "PUSH", + "source": 0, + "value": "2BD3E6D0F3B142924F5CA7B49CE5B9D54C4703D7AE5648E61D02268B1A0A9FB7" + }, + { "begin": 1034, "end": 1040, "name": "DUP2", "source": 0 }, + { + "begin": 1041, + "end": 1042, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { + "begin": 1034, + "end": 1043, + "name": "PUSH", + "source": 0, + "value": "2" + }, + { "begin": 1034, "end": 1043, "name": "DUP2", "source": 0 }, + { "begin": 1034, "end": 1043, "name": "LT", "source": 0 }, + { + "begin": 1034, + "end": 1043, + "name": "PUSH [tag]", + "source": 0, + "value": "9" + }, + { "begin": 1034, "end": 1043, "name": "JUMPI", "source": 0 }, + { + "begin": 1034, + "end": 1043, + "name": "PUSH", + "source": 0, + "value": "4E487B7100000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 1034, + "end": 1043, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 1034, "end": 1043, "name": "MSTORE", "source": 0 }, + { + "begin": 1034, + "end": 1043, + "name": "PUSH", + "source": 0, + "value": "32" + }, + { + "begin": 1034, + "end": 1043, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 1034, "end": 1043, "name": "MSTORE", "source": 0 }, + { + "begin": 1034, + "end": 1043, + "name": "PUSH", + "source": 0, + "value": "24" + }, + { + "begin": 1034, + "end": 1043, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 1034, "end": 1043, "name": "REVERT", "source": 0 }, + { + "begin": 1034, + "end": 1043, + "name": "tag", + "source": 0, + "value": "9" + }, + { "begin": 1034, "end": 1043, "name": "JUMPDEST", "source": 0 }, + { + "begin": 1034, + "end": 1043, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 1034, "end": 1043, "name": "MUL", "source": 0 }, + { "begin": 1034, "end": 1043, "name": "ADD", "source": 0 }, + { "begin": 1034, "end": 1043, "name": "MLOAD", "source": 0 }, + { "begin": 1034, "end": 1129, "name": "EQ", "source": 0 }, + { + "begin": 1009, + "end": 1152, + "name": "PUSH [tag]", + "source": 0, + "value": "10" + }, + { "begin": 1009, "end": 1152, "name": "JUMPI", "source": 0 }, + { + "begin": 1009, + "end": 1152, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 1009, "end": 1152, "name": "MLOAD", "source": 0 }, + { + "begin": 1009, + "end": 1152, + "name": "PUSH", + "source": 0, + "value": "8C379A000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 1009, "end": 1152, "name": "DUP2", "source": 0 }, + { "begin": 1009, "end": 1152, "name": "MSTORE", "source": 0 }, + { + "begin": 1009, + "end": 1152, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 1009, "end": 1152, "name": "ADD", "source": 0 }, + { + "begin": 1009, + "end": 1152, + "name": "PUSH [tag]", + "source": 0, + "value": "11" + }, + { "begin": 1009, "end": 1152, "name": "SWAP1", "source": 0 }, + { + "begin": 1009, + "end": 1152, + "name": "PUSH [tag]", + "source": 0, + "value": "12" + }, + { + "begin": 1009, + "end": 1152, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 1009, + "end": 1152, + "name": "tag", + "source": 0, + "value": "11" + }, + { "begin": 1009, "end": 1152, "name": "JUMPDEST", "source": 0 }, + { + "begin": 1009, + "end": 1152, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 1009, "end": 1152, "name": "MLOAD", "source": 0 }, + { "begin": 1009, "end": 1152, "name": "DUP1", "source": 0 }, + { "begin": 1009, "end": 1152, "name": "SWAP2", "source": 0 }, + { "begin": 1009, "end": 1152, "name": "SUB", "source": 0 }, + { "begin": 1009, "end": 1152, "name": "SWAP1", "source": 0 }, + { "begin": 1009, "end": 1152, "name": "REVERT", "source": 0 }, + { + "begin": 1009, + "end": 1152, + "name": "tag", + "source": 0, + "value": "10" + }, + { "begin": 1009, "end": 1152, "name": "JUMPDEST", "source": 0 }, + { + "begin": 1220, + "end": 1286, + "name": "PUSH", + "source": 0, + "value": "21611CE0A6AF85915E2F1D70300909CE2E49DFAD4A4619C8390CAE66CEFDB204" + }, + { "begin": 1191, "end": 1197, "name": "DUP2", "source": 0 }, + { + "begin": 1198, + "end": 1199, + "name": "PUSH", + "source": 0, + "value": "1" + }, + { + "begin": 1191, + "end": 1200, + "name": "PUSH", + "source": 0, + "value": "2" + }, + { "begin": 1191, "end": 1200, "name": "DUP2", "source": 0 }, + { "begin": 1191, "end": 1200, "name": "LT", "source": 0 }, + { + "begin": 1191, + "end": 1200, + "name": "PUSH [tag]", + "source": 0, + "value": "13" + }, + { "begin": 1191, "end": 1200, "name": "JUMPI", "source": 0 }, + { + "begin": 1191, + "end": 1200, + "name": "PUSH", + "source": 0, + "value": "4E487B7100000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 1191, + "end": 1200, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 1191, "end": 1200, "name": "MSTORE", "source": 0 }, + { + "begin": 1191, + "end": 1200, + "name": "PUSH", + "source": 0, + "value": "32" + }, + { + "begin": 1191, + "end": 1200, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 1191, "end": 1200, "name": "MSTORE", "source": 0 }, + { + "begin": 1191, + "end": 1200, + "name": "PUSH", + "source": 0, + "value": "24" + }, + { + "begin": 1191, + "end": 1200, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 1191, "end": 1200, "name": "REVERT", "source": 0 }, + { + "begin": 1191, + "end": 1200, + "name": "tag", + "source": 0, + "value": "13" + }, + { "begin": 1191, "end": 1200, "name": "JUMPDEST", "source": 0 }, + { + "begin": 1191, + "end": 1200, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 1191, "end": 1200, "name": "MUL", "source": 0 }, + { "begin": 1191, "end": 1200, "name": "ADD", "source": 0 }, + { "begin": 1191, "end": 1200, "name": "MLOAD", "source": 0 }, + { "begin": 1191, "end": 1286, "name": "EQ", "source": 0 }, + { + "begin": 1166, + "end": 1309, + "name": "PUSH [tag]", + "source": 0, + "value": "14" + }, + { "begin": 1166, "end": 1309, "name": "JUMPI", "source": 0 }, + { + "begin": 1166, + "end": 1309, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 1166, "end": 1309, "name": "MLOAD", "source": 0 }, + { + "begin": 1166, + "end": 1309, + "name": "PUSH", + "source": 0, + "value": "8C379A000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 1166, "end": 1309, "name": "DUP2", "source": 0 }, + { "begin": 1166, "end": 1309, "name": "MSTORE", "source": 0 }, + { + "begin": 1166, + "end": 1309, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 1166, "end": 1309, "name": "ADD", "source": 0 }, + { + "begin": 1166, + "end": 1309, + "name": "PUSH [tag]", + "source": 0, + "value": "15" + }, + { "begin": 1166, "end": 1309, "name": "SWAP1", "source": 0 }, + { + "begin": 1166, + "end": 1309, + "name": "PUSH [tag]", + "source": 0, + "value": "12" + }, + { + "begin": 1166, + "end": 1309, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 1166, + "end": 1309, + "name": "tag", + "source": 0, + "value": "15" + }, + { "begin": 1166, "end": 1309, "name": "JUMPDEST", "source": 0 }, + { + "begin": 1166, + "end": 1309, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 1166, "end": 1309, "name": "MLOAD", "source": 0 }, + { "begin": 1166, "end": 1309, "name": "DUP1", "source": 0 }, + { "begin": 1166, "end": 1309, "name": "SWAP2", "source": 0 }, + { "begin": 1166, "end": 1309, "name": "SUB", "source": 0 }, + { "begin": 1166, "end": 1309, "name": "SWAP1", "source": 0 }, + { "begin": 1166, "end": 1309, "name": "REVERT", "source": 0 }, + { + "begin": 1166, + "end": 1309, + "name": "tag", + "source": 0, + "value": "14" + }, + { "begin": 1166, "end": 1309, "name": "JUMPDEST", "source": 0 }, + { "begin": 66, "end": 1320, "name": "POP", "source": 0 }, + { "begin": 66, "end": 1320, "name": "POP", "source": 0 }, + { "begin": 66, "end": 1320, "name": "POP", "source": 0 }, + { + "begin": 34, + "end": 1326, + "name": "PUSH [tag]", + "source": 0, + "value": "16" + }, + { "begin": 34, "end": 1326, "name": "JUMP", "source": 0 }, + { + "begin": 34, + "end": 1326, + "name": "tag", + "source": 0, + "value": "5" + }, + { "begin": 34, "end": 1326, "name": "JUMPDEST", "source": 0 }, + { + "begin": 34, + "end": 1326, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 1326, "name": "MLOAD", "source": 0 }, + { "begin": 34, "end": 1326, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 1326, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 1326, "name": "ADD", "source": 0 }, + { + "begin": 34, + "end": 1326, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 1326, "name": "MSTORE", "source": 0 }, + { "begin": 34, "end": 1326, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 1326, + "name": "PUSH", + "source": 0, + "value": "2" + }, + { "begin": 34, "end": 1326, "name": "SWAP1", "source": 0 }, + { + "begin": 34, + "end": 1326, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 34, "end": 1326, "name": "DUP3", "source": 0 }, + { "begin": 34, "end": 1326, "name": "MUL", "source": 0 }, + { "begin": 34, "end": 1326, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 1326, "name": "CALLDATASIZE", "source": 0 }, + { "begin": 34, "end": 1326, "name": "DUP4", "source": 0 }, + { "begin": 34, "end": 1326, "name": "CALLDATACOPY", "source": 0 }, + { "begin": 34, "end": 1326, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 1326, "name": "DUP3", "source": 0 }, + { "begin": 34, "end": 1326, "name": "ADD", "source": 0 }, + { "begin": 34, "end": 1326, "name": "SWAP2", "source": 0 }, + { "begin": 34, "end": 1326, "name": "POP", "source": 0 }, + { "begin": 34, "end": 1326, "name": "POP", "source": 0 }, + { "begin": 34, "end": 1326, "name": "SWAP1", "source": 0 }, + { "begin": 34, "end": 1326, "name": "POP", "source": 0 }, + { "begin": 34, "end": 1326, "name": "POP", "source": 0 }, + { "begin": 34, "end": 1326, "name": "SWAP1", "source": 0 }, + { + "begin": 34, + "end": 1326, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { "begin": 7, "end": 373, "name": "tag", "source": 1, "value": "18" }, + { "begin": 7, "end": 373, "name": "JUMPDEST", "source": 1 }, + { "begin": 7, "end": 373, "name": "PUSH", "source": 1, "value": "0" }, + { + "begin": 170, + "end": 237, + "name": "PUSH [tag]", + "source": 1, + "value": "20" + }, + { + "begin": 234, + "end": 236, + "name": "PUSH", + "source": 1, + "value": "1E" + }, + { "begin": 229, "end": 232, "name": "DUP4", "source": 1 }, + { + "begin": 170, + "end": 237, + "name": "PUSH [tag]", + "source": 1, + "value": "21" + }, + { + "begin": 170, + "end": 237, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 170, + "end": 237, + "name": "tag", + "source": 1, + "value": "20" + }, + { "begin": 170, "end": 237, "name": "JUMPDEST", "source": 1 }, + { "begin": 163, "end": 237, "name": "SWAP2", "source": 1 }, + { "begin": 163, "end": 237, "name": "POP", "source": 1 }, + { + "begin": 246, + "end": 339, + "name": "PUSH [tag]", + "source": 1, + "value": "22" + }, + { "begin": 335, "end": 338, "name": "DUP3", "source": 1 }, + { + "begin": 246, + "end": 339, + "name": "PUSH [tag]", + "source": 1, + "value": "23" + }, + { + "begin": 246, + "end": 339, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 246, + "end": 339, + "name": "tag", + "source": 1, + "value": "22" + }, + { "begin": 246, "end": 339, "name": "JUMPDEST", "source": 1 }, + { + "begin": 364, + "end": 366, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 359, "end": 362, "name": "DUP3", "source": 1 }, + { "begin": 355, "end": 367, "name": "ADD", "source": 1 }, + { "begin": 348, "end": 367, "name": "SWAP1", "source": 1 }, + { "begin": 348, "end": 367, "name": "POP", "source": 1 }, + { "begin": 153, "end": 373, "name": "SWAP2", "source": 1 }, + { "begin": 153, "end": 373, "name": "SWAP1", "source": 1 }, + { "begin": 153, "end": 373, "name": "POP", "source": 1 }, + { + "begin": 153, + "end": 373, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 379, + "end": 744, + "name": "tag", + "source": 1, + "value": "24" + }, + { "begin": 379, "end": 744, "name": "JUMPDEST", "source": 1 }, + { + "begin": 379, + "end": 744, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 542, + "end": 608, + "name": "PUSH [tag]", + "source": 1, + "value": "26" + }, + { + "begin": 606, + "end": 607, + "name": "PUSH", + "source": 1, + "value": "6" + }, + { "begin": 601, "end": 604, "name": "DUP4", "source": 1 }, + { + "begin": 542, + "end": 608, + "name": "PUSH [tag]", + "source": 1, + "value": "21" + }, + { + "begin": 542, + "end": 608, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 542, + "end": 608, + "name": "tag", + "source": 1, + "value": "26" + }, + { "begin": 542, "end": 608, "name": "JUMPDEST", "source": 1 }, + { "begin": 535, "end": 608, "name": "SWAP2", "source": 1 }, + { "begin": 535, "end": 608, "name": "POP", "source": 1 }, + { + "begin": 617, + "end": 710, + "name": "PUSH [tag]", + "source": 1, + "value": "27" + }, + { "begin": 706, "end": 709, "name": "DUP3", "source": 1 }, + { + "begin": 617, + "end": 710, + "name": "PUSH [tag]", + "source": 1, + "value": "28" + }, + { + "begin": 617, + "end": 710, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 617, + "end": 710, + "name": "tag", + "source": 1, + "value": "27" + }, + { "begin": 617, "end": 710, "name": "JUMPDEST", "source": 1 }, + { + "begin": 735, + "end": 737, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 730, "end": 733, "name": "DUP3", "source": 1 }, + { "begin": 726, "end": 738, "name": "ADD", "source": 1 }, + { "begin": 719, "end": 738, "name": "SWAP1", "source": 1 }, + { "begin": 719, "end": 738, "name": "POP", "source": 1 }, + { "begin": 525, "end": 744, "name": "SWAP2", "source": 1 }, + { "begin": 525, "end": 744, "name": "SWAP1", "source": 1 }, + { "begin": 525, "end": 744, "name": "POP", "source": 1 }, + { + "begin": 525, + "end": 744, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 750, + "end": 1169, + "name": "tag", + "source": 1, + "value": "8" + }, + { "begin": 750, "end": 1169, "name": "JUMPDEST", "source": 1 }, + { + "begin": 750, + "end": 1169, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 954, + "end": 956, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 943, "end": 952, "name": "DUP3", "source": 1 }, + { "begin": 939, "end": 957, "name": "ADD", "source": 1 }, + { "begin": 931, "end": 957, "name": "SWAP1", "source": 1 }, + { "begin": 931, "end": 957, "name": "POP", "source": 1 }, + { "begin": 1003, "end": 1012, "name": "DUP2", "source": 1 }, + { "begin": 997, "end": 1001, "name": "DUP2", "source": 1 }, + { "begin": 993, "end": 1013, "name": "SUB", "source": 1 }, + { + "begin": 989, + "end": 990, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 978, "end": 987, "name": "DUP4", "source": 1 }, + { "begin": 974, "end": 991, "name": "ADD", "source": 1 }, + { "begin": 967, "end": 1014, "name": "MSTORE", "source": 1 }, + { + "begin": 1031, + "end": 1162, + "name": "PUSH [tag]", + "source": 1, + "value": "30" + }, + { "begin": 1157, "end": 1161, "name": "DUP2", "source": 1 }, + { + "begin": 1031, + "end": 1162, + "name": "PUSH [tag]", + "source": 1, + "value": "18" + }, + { + "begin": 1031, + "end": 1162, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1031, + "end": 1162, + "name": "tag", + "source": 1, + "value": "30" + }, + { "begin": 1031, "end": 1162, "name": "JUMPDEST", "source": 1 }, + { "begin": 1023, "end": 1162, "name": "SWAP1", "source": 1 }, + { "begin": 1023, "end": 1162, "name": "POP", "source": 1 }, + { "begin": 921, "end": 1169, "name": "SWAP2", "source": 1 }, + { "begin": 921, "end": 1169, "name": "SWAP1", "source": 1 }, + { "begin": 921, "end": 1169, "name": "POP", "source": 1 }, + { + "begin": 921, + "end": 1169, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1175, + "end": 1594, + "name": "tag", + "source": 1, + "value": "12" + }, + { "begin": 1175, "end": 1594, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1175, + "end": 1594, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 1379, + "end": 1381, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 1368, "end": 1377, "name": "DUP3", "source": 1 }, + { "begin": 1364, "end": 1382, "name": "ADD", "source": 1 }, + { "begin": 1356, "end": 1382, "name": "SWAP1", "source": 1 }, + { "begin": 1356, "end": 1382, "name": "POP", "source": 1 }, + { "begin": 1428, "end": 1437, "name": "DUP2", "source": 1 }, + { "begin": 1422, "end": 1426, "name": "DUP2", "source": 1 }, + { "begin": 1418, "end": 1438, "name": "SUB", "source": 1 }, + { + "begin": 1414, + "end": 1415, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1403, "end": 1412, "name": "DUP4", "source": 1 }, + { "begin": 1399, "end": 1416, "name": "ADD", "source": 1 }, + { "begin": 1392, "end": 1439, "name": "MSTORE", "source": 1 }, + { + "begin": 1456, + "end": 1587, + "name": "PUSH [tag]", + "source": 1, + "value": "32" + }, + { "begin": 1582, "end": 1586, "name": "DUP2", "source": 1 }, + { + "begin": 1456, + "end": 1587, + "name": "PUSH [tag]", + "source": 1, + "value": "24" + }, + { + "begin": 1456, + "end": 1587, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1456, + "end": 1587, + "name": "tag", + "source": 1, + "value": "32" + }, + { "begin": 1456, "end": 1587, "name": "JUMPDEST", "source": 1 }, + { "begin": 1448, "end": 1587, "name": "SWAP1", "source": 1 }, + { "begin": 1448, "end": 1587, "name": "POP", "source": 1 }, + { "begin": 1346, "end": 1594, "name": "SWAP2", "source": 1 }, + { "begin": 1346, "end": 1594, "name": "SWAP1", "source": 1 }, + { "begin": 1346, "end": 1594, "name": "POP", "source": 1 }, + { + "begin": 1346, + "end": 1594, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1600, + "end": 1769, + "name": "tag", + "source": 1, + "value": "21" + }, + { "begin": 1600, "end": 1769, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1600, + "end": 1769, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1718, "end": 1724, "name": "DUP3", "source": 1 }, + { "begin": 1713, "end": 1716, "name": "DUP3", "source": 1 }, + { "begin": 1706, "end": 1725, "name": "MSTORE", "source": 1 }, + { + "begin": 1758, + "end": 1762, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 1753, "end": 1756, "name": "DUP3", "source": 1 }, + { "begin": 1749, "end": 1763, "name": "ADD", "source": 1 }, + { "begin": 1734, "end": 1763, "name": "SWAP1", "source": 1 }, + { "begin": 1734, "end": 1763, "name": "POP", "source": 1 }, + { "begin": 1696, "end": 1769, "name": "SWAP3", "source": 1 }, + { "begin": 1696, "end": 1769, "name": "SWAP2", "source": 1 }, + { "begin": 1696, "end": 1769, "name": "POP", "source": 1 }, + { "begin": 1696, "end": 1769, "name": "POP", "source": 1 }, + { + "begin": 1696, + "end": 1769, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1775, + "end": 1955, + "name": "tag", + "source": 1, + "value": "23" + }, + { "begin": 1775, "end": 1955, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1915, + "end": 1947, + "name": "PUSH", + "source": 1, + "value": "656C6C6970746963206375727665206164646974696F6E206661696C65640000" + }, + { + "begin": 1911, + "end": 1912, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1903, "end": 1909, "name": "DUP3", "source": 1 }, + { "begin": 1899, "end": 1913, "name": "ADD", "source": 1 }, + { "begin": 1892, "end": 1948, "name": "MSTORE", "source": 1 }, + { "begin": 1881, "end": 1955, "name": "POP", "source": 1 }, + { + "begin": 1881, + "end": 1955, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1961, + "end": 2117, + "name": "tag", + "source": 1, + "value": "28" + }, + { "begin": 1961, "end": 2117, "name": "JUMPDEST", "source": 1 }, + { + "begin": 2101, + "end": 2109, + "name": "PUSH", + "source": 1, + "value": "6661696C65640000000000000000000000000000000000000000000000000000" + }, + { + "begin": 2097, + "end": 2098, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 2089, "end": 2095, "name": "DUP3", "source": 1 }, + { "begin": 2085, "end": 2099, "name": "ADD", "source": 1 }, + { "begin": 2078, "end": 2110, "name": "MSTORE", "source": 1 }, + { "begin": 2067, "end": 2117, "name": "POP", "source": 1 }, + { + "begin": 2067, + "end": 2117, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 34, + "end": 1326, + "name": "tag", + "source": 0, + "value": "16" + }, + { "begin": 34, "end": 1326, "name": "JUMPDEST", "source": 0 }, + { + "begin": 34, + "end": 1326, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 34, "end": 1326, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 1326, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 34, + "end": 1326, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 1326, "name": "CODECOPY", "source": 0 }, + { + "begin": 34, + "end": 1326, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 1326, "name": "RETURN", "source": 0 } + ], + ".data": { + "0": { + ".auxdata": "a2646970667358221220a18633c4ec2f5fd19918720cc9181bf53e954372785d2b34c64298c5275b4d5264736f6c63430008030033", + ".code": [ + { + "begin": 34, + "end": 1326, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 34, + "end": 1326, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 1326, "name": "MSTORE", "source": 0 }, + { + "begin": 34, + "end": 1326, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 1326, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 1326, "name": "REVERT", "source": 0 } + ] + } + } + }, + "methodIdentifiers": {} + }, + "ewasm": { "wasm": "" }, + "metadata": "{\"compiler\":{\"version\":\"0.8.3+commit.8d00100c\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"main.sol\":\"Bn128Addition\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"main.sol\":{\"keccak256\":\"0xa69c6a43cafc5dee64bc54ce2a53939c8a8e4f352073e190d2d966c2776ce646\",\"urls\":[\"bzz-raw://5349651b4604d8e14aefaefb5c3dd7cc9f18250cc2e405afb196f1d932cfc602\",\"dweb:/ipfs/QmRqKv4ehqib45LwVT7EQZfm6vn7zjk8AwJiSDNL1ubhtb\"]}},\"version\":1}", + "storageLayout": { "storage": [], "types": null }, + "userdoc": { "kind": "user", "methods": {}, "version": 1 } + }, + "sourceCode": "\n pragma solidity >=0.8.0;\n contract Bn128Addition{\n constructor() {\n bool success;\n uint256[4] memory input = [\n 0x2243525c5efd4b9c3d3c45ac0ca3fe4dd85e830a4ce6b65fa1eeaee202839703,\n 0x301d1d33be6da8e509df21cc35964723180eed7532537db9ae5e7d48f195c915,\n 0x18b18acfb4c2c30276db5411368e7185b311dd124691610c5d3b74034e093dc9,\n 0x063c909c4720840cb5134cb9f59fa749755796819658d32efc0d288198f37266\n ];\n uint256[2] memory result;\n\n assembly {\n // 0x06 id of the bn256Add precompile\n // 0 number of ether to transfer\n // 128 size of call parameters, i.e. 128 bytes total\n // 64 size of return value, i.e. 64 bytes / 512 bit for a BN256 curve point\n success := call(not(0), 0x06, 0, input, 128, result, 64)\n }\n require(success, \"elliptic curve addition failed\");\n require(\n result[0] ==\n 0x2bd3e6d0f3b142924f5ca7b49ce5b9d54c4703d7ae5648e61d02268b1a0a9fb7,\n \"failed\");\n require(\n result[1] ==\n 0x21611ce0a6af85915e2f1d70300909ce2e49dfad4a4619c8390cae66cefdb204,\n \"failed\");\n }\n }" +} diff --git a/tests/contracts/compiled/Bn128Multiply.json b/tests/contracts/compiled/Bn128Multiply.json new file mode 100644 index 00000000000..23cee13b640 --- /dev/null +++ b/tests/contracts/compiled/Bn128Multiply.json @@ -0,0 +1,2059 @@ +{ + "byteCode": "0x608060405234801561001057600080fd5b5060008060405180606001604052807f1a87b0584ce92f4593d161480614f2989035225609f08058ccfa3d0f940febe381526020017f1a2f3c951f6dadcc7ee9007dff81504b0fcd6d7cf59996efdc33d92bf7f9f8f681526020017f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000008152509050610099610231565b60408160608460006007600019f19250826100e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100e090610299565b60405180910390fd5b7f1a87b0584ce92f4593d161480614f2989035225609f08058ccfa3d0f940febe381600060028110610144577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015114610189576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610180906102b9565b60405180910390fd5b7f163511ddc1c3f25d396745388200081287b3fd1472d8339d5fecb2eae0830451816001600281106101e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015114610229576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610220906102b9565b60405180910390fd5b50505061033c565b6040518060400160405280600290602082028036833780820191505090505090565b6000610260601e836102d9565b915061026b826102ea565b602082019050919050565b60006102836006836102d9565b915061028e82610313565b602082019050919050565b600060208201905081810360008301526102b281610253565b9050919050565b600060208201905081810360008301526102d281610276565b9050919050565b600082825260208201905092915050565b7f656c6c6970746963206375727665206164646974696f6e206661696c65640000600082015250565b7f6661696c65640000000000000000000000000000000000000000000000000000600082015250565b603f8061034a6000396000f3fe6080604052600080fdfea26469706673582212209a97bc97d5e3a377e8298e3b3a72b24963abb30bc27bb2266ae137b12aac8cc964736f6c63430008030033", + "contract": { + "abi": [ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" } + ], + "devdoc": { "kind": "dev", "methods": {}, "version": 1 }, + "evm": { + "assembly": " /* \"main.sol\":34:1229 contract Bn128Multiply{... */\n mstore(0x40, 0x80)\n /* \"main.sol\":66:1223 constructor() {... */\n callvalue\n dup1\n iszero\n tag_1\n jumpi\n 0x00\n dup1\n revert\ntag_1:\n pop\n /* \"main.sol\":94:106 bool success */\n 0x00\n /* \"main.sol\":120:143 uint256[3] memory input */\n dup1\n /* \"main.sol\":120:400 uint256[3] memory input = [... */\n mload(0x40)\n dup1\n 0x60\n add\n 0x40\n mstore\n dup1\n /* \"main.sol\":160:226 0x1a87b0584ce92f4593d161480614f2989035225609f08058ccfa3d0f940febe3 */\n 0x1a87b0584ce92f4593d161480614f2989035225609f08058ccfa3d0f940febe3\n /* \"main.sol\":120:400 uint256[3] memory input = [... */\n dup2\n mstore\n 0x20\n add\n /* \"main.sol\":240:306 0x1a2f3c951f6dadcc7ee9007dff81504b0fcd6d7cf59996efdc33d92bf7f9f8f6 */\n 0x1a2f3c951f6dadcc7ee9007dff81504b0fcd6d7cf59996efdc33d92bf7f9f8f6\n /* \"main.sol\":120:400 uint256[3] memory input = [... */\n dup2\n mstore\n 0x20\n add\n /* \"main.sol\":320:386 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000000 */\n 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000000\n /* \"main.sol\":120:400 uint256[3] memory input = [... */\n dup2\n mstore\n pop\n swap1\n pop\n /* \"main.sol\":414:438 uint256[2] memory result */\n tag_4\n tag_5\n jump\t// in\ntag_4:\n /* \"main.sol\":818:820 64 */\n 0x40\n /* \"main.sol\":810:816 result */\n dup2\n /* \"main.sol\":806:808 96 */\n 0x60\n /* \"main.sol\":799:804 input */\n dup5\n /* \"main.sol\":796:797 0 */\n 0x00\n /* \"main.sol\":790:794 0x07 */\n 0x07\n /* \"main.sol\":786:787 0 */\n 0x00\n /* \"main.sol\":782:788 not(0) */\n not\n /* \"main.sol\":777:821 call(not(0), 0x07, 0, input, 96, result, 64) */\n call\n /* \"main.sol\":766:821 success := call(not(0), 0x07, 0, input, 96, result, 64) */\n swap3\n pop\n /* \"main.sol\":856:863 success */\n dup3\n /* \"main.sol\":848:898 require(success, \"elliptic curve addition failed\") */\n tag_6\n jumpi\n mload(0x40)\n 0x08c379a000000000000000000000000000000000000000000000000000000000\n dup2\n mstore\n 0x04\n add\n tag_7\n swap1\n tag_8\n jump\t// in\ntag_7:\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n revert\ntag_6:\n /* \"main.sol\":966:1032 0x1a87b0584ce92f4593d161480614f2989035225609f08058ccfa3d0f940febe3 */\n 0x1a87b0584ce92f4593d161480614f2989035225609f08058ccfa3d0f940febe3\n /* \"main.sol\":937:943 result */\n dup2\n /* \"main.sol\":944:945 0 */\n 0x00\n /* \"main.sol\":937:946 result[0] */\n 0x02\n dup2\n lt\n tag_9\n jumpi\n mstore(0x00, 0x4e487b7100000000000000000000000000000000000000000000000000000000)\n mstore(0x04, 0x32)\n revert(0x00, 0x24)\ntag_9:\n 0x20\n mul\n add\n mload\n /* \"main.sol\":937:1032 result[0] ==... */\n eq\n /* \"main.sol\":912:1055 require(... */\n tag_10\n jumpi\n mload(0x40)\n 0x08c379a000000000000000000000000000000000000000000000000000000000\n dup2\n mstore\n 0x04\n add\n tag_11\n swap1\n tag_12\n jump\t// in\ntag_11:\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n revert\ntag_10:\n /* \"main.sol\":1123:1189 0x163511ddc1c3f25d396745388200081287b3fd1472d8339d5fecb2eae0830451 */\n 0x163511ddc1c3f25d396745388200081287b3fd1472d8339d5fecb2eae0830451\n /* \"main.sol\":1094:1100 result */\n dup2\n /* \"main.sol\":1101:1102 1 */\n 0x01\n /* \"main.sol\":1094:1103 result[1] */\n 0x02\n dup2\n lt\n tag_13\n jumpi\n mstore(0x00, 0x4e487b7100000000000000000000000000000000000000000000000000000000)\n mstore(0x04, 0x32)\n revert(0x00, 0x24)\ntag_13:\n 0x20\n mul\n add\n mload\n /* \"main.sol\":1094:1189 result[1] ==... */\n eq\n /* \"main.sol\":1069:1212 require(... */\n tag_14\n jumpi\n mload(0x40)\n 0x08c379a000000000000000000000000000000000000000000000000000000000\n dup2\n mstore\n 0x04\n add\n tag_15\n swap1\n tag_12\n jump\t// in\ntag_15:\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n revert\ntag_14:\n /* \"main.sol\":66:1223 constructor() {... */\n pop\n pop\n pop\n /* \"main.sol\":34:1229 contract Bn128Multiply{... */\n jump(tag_16)\ntag_5:\n mload(0x40)\n dup1\n 0x40\n add\n 0x40\n mstore\n dup1\n 0x02\n swap1\n 0x20\n dup3\n mul\n dup1\n calldatasize\n dup4\n calldatacopy\n dup1\n dup3\n add\n swap2\n pop\n pop\n swap1\n pop\n pop\n swap1\n jump\t// out\n /* \"#utility.yul\":7:373 */\ntag_18:\n 0x00\n /* \"#utility.yul\":170:237 */\n tag_20\n /* \"#utility.yul\":234:236 */\n 0x1e\n /* \"#utility.yul\":229:232 */\n dup4\n /* \"#utility.yul\":170:237 */\n tag_21\n jump\t// in\ntag_20:\n /* \"#utility.yul\":163:237 */\n swap2\n pop\n /* \"#utility.yul\":246:339 */\n tag_22\n /* \"#utility.yul\":335:338 */\n dup3\n /* \"#utility.yul\":246:339 */\n tag_23\n jump\t// in\ntag_22:\n /* \"#utility.yul\":364:366 */\n 0x20\n /* \"#utility.yul\":359:362 */\n dup3\n /* \"#utility.yul\":355:367 */\n add\n /* \"#utility.yul\":348:367 */\n swap1\n pop\n /* \"#utility.yul\":153:373 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":379:744 */\ntag_24:\n 0x00\n /* \"#utility.yul\":542:608 */\n tag_26\n /* \"#utility.yul\":606:607 */\n 0x06\n /* \"#utility.yul\":601:604 */\n dup4\n /* \"#utility.yul\":542:608 */\n tag_21\n jump\t// in\ntag_26:\n /* \"#utility.yul\":535:608 */\n swap2\n pop\n /* \"#utility.yul\":617:710 */\n tag_27\n /* \"#utility.yul\":706:709 */\n dup3\n /* \"#utility.yul\":617:710 */\n tag_28\n jump\t// in\ntag_27:\n /* \"#utility.yul\":735:737 */\n 0x20\n /* \"#utility.yul\":730:733 */\n dup3\n /* \"#utility.yul\":726:738 */\n add\n /* \"#utility.yul\":719:738 */\n swap1\n pop\n /* \"#utility.yul\":525:744 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":750:1169 */\ntag_8:\n 0x00\n /* \"#utility.yul\":954:956 */\n 0x20\n /* \"#utility.yul\":943:952 */\n dup3\n /* \"#utility.yul\":939:957 */\n add\n /* \"#utility.yul\":931:957 */\n swap1\n pop\n /* \"#utility.yul\":1003:1012 */\n dup2\n /* \"#utility.yul\":997:1001 */\n dup2\n /* \"#utility.yul\":993:1013 */\n sub\n /* \"#utility.yul\":989:990 */\n 0x00\n /* \"#utility.yul\":978:987 */\n dup4\n /* \"#utility.yul\":974:991 */\n add\n /* \"#utility.yul\":967:1014 */\n mstore\n /* \"#utility.yul\":1031:1162 */\n tag_30\n /* \"#utility.yul\":1157:1161 */\n dup2\n /* \"#utility.yul\":1031:1162 */\n tag_18\n jump\t// in\ntag_30:\n /* \"#utility.yul\":1023:1162 */\n swap1\n pop\n /* \"#utility.yul\":921:1169 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":1175:1594 */\ntag_12:\n 0x00\n /* \"#utility.yul\":1379:1381 */\n 0x20\n /* \"#utility.yul\":1368:1377 */\n dup3\n /* \"#utility.yul\":1364:1382 */\n add\n /* \"#utility.yul\":1356:1382 */\n swap1\n pop\n /* \"#utility.yul\":1428:1437 */\n dup2\n /* \"#utility.yul\":1422:1426 */\n dup2\n /* \"#utility.yul\":1418:1438 */\n sub\n /* \"#utility.yul\":1414:1415 */\n 0x00\n /* \"#utility.yul\":1403:1412 */\n dup4\n /* \"#utility.yul\":1399:1416 */\n add\n /* \"#utility.yul\":1392:1439 */\n mstore\n /* \"#utility.yul\":1456:1587 */\n tag_32\n /* \"#utility.yul\":1582:1586 */\n dup2\n /* \"#utility.yul\":1456:1587 */\n tag_24\n jump\t// in\ntag_32:\n /* \"#utility.yul\":1448:1587 */\n swap1\n pop\n /* \"#utility.yul\":1346:1594 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":1600:1769 */\ntag_21:\n 0x00\n /* \"#utility.yul\":1718:1724 */\n dup3\n /* \"#utility.yul\":1713:1716 */\n dup3\n /* \"#utility.yul\":1706:1725 */\n mstore\n /* \"#utility.yul\":1758:1762 */\n 0x20\n /* \"#utility.yul\":1753:1756 */\n dup3\n /* \"#utility.yul\":1749:1763 */\n add\n /* \"#utility.yul\":1734:1763 */\n swap1\n pop\n /* \"#utility.yul\":1696:1769 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":1775:1955 */\ntag_23:\n /* \"#utility.yul\":1915:1947 */\n 0x656c6c6970746963206375727665206164646974696f6e206661696c65640000\n /* \"#utility.yul\":1911:1912 */\n 0x00\n /* \"#utility.yul\":1903:1909 */\n dup3\n /* \"#utility.yul\":1899:1913 */\n add\n /* \"#utility.yul\":1892:1948 */\n mstore\n /* \"#utility.yul\":1881:1955 */\n pop\n jump\t// out\n /* \"#utility.yul\":1961:2117 */\ntag_28:\n /* \"#utility.yul\":2101:2109 */\n 0x6661696c65640000000000000000000000000000000000000000000000000000\n /* \"#utility.yul\":2097:2098 */\n 0x00\n /* \"#utility.yul\":2089:2095 */\n dup3\n /* \"#utility.yul\":2085:2099 */\n add\n /* \"#utility.yul\":2078:2110 */\n mstore\n /* \"#utility.yul\":2067:2117 */\n pop\n jump\t// out\n /* \"main.sol\":34:1229 contract Bn128Multiply{... */\ntag_16:\n dataSize(sub_0)\n dup1\n dataOffset(sub_0)\n 0x00\n codecopy\n 0x00\n return\nstop\n\nsub_0: assembly {\n /* \"main.sol\":34:1229 contract Bn128Multiply{... */\n mstore(0x40, 0x80)\n 0x00\n dup1\n revert\n\n auxdata: 0xa26469706673582212209a97bc97d5e3a377e8298e3b3a72b24963abb30bc27bb2266ae137b12aac8cc964736f6c63430008030033\n}\n", + "bytecode": { + "generatedSources": [ + { + "ast": { + "nodeType": "YulBlock", + "src": "0:2120:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "153:220:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "163:74:1", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "229:3:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "234:2:1", + "type": "", + "value": "30" + } + ], + "functionName": { + "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", + "nodeType": "YulIdentifier", + "src": "170:58:1" + }, + "nodeType": "YulFunctionCall", + "src": "170:67:1" + }, + "variableNames": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "163:3:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "335:3:1" + } + ], + "functionName": { + "name": "store_literal_in_memory_0b6c4680c9699354fe09d0e864e370495b9b131fb2b406b5cf2517a420eb7e27", + "nodeType": "YulIdentifier", + "src": "246:88:1" + }, + "nodeType": "YulFunctionCall", + "src": "246:93:1" + }, + "nodeType": "YulExpressionStatement", + "src": "246:93:1" + }, + { + "nodeType": "YulAssignment", + "src": "348:19:1", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "359:3:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "364:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "355:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "355:12:1" + }, + "variableNames": [ + { + "name": "end", + "nodeType": "YulIdentifier", + "src": "348:3:1" + } + ] + } + ] + }, + "name": "abi_encode_t_stringliteral_0b6c4680c9699354fe09d0e864e370495b9b131fb2b406b5cf2517a420eb7e27_to_t_string_memory_ptr_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "141:3:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "end", + "nodeType": "YulTypedName", + "src": "149:3:1", + "type": "" + } + ], + "src": "7:366:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "525:219:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "535:73:1", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "601:3:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "606:1:1", + "type": "", + "value": "6" + } + ], + "functionName": { + "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", + "nodeType": "YulIdentifier", + "src": "542:58:1" + }, + "nodeType": "YulFunctionCall", + "src": "542:66:1" + }, + "variableNames": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "535:3:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "706:3:1" + } + ], + "functionName": { + "name": "store_literal_in_memory_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43", + "nodeType": "YulIdentifier", + "src": "617:88:1" + }, + "nodeType": "YulFunctionCall", + "src": "617:93:1" + }, + "nodeType": "YulExpressionStatement", + "src": "617:93:1" + }, + { + "nodeType": "YulAssignment", + "src": "719:19:1", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "730:3:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "735:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "726:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "726:12:1" + }, + "variableNames": [ + { + "name": "end", + "nodeType": "YulIdentifier", + "src": "719:3:1" + } + ] + } + ] + }, + "name": "abi_encode_t_stringliteral_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43_to_t_string_memory_ptr_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "513:3:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "end", + "nodeType": "YulTypedName", + "src": "521:3:1", + "type": "" + } + ], + "src": "379:365:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "921:248:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "931:26:1", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "943:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "954:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "939:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "939:18:1" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "931:4:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "978:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "989:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "974:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "974:17:1" + }, + { + "arguments": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "997:4:1" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "1003:9:1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "993:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "993:20:1" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "967:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "967:47:1" + }, + "nodeType": "YulExpressionStatement", + "src": "967:47:1" + }, + { + "nodeType": "YulAssignment", + "src": "1023:139:1", + "value": { + "arguments": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "1157:4:1" + } + ], + "functionName": { + "name": "abi_encode_t_stringliteral_0b6c4680c9699354fe09d0e864e370495b9b131fb2b406b5cf2517a420eb7e27_to_t_string_memory_ptr_fromStack", + "nodeType": "YulIdentifier", + "src": "1031:124:1" + }, + "nodeType": "YulFunctionCall", + "src": "1031:131:1" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "1023:4:1" + } + ] + } + ] + }, + "name": "abi_encode_tuple_t_stringliteral_0b6c4680c9699354fe09d0e864e370495b9b131fb2b406b5cf2517a420eb7e27__to_t_string_memory_ptr__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "901:9:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "916:4:1", + "type": "" + } + ], + "src": "750:419:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1346:248:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "1356:26:1", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "1368:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1379:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1364:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1364:18:1" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "1356:4:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "1403:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1414:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1399:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1399:17:1" + }, + { + "arguments": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "1422:4:1" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "1428:9:1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "1418:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1418:20:1" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "1392:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1392:47:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1392:47:1" + }, + { + "nodeType": "YulAssignment", + "src": "1448:139:1", + "value": { + "arguments": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "1582:4:1" + } + ], + "functionName": { + "name": "abi_encode_t_stringliteral_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43_to_t_string_memory_ptr_fromStack", + "nodeType": "YulIdentifier", + "src": "1456:124:1" + }, + "nodeType": "YulFunctionCall", + "src": "1456:131:1" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "1448:4:1" + } + ] + } + ] + }, + "name": "abi_encode_tuple_t_stringliteral_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43__to_t_string_memory_ptr__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "1326:9:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "1341:4:1", + "type": "" + } + ], + "src": "1175:419:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1696:73:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "1713:3:1" + }, + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "1718:6:1" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "1706:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1706:19:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1706:19:1" + }, + { + "nodeType": "YulAssignment", + "src": "1734:29:1", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "1753:3:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1758:4:1", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1749:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1749:14:1" + }, + "variableNames": [ + { + "name": "updated_pos", + "nodeType": "YulIdentifier", + "src": "1734:11:1" + } + ] + } + ] + }, + "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "1668:3:1", + "type": "" + }, + { + "name": "length", + "nodeType": "YulTypedName", + "src": "1673:6:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "updated_pos", + "nodeType": "YulTypedName", + "src": "1684:11:1", + "type": "" + } + ], + "src": "1600:169:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1881:74:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "memPtr", + "nodeType": "YulIdentifier", + "src": "1903:6:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1911:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1899:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1899:14:1" + }, + { + "kind": "string", + "nodeType": "YulLiteral", + "src": "1915:32:1", + "type": "", + "value": "elliptic curve addition failed" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "1892:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1892:56:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1892:56:1" + } + ] + }, + "name": "store_literal_in_memory_0b6c4680c9699354fe09d0e864e370495b9b131fb2b406b5cf2517a420eb7e27", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "memPtr", + "nodeType": "YulTypedName", + "src": "1873:6:1", + "type": "" + } + ], + "src": "1775:180:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "2067:50:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "memPtr", + "nodeType": "YulIdentifier", + "src": "2089:6:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "2097:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "2085:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "2085:14:1" + }, + { + "kind": "string", + "nodeType": "YulLiteral", + "src": "2101:8:1", + "type": "", + "value": "failed" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "2078:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "2078:32:1" + }, + "nodeType": "YulExpressionStatement", + "src": "2078:32:1" + } + ] + }, + "name": "store_literal_in_memory_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "memPtr", + "nodeType": "YulTypedName", + "src": "2059:6:1", + "type": "" + } + ], + "src": "1961:156:1" + } + ] + }, + "contents": "{\n\n function abi_encode_t_stringliteral_0b6c4680c9699354fe09d0e864e370495b9b131fb2b406b5cf2517a420eb7e27_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 30)\n store_literal_in_memory_0b6c4680c9699354fe09d0e864e370495b9b131fb2b406b5cf2517a420eb7e27(pos)\n end := add(pos, 32)\n }\n\n function abi_encode_t_stringliteral_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 6)\n store_literal_in_memory_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43(pos)\n end := add(pos, 32)\n }\n\n function abi_encode_tuple_t_stringliteral_0b6c4680c9699354fe09d0e864e370495b9b131fb2b406b5cf2517a420eb7e27__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_0b6c4680c9699354fe09d0e864e370495b9b131fb2b406b5cf2517a420eb7e27_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n function abi_encode_tuple_t_stringliteral_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n function array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, length) -> updated_pos {\n mstore(pos, length)\n updated_pos := add(pos, 0x20)\n }\n\n function store_literal_in_memory_0b6c4680c9699354fe09d0e864e370495b9b131fb2b406b5cf2517a420eb7e27(memPtr) {\n\n mstore(add(memPtr, 0), \"elliptic curve addition failed\")\n\n }\n\n function store_literal_in_memory_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43(memPtr) {\n\n mstore(add(memPtr, 0), \"failed\")\n\n }\n\n}\n", + "id": 1, + "language": "Yul", + "name": "#utility.yul" + } + ], + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b5060008060405180606001604052807f1a87b0584ce92f4593d161480614f2989035225609f08058ccfa3d0f940febe381526020017f1a2f3c951f6dadcc7ee9007dff81504b0fcd6d7cf59996efdc33d92bf7f9f8f681526020017f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000008152509050610099610231565b60408160608460006007600019f19250826100e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100e090610299565b60405180910390fd5b7f1a87b0584ce92f4593d161480614f2989035225609f08058ccfa3d0f940febe381600060028110610144577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015114610189576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610180906102b9565b60405180910390fd5b7f163511ddc1c3f25d396745388200081287b3fd1472d8339d5fecb2eae0830451816001600281106101e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015114610229576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610220906102b9565b60405180910390fd5b50505061033c565b6040518060400160405280600290602082028036833780820191505090505090565b6000610260601e836102d9565b915061026b826102ea565b602082019050919050565b60006102836006836102d9565b915061028e82610313565b602082019050919050565b600060208201905081810360008301526102b281610253565b9050919050565b600060208201905081810360008301526102d281610276565b9050919050565b600082825260208201905092915050565b7f656c6c6970746963206375727665206164646974696f6e206661696c65640000600082015250565b7f6661696c65640000000000000000000000000000000000000000000000000000600082015250565b603f8061034a6000396000f3fe6080604052600080fdfea26469706673582212209a97bc97d5e3a377e8298e3b3a72b24963abb30bc27bb2266ae137b12aac8cc964736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 PUSH1 0x40 MLOAD DUP1 PUSH1 0x60 ADD PUSH1 0x40 MSTORE DUP1 PUSH32 0x1A87B0584CE92F4593D161480614F2989035225609F08058CCFA3D0F940FEBE3 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x1A2F3C951F6DADCC7EE9007DFF81504B0FCD6D7CF59996EFDC33D92BF7F9F8F6 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x30644E72E131A029B85045B68181585D2833E84879B9709143E1F593F0000000 DUP2 MSTORE POP SWAP1 POP PUSH2 0x99 PUSH2 0x231 JUMP JUMPDEST PUSH1 0x40 DUP2 PUSH1 0x60 DUP5 PUSH1 0x0 PUSH1 0x7 PUSH1 0x0 NOT CALL SWAP3 POP DUP3 PUSH2 0xE9 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xE0 SWAP1 PUSH2 0x299 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH32 0x1A87B0584CE92F4593D161480614F2989035225609F08058CCFA3D0F940FEBE3 DUP2 PUSH1 0x0 PUSH1 0x2 DUP2 LT PUSH2 0x144 JUMPI PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x32 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x20 MUL ADD MLOAD EQ PUSH2 0x189 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x180 SWAP1 PUSH2 0x2B9 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH32 0x163511DDC1C3F25D396745388200081287B3FD1472D8339D5FECB2EAE0830451 DUP2 PUSH1 0x1 PUSH1 0x2 DUP2 LT PUSH2 0x1E4 JUMPI PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x32 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x20 MUL ADD MLOAD EQ PUSH2 0x229 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x220 SWAP1 PUSH2 0x2B9 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP POP POP PUSH2 0x33C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2 SWAP1 PUSH1 0x20 DUP3 MUL DUP1 CALLDATASIZE DUP4 CALLDATACOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP POP SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x260 PUSH1 0x1E DUP4 PUSH2 0x2D9 JUMP JUMPDEST SWAP2 POP PUSH2 0x26B DUP3 PUSH2 0x2EA JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x283 PUSH1 0x6 DUP4 PUSH2 0x2D9 JUMP JUMPDEST SWAP2 POP PUSH2 0x28E DUP3 PUSH2 0x313 JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x2B2 DUP2 PUSH2 0x253 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x2D2 DUP2 PUSH2 0x276 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH32 0x656C6C6970746963206375727665206164646974696F6E206661696C65640000 PUSH1 0x0 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH32 0x6661696C65640000000000000000000000000000000000000000000000000000 PUSH1 0x0 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH1 0x3F DUP1 PUSH2 0x34A PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 SWAP11 SWAP8 0xBC SWAP8 0xD5 0xE3 LOG3 PUSH24 0xE8298E3B3A72B24963ABB30BC27BB2266AE137B12AAC8CC9 PUSH5 0x736F6C6343 STOP ADDMOD SUB STOP CALLER ", + "sourceMap": "34:1195:0:-:0;;;66:1157;;;;;;;;;;94:12;120:23;:280;;;;;;;;160:66;120:280;;;;240:66;120:280;;;;320:66;120:280;;;;;414:24;;:::i;:::-;818:2;810:6;806:2;799:5;796:1;790:4;786:1;782:6;777:44;766:55;;856:7;848:50;;;;;;;;;;;;:::i;:::-;;;;;;;;;966:66;937:6;944:1;937:9;;;;;;;;;;;;;;;;;;;:95;912:143;;;;;;;;;;;;:::i;:::-;;;;;;;;;1123:66;1094:6;1101:1;1094:9;;;;;;;;;;;;;;;;;;;:95;1069:143;;;;;;;;;;;;:::i;:::-;;;;;;;;;66:1157;;;34:1195;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;7:366:1:-;;170:67;234:2;229:3;170:67;:::i;:::-;163:74;;246:93;335:3;246:93;:::i;:::-;364:2;359:3;355:12;348:19;;153:220;;;:::o;379:365::-;;542:66;606:1;601:3;542:66;:::i;:::-;535:73;;617:93;706:3;617:93;:::i;:::-;735:2;730:3;726:12;719:19;;525:219;;;:::o;750:419::-;;954:2;943:9;939:18;931:26;;1003:9;997:4;993:20;989:1;978:9;974:17;967:47;1031:131;1157:4;1031:131;:::i;:::-;1023:139;;921:248;;;:::o;1175:419::-;;1379:2;1368:9;1364:18;1356:26;;1428:9;1422:4;1418:20;1414:1;1403:9;1399:17;1392:47;1456:131;1582:4;1456:131;:::i;:::-;1448:139;;1346:248;;;:::o;1600:169::-;;1718:6;1713:3;1706:19;1758:4;1753:3;1749:14;1734:29;;1696:73;;;;:::o;1775:180::-;1915:32;1911:1;1903:6;1899:14;1892:56;1881:74;:::o;1961:156::-;2101:8;2097:1;2089:6;2085:14;2078:32;2067:50;:::o;34:1195:0:-;;;;;;;" + }, + "deployedBytecode": { + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "6080604052600080fdfea26469706673582212209a97bc97d5e3a377e8298e3b3a72b24963abb30bc27bb2266ae137b12aac8cc964736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 SWAP11 SWAP8 0xBC SWAP8 0xD5 0xE3 LOG3 PUSH24 0xE8298E3B3A72B24963ABB30BC27BB2266AE137B12AAC8CC9 PUSH5 0x736F6C6343 STOP ADDMOD SUB STOP CALLER ", + "sourceMap": "34:1195:0:-:0;;;;;" + }, + "gasEstimates": { + "creation": { + "codeDepositCost": "12600", + "executionCost": "infinite", + "totalCost": "infinite" + } + }, + "legacyAssembly": { + ".code": [ + { + "begin": 34, + "end": 1229, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 34, + "end": 1229, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 1229, "name": "MSTORE", "source": 0 }, + { "begin": 66, "end": 1223, "name": "CALLVALUE", "source": 0 }, + { "begin": 66, "end": 1223, "name": "DUP1", "source": 0 }, + { "begin": 66, "end": 1223, "name": "ISZERO", "source": 0 }, + { + "begin": 66, + "end": 1223, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 66, "end": 1223, "name": "JUMPI", "source": 0 }, + { + "begin": 66, + "end": 1223, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 66, "end": 1223, "name": "DUP1", "source": 0 }, + { "begin": 66, "end": 1223, "name": "REVERT", "source": 0 }, + { + "begin": 66, + "end": 1223, + "name": "tag", + "source": 0, + "value": "1" + }, + { "begin": 66, "end": 1223, "name": "JUMPDEST", "source": 0 }, + { "begin": 66, "end": 1223, "name": "POP", "source": 0 }, + { + "begin": 94, + "end": 106, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 120, "end": 143, "name": "DUP1", "source": 0 }, + { + "begin": 120, + "end": 400, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 120, "end": 400, "name": "MLOAD", "source": 0 }, + { "begin": 120, "end": 400, "name": "DUP1", "source": 0 }, + { + "begin": 120, + "end": 400, + "name": "PUSH", + "source": 0, + "value": "60" + }, + { "begin": 120, "end": 400, "name": "ADD", "source": 0 }, + { + "begin": 120, + "end": 400, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 120, "end": 400, "name": "MSTORE", "source": 0 }, + { "begin": 120, "end": 400, "name": "DUP1", "source": 0 }, + { + "begin": 160, + "end": 226, + "name": "PUSH", + "source": 0, + "value": "1A87B0584CE92F4593D161480614F2989035225609F08058CCFA3D0F940FEBE3" + }, + { "begin": 120, "end": 400, "name": "DUP2", "source": 0 }, + { "begin": 120, "end": 400, "name": "MSTORE", "source": 0 }, + { + "begin": 120, + "end": 400, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 120, "end": 400, "name": "ADD", "source": 0 }, + { + "begin": 240, + "end": 306, + "name": "PUSH", + "source": 0, + "value": "1A2F3C951F6DADCC7EE9007DFF81504B0FCD6D7CF59996EFDC33D92BF7F9F8F6" + }, + { "begin": 120, "end": 400, "name": "DUP2", "source": 0 }, + { "begin": 120, "end": 400, "name": "MSTORE", "source": 0 }, + { + "begin": 120, + "end": 400, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 120, "end": 400, "name": "ADD", "source": 0 }, + { + "begin": 320, + "end": 386, + "name": "PUSH", + "source": 0, + "value": "30644E72E131A029B85045B68181585D2833E84879B9709143E1F593F0000000" + }, + { "begin": 120, "end": 400, "name": "DUP2", "source": 0 }, + { "begin": 120, "end": 400, "name": "MSTORE", "source": 0 }, + { "begin": 120, "end": 400, "name": "POP", "source": 0 }, + { "begin": 120, "end": 400, "name": "SWAP1", "source": 0 }, + { "begin": 120, "end": 400, "name": "POP", "source": 0 }, + { + "begin": 414, + "end": 438, + "name": "PUSH [tag]", + "source": 0, + "value": "4" + }, + { + "begin": 414, + "end": 438, + "name": "PUSH [tag]", + "source": 0, + "value": "5" + }, + { + "begin": 414, + "end": 438, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 414, + "end": 438, + "name": "tag", + "source": 0, + "value": "4" + }, + { "begin": 414, "end": 438, "name": "JUMPDEST", "source": 0 }, + { + "begin": 818, + "end": 820, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 810, "end": 816, "name": "DUP2", "source": 0 }, + { + "begin": 806, + "end": 808, + "name": "PUSH", + "source": 0, + "value": "60" + }, + { "begin": 799, "end": 804, "name": "DUP5", "source": 0 }, + { + "begin": 796, + "end": 797, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { + "begin": 790, + "end": 794, + "name": "PUSH", + "source": 0, + "value": "7" + }, + { + "begin": 786, + "end": 787, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 782, "end": 788, "name": "NOT", "source": 0 }, + { "begin": 777, "end": 821, "name": "CALL", "source": 0 }, + { "begin": 766, "end": 821, "name": "SWAP3", "source": 0 }, + { "begin": 766, "end": 821, "name": "POP", "source": 0 }, + { "begin": 856, "end": 863, "name": "DUP3", "source": 0 }, + { + "begin": 848, + "end": 898, + "name": "PUSH [tag]", + "source": 0, + "value": "6" + }, + { "begin": 848, "end": 898, "name": "JUMPI", "source": 0 }, + { + "begin": 848, + "end": 898, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 848, "end": 898, "name": "MLOAD", "source": 0 }, + { + "begin": 848, + "end": 898, + "name": "PUSH", + "source": 0, + "value": "8C379A000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 848, "end": 898, "name": "DUP2", "source": 0 }, + { "begin": 848, "end": 898, "name": "MSTORE", "source": 0 }, + { + "begin": 848, + "end": 898, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 848, "end": 898, "name": "ADD", "source": 0 }, + { + "begin": 848, + "end": 898, + "name": "PUSH [tag]", + "source": 0, + "value": "7" + }, + { "begin": 848, "end": 898, "name": "SWAP1", "source": 0 }, + { + "begin": 848, + "end": 898, + "name": "PUSH [tag]", + "source": 0, + "value": "8" + }, + { + "begin": 848, + "end": 898, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 848, + "end": 898, + "name": "tag", + "source": 0, + "value": "7" + }, + { "begin": 848, "end": 898, "name": "JUMPDEST", "source": 0 }, + { + "begin": 848, + "end": 898, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 848, "end": 898, "name": "MLOAD", "source": 0 }, + { "begin": 848, "end": 898, "name": "DUP1", "source": 0 }, + { "begin": 848, "end": 898, "name": "SWAP2", "source": 0 }, + { "begin": 848, "end": 898, "name": "SUB", "source": 0 }, + { "begin": 848, "end": 898, "name": "SWAP1", "source": 0 }, + { "begin": 848, "end": 898, "name": "REVERT", "source": 0 }, + { + "begin": 848, + "end": 898, + "name": "tag", + "source": 0, + "value": "6" + }, + { "begin": 848, "end": 898, "name": "JUMPDEST", "source": 0 }, + { + "begin": 966, + "end": 1032, + "name": "PUSH", + "source": 0, + "value": "1A87B0584CE92F4593D161480614F2989035225609F08058CCFA3D0F940FEBE3" + }, + { "begin": 937, "end": 943, "name": "DUP2", "source": 0 }, + { + "begin": 944, + "end": 945, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { + "begin": 937, + "end": 946, + "name": "PUSH", + "source": 0, + "value": "2" + }, + { "begin": 937, "end": 946, "name": "DUP2", "source": 0 }, + { "begin": 937, "end": 946, "name": "LT", "source": 0 }, + { + "begin": 937, + "end": 946, + "name": "PUSH [tag]", + "source": 0, + "value": "9" + }, + { "begin": 937, "end": 946, "name": "JUMPI", "source": 0 }, + { + "begin": 937, + "end": 946, + "name": "PUSH", + "source": 0, + "value": "4E487B7100000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 937, + "end": 946, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 937, "end": 946, "name": "MSTORE", "source": 0 }, + { + "begin": 937, + "end": 946, + "name": "PUSH", + "source": 0, + "value": "32" + }, + { + "begin": 937, + "end": 946, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 937, "end": 946, "name": "MSTORE", "source": 0 }, + { + "begin": 937, + "end": 946, + "name": "PUSH", + "source": 0, + "value": "24" + }, + { + "begin": 937, + "end": 946, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 937, "end": 946, "name": "REVERT", "source": 0 }, + { + "begin": 937, + "end": 946, + "name": "tag", + "source": 0, + "value": "9" + }, + { "begin": 937, "end": 946, "name": "JUMPDEST", "source": 0 }, + { + "begin": 937, + "end": 946, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 937, "end": 946, "name": "MUL", "source": 0 }, + { "begin": 937, "end": 946, "name": "ADD", "source": 0 }, + { "begin": 937, "end": 946, "name": "MLOAD", "source": 0 }, + { "begin": 937, "end": 1032, "name": "EQ", "source": 0 }, + { + "begin": 912, + "end": 1055, + "name": "PUSH [tag]", + "source": 0, + "value": "10" + }, + { "begin": 912, "end": 1055, "name": "JUMPI", "source": 0 }, + { + "begin": 912, + "end": 1055, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 912, "end": 1055, "name": "MLOAD", "source": 0 }, + { + "begin": 912, + "end": 1055, + "name": "PUSH", + "source": 0, + "value": "8C379A000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 912, "end": 1055, "name": "DUP2", "source": 0 }, + { "begin": 912, "end": 1055, "name": "MSTORE", "source": 0 }, + { + "begin": 912, + "end": 1055, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 912, "end": 1055, "name": "ADD", "source": 0 }, + { + "begin": 912, + "end": 1055, + "name": "PUSH [tag]", + "source": 0, + "value": "11" + }, + { "begin": 912, "end": 1055, "name": "SWAP1", "source": 0 }, + { + "begin": 912, + "end": 1055, + "name": "PUSH [tag]", + "source": 0, + "value": "12" + }, + { + "begin": 912, + "end": 1055, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 912, + "end": 1055, + "name": "tag", + "source": 0, + "value": "11" + }, + { "begin": 912, "end": 1055, "name": "JUMPDEST", "source": 0 }, + { + "begin": 912, + "end": 1055, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 912, "end": 1055, "name": "MLOAD", "source": 0 }, + { "begin": 912, "end": 1055, "name": "DUP1", "source": 0 }, + { "begin": 912, "end": 1055, "name": "SWAP2", "source": 0 }, + { "begin": 912, "end": 1055, "name": "SUB", "source": 0 }, + { "begin": 912, "end": 1055, "name": "SWAP1", "source": 0 }, + { "begin": 912, "end": 1055, "name": "REVERT", "source": 0 }, + { + "begin": 912, + "end": 1055, + "name": "tag", + "source": 0, + "value": "10" + }, + { "begin": 912, "end": 1055, "name": "JUMPDEST", "source": 0 }, + { + "begin": 1123, + "end": 1189, + "name": "PUSH", + "source": 0, + "value": "163511DDC1C3F25D396745388200081287B3FD1472D8339D5FECB2EAE0830451" + }, + { "begin": 1094, "end": 1100, "name": "DUP2", "source": 0 }, + { + "begin": 1101, + "end": 1102, + "name": "PUSH", + "source": 0, + "value": "1" + }, + { + "begin": 1094, + "end": 1103, + "name": "PUSH", + "source": 0, + "value": "2" + }, + { "begin": 1094, "end": 1103, "name": "DUP2", "source": 0 }, + { "begin": 1094, "end": 1103, "name": "LT", "source": 0 }, + { + "begin": 1094, + "end": 1103, + "name": "PUSH [tag]", + "source": 0, + "value": "13" + }, + { "begin": 1094, "end": 1103, "name": "JUMPI", "source": 0 }, + { + "begin": 1094, + "end": 1103, + "name": "PUSH", + "source": 0, + "value": "4E487B7100000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 1094, + "end": 1103, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 1094, "end": 1103, "name": "MSTORE", "source": 0 }, + { + "begin": 1094, + "end": 1103, + "name": "PUSH", + "source": 0, + "value": "32" + }, + { + "begin": 1094, + "end": 1103, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 1094, "end": 1103, "name": "MSTORE", "source": 0 }, + { + "begin": 1094, + "end": 1103, + "name": "PUSH", + "source": 0, + "value": "24" + }, + { + "begin": 1094, + "end": 1103, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 1094, "end": 1103, "name": "REVERT", "source": 0 }, + { + "begin": 1094, + "end": 1103, + "name": "tag", + "source": 0, + "value": "13" + }, + { "begin": 1094, "end": 1103, "name": "JUMPDEST", "source": 0 }, + { + "begin": 1094, + "end": 1103, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 1094, "end": 1103, "name": "MUL", "source": 0 }, + { "begin": 1094, "end": 1103, "name": "ADD", "source": 0 }, + { "begin": 1094, "end": 1103, "name": "MLOAD", "source": 0 }, + { "begin": 1094, "end": 1189, "name": "EQ", "source": 0 }, + { + "begin": 1069, + "end": 1212, + "name": "PUSH [tag]", + "source": 0, + "value": "14" + }, + { "begin": 1069, "end": 1212, "name": "JUMPI", "source": 0 }, + { + "begin": 1069, + "end": 1212, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 1069, "end": 1212, "name": "MLOAD", "source": 0 }, + { + "begin": 1069, + "end": 1212, + "name": "PUSH", + "source": 0, + "value": "8C379A000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 1069, "end": 1212, "name": "DUP2", "source": 0 }, + { "begin": 1069, "end": 1212, "name": "MSTORE", "source": 0 }, + { + "begin": 1069, + "end": 1212, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 1069, "end": 1212, "name": "ADD", "source": 0 }, + { + "begin": 1069, + "end": 1212, + "name": "PUSH [tag]", + "source": 0, + "value": "15" + }, + { "begin": 1069, "end": 1212, "name": "SWAP1", "source": 0 }, + { + "begin": 1069, + "end": 1212, + "name": "PUSH [tag]", + "source": 0, + "value": "12" + }, + { + "begin": 1069, + "end": 1212, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 1069, + "end": 1212, + "name": "tag", + "source": 0, + "value": "15" + }, + { "begin": 1069, "end": 1212, "name": "JUMPDEST", "source": 0 }, + { + "begin": 1069, + "end": 1212, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 1069, "end": 1212, "name": "MLOAD", "source": 0 }, + { "begin": 1069, "end": 1212, "name": "DUP1", "source": 0 }, + { "begin": 1069, "end": 1212, "name": "SWAP2", "source": 0 }, + { "begin": 1069, "end": 1212, "name": "SUB", "source": 0 }, + { "begin": 1069, "end": 1212, "name": "SWAP1", "source": 0 }, + { "begin": 1069, "end": 1212, "name": "REVERT", "source": 0 }, + { + "begin": 1069, + "end": 1212, + "name": "tag", + "source": 0, + "value": "14" + }, + { "begin": 1069, "end": 1212, "name": "JUMPDEST", "source": 0 }, + { "begin": 66, "end": 1223, "name": "POP", "source": 0 }, + { "begin": 66, "end": 1223, "name": "POP", "source": 0 }, + { "begin": 66, "end": 1223, "name": "POP", "source": 0 }, + { + "begin": 34, + "end": 1229, + "name": "PUSH [tag]", + "source": 0, + "value": "16" + }, + { "begin": 34, "end": 1229, "name": "JUMP", "source": 0 }, + { + "begin": 34, + "end": 1229, + "name": "tag", + "source": 0, + "value": "5" + }, + { "begin": 34, "end": 1229, "name": "JUMPDEST", "source": 0 }, + { + "begin": 34, + "end": 1229, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 1229, "name": "MLOAD", "source": 0 }, + { "begin": 34, "end": 1229, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 1229, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 1229, "name": "ADD", "source": 0 }, + { + "begin": 34, + "end": 1229, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 1229, "name": "MSTORE", "source": 0 }, + { "begin": 34, "end": 1229, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 1229, + "name": "PUSH", + "source": 0, + "value": "2" + }, + { "begin": 34, "end": 1229, "name": "SWAP1", "source": 0 }, + { + "begin": 34, + "end": 1229, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 34, "end": 1229, "name": "DUP3", "source": 0 }, + { "begin": 34, "end": 1229, "name": "MUL", "source": 0 }, + { "begin": 34, "end": 1229, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 1229, "name": "CALLDATASIZE", "source": 0 }, + { "begin": 34, "end": 1229, "name": "DUP4", "source": 0 }, + { "begin": 34, "end": 1229, "name": "CALLDATACOPY", "source": 0 }, + { "begin": 34, "end": 1229, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 1229, "name": "DUP3", "source": 0 }, + { "begin": 34, "end": 1229, "name": "ADD", "source": 0 }, + { "begin": 34, "end": 1229, "name": "SWAP2", "source": 0 }, + { "begin": 34, "end": 1229, "name": "POP", "source": 0 }, + { "begin": 34, "end": 1229, "name": "POP", "source": 0 }, + { "begin": 34, "end": 1229, "name": "SWAP1", "source": 0 }, + { "begin": 34, "end": 1229, "name": "POP", "source": 0 }, + { "begin": 34, "end": 1229, "name": "POP", "source": 0 }, + { "begin": 34, "end": 1229, "name": "SWAP1", "source": 0 }, + { + "begin": 34, + "end": 1229, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { "begin": 7, "end": 373, "name": "tag", "source": 1, "value": "18" }, + { "begin": 7, "end": 373, "name": "JUMPDEST", "source": 1 }, + { "begin": 7, "end": 373, "name": "PUSH", "source": 1, "value": "0" }, + { + "begin": 170, + "end": 237, + "name": "PUSH [tag]", + "source": 1, + "value": "20" + }, + { + "begin": 234, + "end": 236, + "name": "PUSH", + "source": 1, + "value": "1E" + }, + { "begin": 229, "end": 232, "name": "DUP4", "source": 1 }, + { + "begin": 170, + "end": 237, + "name": "PUSH [tag]", + "source": 1, + "value": "21" + }, + { + "begin": 170, + "end": 237, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 170, + "end": 237, + "name": "tag", + "source": 1, + "value": "20" + }, + { "begin": 170, "end": 237, "name": "JUMPDEST", "source": 1 }, + { "begin": 163, "end": 237, "name": "SWAP2", "source": 1 }, + { "begin": 163, "end": 237, "name": "POP", "source": 1 }, + { + "begin": 246, + "end": 339, + "name": "PUSH [tag]", + "source": 1, + "value": "22" + }, + { "begin": 335, "end": 338, "name": "DUP3", "source": 1 }, + { + "begin": 246, + "end": 339, + "name": "PUSH [tag]", + "source": 1, + "value": "23" + }, + { + "begin": 246, + "end": 339, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 246, + "end": 339, + "name": "tag", + "source": 1, + "value": "22" + }, + { "begin": 246, "end": 339, "name": "JUMPDEST", "source": 1 }, + { + "begin": 364, + "end": 366, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 359, "end": 362, "name": "DUP3", "source": 1 }, + { "begin": 355, "end": 367, "name": "ADD", "source": 1 }, + { "begin": 348, "end": 367, "name": "SWAP1", "source": 1 }, + { "begin": 348, "end": 367, "name": "POP", "source": 1 }, + { "begin": 153, "end": 373, "name": "SWAP2", "source": 1 }, + { "begin": 153, "end": 373, "name": "SWAP1", "source": 1 }, + { "begin": 153, "end": 373, "name": "POP", "source": 1 }, + { + "begin": 153, + "end": 373, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 379, + "end": 744, + "name": "tag", + "source": 1, + "value": "24" + }, + { "begin": 379, "end": 744, "name": "JUMPDEST", "source": 1 }, + { + "begin": 379, + "end": 744, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 542, + "end": 608, + "name": "PUSH [tag]", + "source": 1, + "value": "26" + }, + { + "begin": 606, + "end": 607, + "name": "PUSH", + "source": 1, + "value": "6" + }, + { "begin": 601, "end": 604, "name": "DUP4", "source": 1 }, + { + "begin": 542, + "end": 608, + "name": "PUSH [tag]", + "source": 1, + "value": "21" + }, + { + "begin": 542, + "end": 608, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 542, + "end": 608, + "name": "tag", + "source": 1, + "value": "26" + }, + { "begin": 542, "end": 608, "name": "JUMPDEST", "source": 1 }, + { "begin": 535, "end": 608, "name": "SWAP2", "source": 1 }, + { "begin": 535, "end": 608, "name": "POP", "source": 1 }, + { + "begin": 617, + "end": 710, + "name": "PUSH [tag]", + "source": 1, + "value": "27" + }, + { "begin": 706, "end": 709, "name": "DUP3", "source": 1 }, + { + "begin": 617, + "end": 710, + "name": "PUSH [tag]", + "source": 1, + "value": "28" + }, + { + "begin": 617, + "end": 710, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 617, + "end": 710, + "name": "tag", + "source": 1, + "value": "27" + }, + { "begin": 617, "end": 710, "name": "JUMPDEST", "source": 1 }, + { + "begin": 735, + "end": 737, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 730, "end": 733, "name": "DUP3", "source": 1 }, + { "begin": 726, "end": 738, "name": "ADD", "source": 1 }, + { "begin": 719, "end": 738, "name": "SWAP1", "source": 1 }, + { "begin": 719, "end": 738, "name": "POP", "source": 1 }, + { "begin": 525, "end": 744, "name": "SWAP2", "source": 1 }, + { "begin": 525, "end": 744, "name": "SWAP1", "source": 1 }, + { "begin": 525, "end": 744, "name": "POP", "source": 1 }, + { + "begin": 525, + "end": 744, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 750, + "end": 1169, + "name": "tag", + "source": 1, + "value": "8" + }, + { "begin": 750, "end": 1169, "name": "JUMPDEST", "source": 1 }, + { + "begin": 750, + "end": 1169, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 954, + "end": 956, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 943, "end": 952, "name": "DUP3", "source": 1 }, + { "begin": 939, "end": 957, "name": "ADD", "source": 1 }, + { "begin": 931, "end": 957, "name": "SWAP1", "source": 1 }, + { "begin": 931, "end": 957, "name": "POP", "source": 1 }, + { "begin": 1003, "end": 1012, "name": "DUP2", "source": 1 }, + { "begin": 997, "end": 1001, "name": "DUP2", "source": 1 }, + { "begin": 993, "end": 1013, "name": "SUB", "source": 1 }, + { + "begin": 989, + "end": 990, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 978, "end": 987, "name": "DUP4", "source": 1 }, + { "begin": 974, "end": 991, "name": "ADD", "source": 1 }, + { "begin": 967, "end": 1014, "name": "MSTORE", "source": 1 }, + { + "begin": 1031, + "end": 1162, + "name": "PUSH [tag]", + "source": 1, + "value": "30" + }, + { "begin": 1157, "end": 1161, "name": "DUP2", "source": 1 }, + { + "begin": 1031, + "end": 1162, + "name": "PUSH [tag]", + "source": 1, + "value": "18" + }, + { + "begin": 1031, + "end": 1162, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1031, + "end": 1162, + "name": "tag", + "source": 1, + "value": "30" + }, + { "begin": 1031, "end": 1162, "name": "JUMPDEST", "source": 1 }, + { "begin": 1023, "end": 1162, "name": "SWAP1", "source": 1 }, + { "begin": 1023, "end": 1162, "name": "POP", "source": 1 }, + { "begin": 921, "end": 1169, "name": "SWAP2", "source": 1 }, + { "begin": 921, "end": 1169, "name": "SWAP1", "source": 1 }, + { "begin": 921, "end": 1169, "name": "POP", "source": 1 }, + { + "begin": 921, + "end": 1169, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1175, + "end": 1594, + "name": "tag", + "source": 1, + "value": "12" + }, + { "begin": 1175, "end": 1594, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1175, + "end": 1594, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 1379, + "end": 1381, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 1368, "end": 1377, "name": "DUP3", "source": 1 }, + { "begin": 1364, "end": 1382, "name": "ADD", "source": 1 }, + { "begin": 1356, "end": 1382, "name": "SWAP1", "source": 1 }, + { "begin": 1356, "end": 1382, "name": "POP", "source": 1 }, + { "begin": 1428, "end": 1437, "name": "DUP2", "source": 1 }, + { "begin": 1422, "end": 1426, "name": "DUP2", "source": 1 }, + { "begin": 1418, "end": 1438, "name": "SUB", "source": 1 }, + { + "begin": 1414, + "end": 1415, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1403, "end": 1412, "name": "DUP4", "source": 1 }, + { "begin": 1399, "end": 1416, "name": "ADD", "source": 1 }, + { "begin": 1392, "end": 1439, "name": "MSTORE", "source": 1 }, + { + "begin": 1456, + "end": 1587, + "name": "PUSH [tag]", + "source": 1, + "value": "32" + }, + { "begin": 1582, "end": 1586, "name": "DUP2", "source": 1 }, + { + "begin": 1456, + "end": 1587, + "name": "PUSH [tag]", + "source": 1, + "value": "24" + }, + { + "begin": 1456, + "end": 1587, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1456, + "end": 1587, + "name": "tag", + "source": 1, + "value": "32" + }, + { "begin": 1456, "end": 1587, "name": "JUMPDEST", "source": 1 }, + { "begin": 1448, "end": 1587, "name": "SWAP1", "source": 1 }, + { "begin": 1448, "end": 1587, "name": "POP", "source": 1 }, + { "begin": 1346, "end": 1594, "name": "SWAP2", "source": 1 }, + { "begin": 1346, "end": 1594, "name": "SWAP1", "source": 1 }, + { "begin": 1346, "end": 1594, "name": "POP", "source": 1 }, + { + "begin": 1346, + "end": 1594, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1600, + "end": 1769, + "name": "tag", + "source": 1, + "value": "21" + }, + { "begin": 1600, "end": 1769, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1600, + "end": 1769, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1718, "end": 1724, "name": "DUP3", "source": 1 }, + { "begin": 1713, "end": 1716, "name": "DUP3", "source": 1 }, + { "begin": 1706, "end": 1725, "name": "MSTORE", "source": 1 }, + { + "begin": 1758, + "end": 1762, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 1753, "end": 1756, "name": "DUP3", "source": 1 }, + { "begin": 1749, "end": 1763, "name": "ADD", "source": 1 }, + { "begin": 1734, "end": 1763, "name": "SWAP1", "source": 1 }, + { "begin": 1734, "end": 1763, "name": "POP", "source": 1 }, + { "begin": 1696, "end": 1769, "name": "SWAP3", "source": 1 }, + { "begin": 1696, "end": 1769, "name": "SWAP2", "source": 1 }, + { "begin": 1696, "end": 1769, "name": "POP", "source": 1 }, + { "begin": 1696, "end": 1769, "name": "POP", "source": 1 }, + { + "begin": 1696, + "end": 1769, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1775, + "end": 1955, + "name": "tag", + "source": 1, + "value": "23" + }, + { "begin": 1775, "end": 1955, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1915, + "end": 1947, + "name": "PUSH", + "source": 1, + "value": "656C6C6970746963206375727665206164646974696F6E206661696C65640000" + }, + { + "begin": 1911, + "end": 1912, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1903, "end": 1909, "name": "DUP3", "source": 1 }, + { "begin": 1899, "end": 1913, "name": "ADD", "source": 1 }, + { "begin": 1892, "end": 1948, "name": "MSTORE", "source": 1 }, + { "begin": 1881, "end": 1955, "name": "POP", "source": 1 }, + { + "begin": 1881, + "end": 1955, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1961, + "end": 2117, + "name": "tag", + "source": 1, + "value": "28" + }, + { "begin": 1961, "end": 2117, "name": "JUMPDEST", "source": 1 }, + { + "begin": 2101, + "end": 2109, + "name": "PUSH", + "source": 1, + "value": "6661696C65640000000000000000000000000000000000000000000000000000" + }, + { + "begin": 2097, + "end": 2098, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 2089, "end": 2095, "name": "DUP3", "source": 1 }, + { "begin": 2085, "end": 2099, "name": "ADD", "source": 1 }, + { "begin": 2078, "end": 2110, "name": "MSTORE", "source": 1 }, + { "begin": 2067, "end": 2117, "name": "POP", "source": 1 }, + { + "begin": 2067, + "end": 2117, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 34, + "end": 1229, + "name": "tag", + "source": 0, + "value": "16" + }, + { "begin": 34, "end": 1229, "name": "JUMPDEST", "source": 0 }, + { + "begin": 34, + "end": 1229, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 34, "end": 1229, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 1229, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 34, + "end": 1229, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 1229, "name": "CODECOPY", "source": 0 }, + { + "begin": 34, + "end": 1229, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 1229, "name": "RETURN", "source": 0 } + ], + ".data": { + "0": { + ".auxdata": "a26469706673582212209a97bc97d5e3a377e8298e3b3a72b24963abb30bc27bb2266ae137b12aac8cc964736f6c63430008030033", + ".code": [ + { + "begin": 34, + "end": 1229, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 34, + "end": 1229, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 1229, "name": "MSTORE", "source": 0 }, + { + "begin": 34, + "end": 1229, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 1229, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 1229, "name": "REVERT", "source": 0 } + ] + } + } + }, + "methodIdentifiers": {} + }, + "ewasm": { "wasm": "" }, + "metadata": "{\"compiler\":{\"version\":\"0.8.3+commit.8d00100c\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"main.sol\":\"Bn128Multiply\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"main.sol\":{\"keccak256\":\"0x0866695f85e6c1a4e1a8cb93dfeef35e2b9269877a1562fbd3e145c2e75e3395\",\"urls\":[\"bzz-raw://84a275684a19c387b2ffd04d1b4df333ff4c72127508ea5a3604b35ccd21492e\",\"dweb:/ipfs/QmQmBMj75rX9QqPYae9GiDacPuGieUfXsYjZavjPvkrRH2\"]}},\"version\":1}", + "storageLayout": { "storage": [], "types": null }, + "userdoc": { "kind": "user", "methods": {}, "version": 1 } + }, + "sourceCode": "\n pragma solidity >=0.8.0;\n contract Bn128Multiply{\n constructor() {\n bool success;\n uint256[3] memory input = [\n 0x1a87b0584ce92f4593d161480614f2989035225609f08058ccfa3d0f940febe3,\n 0x1a2f3c951f6dadcc7ee9007dff81504b0fcd6d7cf59996efdc33d92bf7f9f8f6,\n 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000000\n ];\n uint256[2] memory result;\n\n assembly {\n // 0x07 id of the bn256Mul precompile\n // 0 number of ether to transfer\n // 96 size of call parameters, i.e. 128 bytes total\n // 64 size of return value, i.e. 64 bytes / 512 bit for a BN256 curve point\n success := call(not(0), 0x07, 0, input, 96, result, 64)\n }\n require(success, \"elliptic curve addition failed\");\n require(\n result[0] ==\n 0x1a87b0584ce92f4593d161480614f2989035225609f08058ccfa3d0f940febe3,\n \"failed\");\n require(\n result[1] ==\n 0x163511ddc1c3f25d396745388200081287b3fd1472d8339d5fecb2eae0830451,\n \"failed\");\n }\n }" +} diff --git a/tests/contracts/compiled/Bn128Pairing.json b/tests/contracts/compiled/Bn128Pairing.json new file mode 100644 index 00000000000..02c64010917 --- /dev/null +++ b/tests/contracts/compiled/Bn128Pairing.json @@ -0,0 +1,2039 @@ +{ + "byteCode": "0x608060405234801561001057600080fd5b5060006040518061018001604052807f2eca0c7238bf16e83e7a1e6c5d49540685ff51380f309842a98561558019fc0281526020017f03d3260361bb8451de5ff5ecd17f010ff22f5c31cdf184e9020b06fa5997db8481526020017f1213d2149b006137fcfb23036606f848d638d576a120ca981b5b1a5f9300b3ee81526020017f2276cf730cf493cd95d64677bbb75fc42db72513a4c1e387b476d056f80aa75f81526020017f21ee6226d31426322afcda621464d0611d226783262e21bb3bc86b537e98623781526020017f096df1f82dff337dd5972e32a8ad43e28a78a96a823ef1cd4debe12b6552ea5f81526020017f06967a1237ebfeca9aaae0d6d0bab8e28c198c5a339ef8a2407e31cdac516db981526020017f22160fa257a5fd5b280642ff47b65eca77e626cb685c84fa6d3b6882a283ddd181526020017f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c281526020017f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed81526020017f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b81526020017f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa81525090506101ef6102cd565b600060208261018085600060086107d05a03f1905080610244576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161023b90610355565b60405180910390fd5b600182600060018110610280577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151146102c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102bc90610335565b60405180910390fd5b5050506103d8565b6040518060200160405280600190602082028036833780820191505090505090565b60006102fc600683610375565b915061030782610386565b602082019050919050565b600061031f601d83610375565b915061032a826103af565b602082019050919050565b6000602082019050818103600083015261034e816102ef565b9050919050565b6000602082019050818103600083015261036e81610312565b9050919050565b600082825260208201905092915050565b7f6661696c65640000000000000000000000000000000000000000000000000000600082015250565b7f656c6c69707469632063757276652070616972696e67206661696c6564000000600082015250565b603f806103e66000396000f3fe6080604052600080fdfea2646970667358221220e90355f07d7a4ae3a9df347abcddaab722cb5be69464e1ff818d231c9ee0b8de64736f6c63430008030033", + "contract": { + "abi": [ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" } + ], + "devdoc": { "kind": "dev", "methods": {}, "version": 1 }, + "evm": { + "assembly": " /* \"main.sol\":34:1708 contract Bn128Pairing {... */\n mstore(0x40, 0x80)\n /* \"main.sol\":66:1702 constructor() {... */\n callvalue\n dup1\n iszero\n tag_1\n jumpi\n 0x00\n dup1\n revert\ntag_1:\n pop\n /* \"main.sol\":90:114 uint256[12] memory input */\n 0x00\n /* \"main.sol\":90:1087 uint256[12] memory input = [... */\n mload(0x40)\n dup1\n 0x0180\n add\n 0x40\n mstore\n dup1\n /* \"main.sol\":131:197 0x2eca0c7238bf16e83e7a1e6c5d49540685ff51380f309842a98561558019fc02 */\n 0x2eca0c7238bf16e83e7a1e6c5d49540685ff51380f309842a98561558019fc02\n /* \"main.sol\":90:1087 uint256[12] memory input = [... */\n dup2\n mstore\n 0x20\n add\n /* \"main.sol\":211:277 0x03d3260361bb8451de5ff5ecd17f010ff22f5c31cdf184e9020b06fa5997db84 */\n 0x03d3260361bb8451de5ff5ecd17f010ff22f5c31cdf184e9020b06fa5997db84\n /* \"main.sol\":90:1087 uint256[12] memory input = [... */\n dup2\n mstore\n 0x20\n add\n /* \"main.sol\":291:357 0x1213d2149b006137fcfb23036606f848d638d576a120ca981b5b1a5f9300b3ee */\n 0x1213d2149b006137fcfb23036606f848d638d576a120ca981b5b1a5f9300b3ee\n /* \"main.sol\":90:1087 uint256[12] memory input = [... */\n dup2\n mstore\n 0x20\n add\n /* \"main.sol\":371:437 0x2276cf730cf493cd95d64677bbb75fc42db72513a4c1e387b476d056f80aa75f */\n 0x2276cf730cf493cd95d64677bbb75fc42db72513a4c1e387b476d056f80aa75f\n /* \"main.sol\":90:1087 uint256[12] memory input = [... */\n dup2\n mstore\n 0x20\n add\n /* \"main.sol\":451:517 0x21ee6226d31426322afcda621464d0611d226783262e21bb3bc86b537e986237 */\n 0x21ee6226d31426322afcda621464d0611d226783262e21bb3bc86b537e986237\n /* \"main.sol\":90:1087 uint256[12] memory input = [... */\n dup2\n mstore\n 0x20\n add\n /* \"main.sol\":531:597 0x096df1f82dff337dd5972e32a8ad43e28a78a96a823ef1cd4debe12b6552ea5f */\n 0x096df1f82dff337dd5972e32a8ad43e28a78a96a823ef1cd4debe12b6552ea5f\n /* \"main.sol\":90:1087 uint256[12] memory input = [... */\n dup2\n mstore\n 0x20\n add\n /* \"main.sol\":611:677 0x06967a1237ebfeca9aaae0d6d0bab8e28c198c5a339ef8a2407e31cdac516db9 */\n 0x06967a1237ebfeca9aaae0d6d0bab8e28c198c5a339ef8a2407e31cdac516db9\n /* \"main.sol\":90:1087 uint256[12] memory input = [... */\n dup2\n mstore\n 0x20\n add\n /* \"main.sol\":691:757 0x22160fa257a5fd5b280642ff47b65eca77e626cb685c84fa6d3b6882a283ddd1 */\n 0x22160fa257a5fd5b280642ff47b65eca77e626cb685c84fa6d3b6882a283ddd1\n /* \"main.sol\":90:1087 uint256[12] memory input = [... */\n dup2\n mstore\n 0x20\n add\n /* \"main.sol\":771:837 0x198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c2 */\n 0x198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c2\n /* \"main.sol\":90:1087 uint256[12] memory input = [... */\n dup2\n mstore\n 0x20\n add\n /* \"main.sol\":851:917 0x1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed */\n 0x1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed\n /* \"main.sol\":90:1087 uint256[12] memory input = [... */\n dup2\n mstore\n 0x20\n add\n /* \"main.sol\":931:997 0x090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b */\n 0x090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b\n /* \"main.sol\":90:1087 uint256[12] memory input = [... */\n dup2\n mstore\n 0x20\n add\n /* \"main.sol\":1011:1077 0x12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa */\n 0x12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa\n /* \"main.sol\":90:1087 uint256[12] memory input = [... */\n dup2\n mstore\n pop\n swap1\n pop\n /* \"main.sol\":1097:1121 uint256[1] memory result */\n tag_4\n tag_5\n jump\t// in\ntag_4:\n /* \"main.sol\":1131:1143 bool success */\n 0x00\n /* \"main.sol\":1577:1579 32 */\n 0x20\n /* \"main.sol\":1569:1575 result */\n dup3\n /* \"main.sol\":1564:1567 384 */\n 0x0180\n /* \"main.sol\":1557:1562 input */\n dup6\n /* \"main.sol\":1554:1555 0 */\n 0x00\n /* \"main.sol\":1548:1552 0x08 */\n 0x08\n /* \"main.sol\":1541:1545 2000 */\n 0x07d0\n /* \"main.sol\":1534:1539 gas() */\n gas\n /* \"main.sol\":1530:1546 sub(gas(), 2000) */\n sub\n /* \"main.sol\":1525:1580 call(sub(gas(), 2000), 0x08, 0, input, 384, result, 32) */\n call\n /* \"main.sol\":1514:1580 success := call(sub(gas(), 2000), 0x08, 0, input, 384, result, 32) */\n swap1\n pop\n /* \"main.sol\":1607:1614 success */\n dup1\n /* \"main.sol\":1599:1648 require(success, \"elliptic curve pairing failed\") */\n tag_6\n jumpi\n mload(0x40)\n 0x08c379a000000000000000000000000000000000000000000000000000000000\n dup2\n mstore\n 0x04\n add\n tag_7\n swap1\n tag_8\n jump\t// in\ntag_7:\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n revert\ntag_6:\n /* \"main.sol\":1679:1680 1 */\n 0x01\n /* \"main.sol\":1666:1672 result */\n dup3\n /* \"main.sol\":1673:1674 0 */\n 0x00\n /* \"main.sol\":1666:1675 result[0] */\n 0x01\n dup2\n lt\n tag_9\n jumpi\n mstore(0x00, 0x4e487b7100000000000000000000000000000000000000000000000000000000)\n mstore(0x04, 0x32)\n revert(0x00, 0x24)\ntag_9:\n 0x20\n mul\n add\n mload\n /* \"main.sol\":1666:1680 result[0] == 1 */\n eq\n /* \"main.sol\":1658:1691 require(result[0] == 1, \"failed\") */\n tag_10\n jumpi\n mload(0x40)\n 0x08c379a000000000000000000000000000000000000000000000000000000000\n dup2\n mstore\n 0x04\n add\n tag_11\n swap1\n tag_12\n jump\t// in\ntag_11:\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n revert\ntag_10:\n /* \"main.sol\":66:1702 constructor() {... */\n pop\n pop\n pop\n /* \"main.sol\":34:1708 contract Bn128Pairing {... */\n jump(tag_13)\ntag_5:\n mload(0x40)\n dup1\n 0x20\n add\n 0x40\n mstore\n dup1\n 0x01\n swap1\n 0x20\n dup3\n mul\n dup1\n calldatasize\n dup4\n calldatacopy\n dup1\n dup3\n add\n swap2\n pop\n pop\n swap1\n pop\n pop\n swap1\n jump\t// out\n /* \"#utility.yul\":7:372 */\ntag_15:\n 0x00\n /* \"#utility.yul\":170:236 */\n tag_17\n /* \"#utility.yul\":234:235 */\n 0x06\n /* \"#utility.yul\":229:232 */\n dup4\n /* \"#utility.yul\":170:236 */\n tag_18\n jump\t// in\ntag_17:\n /* \"#utility.yul\":163:236 */\n swap2\n pop\n /* \"#utility.yul\":245:338 */\n tag_19\n /* \"#utility.yul\":334:337 */\n dup3\n /* \"#utility.yul\":245:338 */\n tag_20\n jump\t// in\ntag_19:\n /* \"#utility.yul\":363:365 */\n 0x20\n /* \"#utility.yul\":358:361 */\n dup3\n /* \"#utility.yul\":354:366 */\n add\n /* \"#utility.yul\":347:366 */\n swap1\n pop\n /* \"#utility.yul\":153:372 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":378:744 */\ntag_21:\n 0x00\n /* \"#utility.yul\":541:608 */\n tag_23\n /* \"#utility.yul\":605:607 */\n 0x1d\n /* \"#utility.yul\":600:603 */\n dup4\n /* \"#utility.yul\":541:608 */\n tag_18\n jump\t// in\ntag_23:\n /* \"#utility.yul\":534:608 */\n swap2\n pop\n /* \"#utility.yul\":617:710 */\n tag_24\n /* \"#utility.yul\":706:709 */\n dup3\n /* \"#utility.yul\":617:710 */\n tag_25\n jump\t// in\ntag_24:\n /* \"#utility.yul\":735:737 */\n 0x20\n /* \"#utility.yul\":730:733 */\n dup3\n /* \"#utility.yul\":726:738 */\n add\n /* \"#utility.yul\":719:738 */\n swap1\n pop\n /* \"#utility.yul\":524:744 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":750:1169 */\ntag_12:\n 0x00\n /* \"#utility.yul\":954:956 */\n 0x20\n /* \"#utility.yul\":943:952 */\n dup3\n /* \"#utility.yul\":939:957 */\n add\n /* \"#utility.yul\":931:957 */\n swap1\n pop\n /* \"#utility.yul\":1003:1012 */\n dup2\n /* \"#utility.yul\":997:1001 */\n dup2\n /* \"#utility.yul\":993:1013 */\n sub\n /* \"#utility.yul\":989:990 */\n 0x00\n /* \"#utility.yul\":978:987 */\n dup4\n /* \"#utility.yul\":974:991 */\n add\n /* \"#utility.yul\":967:1014 */\n mstore\n /* \"#utility.yul\":1031:1162 */\n tag_27\n /* \"#utility.yul\":1157:1161 */\n dup2\n /* \"#utility.yul\":1031:1162 */\n tag_15\n jump\t// in\ntag_27:\n /* \"#utility.yul\":1023:1162 */\n swap1\n pop\n /* \"#utility.yul\":921:1169 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":1175:1594 */\ntag_8:\n 0x00\n /* \"#utility.yul\":1379:1381 */\n 0x20\n /* \"#utility.yul\":1368:1377 */\n dup3\n /* \"#utility.yul\":1364:1382 */\n add\n /* \"#utility.yul\":1356:1382 */\n swap1\n pop\n /* \"#utility.yul\":1428:1437 */\n dup2\n /* \"#utility.yul\":1422:1426 */\n dup2\n /* \"#utility.yul\":1418:1438 */\n sub\n /* \"#utility.yul\":1414:1415 */\n 0x00\n /* \"#utility.yul\":1403:1412 */\n dup4\n /* \"#utility.yul\":1399:1416 */\n add\n /* \"#utility.yul\":1392:1439 */\n mstore\n /* \"#utility.yul\":1456:1587 */\n tag_29\n /* \"#utility.yul\":1582:1586 */\n dup2\n /* \"#utility.yul\":1456:1587 */\n tag_21\n jump\t// in\ntag_29:\n /* \"#utility.yul\":1448:1587 */\n swap1\n pop\n /* \"#utility.yul\":1346:1594 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":1600:1769 */\ntag_18:\n 0x00\n /* \"#utility.yul\":1718:1724 */\n dup3\n /* \"#utility.yul\":1713:1716 */\n dup3\n /* \"#utility.yul\":1706:1725 */\n mstore\n /* \"#utility.yul\":1758:1762 */\n 0x20\n /* \"#utility.yul\":1753:1756 */\n dup3\n /* \"#utility.yul\":1749:1763 */\n add\n /* \"#utility.yul\":1734:1763 */\n swap1\n pop\n /* \"#utility.yul\":1696:1769 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":1775:1931 */\ntag_20:\n /* \"#utility.yul\":1915:1923 */\n 0x6661696c65640000000000000000000000000000000000000000000000000000\n /* \"#utility.yul\":1911:1912 */\n 0x00\n /* \"#utility.yul\":1903:1909 */\n dup3\n /* \"#utility.yul\":1899:1913 */\n add\n /* \"#utility.yul\":1892:1924 */\n mstore\n /* \"#utility.yul\":1881:1931 */\n pop\n jump\t// out\n /* \"#utility.yul\":1937:2116 */\ntag_25:\n /* \"#utility.yul\":2077:2108 */\n 0x656c6c69707469632063757276652070616972696e67206661696c6564000000\n /* \"#utility.yul\":2073:2074 */\n 0x00\n /* \"#utility.yul\":2065:2071 */\n dup3\n /* \"#utility.yul\":2061:2075 */\n add\n /* \"#utility.yul\":2054:2109 */\n mstore\n /* \"#utility.yul\":2043:2116 */\n pop\n jump\t// out\n /* \"main.sol\":34:1708 contract Bn128Pairing {... */\ntag_13:\n dataSize(sub_0)\n dup1\n dataOffset(sub_0)\n 0x00\n codecopy\n 0x00\n return\nstop\n\nsub_0: assembly {\n /* \"main.sol\":34:1708 contract Bn128Pairing {... */\n mstore(0x40, 0x80)\n 0x00\n dup1\n revert\n\n auxdata: 0xa2646970667358221220e90355f07d7a4ae3a9df347abcddaab722cb5be69464e1ff818d231c9ee0b8de64736f6c63430008030033\n}\n", + "bytecode": { + "generatedSources": [ + { + "ast": { + "nodeType": "YulBlock", + "src": "0:2119:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "153:219:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "163:73:1", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "229:3:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "234:1:1", + "type": "", + "value": "6" + } + ], + "functionName": { + "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", + "nodeType": "YulIdentifier", + "src": "170:58:1" + }, + "nodeType": "YulFunctionCall", + "src": "170:66:1" + }, + "variableNames": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "163:3:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "334:3:1" + } + ], + "functionName": { + "name": "store_literal_in_memory_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43", + "nodeType": "YulIdentifier", + "src": "245:88:1" + }, + "nodeType": "YulFunctionCall", + "src": "245:93:1" + }, + "nodeType": "YulExpressionStatement", + "src": "245:93:1" + }, + { + "nodeType": "YulAssignment", + "src": "347:19:1", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "358:3:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "363:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "354:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "354:12:1" + }, + "variableNames": [ + { + "name": "end", + "nodeType": "YulIdentifier", + "src": "347:3:1" + } + ] + } + ] + }, + "name": "abi_encode_t_stringliteral_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43_to_t_string_memory_ptr_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "141:3:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "end", + "nodeType": "YulTypedName", + "src": "149:3:1", + "type": "" + } + ], + "src": "7:365:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "524:220:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "534:74:1", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "600:3:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "605:2:1", + "type": "", + "value": "29" + } + ], + "functionName": { + "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", + "nodeType": "YulIdentifier", + "src": "541:58:1" + }, + "nodeType": "YulFunctionCall", + "src": "541:67:1" + }, + "variableNames": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "534:3:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "706:3:1" + } + ], + "functionName": { + "name": "store_literal_in_memory_dc2f8c3d1a6057e9deb8934eebf88df4d746938df18208c9f82776620c480862", + "nodeType": "YulIdentifier", + "src": "617:88:1" + }, + "nodeType": "YulFunctionCall", + "src": "617:93:1" + }, + "nodeType": "YulExpressionStatement", + "src": "617:93:1" + }, + { + "nodeType": "YulAssignment", + "src": "719:19:1", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "730:3:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "735:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "726:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "726:12:1" + }, + "variableNames": [ + { + "name": "end", + "nodeType": "YulIdentifier", + "src": "719:3:1" + } + ] + } + ] + }, + "name": "abi_encode_t_stringliteral_dc2f8c3d1a6057e9deb8934eebf88df4d746938df18208c9f82776620c480862_to_t_string_memory_ptr_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "512:3:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "end", + "nodeType": "YulTypedName", + "src": "520:3:1", + "type": "" + } + ], + "src": "378:366:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "921:248:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "931:26:1", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "943:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "954:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "939:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "939:18:1" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "931:4:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "978:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "989:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "974:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "974:17:1" + }, + { + "arguments": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "997:4:1" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "1003:9:1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "993:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "993:20:1" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "967:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "967:47:1" + }, + "nodeType": "YulExpressionStatement", + "src": "967:47:1" + }, + { + "nodeType": "YulAssignment", + "src": "1023:139:1", + "value": { + "arguments": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "1157:4:1" + } + ], + "functionName": { + "name": "abi_encode_t_stringliteral_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43_to_t_string_memory_ptr_fromStack", + "nodeType": "YulIdentifier", + "src": "1031:124:1" + }, + "nodeType": "YulFunctionCall", + "src": "1031:131:1" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "1023:4:1" + } + ] + } + ] + }, + "name": "abi_encode_tuple_t_stringliteral_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43__to_t_string_memory_ptr__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "901:9:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "916:4:1", + "type": "" + } + ], + "src": "750:419:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1346:248:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "1356:26:1", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "1368:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1379:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1364:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1364:18:1" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "1356:4:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "1403:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1414:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1399:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1399:17:1" + }, + { + "arguments": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "1422:4:1" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "1428:9:1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "1418:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1418:20:1" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "1392:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1392:47:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1392:47:1" + }, + { + "nodeType": "YulAssignment", + "src": "1448:139:1", + "value": { + "arguments": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "1582:4:1" + } + ], + "functionName": { + "name": "abi_encode_t_stringliteral_dc2f8c3d1a6057e9deb8934eebf88df4d746938df18208c9f82776620c480862_to_t_string_memory_ptr_fromStack", + "nodeType": "YulIdentifier", + "src": "1456:124:1" + }, + "nodeType": "YulFunctionCall", + "src": "1456:131:1" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "1448:4:1" + } + ] + } + ] + }, + "name": "abi_encode_tuple_t_stringliteral_dc2f8c3d1a6057e9deb8934eebf88df4d746938df18208c9f82776620c480862__to_t_string_memory_ptr__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "1326:9:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "1341:4:1", + "type": "" + } + ], + "src": "1175:419:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1696:73:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "1713:3:1" + }, + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "1718:6:1" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "1706:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1706:19:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1706:19:1" + }, + { + "nodeType": "YulAssignment", + "src": "1734:29:1", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "1753:3:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1758:4:1", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1749:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1749:14:1" + }, + "variableNames": [ + { + "name": "updated_pos", + "nodeType": "YulIdentifier", + "src": "1734:11:1" + } + ] + } + ] + }, + "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "1668:3:1", + "type": "" + }, + { + "name": "length", + "nodeType": "YulTypedName", + "src": "1673:6:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "updated_pos", + "nodeType": "YulTypedName", + "src": "1684:11:1", + "type": "" + } + ], + "src": "1600:169:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1881:50:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "memPtr", + "nodeType": "YulIdentifier", + "src": "1903:6:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1911:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1899:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1899:14:1" + }, + { + "kind": "string", + "nodeType": "YulLiteral", + "src": "1915:8:1", + "type": "", + "value": "failed" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "1892:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1892:32:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1892:32:1" + } + ] + }, + "name": "store_literal_in_memory_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "memPtr", + "nodeType": "YulTypedName", + "src": "1873:6:1", + "type": "" + } + ], + "src": "1775:156:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "2043:73:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "memPtr", + "nodeType": "YulIdentifier", + "src": "2065:6:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "2073:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "2061:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "2061:14:1" + }, + { + "kind": "string", + "nodeType": "YulLiteral", + "src": "2077:31:1", + "type": "", + "value": "elliptic curve pairing failed" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "2054:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "2054:55:1" + }, + "nodeType": "YulExpressionStatement", + "src": "2054:55:1" + } + ] + }, + "name": "store_literal_in_memory_dc2f8c3d1a6057e9deb8934eebf88df4d746938df18208c9f82776620c480862", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "memPtr", + "nodeType": "YulTypedName", + "src": "2035:6:1", + "type": "" + } + ], + "src": "1937:179:1" + } + ] + }, + "contents": "{\n\n function abi_encode_t_stringliteral_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 6)\n store_literal_in_memory_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43(pos)\n end := add(pos, 32)\n }\n\n function abi_encode_t_stringliteral_dc2f8c3d1a6057e9deb8934eebf88df4d746938df18208c9f82776620c480862_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 29)\n store_literal_in_memory_dc2f8c3d1a6057e9deb8934eebf88df4d746938df18208c9f82776620c480862(pos)\n end := add(pos, 32)\n }\n\n function abi_encode_tuple_t_stringliteral_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n function abi_encode_tuple_t_stringliteral_dc2f8c3d1a6057e9deb8934eebf88df4d746938df18208c9f82776620c480862__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_dc2f8c3d1a6057e9deb8934eebf88df4d746938df18208c9f82776620c480862_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n function array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, length) -> updated_pos {\n mstore(pos, length)\n updated_pos := add(pos, 0x20)\n }\n\n function store_literal_in_memory_8f44d68b1a26169d304522fa2f95aa938d98120d628d1db5726120ca84e53b43(memPtr) {\n\n mstore(add(memPtr, 0), \"failed\")\n\n }\n\n function store_literal_in_memory_dc2f8c3d1a6057e9deb8934eebf88df4d746938df18208c9f82776620c480862(memPtr) {\n\n mstore(add(memPtr, 0), \"elliptic curve pairing failed\")\n\n }\n\n}\n", + "id": 1, + "language": "Yul", + "name": "#utility.yul" + } + ], + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b5060006040518061018001604052807f2eca0c7238bf16e83e7a1e6c5d49540685ff51380f309842a98561558019fc0281526020017f03d3260361bb8451de5ff5ecd17f010ff22f5c31cdf184e9020b06fa5997db8481526020017f1213d2149b006137fcfb23036606f848d638d576a120ca981b5b1a5f9300b3ee81526020017f2276cf730cf493cd95d64677bbb75fc42db72513a4c1e387b476d056f80aa75f81526020017f21ee6226d31426322afcda621464d0611d226783262e21bb3bc86b537e98623781526020017f096df1f82dff337dd5972e32a8ad43e28a78a96a823ef1cd4debe12b6552ea5f81526020017f06967a1237ebfeca9aaae0d6d0bab8e28c198c5a339ef8a2407e31cdac516db981526020017f22160fa257a5fd5b280642ff47b65eca77e626cb685c84fa6d3b6882a283ddd181526020017f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c281526020017f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed81526020017f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b81526020017f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa81525090506101ef6102cd565b600060208261018085600060086107d05a03f1905080610244576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161023b90610355565b60405180910390fd5b600182600060018110610280577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151146102c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102bc90610335565b60405180910390fd5b5050506103d8565b6040518060200160405280600190602082028036833780820191505090505090565b60006102fc600683610375565b915061030782610386565b602082019050919050565b600061031f601d83610375565b915061032a826103af565b602082019050919050565b6000602082019050818103600083015261034e816102ef565b9050919050565b6000602082019050818103600083015261036e81610312565b9050919050565b600082825260208201905092915050565b7f6661696c65640000000000000000000000000000000000000000000000000000600082015250565b7f656c6c69707469632063757276652070616972696e67206661696c6564000000600082015250565b603f806103e66000396000f3fe6080604052600080fdfea2646970667358221220e90355f07d7a4ae3a9df347abcddaab722cb5be69464e1ff818d231c9ee0b8de64736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 PUSH2 0x180 ADD PUSH1 0x40 MSTORE DUP1 PUSH32 0x2ECA0C7238BF16E83E7A1E6C5D49540685FF51380F309842A98561558019FC02 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x3D3260361BB8451DE5FF5ECD17F010FF22F5C31CDF184E9020B06FA5997DB84 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x1213D2149B006137FCFB23036606F848D638D576A120CA981B5B1A5F9300B3EE DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x2276CF730CF493CD95D64677BBB75FC42DB72513A4C1E387B476D056F80AA75F DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x21EE6226D31426322AFCDA621464D0611D226783262E21BB3BC86B537E986237 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x96DF1F82DFF337DD5972E32A8AD43E28A78A96A823EF1CD4DEBE12B6552EA5F DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x6967A1237EBFECA9AAAE0D6D0BAB8E28C198C5A339EF8A2407E31CDAC516DB9 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x22160FA257A5FD5B280642FF47B65ECA77E626CB685C84FA6D3B6882A283DDD1 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x198E9393920D483A7260BFB731FB5D25F1AA493335A9E71297E485B7AEF312C2 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x1800DEEF121F1E76426A00665E5C4479674322D4F75EDADD46DEBD5CD992F6ED DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x90689D0585FF075EC9E99AD690C3395BC4B313370B38EF355ACDADCD122975B DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x12C85EA5DB8C6DEB4AAB71808DCB408FE3D1E7690C43D37B4CE6CC0166FA7DAA DUP2 MSTORE POP SWAP1 POP PUSH2 0x1EF PUSH2 0x2CD JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 PUSH2 0x180 DUP6 PUSH1 0x0 PUSH1 0x8 PUSH2 0x7D0 GAS SUB CALL SWAP1 POP DUP1 PUSH2 0x244 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x23B SWAP1 PUSH2 0x355 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x1 DUP3 PUSH1 0x0 PUSH1 0x1 DUP2 LT PUSH2 0x280 JUMPI PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x32 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x20 MUL ADD MLOAD EQ PUSH2 0x2C5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x2BC SWAP1 PUSH2 0x335 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP POP POP PUSH2 0x3D8 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 PUSH1 0x20 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x1 SWAP1 PUSH1 0x20 DUP3 MUL DUP1 CALLDATASIZE DUP4 CALLDATACOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP POP SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2FC PUSH1 0x6 DUP4 PUSH2 0x375 JUMP JUMPDEST SWAP2 POP PUSH2 0x307 DUP3 PUSH2 0x386 JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x31F PUSH1 0x1D DUP4 PUSH2 0x375 JUMP JUMPDEST SWAP2 POP PUSH2 0x32A DUP3 PUSH2 0x3AF JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x34E DUP2 PUSH2 0x2EF JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x36E DUP2 PUSH2 0x312 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH32 0x6661696C65640000000000000000000000000000000000000000000000000000 PUSH1 0x0 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH32 0x656C6C69707469632063757276652070616972696E67206661696C6564000000 PUSH1 0x0 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH1 0x3F DUP1 PUSH2 0x3E6 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xE9 SUB SSTORE CREATE PUSH30 0x7A4AE3A9DF347ABCDDAAB722CB5BE69464E1FF818D231C9EE0B8DE64736F PUSH13 0x63430008030033000000000000 ", + "sourceMap": "34:1674:0:-:0;;;66:1636;;;;;;;;;;90:24;:997;;;;;;;;131:66;90:997;;;;211:66;90:997;;;;291:66;90:997;;;;371:66;90:997;;;;451:66;90:997;;;;531:66;90:997;;;;611:66;90:997;;;;691:66;90:997;;;;771:66;90:997;;;;851:66;90:997;;;;931:66;90:997;;;;1011:66;90:997;;;;;1097:24;;:::i;:::-;1131:12;1577:2;1569:6;1564:3;1557:5;1554:1;1548:4;1541;1534:5;1530:16;1525:55;1514:66;;1607:7;1599:49;;;;;;;;;;;;:::i;:::-;;;;;;;;;1679:1;1666:6;1673:1;1666:9;;;;;;;;;;;;;;;;;;;:14;1658:33;;;;;;;;;;;;:::i;:::-;;;;;;;;;66:1636;;;34:1674;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;7:365:1:-;;170:66;234:1;229:3;170:66;:::i;:::-;163:73;;245:93;334:3;245:93;:::i;:::-;363:2;358:3;354:12;347:19;;153:219;;;:::o;378:366::-;;541:67;605:2;600:3;541:67;:::i;:::-;534:74;;617:93;706:3;617:93;:::i;:::-;735:2;730:3;726:12;719:19;;524:220;;;:::o;750:419::-;;954:2;943:9;939:18;931:26;;1003:9;997:4;993:20;989:1;978:9;974:17;967:47;1031:131;1157:4;1031:131;:::i;:::-;1023:139;;921:248;;;:::o;1175:419::-;;1379:2;1368:9;1364:18;1356:26;;1428:9;1422:4;1418:20;1414:1;1403:9;1399:17;1392:47;1456:131;1582:4;1456:131;:::i;:::-;1448:139;;1346:248;;;:::o;1600:169::-;;1718:6;1713:3;1706:19;1758:4;1753:3;1749:14;1734:29;;1696:73;;;;:::o;1775:156::-;1915:8;1911:1;1903:6;1899:14;1892:32;1881:50;:::o;1937:179::-;2077:31;2073:1;2065:6;2061:14;2054:55;2043:73;:::o;34:1674:0:-;;;;;;;" + }, + "deployedBytecode": { + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "6080604052600080fdfea2646970667358221220e90355f07d7a4ae3a9df347abcddaab722cb5be69464e1ff818d231c9ee0b8de64736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xE9 SUB SSTORE CREATE PUSH30 0x7A4AE3A9DF347ABCDDAAB722CB5BE69464E1FF818D231C9EE0B8DE64736F PUSH13 0x63430008030033000000000000 ", + "sourceMap": "34:1674:0:-:0;;;;;" + }, + "gasEstimates": { + "creation": { + "codeDepositCost": "12600", + "executionCost": "infinite", + "totalCost": "infinite" + } + }, + "legacyAssembly": { + ".code": [ + { + "begin": 34, + "end": 1708, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 34, + "end": 1708, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 1708, "name": "MSTORE", "source": 0 }, + { "begin": 66, "end": 1702, "name": "CALLVALUE", "source": 0 }, + { "begin": 66, "end": 1702, "name": "DUP1", "source": 0 }, + { "begin": 66, "end": 1702, "name": "ISZERO", "source": 0 }, + { + "begin": 66, + "end": 1702, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 66, "end": 1702, "name": "JUMPI", "source": 0 }, + { + "begin": 66, + "end": 1702, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 66, "end": 1702, "name": "DUP1", "source": 0 }, + { "begin": 66, "end": 1702, "name": "REVERT", "source": 0 }, + { + "begin": 66, + "end": 1702, + "name": "tag", + "source": 0, + "value": "1" + }, + { "begin": 66, "end": 1702, "name": "JUMPDEST", "source": 0 }, + { "begin": 66, "end": 1702, "name": "POP", "source": 0 }, + { + "begin": 90, + "end": 114, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { + "begin": 90, + "end": 1087, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 90, "end": 1087, "name": "MLOAD", "source": 0 }, + { "begin": 90, "end": 1087, "name": "DUP1", "source": 0 }, + { + "begin": 90, + "end": 1087, + "name": "PUSH", + "source": 0, + "value": "180" + }, + { "begin": 90, "end": 1087, "name": "ADD", "source": 0 }, + { + "begin": 90, + "end": 1087, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 90, "end": 1087, "name": "MSTORE", "source": 0 }, + { "begin": 90, "end": 1087, "name": "DUP1", "source": 0 }, + { + "begin": 131, + "end": 197, + "name": "PUSH", + "source": 0, + "value": "2ECA0C7238BF16E83E7A1E6C5D49540685FF51380F309842A98561558019FC02" + }, + { "begin": 90, "end": 1087, "name": "DUP2", "source": 0 }, + { "begin": 90, "end": 1087, "name": "MSTORE", "source": 0 }, + { + "begin": 90, + "end": 1087, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 90, "end": 1087, "name": "ADD", "source": 0 }, + { + "begin": 211, + "end": 277, + "name": "PUSH", + "source": 0, + "value": "3D3260361BB8451DE5FF5ECD17F010FF22F5C31CDF184E9020B06FA5997DB84" + }, + { "begin": 90, "end": 1087, "name": "DUP2", "source": 0 }, + { "begin": 90, "end": 1087, "name": "MSTORE", "source": 0 }, + { + "begin": 90, + "end": 1087, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 90, "end": 1087, "name": "ADD", "source": 0 }, + { + "begin": 291, + "end": 357, + "name": "PUSH", + "source": 0, + "value": "1213D2149B006137FCFB23036606F848D638D576A120CA981B5B1A5F9300B3EE" + }, + { "begin": 90, "end": 1087, "name": "DUP2", "source": 0 }, + { "begin": 90, "end": 1087, "name": "MSTORE", "source": 0 }, + { + "begin": 90, + "end": 1087, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 90, "end": 1087, "name": "ADD", "source": 0 }, + { + "begin": 371, + "end": 437, + "name": "PUSH", + "source": 0, + "value": "2276CF730CF493CD95D64677BBB75FC42DB72513A4C1E387B476D056F80AA75F" + }, + { "begin": 90, "end": 1087, "name": "DUP2", "source": 0 }, + { "begin": 90, "end": 1087, "name": "MSTORE", "source": 0 }, + { + "begin": 90, + "end": 1087, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 90, "end": 1087, "name": "ADD", "source": 0 }, + { + "begin": 451, + "end": 517, + "name": "PUSH", + "source": 0, + "value": "21EE6226D31426322AFCDA621464D0611D226783262E21BB3BC86B537E986237" + }, + { "begin": 90, "end": 1087, "name": "DUP2", "source": 0 }, + { "begin": 90, "end": 1087, "name": "MSTORE", "source": 0 }, + { + "begin": 90, + "end": 1087, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 90, "end": 1087, "name": "ADD", "source": 0 }, + { + "begin": 531, + "end": 597, + "name": "PUSH", + "source": 0, + "value": "96DF1F82DFF337DD5972E32A8AD43E28A78A96A823EF1CD4DEBE12B6552EA5F" + }, + { "begin": 90, "end": 1087, "name": "DUP2", "source": 0 }, + { "begin": 90, "end": 1087, "name": "MSTORE", "source": 0 }, + { + "begin": 90, + "end": 1087, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 90, "end": 1087, "name": "ADD", "source": 0 }, + { + "begin": 611, + "end": 677, + "name": "PUSH", + "source": 0, + "value": "6967A1237EBFECA9AAAE0D6D0BAB8E28C198C5A339EF8A2407E31CDAC516DB9" + }, + { "begin": 90, "end": 1087, "name": "DUP2", "source": 0 }, + { "begin": 90, "end": 1087, "name": "MSTORE", "source": 0 }, + { + "begin": 90, + "end": 1087, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 90, "end": 1087, "name": "ADD", "source": 0 }, + { + "begin": 691, + "end": 757, + "name": "PUSH", + "source": 0, + "value": "22160FA257A5FD5B280642FF47B65ECA77E626CB685C84FA6D3B6882A283DDD1" + }, + { "begin": 90, "end": 1087, "name": "DUP2", "source": 0 }, + { "begin": 90, "end": 1087, "name": "MSTORE", "source": 0 }, + { + "begin": 90, + "end": 1087, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 90, "end": 1087, "name": "ADD", "source": 0 }, + { + "begin": 771, + "end": 837, + "name": "PUSH", + "source": 0, + "value": "198E9393920D483A7260BFB731FB5D25F1AA493335A9E71297E485B7AEF312C2" + }, + { "begin": 90, "end": 1087, "name": "DUP2", "source": 0 }, + { "begin": 90, "end": 1087, "name": "MSTORE", "source": 0 }, + { + "begin": 90, + "end": 1087, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 90, "end": 1087, "name": "ADD", "source": 0 }, + { + "begin": 851, + "end": 917, + "name": "PUSH", + "source": 0, + "value": "1800DEEF121F1E76426A00665E5C4479674322D4F75EDADD46DEBD5CD992F6ED" + }, + { "begin": 90, "end": 1087, "name": "DUP2", "source": 0 }, + { "begin": 90, "end": 1087, "name": "MSTORE", "source": 0 }, + { + "begin": 90, + "end": 1087, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 90, "end": 1087, "name": "ADD", "source": 0 }, + { + "begin": 931, + "end": 997, + "name": "PUSH", + "source": 0, + "value": "90689D0585FF075EC9E99AD690C3395BC4B313370B38EF355ACDADCD122975B" + }, + { "begin": 90, "end": 1087, "name": "DUP2", "source": 0 }, + { "begin": 90, "end": 1087, "name": "MSTORE", "source": 0 }, + { + "begin": 90, + "end": 1087, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 90, "end": 1087, "name": "ADD", "source": 0 }, + { + "begin": 1011, + "end": 1077, + "name": "PUSH", + "source": 0, + "value": "12C85EA5DB8C6DEB4AAB71808DCB408FE3D1E7690C43D37B4CE6CC0166FA7DAA" + }, + { "begin": 90, "end": 1087, "name": "DUP2", "source": 0 }, + { "begin": 90, "end": 1087, "name": "MSTORE", "source": 0 }, + { "begin": 90, "end": 1087, "name": "POP", "source": 0 }, + { "begin": 90, "end": 1087, "name": "SWAP1", "source": 0 }, + { "begin": 90, "end": 1087, "name": "POP", "source": 0 }, + { + "begin": 1097, + "end": 1121, + "name": "PUSH [tag]", + "source": 0, + "value": "4" + }, + { + "begin": 1097, + "end": 1121, + "name": "PUSH [tag]", + "source": 0, + "value": "5" + }, + { + "begin": 1097, + "end": 1121, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 1097, + "end": 1121, + "name": "tag", + "source": 0, + "value": "4" + }, + { "begin": 1097, "end": 1121, "name": "JUMPDEST", "source": 0 }, + { + "begin": 1131, + "end": 1143, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { + "begin": 1577, + "end": 1579, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 1569, "end": 1575, "name": "DUP3", "source": 0 }, + { + "begin": 1564, + "end": 1567, + "name": "PUSH", + "source": 0, + "value": "180" + }, + { "begin": 1557, "end": 1562, "name": "DUP6", "source": 0 }, + { + "begin": 1554, + "end": 1555, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { + "begin": 1548, + "end": 1552, + "name": "PUSH", + "source": 0, + "value": "8" + }, + { + "begin": 1541, + "end": 1545, + "name": "PUSH", + "source": 0, + "value": "7D0" + }, + { "begin": 1534, "end": 1539, "name": "GAS", "source": 0 }, + { "begin": 1530, "end": 1546, "name": "SUB", "source": 0 }, + { "begin": 1525, "end": 1580, "name": "CALL", "source": 0 }, + { "begin": 1514, "end": 1580, "name": "SWAP1", "source": 0 }, + { "begin": 1514, "end": 1580, "name": "POP", "source": 0 }, + { "begin": 1607, "end": 1614, "name": "DUP1", "source": 0 }, + { + "begin": 1599, + "end": 1648, + "name": "PUSH [tag]", + "source": 0, + "value": "6" + }, + { "begin": 1599, "end": 1648, "name": "JUMPI", "source": 0 }, + { + "begin": 1599, + "end": 1648, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 1599, "end": 1648, "name": "MLOAD", "source": 0 }, + { + "begin": 1599, + "end": 1648, + "name": "PUSH", + "source": 0, + "value": "8C379A000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 1599, "end": 1648, "name": "DUP2", "source": 0 }, + { "begin": 1599, "end": 1648, "name": "MSTORE", "source": 0 }, + { + "begin": 1599, + "end": 1648, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 1599, "end": 1648, "name": "ADD", "source": 0 }, + { + "begin": 1599, + "end": 1648, + "name": "PUSH [tag]", + "source": 0, + "value": "7" + }, + { "begin": 1599, "end": 1648, "name": "SWAP1", "source": 0 }, + { + "begin": 1599, + "end": 1648, + "name": "PUSH [tag]", + "source": 0, + "value": "8" + }, + { + "begin": 1599, + "end": 1648, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 1599, + "end": 1648, + "name": "tag", + "source": 0, + "value": "7" + }, + { "begin": 1599, "end": 1648, "name": "JUMPDEST", "source": 0 }, + { + "begin": 1599, + "end": 1648, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 1599, "end": 1648, "name": "MLOAD", "source": 0 }, + { "begin": 1599, "end": 1648, "name": "DUP1", "source": 0 }, + { "begin": 1599, "end": 1648, "name": "SWAP2", "source": 0 }, + { "begin": 1599, "end": 1648, "name": "SUB", "source": 0 }, + { "begin": 1599, "end": 1648, "name": "SWAP1", "source": 0 }, + { "begin": 1599, "end": 1648, "name": "REVERT", "source": 0 }, + { + "begin": 1599, + "end": 1648, + "name": "tag", + "source": 0, + "value": "6" + }, + { "begin": 1599, "end": 1648, "name": "JUMPDEST", "source": 0 }, + { + "begin": 1679, + "end": 1680, + "name": "PUSH", + "source": 0, + "value": "1" + }, + { "begin": 1666, "end": 1672, "name": "DUP3", "source": 0 }, + { + "begin": 1673, + "end": 1674, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { + "begin": 1666, + "end": 1675, + "name": "PUSH", + "source": 0, + "value": "1" + }, + { "begin": 1666, "end": 1675, "name": "DUP2", "source": 0 }, + { "begin": 1666, "end": 1675, "name": "LT", "source": 0 }, + { + "begin": 1666, + "end": 1675, + "name": "PUSH [tag]", + "source": 0, + "value": "9" + }, + { "begin": 1666, "end": 1675, "name": "JUMPI", "source": 0 }, + { + "begin": 1666, + "end": 1675, + "name": "PUSH", + "source": 0, + "value": "4E487B7100000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 1666, + "end": 1675, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 1666, "end": 1675, "name": "MSTORE", "source": 0 }, + { + "begin": 1666, + "end": 1675, + "name": "PUSH", + "source": 0, + "value": "32" + }, + { + "begin": 1666, + "end": 1675, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 1666, "end": 1675, "name": "MSTORE", "source": 0 }, + { + "begin": 1666, + "end": 1675, + "name": "PUSH", + "source": 0, + "value": "24" + }, + { + "begin": 1666, + "end": 1675, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 1666, "end": 1675, "name": "REVERT", "source": 0 }, + { + "begin": 1666, + "end": 1675, + "name": "tag", + "source": 0, + "value": "9" + }, + { "begin": 1666, "end": 1675, "name": "JUMPDEST", "source": 0 }, + { + "begin": 1666, + "end": 1675, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 1666, "end": 1675, "name": "MUL", "source": 0 }, + { "begin": 1666, "end": 1675, "name": "ADD", "source": 0 }, + { "begin": 1666, "end": 1675, "name": "MLOAD", "source": 0 }, + { "begin": 1666, "end": 1680, "name": "EQ", "source": 0 }, + { + "begin": 1658, + "end": 1691, + "name": "PUSH [tag]", + "source": 0, + "value": "10" + }, + { "begin": 1658, "end": 1691, "name": "JUMPI", "source": 0 }, + { + "begin": 1658, + "end": 1691, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 1658, "end": 1691, "name": "MLOAD", "source": 0 }, + { + "begin": 1658, + "end": 1691, + "name": "PUSH", + "source": 0, + "value": "8C379A000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 1658, "end": 1691, "name": "DUP2", "source": 0 }, + { "begin": 1658, "end": 1691, "name": "MSTORE", "source": 0 }, + { + "begin": 1658, + "end": 1691, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 1658, "end": 1691, "name": "ADD", "source": 0 }, + { + "begin": 1658, + "end": 1691, + "name": "PUSH [tag]", + "source": 0, + "value": "11" + }, + { "begin": 1658, "end": 1691, "name": "SWAP1", "source": 0 }, + { + "begin": 1658, + "end": 1691, + "name": "PUSH [tag]", + "source": 0, + "value": "12" + }, + { + "begin": 1658, + "end": 1691, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 1658, + "end": 1691, + "name": "tag", + "source": 0, + "value": "11" + }, + { "begin": 1658, "end": 1691, "name": "JUMPDEST", "source": 0 }, + { + "begin": 1658, + "end": 1691, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 1658, "end": 1691, "name": "MLOAD", "source": 0 }, + { "begin": 1658, "end": 1691, "name": "DUP1", "source": 0 }, + { "begin": 1658, "end": 1691, "name": "SWAP2", "source": 0 }, + { "begin": 1658, "end": 1691, "name": "SUB", "source": 0 }, + { "begin": 1658, "end": 1691, "name": "SWAP1", "source": 0 }, + { "begin": 1658, "end": 1691, "name": "REVERT", "source": 0 }, + { + "begin": 1658, + "end": 1691, + "name": "tag", + "source": 0, + "value": "10" + }, + { "begin": 1658, "end": 1691, "name": "JUMPDEST", "source": 0 }, + { "begin": 66, "end": 1702, "name": "POP", "source": 0 }, + { "begin": 66, "end": 1702, "name": "POP", "source": 0 }, + { "begin": 66, "end": 1702, "name": "POP", "source": 0 }, + { + "begin": 34, + "end": 1708, + "name": "PUSH [tag]", + "source": 0, + "value": "13" + }, + { "begin": 34, "end": 1708, "name": "JUMP", "source": 0 }, + { + "begin": 34, + "end": 1708, + "name": "tag", + "source": 0, + "value": "5" + }, + { "begin": 34, "end": 1708, "name": "JUMPDEST", "source": 0 }, + { + "begin": 34, + "end": 1708, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 1708, "name": "MLOAD", "source": 0 }, + { "begin": 34, "end": 1708, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 1708, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 34, "end": 1708, "name": "ADD", "source": 0 }, + { + "begin": 34, + "end": 1708, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 1708, "name": "MSTORE", "source": 0 }, + { "begin": 34, "end": 1708, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 1708, + "name": "PUSH", + "source": 0, + "value": "1" + }, + { "begin": 34, "end": 1708, "name": "SWAP1", "source": 0 }, + { + "begin": 34, + "end": 1708, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 34, "end": 1708, "name": "DUP3", "source": 0 }, + { "begin": 34, "end": 1708, "name": "MUL", "source": 0 }, + { "begin": 34, "end": 1708, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 1708, "name": "CALLDATASIZE", "source": 0 }, + { "begin": 34, "end": 1708, "name": "DUP4", "source": 0 }, + { "begin": 34, "end": 1708, "name": "CALLDATACOPY", "source": 0 }, + { "begin": 34, "end": 1708, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 1708, "name": "DUP3", "source": 0 }, + { "begin": 34, "end": 1708, "name": "ADD", "source": 0 }, + { "begin": 34, "end": 1708, "name": "SWAP2", "source": 0 }, + { "begin": 34, "end": 1708, "name": "POP", "source": 0 }, + { "begin": 34, "end": 1708, "name": "POP", "source": 0 }, + { "begin": 34, "end": 1708, "name": "SWAP1", "source": 0 }, + { "begin": 34, "end": 1708, "name": "POP", "source": 0 }, + { "begin": 34, "end": 1708, "name": "POP", "source": 0 }, + { "begin": 34, "end": 1708, "name": "SWAP1", "source": 0 }, + { + "begin": 34, + "end": 1708, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { "begin": 7, "end": 372, "name": "tag", "source": 1, "value": "15" }, + { "begin": 7, "end": 372, "name": "JUMPDEST", "source": 1 }, + { "begin": 7, "end": 372, "name": "PUSH", "source": 1, "value": "0" }, + { + "begin": 170, + "end": 236, + "name": "PUSH [tag]", + "source": 1, + "value": "17" + }, + { + "begin": 234, + "end": 235, + "name": "PUSH", + "source": 1, + "value": "6" + }, + { "begin": 229, "end": 232, "name": "DUP4", "source": 1 }, + { + "begin": 170, + "end": 236, + "name": "PUSH [tag]", + "source": 1, + "value": "18" + }, + { + "begin": 170, + "end": 236, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 170, + "end": 236, + "name": "tag", + "source": 1, + "value": "17" + }, + { "begin": 170, "end": 236, "name": "JUMPDEST", "source": 1 }, + { "begin": 163, "end": 236, "name": "SWAP2", "source": 1 }, + { "begin": 163, "end": 236, "name": "POP", "source": 1 }, + { + "begin": 245, + "end": 338, + "name": "PUSH [tag]", + "source": 1, + "value": "19" + }, + { "begin": 334, "end": 337, "name": "DUP3", "source": 1 }, + { + "begin": 245, + "end": 338, + "name": "PUSH [tag]", + "source": 1, + "value": "20" + }, + { + "begin": 245, + "end": 338, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 245, + "end": 338, + "name": "tag", + "source": 1, + "value": "19" + }, + { "begin": 245, "end": 338, "name": "JUMPDEST", "source": 1 }, + { + "begin": 363, + "end": 365, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 358, "end": 361, "name": "DUP3", "source": 1 }, + { "begin": 354, "end": 366, "name": "ADD", "source": 1 }, + { "begin": 347, "end": 366, "name": "SWAP1", "source": 1 }, + { "begin": 347, "end": 366, "name": "POP", "source": 1 }, + { "begin": 153, "end": 372, "name": "SWAP2", "source": 1 }, + { "begin": 153, "end": 372, "name": "SWAP1", "source": 1 }, + { "begin": 153, "end": 372, "name": "POP", "source": 1 }, + { + "begin": 153, + "end": 372, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 378, + "end": 744, + "name": "tag", + "source": 1, + "value": "21" + }, + { "begin": 378, "end": 744, "name": "JUMPDEST", "source": 1 }, + { + "begin": 378, + "end": 744, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 541, + "end": 608, + "name": "PUSH [tag]", + "source": 1, + "value": "23" + }, + { + "begin": 605, + "end": 607, + "name": "PUSH", + "source": 1, + "value": "1D" + }, + { "begin": 600, "end": 603, "name": "DUP4", "source": 1 }, + { + "begin": 541, + "end": 608, + "name": "PUSH [tag]", + "source": 1, + "value": "18" + }, + { + "begin": 541, + "end": 608, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 541, + "end": 608, + "name": "tag", + "source": 1, + "value": "23" + }, + { "begin": 541, "end": 608, "name": "JUMPDEST", "source": 1 }, + { "begin": 534, "end": 608, "name": "SWAP2", "source": 1 }, + { "begin": 534, "end": 608, "name": "POP", "source": 1 }, + { + "begin": 617, + "end": 710, + "name": "PUSH [tag]", + "source": 1, + "value": "24" + }, + { "begin": 706, "end": 709, "name": "DUP3", "source": 1 }, + { + "begin": 617, + "end": 710, + "name": "PUSH [tag]", + "source": 1, + "value": "25" + }, + { + "begin": 617, + "end": 710, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 617, + "end": 710, + "name": "tag", + "source": 1, + "value": "24" + }, + { "begin": 617, "end": 710, "name": "JUMPDEST", "source": 1 }, + { + "begin": 735, + "end": 737, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 730, "end": 733, "name": "DUP3", "source": 1 }, + { "begin": 726, "end": 738, "name": "ADD", "source": 1 }, + { "begin": 719, "end": 738, "name": "SWAP1", "source": 1 }, + { "begin": 719, "end": 738, "name": "POP", "source": 1 }, + { "begin": 524, "end": 744, "name": "SWAP2", "source": 1 }, + { "begin": 524, "end": 744, "name": "SWAP1", "source": 1 }, + { "begin": 524, "end": 744, "name": "POP", "source": 1 }, + { + "begin": 524, + "end": 744, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 750, + "end": 1169, + "name": "tag", + "source": 1, + "value": "12" + }, + { "begin": 750, "end": 1169, "name": "JUMPDEST", "source": 1 }, + { + "begin": 750, + "end": 1169, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 954, + "end": 956, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 943, "end": 952, "name": "DUP3", "source": 1 }, + { "begin": 939, "end": 957, "name": "ADD", "source": 1 }, + { "begin": 931, "end": 957, "name": "SWAP1", "source": 1 }, + { "begin": 931, "end": 957, "name": "POP", "source": 1 }, + { "begin": 1003, "end": 1012, "name": "DUP2", "source": 1 }, + { "begin": 997, "end": 1001, "name": "DUP2", "source": 1 }, + { "begin": 993, "end": 1013, "name": "SUB", "source": 1 }, + { + "begin": 989, + "end": 990, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 978, "end": 987, "name": "DUP4", "source": 1 }, + { "begin": 974, "end": 991, "name": "ADD", "source": 1 }, + { "begin": 967, "end": 1014, "name": "MSTORE", "source": 1 }, + { + "begin": 1031, + "end": 1162, + "name": "PUSH [tag]", + "source": 1, + "value": "27" + }, + { "begin": 1157, "end": 1161, "name": "DUP2", "source": 1 }, + { + "begin": 1031, + "end": 1162, + "name": "PUSH [tag]", + "source": 1, + "value": "15" + }, + { + "begin": 1031, + "end": 1162, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1031, + "end": 1162, + "name": "tag", + "source": 1, + "value": "27" + }, + { "begin": 1031, "end": 1162, "name": "JUMPDEST", "source": 1 }, + { "begin": 1023, "end": 1162, "name": "SWAP1", "source": 1 }, + { "begin": 1023, "end": 1162, "name": "POP", "source": 1 }, + { "begin": 921, "end": 1169, "name": "SWAP2", "source": 1 }, + { "begin": 921, "end": 1169, "name": "SWAP1", "source": 1 }, + { "begin": 921, "end": 1169, "name": "POP", "source": 1 }, + { + "begin": 921, + "end": 1169, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1175, + "end": 1594, + "name": "tag", + "source": 1, + "value": "8" + }, + { "begin": 1175, "end": 1594, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1175, + "end": 1594, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 1379, + "end": 1381, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 1368, "end": 1377, "name": "DUP3", "source": 1 }, + { "begin": 1364, "end": 1382, "name": "ADD", "source": 1 }, + { "begin": 1356, "end": 1382, "name": "SWAP1", "source": 1 }, + { "begin": 1356, "end": 1382, "name": "POP", "source": 1 }, + { "begin": 1428, "end": 1437, "name": "DUP2", "source": 1 }, + { "begin": 1422, "end": 1426, "name": "DUP2", "source": 1 }, + { "begin": 1418, "end": 1438, "name": "SUB", "source": 1 }, + { + "begin": 1414, + "end": 1415, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1403, "end": 1412, "name": "DUP4", "source": 1 }, + { "begin": 1399, "end": 1416, "name": "ADD", "source": 1 }, + { "begin": 1392, "end": 1439, "name": "MSTORE", "source": 1 }, + { + "begin": 1456, + "end": 1587, + "name": "PUSH [tag]", + "source": 1, + "value": "29" + }, + { "begin": 1582, "end": 1586, "name": "DUP2", "source": 1 }, + { + "begin": 1456, + "end": 1587, + "name": "PUSH [tag]", + "source": 1, + "value": "21" + }, + { + "begin": 1456, + "end": 1587, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1456, + "end": 1587, + "name": "tag", + "source": 1, + "value": "29" + }, + { "begin": 1456, "end": 1587, "name": "JUMPDEST", "source": 1 }, + { "begin": 1448, "end": 1587, "name": "SWAP1", "source": 1 }, + { "begin": 1448, "end": 1587, "name": "POP", "source": 1 }, + { "begin": 1346, "end": 1594, "name": "SWAP2", "source": 1 }, + { "begin": 1346, "end": 1594, "name": "SWAP1", "source": 1 }, + { "begin": 1346, "end": 1594, "name": "POP", "source": 1 }, + { + "begin": 1346, + "end": 1594, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1600, + "end": 1769, + "name": "tag", + "source": 1, + "value": "18" + }, + { "begin": 1600, "end": 1769, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1600, + "end": 1769, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1718, "end": 1724, "name": "DUP3", "source": 1 }, + { "begin": 1713, "end": 1716, "name": "DUP3", "source": 1 }, + { "begin": 1706, "end": 1725, "name": "MSTORE", "source": 1 }, + { + "begin": 1758, + "end": 1762, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 1753, "end": 1756, "name": "DUP3", "source": 1 }, + { "begin": 1749, "end": 1763, "name": "ADD", "source": 1 }, + { "begin": 1734, "end": 1763, "name": "SWAP1", "source": 1 }, + { "begin": 1734, "end": 1763, "name": "POP", "source": 1 }, + { "begin": 1696, "end": 1769, "name": "SWAP3", "source": 1 }, + { "begin": 1696, "end": 1769, "name": "SWAP2", "source": 1 }, + { "begin": 1696, "end": 1769, "name": "POP", "source": 1 }, + { "begin": 1696, "end": 1769, "name": "POP", "source": 1 }, + { + "begin": 1696, + "end": 1769, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1775, + "end": 1931, + "name": "tag", + "source": 1, + "value": "20" + }, + { "begin": 1775, "end": 1931, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1915, + "end": 1923, + "name": "PUSH", + "source": 1, + "value": "6661696C65640000000000000000000000000000000000000000000000000000" + }, + { + "begin": 1911, + "end": 1912, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1903, "end": 1909, "name": "DUP3", "source": 1 }, + { "begin": 1899, "end": 1913, "name": "ADD", "source": 1 }, + { "begin": 1892, "end": 1924, "name": "MSTORE", "source": 1 }, + { "begin": 1881, "end": 1931, "name": "POP", "source": 1 }, + { + "begin": 1881, + "end": 1931, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1937, + "end": 2116, + "name": "tag", + "source": 1, + "value": "25" + }, + { "begin": 1937, "end": 2116, "name": "JUMPDEST", "source": 1 }, + { + "begin": 2077, + "end": 2108, + "name": "PUSH", + "source": 1, + "value": "656C6C69707469632063757276652070616972696E67206661696C6564000000" + }, + { + "begin": 2073, + "end": 2074, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 2065, "end": 2071, "name": "DUP3", "source": 1 }, + { "begin": 2061, "end": 2075, "name": "ADD", "source": 1 }, + { "begin": 2054, "end": 2109, "name": "MSTORE", "source": 1 }, + { "begin": 2043, "end": 2116, "name": "POP", "source": 1 }, + { + "begin": 2043, + "end": 2116, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 34, + "end": 1708, + "name": "tag", + "source": 0, + "value": "13" + }, + { "begin": 34, "end": 1708, "name": "JUMPDEST", "source": 0 }, + { + "begin": 34, + "end": 1708, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 34, "end": 1708, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 1708, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 34, + "end": 1708, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 1708, "name": "CODECOPY", "source": 0 }, + { + "begin": 34, + "end": 1708, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 1708, "name": "RETURN", "source": 0 } + ], + ".data": { + "0": { + ".auxdata": "a2646970667358221220e90355f07d7a4ae3a9df347abcddaab722cb5be69464e1ff818d231c9ee0b8de64736f6c63430008030033", + ".code": [ + { + "begin": 34, + "end": 1708, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 34, + "end": 1708, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 1708, "name": "MSTORE", "source": 0 }, + { + "begin": 34, + "end": 1708, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 1708, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 1708, "name": "REVERT", "source": 0 } + ] + } + } + }, + "methodIdentifiers": {} + }, + "ewasm": { "wasm": "" }, + "metadata": "{\"compiler\":{\"version\":\"0.8.3+commit.8d00100c\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"main.sol\":\"Bn128Pairing\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"main.sol\":{\"keccak256\":\"0x53e3d63190581fae7ffa509a011ef9051a34716920e445019ec671b70f62ce7b\",\"urls\":[\"bzz-raw://03fe2554e9fd58d008751b86eb89d2b31e5eac80d93f76dc939b0d13945cdd38\",\"dweb:/ipfs/QmUThb48t3ZMNE6a99sgqtWNUVGitj4eRrS2Gj3oxxRfMu\"]}},\"version\":1}", + "storageLayout": { "storage": [], "types": null }, + "userdoc": { "kind": "user", "methods": {}, "version": 1 } + }, + "sourceCode": "\n pragma solidity >=0.8.0;\n contract Bn128Pairing {\n constructor() {\n uint256[12] memory input = [\n 0x2eca0c7238bf16e83e7a1e6c5d49540685ff51380f309842a98561558019fc02,\n 0x03d3260361bb8451de5ff5ecd17f010ff22f5c31cdf184e9020b06fa5997db84,\n 0x1213d2149b006137fcfb23036606f848d638d576a120ca981b5b1a5f9300b3ee,\n 0x2276cf730cf493cd95d64677bbb75fc42db72513a4c1e387b476d056f80aa75f,\n 0x21ee6226d31426322afcda621464d0611d226783262e21bb3bc86b537e986237,\n 0x096df1f82dff337dd5972e32a8ad43e28a78a96a823ef1cd4debe12b6552ea5f,\n 0x06967a1237ebfeca9aaae0d6d0bab8e28c198c5a339ef8a2407e31cdac516db9,\n 0x22160fa257a5fd5b280642ff47b65eca77e626cb685c84fa6d3b6882a283ddd1,\n 0x198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c2,\n 0x1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed,\n 0x090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b,\n 0x12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa\n ];\n uint256[1] memory result;\n bool success;\n assembly {\n // 0x08 id of the bn256CheckPairing precompile\n // 0 number of ether to transfer\n // 0 since we have an array of fixed length, our input starts in 0\n // 384 size of call parameters, i.e. 12*256 bits == 384 bytes\n // 32 size of result (one 32 byte boolean!)\n success := call(sub(gas(), 2000), 0x08, 0, input, 384, result, 32)\n }\n require(success, \"elliptic curve pairing failed\");\n require(result[0] == 1, \"failed\");\n }\n }" +} diff --git a/tests/contracts/compiled/Callee.json b/tests/contracts/compiled/Callee.json new file mode 100644 index 00000000000..e2efeba4483 --- /dev/null +++ b/tests/contracts/compiled/Callee.json @@ -0,0 +1,2087 @@ +{ + "byteCode": "0x608060405234801561001057600080fd5b506101f5806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063975057e71461003b578063fd63983b14610059575b600080fd5b610043610089565b60405161005091906100fe565b60405180910390f35b610073600480360381019061006e91906100c6565b61008f565b60405161008091906100fe565b60405180910390f35b60005481565b600080600790508260008190555080836100a99190610119565b915050919050565b6000813590506100c0816101a8565b92915050565b6000602082840312156100d857600080fd5b60006100e6848285016100b1565b91505092915050565b6100f88161016f565b82525050565b600060208201905061011360008301846100ef565b92915050565b60006101248261016f565b915061012f8361016f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561016457610163610179565b5b828201905092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6101b18161016f565b81146101bc57600080fd5b5056fea2646970667358221220fc2cf663fdc41a2c9133174a8fc392a6a833f094e2faa27c00da20fd8f81d2da64736f6c63430008030033", + "contract": { + "abi": [ + { + "inputs": [ + { "internalType": "uint256", "name": "_value", "type": "uint256" } + ], + "name": "addtwo", + "outputs": [ + { "internalType": "uint256", "name": "result", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "store", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + } + ], + "devdoc": { "kind": "dev", "methods": {}, "version": 1 }, + "evm": { + "assembly": " /* \"main.sol\":34:247 contract Callee {... */\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 /* \"main.sol\":34:247 contract Callee {... */\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 0x975057e7\n eq\n tag_3\n jumpi\n dup1\n 0xfd63983b\n eq\n tag_4\n jumpi\n tag_2:\n 0x00\n dup1\n revert\n /* \"main.sol\":60:77 uint public store */\n tag_3:\n tag_5\n tag_6\n jump\t// in\n tag_5:\n mload(0x40)\n tag_7\n swap2\n swap1\n tag_8\n jump\t// in\n tag_7:\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n return\n /* \"main.sol\":87:241 function addtwo(uint _value) external returns (uint result) {... */\n tag_4:\n tag_9\n 0x04\n dup1\n calldatasize\n sub\n dup2\n add\n swap1\n tag_10\n swap2\n swap1\n tag_11\n jump\t// in\n tag_10:\n tag_12\n jump\t// in\n tag_9:\n mload(0x40)\n tag_13\n swap2\n swap1\n tag_8\n jump\t// in\n tag_13:\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n return\n /* \"main.sol\":60:77 uint public store */\n tag_6:\n sload(0x00)\n dup2\n jump\t// out\n /* \"main.sol\":87:241 function addtwo(uint _value) external returns (uint result) {... */\n tag_12:\n /* \"main.sol\":134:145 uint result */\n 0x00\n /* \"main.sol\":161:167 uint x */\n dup1\n /* \"main.sol\":170:171 7 */\n 0x07\n /* \"main.sol\":161:171 uint x = 7 */\n swap1\n pop\n /* \"main.sol\":193:199 _value */\n dup3\n /* \"main.sol\":185:190 store */\n 0x00\n /* \"main.sol\":185:199 store = _value */\n dup2\n swap1\n sstore\n pop\n /* \"main.sol\":229:230 x */\n dup1\n /* \"main.sol\":220:226 _value */\n dup4\n /* \"main.sol\":220:230 _value + x */\n tag_15\n swap2\n swap1\n tag_16\n jump\t// in\n tag_15:\n /* \"main.sol\":213:230 return _value + x */\n swap2\n pop\n pop\n /* \"main.sol\":87:241 function addtwo(uint _value) external returns (uint result) {... */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":7:146 */\n tag_18:\n 0x00\n /* \"#utility.yul\":91:97 */\n dup2\n /* \"#utility.yul\":78:98 */\n calldataload\n /* \"#utility.yul\":69:98 */\n swap1\n pop\n /* \"#utility.yul\":107:140 */\n tag_20\n /* \"#utility.yul\":134:139 */\n dup2\n /* \"#utility.yul\":107:140 */\n tag_21\n jump\t// in\n tag_20:\n /* \"#utility.yul\":59:146 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":152:414 */\n tag_11:\n 0x00\n /* \"#utility.yul\":260:262 */\n 0x20\n /* \"#utility.yul\":248:257 */\n dup3\n /* \"#utility.yul\":239:246 */\n dup5\n /* \"#utility.yul\":235:258 */\n sub\n /* \"#utility.yul\":231:263 */\n slt\n /* \"#utility.yul\":228:230 */\n iszero\n tag_23\n jumpi\n /* \"#utility.yul\":276:277 */\n 0x00\n /* \"#utility.yul\":273:274 */\n dup1\n /* \"#utility.yul\":266:278 */\n revert\n /* \"#utility.yul\":228:230 */\n tag_23:\n /* \"#utility.yul\":319:320 */\n 0x00\n /* \"#utility.yul\":344:397 */\n tag_24\n /* \"#utility.yul\":389:396 */\n dup5\n /* \"#utility.yul\":380:386 */\n dup3\n /* \"#utility.yul\":369:378 */\n dup6\n /* \"#utility.yul\":365:387 */\n add\n /* \"#utility.yul\":344:397 */\n tag_18\n jump\t// in\n tag_24:\n /* \"#utility.yul\":334:397 */\n swap2\n pop\n /* \"#utility.yul\":290:407 */\n pop\n /* \"#utility.yul\":218:414 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":420:538 */\n tag_25:\n /* \"#utility.yul\":507:531 */\n tag_27\n /* \"#utility.yul\":525:530 */\n dup2\n /* \"#utility.yul\":507:531 */\n tag_28\n jump\t// in\n tag_27:\n /* \"#utility.yul\":502:505 */\n dup3\n /* \"#utility.yul\":495:532 */\n mstore\n /* \"#utility.yul\":485:538 */\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":544:766 */\n tag_8:\n 0x00\n /* \"#utility.yul\":675:677 */\n 0x20\n /* \"#utility.yul\":664:673 */\n dup3\n /* \"#utility.yul\":660:678 */\n add\n /* \"#utility.yul\":652:678 */\n swap1\n pop\n /* \"#utility.yul\":688:759 */\n tag_30\n /* \"#utility.yul\":756:757 */\n 0x00\n /* \"#utility.yul\":745:754 */\n dup4\n /* \"#utility.yul\":741:758 */\n add\n /* \"#utility.yul\":732:738 */\n dup5\n /* \"#utility.yul\":688:759 */\n tag_25\n jump\t// in\n tag_30:\n /* \"#utility.yul\":642:766 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":772:1077 */\n tag_16:\n 0x00\n /* \"#utility.yul\":831:851 */\n tag_32\n /* \"#utility.yul\":849:850 */\n dup3\n /* \"#utility.yul\":831:851 */\n tag_28\n jump\t// in\n tag_32:\n /* \"#utility.yul\":826:851 */\n swap2\n pop\n /* \"#utility.yul\":865:885 */\n tag_33\n /* \"#utility.yul\":883:884 */\n dup4\n /* \"#utility.yul\":865:885 */\n tag_28\n jump\t// in\n tag_33:\n /* \"#utility.yul\":860:885 */\n swap3\n pop\n /* \"#utility.yul\":1019:1020 */\n dup3\n /* \"#utility.yul\":951:1017 */\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\n /* \"#utility.yul\":947:1021 */\n sub\n /* \"#utility.yul\":944:945 */\n dup3\n /* \"#utility.yul\":941:1022 */\n gt\n /* \"#utility.yul\":938:940 */\n iszero\n tag_34\n jumpi\n /* \"#utility.yul\":1025:1043 */\n tag_35\n tag_36\n jump\t// in\n tag_35:\n /* \"#utility.yul\":938:940 */\n tag_34:\n /* \"#utility.yul\":1069:1070 */\n dup3\n /* \"#utility.yul\":1066:1067 */\n dup3\n /* \"#utility.yul\":1062:1071 */\n add\n /* \"#utility.yul\":1055:1071 */\n swap1\n pop\n /* \"#utility.yul\":816:1077 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":1083:1160 */\n tag_28:\n 0x00\n /* \"#utility.yul\":1149:1154 */\n dup2\n /* \"#utility.yul\":1138:1154 */\n swap1\n pop\n /* \"#utility.yul\":1128:1160 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":1166:1346 */\n tag_36:\n /* \"#utility.yul\":1214:1291 */\n 0x4e487b7100000000000000000000000000000000000000000000000000000000\n /* \"#utility.yul\":1211:1212 */\n 0x00\n /* \"#utility.yul\":1204:1292 */\n mstore\n /* \"#utility.yul\":1311:1315 */\n 0x11\n /* \"#utility.yul\":1308:1309 */\n 0x04\n /* \"#utility.yul\":1301:1316 */\n mstore\n /* \"#utility.yul\":1335:1339 */\n 0x24\n /* \"#utility.yul\":1332:1333 */\n 0x00\n /* \"#utility.yul\":1325:1340 */\n revert\n /* \"#utility.yul\":1352:1474 */\n tag_21:\n /* \"#utility.yul\":1425:1449 */\n tag_40\n /* \"#utility.yul\":1443:1448 */\n dup2\n /* \"#utility.yul\":1425:1449 */\n tag_28\n jump\t// in\n tag_40:\n /* \"#utility.yul\":1418:1423 */\n dup2\n /* \"#utility.yul\":1415:1450 */\n eq\n /* \"#utility.yul\":1405:1407 */\n tag_41\n jumpi\n /* \"#utility.yul\":1464:1465 */\n 0x00\n /* \"#utility.yul\":1461:1462 */\n dup1\n /* \"#utility.yul\":1454:1466 */\n revert\n /* \"#utility.yul\":1405:1407 */\n tag_41:\n /* \"#utility.yul\":1395:1474 */\n pop\n jump\t// out\n\n auxdata: 0xa2646970667358221220fc2cf663fdc41a2c9133174a8fc392a6a833f094e2faa27c00da20fd8f81d2da64736f6c63430008030033\n}\n", + "bytecode": { + "generatedSources": [], + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b506101f5806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063975057e71461003b578063fd63983b14610059575b600080fd5b610043610089565b60405161005091906100fe565b60405180910390f35b610073600480360381019061006e91906100c6565b61008f565b60405161008091906100fe565b60405180910390f35b60005481565b600080600790508260008190555080836100a99190610119565b915050919050565b6000813590506100c0816101a8565b92915050565b6000602082840312156100d857600080fd5b60006100e6848285016100b1565b91505092915050565b6100f88161016f565b82525050565b600060208201905061011360008301846100ef565b92915050565b60006101248261016f565b915061012f8361016f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561016457610163610179565b5b828201905092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6101b18161016f565b81146101bc57600080fd5b5056fea2646970667358221220fc2cf663fdc41a2c9133174a8fc392a6a833f094e2faa27c00da20fd8f81d2da64736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1F5 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 0x975057E7 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0xFD63983B EQ PUSH2 0x59 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x89 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x50 SWAP2 SWAP1 PUSH2 0xFE JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x73 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x6E SWAP2 SWAP1 PUSH2 0xC6 JUMP JUMPDEST PUSH2 0x8F JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x80 SWAP2 SWAP1 PUSH2 0xFE JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x7 SWAP1 POP DUP3 PUSH1 0x0 DUP2 SWAP1 SSTORE POP DUP1 DUP4 PUSH2 0xA9 SWAP2 SWAP1 PUSH2 0x119 JUMP JUMPDEST SWAP2 POP POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xC0 DUP2 PUSH2 0x1A8 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xD8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0xE6 DUP5 DUP3 DUP6 ADD PUSH2 0xB1 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0xF8 DUP2 PUSH2 0x16F JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x113 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0xEF JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x124 DUP3 PUSH2 0x16F JUMP JUMPDEST SWAP2 POP PUSH2 0x12F DUP4 PUSH2 0x16F JUMP JUMPDEST SWAP3 POP DUP3 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SUB DUP3 GT ISZERO PUSH2 0x164 JUMPI PUSH2 0x163 PUSH2 0x179 JUMP JUMPDEST JUMPDEST DUP3 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH2 0x1B1 DUP2 PUSH2 0x16F JUMP JUMPDEST DUP2 EQ PUSH2 0x1BC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xFC 0x2C 0xF6 PUSH4 0xFDC41A2C SWAP2 CALLER OR 0x4A DUP16 0xC3 SWAP3 0xA6 0xA8 CALLER CREATE SWAP5 0xE2 STATICCALL LOG2 PUSH29 0xDA20FD8F81D2DA64736F6C6343000803003300000000000000000000 ", + "sourceMap": "34:213:0:-:0;;;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "generatedSources": [ + { + "ast": { + "nodeType": "YulBlock", + "src": "0:1477:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "59:87:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "69:29:1", + "value": { + "arguments": [ + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "91:6:1" + } + ], + "functionName": { + "name": "calldataload", + "nodeType": "YulIdentifier", + "src": "78:12:1" + }, + "nodeType": "YulFunctionCall", + "src": "78:20:1" + }, + "variableNames": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "69:5:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "134:5:1" + } + ], + "functionName": { + "name": "validator_revert_t_uint256", + "nodeType": "YulIdentifier", + "src": "107:26:1" + }, + "nodeType": "YulFunctionCall", + "src": "107:33:1" + }, + "nodeType": "YulExpressionStatement", + "src": "107:33:1" + } + ] + }, + "name": "abi_decode_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "37:6:1", + "type": "" + }, + { + "name": "end", + "nodeType": "YulTypedName", + "src": "45:3:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "53:5:1", + "type": "" + } + ], + "src": "7:139:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "218:196:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "264:16:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "273:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "276:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "266:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "266:12:1" + }, + "nodeType": "YulExpressionStatement", + "src": "266:12:1" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "239:7:1" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "248:9:1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "235:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "235:23:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "260:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "231:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "231:32:1" + }, + "nodeType": "YulIf", + "src": "228:2:1" + }, + { + "nodeType": "YulBlock", + "src": "290:117:1", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "305:15:1", + "value": { + "kind": "number", + "nodeType": "YulLiteral", + "src": "319:1:1", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "309:6:1", + "type": "" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "334:63:1", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "369:9:1" + }, + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "380:6:1" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "365:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "365:22:1" + }, + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "389:7:1" + } + ], + "functionName": { + "name": "abi_decode_t_uint256", + "nodeType": "YulIdentifier", + "src": "344:20:1" + }, + "nodeType": "YulFunctionCall", + "src": "344:53:1" + }, + "variableNames": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "334:6:1" + } + ] + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "188:9:1", + "type": "" + }, + { + "name": "dataEnd", + "nodeType": "YulTypedName", + "src": "199:7:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "211:6:1", + "type": "" + } + ], + "src": "152:262:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "485:53:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "502:3:1" + }, + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "525:5:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "507:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "507:24:1" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "495:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "495:37:1" + }, + "nodeType": "YulExpressionStatement", + "src": "495:37:1" + } + ] + }, + "name": "abi_encode_t_uint256_to_t_uint256_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "473:5:1", + "type": "" + }, + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "480:3:1", + "type": "" + } + ], + "src": "420:118:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "642:124:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "652:26:1", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "664:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "675:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "660:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "660:18:1" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "652:4:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "732:6:1" + }, + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "745:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "756:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "741:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "741:17:1" + } + ], + "functionName": { + "name": "abi_encode_t_uint256_to_t_uint256_fromStack", + "nodeType": "YulIdentifier", + "src": "688:43:1" + }, + "nodeType": "YulFunctionCall", + "src": "688:71:1" + }, + "nodeType": "YulExpressionStatement", + "src": "688:71:1" + } + ] + }, + "name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "614:9:1", + "type": "" + }, + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "626:6:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "637:4:1", + "type": "" + } + ], + "src": "544:222:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "816:261:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "826:25:1", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "849:1:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "831:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "831:20:1" + }, + "variableNames": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "826:1:1" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "860:25:1", + "value": { + "arguments": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "883:1:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "865:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "865:20:1" + }, + "variableNames": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "860:1:1" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1023:22:1", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nodeType": "YulIdentifier", + "src": "1025:16:1" + }, + "nodeType": "YulFunctionCall", + "src": "1025:18:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1025:18:1" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "944:1:1" + }, + { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "951:66:1", + "type": "", + "value": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "1019:1:1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "947:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "947:74:1" + } + ], + "functionName": { + "name": "gt", + "nodeType": "YulIdentifier", + "src": "941:2:1" + }, + "nodeType": "YulFunctionCall", + "src": "941:81:1" + }, + "nodeType": "YulIf", + "src": "938:2:1" + }, + { + "nodeType": "YulAssignment", + "src": "1055:16:1", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "1066:1:1" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "1069:1:1" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1062:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1062:9:1" + }, + "variableNames": [ + { + "name": "sum", + "nodeType": "YulIdentifier", + "src": "1055:3:1" + } + ] + } + ] + }, + "name": "checked_add_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "x", + "nodeType": "YulTypedName", + "src": "803:1:1", + "type": "" + }, + { + "name": "y", + "nodeType": "YulTypedName", + "src": "806:1:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "sum", + "nodeType": "YulTypedName", + "src": "812:3:1", + "type": "" + } + ], + "src": "772:305:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1128:32:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "1138:16:1", + "value": { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1149:5:1" + }, + "variableNames": [ + { + "name": "cleaned", + "nodeType": "YulIdentifier", + "src": "1138:7:1" + } + ] + } + ] + }, + "name": "cleanup_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "1110:5:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "cleaned", + "nodeType": "YulTypedName", + "src": "1120:7:1", + "type": "" + } + ], + "src": "1083:77:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1194:152:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1211:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1214:77:1", + "type": "", + "value": "35408467139433450592217433187231851964531694900788300625387963629091585785856" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "1204:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1204:88:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1204:88:1" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1308:1:1", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1311:4:1", + "type": "", + "value": "0x11" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "1301:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1301:15:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1301:15:1" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1332:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1335:4:1", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "1325:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1325:15:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1325:15:1" + } + ] + }, + "name": "panic_error_0x11", + "nodeType": "YulFunctionDefinition", + "src": "1166:180:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1395:79:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "1452:16:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1461:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1464:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "1454:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1454:12:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1454:12:1" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1418:5:1" + }, + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1443:5:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "1425:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "1425:24:1" + } + ], + "functionName": { + "name": "eq", + "nodeType": "YulIdentifier", + "src": "1415:2:1" + }, + "nodeType": "YulFunctionCall", + "src": "1415:35:1" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "1408:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1408:43:1" + }, + "nodeType": "YulIf", + "src": "1405:2:1" + } + ] + }, + "name": "validator_revert_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "1388:5:1", + "type": "" + } + ], + "src": "1352:122:1" + } + ] + }, + "contents": "{\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(0, 0) }\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 function checked_add_t_uint256(x, y) -> sum {\n x := cleanup_t_uint256(x)\n y := cleanup_t_uint256(y)\n\n // overflow, if x > (maxValue - y)\n if gt(x, sub(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, y)) { panic_error_0x11() }\n\n sum := add(x, y)\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function panic_error_0x11() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n\n function validator_revert_t_uint256(value) {\n if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }\n }\n\n}\n", + "id": 1, + "language": "Yul", + "name": "#utility.yul" + } + ], + "immutableReferences": {}, + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b50600436106100365760003560e01c8063975057e71461003b578063fd63983b14610059575b600080fd5b610043610089565b60405161005091906100fe565b60405180910390f35b610073600480360381019061006e91906100c6565b61008f565b60405161008091906100fe565b60405180910390f35b60005481565b600080600790508260008190555080836100a99190610119565b915050919050565b6000813590506100c0816101a8565b92915050565b6000602082840312156100d857600080fd5b60006100e6848285016100b1565b91505092915050565b6100f88161016f565b82525050565b600060208201905061011360008301846100ef565b92915050565b60006101248261016f565b915061012f8361016f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561016457610163610179565b5b828201905092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6101b18161016f565b81146101bc57600080fd5b5056fea2646970667358221220fc2cf663fdc41a2c9133174a8fc392a6a833f094e2faa27c00da20fd8f81d2da64736f6c63430008030033", + "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 0x975057E7 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0xFD63983B EQ PUSH2 0x59 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x89 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x50 SWAP2 SWAP1 PUSH2 0xFE JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x73 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x6E SWAP2 SWAP1 PUSH2 0xC6 JUMP JUMPDEST PUSH2 0x8F JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x80 SWAP2 SWAP1 PUSH2 0xFE JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x7 SWAP1 POP DUP3 PUSH1 0x0 DUP2 SWAP1 SSTORE POP DUP1 DUP4 PUSH2 0xA9 SWAP2 SWAP1 PUSH2 0x119 JUMP JUMPDEST SWAP2 POP POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xC0 DUP2 PUSH2 0x1A8 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xD8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0xE6 DUP5 DUP3 DUP6 ADD PUSH2 0xB1 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0xF8 DUP2 PUSH2 0x16F JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x113 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0xEF JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x124 DUP3 PUSH2 0x16F JUMP JUMPDEST SWAP2 POP PUSH2 0x12F DUP4 PUSH2 0x16F JUMP JUMPDEST SWAP3 POP DUP3 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SUB DUP3 GT ISZERO PUSH2 0x164 JUMPI PUSH2 0x163 PUSH2 0x179 JUMP JUMPDEST JUMPDEST DUP3 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH2 0x1B1 DUP2 PUSH2 0x16F JUMP JUMPDEST DUP2 EQ PUSH2 0x1BC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xFC 0x2C 0xF6 PUSH4 0xFDC41A2C SWAP2 CALLER OR 0x4A DUP16 0xC3 SWAP3 0xA6 0xA8 CALLER CREATE SWAP5 0xE2 STATICCALL LOG2 PUSH29 0xDA20FD8F81D2DA64736F6C6343000803003300000000000000000000 ", + "sourceMap": "34:213:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;60:17;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;87:154;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;60:17;;;;:::o;87:154::-;134:11;161:6;170:1;161:10;;193:6;185:5;:14;;;;229:1;220:6;:10;;;;:::i;:::-;213:17;;;87:154;;;:::o;7:139:1:-;;91:6;78:20;69:29;;107:33;134:5;107:33;:::i;:::-;59:87;;;;:::o;152:262::-;;260:2;248:9;239:7;235:23;231:32;228:2;;;276:1;273;266:12;228:2;319:1;344:53;389:7;380:6;369:9;365:22;344:53;:::i;:::-;334:63;;290:117;218:196;;;;:::o;420:118::-;507:24;525:5;507:24;:::i;:::-;502:3;495:37;485:53;;:::o;544:222::-;;675:2;664:9;660:18;652:26;;688:71;756:1;745:9;741:17;732:6;688:71;:::i;:::-;642:124;;;;:::o;772:305::-;;831:20;849:1;831:20;:::i;:::-;826:25;;865:20;883:1;865:20;:::i;:::-;860:25;;1019:1;951:66;947:74;944:1;941:81;938:2;;;1025:18;;:::i;:::-;938:2;1069:1;1066;1062:9;1055:16;;816:261;;;;:::o;1083:77::-;;1149:5;1138:16;;1128:32;;;:::o;1166:180::-;1214:77;1211:1;1204:88;1311:4;1308:1;1301:15;1335:4;1332:1;1325:15;1352:122;1425:24;1443:5;1425:24;:::i;:::-;1418:5;1415:35;1405:2;;1464:1;1461;1454:12;1405:2;1395:79;:::o" + }, + "gasEstimates": { + "creation": { + "codeDepositCost": "100200", + "executionCost": "147", + "totalCost": "100347" + }, + "external": { "addtwo(uint256)": "infinite", "store()": "1107" } + }, + "legacyAssembly": { + ".code": [ + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 247, "name": "MSTORE", "source": 0 }, + { "begin": 34, "end": 247, "name": "CALLVALUE", "source": 0 }, + { "begin": 34, "end": 247, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 247, "name": "ISZERO", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 34, "end": 247, "name": "JUMPI", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 247, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 247, "name": "REVERT", "source": 0 }, + { "begin": 34, "end": 247, "name": "tag", "source": 0, "value": "1" }, + { "begin": 34, "end": 247, "name": "JUMPDEST", "source": 0 }, + { "begin": 34, "end": 247, "name": "POP", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 34, "end": 247, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 247, "name": "CODECOPY", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 247, "name": "RETURN", "source": 0 } + ], + ".data": { + "0": { + ".auxdata": "a2646970667358221220fc2cf663fdc41a2c9133174a8fc392a6a833f094e2faa27c00da20fd8f81d2da64736f6c63430008030033", + ".code": [ + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 247, "name": "MSTORE", "source": 0 }, + { "begin": 34, "end": 247, "name": "CALLVALUE", "source": 0 }, + { "begin": 34, "end": 247, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 247, "name": "ISZERO", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 34, "end": 247, "name": "JUMPI", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 247, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 247, "name": "REVERT", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "tag", + "source": 0, + "value": "1" + }, + { "begin": 34, "end": 247, "name": "JUMPDEST", "source": 0 }, + { "begin": 34, "end": 247, "name": "POP", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 34, "end": 247, "name": "CALLDATASIZE", "source": 0 }, + { "begin": 34, "end": 247, "name": "LT", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH [tag]", + "source": 0, + "value": "2" + }, + { "begin": 34, "end": 247, "name": "JUMPI", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 247, "name": "CALLDATALOAD", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "E0" + }, + { "begin": 34, "end": 247, "name": "SHR", "source": 0 }, + { "begin": 34, "end": 247, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "975057E7" + }, + { "begin": 34, "end": 247, "name": "EQ", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH [tag]", + "source": 0, + "value": "3" + }, + { "begin": 34, "end": 247, "name": "JUMPI", "source": 0 }, + { "begin": 34, "end": 247, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "FD63983B" + }, + { "begin": 34, "end": 247, "name": "EQ", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH [tag]", + "source": 0, + "value": "4" + }, + { "begin": 34, "end": 247, "name": "JUMPI", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "tag", + "source": 0, + "value": "2" + }, + { "begin": 34, "end": 247, "name": "JUMPDEST", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 247, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 247, "name": "REVERT", "source": 0 }, + { + "begin": 60, + "end": 77, + "name": "tag", + "source": 0, + "value": "3" + }, + { "begin": 60, "end": 77, "name": "JUMPDEST", "source": 0 }, + { + "begin": 60, + "end": 77, + "name": "PUSH [tag]", + "source": 0, + "value": "5" + }, + { + "begin": 60, + "end": 77, + "name": "PUSH [tag]", + "source": 0, + "value": "6" + }, + { + "begin": 60, + "end": 77, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 60, + "end": 77, + "name": "tag", + "source": 0, + "value": "5" + }, + { "begin": 60, "end": 77, "name": "JUMPDEST", "source": 0 }, + { + "begin": 60, + "end": 77, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 60, "end": 77, "name": "MLOAD", "source": 0 }, + { + "begin": 60, + "end": 77, + "name": "PUSH [tag]", + "source": 0, + "value": "7" + }, + { "begin": 60, "end": 77, "name": "SWAP2", "source": 0 }, + { "begin": 60, "end": 77, "name": "SWAP1", "source": 0 }, + { + "begin": 60, + "end": 77, + "name": "PUSH [tag]", + "source": 0, + "value": "8" + }, + { + "begin": 60, + "end": 77, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 60, + "end": 77, + "name": "tag", + "source": 0, + "value": "7" + }, + { "begin": 60, "end": 77, "name": "JUMPDEST", "source": 0 }, + { + "begin": 60, + "end": 77, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 60, "end": 77, "name": "MLOAD", "source": 0 }, + { "begin": 60, "end": 77, "name": "DUP1", "source": 0 }, + { "begin": 60, "end": 77, "name": "SWAP2", "source": 0 }, + { "begin": 60, "end": 77, "name": "SUB", "source": 0 }, + { "begin": 60, "end": 77, "name": "SWAP1", "source": 0 }, + { "begin": 60, "end": 77, "name": "RETURN", "source": 0 }, + { + "begin": 87, + "end": 241, + "name": "tag", + "source": 0, + "value": "4" + }, + { "begin": 87, "end": 241, "name": "JUMPDEST", "source": 0 }, + { + "begin": 87, + "end": 241, + "name": "PUSH [tag]", + "source": 0, + "value": "9" + }, + { + "begin": 87, + "end": 241, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 87, "end": 241, "name": "DUP1", "source": 0 }, + { "begin": 87, "end": 241, "name": "CALLDATASIZE", "source": 0 }, + { "begin": 87, "end": 241, "name": "SUB", "source": 0 }, + { "begin": 87, "end": 241, "name": "DUP2", "source": 0 }, + { "begin": 87, "end": 241, "name": "ADD", "source": 0 }, + { "begin": 87, "end": 241, "name": "SWAP1", "source": 0 }, + { + "begin": 87, + "end": 241, + "name": "PUSH [tag]", + "source": 0, + "value": "10" + }, + { "begin": 87, "end": 241, "name": "SWAP2", "source": 0 }, + { "begin": 87, "end": 241, "name": "SWAP1", "source": 0 }, + { + "begin": 87, + "end": 241, + "name": "PUSH [tag]", + "source": 0, + "value": "11" + }, + { + "begin": 87, + "end": 241, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 87, + "end": 241, + "name": "tag", + "source": 0, + "value": "10" + }, + { "begin": 87, "end": 241, "name": "JUMPDEST", "source": 0 }, + { + "begin": 87, + "end": 241, + "name": "PUSH [tag]", + "source": 0, + "value": "12" + }, + { + "begin": 87, + "end": 241, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 87, + "end": 241, + "name": "tag", + "source": 0, + "value": "9" + }, + { "begin": 87, "end": 241, "name": "JUMPDEST", "source": 0 }, + { + "begin": 87, + "end": 241, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 87, "end": 241, "name": "MLOAD", "source": 0 }, + { + "begin": 87, + "end": 241, + "name": "PUSH [tag]", + "source": 0, + "value": "13" + }, + { "begin": 87, "end": 241, "name": "SWAP2", "source": 0 }, + { "begin": 87, "end": 241, "name": "SWAP1", "source": 0 }, + { + "begin": 87, + "end": 241, + "name": "PUSH [tag]", + "source": 0, + "value": "8" + }, + { + "begin": 87, + "end": 241, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 87, + "end": 241, + "name": "tag", + "source": 0, + "value": "13" + }, + { "begin": 87, "end": 241, "name": "JUMPDEST", "source": 0 }, + { + "begin": 87, + "end": 241, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 87, "end": 241, "name": "MLOAD", "source": 0 }, + { "begin": 87, "end": 241, "name": "DUP1", "source": 0 }, + { "begin": 87, "end": 241, "name": "SWAP2", "source": 0 }, + { "begin": 87, "end": 241, "name": "SUB", "source": 0 }, + { "begin": 87, "end": 241, "name": "SWAP1", "source": 0 }, + { "begin": 87, "end": 241, "name": "RETURN", "source": 0 }, + { + "begin": 60, + "end": 77, + "name": "tag", + "source": 0, + "value": "6" + }, + { "begin": 60, "end": 77, "name": "JUMPDEST", "source": 0 }, + { + "begin": 60, + "end": 77, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 60, "end": 77, "name": "SLOAD", "source": 0 }, + { "begin": 60, "end": 77, "name": "DUP2", "source": 0 }, + { + "begin": 60, + "end": 77, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { + "begin": 87, + "end": 241, + "name": "tag", + "source": 0, + "value": "12" + }, + { "begin": 87, "end": 241, "name": "JUMPDEST", "source": 0 }, + { + "begin": 134, + "end": 145, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 161, "end": 167, "name": "DUP1", "source": 0 }, + { + "begin": 170, + "end": 171, + "name": "PUSH", + "source": 0, + "value": "7" + }, + { "begin": 161, "end": 171, "name": "SWAP1", "source": 0 }, + { "begin": 161, "end": 171, "name": "POP", "source": 0 }, + { "begin": 193, "end": 199, "name": "DUP3", "source": 0 }, + { + "begin": 185, + "end": 190, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 185, "end": 199, "name": "DUP2", "source": 0 }, + { "begin": 185, "end": 199, "name": "SWAP1", "source": 0 }, + { "begin": 185, "end": 199, "name": "SSTORE", "source": 0 }, + { "begin": 185, "end": 199, "name": "POP", "source": 0 }, + { "begin": 229, "end": 230, "name": "DUP1", "source": 0 }, + { "begin": 220, "end": 226, "name": "DUP4", "source": 0 }, + { + "begin": 220, + "end": 230, + "name": "PUSH [tag]", + "source": 0, + "value": "15" + }, + { "begin": 220, "end": 230, "name": "SWAP2", "source": 0 }, + { "begin": 220, "end": 230, "name": "SWAP1", "source": 0 }, + { + "begin": 220, + "end": 230, + "name": "PUSH [tag]", + "source": 0, + "value": "16" + }, + { + "begin": 220, + "end": 230, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 220, + "end": 230, + "name": "tag", + "source": 0, + "value": "15" + }, + { "begin": 220, "end": 230, "name": "JUMPDEST", "source": 0 }, + { "begin": 213, "end": 230, "name": "SWAP2", "source": 0 }, + { "begin": 213, "end": 230, "name": "POP", "source": 0 }, + { "begin": 213, "end": 230, "name": "POP", "source": 0 }, + { "begin": 87, "end": 241, "name": "SWAP2", "source": 0 }, + { "begin": 87, "end": 241, "name": "SWAP1", "source": 0 }, + { "begin": 87, "end": 241, "name": "POP", "source": 0 }, + { + "begin": 87, + "end": 241, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { + "begin": 7, + "end": 146, + "name": "tag", + "source": 1, + "value": "18" + }, + { "begin": 7, "end": 146, "name": "JUMPDEST", "source": 1 }, + { + "begin": 7, + "end": 146, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 91, "end": 97, "name": "DUP2", "source": 1 }, + { "begin": 78, "end": 98, "name": "CALLDATALOAD", "source": 1 }, + { "begin": 69, "end": 98, "name": "SWAP1", "source": 1 }, + { "begin": 69, "end": 98, "name": "POP", "source": 1 }, + { + "begin": 107, + "end": 140, + "name": "PUSH [tag]", + "source": 1, + "value": "20" + }, + { "begin": 134, "end": 139, "name": "DUP2", "source": 1 }, + { + "begin": 107, + "end": 140, + "name": "PUSH [tag]", + "source": 1, + "value": "21" + }, + { + "begin": 107, + "end": 140, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 107, + "end": 140, + "name": "tag", + "source": 1, + "value": "20" + }, + { "begin": 107, "end": 140, "name": "JUMPDEST", "source": 1 }, + { "begin": 59, "end": 146, "name": "SWAP3", "source": 1 }, + { "begin": 59, "end": 146, "name": "SWAP2", "source": 1 }, + { "begin": 59, "end": 146, "name": "POP", "source": 1 }, + { "begin": 59, "end": 146, "name": "POP", "source": 1 }, + { + "begin": 59, + "end": 146, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 152, + "end": 414, + "name": "tag", + "source": 1, + "value": "11" + }, + { "begin": 152, "end": 414, "name": "JUMPDEST", "source": 1 }, + { + "begin": 152, + "end": 414, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 260, + "end": 262, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 248, "end": 257, "name": "DUP3", "source": 1 }, + { "begin": 239, "end": 246, "name": "DUP5", "source": 1 }, + { "begin": 235, "end": 258, "name": "SUB", "source": 1 }, + { "begin": 231, "end": 263, "name": "SLT", "source": 1 }, + { "begin": 228, "end": 230, "name": "ISZERO", "source": 1 }, + { + "begin": 228, + "end": 230, + "name": "PUSH [tag]", + "source": 1, + "value": "23" + }, + { "begin": 228, "end": 230, "name": "JUMPI", "source": 1 }, + { + "begin": 276, + "end": 277, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 273, "end": 274, "name": "DUP1", "source": 1 }, + { "begin": 266, "end": 278, "name": "REVERT", "source": 1 }, + { + "begin": 228, + "end": 230, + "name": "tag", + "source": 1, + "value": "23" + }, + { "begin": 228, "end": 230, "name": "JUMPDEST", "source": 1 }, + { + "begin": 319, + "end": 320, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 344, + "end": 397, + "name": "PUSH [tag]", + "source": 1, + "value": "24" + }, + { "begin": 389, "end": 396, "name": "DUP5", "source": 1 }, + { "begin": 380, "end": 386, "name": "DUP3", "source": 1 }, + { "begin": 369, "end": 378, "name": "DUP6", "source": 1 }, + { "begin": 365, "end": 387, "name": "ADD", "source": 1 }, + { + "begin": 344, + "end": 397, + "name": "PUSH [tag]", + "source": 1, + "value": "18" + }, + { + "begin": 344, + "end": 397, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 344, + "end": 397, + "name": "tag", + "source": 1, + "value": "24" + }, + { "begin": 344, "end": 397, "name": "JUMPDEST", "source": 1 }, + { "begin": 334, "end": 397, "name": "SWAP2", "source": 1 }, + { "begin": 334, "end": 397, "name": "POP", "source": 1 }, + { "begin": 290, "end": 407, "name": "POP", "source": 1 }, + { "begin": 218, "end": 414, "name": "SWAP3", "source": 1 }, + { "begin": 218, "end": 414, "name": "SWAP2", "source": 1 }, + { "begin": 218, "end": 414, "name": "POP", "source": 1 }, + { "begin": 218, "end": 414, "name": "POP", "source": 1 }, + { + "begin": 218, + "end": 414, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 420, + "end": 538, + "name": "tag", + "source": 1, + "value": "25" + }, + { "begin": 420, "end": 538, "name": "JUMPDEST", "source": 1 }, + { + "begin": 507, + "end": 531, + "name": "PUSH [tag]", + "source": 1, + "value": "27" + }, + { "begin": 525, "end": 530, "name": "DUP2", "source": 1 }, + { + "begin": 507, + "end": 531, + "name": "PUSH [tag]", + "source": 1, + "value": "28" + }, + { + "begin": 507, + "end": 531, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 507, + "end": 531, + "name": "tag", + "source": 1, + "value": "27" + }, + { "begin": 507, "end": 531, "name": "JUMPDEST", "source": 1 }, + { "begin": 502, "end": 505, "name": "DUP3", "source": 1 }, + { "begin": 495, "end": 532, "name": "MSTORE", "source": 1 }, + { "begin": 485, "end": 538, "name": "POP", "source": 1 }, + { "begin": 485, "end": 538, "name": "POP", "source": 1 }, + { + "begin": 485, + "end": 538, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 544, + "end": 766, + "name": "tag", + "source": 1, + "value": "8" + }, + { "begin": 544, "end": 766, "name": "JUMPDEST", "source": 1 }, + { + "begin": 544, + "end": 766, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 675, + "end": 677, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 664, "end": 673, "name": "DUP3", "source": 1 }, + { "begin": 660, "end": 678, "name": "ADD", "source": 1 }, + { "begin": 652, "end": 678, "name": "SWAP1", "source": 1 }, + { "begin": 652, "end": 678, "name": "POP", "source": 1 }, + { + "begin": 688, + "end": 759, + "name": "PUSH [tag]", + "source": 1, + "value": "30" + }, + { + "begin": 756, + "end": 757, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 745, "end": 754, "name": "DUP4", "source": 1 }, + { "begin": 741, "end": 758, "name": "ADD", "source": 1 }, + { "begin": 732, "end": 738, "name": "DUP5", "source": 1 }, + { + "begin": 688, + "end": 759, + "name": "PUSH [tag]", + "source": 1, + "value": "25" + }, + { + "begin": 688, + "end": 759, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 688, + "end": 759, + "name": "tag", + "source": 1, + "value": "30" + }, + { "begin": 688, "end": 759, "name": "JUMPDEST", "source": 1 }, + { "begin": 642, "end": 766, "name": "SWAP3", "source": 1 }, + { "begin": 642, "end": 766, "name": "SWAP2", "source": 1 }, + { "begin": 642, "end": 766, "name": "POP", "source": 1 }, + { "begin": 642, "end": 766, "name": "POP", "source": 1 }, + { + "begin": 642, + "end": 766, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 772, + "end": 1077, + "name": "tag", + "source": 1, + "value": "16" + }, + { "begin": 772, "end": 1077, "name": "JUMPDEST", "source": 1 }, + { + "begin": 772, + "end": 1077, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 831, + "end": 851, + "name": "PUSH [tag]", + "source": 1, + "value": "32" + }, + { "begin": 849, "end": 850, "name": "DUP3", "source": 1 }, + { + "begin": 831, + "end": 851, + "name": "PUSH [tag]", + "source": 1, + "value": "28" + }, + { + "begin": 831, + "end": 851, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 831, + "end": 851, + "name": "tag", + "source": 1, + "value": "32" + }, + { "begin": 831, "end": 851, "name": "JUMPDEST", "source": 1 }, + { "begin": 826, "end": 851, "name": "SWAP2", "source": 1 }, + { "begin": 826, "end": 851, "name": "POP", "source": 1 }, + { + "begin": 865, + "end": 885, + "name": "PUSH [tag]", + "source": 1, + "value": "33" + }, + { "begin": 883, "end": 884, "name": "DUP4", "source": 1 }, + { + "begin": 865, + "end": 885, + "name": "PUSH [tag]", + "source": 1, + "value": "28" + }, + { + "begin": 865, + "end": 885, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 865, + "end": 885, + "name": "tag", + "source": 1, + "value": "33" + }, + { "begin": 865, "end": 885, "name": "JUMPDEST", "source": 1 }, + { "begin": 860, "end": 885, "name": "SWAP3", "source": 1 }, + { "begin": 860, "end": 885, "name": "POP", "source": 1 }, + { "begin": 1019, "end": 1020, "name": "DUP3", "source": 1 }, + { + "begin": 951, + "end": 1017, + "name": "PUSH", + "source": 1, + "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + }, + { "begin": 947, "end": 1021, "name": "SUB", "source": 1 }, + { "begin": 944, "end": 945, "name": "DUP3", "source": 1 }, + { "begin": 941, "end": 1022, "name": "GT", "source": 1 }, + { "begin": 938, "end": 940, "name": "ISZERO", "source": 1 }, + { + "begin": 938, + "end": 940, + "name": "PUSH [tag]", + "source": 1, + "value": "34" + }, + { "begin": 938, "end": 940, "name": "JUMPI", "source": 1 }, + { + "begin": 1025, + "end": 1043, + "name": "PUSH [tag]", + "source": 1, + "value": "35" + }, + { + "begin": 1025, + "end": 1043, + "name": "PUSH [tag]", + "source": 1, + "value": "36" + }, + { + "begin": 1025, + "end": 1043, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1025, + "end": 1043, + "name": "tag", + "source": 1, + "value": "35" + }, + { "begin": 1025, "end": 1043, "name": "JUMPDEST", "source": 1 }, + { + "begin": 938, + "end": 940, + "name": "tag", + "source": 1, + "value": "34" + }, + { "begin": 938, "end": 940, "name": "JUMPDEST", "source": 1 }, + { "begin": 1069, "end": 1070, "name": "DUP3", "source": 1 }, + { "begin": 1066, "end": 1067, "name": "DUP3", "source": 1 }, + { "begin": 1062, "end": 1071, "name": "ADD", "source": 1 }, + { "begin": 1055, "end": 1071, "name": "SWAP1", "source": 1 }, + { "begin": 1055, "end": 1071, "name": "POP", "source": 1 }, + { "begin": 816, "end": 1077, "name": "SWAP3", "source": 1 }, + { "begin": 816, "end": 1077, "name": "SWAP2", "source": 1 }, + { "begin": 816, "end": 1077, "name": "POP", "source": 1 }, + { "begin": 816, "end": 1077, "name": "POP", "source": 1 }, + { + "begin": 816, + "end": 1077, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1083, + "end": 1160, + "name": "tag", + "source": 1, + "value": "28" + }, + { "begin": 1083, "end": 1160, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1083, + "end": 1160, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1149, "end": 1154, "name": "DUP2", "source": 1 }, + { "begin": 1138, "end": 1154, "name": "SWAP1", "source": 1 }, + { "begin": 1138, "end": 1154, "name": "POP", "source": 1 }, + { "begin": 1128, "end": 1160, "name": "SWAP2", "source": 1 }, + { "begin": 1128, "end": 1160, "name": "SWAP1", "source": 1 }, + { "begin": 1128, "end": 1160, "name": "POP", "source": 1 }, + { + "begin": 1128, + "end": 1160, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1166, + "end": 1346, + "name": "tag", + "source": 1, + "value": "36" + }, + { "begin": 1166, "end": 1346, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1214, + "end": 1291, + "name": "PUSH", + "source": 1, + "value": "4E487B7100000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 1211, + "end": 1212, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1204, "end": 1292, "name": "MSTORE", "source": 1 }, + { + "begin": 1311, + "end": 1315, + "name": "PUSH", + "source": 1, + "value": "11" + }, + { + "begin": 1308, + "end": 1309, + "name": "PUSH", + "source": 1, + "value": "4" + }, + { "begin": 1301, "end": 1316, "name": "MSTORE", "source": 1 }, + { + "begin": 1335, + "end": 1339, + "name": "PUSH", + "source": 1, + "value": "24" + }, + { + "begin": 1332, + "end": 1333, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1325, "end": 1340, "name": "REVERT", "source": 1 }, + { + "begin": 1352, + "end": 1474, + "name": "tag", + "source": 1, + "value": "21" + }, + { "begin": 1352, "end": 1474, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1425, + "end": 1449, + "name": "PUSH [tag]", + "source": 1, + "value": "40" + }, + { "begin": 1443, "end": 1448, "name": "DUP2", "source": 1 }, + { + "begin": 1425, + "end": 1449, + "name": "PUSH [tag]", + "source": 1, + "value": "28" + }, + { + "begin": 1425, + "end": 1449, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1425, + "end": 1449, + "name": "tag", + "source": 1, + "value": "40" + }, + { "begin": 1425, "end": 1449, "name": "JUMPDEST", "source": 1 }, + { "begin": 1418, "end": 1423, "name": "DUP2", "source": 1 }, + { "begin": 1415, "end": 1450, "name": "EQ", "source": 1 }, + { + "begin": 1405, + "end": 1407, + "name": "PUSH [tag]", + "source": 1, + "value": "41" + }, + { "begin": 1405, "end": 1407, "name": "JUMPI", "source": 1 }, + { + "begin": 1464, + "end": 1465, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1461, "end": 1462, "name": "DUP1", "source": 1 }, + { "begin": 1454, "end": 1466, "name": "REVERT", "source": 1 }, + { + "begin": 1405, + "end": 1407, + "name": "tag", + "source": 1, + "value": "41" + }, + { "begin": 1405, "end": 1407, "name": "JUMPDEST", "source": 1 }, + { "begin": 1395, "end": 1474, "name": "POP", "source": 1 }, + { + "begin": 1395, + "end": 1474, + "name": "JUMP", + "source": 1, + "value": "[out]" + } + ] + } + } + }, + "methodIdentifiers": { + "addtwo(uint256)": "fd63983b", + "store()": "975057e7" + } + }, + "ewasm": { "wasm": "" }, + "metadata": "{\"compiler\":{\"version\":\"0.8.3+commit.8d00100c\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"addtwo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"result\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"store\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"main.sol\":\"Callee\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"main.sol\":{\"keccak256\":\"0x597ee1f5715720411519610d7b9fdeaf3d234f6c8fd6ade675f7c33cbc916028\",\"urls\":[\"bzz-raw://0ea407e22255a20ce7b5c1b7f1f0d74ae931b36cf3f895fdeabd4ceca17ef58b\",\"dweb:/ipfs/QmXdP96RQak3qWZLFhfgutBhSWF8FKjNAWaHeCrZVeqYa4\"]}},\"version\":1}", + "storageLayout": { + "storage": [ + { + "astId": 3, + "contract": "main.sol:Callee", + "label": "store", + "offset": 0, + "slot": "0", + "type": "t_uint256" + } + ], + "types": { + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + }, + "userdoc": { "kind": "user", "methods": {}, "version": 1 } + }, + "sourceCode": "\n pragma solidity >=0.8.0;\n contract Callee {\n uint public store;\n function addtwo(uint _value) external returns (uint result) {\n uint x = 7;\n store = _value;\n return _value + x;\n }\n }" +} diff --git a/tests/contracts/compiled/Caller.json b/tests/contracts/compiled/Caller.json new file mode 100644 index 00000000000..69da4c19703 --- /dev/null +++ b/tests/contracts/compiled/Caller.json @@ -0,0 +1,2943 @@ +{ + "byteCode": "0x608060405234801561001057600080fd5b506102de806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063398f72231461003b578063975057e714610057575b600080fd5b610055600480360381019061005091906101af565b610075565b005b61005f61016a565b60405161006c9190610223565b60405180910390f35b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fd63983b826040518263ffffffff1660e01b815260040161010e9190610223565b602060405180830381600087803b15801561012857600080fd5b505af115801561013c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061016091906101eb565b6001819055505050565b60015481565b60008135905061017f8161027a565b92915050565b60008135905061019481610291565b92915050565b6000815190506101a981610291565b92915050565b600080604083850312156101c257600080fd5b60006101d085828601610170565b92505060206101e185828601610185565b9150509250929050565b6000602082840312156101fd57600080fd5b600061020b8482850161019a565b91505092915050565b61021d81610270565b82525050565b60006020820190506102386000830184610214565b92915050565b600061024982610250565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6102838161023e565b811461028e57600080fd5b50565b61029a81610270565b81146102a557600080fd5b5056fea26469706673582212208b44616dfaba36ab3ed3c66e08e62b41b20549fa87e881fd77e006374d11f86b64736f6c63430008030033", + "contract": { + "abi": [ + { + "inputs": [ + { "internalType": "address", "name": "_addr", "type": "address" }, + { "internalType": "uint256", "name": "_number", "type": "uint256" } + ], + "name": "someAction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "store", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + } + ], + "devdoc": { "kind": "dev", "methods": {}, "version": 1 }, + "evm": { + "assembly": " /* \"main.sol\":136:374 contract Caller {... */\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 /* \"main.sol\":136:374 contract Caller {... */\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 0x398f7223\n eq\n tag_3\n jumpi\n dup1\n 0x975057e7\n eq\n tag_4\n jumpi\n tag_2:\n 0x00\n dup1\n revert\n /* \"main.sol\":221:368 function someAction(address _addr, uint _number) 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 /* \"main.sol\":194:211 uint public store */\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 /* \"main.sol\":221:368 function someAction(address _addr, uint _number) public {... */\n tag_8:\n /* \"main.sol\":307:312 _addr */\n dup2\n /* \"main.sol\":291:297 callee */\n 0x00\n dup1\n /* \"main.sol\":291:313 callee = Callee(_addr) */\n 0x0100\n exp\n dup2\n sload\n dup2\n 0xffffffffffffffffffffffffffffffffffffffff\n mul\n not\n and\n swap1\n dup4\n 0xffffffffffffffffffffffffffffffffffffffff\n and\n mul\n or\n swap1\n sstore\n pop\n /* \"main.sol\":335:341 callee */\n 0x00\n dup1\n sload\n swap1\n 0x0100\n exp\n swap1\n div\n 0xffffffffffffffffffffffffffffffffffffffff\n and\n /* \"main.sol\":335:348 callee.addtwo */\n 0xffffffffffffffffffffffffffffffffffffffff\n and\n 0xfd63983b\n /* \"main.sol\":349:356 _number */\n dup3\n /* \"main.sol\":335:357 callee.addtwo(_number) */\n mload(0x40)\n dup3\n 0xffffffff\n and\n 0xe0\n shl\n dup2\n mstore\n 0x04\n add\n tag_14\n swap2\n swap1\n tag_12\n jump\t// in\n tag_14:\n 0x20\n mload(0x40)\n dup1\n dup4\n sub\n dup2\n 0x00\n dup8\n dup1\n extcodesize\n iszero\n dup1\n iszero\n tag_15\n jumpi\n 0x00\n dup1\n revert\n tag_15:\n pop\n gas\n call\n iszero\n dup1\n iszero\n tag_17\n jumpi\n returndatasize\n 0x00\n dup1\n returndatacopy\n revert(0x00, returndatasize)\n tag_17:\n pop\n pop\n pop\n pop\n mload(0x40)\n returndatasize\n not(0x1f)\n 0x1f\n dup3\n add\n and\n dup3\n add\n dup1\n 0x40\n mstore\n pop\n dup2\n add\n swap1\n tag_18\n swap2\n swap1\n tag_19\n jump\t// in\n tag_18:\n /* \"main.sol\":327:332 store */\n 0x01\n /* \"main.sol\":327:357 store = callee.addtwo(_number) */\n dup2\n swap1\n sstore\n pop\n /* \"main.sol\":221:368 function someAction(address _addr, uint _number) public {... */\n pop\n pop\n jump\t// out\n /* \"main.sol\":194:211 uint public store */\n tag_10:\n sload(0x01)\n dup2\n jump\t// out\n /* \"#utility.yul\":7:146 */\n tag_21:\n 0x00\n /* \"#utility.yul\":91:97 */\n dup2\n /* \"#utility.yul\":78:98 */\n calldataload\n /* \"#utility.yul\":69:98 */\n swap1\n pop\n /* \"#utility.yul\":107:140 */\n tag_23\n /* \"#utility.yul\":134:139 */\n dup2\n /* \"#utility.yul\":107:140 */\n tag_24\n jump\t// in\n tag_23:\n /* \"#utility.yul\":59:146 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":152:291 */\n tag_25:\n 0x00\n /* \"#utility.yul\":236:242 */\n dup2\n /* \"#utility.yul\":223:243 */\n calldataload\n /* \"#utility.yul\":214:243 */\n swap1\n pop\n /* \"#utility.yul\":252:285 */\n tag_27\n /* \"#utility.yul\":279:284 */\n dup2\n /* \"#utility.yul\":252:285 */\n tag_28\n jump\t// in\n tag_27:\n /* \"#utility.yul\":204:291 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":297:440 */\n tag_29:\n 0x00\n /* \"#utility.yul\":385:391 */\n dup2\n /* \"#utility.yul\":379:392 */\n mload\n /* \"#utility.yul\":370:392 */\n swap1\n pop\n /* \"#utility.yul\":401:434 */\n tag_31\n /* \"#utility.yul\":428:433 */\n dup2\n /* \"#utility.yul\":401:434 */\n tag_28\n jump\t// in\n tag_31:\n /* \"#utility.yul\":360:440 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":446:853 */\n tag_7:\n 0x00\n dup1\n /* \"#utility.yul\":571:573 */\n 0x40\n /* \"#utility.yul\":559:568 */\n dup4\n /* \"#utility.yul\":550:557 */\n dup6\n /* \"#utility.yul\":546:569 */\n sub\n /* \"#utility.yul\":542:574 */\n slt\n /* \"#utility.yul\":539:541 */\n iszero\n tag_33\n jumpi\n /* \"#utility.yul\":587:588 */\n 0x00\n /* \"#utility.yul\":584:585 */\n dup1\n /* \"#utility.yul\":577:589 */\n revert\n /* \"#utility.yul\":539:541 */\n tag_33:\n /* \"#utility.yul\":630:631 */\n 0x00\n /* \"#utility.yul\":655:708 */\n tag_34\n /* \"#utility.yul\":700:707 */\n dup6\n /* \"#utility.yul\":691:697 */\n dup3\n /* \"#utility.yul\":680:689 */\n dup7\n /* \"#utility.yul\":676:698 */\n add\n /* \"#utility.yul\":655:708 */\n tag_21\n jump\t// in\n tag_34:\n /* \"#utility.yul\":645:708 */\n swap3\n pop\n /* \"#utility.yul\":601:718 */\n pop\n /* \"#utility.yul\":757:759 */\n 0x20\n /* \"#utility.yul\":783:836 */\n tag_35\n /* \"#utility.yul\":828:835 */\n dup6\n /* \"#utility.yul\":819:825 */\n dup3\n /* \"#utility.yul\":808:817 */\n dup7\n /* \"#utility.yul\":804:826 */\n add\n /* \"#utility.yul\":783:836 */\n tag_25\n jump\t// in\n tag_35:\n /* \"#utility.yul\":773:836 */\n swap2\n pop\n /* \"#utility.yul\":728:846 */\n pop\n /* \"#utility.yul\":529:853 */\n swap3\n pop\n swap3\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":859:1143 */\n tag_19:\n 0x00\n /* \"#utility.yul\":978:980 */\n 0x20\n /* \"#utility.yul\":966:975 */\n dup3\n /* \"#utility.yul\":957:964 */\n dup5\n /* \"#utility.yul\":953:976 */\n sub\n /* \"#utility.yul\":949:981 */\n slt\n /* \"#utility.yul\":946:948 */\n iszero\n tag_37\n jumpi\n /* \"#utility.yul\":994:995 */\n 0x00\n /* \"#utility.yul\":991:992 */\n dup1\n /* \"#utility.yul\":984:996 */\n revert\n /* \"#utility.yul\":946:948 */\n tag_37:\n /* \"#utility.yul\":1037:1038 */\n 0x00\n /* \"#utility.yul\":1062:1126 */\n tag_38\n /* \"#utility.yul\":1118:1125 */\n dup5\n /* \"#utility.yul\":1109:1115 */\n dup3\n /* \"#utility.yul\":1098:1107 */\n dup6\n /* \"#utility.yul\":1094:1116 */\n add\n /* \"#utility.yul\":1062:1126 */\n tag_29\n jump\t// in\n tag_38:\n /* \"#utility.yul\":1052:1126 */\n swap2\n pop\n /* \"#utility.yul\":1008:1136 */\n pop\n /* \"#utility.yul\":936:1143 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":1149:1267 */\n tag_39:\n /* \"#utility.yul\":1236:1260 */\n tag_41\n /* \"#utility.yul\":1254:1259 */\n dup2\n /* \"#utility.yul\":1236:1260 */\n tag_42\n jump\t// in\n tag_41:\n /* \"#utility.yul\":1231:1234 */\n dup3\n /* \"#utility.yul\":1224:1261 */\n mstore\n /* \"#utility.yul\":1214:1267 */\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":1273:1495 */\n tag_12:\n 0x00\n /* \"#utility.yul\":1404:1406 */\n 0x20\n /* \"#utility.yul\":1393:1402 */\n dup3\n /* \"#utility.yul\":1389:1407 */\n add\n /* \"#utility.yul\":1381:1407 */\n swap1\n pop\n /* \"#utility.yul\":1417:1488 */\n tag_44\n /* \"#utility.yul\":1485:1486 */\n 0x00\n /* \"#utility.yul\":1474:1483 */\n dup4\n /* \"#utility.yul\":1470:1487 */\n add\n /* \"#utility.yul\":1461:1467 */\n dup5\n /* \"#utility.yul\":1417:1488 */\n tag_39\n jump\t// in\n tag_44:\n /* \"#utility.yul\":1371:1495 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":1501:1597 */\n tag_45:\n 0x00\n /* \"#utility.yul\":1567:1591 */\n tag_47\n /* \"#utility.yul\":1585:1590 */\n dup3\n /* \"#utility.yul\":1567:1591 */\n tag_48\n jump\t// in\n tag_47:\n /* \"#utility.yul\":1556:1591 */\n swap1\n pop\n /* \"#utility.yul\":1546:1597 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":1603:1729 */\n tag_48:\n 0x00\n /* \"#utility.yul\":1680:1722 */\n 0xffffffffffffffffffffffffffffffffffffffff\n /* \"#utility.yul\":1673:1678 */\n dup3\n /* \"#utility.yul\":1669:1723 */\n and\n /* \"#utility.yul\":1658:1723 */\n swap1\n pop\n /* \"#utility.yul\":1648:1729 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":1735:1812 */\n tag_42:\n 0x00\n /* \"#utility.yul\":1801:1806 */\n dup2\n /* \"#utility.yul\":1790:1806 */\n swap1\n pop\n /* \"#utility.yul\":1780:1812 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":1818:1940 */\n tag_24:\n /* \"#utility.yul\":1891:1915 */\n tag_52\n /* \"#utility.yul\":1909:1914 */\n dup2\n /* \"#utility.yul\":1891:1915 */\n tag_45\n jump\t// in\n tag_52:\n /* \"#utility.yul\":1884:1889 */\n dup2\n /* \"#utility.yul\":1881:1916 */\n eq\n /* \"#utility.yul\":1871:1873 */\n tag_53\n jumpi\n /* \"#utility.yul\":1930:1931 */\n 0x00\n /* \"#utility.yul\":1927:1928 */\n dup1\n /* \"#utility.yul\":1920:1932 */\n revert\n /* \"#utility.yul\":1871:1873 */\n tag_53:\n /* \"#utility.yul\":1861:1940 */\n pop\n jump\t// out\n /* \"#utility.yul\":1946:2068 */\n tag_28:\n /* \"#utility.yul\":2019:2043 */\n tag_55\n /* \"#utility.yul\":2037:2042 */\n dup2\n /* \"#utility.yul\":2019:2043 */\n tag_42\n jump\t// in\n tag_55:\n /* \"#utility.yul\":2012:2017 */\n dup2\n /* \"#utility.yul\":2009:2044 */\n eq\n /* \"#utility.yul\":1999:2001 */\n tag_56\n jumpi\n /* \"#utility.yul\":2058:2059 */\n 0x00\n /* \"#utility.yul\":2055:2056 */\n dup1\n /* \"#utility.yul\":2048:2060 */\n revert\n /* \"#utility.yul\":1999:2001 */\n tag_56:\n /* \"#utility.yul\":1989:2068 */\n pop\n jump\t// out\n\n auxdata: 0xa26469706673582212208b44616dfaba36ab3ed3c66e08e62b41b20549fa87e881fd77e006374d11f86b64736f6c63430008030033\n}\n", + "bytecode": { + "generatedSources": [], + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b506102de806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063398f72231461003b578063975057e714610057575b600080fd5b610055600480360381019061005091906101af565b610075565b005b61005f61016a565b60405161006c9190610223565b60405180910390f35b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fd63983b826040518263ffffffff1660e01b815260040161010e9190610223565b602060405180830381600087803b15801561012857600080fd5b505af115801561013c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061016091906101eb565b6001819055505050565b60015481565b60008135905061017f8161027a565b92915050565b60008135905061019481610291565b92915050565b6000815190506101a981610291565b92915050565b600080604083850312156101c257600080fd5b60006101d085828601610170565b92505060206101e185828601610185565b9150509250929050565b6000602082840312156101fd57600080fd5b600061020b8482850161019a565b91505092915050565b61021d81610270565b82525050565b60006020820190506102386000830184610214565b92915050565b600061024982610250565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6102838161023e565b811461028e57600080fd5b50565b61029a81610270565b81146102a557600080fd5b5056fea26469706673582212208b44616dfaba36ab3ed3c66e08e62b41b20549fa87e881fd77e006374d11f86b64736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2DE 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 0x398F7223 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x975057E7 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 0x1AF JUMP JUMPDEST PUSH2 0x75 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x5F PUSH2 0x16A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x6C SWAP2 SWAP1 PUSH2 0x223 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST DUP2 PUSH1 0x0 DUP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xFD63983B DUP3 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x10E SWAP2 SWAP1 PUSH2 0x223 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x128 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x13C JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x160 SWAP2 SWAP1 PUSH2 0x1EB JUMP JUMPDEST PUSH1 0x1 DUP2 SWAP1 SSTORE POP POP POP JUMP JUMPDEST PUSH1 0x1 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x17F DUP2 PUSH2 0x27A JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x194 DUP2 PUSH2 0x291 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP PUSH2 0x1A9 DUP2 PUSH2 0x291 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x1C2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1D0 DUP6 DUP3 DUP7 ADD PUSH2 0x170 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x1E1 DUP6 DUP3 DUP7 ADD PUSH2 0x185 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1FD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x20B DUP5 DUP3 DUP6 ADD PUSH2 0x19A JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x21D DUP2 PUSH2 0x270 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x238 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x214 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x249 DUP3 PUSH2 0x250 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x283 DUP2 PUSH2 0x23E JUMP JUMPDEST DUP2 EQ PUSH2 0x28E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH2 0x29A DUP2 PUSH2 0x270 JUMP JUMPDEST DUP2 EQ PUSH2 0x2A5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 DUP12 DIFFICULTY PUSH2 0x6DFA 0xBA CALLDATASIZE 0xAB RETURNDATACOPY 0xD3 0xC6 PUSH15 0x8E62B41B20549FA87E881FD77E006 CALLDATACOPY 0x4D GT 0xF8 PUSH12 0x64736F6C6343000803003300 ", + "sourceMap": "136:238:0:-:0;;;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "generatedSources": [ + { + "ast": { + "nodeType": "YulBlock", + "src": "0:2071:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "59:87:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "69:29:1", + "value": { + "arguments": [ + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "91:6:1" + } + ], + "functionName": { + "name": "calldataload", + "nodeType": "YulIdentifier", + "src": "78:12:1" + }, + "nodeType": "YulFunctionCall", + "src": "78:20:1" + }, + "variableNames": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "69:5:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "134:5:1" + } + ], + "functionName": { + "name": "validator_revert_t_address", + "nodeType": "YulIdentifier", + "src": "107:26:1" + }, + "nodeType": "YulFunctionCall", + "src": "107:33:1" + }, + "nodeType": "YulExpressionStatement", + "src": "107:33:1" + } + ] + }, + "name": "abi_decode_t_address", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "37:6:1", + "type": "" + }, + { + "name": "end", + "nodeType": "YulTypedName", + "src": "45:3:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "53:5:1", + "type": "" + } + ], + "src": "7:139:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "204:87:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "214:29:1", + "value": { + "arguments": [ + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "236:6:1" + } + ], + "functionName": { + "name": "calldataload", + "nodeType": "YulIdentifier", + "src": "223:12:1" + }, + "nodeType": "YulFunctionCall", + "src": "223:20:1" + }, + "variableNames": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "214:5:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "279:5:1" + } + ], + "functionName": { + "name": "validator_revert_t_uint256", + "nodeType": "YulIdentifier", + "src": "252:26:1" + }, + "nodeType": "YulFunctionCall", + "src": "252:33:1" + }, + "nodeType": "YulExpressionStatement", + "src": "252:33:1" + } + ] + }, + "name": "abi_decode_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "182:6:1", + "type": "" + }, + { + "name": "end", + "nodeType": "YulTypedName", + "src": "190:3:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "198:5:1", + "type": "" + } + ], + "src": "152:139:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "360:80:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "370:22:1", + "value": { + "arguments": [ + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "385:6:1" + } + ], + "functionName": { + "name": "mload", + "nodeType": "YulIdentifier", + "src": "379:5:1" + }, + "nodeType": "YulFunctionCall", + "src": "379:13:1" + }, + "variableNames": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "370:5:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "428:5:1" + } + ], + "functionName": { + "name": "validator_revert_t_uint256", + "nodeType": "YulIdentifier", + "src": "401:26:1" + }, + "nodeType": "YulFunctionCall", + "src": "401:33:1" + }, + "nodeType": "YulExpressionStatement", + "src": "401:33:1" + } + ] + }, + "name": "abi_decode_t_uint256_fromMemory", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "338:6:1", + "type": "" + }, + { + "name": "end", + "nodeType": "YulTypedName", + "src": "346:3:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "354:5:1", + "type": "" + } + ], + "src": "297:143:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "529:324:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "575:16:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "584:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "587:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "577:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "577:12:1" + }, + "nodeType": "YulExpressionStatement", + "src": "577:12:1" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "550:7:1" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "559:9:1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "546:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "546:23:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "571:2:1", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "542:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "542:32:1" + }, + "nodeType": "YulIf", + "src": "539:2:1" + }, + { + "nodeType": "YulBlock", + "src": "601:117:1", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "616:15:1", + "value": { + "kind": "number", + "nodeType": "YulLiteral", + "src": "630:1:1", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "620:6:1", + "type": "" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "645:63:1", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "680:9:1" + }, + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "691:6:1" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "676:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "676:22:1" + }, + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "700:7:1" + } + ], + "functionName": { + "name": "abi_decode_t_address", + "nodeType": "YulIdentifier", + "src": "655:20:1" + }, + "nodeType": "YulFunctionCall", + "src": "655:53:1" + }, + "variableNames": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "645:6:1" + } + ] + } + ] + }, + { + "nodeType": "YulBlock", + "src": "728:118:1", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "743:16:1", + "value": { + "kind": "number", + "nodeType": "YulLiteral", + "src": "757:2:1", + "type": "", + "value": "32" + }, + "variables": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "747:6:1", + "type": "" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "773:63:1", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "808:9:1" + }, + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "819:6:1" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "804:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "804:22:1" + }, + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "828:7:1" + } + ], + "functionName": { + "name": "abi_decode_t_uint256", + "nodeType": "YulIdentifier", + "src": "783:20:1" + }, + "nodeType": "YulFunctionCall", + "src": "783:53:1" + }, + "variableNames": [ + { + "name": "value1", + "nodeType": "YulIdentifier", + "src": "773:6:1" + } + ] + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_addresst_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "491:9:1", + "type": "" + }, + { + "name": "dataEnd", + "nodeType": "YulTypedName", + "src": "502:7:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "514:6:1", + "type": "" + }, + { + "name": "value1", + "nodeType": "YulTypedName", + "src": "522:6:1", + "type": "" + } + ], + "src": "446:407:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "936:207:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "982:16:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "991:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "994:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "984:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "984:12:1" + }, + "nodeType": "YulExpressionStatement", + "src": "984:12:1" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "957:7:1" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "966:9:1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "953:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "953:23:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "978:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "949:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "949:32:1" + }, + "nodeType": "YulIf", + "src": "946:2:1" + }, + { + "nodeType": "YulBlock", + "src": "1008:128:1", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "1023:15:1", + "value": { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1037:1:1", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "1027:6:1", + "type": "" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "1052:74:1", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "1098:9:1" + }, + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "1109:6:1" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1094:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1094:22:1" + }, + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "1118:7:1" + } + ], + "functionName": { + "name": "abi_decode_t_uint256_fromMemory", + "nodeType": "YulIdentifier", + "src": "1062:31:1" + }, + "nodeType": "YulFunctionCall", + "src": "1062:64:1" + }, + "variableNames": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "1052:6:1" + } + ] + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_uint256_fromMemory", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "906:9:1", + "type": "" + }, + { + "name": "dataEnd", + "nodeType": "YulTypedName", + "src": "917:7:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "929:6:1", + "type": "" + } + ], + "src": "859:284:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1214:53:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "1231:3:1" + }, + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1254:5:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "1236:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "1236:24:1" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "1224:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1224:37:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1224:37:1" + } + ] + }, + "name": "abi_encode_t_uint256_to_t_uint256_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "1202:5:1", + "type": "" + }, + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "1209:3:1", + "type": "" + } + ], + "src": "1149:118:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1371:124:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "1381:26:1", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "1393:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1404:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1389:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1389:18:1" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "1381:4:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "1461:6:1" + }, + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "1474:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1485:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1470:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1470:17:1" + } + ], + "functionName": { + "name": "abi_encode_t_uint256_to_t_uint256_fromStack", + "nodeType": "YulIdentifier", + "src": "1417:43:1" + }, + "nodeType": "YulFunctionCall", + "src": "1417:71:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1417:71:1" + } + ] + }, + "name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "1343:9:1", + "type": "" + }, + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "1355:6:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "1366:4:1", + "type": "" + } + ], + "src": "1273:222:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1546:51:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "1556:35:1", + "value": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1585:5:1" + } + ], + "functionName": { + "name": "cleanup_t_uint160", + "nodeType": "YulIdentifier", + "src": "1567:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "1567:24:1" + }, + "variableNames": [ + { + "name": "cleaned", + "nodeType": "YulIdentifier", + "src": "1556:7:1" + } + ] + } + ] + }, + "name": "cleanup_t_address", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "1528:5:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "cleaned", + "nodeType": "YulTypedName", + "src": "1538:7:1", + "type": "" + } + ], + "src": "1501:96:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1648:81:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "1658:65:1", + "value": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1673:5:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1680:42:1", + "type": "", + "value": "0xffffffffffffffffffffffffffffffffffffffff" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "1669:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1669:54:1" + }, + "variableNames": [ + { + "name": "cleaned", + "nodeType": "YulIdentifier", + "src": "1658:7:1" + } + ] + } + ] + }, + "name": "cleanup_t_uint160", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "1630:5:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "cleaned", + "nodeType": "YulTypedName", + "src": "1640:7:1", + "type": "" + } + ], + "src": "1603:126:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1780:32:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "1790:16:1", + "value": { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1801:5:1" + }, + "variableNames": [ + { + "name": "cleaned", + "nodeType": "YulIdentifier", + "src": "1790:7:1" + } + ] + } + ] + }, + "name": "cleanup_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "1762:5:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "cleaned", + "nodeType": "YulTypedName", + "src": "1772:7:1", + "type": "" + } + ], + "src": "1735:77:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1861:79:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "1918:16:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1927:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1930:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "1920:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1920:12:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1920:12:1" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1884:5:1" + }, + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1909:5:1" + } + ], + "functionName": { + "name": "cleanup_t_address", + "nodeType": "YulIdentifier", + "src": "1891:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "1891:24:1" + } + ], + "functionName": { + "name": "eq", + "nodeType": "YulIdentifier", + "src": "1881:2:1" + }, + "nodeType": "YulFunctionCall", + "src": "1881:35:1" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "1874:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1874:43:1" + }, + "nodeType": "YulIf", + "src": "1871:2:1" + } + ] + }, + "name": "validator_revert_t_address", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "1854:5:1", + "type": "" + } + ], + "src": "1818:122:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1989:79:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "2046:16:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "2055:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "2058:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "2048:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "2048:12:1" + }, + "nodeType": "YulExpressionStatement", + "src": "2048:12:1" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "2012:5:1" + }, + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "2037:5:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "2019:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "2019:24:1" + } + ], + "functionName": { + "name": "eq", + "nodeType": "YulIdentifier", + "src": "2009:2:1" + }, + "nodeType": "YulFunctionCall", + "src": "2009:35:1" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "2002:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "2002:43:1" + }, + "nodeType": "YulIf", + "src": "1999:2:1" + } + ] + }, + "name": "validator_revert_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "1982:5:1", + "type": "" + } + ], + "src": "1946:122:1" + } + ] + }, + "contents": "{\n\n function abi_decode_t_address(offset, end) -> value {\n value := calldataload(offset)\n validator_revert_t_address(value)\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_t_uint256_fromMemory(offset, end) -> value {\n value := mload(offset)\n validator_revert_t_uint256(value)\n }\n\n function abi_decode_tuple_t_addresst_uint256(headStart, dataEnd) -> value0, value1 {\n if slt(sub(dataEnd, headStart), 64) { revert(0, 0) }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_address(add(headStart, offset), dataEnd)\n }\n\n {\n\n let offset := 32\n\n value1 := abi_decode_t_uint256(add(headStart, offset), dataEnd)\n }\n\n }\n\n function abi_decode_tuple_t_uint256_fromMemory(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_uint256_fromMemory(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 function cleanup_t_address(value) -> cleaned {\n cleaned := cleanup_t_uint160(value)\n }\n\n function cleanup_t_uint160(value) -> cleaned {\n cleaned := and(value, 0xffffffffffffffffffffffffffffffffffffffff)\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function validator_revert_t_address(value) {\n if iszero(eq(value, cleanup_t_address(value))) { revert(0, 0) }\n }\n\n function validator_revert_t_uint256(value) {\n if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }\n }\n\n}\n", + "id": 1, + "language": "Yul", + "name": "#utility.yul" + } + ], + "immutableReferences": {}, + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b50600436106100365760003560e01c8063398f72231461003b578063975057e714610057575b600080fd5b610055600480360381019061005091906101af565b610075565b005b61005f61016a565b60405161006c9190610223565b60405180910390f35b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fd63983b826040518263ffffffff1660e01b815260040161010e9190610223565b602060405180830381600087803b15801561012857600080fd5b505af115801561013c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061016091906101eb565b6001819055505050565b60015481565b60008135905061017f8161027a565b92915050565b60008135905061019481610291565b92915050565b6000815190506101a981610291565b92915050565b600080604083850312156101c257600080fd5b60006101d085828601610170565b92505060206101e185828601610185565b9150509250929050565b6000602082840312156101fd57600080fd5b600061020b8482850161019a565b91505092915050565b61021d81610270565b82525050565b60006020820190506102386000830184610214565b92915050565b600061024982610250565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6102838161023e565b811461028e57600080fd5b50565b61029a81610270565b81146102a557600080fd5b5056fea26469706673582212208b44616dfaba36ab3ed3c66e08e62b41b20549fa87e881fd77e006374d11f86b64736f6c63430008030033", + "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 0x398F7223 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x975057E7 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 0x1AF JUMP JUMPDEST PUSH2 0x75 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x5F PUSH2 0x16A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x6C SWAP2 SWAP1 PUSH2 0x223 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST DUP2 PUSH1 0x0 DUP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xFD63983B DUP3 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x10E SWAP2 SWAP1 PUSH2 0x223 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x128 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x13C JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x160 SWAP2 SWAP1 PUSH2 0x1EB JUMP JUMPDEST PUSH1 0x1 DUP2 SWAP1 SSTORE POP POP POP JUMP JUMPDEST PUSH1 0x1 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x17F DUP2 PUSH2 0x27A JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x194 DUP2 PUSH2 0x291 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP PUSH2 0x1A9 DUP2 PUSH2 0x291 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x1C2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1D0 DUP6 DUP3 DUP7 ADD PUSH2 0x170 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x1E1 DUP6 DUP3 DUP7 ADD PUSH2 0x185 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1FD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x20B DUP5 DUP3 DUP6 ADD PUSH2 0x19A JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x21D DUP2 PUSH2 0x270 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x238 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x214 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x249 DUP3 PUSH2 0x250 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x283 DUP2 PUSH2 0x23E JUMP JUMPDEST DUP2 EQ PUSH2 0x28E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH2 0x29A DUP2 PUSH2 0x270 JUMP JUMPDEST DUP2 EQ PUSH2 0x2A5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 DUP12 DIFFICULTY PUSH2 0x6DFA 0xBA CALLDATASIZE 0xAB RETURNDATACOPY 0xD3 0xC6 PUSH15 0x8E62B41B20549FA87E881FD77E006 CALLDATACOPY 0x4D GT 0xF8 PUSH12 0x64736F6C6343000803003300 ", + "sourceMap": "136:238:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;221:147;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;194:17;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;221:147;307:5;291:6;;:22;;;;;;;;;;;;;;;;;;335:6;;;;;;;;;;:13;;;349:7;335:22;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;327:5;:30;;;;221:147;;:::o;194:17::-;;;;:::o;7:139:1:-;;91:6;78:20;69:29;;107:33;134:5;107:33;:::i;:::-;59:87;;;;:::o;152:139::-;;236:6;223:20;214:29;;252:33;279:5;252:33;:::i;:::-;204:87;;;;:::o;297:143::-;;385:6;379:13;370:22;;401:33;428:5;401:33;:::i;:::-;360:80;;;;:::o;446:407::-;;;571:2;559:9;550:7;546:23;542:32;539:2;;;587:1;584;577:12;539:2;630:1;655:53;700:7;691:6;680:9;676:22;655:53;:::i;:::-;645:63;;601:117;757:2;783:53;828:7;819:6;808:9;804:22;783:53;:::i;:::-;773:63;;728:118;529:324;;;;;:::o;859:284::-;;978:2;966:9;957:7;953:23;949:32;946:2;;;994:1;991;984:12;946:2;1037:1;1062:64;1118:7;1109:6;1098:9;1094:22;1062:64;:::i;:::-;1052:74;;1008:128;936:207;;;;:::o;1149:118::-;1236:24;1254:5;1236:24;:::i;:::-;1231:3;1224:37;1214:53;;:::o;1273:222::-;;1404:2;1393:9;1389:18;1381:26;;1417:71;1485:1;1474:9;1470:17;1461:6;1417:71;:::i;:::-;1371:124;;;;:::o;1501:96::-;;1567:24;1585:5;1567:24;:::i;:::-;1556:35;;1546:51;;;:::o;1603:126::-;;1680:42;1673:5;1669:54;1658:65;;1648:81;;;:::o;1735:77::-;;1801:5;1790:16;;1780:32;;;:::o;1818:122::-;1891:24;1909:5;1891:24;:::i;:::-;1884:5;1881:35;1871:2;;1930:1;1927;1920:12;1871:2;1861:79;:::o;1946:122::-;2019:24;2037:5;2019:24;:::i;:::-;2012:5;2009:35;1999:2;;2058:1;2055;2048:12;1999:2;1989:79;:::o" + }, + "gasEstimates": { + "creation": { + "codeDepositCost": "146800", + "executionCost": "190", + "totalCost": "146990" + }, + "external": { + "someAction(address,uint256)": "infinite", + "store()": "1129" + } + }, + "legacyAssembly": { + ".code": [ + { + "begin": 136, + "end": 374, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 136, + "end": 374, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 136, "end": 374, "name": "MSTORE", "source": 0 }, + { "begin": 136, "end": 374, "name": "CALLVALUE", "source": 0 }, + { "begin": 136, "end": 374, "name": "DUP1", "source": 0 }, + { "begin": 136, "end": 374, "name": "ISZERO", "source": 0 }, + { + "begin": 136, + "end": 374, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 136, "end": 374, "name": "JUMPI", "source": 0 }, + { + "begin": 136, + "end": 374, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 136, "end": 374, "name": "DUP1", "source": 0 }, + { "begin": 136, "end": 374, "name": "REVERT", "source": 0 }, + { + "begin": 136, + "end": 374, + "name": "tag", + "source": 0, + "value": "1" + }, + { "begin": 136, "end": 374, "name": "JUMPDEST", "source": 0 }, + { "begin": 136, "end": 374, "name": "POP", "source": 0 }, + { + "begin": 136, + "end": 374, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 136, "end": 374, "name": "DUP1", "source": 0 }, + { + "begin": 136, + "end": 374, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 136, + "end": 374, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 136, "end": 374, "name": "CODECOPY", "source": 0 }, + { + "begin": 136, + "end": 374, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 136, "end": 374, "name": "RETURN", "source": 0 } + ], + ".data": { + "0": { + ".auxdata": "a26469706673582212208b44616dfaba36ab3ed3c66e08e62b41b20549fa87e881fd77e006374d11f86b64736f6c63430008030033", + ".code": [ + { + "begin": 136, + "end": 374, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 136, + "end": 374, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 136, "end": 374, "name": "MSTORE", "source": 0 }, + { "begin": 136, "end": 374, "name": "CALLVALUE", "source": 0 }, + { "begin": 136, "end": 374, "name": "DUP1", "source": 0 }, + { "begin": 136, "end": 374, "name": "ISZERO", "source": 0 }, + { + "begin": 136, + "end": 374, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 136, "end": 374, "name": "JUMPI", "source": 0 }, + { + "begin": 136, + "end": 374, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 136, "end": 374, "name": "DUP1", "source": 0 }, + { "begin": 136, "end": 374, "name": "REVERT", "source": 0 }, + { + "begin": 136, + "end": 374, + "name": "tag", + "source": 0, + "value": "1" + }, + { "begin": 136, "end": 374, "name": "JUMPDEST", "source": 0 }, + { "begin": 136, "end": 374, "name": "POP", "source": 0 }, + { + "begin": 136, + "end": 374, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 136, "end": 374, "name": "CALLDATASIZE", "source": 0 }, + { "begin": 136, "end": 374, "name": "LT", "source": 0 }, + { + "begin": 136, + "end": 374, + "name": "PUSH [tag]", + "source": 0, + "value": "2" + }, + { "begin": 136, "end": 374, "name": "JUMPI", "source": 0 }, + { + "begin": 136, + "end": 374, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 136, "end": 374, "name": "CALLDATALOAD", "source": 0 }, + { + "begin": 136, + "end": 374, + "name": "PUSH", + "source": 0, + "value": "E0" + }, + { "begin": 136, "end": 374, "name": "SHR", "source": 0 }, + { "begin": 136, "end": 374, "name": "DUP1", "source": 0 }, + { + "begin": 136, + "end": 374, + "name": "PUSH", + "source": 0, + "value": "398F7223" + }, + { "begin": 136, "end": 374, "name": "EQ", "source": 0 }, + { + "begin": 136, + "end": 374, + "name": "PUSH [tag]", + "source": 0, + "value": "3" + }, + { "begin": 136, "end": 374, "name": "JUMPI", "source": 0 }, + { "begin": 136, "end": 374, "name": "DUP1", "source": 0 }, + { + "begin": 136, + "end": 374, + "name": "PUSH", + "source": 0, + "value": "975057E7" + }, + { "begin": 136, "end": 374, "name": "EQ", "source": 0 }, + { + "begin": 136, + "end": 374, + "name": "PUSH [tag]", + "source": 0, + "value": "4" + }, + { "begin": 136, "end": 374, "name": "JUMPI", "source": 0 }, + { + "begin": 136, + "end": 374, + "name": "tag", + "source": 0, + "value": "2" + }, + { "begin": 136, "end": 374, "name": "JUMPDEST", "source": 0 }, + { + "begin": 136, + "end": 374, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 136, "end": 374, "name": "DUP1", "source": 0 }, + { "begin": 136, "end": 374, "name": "REVERT", "source": 0 }, + { + "begin": 221, + "end": 368, + "name": "tag", + "source": 0, + "value": "3" + }, + { "begin": 221, "end": 368, "name": "JUMPDEST", "source": 0 }, + { + "begin": 221, + "end": 368, + "name": "PUSH [tag]", + "source": 0, + "value": "5" + }, + { + "begin": 221, + "end": 368, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 221, "end": 368, "name": "DUP1", "source": 0 }, + { "begin": 221, "end": 368, "name": "CALLDATASIZE", "source": 0 }, + { "begin": 221, "end": 368, "name": "SUB", "source": 0 }, + { "begin": 221, "end": 368, "name": "DUP2", "source": 0 }, + { "begin": 221, "end": 368, "name": "ADD", "source": 0 }, + { "begin": 221, "end": 368, "name": "SWAP1", "source": 0 }, + { + "begin": 221, + "end": 368, + "name": "PUSH [tag]", + "source": 0, + "value": "6" + }, + { "begin": 221, "end": 368, "name": "SWAP2", "source": 0 }, + { "begin": 221, "end": 368, "name": "SWAP1", "source": 0 }, + { + "begin": 221, + "end": 368, + "name": "PUSH [tag]", + "source": 0, + "value": "7" + }, + { + "begin": 221, + "end": 368, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 221, + "end": 368, + "name": "tag", + "source": 0, + "value": "6" + }, + { "begin": 221, "end": 368, "name": "JUMPDEST", "source": 0 }, + { + "begin": 221, + "end": 368, + "name": "PUSH [tag]", + "source": 0, + "value": "8" + }, + { + "begin": 221, + "end": 368, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 221, + "end": 368, + "name": "tag", + "source": 0, + "value": "5" + }, + { "begin": 221, "end": 368, "name": "JUMPDEST", "source": 0 }, + { "begin": 221, "end": 368, "name": "STOP", "source": 0 }, + { + "begin": 194, + "end": 211, + "name": "tag", + "source": 0, + "value": "4" + }, + { "begin": 194, "end": 211, "name": "JUMPDEST", "source": 0 }, + { + "begin": 194, + "end": 211, + "name": "PUSH [tag]", + "source": 0, + "value": "9" + }, + { + "begin": 194, + "end": 211, + "name": "PUSH [tag]", + "source": 0, + "value": "10" + }, + { + "begin": 194, + "end": 211, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 194, + "end": 211, + "name": "tag", + "source": 0, + "value": "9" + }, + { "begin": 194, "end": 211, "name": "JUMPDEST", "source": 0 }, + { + "begin": 194, + "end": 211, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 194, "end": 211, "name": "MLOAD", "source": 0 }, + { + "begin": 194, + "end": 211, + "name": "PUSH [tag]", + "source": 0, + "value": "11" + }, + { "begin": 194, "end": 211, "name": "SWAP2", "source": 0 }, + { "begin": 194, "end": 211, "name": "SWAP1", "source": 0 }, + { + "begin": 194, + "end": 211, + "name": "PUSH [tag]", + "source": 0, + "value": "12" + }, + { + "begin": 194, + "end": 211, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 194, + "end": 211, + "name": "tag", + "source": 0, + "value": "11" + }, + { "begin": 194, "end": 211, "name": "JUMPDEST", "source": 0 }, + { + "begin": 194, + "end": 211, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 194, "end": 211, "name": "MLOAD", "source": 0 }, + { "begin": 194, "end": 211, "name": "DUP1", "source": 0 }, + { "begin": 194, "end": 211, "name": "SWAP2", "source": 0 }, + { "begin": 194, "end": 211, "name": "SUB", "source": 0 }, + { "begin": 194, "end": 211, "name": "SWAP1", "source": 0 }, + { "begin": 194, "end": 211, "name": "RETURN", "source": 0 }, + { + "begin": 221, + "end": 368, + "name": "tag", + "source": 0, + "value": "8" + }, + { "begin": 221, "end": 368, "name": "JUMPDEST", "source": 0 }, + { "begin": 307, "end": 312, "name": "DUP2", "source": 0 }, + { + "begin": 291, + "end": 297, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 291, "end": 297, "name": "DUP1", "source": 0 }, + { + "begin": 291, + "end": 313, + "name": "PUSH", + "source": 0, + "value": "100" + }, + { "begin": 291, "end": 313, "name": "EXP", "source": 0 }, + { "begin": 291, "end": 313, "name": "DUP2", "source": 0 }, + { "begin": 291, "end": 313, "name": "SLOAD", "source": 0 }, + { "begin": 291, "end": 313, "name": "DUP2", "source": 0 }, + { + "begin": 291, + "end": 313, + "name": "PUSH", + "source": 0, + "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + }, + { "begin": 291, "end": 313, "name": "MUL", "source": 0 }, + { "begin": 291, "end": 313, "name": "NOT", "source": 0 }, + { "begin": 291, "end": 313, "name": "AND", "source": 0 }, + { "begin": 291, "end": 313, "name": "SWAP1", "source": 0 }, + { "begin": 291, "end": 313, "name": "DUP4", "source": 0 }, + { + "begin": 291, + "end": 313, + "name": "PUSH", + "source": 0, + "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + }, + { "begin": 291, "end": 313, "name": "AND", "source": 0 }, + { "begin": 291, "end": 313, "name": "MUL", "source": 0 }, + { "begin": 291, "end": 313, "name": "OR", "source": 0 }, + { "begin": 291, "end": 313, "name": "SWAP1", "source": 0 }, + { "begin": 291, "end": 313, "name": "SSTORE", "source": 0 }, + { "begin": 291, "end": 313, "name": "POP", "source": 0 }, + { + "begin": 335, + "end": 341, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 335, "end": 341, "name": "DUP1", "source": 0 }, + { "begin": 335, "end": 341, "name": "SLOAD", "source": 0 }, + { "begin": 335, "end": 341, "name": "SWAP1", "source": 0 }, + { + "begin": 335, + "end": 341, + "name": "PUSH", + "source": 0, + "value": "100" + }, + { "begin": 335, "end": 341, "name": "EXP", "source": 0 }, + { "begin": 335, "end": 341, "name": "SWAP1", "source": 0 }, + { "begin": 335, "end": 341, "name": "DIV", "source": 0 }, + { + "begin": 335, + "end": 341, + "name": "PUSH", + "source": 0, + "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + }, + { "begin": 335, "end": 341, "name": "AND", "source": 0 }, + { + "begin": 335, + "end": 348, + "name": "PUSH", + "source": 0, + "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + }, + { "begin": 335, "end": 348, "name": "AND", "source": 0 }, + { + "begin": 335, + "end": 348, + "name": "PUSH", + "source": 0, + "value": "FD63983B" + }, + { "begin": 349, "end": 356, "name": "DUP3", "source": 0 }, + { + "begin": 335, + "end": 357, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 335, "end": 357, "name": "MLOAD", "source": 0 }, + { "begin": 335, "end": 357, "name": "DUP3", "source": 0 }, + { + "begin": 335, + "end": 357, + "name": "PUSH", + "source": 0, + "value": "FFFFFFFF" + }, + { "begin": 335, "end": 357, "name": "AND", "source": 0 }, + { + "begin": 335, + "end": 357, + "name": "PUSH", + "source": 0, + "value": "E0" + }, + { "begin": 335, "end": 357, "name": "SHL", "source": 0 }, + { "begin": 335, "end": 357, "name": "DUP2", "source": 0 }, + { "begin": 335, "end": 357, "name": "MSTORE", "source": 0 }, + { + "begin": 335, + "end": 357, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 335, "end": 357, "name": "ADD", "source": 0 }, + { + "begin": 335, + "end": 357, + "name": "PUSH [tag]", + "source": 0, + "value": "14" + }, + { "begin": 335, "end": 357, "name": "SWAP2", "source": 0 }, + { "begin": 335, "end": 357, "name": "SWAP1", "source": 0 }, + { + "begin": 335, + "end": 357, + "name": "PUSH [tag]", + "source": 0, + "value": "12" + }, + { + "begin": 335, + "end": 357, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 335, + "end": 357, + "name": "tag", + "source": 0, + "value": "14" + }, + { "begin": 335, "end": 357, "name": "JUMPDEST", "source": 0 }, + { + "begin": 335, + "end": 357, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { + "begin": 335, + "end": 357, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 335, "end": 357, "name": "MLOAD", "source": 0 }, + { "begin": 335, "end": 357, "name": "DUP1", "source": 0 }, + { "begin": 335, "end": 357, "name": "DUP4", "source": 0 }, + { "begin": 335, "end": 357, "name": "SUB", "source": 0 }, + { "begin": 335, "end": 357, "name": "DUP2", "source": 0 }, + { + "begin": 335, + "end": 357, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 335, "end": 357, "name": "DUP8", "source": 0 }, + { "begin": 335, "end": 357, "name": "DUP1", "source": 0 }, + { "begin": 335, "end": 357, "name": "EXTCODESIZE", "source": 0 }, + { "begin": 335, "end": 357, "name": "ISZERO", "source": 0 }, + { "begin": 335, "end": 357, "name": "DUP1", "source": 0 }, + { "begin": 335, "end": 357, "name": "ISZERO", "source": 0 }, + { + "begin": 335, + "end": 357, + "name": "PUSH [tag]", + "source": 0, + "value": "15" + }, + { "begin": 335, "end": 357, "name": "JUMPI", "source": 0 }, + { + "begin": 335, + "end": 357, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 335, "end": 357, "name": "DUP1", "source": 0 }, + { "begin": 335, "end": 357, "name": "REVERT", "source": 0 }, + { + "begin": 335, + "end": 357, + "name": "tag", + "source": 0, + "value": "15" + }, + { "begin": 335, "end": 357, "name": "JUMPDEST", "source": 0 }, + { "begin": 335, "end": 357, "name": "POP", "source": 0 }, + { "begin": 335, "end": 357, "name": "GAS", "source": 0 }, + { "begin": 335, "end": 357, "name": "CALL", "source": 0 }, + { "begin": 335, "end": 357, "name": "ISZERO", "source": 0 }, + { "begin": 335, "end": 357, "name": "DUP1", "source": 0 }, + { "begin": 335, "end": 357, "name": "ISZERO", "source": 0 }, + { + "begin": 335, + "end": 357, + "name": "PUSH [tag]", + "source": 0, + "value": "17" + }, + { "begin": 335, "end": 357, "name": "JUMPI", "source": 0 }, + { + "begin": 335, + "end": 357, + "name": "RETURNDATASIZE", + "source": 0 + }, + { + "begin": 335, + "end": 357, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 335, "end": 357, "name": "DUP1", "source": 0 }, + { + "begin": 335, + "end": 357, + "name": "RETURNDATACOPY", + "source": 0 + }, + { + "begin": 335, + "end": 357, + "name": "RETURNDATASIZE", + "source": 0 + }, + { + "begin": 335, + "end": 357, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 335, "end": 357, "name": "REVERT", "source": 0 }, + { + "begin": 335, + "end": 357, + "name": "tag", + "source": 0, + "value": "17" + }, + { "begin": 335, "end": 357, "name": "JUMPDEST", "source": 0 }, + { "begin": 335, "end": 357, "name": "POP", "source": 0 }, + { "begin": 335, "end": 357, "name": "POP", "source": 0 }, + { "begin": 335, "end": 357, "name": "POP", "source": 0 }, + { "begin": 335, "end": 357, "name": "POP", "source": 0 }, + { + "begin": 335, + "end": 357, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 335, "end": 357, "name": "MLOAD", "source": 0 }, + { + "begin": 335, + "end": 357, + "name": "RETURNDATASIZE", + "source": 0 + }, + { + "begin": 335, + "end": 357, + "name": "PUSH", + "source": 0, + "value": "1F" + }, + { "begin": 335, "end": 357, "name": "NOT", "source": 0 }, + { + "begin": 335, + "end": 357, + "name": "PUSH", + "source": 0, + "value": "1F" + }, + { "begin": 335, "end": 357, "name": "DUP3", "source": 0 }, + { "begin": 335, "end": 357, "name": "ADD", "source": 0 }, + { "begin": 335, "end": 357, "name": "AND", "source": 0 }, + { "begin": 335, "end": 357, "name": "DUP3", "source": 0 }, + { "begin": 335, "end": 357, "name": "ADD", "source": 0 }, + { "begin": 335, "end": 357, "name": "DUP1", "source": 0 }, + { + "begin": 335, + "end": 357, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 335, "end": 357, "name": "MSTORE", "source": 0 }, + { "begin": 335, "end": 357, "name": "POP", "source": 0 }, + { "begin": 335, "end": 357, "name": "DUP2", "source": 0 }, + { "begin": 335, "end": 357, "name": "ADD", "source": 0 }, + { "begin": 335, "end": 357, "name": "SWAP1", "source": 0 }, + { + "begin": 335, + "end": 357, + "name": "PUSH [tag]", + "source": 0, + "value": "18" + }, + { "begin": 335, "end": 357, "name": "SWAP2", "source": 0 }, + { "begin": 335, "end": 357, "name": "SWAP1", "source": 0 }, + { + "begin": 335, + "end": 357, + "name": "PUSH [tag]", + "source": 0, + "value": "19" + }, + { + "begin": 335, + "end": 357, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 335, + "end": 357, + "name": "tag", + "source": 0, + "value": "18" + }, + { "begin": 335, "end": 357, "name": "JUMPDEST", "source": 0 }, + { + "begin": 327, + "end": 332, + "name": "PUSH", + "source": 0, + "value": "1" + }, + { "begin": 327, "end": 357, "name": "DUP2", "source": 0 }, + { "begin": 327, "end": 357, "name": "SWAP1", "source": 0 }, + { "begin": 327, "end": 357, "name": "SSTORE", "source": 0 }, + { "begin": 327, "end": 357, "name": "POP", "source": 0 }, + { "begin": 221, "end": 368, "name": "POP", "source": 0 }, + { "begin": 221, "end": 368, "name": "POP", "source": 0 }, + { + "begin": 221, + "end": 368, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { + "begin": 194, + "end": 211, + "name": "tag", + "source": 0, + "value": "10" + }, + { "begin": 194, "end": 211, "name": "JUMPDEST", "source": 0 }, + { + "begin": 194, + "end": 211, + "name": "PUSH", + "source": 0, + "value": "1" + }, + { "begin": 194, "end": 211, "name": "SLOAD", "source": 0 }, + { "begin": 194, "end": 211, "name": "DUP2", "source": 0 }, + { + "begin": 194, + "end": 211, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { + "begin": 7, + "end": 146, + "name": "tag", + "source": 1, + "value": "21" + }, + { "begin": 7, "end": 146, "name": "JUMPDEST", "source": 1 }, + { + "begin": 7, + "end": 146, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 91, "end": 97, "name": "DUP2", "source": 1 }, + { "begin": 78, "end": 98, "name": "CALLDATALOAD", "source": 1 }, + { "begin": 69, "end": 98, "name": "SWAP1", "source": 1 }, + { "begin": 69, "end": 98, "name": "POP", "source": 1 }, + { + "begin": 107, + "end": 140, + "name": "PUSH [tag]", + "source": 1, + "value": "23" + }, + { "begin": 134, "end": 139, "name": "DUP2", "source": 1 }, + { + "begin": 107, + "end": 140, + "name": "PUSH [tag]", + "source": 1, + "value": "24" + }, + { + "begin": 107, + "end": 140, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 107, + "end": 140, + "name": "tag", + "source": 1, + "value": "23" + }, + { "begin": 107, "end": 140, "name": "JUMPDEST", "source": 1 }, + { "begin": 59, "end": 146, "name": "SWAP3", "source": 1 }, + { "begin": 59, "end": 146, "name": "SWAP2", "source": 1 }, + { "begin": 59, "end": 146, "name": "POP", "source": 1 }, + { "begin": 59, "end": 146, "name": "POP", "source": 1 }, + { + "begin": 59, + "end": 146, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 152, + "end": 291, + "name": "tag", + "source": 1, + "value": "25" + }, + { "begin": 152, "end": 291, "name": "JUMPDEST", "source": 1 }, + { + "begin": 152, + "end": 291, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 236, "end": 242, "name": "DUP2", "source": 1 }, + { "begin": 223, "end": 243, "name": "CALLDATALOAD", "source": 1 }, + { "begin": 214, "end": 243, "name": "SWAP1", "source": 1 }, + { "begin": 214, "end": 243, "name": "POP", "source": 1 }, + { + "begin": 252, + "end": 285, + "name": "PUSH [tag]", + "source": 1, + "value": "27" + }, + { "begin": 279, "end": 284, "name": "DUP2", "source": 1 }, + { + "begin": 252, + "end": 285, + "name": "PUSH [tag]", + "source": 1, + "value": "28" + }, + { + "begin": 252, + "end": 285, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 252, + "end": 285, + "name": "tag", + "source": 1, + "value": "27" + }, + { "begin": 252, "end": 285, "name": "JUMPDEST", "source": 1 }, + { "begin": 204, "end": 291, "name": "SWAP3", "source": 1 }, + { "begin": 204, "end": 291, "name": "SWAP2", "source": 1 }, + { "begin": 204, "end": 291, "name": "POP", "source": 1 }, + { "begin": 204, "end": 291, "name": "POP", "source": 1 }, + { + "begin": 204, + "end": 291, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 297, + "end": 440, + "name": "tag", + "source": 1, + "value": "29" + }, + { "begin": 297, "end": 440, "name": "JUMPDEST", "source": 1 }, + { + "begin": 297, + "end": 440, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 385, "end": 391, "name": "DUP2", "source": 1 }, + { "begin": 379, "end": 392, "name": "MLOAD", "source": 1 }, + { "begin": 370, "end": 392, "name": "SWAP1", "source": 1 }, + { "begin": 370, "end": 392, "name": "POP", "source": 1 }, + { + "begin": 401, + "end": 434, + "name": "PUSH [tag]", + "source": 1, + "value": "31" + }, + { "begin": 428, "end": 433, "name": "DUP2", "source": 1 }, + { + "begin": 401, + "end": 434, + "name": "PUSH [tag]", + "source": 1, + "value": "28" + }, + { + "begin": 401, + "end": 434, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 401, + "end": 434, + "name": "tag", + "source": 1, + "value": "31" + }, + { "begin": 401, "end": 434, "name": "JUMPDEST", "source": 1 }, + { "begin": 360, "end": 440, "name": "SWAP3", "source": 1 }, + { "begin": 360, "end": 440, "name": "SWAP2", "source": 1 }, + { "begin": 360, "end": 440, "name": "POP", "source": 1 }, + { "begin": 360, "end": 440, "name": "POP", "source": 1 }, + { + "begin": 360, + "end": 440, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 446, + "end": 853, + "name": "tag", + "source": 1, + "value": "7" + }, + { "begin": 446, "end": 853, "name": "JUMPDEST", "source": 1 }, + { + "begin": 446, + "end": 853, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 446, "end": 853, "name": "DUP1", "source": 1 }, + { + "begin": 571, + "end": 573, + "name": "PUSH", + "source": 1, + "value": "40" + }, + { "begin": 559, "end": 568, "name": "DUP4", "source": 1 }, + { "begin": 550, "end": 557, "name": "DUP6", "source": 1 }, + { "begin": 546, "end": 569, "name": "SUB", "source": 1 }, + { "begin": 542, "end": 574, "name": "SLT", "source": 1 }, + { "begin": 539, "end": 541, "name": "ISZERO", "source": 1 }, + { + "begin": 539, + "end": 541, + "name": "PUSH [tag]", + "source": 1, + "value": "33" + }, + { "begin": 539, "end": 541, "name": "JUMPI", "source": 1 }, + { + "begin": 587, + "end": 588, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 584, "end": 585, "name": "DUP1", "source": 1 }, + { "begin": 577, "end": 589, "name": "REVERT", "source": 1 }, + { + "begin": 539, + "end": 541, + "name": "tag", + "source": 1, + "value": "33" + }, + { "begin": 539, "end": 541, "name": "JUMPDEST", "source": 1 }, + { + "begin": 630, + "end": 631, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 655, + "end": 708, + "name": "PUSH [tag]", + "source": 1, + "value": "34" + }, + { "begin": 700, "end": 707, "name": "DUP6", "source": 1 }, + { "begin": 691, "end": 697, "name": "DUP3", "source": 1 }, + { "begin": 680, "end": 689, "name": "DUP7", "source": 1 }, + { "begin": 676, "end": 698, "name": "ADD", "source": 1 }, + { + "begin": 655, + "end": 708, + "name": "PUSH [tag]", + "source": 1, + "value": "21" + }, + { + "begin": 655, + "end": 708, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 655, + "end": 708, + "name": "tag", + "source": 1, + "value": "34" + }, + { "begin": 655, "end": 708, "name": "JUMPDEST", "source": 1 }, + { "begin": 645, "end": 708, "name": "SWAP3", "source": 1 }, + { "begin": 645, "end": 708, "name": "POP", "source": 1 }, + { "begin": 601, "end": 718, "name": "POP", "source": 1 }, + { + "begin": 757, + "end": 759, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { + "begin": 783, + "end": 836, + "name": "PUSH [tag]", + "source": 1, + "value": "35" + }, + { "begin": 828, "end": 835, "name": "DUP6", "source": 1 }, + { "begin": 819, "end": 825, "name": "DUP3", "source": 1 }, + { "begin": 808, "end": 817, "name": "DUP7", "source": 1 }, + { "begin": 804, "end": 826, "name": "ADD", "source": 1 }, + { + "begin": 783, + "end": 836, + "name": "PUSH [tag]", + "source": 1, + "value": "25" + }, + { + "begin": 783, + "end": 836, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 783, + "end": 836, + "name": "tag", + "source": 1, + "value": "35" + }, + { "begin": 783, "end": 836, "name": "JUMPDEST", "source": 1 }, + { "begin": 773, "end": 836, "name": "SWAP2", "source": 1 }, + { "begin": 773, "end": 836, "name": "POP", "source": 1 }, + { "begin": 728, "end": 846, "name": "POP", "source": 1 }, + { "begin": 529, "end": 853, "name": "SWAP3", "source": 1 }, + { "begin": 529, "end": 853, "name": "POP", "source": 1 }, + { "begin": 529, "end": 853, "name": "SWAP3", "source": 1 }, + { "begin": 529, "end": 853, "name": "SWAP1", "source": 1 }, + { "begin": 529, "end": 853, "name": "POP", "source": 1 }, + { + "begin": 529, + "end": 853, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 859, + "end": 1143, + "name": "tag", + "source": 1, + "value": "19" + }, + { "begin": 859, "end": 1143, "name": "JUMPDEST", "source": 1 }, + { + "begin": 859, + "end": 1143, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 978, + "end": 980, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 966, "end": 975, "name": "DUP3", "source": 1 }, + { "begin": 957, "end": 964, "name": "DUP5", "source": 1 }, + { "begin": 953, "end": 976, "name": "SUB", "source": 1 }, + { "begin": 949, "end": 981, "name": "SLT", "source": 1 }, + { "begin": 946, "end": 948, "name": "ISZERO", "source": 1 }, + { + "begin": 946, + "end": 948, + "name": "PUSH [tag]", + "source": 1, + "value": "37" + }, + { "begin": 946, "end": 948, "name": "JUMPI", "source": 1 }, + { + "begin": 994, + "end": 995, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 991, "end": 992, "name": "DUP1", "source": 1 }, + { "begin": 984, "end": 996, "name": "REVERT", "source": 1 }, + { + "begin": 946, + "end": 948, + "name": "tag", + "source": 1, + "value": "37" + }, + { "begin": 946, "end": 948, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1037, + "end": 1038, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 1062, + "end": 1126, + "name": "PUSH [tag]", + "source": 1, + "value": "38" + }, + { "begin": 1118, "end": 1125, "name": "DUP5", "source": 1 }, + { "begin": 1109, "end": 1115, "name": "DUP3", "source": 1 }, + { "begin": 1098, "end": 1107, "name": "DUP6", "source": 1 }, + { "begin": 1094, "end": 1116, "name": "ADD", "source": 1 }, + { + "begin": 1062, + "end": 1126, + "name": "PUSH [tag]", + "source": 1, + "value": "29" + }, + { + "begin": 1062, + "end": 1126, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1062, + "end": 1126, + "name": "tag", + "source": 1, + "value": "38" + }, + { "begin": 1062, "end": 1126, "name": "JUMPDEST", "source": 1 }, + { "begin": 1052, "end": 1126, "name": "SWAP2", "source": 1 }, + { "begin": 1052, "end": 1126, "name": "POP", "source": 1 }, + { "begin": 1008, "end": 1136, "name": "POP", "source": 1 }, + { "begin": 936, "end": 1143, "name": "SWAP3", "source": 1 }, + { "begin": 936, "end": 1143, "name": "SWAP2", "source": 1 }, + { "begin": 936, "end": 1143, "name": "POP", "source": 1 }, + { "begin": 936, "end": 1143, "name": "POP", "source": 1 }, + { + "begin": 936, + "end": 1143, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1149, + "end": 1267, + "name": "tag", + "source": 1, + "value": "39" + }, + { "begin": 1149, "end": 1267, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1236, + "end": 1260, + "name": "PUSH [tag]", + "source": 1, + "value": "41" + }, + { "begin": 1254, "end": 1259, "name": "DUP2", "source": 1 }, + { + "begin": 1236, + "end": 1260, + "name": "PUSH [tag]", + "source": 1, + "value": "42" + }, + { + "begin": 1236, + "end": 1260, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1236, + "end": 1260, + "name": "tag", + "source": 1, + "value": "41" + }, + { "begin": 1236, "end": 1260, "name": "JUMPDEST", "source": 1 }, + { "begin": 1231, "end": 1234, "name": "DUP3", "source": 1 }, + { "begin": 1224, "end": 1261, "name": "MSTORE", "source": 1 }, + { "begin": 1214, "end": 1267, "name": "POP", "source": 1 }, + { "begin": 1214, "end": 1267, "name": "POP", "source": 1 }, + { + "begin": 1214, + "end": 1267, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1273, + "end": 1495, + "name": "tag", + "source": 1, + "value": "12" + }, + { "begin": 1273, "end": 1495, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1273, + "end": 1495, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 1404, + "end": 1406, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 1393, "end": 1402, "name": "DUP3", "source": 1 }, + { "begin": 1389, "end": 1407, "name": "ADD", "source": 1 }, + { "begin": 1381, "end": 1407, "name": "SWAP1", "source": 1 }, + { "begin": 1381, "end": 1407, "name": "POP", "source": 1 }, + { + "begin": 1417, + "end": 1488, + "name": "PUSH [tag]", + "source": 1, + "value": "44" + }, + { + "begin": 1485, + "end": 1486, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1474, "end": 1483, "name": "DUP4", "source": 1 }, + { "begin": 1470, "end": 1487, "name": "ADD", "source": 1 }, + { "begin": 1461, "end": 1467, "name": "DUP5", "source": 1 }, + { + "begin": 1417, + "end": 1488, + "name": "PUSH [tag]", + "source": 1, + "value": "39" + }, + { + "begin": 1417, + "end": 1488, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1417, + "end": 1488, + "name": "tag", + "source": 1, + "value": "44" + }, + { "begin": 1417, "end": 1488, "name": "JUMPDEST", "source": 1 }, + { "begin": 1371, "end": 1495, "name": "SWAP3", "source": 1 }, + { "begin": 1371, "end": 1495, "name": "SWAP2", "source": 1 }, + { "begin": 1371, "end": 1495, "name": "POP", "source": 1 }, + { "begin": 1371, "end": 1495, "name": "POP", "source": 1 }, + { + "begin": 1371, + "end": 1495, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1501, + "end": 1597, + "name": "tag", + "source": 1, + "value": "45" + }, + { "begin": 1501, "end": 1597, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1501, + "end": 1597, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 1567, + "end": 1591, + "name": "PUSH [tag]", + "source": 1, + "value": "47" + }, + { "begin": 1585, "end": 1590, "name": "DUP3", "source": 1 }, + { + "begin": 1567, + "end": 1591, + "name": "PUSH [tag]", + "source": 1, + "value": "48" + }, + { + "begin": 1567, + "end": 1591, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1567, + "end": 1591, + "name": "tag", + "source": 1, + "value": "47" + }, + { "begin": 1567, "end": 1591, "name": "JUMPDEST", "source": 1 }, + { "begin": 1556, "end": 1591, "name": "SWAP1", "source": 1 }, + { "begin": 1556, "end": 1591, "name": "POP", "source": 1 }, + { "begin": 1546, "end": 1597, "name": "SWAP2", "source": 1 }, + { "begin": 1546, "end": 1597, "name": "SWAP1", "source": 1 }, + { "begin": 1546, "end": 1597, "name": "POP", "source": 1 }, + { + "begin": 1546, + "end": 1597, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1603, + "end": 1729, + "name": "tag", + "source": 1, + "value": "48" + }, + { "begin": 1603, "end": 1729, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1603, + "end": 1729, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 1680, + "end": 1722, + "name": "PUSH", + "source": 1, + "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + }, + { "begin": 1673, "end": 1678, "name": "DUP3", "source": 1 }, + { "begin": 1669, "end": 1723, "name": "AND", "source": 1 }, + { "begin": 1658, "end": 1723, "name": "SWAP1", "source": 1 }, + { "begin": 1658, "end": 1723, "name": "POP", "source": 1 }, + { "begin": 1648, "end": 1729, "name": "SWAP2", "source": 1 }, + { "begin": 1648, "end": 1729, "name": "SWAP1", "source": 1 }, + { "begin": 1648, "end": 1729, "name": "POP", "source": 1 }, + { + "begin": 1648, + "end": 1729, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1735, + "end": 1812, + "name": "tag", + "source": 1, + "value": "42" + }, + { "begin": 1735, "end": 1812, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1735, + "end": 1812, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1801, "end": 1806, "name": "DUP2", "source": 1 }, + { "begin": 1790, "end": 1806, "name": "SWAP1", "source": 1 }, + { "begin": 1790, "end": 1806, "name": "POP", "source": 1 }, + { "begin": 1780, "end": 1812, "name": "SWAP2", "source": 1 }, + { "begin": 1780, "end": 1812, "name": "SWAP1", "source": 1 }, + { "begin": 1780, "end": 1812, "name": "POP", "source": 1 }, + { + "begin": 1780, + "end": 1812, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1818, + "end": 1940, + "name": "tag", + "source": 1, + "value": "24" + }, + { "begin": 1818, "end": 1940, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1891, + "end": 1915, + "name": "PUSH [tag]", + "source": 1, + "value": "52" + }, + { "begin": 1909, "end": 1914, "name": "DUP2", "source": 1 }, + { + "begin": 1891, + "end": 1915, + "name": "PUSH [tag]", + "source": 1, + "value": "45" + }, + { + "begin": 1891, + "end": 1915, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1891, + "end": 1915, + "name": "tag", + "source": 1, + "value": "52" + }, + { "begin": 1891, "end": 1915, "name": "JUMPDEST", "source": 1 }, + { "begin": 1884, "end": 1889, "name": "DUP2", "source": 1 }, + { "begin": 1881, "end": 1916, "name": "EQ", "source": 1 }, + { + "begin": 1871, + "end": 1873, + "name": "PUSH [tag]", + "source": 1, + "value": "53" + }, + { "begin": 1871, "end": 1873, "name": "JUMPI", "source": 1 }, + { + "begin": 1930, + "end": 1931, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1927, "end": 1928, "name": "DUP1", "source": 1 }, + { "begin": 1920, "end": 1932, "name": "REVERT", "source": 1 }, + { + "begin": 1871, + "end": 1873, + "name": "tag", + "source": 1, + "value": "53" + }, + { "begin": 1871, "end": 1873, "name": "JUMPDEST", "source": 1 }, + { "begin": 1861, "end": 1940, "name": "POP", "source": 1 }, + { + "begin": 1861, + "end": 1940, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1946, + "end": 2068, + "name": "tag", + "source": 1, + "value": "28" + }, + { "begin": 1946, "end": 2068, "name": "JUMPDEST", "source": 1 }, + { + "begin": 2019, + "end": 2043, + "name": "PUSH [tag]", + "source": 1, + "value": "55" + }, + { "begin": 2037, "end": 2042, "name": "DUP2", "source": 1 }, + { + "begin": 2019, + "end": 2043, + "name": "PUSH [tag]", + "source": 1, + "value": "42" + }, + { + "begin": 2019, + "end": 2043, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 2019, + "end": 2043, + "name": "tag", + "source": 1, + "value": "55" + }, + { "begin": 2019, "end": 2043, "name": "JUMPDEST", "source": 1 }, + { "begin": 2012, "end": 2017, "name": "DUP2", "source": 1 }, + { "begin": 2009, "end": 2044, "name": "EQ", "source": 1 }, + { + "begin": 1999, + "end": 2001, + "name": "PUSH [tag]", + "source": 1, + "value": "56" + }, + { "begin": 1999, "end": 2001, "name": "JUMPI", "source": 1 }, + { + "begin": 2058, + "end": 2059, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 2055, "end": 2056, "name": "DUP1", "source": 1 }, + { "begin": 2048, "end": 2060, "name": "REVERT", "source": 1 }, + { + "begin": 1999, + "end": 2001, + "name": "tag", + "source": 1, + "value": "56" + }, + { "begin": 1999, "end": 2001, "name": "JUMPDEST", "source": 1 }, + { "begin": 1989, "end": 2068, "name": "POP", "source": 1 }, + { + "begin": 1989, + "end": 2068, + "name": "JUMP", + "source": 1, + "value": "[out]" + } + ] + } + } + }, + "methodIdentifiers": { + "someAction(address,uint256)": "398f7223", + "store()": "975057e7" + } + }, + "ewasm": { "wasm": "" }, + "metadata": "{\"compiler\":{\"version\":\"0.8.3+commit.8d00100c\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_number\",\"type\":\"uint256\"}],\"name\":\"someAction\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"store\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"main.sol\":\"Caller\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"main.sol\":{\"keccak256\":\"0xa202f20982a227156b2ffee8e5066c8682d3d5d26496e43ea5190d9facb8afb3\",\"urls\":[\"bzz-raw://f8db628e4181d8bca1a4a38b01424d609ee2f5f24872e89b6bf80a14cf0cd775\",\"dweb:/ipfs/QmQ2pjvkX5PGxwHU57fPjCprvAsbKZdw9pVkeT8Kz3zj35\"]}},\"version\":1}", + "storageLayout": { + "storage": [ + { + "astId": 12, + "contract": "main.sol:Caller", + "label": "callee", + "offset": 0, + "slot": "0", + "type": "t_contract(Callee)9" + }, + { + "astId": 14, + "contract": "main.sol:Caller", + "label": "store", + "offset": 0, + "slot": "1", + "type": "t_uint256" + } + ], + "types": { + "t_contract(Callee)9": { + "encoding": "inplace", + "label": "contract Callee", + "numberOfBytes": "20" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + }, + "userdoc": { "kind": "user", "methods": {}, "version": 1 } + }, + "sourceCode": "\n pragma solidity >=0.8.0;\n interface Callee {\n function addtwo(uint _value) external returns (uint result);\n } \n contract Caller {\n Callee internal callee;\n uint public store;\n function someAction(address _addr, uint _number) public {\n callee = Callee(_addr);\n store = callee.addtwo(_number);\n }\n }" +} diff --git a/tests/contracts/compiled/CheckBlockGasLimit.json b/tests/contracts/compiled/CheckBlockGasLimit.json new file mode 100644 index 00000000000..0e53e2ccbcd --- /dev/null +++ b/tests/contracts/compiled/CheckBlockGasLimit.json @@ -0,0 +1,929 @@ +{ + "byteCode": "0x608060405234801561001057600080fd5b50456000819055504660018190555060dd8061002d6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80632a722839146037578063cd84980e146051575b600080fd5b603d606b565b604051604891906084565b60405180910390f35b60576071565b604051606291906084565b60405180910390f35b60005481565b60015481565b607e81609d565b82525050565b6000602082019050609760008301846077565b92915050565b600081905091905056fea26469706673582212201136ea9ac4990168309c87ec471a816249514c19e92015b2c4f0494707d420bf64736f6c63430008030033", + "contract": { + "abi": [ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, + { + "inputs": [], + "name": "chainid", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gaslimit", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + } + ], + "devdoc": { "kind": "dev", "methods": {}, "version": 1 }, + "evm": { + "assembly": " /* \"main.sol\":34:247 contract CheckBlockGasLimit {... */\n mstore(0x40, 0x80)\n /* \"main.sol\":140:241 constructor() {... */\n callvalue\n dup1\n iszero\n tag_1\n jumpi\n 0x00\n dup1\n revert\ntag_1:\n pop\n /* \"main.sol\":179:193 block.gaslimit */\n gaslimit\n /* \"main.sol\":168:176 gaslimit */\n 0x00\n /* \"main.sol\":168:193 gaslimit = block.gaslimit */\n dup2\n swap1\n sstore\n pop\n /* \"main.sol\":217:230 block.chainid */\n chainid\n /* \"main.sol\":207:214 chainid */\n 0x01\n /* \"main.sol\":207:230 chainid = block.chainid */\n dup2\n swap1\n sstore\n pop\n /* \"main.sol\":34:247 contract CheckBlockGasLimit {... */\n dataSize(sub_0)\n dup1\n dataOffset(sub_0)\n 0x00\n codecopy\n 0x00\n return\nstop\n\nsub_0: assembly {\n /* \"main.sol\":34:247 contract CheckBlockGasLimit {... */\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 0x2a722839\n eq\n tag_3\n jumpi\n dup1\n 0xcd84980e\n eq\n tag_4\n jumpi\n tag_2:\n 0x00\n dup1\n revert\n /* \"main.sol\":72:92 uint public gaslimit */\n tag_3:\n tag_5\n tag_6\n jump\t// in\n tag_5:\n mload(0x40)\n tag_7\n swap2\n swap1\n tag_8\n jump\t// in\n tag_7:\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n return\n /* \"main.sol\":102:121 uint public chainid */\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_8\n jump\t// in\n tag_11:\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n return\n /* \"main.sol\":72:92 uint public gaslimit */\n tag_6:\n sload(0x00)\n dup2\n jump\t// out\n /* \"main.sol\":102:121 uint public chainid */\n tag_10:\n sload(0x01)\n dup2\n jump\t// out\n /* \"#utility.yul\":7:125 */\n tag_13:\n /* \"#utility.yul\":94:118 */\n tag_15\n /* \"#utility.yul\":112:117 */\n dup2\n /* \"#utility.yul\":94:118 */\n tag_16\n jump\t// in\n tag_15:\n /* \"#utility.yul\":89:92 */\n dup3\n /* \"#utility.yul\":82:119 */\n mstore\n /* \"#utility.yul\":72:125 */\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":131:353 */\n tag_8:\n 0x00\n /* \"#utility.yul\":262:264 */\n 0x20\n /* \"#utility.yul\":251:260 */\n dup3\n /* \"#utility.yul\":247:265 */\n add\n /* \"#utility.yul\":239:265 */\n swap1\n pop\n /* \"#utility.yul\":275:346 */\n tag_18\n /* \"#utility.yul\":343:344 */\n 0x00\n /* \"#utility.yul\":332:341 */\n dup4\n /* \"#utility.yul\":328:345 */\n add\n /* \"#utility.yul\":319:325 */\n dup5\n /* \"#utility.yul\":275:346 */\n tag_13\n jump\t// in\n tag_18:\n /* \"#utility.yul\":229:353 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":359:436 */\n tag_16:\n 0x00\n /* \"#utility.yul\":425:430 */\n dup2\n /* \"#utility.yul\":414:430 */\n swap1\n pop\n /* \"#utility.yul\":404:436 */\n swap2\n swap1\n pop\n jump\t// out\n\n auxdata: 0xa26469706673582212201136ea9ac4990168309c87ec471a816249514c19e92015b2c4f0494707d420bf64736f6c63430008030033\n}\n", + "bytecode": { + "generatedSources": [], + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b50456000819055504660018190555060dd8061002d6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80632a722839146037578063cd84980e146051575b600080fd5b603d606b565b604051604891906084565b60405180910390f35b60576071565b604051606291906084565b60405180910390f35b60005481565b60015481565b607e81609d565b82525050565b6000602082019050609760008301846077565b92915050565b600081905091905056fea26469706673582212201136ea9ac4990168309c87ec471a816249514c19e92015b2c4f0494707d420bf64736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GASLIMIT PUSH1 0x0 DUP2 SWAP1 SSTORE POP CHAINID PUSH1 0x1 DUP2 SWAP1 SSTORE POP PUSH1 0xDD DUP1 PUSH2 0x2D PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH1 0x32 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x2A722839 EQ PUSH1 0x37 JUMPI DUP1 PUSH4 0xCD84980E EQ PUSH1 0x51 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3D PUSH1 0x6B JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x48 SWAP2 SWAP1 PUSH1 0x84 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x57 PUSH1 0x71 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x62 SWAP2 SWAP1 PUSH1 0x84 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x1 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x7E DUP2 PUSH1 0x9D JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH1 0x97 PUSH1 0x0 DUP4 ADD DUP5 PUSH1 0x77 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 GT CALLDATASIZE 0xEA SWAP11 0xC4 SWAP10 ADD PUSH9 0x309C87EC471A816249 MLOAD 0x4C NOT 0xE9 KECCAK256 ISZERO 0xB2 0xC4 CREATE 0x49 SELFBALANCE SMOD 0xD4 KECCAK256 0xBF PUSH5 0x736F6C6343 STOP ADDMOD SUB STOP CALLER ", + "sourceMap": "34:213:0:-:0;;;140:101;;;;;;;;;;179:14;168:8;:25;;;;217:13;207:7;:23;;;;34:213;;;;;;" + }, + "deployedBytecode": { + "generatedSources": [ + { + "ast": { + "nodeType": "YulBlock", + "src": "0:439:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "72:53:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "89:3:1" + }, + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "112:5:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "94:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "94:24:1" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "82:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "82:37:1" + }, + "nodeType": "YulExpressionStatement", + "src": "82:37:1" + } + ] + }, + "name": "abi_encode_t_uint256_to_t_uint256_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "60:5:1", + "type": "" + }, + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "67:3:1", + "type": "" + } + ], + "src": "7:118:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "229:124:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "239:26:1", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "251:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "262:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "247:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "247:18:1" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "239:4:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "319:6:1" + }, + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "332:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "343:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "328:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "328:17:1" + } + ], + "functionName": { + "name": "abi_encode_t_uint256_to_t_uint256_fromStack", + "nodeType": "YulIdentifier", + "src": "275:43:1" + }, + "nodeType": "YulFunctionCall", + "src": "275:71:1" + }, + "nodeType": "YulExpressionStatement", + "src": "275:71:1" + } + ] + }, + "name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "201:9:1", + "type": "" + }, + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "213:6:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "224:4:1", + "type": "" + } + ], + "src": "131:222:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "404:32:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "414:16:1", + "value": { + "name": "value", + "nodeType": "YulIdentifier", + "src": "425:5:1" + }, + "variableNames": [ + { + "name": "cleaned", + "nodeType": "YulIdentifier", + "src": "414:7:1" + } + ] + } + ] + }, + "name": "cleanup_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "386:5:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "cleaned", + "nodeType": "YulTypedName", + "src": "396:7:1", + "type": "" + } + ], + "src": "359:77:1" + } + ] + }, + "contents": "{\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 function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n}\n", + "id": 1, + "language": "Yul", + "name": "#utility.yul" + } + ], + "immutableReferences": {}, + "linkReferences": {}, + "object": "6080604052348015600f57600080fd5b506004361060325760003560e01c80632a722839146037578063cd84980e146051575b600080fd5b603d606b565b604051604891906084565b60405180910390f35b60576071565b604051606291906084565b60405180910390f35b60005481565b60015481565b607e81609d565b82525050565b6000602082019050609760008301846077565b92915050565b600081905091905056fea26469706673582212201136ea9ac4990168309c87ec471a816249514c19e92015b2c4f0494707d420bf64736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH1 0x32 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x2A722839 EQ PUSH1 0x37 JUMPI DUP1 PUSH4 0xCD84980E EQ PUSH1 0x51 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3D PUSH1 0x6B JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x48 SWAP2 SWAP1 PUSH1 0x84 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x57 PUSH1 0x71 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x62 SWAP2 SWAP1 PUSH1 0x84 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x1 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x7E DUP2 PUSH1 0x9D JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH1 0x97 PUSH1 0x0 DUP4 ADD DUP5 PUSH1 0x77 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 GT CALLDATASIZE 0xEA SWAP11 0xC4 SWAP10 ADD PUSH9 0x309C87EC471A816249 MLOAD 0x4C NOT 0xE9 KECCAK256 ISZERO 0xB2 0xC4 CREATE 0x49 SELFBALANCE SMOD 0xD4 KECCAK256 0xBF PUSH5 0x736F6C6343 STOP ADDMOD SUB STOP CALLER ", + "sourceMap": "34:213:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;72:20;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;102:19;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;72:20;;;;:::o;102:19::-;;;;:::o;7:118:1:-;94:24;112:5;94:24;:::i;:::-;89:3;82:37;72:53;;:::o;131:222::-;;262:2;251:9;247:18;239:26;;275:71;343:1;332:9;328:17;319:6;275:71;:::i;:::-;229:124;;;;:::o;359:77::-;;425:5;414:16;;404:32;;;:::o" + }, + "gasEstimates": { + "creation": { + "codeDepositCost": "44200", + "executionCost": "40119", + "totalCost": "84319" + }, + "external": { "chainid()": "1129", "gaslimit()": "1107" } + }, + "legacyAssembly": { + ".code": [ + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 247, "name": "MSTORE", "source": 0 }, + { "begin": 140, "end": 241, "name": "CALLVALUE", "source": 0 }, + { "begin": 140, "end": 241, "name": "DUP1", "source": 0 }, + { "begin": 140, "end": 241, "name": "ISZERO", "source": 0 }, + { + "begin": 140, + "end": 241, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 140, "end": 241, "name": "JUMPI", "source": 0 }, + { + "begin": 140, + "end": 241, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 140, "end": 241, "name": "DUP1", "source": 0 }, + { "begin": 140, "end": 241, "name": "REVERT", "source": 0 }, + { + "begin": 140, + "end": 241, + "name": "tag", + "source": 0, + "value": "1" + }, + { "begin": 140, "end": 241, "name": "JUMPDEST", "source": 0 }, + { "begin": 140, "end": 241, "name": "POP", "source": 0 }, + { "begin": 179, "end": 193, "name": "GASLIMIT", "source": 0 }, + { + "begin": 168, + "end": 176, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 168, "end": 193, "name": "DUP2", "source": 0 }, + { "begin": 168, "end": 193, "name": "SWAP1", "source": 0 }, + { "begin": 168, "end": 193, "name": "SSTORE", "source": 0 }, + { "begin": 168, "end": 193, "name": "POP", "source": 0 }, + { "begin": 217, "end": 230, "name": "CHAINID", "source": 0 }, + { + "begin": 207, + "end": 214, + "name": "PUSH", + "source": 0, + "value": "1" + }, + { "begin": 207, "end": 230, "name": "DUP2", "source": 0 }, + { "begin": 207, "end": 230, "name": "SWAP1", "source": 0 }, + { "begin": 207, "end": 230, "name": "SSTORE", "source": 0 }, + { "begin": 207, "end": 230, "name": "POP", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 34, "end": 247, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 247, "name": "CODECOPY", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 247, "name": "RETURN", "source": 0 } + ], + ".data": { + "0": { + ".auxdata": "a26469706673582212201136ea9ac4990168309c87ec471a816249514c19e92015b2c4f0494707d420bf64736f6c63430008030033", + ".code": [ + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 247, "name": "MSTORE", "source": 0 }, + { "begin": 34, "end": 247, "name": "CALLVALUE", "source": 0 }, + { "begin": 34, "end": 247, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 247, "name": "ISZERO", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 34, "end": 247, "name": "JUMPI", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 247, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 247, "name": "REVERT", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "tag", + "source": 0, + "value": "1" + }, + { "begin": 34, "end": 247, "name": "JUMPDEST", "source": 0 }, + { "begin": 34, "end": 247, "name": "POP", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 34, "end": 247, "name": "CALLDATASIZE", "source": 0 }, + { "begin": 34, "end": 247, "name": "LT", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH [tag]", + "source": 0, + "value": "2" + }, + { "begin": 34, "end": 247, "name": "JUMPI", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 247, "name": "CALLDATALOAD", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "E0" + }, + { "begin": 34, "end": 247, "name": "SHR", "source": 0 }, + { "begin": 34, "end": 247, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "2A722839" + }, + { "begin": 34, "end": 247, "name": "EQ", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH [tag]", + "source": 0, + "value": "3" + }, + { "begin": 34, "end": 247, "name": "JUMPI", "source": 0 }, + { "begin": 34, "end": 247, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "CD84980E" + }, + { "begin": 34, "end": 247, "name": "EQ", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH [tag]", + "source": 0, + "value": "4" + }, + { "begin": 34, "end": 247, "name": "JUMPI", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "tag", + "source": 0, + "value": "2" + }, + { "begin": 34, "end": 247, "name": "JUMPDEST", "source": 0 }, + { + "begin": 34, + "end": 247, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 247, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 247, "name": "REVERT", "source": 0 }, + { + "begin": 72, + "end": 92, + "name": "tag", + "source": 0, + "value": "3" + }, + { "begin": 72, "end": 92, "name": "JUMPDEST", "source": 0 }, + { + "begin": 72, + "end": 92, + "name": "PUSH [tag]", + "source": 0, + "value": "5" + }, + { + "begin": 72, + "end": 92, + "name": "PUSH [tag]", + "source": 0, + "value": "6" + }, + { + "begin": 72, + "end": 92, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 72, + "end": 92, + "name": "tag", + "source": 0, + "value": "5" + }, + { "begin": 72, "end": 92, "name": "JUMPDEST", "source": 0 }, + { + "begin": 72, + "end": 92, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 72, "end": 92, "name": "MLOAD", "source": 0 }, + { + "begin": 72, + "end": 92, + "name": "PUSH [tag]", + "source": 0, + "value": "7" + }, + { "begin": 72, "end": 92, "name": "SWAP2", "source": 0 }, + { "begin": 72, "end": 92, "name": "SWAP1", "source": 0 }, + { + "begin": 72, + "end": 92, + "name": "PUSH [tag]", + "source": 0, + "value": "8" + }, + { + "begin": 72, + "end": 92, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 72, + "end": 92, + "name": "tag", + "source": 0, + "value": "7" + }, + { "begin": 72, "end": 92, "name": "JUMPDEST", "source": 0 }, + { + "begin": 72, + "end": 92, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 72, "end": 92, "name": "MLOAD", "source": 0 }, + { "begin": 72, "end": 92, "name": "DUP1", "source": 0 }, + { "begin": 72, "end": 92, "name": "SWAP2", "source": 0 }, + { "begin": 72, "end": 92, "name": "SUB", "source": 0 }, + { "begin": 72, "end": 92, "name": "SWAP1", "source": 0 }, + { "begin": 72, "end": 92, "name": "RETURN", "source": 0 }, + { + "begin": 102, + "end": 121, + "name": "tag", + "source": 0, + "value": "4" + }, + { "begin": 102, "end": 121, "name": "JUMPDEST", "source": 0 }, + { + "begin": 102, + "end": 121, + "name": "PUSH [tag]", + "source": 0, + "value": "9" + }, + { + "begin": 102, + "end": 121, + "name": "PUSH [tag]", + "source": 0, + "value": "10" + }, + { + "begin": 102, + "end": 121, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 102, + "end": 121, + "name": "tag", + "source": 0, + "value": "9" + }, + { "begin": 102, "end": 121, "name": "JUMPDEST", "source": 0 }, + { + "begin": 102, + "end": 121, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 102, "end": 121, "name": "MLOAD", "source": 0 }, + { + "begin": 102, + "end": 121, + "name": "PUSH [tag]", + "source": 0, + "value": "11" + }, + { "begin": 102, "end": 121, "name": "SWAP2", "source": 0 }, + { "begin": 102, "end": 121, "name": "SWAP1", "source": 0 }, + { + "begin": 102, + "end": 121, + "name": "PUSH [tag]", + "source": 0, + "value": "8" + }, + { + "begin": 102, + "end": 121, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 102, + "end": 121, + "name": "tag", + "source": 0, + "value": "11" + }, + { "begin": 102, "end": 121, "name": "JUMPDEST", "source": 0 }, + { + "begin": 102, + "end": 121, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 102, "end": 121, "name": "MLOAD", "source": 0 }, + { "begin": 102, "end": 121, "name": "DUP1", "source": 0 }, + { "begin": 102, "end": 121, "name": "SWAP2", "source": 0 }, + { "begin": 102, "end": 121, "name": "SUB", "source": 0 }, + { "begin": 102, "end": 121, "name": "SWAP1", "source": 0 }, + { "begin": 102, "end": 121, "name": "RETURN", "source": 0 }, + { + "begin": 72, + "end": 92, + "name": "tag", + "source": 0, + "value": "6" + }, + { "begin": 72, "end": 92, "name": "JUMPDEST", "source": 0 }, + { + "begin": 72, + "end": 92, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 72, "end": 92, "name": "SLOAD", "source": 0 }, + { "begin": 72, "end": 92, "name": "DUP2", "source": 0 }, + { + "begin": 72, + "end": 92, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { + "begin": 102, + "end": 121, + "name": "tag", + "source": 0, + "value": "10" + }, + { "begin": 102, "end": 121, "name": "JUMPDEST", "source": 0 }, + { + "begin": 102, + "end": 121, + "name": "PUSH", + "source": 0, + "value": "1" + }, + { "begin": 102, "end": 121, "name": "SLOAD", "source": 0 }, + { "begin": 102, "end": 121, "name": "DUP2", "source": 0 }, + { + "begin": 102, + "end": 121, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { + "begin": 7, + "end": 125, + "name": "tag", + "source": 1, + "value": "13" + }, + { "begin": 7, "end": 125, "name": "JUMPDEST", "source": 1 }, + { + "begin": 94, + "end": 118, + "name": "PUSH [tag]", + "source": 1, + "value": "15" + }, + { "begin": 112, "end": 117, "name": "DUP2", "source": 1 }, + { + "begin": 94, + "end": 118, + "name": "PUSH [tag]", + "source": 1, + "value": "16" + }, + { + "begin": 94, + "end": 118, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 94, + "end": 118, + "name": "tag", + "source": 1, + "value": "15" + }, + { "begin": 94, "end": 118, "name": "JUMPDEST", "source": 1 }, + { "begin": 89, "end": 92, "name": "DUP3", "source": 1 }, + { "begin": 82, "end": 119, "name": "MSTORE", "source": 1 }, + { "begin": 72, "end": 125, "name": "POP", "source": 1 }, + { "begin": 72, "end": 125, "name": "POP", "source": 1 }, + { + "begin": 72, + "end": 125, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 131, + "end": 353, + "name": "tag", + "source": 1, + "value": "8" + }, + { "begin": 131, "end": 353, "name": "JUMPDEST", "source": 1 }, + { + "begin": 131, + "end": 353, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 262, + "end": 264, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 251, "end": 260, "name": "DUP3", "source": 1 }, + { "begin": 247, "end": 265, "name": "ADD", "source": 1 }, + { "begin": 239, "end": 265, "name": "SWAP1", "source": 1 }, + { "begin": 239, "end": 265, "name": "POP", "source": 1 }, + { + "begin": 275, + "end": 346, + "name": "PUSH [tag]", + "source": 1, + "value": "18" + }, + { + "begin": 343, + "end": 344, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 332, "end": 341, "name": "DUP4", "source": 1 }, + { "begin": 328, "end": 345, "name": "ADD", "source": 1 }, + { "begin": 319, "end": 325, "name": "DUP5", "source": 1 }, + { + "begin": 275, + "end": 346, + "name": "PUSH [tag]", + "source": 1, + "value": "13" + }, + { + "begin": 275, + "end": 346, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 275, + "end": 346, + "name": "tag", + "source": 1, + "value": "18" + }, + { "begin": 275, "end": 346, "name": "JUMPDEST", "source": 1 }, + { "begin": 229, "end": 353, "name": "SWAP3", "source": 1 }, + { "begin": 229, "end": 353, "name": "SWAP2", "source": 1 }, + { "begin": 229, "end": 353, "name": "POP", "source": 1 }, + { "begin": 229, "end": 353, "name": "POP", "source": 1 }, + { + "begin": 229, + "end": 353, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 359, + "end": 436, + "name": "tag", + "source": 1, + "value": "16" + }, + { "begin": 359, "end": 436, "name": "JUMPDEST", "source": 1 }, + { + "begin": 359, + "end": 436, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 425, "end": 430, "name": "DUP2", "source": 1 }, + { "begin": 414, "end": 430, "name": "SWAP1", "source": 1 }, + { "begin": 414, "end": 430, "name": "POP", "source": 1 }, + { "begin": 404, "end": 436, "name": "SWAP2", "source": 1 }, + { "begin": 404, "end": 436, "name": "SWAP1", "source": 1 }, + { "begin": 404, "end": 436, "name": "POP", "source": 1 }, + { + "begin": 404, + "end": 436, + "name": "JUMP", + "source": 1, + "value": "[out]" + } + ] + } + } + }, + "methodIdentifiers": { "chainid()": "cd84980e", "gaslimit()": "2a722839" } + }, + "ewasm": { "wasm": "" }, + "metadata": "{\"compiler\":{\"version\":\"0.8.3+commit.8d00100c\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"chainid\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gaslimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"main.sol\":\"CheckBlockGasLimit\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"main.sol\":{\"keccak256\":\"0xe16991d1ac8979785b9384734bad8c5fc38fe331a7caa57382eaf1d5521736fa\",\"urls\":[\"bzz-raw://e44d7c722b24944590846825e0601b50fcebe64308be41756cb69bb69182e687\",\"dweb:/ipfs/QmR1ycByAGDhBGBMAn2enQANLicVYpX7H3Ch9PwWKQNPjL\"]}},\"version\":1}", + "storageLayout": { + "storage": [ + { + "astId": 3, + "contract": "main.sol:CheckBlockGasLimit", + "label": "gaslimit", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 5, + "contract": "main.sol:CheckBlockGasLimit", + "label": "chainid", + "offset": 0, + "slot": "1", + "type": "t_uint256" + } + ], + "types": { + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + }, + "userdoc": { "kind": "user", "methods": {}, "version": 1 } + }, + "sourceCode": "\n pragma solidity >=0.8.0;\n contract CheckBlockGasLimit {\n uint public gaslimit;\n uint public chainid;\n \n constructor() {\n gaslimit = block.gaslimit;\n chainid = block.chainid;\n }\n }" +} diff --git a/tests/contracts/compiled/FailContract.json b/tests/contracts/compiled/FailContract.json new file mode 100644 index 00000000000..40314e99f59 --- /dev/null +++ b/tests/contracts/compiled/FailContract.json @@ -0,0 +1,176 @@ +{ + "byteCode": "0x6080604052348015600f57600080fd5b506000601a57600080fd5b603f8060276000396000f3fe6080604052600080fdfea26469706673582212207b68e132fa347c6e3b45db840e591ea6fac483da22d192aabb59494b63a4c1a564736f6c63430008030033", + "contract": { + "abi": [ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" } + ], + "devdoc": { "kind": "dev", "methods": {}, "version": 1 }, + "evm": { + "assembly": " /* \"main.sol\":39:137 contract FailContract {... */\n mstore(0x40, 0x80)\n /* \"main.sol\":71:131 constructor() public {... */\n callvalue\n dup1\n iszero\n tag_1\n jumpi\n 0x00\n dup1\n revert\ntag_1:\n pop\n /* \"main.sol\":114:119 false */\n 0x00\n /* \"main.sol\":106:120 require(false) */\n tag_4\n jumpi\n 0x00\n dup1\n revert\ntag_4:\n /* \"main.sol\":39:137 contract FailContract {... */\n dataSize(sub_0)\n dup1\n dataOffset(sub_0)\n 0x00\n codecopy\n 0x00\n return\nstop\n\nsub_0: assembly {\n /* \"main.sol\":39:137 contract FailContract {... */\n mstore(0x40, 0x80)\n 0x00\n dup1\n revert\n\n auxdata: 0xa26469706673582212207b68e132fa347c6e3b45db840e591ea6fac483da22d192aabb59494b63a4c1a564736f6c63430008030033\n}\n", + "bytecode": { + "generatedSources": [], + "linkReferences": {}, + "object": "6080604052348015600f57600080fd5b506000601a57600080fd5b603f8060276000396000f3fe6080604052600080fdfea26469706673582212207b68e132fa347c6e3b45db840e591ea6fac483da22d192aabb59494b63a4c1a564736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x0 PUSH1 0x1A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3F DUP1 PUSH1 0x27 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PUSH28 0x68E132FA347C6E3B45DB840E591EA6FAC483DA22D192AABB59494B63 LOG4 0xC1 0xA5 PUSH5 0x736F6C6343 STOP ADDMOD SUB STOP CALLER ", + "sourceMap": "39:98:0:-:0;;;71:60;;;;;;;;;;114:5;106:14;;;;;;39:98;;;;;;" + }, + "deployedBytecode": { + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "6080604052600080fdfea26469706673582212207b68e132fa347c6e3b45db840e591ea6fac483da22d192aabb59494b63a4c1a564736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PUSH28 0x68E132FA347C6E3B45DB840E591EA6FAC483DA22D192AABB59494B63 LOG4 0xC1 0xA5 PUSH5 0x736F6C6343 STOP ADDMOD SUB STOP CALLER ", + "sourceMap": "39:98:0:-:0;;;;;" + }, + "gasEstimates": { + "creation": { + "codeDepositCost": "12600", + "executionCost": "64", + "totalCost": "12664" + } + }, + "legacyAssembly": { + ".code": [ + { + "begin": 39, + "end": 137, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 39, + "end": 137, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 39, "end": 137, "name": "MSTORE", "source": 0 }, + { "begin": 71, "end": 131, "name": "CALLVALUE", "source": 0 }, + { "begin": 71, "end": 131, "name": "DUP1", "source": 0 }, + { "begin": 71, "end": 131, "name": "ISZERO", "source": 0 }, + { + "begin": 71, + "end": 131, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 71, "end": 131, "name": "JUMPI", "source": 0 }, + { + "begin": 71, + "end": 131, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 71, "end": 131, "name": "DUP1", "source": 0 }, + { "begin": 71, "end": 131, "name": "REVERT", "source": 0 }, + { "begin": 71, "end": 131, "name": "tag", "source": 0, "value": "1" }, + { "begin": 71, "end": 131, "name": "JUMPDEST", "source": 0 }, + { "begin": 71, "end": 131, "name": "POP", "source": 0 }, + { + "begin": 114, + "end": 119, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { + "begin": 106, + "end": 120, + "name": "PUSH [tag]", + "source": 0, + "value": "4" + }, + { "begin": 106, "end": 120, "name": "JUMPI", "source": 0 }, + { + "begin": 106, + "end": 120, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 106, "end": 120, "name": "DUP1", "source": 0 }, + { "begin": 106, "end": 120, "name": "REVERT", "source": 0 }, + { + "begin": 106, + "end": 120, + "name": "tag", + "source": 0, + "value": "4" + }, + { "begin": 106, "end": 120, "name": "JUMPDEST", "source": 0 }, + { + "begin": 39, + "end": 137, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 39, "end": 137, "name": "DUP1", "source": 0 }, + { + "begin": 39, + "end": 137, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 39, + "end": 137, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 137, "name": "CODECOPY", "source": 0 }, + { + "begin": 39, + "end": 137, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 137, "name": "RETURN", "source": 0 } + ], + ".data": { + "0": { + ".auxdata": "a26469706673582212207b68e132fa347c6e3b45db840e591ea6fac483da22d192aabb59494b63a4c1a564736f6c63430008030033", + ".code": [ + { + "begin": 39, + "end": 137, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 39, + "end": 137, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 39, "end": 137, "name": "MSTORE", "source": 0 }, + { + "begin": 39, + "end": 137, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 137, "name": "DUP1", "source": 0 }, + { "begin": 39, "end": 137, "name": "REVERT", "source": 0 } + ] + } + } + }, + "methodIdentifiers": {} + }, + "ewasm": { "wasm": "" }, + "metadata": "{\"compiler\":{\"version\":\"0.8.3+commit.8d00100c\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"main.sol\":\"FailContract\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"main.sol\":{\"keccak256\":\"0x4de9ab93b7ba7a82d8e58a903a5a297b8a8dc5263369657b062496782a5a51e9\",\"urls\":[\"bzz-raw://70e08b1c0fff16d5982491d2b46221465b0094cd251f991786aa1ca409f6c431\",\"dweb:/ipfs/QmVc7Qm8cNSUa4CrQhPtuSUJndczcDARrLoYc4z1CCuJ3m\"]}},\"version\":1}", + "storageLayout": { "storage": [], "types": null }, + "userdoc": { "kind": "user", "methods": {}, "version": 1 } + }, + "sourceCode": "\n pragma solidity >=0.8.0;\n \n contract FailContract {\n constructor() public {\n require(false);\n }\n }" +} diff --git a/tests/contracts/compiled/FiniteLoopContract.json b/tests/contracts/compiled/FiniteLoopContract.json new file mode 100644 index 00000000000..723b6f0796c --- /dev/null +++ b/tests/contracts/compiled/FiniteLoopContract.json @@ -0,0 +1,2128 @@ +{ + "byteCode": "0x608060405234801561001057600080fd5b50600080819055506101f7806100276000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806306661abd1461003b57806321b13c4814610059575b600080fd5b610043610075565b6040516100509190610100565b60405180910390f35b610073600480360381019061006e91906100c8565b61007b565b005b60005481565b60005b818110156100af576001600054610095919061011b565b6000819055506001816100a8919061011b565b905061007e565b5050565b6000813590506100c2816101aa565b92915050565b6000602082840312156100da57600080fd5b60006100e8848285016100b3565b91505092915050565b6100fa81610171565b82525050565b600060208201905061011560008301846100f1565b92915050565b600061012682610171565b915061013183610171565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156101665761016561017b565b5b828201905092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6101b381610171565b81146101be57600080fd5b5056fea2646970667358221220ce01b190f7cc227810064e794c9f0944d297e9623609a22ec42a53f82b63521b64736f6c63430008030033", + "contract": { + "abi": [ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, + { + "inputs": [], + "name": "count", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "n", "type": "uint256" } + ], + "name": "incr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "devdoc": { "kind": "dev", "methods": {}, "version": 1 }, + "evm": { + "assembly": " /* \"main.sol\":39:339 contract FiniteLoopContract {... */\n mstore(0x40, 0x80)\n /* \"main.sol\":109:164 constructor() public {... */\n callvalue\n dup1\n iszero\n tag_1\n jumpi\n 0x00\n dup1\n revert\ntag_1:\n pop\n /* \"main.sol\":152:153 0 */\n 0x00\n /* \"main.sol\":144:149 count */\n dup1\n /* \"main.sol\":144:153 count = 0 */\n dup2\n swap1\n sstore\n pop\n /* \"main.sol\":39:339 contract FiniteLoopContract {... */\n dataSize(sub_0)\n dup1\n dataOffset(sub_0)\n 0x00\n codecopy\n 0x00\n return\nstop\n\nsub_0: assembly {\n /* \"main.sol\":39:339 contract FiniteLoopContract {... */\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 0x06661abd\n eq\n tag_3\n jumpi\n dup1\n 0x21b13c48\n eq\n tag_4\n jumpi\n tag_2:\n 0x00\n dup1\n revert\n /* \"main.sol\":77:94 uint public count */\n tag_3:\n tag_5\n tag_6\n jump\t// in\n tag_5:\n mload(0x40)\n tag_7\n swap2\n swap1\n tag_8\n jump\t// in\n tag_7:\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n return\n /* \"main.sol\":178:333 function incr(uint n) public {... */\n tag_4:\n tag_9\n 0x04\n dup1\n calldatasize\n sub\n dup2\n add\n swap1\n tag_10\n swap2\n swap1\n tag_11\n jump\t// in\n tag_10:\n tag_12\n jump\t// in\n tag_9:\n stop\n /* \"main.sol\":77:94 uint public count */\n tag_6:\n sload(0x00)\n dup2\n jump\t// out\n /* \"main.sol\":178:333 function incr(uint n) public {... */\n tag_12:\n /* \"main.sol\":221:227 uint i */\n 0x00\n /* \"main.sol\":243:323 while (i 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(0, 0) }\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 function checked_add_t_uint256(x, y) -> sum {\n x := cleanup_t_uint256(x)\n y := cleanup_t_uint256(y)\n\n // overflow, if x > (maxValue - y)\n if gt(x, sub(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, y)) { panic_error_0x11() }\n\n sum := add(x, y)\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function panic_error_0x11() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n\n function validator_revert_t_uint256(value) {\n if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }\n }\n\n}\n", + "id": 1, + "language": "Yul", + "name": "#utility.yul" + } + ], + "immutableReferences": {}, + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b50600436106100365760003560e01c806306661abd1461003b57806321b13c4814610059575b600080fd5b610043610075565b6040516100509190610100565b60405180910390f35b610073600480360381019061006e91906100c8565b61007b565b005b60005481565b60005b818110156100af576001600054610095919061011b565b6000819055506001816100a8919061011b565b905061007e565b5050565b6000813590506100c2816101aa565b92915050565b6000602082840312156100da57600080fd5b60006100e8848285016100b3565b91505092915050565b6100fa81610171565b82525050565b600060208201905061011560008301846100f1565b92915050565b600061012682610171565b915061013183610171565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156101665761016561017b565b5b828201905092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6101b381610171565b81146101be57600080fd5b5056fea2646970667358221220ce01b190f7cc227810064e794c9f0944d297e9623609a22ec42a53f82b63521b64736f6c63430008030033", + "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 0x6661ABD EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x21B13C48 EQ PUSH2 0x59 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x75 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x50 SWAP2 SWAP1 PUSH2 0x100 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x73 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x6E SWAP2 SWAP1 PUSH2 0xC8 JUMP JUMPDEST PUSH2 0x7B JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0xAF JUMPI PUSH1 0x1 PUSH1 0x0 SLOAD PUSH2 0x95 SWAP2 SWAP1 PUSH2 0x11B JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 SSTORE POP PUSH1 0x1 DUP2 PUSH2 0xA8 SWAP2 SWAP1 PUSH2 0x11B JUMP JUMPDEST SWAP1 POP PUSH2 0x7E JUMP JUMPDEST POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xC2 DUP2 PUSH2 0x1AA JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xDA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0xE8 DUP5 DUP3 DUP6 ADD PUSH2 0xB3 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0xFA DUP2 PUSH2 0x171 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x115 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0xF1 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x126 DUP3 PUSH2 0x171 JUMP JUMPDEST SWAP2 POP PUSH2 0x131 DUP4 PUSH2 0x171 JUMP JUMPDEST SWAP3 POP DUP3 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SUB DUP3 GT ISZERO PUSH2 0x166 JUMPI PUSH2 0x165 PUSH2 0x17B JUMP JUMPDEST JUMPDEST DUP3 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH2 0x1B3 DUP2 PUSH2 0x171 JUMP JUMPDEST DUP2 EQ PUSH2 0x1BE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xCE ADD 0xB1 SWAP1 0xF7 0xCC 0x22 PUSH25 0x10064E794C9F0944D297E9623609A22EC42A53F82B63521B64 PUSH20 0x6F6C634300080300330000000000000000000000 ", + "sourceMap": "39:300:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;77:17;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;178:155;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;77:17;;;;:::o;178:155::-;221:6;243:80;252:1;250;:3;243:80;;;285:1;279:5;;:7;;;;:::i;:::-;273:5;:13;;;;307:1;304:4;;;;;:::i;:::-;;;243:80;;;178:155;;:::o;7:139:1:-;;91:6;78:20;69:29;;107:33;134:5;107:33;:::i;:::-;59:87;;;;:::o;152:262::-;;260:2;248:9;239:7;235:23;231:32;228:2;;;276:1;273;266:12;228:2;319:1;344:53;389:7;380:6;369:9;365:22;344:53;:::i;:::-;334:63;;290:117;218:196;;;;:::o;420:118::-;507:24;525:5;507:24;:::i;:::-;502:3;495:37;485:53;;:::o;544:222::-;;675:2;664:9;660:18;652:26;;688:71;756:1;745:9;741:17;732:6;688:71;:::i;:::-;642:124;;;;:::o;772:305::-;;831:20;849:1;831:20;:::i;:::-;826:25;;865:20;883:1;865:20;:::i;:::-;860:25;;1019:1;951:66;947:74;944:1;941:81;938:2;;;1025:18;;:::i;:::-;938:2;1069:1;1066;1062:9;1055:16;;816:261;;;;:::o;1083:77::-;;1149:5;1138:16;;1128:32;;;:::o;1166:180::-;1214:77;1211:1;1204:88;1311:4;1308:1;1301:15;1335:4;1332:1;1325:15;1352:122;1425:24;1443:5;1425:24;:::i;:::-;1418:5;1415:35;1405:2;;1464:1;1461;1454:12;1405:2;1395:79;:::o" + }, + "gasEstimates": { + "creation": { + "codeDepositCost": "100600", + "executionCost": "5161", + "totalCost": "105761" + }, + "external": { "count()": "1107", "incr(uint256)": "infinite" } + }, + "legacyAssembly": { + ".code": [ + { + "begin": 39, + "end": 339, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 39, + "end": 339, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 39, "end": 339, "name": "MSTORE", "source": 0 }, + { "begin": 109, "end": 164, "name": "CALLVALUE", "source": 0 }, + { "begin": 109, "end": 164, "name": "DUP1", "source": 0 }, + { "begin": 109, "end": 164, "name": "ISZERO", "source": 0 }, + { + "begin": 109, + "end": 164, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 109, "end": 164, "name": "JUMPI", "source": 0 }, + { + "begin": 109, + "end": 164, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 109, "end": 164, "name": "DUP1", "source": 0 }, + { "begin": 109, "end": 164, "name": "REVERT", "source": 0 }, + { + "begin": 109, + "end": 164, + "name": "tag", + "source": 0, + "value": "1" + }, + { "begin": 109, "end": 164, "name": "JUMPDEST", "source": 0 }, + { "begin": 109, "end": 164, "name": "POP", "source": 0 }, + { + "begin": 152, + "end": 153, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 144, "end": 149, "name": "DUP1", "source": 0 }, + { "begin": 144, "end": 153, "name": "DUP2", "source": 0 }, + { "begin": 144, "end": 153, "name": "SWAP1", "source": 0 }, + { "begin": 144, "end": 153, "name": "SSTORE", "source": 0 }, + { "begin": 144, "end": 153, "name": "POP", "source": 0 }, + { + "begin": 39, + "end": 339, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 39, "end": 339, "name": "DUP1", "source": 0 }, + { + "begin": 39, + "end": 339, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 39, + "end": 339, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 339, "name": "CODECOPY", "source": 0 }, + { + "begin": 39, + "end": 339, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 339, "name": "RETURN", "source": 0 } + ], + ".data": { + "0": { + ".auxdata": "a2646970667358221220ce01b190f7cc227810064e794c9f0944d297e9623609a22ec42a53f82b63521b64736f6c63430008030033", + ".code": [ + { + "begin": 39, + "end": 339, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 39, + "end": 339, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 39, "end": 339, "name": "MSTORE", "source": 0 }, + { "begin": 39, "end": 339, "name": "CALLVALUE", "source": 0 }, + { "begin": 39, "end": 339, "name": "DUP1", "source": 0 }, + { "begin": 39, "end": 339, "name": "ISZERO", "source": 0 }, + { + "begin": 39, + "end": 339, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 39, "end": 339, "name": "JUMPI", "source": 0 }, + { + "begin": 39, + "end": 339, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 339, "name": "DUP1", "source": 0 }, + { "begin": 39, "end": 339, "name": "REVERT", "source": 0 }, + { + "begin": 39, + "end": 339, + "name": "tag", + "source": 0, + "value": "1" + }, + { "begin": 39, "end": 339, "name": "JUMPDEST", "source": 0 }, + { "begin": 39, "end": 339, "name": "POP", "source": 0 }, + { + "begin": 39, + "end": 339, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 39, "end": 339, "name": "CALLDATASIZE", "source": 0 }, + { "begin": 39, "end": 339, "name": "LT", "source": 0 }, + { + "begin": 39, + "end": 339, + "name": "PUSH [tag]", + "source": 0, + "value": "2" + }, + { "begin": 39, "end": 339, "name": "JUMPI", "source": 0 }, + { + "begin": 39, + "end": 339, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 339, "name": "CALLDATALOAD", "source": 0 }, + { + "begin": 39, + "end": 339, + "name": "PUSH", + "source": 0, + "value": "E0" + }, + { "begin": 39, "end": 339, "name": "SHR", "source": 0 }, + { "begin": 39, "end": 339, "name": "DUP1", "source": 0 }, + { + "begin": 39, + "end": 339, + "name": "PUSH", + "source": 0, + "value": "6661ABD" + }, + { "begin": 39, "end": 339, "name": "EQ", "source": 0 }, + { + "begin": 39, + "end": 339, + "name": "PUSH [tag]", + "source": 0, + "value": "3" + }, + { "begin": 39, "end": 339, "name": "JUMPI", "source": 0 }, + { "begin": 39, "end": 339, "name": "DUP1", "source": 0 }, + { + "begin": 39, + "end": 339, + "name": "PUSH", + "source": 0, + "value": "21B13C48" + }, + { "begin": 39, "end": 339, "name": "EQ", "source": 0 }, + { + "begin": 39, + "end": 339, + "name": "PUSH [tag]", + "source": 0, + "value": "4" + }, + { "begin": 39, "end": 339, "name": "JUMPI", "source": 0 }, + { + "begin": 39, + "end": 339, + "name": "tag", + "source": 0, + "value": "2" + }, + { "begin": 39, "end": 339, "name": "JUMPDEST", "source": 0 }, + { + "begin": 39, + "end": 339, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 339, "name": "DUP1", "source": 0 }, + { "begin": 39, "end": 339, "name": "REVERT", "source": 0 }, + { + "begin": 77, + "end": 94, + "name": "tag", + "source": 0, + "value": "3" + }, + { "begin": 77, "end": 94, "name": "JUMPDEST", "source": 0 }, + { + "begin": 77, + "end": 94, + "name": "PUSH [tag]", + "source": 0, + "value": "5" + }, + { + "begin": 77, + "end": 94, + "name": "PUSH [tag]", + "source": 0, + "value": "6" + }, + { + "begin": 77, + "end": 94, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 77, + "end": 94, + "name": "tag", + "source": 0, + "value": "5" + }, + { "begin": 77, "end": 94, "name": "JUMPDEST", "source": 0 }, + { + "begin": 77, + "end": 94, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 77, "end": 94, "name": "MLOAD", "source": 0 }, + { + "begin": 77, + "end": 94, + "name": "PUSH [tag]", + "source": 0, + "value": "7" + }, + { "begin": 77, "end": 94, "name": "SWAP2", "source": 0 }, + { "begin": 77, "end": 94, "name": "SWAP1", "source": 0 }, + { + "begin": 77, + "end": 94, + "name": "PUSH [tag]", + "source": 0, + "value": "8" + }, + { + "begin": 77, + "end": 94, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 77, + "end": 94, + "name": "tag", + "source": 0, + "value": "7" + }, + { "begin": 77, "end": 94, "name": "JUMPDEST", "source": 0 }, + { + "begin": 77, + "end": 94, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 77, "end": 94, "name": "MLOAD", "source": 0 }, + { "begin": 77, "end": 94, "name": "DUP1", "source": 0 }, + { "begin": 77, "end": 94, "name": "SWAP2", "source": 0 }, + { "begin": 77, "end": 94, "name": "SUB", "source": 0 }, + { "begin": 77, "end": 94, "name": "SWAP1", "source": 0 }, + { "begin": 77, "end": 94, "name": "RETURN", "source": 0 }, + { + "begin": 178, + "end": 333, + "name": "tag", + "source": 0, + "value": "4" + }, + { "begin": 178, "end": 333, "name": "JUMPDEST", "source": 0 }, + { + "begin": 178, + "end": 333, + "name": "PUSH [tag]", + "source": 0, + "value": "9" + }, + { + "begin": 178, + "end": 333, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 178, "end": 333, "name": "DUP1", "source": 0 }, + { "begin": 178, "end": 333, "name": "CALLDATASIZE", "source": 0 }, + { "begin": 178, "end": 333, "name": "SUB", "source": 0 }, + { "begin": 178, "end": 333, "name": "DUP2", "source": 0 }, + { "begin": 178, "end": 333, "name": "ADD", "source": 0 }, + { "begin": 178, "end": 333, "name": "SWAP1", "source": 0 }, + { + "begin": 178, + "end": 333, + "name": "PUSH [tag]", + "source": 0, + "value": "10" + }, + { "begin": 178, "end": 333, "name": "SWAP2", "source": 0 }, + { "begin": 178, "end": 333, "name": "SWAP1", "source": 0 }, + { + "begin": 178, + "end": 333, + "name": "PUSH [tag]", + "source": 0, + "value": "11" + }, + { + "begin": 178, + "end": 333, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 178, + "end": 333, + "name": "tag", + "source": 0, + "value": "10" + }, + { "begin": 178, "end": 333, "name": "JUMPDEST", "source": 0 }, + { + "begin": 178, + "end": 333, + "name": "PUSH [tag]", + "source": 0, + "value": "12" + }, + { + "begin": 178, + "end": 333, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 178, + "end": 333, + "name": "tag", + "source": 0, + "value": "9" + }, + { "begin": 178, "end": 333, "name": "JUMPDEST", "source": 0 }, + { "begin": 178, "end": 333, "name": "STOP", "source": 0 }, + { + "begin": 77, + "end": 94, + "name": "tag", + "source": 0, + "value": "6" + }, + { "begin": 77, "end": 94, "name": "JUMPDEST", "source": 0 }, + { + "begin": 77, + "end": 94, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 77, "end": 94, "name": "SLOAD", "source": 0 }, + { "begin": 77, "end": 94, "name": "DUP2", "source": 0 }, + { + "begin": 77, + "end": 94, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { + "begin": 178, + "end": 333, + "name": "tag", + "source": 0, + "value": "12" + }, + { "begin": 178, "end": 333, "name": "JUMPDEST", "source": 0 }, + { + "begin": 221, + "end": 227, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { + "begin": 243, + "end": 323, + "name": "tag", + "source": 0, + "value": "14" + }, + { "begin": 243, "end": 323, "name": "JUMPDEST", "source": 0 }, + { "begin": 252, "end": 253, "name": "DUP2", "source": 0 }, + { "begin": 250, "end": 251, "name": "DUP2", "source": 0 }, + { "begin": 250, "end": 253, "name": "LT", "source": 0 }, + { "begin": 243, "end": 323, "name": "ISZERO", "source": 0 }, + { + "begin": 243, + "end": 323, + "name": "PUSH [tag]", + "source": 0, + "value": "15" + }, + { "begin": 243, "end": 323, "name": "JUMPI", "source": 0 }, + { + "begin": 285, + "end": 286, + "name": "PUSH", + "source": 0, + "value": "1" + }, + { + "begin": 279, + "end": 284, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 279, "end": 284, "name": "SLOAD", "source": 0 }, + { + "begin": 279, + "end": 286, + "name": "PUSH [tag]", + "source": 0, + "value": "16" + }, + { "begin": 279, "end": 286, "name": "SWAP2", "source": 0 }, + { "begin": 279, "end": 286, "name": "SWAP1", "source": 0 }, + { + "begin": 279, + "end": 286, + "name": "PUSH [tag]", + "source": 0, + "value": "17" + }, + { + "begin": 279, + "end": 286, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 279, + "end": 286, + "name": "tag", + "source": 0, + "value": "16" + }, + { "begin": 279, "end": 286, "name": "JUMPDEST", "source": 0 }, + { + "begin": 273, + "end": 278, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 273, "end": 286, "name": "DUP2", "source": 0 }, + { "begin": 273, "end": 286, "name": "SWAP1", "source": 0 }, + { "begin": 273, "end": 286, "name": "SSTORE", "source": 0 }, + { "begin": 273, "end": 286, "name": "POP", "source": 0 }, + { + "begin": 307, + "end": 308, + "name": "PUSH", + "source": 0, + "value": "1" + }, + { "begin": 304, "end": 308, "name": "DUP2", "source": 0 }, + { + "begin": 304, + "end": 308, + "name": "PUSH [tag]", + "source": 0, + "value": "18" + }, + { "begin": 304, "end": 308, "name": "SWAP2", "source": 0 }, + { "begin": 304, "end": 308, "name": "SWAP1", "source": 0 }, + { + "begin": 304, + "end": 308, + "name": "PUSH [tag]", + "source": 0, + "value": "17" + }, + { + "begin": 304, + "end": 308, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 304, + "end": 308, + "name": "tag", + "source": 0, + "value": "18" + }, + { "begin": 304, "end": 308, "name": "JUMPDEST", "source": 0 }, + { "begin": 304, "end": 308, "name": "SWAP1", "source": 0 }, + { "begin": 304, "end": 308, "name": "POP", "source": 0 }, + { + "begin": 243, + "end": 323, + "name": "PUSH [tag]", + "source": 0, + "value": "14" + }, + { "begin": 243, "end": 323, "name": "JUMP", "source": 0 }, + { + "begin": 243, + "end": 323, + "name": "tag", + "source": 0, + "value": "15" + }, + { "begin": 243, "end": 323, "name": "JUMPDEST", "source": 0 }, + { "begin": 178, "end": 333, "name": "POP", "source": 0 }, + { "begin": 178, "end": 333, "name": "POP", "source": 0 }, + { + "begin": 178, + "end": 333, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { + "begin": 7, + "end": 146, + "name": "tag", + "source": 1, + "value": "20" + }, + { "begin": 7, "end": 146, "name": "JUMPDEST", "source": 1 }, + { + "begin": 7, + "end": 146, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 91, "end": 97, "name": "DUP2", "source": 1 }, + { "begin": 78, "end": 98, "name": "CALLDATALOAD", "source": 1 }, + { "begin": 69, "end": 98, "name": "SWAP1", "source": 1 }, + { "begin": 69, "end": 98, "name": "POP", "source": 1 }, + { + "begin": 107, + "end": 140, + "name": "PUSH [tag]", + "source": 1, + "value": "22" + }, + { "begin": 134, "end": 139, "name": "DUP2", "source": 1 }, + { + "begin": 107, + "end": 140, + "name": "PUSH [tag]", + "source": 1, + "value": "23" + }, + { + "begin": 107, + "end": 140, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 107, + "end": 140, + "name": "tag", + "source": 1, + "value": "22" + }, + { "begin": 107, "end": 140, "name": "JUMPDEST", "source": 1 }, + { "begin": 59, "end": 146, "name": "SWAP3", "source": 1 }, + { "begin": 59, "end": 146, "name": "SWAP2", "source": 1 }, + { "begin": 59, "end": 146, "name": "POP", "source": 1 }, + { "begin": 59, "end": 146, "name": "POP", "source": 1 }, + { + "begin": 59, + "end": 146, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 152, + "end": 414, + "name": "tag", + "source": 1, + "value": "11" + }, + { "begin": 152, "end": 414, "name": "JUMPDEST", "source": 1 }, + { + "begin": 152, + "end": 414, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 260, + "end": 262, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 248, "end": 257, "name": "DUP3", "source": 1 }, + { "begin": 239, "end": 246, "name": "DUP5", "source": 1 }, + { "begin": 235, "end": 258, "name": "SUB", "source": 1 }, + { "begin": 231, "end": 263, "name": "SLT", "source": 1 }, + { "begin": 228, "end": 230, "name": "ISZERO", "source": 1 }, + { + "begin": 228, + "end": 230, + "name": "PUSH [tag]", + "source": 1, + "value": "25" + }, + { "begin": 228, "end": 230, "name": "JUMPI", "source": 1 }, + { + "begin": 276, + "end": 277, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 273, "end": 274, "name": "DUP1", "source": 1 }, + { "begin": 266, "end": 278, "name": "REVERT", "source": 1 }, + { + "begin": 228, + "end": 230, + "name": "tag", + "source": 1, + "value": "25" + }, + { "begin": 228, "end": 230, "name": "JUMPDEST", "source": 1 }, + { + "begin": 319, + "end": 320, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 344, + "end": 397, + "name": "PUSH [tag]", + "source": 1, + "value": "26" + }, + { "begin": 389, "end": 396, "name": "DUP5", "source": 1 }, + { "begin": 380, "end": 386, "name": "DUP3", "source": 1 }, + { "begin": 369, "end": 378, "name": "DUP6", "source": 1 }, + { "begin": 365, "end": 387, "name": "ADD", "source": 1 }, + { + "begin": 344, + "end": 397, + "name": "PUSH [tag]", + "source": 1, + "value": "20" + }, + { + "begin": 344, + "end": 397, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 344, + "end": 397, + "name": "tag", + "source": 1, + "value": "26" + }, + { "begin": 344, "end": 397, "name": "JUMPDEST", "source": 1 }, + { "begin": 334, "end": 397, "name": "SWAP2", "source": 1 }, + { "begin": 334, "end": 397, "name": "POP", "source": 1 }, + { "begin": 290, "end": 407, "name": "POP", "source": 1 }, + { "begin": 218, "end": 414, "name": "SWAP3", "source": 1 }, + { "begin": 218, "end": 414, "name": "SWAP2", "source": 1 }, + { "begin": 218, "end": 414, "name": "POP", "source": 1 }, + { "begin": 218, "end": 414, "name": "POP", "source": 1 }, + { + "begin": 218, + "end": 414, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 420, + "end": 538, + "name": "tag", + "source": 1, + "value": "27" + }, + { "begin": 420, "end": 538, "name": "JUMPDEST", "source": 1 }, + { + "begin": 507, + "end": 531, + "name": "PUSH [tag]", + "source": 1, + "value": "29" + }, + { "begin": 525, "end": 530, "name": "DUP2", "source": 1 }, + { + "begin": 507, + "end": 531, + "name": "PUSH [tag]", + "source": 1, + "value": "30" + }, + { + "begin": 507, + "end": 531, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 507, + "end": 531, + "name": "tag", + "source": 1, + "value": "29" + }, + { "begin": 507, "end": 531, "name": "JUMPDEST", "source": 1 }, + { "begin": 502, "end": 505, "name": "DUP3", "source": 1 }, + { "begin": 495, "end": 532, "name": "MSTORE", "source": 1 }, + { "begin": 485, "end": 538, "name": "POP", "source": 1 }, + { "begin": 485, "end": 538, "name": "POP", "source": 1 }, + { + "begin": 485, + "end": 538, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 544, + "end": 766, + "name": "tag", + "source": 1, + "value": "8" + }, + { "begin": 544, "end": 766, "name": "JUMPDEST", "source": 1 }, + { + "begin": 544, + "end": 766, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 675, + "end": 677, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 664, "end": 673, "name": "DUP3", "source": 1 }, + { "begin": 660, "end": 678, "name": "ADD", "source": 1 }, + { "begin": 652, "end": 678, "name": "SWAP1", "source": 1 }, + { "begin": 652, "end": 678, "name": "POP", "source": 1 }, + { + "begin": 688, + "end": 759, + "name": "PUSH [tag]", + "source": 1, + "value": "32" + }, + { + "begin": 756, + "end": 757, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 745, "end": 754, "name": "DUP4", "source": 1 }, + { "begin": 741, "end": 758, "name": "ADD", "source": 1 }, + { "begin": 732, "end": 738, "name": "DUP5", "source": 1 }, + { + "begin": 688, + "end": 759, + "name": "PUSH [tag]", + "source": 1, + "value": "27" + }, + { + "begin": 688, + "end": 759, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 688, + "end": 759, + "name": "tag", + "source": 1, + "value": "32" + }, + { "begin": 688, "end": 759, "name": "JUMPDEST", "source": 1 }, + { "begin": 642, "end": 766, "name": "SWAP3", "source": 1 }, + { "begin": 642, "end": 766, "name": "SWAP2", "source": 1 }, + { "begin": 642, "end": 766, "name": "POP", "source": 1 }, + { "begin": 642, "end": 766, "name": "POP", "source": 1 }, + { + "begin": 642, + "end": 766, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 772, + "end": 1077, + "name": "tag", + "source": 1, + "value": "17" + }, + { "begin": 772, "end": 1077, "name": "JUMPDEST", "source": 1 }, + { + "begin": 772, + "end": 1077, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 831, + "end": 851, + "name": "PUSH [tag]", + "source": 1, + "value": "34" + }, + { "begin": 849, "end": 850, "name": "DUP3", "source": 1 }, + { + "begin": 831, + "end": 851, + "name": "PUSH [tag]", + "source": 1, + "value": "30" + }, + { + "begin": 831, + "end": 851, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 831, + "end": 851, + "name": "tag", + "source": 1, + "value": "34" + }, + { "begin": 831, "end": 851, "name": "JUMPDEST", "source": 1 }, + { "begin": 826, "end": 851, "name": "SWAP2", "source": 1 }, + { "begin": 826, "end": 851, "name": "POP", "source": 1 }, + { + "begin": 865, + "end": 885, + "name": "PUSH [tag]", + "source": 1, + "value": "35" + }, + { "begin": 883, "end": 884, "name": "DUP4", "source": 1 }, + { + "begin": 865, + "end": 885, + "name": "PUSH [tag]", + "source": 1, + "value": "30" + }, + { + "begin": 865, + "end": 885, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 865, + "end": 885, + "name": "tag", + "source": 1, + "value": "35" + }, + { "begin": 865, "end": 885, "name": "JUMPDEST", "source": 1 }, + { "begin": 860, "end": 885, "name": "SWAP3", "source": 1 }, + { "begin": 860, "end": 885, "name": "POP", "source": 1 }, + { "begin": 1019, "end": 1020, "name": "DUP3", "source": 1 }, + { + "begin": 951, + "end": 1017, + "name": "PUSH", + "source": 1, + "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + }, + { "begin": 947, "end": 1021, "name": "SUB", "source": 1 }, + { "begin": 944, "end": 945, "name": "DUP3", "source": 1 }, + { "begin": 941, "end": 1022, "name": "GT", "source": 1 }, + { "begin": 938, "end": 940, "name": "ISZERO", "source": 1 }, + { + "begin": 938, + "end": 940, + "name": "PUSH [tag]", + "source": 1, + "value": "36" + }, + { "begin": 938, "end": 940, "name": "JUMPI", "source": 1 }, + { + "begin": 1025, + "end": 1043, + "name": "PUSH [tag]", + "source": 1, + "value": "37" + }, + { + "begin": 1025, + "end": 1043, + "name": "PUSH [tag]", + "source": 1, + "value": "38" + }, + { + "begin": 1025, + "end": 1043, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1025, + "end": 1043, + "name": "tag", + "source": 1, + "value": "37" + }, + { "begin": 1025, "end": 1043, "name": "JUMPDEST", "source": 1 }, + { + "begin": 938, + "end": 940, + "name": "tag", + "source": 1, + "value": "36" + }, + { "begin": 938, "end": 940, "name": "JUMPDEST", "source": 1 }, + { "begin": 1069, "end": 1070, "name": "DUP3", "source": 1 }, + { "begin": 1066, "end": 1067, "name": "DUP3", "source": 1 }, + { "begin": 1062, "end": 1071, "name": "ADD", "source": 1 }, + { "begin": 1055, "end": 1071, "name": "SWAP1", "source": 1 }, + { "begin": 1055, "end": 1071, "name": "POP", "source": 1 }, + { "begin": 816, "end": 1077, "name": "SWAP3", "source": 1 }, + { "begin": 816, "end": 1077, "name": "SWAP2", "source": 1 }, + { "begin": 816, "end": 1077, "name": "POP", "source": 1 }, + { "begin": 816, "end": 1077, "name": "POP", "source": 1 }, + { + "begin": 816, + "end": 1077, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1083, + "end": 1160, + "name": "tag", + "source": 1, + "value": "30" + }, + { "begin": 1083, "end": 1160, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1083, + "end": 1160, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1149, "end": 1154, "name": "DUP2", "source": 1 }, + { "begin": 1138, "end": 1154, "name": "SWAP1", "source": 1 }, + { "begin": 1138, "end": 1154, "name": "POP", "source": 1 }, + { "begin": 1128, "end": 1160, "name": "SWAP2", "source": 1 }, + { "begin": 1128, "end": 1160, "name": "SWAP1", "source": 1 }, + { "begin": 1128, "end": 1160, "name": "POP", "source": 1 }, + { + "begin": 1128, + "end": 1160, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1166, + "end": 1346, + "name": "tag", + "source": 1, + "value": "38" + }, + { "begin": 1166, "end": 1346, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1214, + "end": 1291, + "name": "PUSH", + "source": 1, + "value": "4E487B7100000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 1211, + "end": 1212, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1204, "end": 1292, "name": "MSTORE", "source": 1 }, + { + "begin": 1311, + "end": 1315, + "name": "PUSH", + "source": 1, + "value": "11" + }, + { + "begin": 1308, + "end": 1309, + "name": "PUSH", + "source": 1, + "value": "4" + }, + { "begin": 1301, "end": 1316, "name": "MSTORE", "source": 1 }, + { + "begin": 1335, + "end": 1339, + "name": "PUSH", + "source": 1, + "value": "24" + }, + { + "begin": 1332, + "end": 1333, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1325, "end": 1340, "name": "REVERT", "source": 1 }, + { + "begin": 1352, + "end": 1474, + "name": "tag", + "source": 1, + "value": "23" + }, + { "begin": 1352, "end": 1474, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1425, + "end": 1449, + "name": "PUSH [tag]", + "source": 1, + "value": "42" + }, + { "begin": 1443, "end": 1448, "name": "DUP2", "source": 1 }, + { + "begin": 1425, + "end": 1449, + "name": "PUSH [tag]", + "source": 1, + "value": "30" + }, + { + "begin": 1425, + "end": 1449, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1425, + "end": 1449, + "name": "tag", + "source": 1, + "value": "42" + }, + { "begin": 1425, "end": 1449, "name": "JUMPDEST", "source": 1 }, + { "begin": 1418, "end": 1423, "name": "DUP2", "source": 1 }, + { "begin": 1415, "end": 1450, "name": "EQ", "source": 1 }, + { + "begin": 1405, + "end": 1407, + "name": "PUSH [tag]", + "source": 1, + "value": "43" + }, + { "begin": 1405, "end": 1407, "name": "JUMPI", "source": 1 }, + { + "begin": 1464, + "end": 1465, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1461, "end": 1462, "name": "DUP1", "source": 1 }, + { "begin": 1454, "end": 1466, "name": "REVERT", "source": 1 }, + { + "begin": 1405, + "end": 1407, + "name": "tag", + "source": 1, + "value": "43" + }, + { "begin": 1405, "end": 1407, "name": "JUMPDEST", "source": 1 }, + { "begin": 1395, "end": 1474, "name": "POP", "source": 1 }, + { + "begin": 1395, + "end": 1474, + "name": "JUMP", + "source": 1, + "value": "[out]" + } + ] + } + } + }, + "methodIdentifiers": { + "count()": "06661abd", + "incr(uint256)": "21b13c48" + } + }, + "ewasm": { "wasm": "" }, + "metadata": "{\"compiler\":{\"version\":\"0.8.3+commit.8d00100c\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"count\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"n\",\"type\":\"uint256\"}],\"name\":\"incr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"main.sol\":\"FiniteLoopContract\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"main.sol\":{\"keccak256\":\"0x984f01945ae71c6c12ccb0421a8c9f515385b977cc6e22f2dbe1fcf563d3f357\",\"urls\":[\"bzz-raw://64648061acbabb53f52d9e8cb94deb199bb26f2b0afbcd74ccdc1a6710b9e661\",\"dweb:/ipfs/Qmcr6Wq5kkatTmcWE5jnfPfGb9fhexKFTjLmoTSzeUp8iP\"]}},\"version\":1}", + "storageLayout": { + "storage": [ + { + "astId": 3, + "contract": "main.sol:FiniteLoopContract", + "label": "count", + "offset": 0, + "slot": "0", + "type": "t_uint256" + } + ], + "types": { + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + }, + "userdoc": { "kind": "user", "methods": {}, "version": 1 } + }, + "sourceCode": "\n pragma solidity >=0.8.0;\n \n contract FiniteLoopContract {\n uint public count;\n \n constructor() public {\n count = 0;\n }\n \n function incr(uint n) public {\n uint i=0;\n while (i end {\n let length := array_length_t_bytes_memory_ptr(value)\n pos := array_storeLengthForEncoding_t_bytes_memory_ptr_nonPadded_inplace_fromStack(pos, length)\n copy_memory_to_memory(add(value, 0x20), pos, length)\n end := add(pos, length)\n }\n\n function abi_encode_tuple_packed_t_bytes_memory_ptr__to_t_bytes_memory_ptr__nonPadded_inplace_fromStack_reversed(pos , value0) -> end {\n\n pos := abi_encode_t_bytes_memory_ptr_to_t_bytes_memory_ptr_nonPadded_inplace_fromStack(value0, pos)\n\n end := pos\n }\n\n function array_length_t_bytes_memory_ptr(value) -> length {\n\n length := mload(value)\n\n }\n\n function array_storeLengthForEncoding_t_bytes_memory_ptr_nonPadded_inplace_fromStack(pos, length) -> updated_pos {\n updated_pos := pos\n }\n\n function copy_memory_to_memory(src, dst, length) {\n let i := 0\n for { } lt(i, length) { i := add(i, 32) }\n {\n mstore(add(dst, i), mload(add(src, i)))\n }\n if gt(i, length)\n {\n // clear end\n mstore(add(dst, length), 0)\n }\n }\n\n}\n", + "id": 1, + "language": "Yul", + "name": "#utility.yul" + } + ], + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b507f8476ee4631b9b30ac2754b0ee0c47e161d3f724c00000000000000000000000060036040518060400160405280600c81526020017f48656c6c6f20576f726c6421000000000000000000000000000000000000000081525060405161007791906100ed565b602060405180830381855afa158015610094573d6000803e3d6000fd5b5050506040515160601b6bffffffffffffffffffffffff1916146100b757600080fd5b61014d565b60006100c782610104565b6100d1818561010f565b93506100e181856020860161011a565b80840191505092915050565b60006100f982846100bc565b915081905092915050565b600081519050919050565b600081905092915050565b60005b8381101561013857808201518184015260208101905061011d565b83811115610147576000848401525b50505050565b603f8061015b6000396000f3fe6080604052600080fdfea26469706673582212202a18a661fdf5ea3600714f19a16e1681d5c651e3b23f5a55166c1372b7f4119b64736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH32 0x8476EE4631B9B30AC2754B0EE0C47E161D3F724C000000000000000000000000 PUSH1 0x3 PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0xC DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x48656C6C6F20576F726C64210000000000000000000000000000000000000000 DUP2 MSTORE POP PUSH1 0x40 MLOAD PUSH2 0x77 SWAP2 SWAP1 PUSH2 0xED JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x94 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP PUSH1 0x40 MLOAD MLOAD PUSH1 0x60 SHL PUSH12 0xFFFFFFFFFFFFFFFFFFFFFFFF NOT AND EQ PUSH2 0xB7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x14D JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7 DUP3 PUSH2 0x104 JUMP JUMPDEST PUSH2 0xD1 DUP2 DUP6 PUSH2 0x10F JUMP JUMPDEST SWAP4 POP PUSH2 0xE1 DUP2 DUP6 PUSH1 0x20 DUP7 ADD PUSH2 0x11A JUMP JUMPDEST DUP1 DUP5 ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xF9 DUP3 DUP5 PUSH2 0xBC JUMP JUMPDEST SWAP2 POP DUP2 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x138 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x11D JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x147 JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x3F DUP1 PUSH2 0x15B PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0x2A XOR 0xA6 PUSH2 0xFDF5 0xEA CALLDATASIZE STOP PUSH18 0x4F19A16E1681D5C651E3B23F5A55166C1372 0xB7 DELEGATECALL GT SWAP12 PUSH5 0x736F6C6343 STOP ADDMOD SUB STOP CALLER ", + "sourceMap": "32:170:0:-:0;;;62:134;;;;;;;;;;94:92;:33;104:22;;;;;;;;;;;;;;;;;94:33;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:92;;;;86:101;;;;;;32:170;;7:373:1;;139:38;171:5;139:38;:::i;:::-;193:88;274:6;269:3;193:88;:::i;:::-;186:95;;290:52;335:6;330:3;323:4;316:5;312:16;290:52;:::i;:::-;367:6;362:3;358:16;351:23;;115:265;;;;;:::o;386:271::-;;538:93;627:3;618:6;538:93;:::i;:::-;531:100;;648:3;641:10;;520:137;;;;:::o;663:98::-;;748:5;742:12;732:22;;721:40;;;:::o;767:147::-;;905:3;890:18;;880:34;;;;:::o;920:307::-;988:1;998:113;1012:6;1009:1;1006:13;998:113;;;1097:1;1092:3;1088:11;1082:18;1078:1;1073:3;1069:11;1062:39;1034:2;1031:1;1027:10;1022:15;;998:113;;;1129:6;1126:1;1123:13;1120:2;;;1209:1;1200:6;1195:3;1191:16;1184:27;1120:2;969:258;;;;:::o;32:170:0:-;;;;;;;" + }, + "deployedBytecode": { + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "6080604052600080fdfea26469706673582212202a18a661fdf5ea3600714f19a16e1681d5c651e3b23f5a55166c1372b7f4119b64736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0x2A XOR 0xA6 PUSH2 0xFDF5 0xEA CALLDATASIZE STOP PUSH18 0x4F19A16E1681D5C651E3B23F5A55166C1372 0xB7 DELEGATECALL GT SWAP12 PUSH5 0x736F6C6343 STOP ADDMOD SUB STOP CALLER ", + "sourceMap": "32:170:0:-:0;;;;;" + }, + "gasEstimates": { + "creation": { + "codeDepositCost": "12600", + "executionCost": "infinite", + "totalCost": "infinite" + } + }, + "legacyAssembly": { + ".code": [ + { + "begin": 32, + "end": 202, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 32, + "end": 202, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 32, "end": 202, "name": "MSTORE", "source": 0 }, + { "begin": 62, "end": 196, "name": "CALLVALUE", "source": 0 }, + { "begin": 62, "end": 196, "name": "DUP1", "source": 0 }, + { "begin": 62, "end": 196, "name": "ISZERO", "source": 0 }, + { + "begin": 62, + "end": 196, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 62, "end": 196, "name": "JUMPI", "source": 0 }, + { + "begin": 62, + "end": 196, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 62, "end": 196, "name": "DUP1", "source": 0 }, + { "begin": 62, "end": 196, "name": "REVERT", "source": 0 }, + { "begin": 62, "end": 196, "name": "tag", "source": 0, "value": "1" }, + { "begin": 62, "end": 196, "name": "JUMPDEST", "source": 0 }, + { "begin": 62, "end": 196, "name": "POP", "source": 0 }, + { + "begin": 94, + "end": 186, + "name": "PUSH", + "source": 0, + "value": "8476EE4631B9B30AC2754B0EE0C47E161D3F724C000000000000000000000000" + }, + { + "begin": 94, + "end": 127, + "name": "PUSH", + "source": 0, + "value": "3" + }, + { + "begin": 104, + "end": 126, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 104, "end": 126, "name": "MLOAD", "source": 0 }, + { "begin": 104, "end": 126, "name": "DUP1", "source": 0 }, + { + "begin": 104, + "end": 126, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 104, "end": 126, "name": "ADD", "source": 0 }, + { + "begin": 104, + "end": 126, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 104, "end": 126, "name": "MSTORE", "source": 0 }, + { "begin": 104, "end": 126, "name": "DUP1", "source": 0 }, + { + "begin": 104, + "end": 126, + "name": "PUSH", + "source": 0, + "value": "C" + }, + { "begin": 104, "end": 126, "name": "DUP2", "source": 0 }, + { "begin": 104, "end": 126, "name": "MSTORE", "source": 0 }, + { + "begin": 104, + "end": 126, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 104, "end": 126, "name": "ADD", "source": 0 }, + { + "begin": 104, + "end": 126, + "name": "PUSH", + "source": 0, + "value": "48656C6C6F20576F726C64210000000000000000000000000000000000000000" + }, + { "begin": 104, "end": 126, "name": "DUP2", "source": 0 }, + { "begin": 104, "end": 126, "name": "MSTORE", "source": 0 }, + { "begin": 104, "end": 126, "name": "POP", "source": 0 }, + { + "begin": 94, + "end": 127, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 94, "end": 127, "name": "MLOAD", "source": 0 }, + { + "begin": 94, + "end": 127, + "name": "PUSH [tag]", + "source": 0, + "value": "4" + }, + { "begin": 94, "end": 127, "name": "SWAP2", "source": 0 }, + { "begin": 94, "end": 127, "name": "SWAP1", "source": 0 }, + { + "begin": 94, + "end": 127, + "name": "PUSH [tag]", + "source": 0, + "value": "5" + }, + { + "begin": 94, + "end": 127, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { "begin": 94, "end": 127, "name": "tag", "source": 0, "value": "4" }, + { "begin": 94, "end": 127, "name": "JUMPDEST", "source": 0 }, + { + "begin": 94, + "end": 127, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { + "begin": 94, + "end": 127, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 94, "end": 127, "name": "MLOAD", "source": 0 }, + { "begin": 94, "end": 127, "name": "DUP1", "source": 0 }, + { "begin": 94, "end": 127, "name": "DUP4", "source": 0 }, + { "begin": 94, "end": 127, "name": "SUB", "source": 0 }, + { "begin": 94, "end": 127, "name": "DUP2", "source": 0 }, + { "begin": 94, "end": 127, "name": "DUP6", "source": 0 }, + { "begin": 94, "end": 127, "name": "GAS", "source": 0 }, + { "begin": 94, "end": 127, "name": "STATICCALL", "source": 0 }, + { "begin": 94, "end": 127, "name": "ISZERO", "source": 0 }, + { "begin": 94, "end": 127, "name": "DUP1", "source": 0 }, + { "begin": 94, "end": 127, "name": "ISZERO", "source": 0 }, + { + "begin": 94, + "end": 127, + "name": "PUSH [tag]", + "source": 0, + "value": "7" + }, + { "begin": 94, "end": 127, "name": "JUMPI", "source": 0 }, + { "begin": 94, "end": 127, "name": "RETURNDATASIZE", "source": 0 }, + { + "begin": 94, + "end": 127, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 94, "end": 127, "name": "DUP1", "source": 0 }, + { "begin": 94, "end": 127, "name": "RETURNDATACOPY", "source": 0 }, + { "begin": 94, "end": 127, "name": "RETURNDATASIZE", "source": 0 }, + { + "begin": 94, + "end": 127, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 94, "end": 127, "name": "REVERT", "source": 0 }, + { "begin": 94, "end": 127, "name": "tag", "source": 0, "value": "7" }, + { "begin": 94, "end": 127, "name": "JUMPDEST", "source": 0 }, + { "begin": 94, "end": 127, "name": "POP", "source": 0 }, + { "begin": 94, "end": 127, "name": "POP", "source": 0 }, + { "begin": 94, "end": 127, "name": "POP", "source": 0 }, + { + "begin": 94, + "end": 127, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 94, "end": 127, "name": "MLOAD", "source": 0 }, + { "begin": 94, "end": 127, "name": "MLOAD", "source": 0 }, + { + "begin": 94, + "end": 127, + "name": "PUSH", + "source": 0, + "value": "60" + }, + { "begin": 94, "end": 127, "name": "SHL", "source": 0 }, + { + "begin": 94, + "end": 186, + "name": "PUSH", + "source": 0, + "value": "FFFFFFFFFFFFFFFFFFFFFFFF" + }, + { "begin": 94, "end": 186, "name": "NOT", "source": 0 }, + { "begin": 94, "end": 186, "name": "AND", "source": 0 }, + { "begin": 94, "end": 186, "name": "EQ", "source": 0 }, + { + "begin": 86, + "end": 187, + "name": "PUSH [tag]", + "source": 0, + "value": "8" + }, + { "begin": 86, "end": 187, "name": "JUMPI", "source": 0 }, + { + "begin": 86, + "end": 187, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 86, "end": 187, "name": "DUP1", "source": 0 }, + { "begin": 86, "end": 187, "name": "REVERT", "source": 0 }, + { "begin": 86, "end": 187, "name": "tag", "source": 0, "value": "8" }, + { "begin": 86, "end": 187, "name": "JUMPDEST", "source": 0 }, + { + "begin": 32, + "end": 202, + "name": "PUSH [tag]", + "source": 0, + "value": "9" + }, + { "begin": 32, "end": 202, "name": "JUMP", "source": 0 }, + { "begin": 7, "end": 380, "name": "tag", "source": 1, "value": "11" }, + { "begin": 7, "end": 380, "name": "JUMPDEST", "source": 1 }, + { "begin": 7, "end": 380, "name": "PUSH", "source": 1, "value": "0" }, + { + "begin": 139, + "end": 177, + "name": "PUSH [tag]", + "source": 1, + "value": "13" + }, + { "begin": 171, "end": 176, "name": "DUP3", "source": 1 }, + { + "begin": 139, + "end": 177, + "name": "PUSH [tag]", + "source": 1, + "value": "14" + }, + { + "begin": 139, + "end": 177, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 139, + "end": 177, + "name": "tag", + "source": 1, + "value": "13" + }, + { "begin": 139, "end": 177, "name": "JUMPDEST", "source": 1 }, + { + "begin": 193, + "end": 281, + "name": "PUSH [tag]", + "source": 1, + "value": "15" + }, + { "begin": 274, "end": 280, "name": "DUP2", "source": 1 }, + { "begin": 269, "end": 272, "name": "DUP6", "source": 1 }, + { + "begin": 193, + "end": 281, + "name": "PUSH [tag]", + "source": 1, + "value": "16" + }, + { + "begin": 193, + "end": 281, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 193, + "end": 281, + "name": "tag", + "source": 1, + "value": "15" + }, + { "begin": 193, "end": 281, "name": "JUMPDEST", "source": 1 }, + { "begin": 186, "end": 281, "name": "SWAP4", "source": 1 }, + { "begin": 186, "end": 281, "name": "POP", "source": 1 }, + { + "begin": 290, + "end": 342, + "name": "PUSH [tag]", + "source": 1, + "value": "17" + }, + { "begin": 335, "end": 341, "name": "DUP2", "source": 1 }, + { "begin": 330, "end": 333, "name": "DUP6", "source": 1 }, + { + "begin": 323, + "end": 327, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 316, "end": 321, "name": "DUP7", "source": 1 }, + { "begin": 312, "end": 328, "name": "ADD", "source": 1 }, + { + "begin": 290, + "end": 342, + "name": "PUSH [tag]", + "source": 1, + "value": "18" + }, + { + "begin": 290, + "end": 342, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 290, + "end": 342, + "name": "tag", + "source": 1, + "value": "17" + }, + { "begin": 290, "end": 342, "name": "JUMPDEST", "source": 1 }, + { "begin": 367, "end": 373, "name": "DUP1", "source": 1 }, + { "begin": 362, "end": 365, "name": "DUP5", "source": 1 }, + { "begin": 358, "end": 374, "name": "ADD", "source": 1 }, + { "begin": 351, "end": 374, "name": "SWAP2", "source": 1 }, + { "begin": 351, "end": 374, "name": "POP", "source": 1 }, + { "begin": 115, "end": 380, "name": "POP", "source": 1 }, + { "begin": 115, "end": 380, "name": "SWAP3", "source": 1 }, + { "begin": 115, "end": 380, "name": "SWAP2", "source": 1 }, + { "begin": 115, "end": 380, "name": "POP", "source": 1 }, + { "begin": 115, "end": 380, "name": "POP", "source": 1 }, + { + "begin": 115, + "end": 380, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 386, + "end": 657, + "name": "tag", + "source": 1, + "value": "5" + }, + { "begin": 386, "end": 657, "name": "JUMPDEST", "source": 1 }, + { + "begin": 386, + "end": 657, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 538, + "end": 631, + "name": "PUSH [tag]", + "source": 1, + "value": "20" + }, + { "begin": 627, "end": 630, "name": "DUP3", "source": 1 }, + { "begin": 618, "end": 624, "name": "DUP5", "source": 1 }, + { + "begin": 538, + "end": 631, + "name": "PUSH [tag]", + "source": 1, + "value": "11" + }, + { + "begin": 538, + "end": 631, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 538, + "end": 631, + "name": "tag", + "source": 1, + "value": "20" + }, + { "begin": 538, "end": 631, "name": "JUMPDEST", "source": 1 }, + { "begin": 531, "end": 631, "name": "SWAP2", "source": 1 }, + { "begin": 531, "end": 631, "name": "POP", "source": 1 }, + { "begin": 648, "end": 651, "name": "DUP2", "source": 1 }, + { "begin": 641, "end": 651, "name": "SWAP1", "source": 1 }, + { "begin": 641, "end": 651, "name": "POP", "source": 1 }, + { "begin": 520, "end": 657, "name": "SWAP3", "source": 1 }, + { "begin": 520, "end": 657, "name": "SWAP2", "source": 1 }, + { "begin": 520, "end": 657, "name": "POP", "source": 1 }, + { "begin": 520, "end": 657, "name": "POP", "source": 1 }, + { + "begin": 520, + "end": 657, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 663, + "end": 761, + "name": "tag", + "source": 1, + "value": "14" + }, + { "begin": 663, "end": 761, "name": "JUMPDEST", "source": 1 }, + { + "begin": 663, + "end": 761, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 748, "end": 753, "name": "DUP2", "source": 1 }, + { "begin": 742, "end": 754, "name": "MLOAD", "source": 1 }, + { "begin": 732, "end": 754, "name": "SWAP1", "source": 1 }, + { "begin": 732, "end": 754, "name": "POP", "source": 1 }, + { "begin": 721, "end": 761, "name": "SWAP2", "source": 1 }, + { "begin": 721, "end": 761, "name": "SWAP1", "source": 1 }, + { "begin": 721, "end": 761, "name": "POP", "source": 1 }, + { + "begin": 721, + "end": 761, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 767, + "end": 914, + "name": "tag", + "source": 1, + "value": "16" + }, + { "begin": 767, "end": 914, "name": "JUMPDEST", "source": 1 }, + { + "begin": 767, + "end": 914, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 905, "end": 908, "name": "DUP2", "source": 1 }, + { "begin": 890, "end": 908, "name": "SWAP1", "source": 1 }, + { "begin": 890, "end": 908, "name": "POP", "source": 1 }, + { "begin": 880, "end": 914, "name": "SWAP3", "source": 1 }, + { "begin": 880, "end": 914, "name": "SWAP2", "source": 1 }, + { "begin": 880, "end": 914, "name": "POP", "source": 1 }, + { "begin": 880, "end": 914, "name": "POP", "source": 1 }, + { + "begin": 880, + "end": 914, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 920, + "end": 1227, + "name": "tag", + "source": 1, + "value": "18" + }, + { "begin": 920, "end": 1227, "name": "JUMPDEST", "source": 1 }, + { + "begin": 988, + "end": 989, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 998, + "end": 1111, + "name": "tag", + "source": 1, + "value": "24" + }, + { "begin": 998, "end": 1111, "name": "JUMPDEST", "source": 1 }, + { "begin": 1012, "end": 1018, "name": "DUP4", "source": 1 }, + { "begin": 1009, "end": 1010, "name": "DUP2", "source": 1 }, + { "begin": 1006, "end": 1019, "name": "LT", "source": 1 }, + { "begin": 998, "end": 1111, "name": "ISZERO", "source": 1 }, + { + "begin": 998, + "end": 1111, + "name": "PUSH [tag]", + "source": 1, + "value": "26" + }, + { "begin": 998, "end": 1111, "name": "JUMPI", "source": 1 }, + { "begin": 1097, "end": 1098, "name": "DUP1", "source": 1 }, + { "begin": 1092, "end": 1095, "name": "DUP3", "source": 1 }, + { "begin": 1088, "end": 1099, "name": "ADD", "source": 1 }, + { "begin": 1082, "end": 1100, "name": "MLOAD", "source": 1 }, + { "begin": 1078, "end": 1079, "name": "DUP2", "source": 1 }, + { "begin": 1073, "end": 1076, "name": "DUP5", "source": 1 }, + { "begin": 1069, "end": 1080, "name": "ADD", "source": 1 }, + { "begin": 1062, "end": 1101, "name": "MSTORE", "source": 1 }, + { + "begin": 1034, + "end": 1036, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 1031, "end": 1032, "name": "DUP2", "source": 1 }, + { "begin": 1027, "end": 1037, "name": "ADD", "source": 1 }, + { "begin": 1022, "end": 1037, "name": "SWAP1", "source": 1 }, + { "begin": 1022, "end": 1037, "name": "POP", "source": 1 }, + { + "begin": 998, + "end": 1111, + "name": "PUSH [tag]", + "source": 1, + "value": "24" + }, + { "begin": 998, "end": 1111, "name": "JUMP", "source": 1 }, + { + "begin": 998, + "end": 1111, + "name": "tag", + "source": 1, + "value": "26" + }, + { "begin": 998, "end": 1111, "name": "JUMPDEST", "source": 1 }, + { "begin": 1129, "end": 1135, "name": "DUP4", "source": 1 }, + { "begin": 1126, "end": 1127, "name": "DUP2", "source": 1 }, + { "begin": 1123, "end": 1136, "name": "GT", "source": 1 }, + { "begin": 1120, "end": 1122, "name": "ISZERO", "source": 1 }, + { + "begin": 1120, + "end": 1122, + "name": "PUSH [tag]", + "source": 1, + "value": "27" + }, + { "begin": 1120, "end": 1122, "name": "JUMPI", "source": 1 }, + { + "begin": 1209, + "end": 1210, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1200, "end": 1206, "name": "DUP5", "source": 1 }, + { "begin": 1195, "end": 1198, "name": "DUP5", "source": 1 }, + { "begin": 1191, "end": 1207, "name": "ADD", "source": 1 }, + { "begin": 1184, "end": 1211, "name": "MSTORE", "source": 1 }, + { + "begin": 1120, + "end": 1122, + "name": "tag", + "source": 1, + "value": "27" + }, + { "begin": 1120, "end": 1122, "name": "JUMPDEST", "source": 1 }, + { "begin": 969, "end": 1227, "name": "POP", "source": 1 }, + { "begin": 969, "end": 1227, "name": "POP", "source": 1 }, + { "begin": 969, "end": 1227, "name": "POP", "source": 1 }, + { "begin": 969, "end": 1227, "name": "POP", "source": 1 }, + { + "begin": 969, + "end": 1227, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { "begin": 32, "end": 202, "name": "tag", "source": 0, "value": "9" }, + { "begin": 32, "end": 202, "name": "JUMPDEST", "source": 0 }, + { + "begin": 32, + "end": 202, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 32, "end": 202, "name": "DUP1", "source": 0 }, + { + "begin": 32, + "end": 202, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 32, + "end": 202, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 32, "end": 202, "name": "CODECOPY", "source": 0 }, + { + "begin": 32, + "end": 202, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 32, "end": 202, "name": "RETURN", "source": 0 } + ], + ".data": { + "0": { + ".auxdata": "a26469706673582212202a18a661fdf5ea3600714f19a16e1681d5c651e3b23f5a55166c1372b7f4119b64736f6c63430008030033", + ".code": [ + { + "begin": 32, + "end": 202, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 32, + "end": 202, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 32, "end": 202, "name": "MSTORE", "source": 0 }, + { + "begin": 32, + "end": 202, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 32, "end": 202, "name": "DUP1", "source": 0 }, + { "begin": 32, "end": 202, "name": "REVERT", "source": 0 } + ] + } + } + }, + "methodIdentifiers": {} + }, + "ewasm": { "wasm": "" }, + "metadata": "{\"compiler\":{\"version\":\"0.8.3+commit.8d00100c\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"main.sol\":\"HashRipmd160\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"main.sol\":{\"keccak256\":\"0xf3ae788ee7dce70defb6af44a4f7bfa31cb824bd3be9b4975e130191d96ea505\",\"urls\":[\"bzz-raw://4a252a1c455fb39492f493b58841b260aa4d0675a94cc892e218e07fc2d27b82\",\"dweb:/ipfs/QmUVQYPzqdmRavXJddNkSDZQ6hXThqVLHfYWFNj1yNMgSJ\"]}},\"version\":1}", + "storageLayout": { "storage": [], "types": null }, + "userdoc": { "kind": "user", "methods": {}, "version": 1 } + }, + "sourceCode": "\n pragma solidity >=0.8.0;\n contract HashRipmd160 {\n constructor() {\n require(ripemd160(bytes ('Hello World!')) ==\n hex'8476ee4631b9b30ac2754b0ee0c47e161d3f724c');\n }\n }" +} diff --git a/tests/contracts/compiled/Incrementer.json b/tests/contracts/compiled/Incrementer.json new file mode 100644 index 00000000000..0d3c382df93 --- /dev/null +++ b/tests/contracts/compiled/Incrementer.json @@ -0,0 +1,1947 @@ +{ + "byteCode": "0x608060405234801561001057600080fd5b506101c8806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063188b85b414610030575b600080fd5b61004a60048036038101906100459190610099565b610060565b60405161005791906100d1565b60405180910390f35b60008160008082825461007391906100ec565b925050819055506000549050919050565b6000813590506100938161017b565b92915050565b6000602082840312156100ab57600080fd5b60006100b984828501610084565b91505092915050565b6100cb81610142565b82525050565b60006020820190506100e660008301846100c2565b92915050565b60006100f782610142565b915061010283610142565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156101375761013661014c565b5b828201905092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b61018481610142565b811461018f57600080fd5b5056fea26469706673582212205ac572598f4d79893dc041296111a23a36a22bbd00d4b1762e272c2342998ca464736f6c63430008030033", + "contract": { + "abi": [ + { + "inputs": [ + { "internalType": "uint256", "name": "num", "type": "uint256" } + ], + "name": "sum", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "devdoc": { "kind": "dev", "methods": {}, "version": 1 }, + "evm": { + "assembly": " /* \"main.sol\":34:210 contract Incrementer {... */\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 /* \"main.sol\":34:210 contract Incrementer {... */\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 0x188b85b4\n eq\n tag_3\n jumpi\n tag_2:\n 0x00\n dup1\n revert\n /* \"main.sol\":89:204 function sum(uint256 num) public returns (uint256){... */\n tag_3:\n tag_4\n 0x04\n dup1\n calldatasize\n sub\n dup2\n add\n swap1\n tag_5\n swap2\n swap1\n tag_6\n jump\t// in\n tag_5:\n tag_7\n jump\t// in\n tag_4:\n mload(0x40)\n tag_8\n swap2\n swap1\n tag_9\n jump\t// in\n tag_8:\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n return\n tag_7:\n /* \"main.sol\":131:138 uint256 */\n 0x00\n /* \"main.sol\":163:166 num */\n dup2\n /* \"main.sol\":153:159 number */\n 0x00\n dup1\n /* \"main.sol\":153:166 number += num */\n dup3\n dup3\n sload\n tag_11\n swap2\n swap1\n tag_12\n jump\t// in\n tag_11:\n swap3\n pop\n pop\n dup2\n swap1\n sstore\n pop\n /* \"main.sol\":187:193 number */\n sload(0x00)\n /* \"main.sol\":180:193 return number */\n swap1\n pop\n /* \"main.sol\":89:204 function sum(uint256 num) public returns (uint256){... */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":7:146 */\n tag_14:\n 0x00\n /* \"#utility.yul\":91:97 */\n dup2\n /* \"#utility.yul\":78:98 */\n calldataload\n /* \"#utility.yul\":69:98 */\n swap1\n pop\n /* \"#utility.yul\":107:140 */\n tag_16\n /* \"#utility.yul\":134:139 */\n dup2\n /* \"#utility.yul\":107:140 */\n tag_17\n jump\t// in\n tag_16:\n /* \"#utility.yul\":59:146 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":152:414 */\n tag_6:\n 0x00\n /* \"#utility.yul\":260:262 */\n 0x20\n /* \"#utility.yul\":248:257 */\n dup3\n /* \"#utility.yul\":239:246 */\n dup5\n /* \"#utility.yul\":235:258 */\n sub\n /* \"#utility.yul\":231:263 */\n slt\n /* \"#utility.yul\":228:230 */\n iszero\n tag_19\n jumpi\n /* \"#utility.yul\":276:277 */\n 0x00\n /* \"#utility.yul\":273:274 */\n dup1\n /* \"#utility.yul\":266:278 */\n revert\n /* \"#utility.yul\":228:230 */\n tag_19:\n /* \"#utility.yul\":319:320 */\n 0x00\n /* \"#utility.yul\":344:397 */\n tag_20\n /* \"#utility.yul\":389:396 */\n dup5\n /* \"#utility.yul\":380:386 */\n dup3\n /* \"#utility.yul\":369:378 */\n dup6\n /* \"#utility.yul\":365:387 */\n add\n /* \"#utility.yul\":344:397 */\n tag_14\n jump\t// in\n tag_20:\n /* \"#utility.yul\":334:397 */\n swap2\n pop\n /* \"#utility.yul\":290:407 */\n pop\n /* \"#utility.yul\":218:414 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":420:538 */\n tag_21:\n /* \"#utility.yul\":507:531 */\n tag_23\n /* \"#utility.yul\":525:530 */\n dup2\n /* \"#utility.yul\":507:531 */\n tag_24\n jump\t// in\n tag_23:\n /* \"#utility.yul\":502:505 */\n dup3\n /* \"#utility.yul\":495:532 */\n mstore\n /* \"#utility.yul\":485:538 */\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":544:766 */\n tag_9:\n 0x00\n /* \"#utility.yul\":675:677 */\n 0x20\n /* \"#utility.yul\":664:673 */\n dup3\n /* \"#utility.yul\":660:678 */\n add\n /* \"#utility.yul\":652:678 */\n swap1\n pop\n /* \"#utility.yul\":688:759 */\n tag_26\n /* \"#utility.yul\":756:757 */\n 0x00\n /* \"#utility.yul\":745:754 */\n dup4\n /* \"#utility.yul\":741:758 */\n add\n /* \"#utility.yul\":732:738 */\n dup5\n /* \"#utility.yul\":688:759 */\n tag_21\n jump\t// in\n tag_26:\n /* \"#utility.yul\":642:766 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":772:1077 */\n tag_12:\n 0x00\n /* \"#utility.yul\":831:851 */\n tag_28\n /* \"#utility.yul\":849:850 */\n dup3\n /* \"#utility.yul\":831:851 */\n tag_24\n jump\t// in\n tag_28:\n /* \"#utility.yul\":826:851 */\n swap2\n pop\n /* \"#utility.yul\":865:885 */\n tag_29\n /* \"#utility.yul\":883:884 */\n dup4\n /* \"#utility.yul\":865:885 */\n tag_24\n jump\t// in\n tag_29:\n /* \"#utility.yul\":860:885 */\n swap3\n pop\n /* \"#utility.yul\":1019:1020 */\n dup3\n /* \"#utility.yul\":951:1017 */\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\n /* \"#utility.yul\":947:1021 */\n sub\n /* \"#utility.yul\":944:945 */\n dup3\n /* \"#utility.yul\":941:1022 */\n gt\n /* \"#utility.yul\":938:940 */\n iszero\n tag_30\n jumpi\n /* \"#utility.yul\":1025:1043 */\n tag_31\n tag_32\n jump\t// in\n tag_31:\n /* \"#utility.yul\":938:940 */\n tag_30:\n /* \"#utility.yul\":1069:1070 */\n dup3\n /* \"#utility.yul\":1066:1067 */\n dup3\n /* \"#utility.yul\":1062:1071 */\n add\n /* \"#utility.yul\":1055:1071 */\n swap1\n pop\n /* \"#utility.yul\":816:1077 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":1083:1160 */\n tag_24:\n 0x00\n /* \"#utility.yul\":1149:1154 */\n dup2\n /* \"#utility.yul\":1138:1154 */\n swap1\n pop\n /* \"#utility.yul\":1128:1160 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":1166:1346 */\n tag_32:\n /* \"#utility.yul\":1214:1291 */\n 0x4e487b7100000000000000000000000000000000000000000000000000000000\n /* \"#utility.yul\":1211:1212 */\n 0x00\n /* \"#utility.yul\":1204:1292 */\n mstore\n /* \"#utility.yul\":1311:1315 */\n 0x11\n /* \"#utility.yul\":1308:1309 */\n 0x04\n /* \"#utility.yul\":1301:1316 */\n mstore\n /* \"#utility.yul\":1335:1339 */\n 0x24\n /* \"#utility.yul\":1332:1333 */\n 0x00\n /* \"#utility.yul\":1325:1340 */\n revert\n /* \"#utility.yul\":1352:1474 */\n tag_17:\n /* \"#utility.yul\":1425:1449 */\n tag_36\n /* \"#utility.yul\":1443:1448 */\n dup2\n /* \"#utility.yul\":1425:1449 */\n tag_24\n jump\t// in\n tag_36:\n /* \"#utility.yul\":1418:1423 */\n dup2\n /* \"#utility.yul\":1415:1450 */\n eq\n /* \"#utility.yul\":1405:1407 */\n tag_37\n jumpi\n /* \"#utility.yul\":1464:1465 */\n 0x00\n /* \"#utility.yul\":1461:1462 */\n dup1\n /* \"#utility.yul\":1454:1466 */\n revert\n /* \"#utility.yul\":1405:1407 */\n tag_37:\n /* \"#utility.yul\":1395:1474 */\n pop\n jump\t// out\n\n auxdata: 0xa26469706673582212205ac572598f4d79893dc041296111a23a36a22bbd00d4b1762e272c2342998ca464736f6c63430008030033\n}\n", + "bytecode": { + "generatedSources": [], + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b506101c8806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063188b85b414610030575b600080fd5b61004a60048036038101906100459190610099565b610060565b60405161005791906100d1565b60405180910390f35b60008160008082825461007391906100ec565b925050819055506000549050919050565b6000813590506100938161017b565b92915050565b6000602082840312156100ab57600080fd5b60006100b984828501610084565b91505092915050565b6100cb81610142565b82525050565b60006020820190506100e660008301846100c2565b92915050565b60006100f782610142565b915061010283610142565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156101375761013661014c565b5b828201905092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b61018481610142565b811461018f57600080fd5b5056fea26469706673582212205ac572598f4d79893dc041296111a23a36a22bbd00d4b1762e272c2342998ca464736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1C8 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 0x2B JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x188B85B4 EQ PUSH2 0x30 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4A PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x45 SWAP2 SWAP1 PUSH2 0x99 JUMP JUMPDEST PUSH2 0x60 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x57 SWAP2 SWAP1 PUSH2 0xD1 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 DUP3 DUP3 SLOAD PUSH2 0x73 SWAP2 SWAP1 PUSH2 0xEC JUMP JUMPDEST SWAP3 POP POP DUP2 SWAP1 SSTORE POP PUSH1 0x0 SLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x93 DUP2 PUSH2 0x17B JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xAB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0xB9 DUP5 DUP3 DUP6 ADD PUSH2 0x84 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0xCB DUP2 PUSH2 0x142 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0xE6 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0xC2 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xF7 DUP3 PUSH2 0x142 JUMP JUMPDEST SWAP2 POP PUSH2 0x102 DUP4 PUSH2 0x142 JUMP JUMPDEST SWAP3 POP DUP3 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SUB DUP3 GT ISZERO PUSH2 0x137 JUMPI PUSH2 0x136 PUSH2 0x14C JUMP JUMPDEST JUMPDEST DUP3 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH2 0x184 DUP2 PUSH2 0x142 JUMP JUMPDEST DUP2 EQ PUSH2 0x18F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 GAS 0xC5 PUSH19 0x598F4D79893DC041296111A23A36A22BBD00D4 0xB1 PUSH23 0x2E272C2342998CA464736F6C6343000803003300000000 ", + "sourceMap": "34:176:0:-:0;;;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "generatedSources": [ + { + "ast": { + "nodeType": "YulBlock", + "src": "0:1477:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "59:87:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "69:29:1", + "value": { + "arguments": [ + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "91:6:1" + } + ], + "functionName": { + "name": "calldataload", + "nodeType": "YulIdentifier", + "src": "78:12:1" + }, + "nodeType": "YulFunctionCall", + "src": "78:20:1" + }, + "variableNames": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "69:5:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "134:5:1" + } + ], + "functionName": { + "name": "validator_revert_t_uint256", + "nodeType": "YulIdentifier", + "src": "107:26:1" + }, + "nodeType": "YulFunctionCall", + "src": "107:33:1" + }, + "nodeType": "YulExpressionStatement", + "src": "107:33:1" + } + ] + }, + "name": "abi_decode_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "37:6:1", + "type": "" + }, + { + "name": "end", + "nodeType": "YulTypedName", + "src": "45:3:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "53:5:1", + "type": "" + } + ], + "src": "7:139:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "218:196:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "264:16:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "273:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "276:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "266:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "266:12:1" + }, + "nodeType": "YulExpressionStatement", + "src": "266:12:1" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "239:7:1" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "248:9:1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "235:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "235:23:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "260:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "231:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "231:32:1" + }, + "nodeType": "YulIf", + "src": "228:2:1" + }, + { + "nodeType": "YulBlock", + "src": "290:117:1", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "305:15:1", + "value": { + "kind": "number", + "nodeType": "YulLiteral", + "src": "319:1:1", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "309:6:1", + "type": "" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "334:63:1", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "369:9:1" + }, + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "380:6:1" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "365:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "365:22:1" + }, + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "389:7:1" + } + ], + "functionName": { + "name": "abi_decode_t_uint256", + "nodeType": "YulIdentifier", + "src": "344:20:1" + }, + "nodeType": "YulFunctionCall", + "src": "344:53:1" + }, + "variableNames": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "334:6:1" + } + ] + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "188:9:1", + "type": "" + }, + { + "name": "dataEnd", + "nodeType": "YulTypedName", + "src": "199:7:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "211:6:1", + "type": "" + } + ], + "src": "152:262:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "485:53:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "502:3:1" + }, + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "525:5:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "507:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "507:24:1" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "495:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "495:37:1" + }, + "nodeType": "YulExpressionStatement", + "src": "495:37:1" + } + ] + }, + "name": "abi_encode_t_uint256_to_t_uint256_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "473:5:1", + "type": "" + }, + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "480:3:1", + "type": "" + } + ], + "src": "420:118:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "642:124:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "652:26:1", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "664:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "675:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "660:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "660:18:1" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "652:4:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "732:6:1" + }, + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "745:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "756:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "741:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "741:17:1" + } + ], + "functionName": { + "name": "abi_encode_t_uint256_to_t_uint256_fromStack", + "nodeType": "YulIdentifier", + "src": "688:43:1" + }, + "nodeType": "YulFunctionCall", + "src": "688:71:1" + }, + "nodeType": "YulExpressionStatement", + "src": "688:71:1" + } + ] + }, + "name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "614:9:1", + "type": "" + }, + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "626:6:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "637:4:1", + "type": "" + } + ], + "src": "544:222:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "816:261:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "826:25:1", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "849:1:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "831:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "831:20:1" + }, + "variableNames": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "826:1:1" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "860:25:1", + "value": { + "arguments": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "883:1:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "865:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "865:20:1" + }, + "variableNames": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "860:1:1" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1023:22:1", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nodeType": "YulIdentifier", + "src": "1025:16:1" + }, + "nodeType": "YulFunctionCall", + "src": "1025:18:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1025:18:1" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "944:1:1" + }, + { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "951:66:1", + "type": "", + "value": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "1019:1:1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "947:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "947:74:1" + } + ], + "functionName": { + "name": "gt", + "nodeType": "YulIdentifier", + "src": "941:2:1" + }, + "nodeType": "YulFunctionCall", + "src": "941:81:1" + }, + "nodeType": "YulIf", + "src": "938:2:1" + }, + { + "nodeType": "YulAssignment", + "src": "1055:16:1", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "1066:1:1" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "1069:1:1" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1062:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1062:9:1" + }, + "variableNames": [ + { + "name": "sum", + "nodeType": "YulIdentifier", + "src": "1055:3:1" + } + ] + } + ] + }, + "name": "checked_add_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "x", + "nodeType": "YulTypedName", + "src": "803:1:1", + "type": "" + }, + { + "name": "y", + "nodeType": "YulTypedName", + "src": "806:1:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "sum", + "nodeType": "YulTypedName", + "src": "812:3:1", + "type": "" + } + ], + "src": "772:305:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1128:32:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "1138:16:1", + "value": { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1149:5:1" + }, + "variableNames": [ + { + "name": "cleaned", + "nodeType": "YulIdentifier", + "src": "1138:7:1" + } + ] + } + ] + }, + "name": "cleanup_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "1110:5:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "cleaned", + "nodeType": "YulTypedName", + "src": "1120:7:1", + "type": "" + } + ], + "src": "1083:77:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1194:152:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1211:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1214:77:1", + "type": "", + "value": "35408467139433450592217433187231851964531694900788300625387963629091585785856" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "1204:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1204:88:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1204:88:1" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1308:1:1", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1311:4:1", + "type": "", + "value": "0x11" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "1301:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1301:15:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1301:15:1" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1332:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1335:4:1", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "1325:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1325:15:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1325:15:1" + } + ] + }, + "name": "panic_error_0x11", + "nodeType": "YulFunctionDefinition", + "src": "1166:180:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1395:79:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "1452:16:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1461:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1464:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "1454:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1454:12:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1454:12:1" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1418:5:1" + }, + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1443:5:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "1425:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "1425:24:1" + } + ], + "functionName": { + "name": "eq", + "nodeType": "YulIdentifier", + "src": "1415:2:1" + }, + "nodeType": "YulFunctionCall", + "src": "1415:35:1" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "1408:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1408:43:1" + }, + "nodeType": "YulIf", + "src": "1405:2:1" + } + ] + }, + "name": "validator_revert_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "1388:5:1", + "type": "" + } + ], + "src": "1352:122:1" + } + ] + }, + "contents": "{\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(0, 0) }\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 function checked_add_t_uint256(x, y) -> sum {\n x := cleanup_t_uint256(x)\n y := cleanup_t_uint256(y)\n\n // overflow, if x > (maxValue - y)\n if gt(x, sub(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, y)) { panic_error_0x11() }\n\n sum := add(x, y)\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function panic_error_0x11() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n\n function validator_revert_t_uint256(value) {\n if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }\n }\n\n}\n", + "id": 1, + "language": "Yul", + "name": "#utility.yul" + } + ], + "immutableReferences": {}, + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b506004361061002b5760003560e01c8063188b85b414610030575b600080fd5b61004a60048036038101906100459190610099565b610060565b60405161005791906100d1565b60405180910390f35b60008160008082825461007391906100ec565b925050819055506000549050919050565b6000813590506100938161017b565b92915050565b6000602082840312156100ab57600080fd5b60006100b984828501610084565b91505092915050565b6100cb81610142565b82525050565b60006020820190506100e660008301846100c2565b92915050565b60006100f782610142565b915061010283610142565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156101375761013661014c565b5b828201905092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b61018481610142565b811461018f57600080fd5b5056fea26469706673582212205ac572598f4d79893dc041296111a23a36a22bbd00d4b1762e272c2342998ca464736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x2B JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x188B85B4 EQ PUSH2 0x30 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4A PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x45 SWAP2 SWAP1 PUSH2 0x99 JUMP JUMPDEST PUSH2 0x60 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x57 SWAP2 SWAP1 PUSH2 0xD1 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 DUP3 DUP3 SLOAD PUSH2 0x73 SWAP2 SWAP1 PUSH2 0xEC JUMP JUMPDEST SWAP3 POP POP DUP2 SWAP1 SSTORE POP PUSH1 0x0 SLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x93 DUP2 PUSH2 0x17B JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xAB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0xB9 DUP5 DUP3 DUP6 ADD PUSH2 0x84 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0xCB DUP2 PUSH2 0x142 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0xE6 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0xC2 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xF7 DUP3 PUSH2 0x142 JUMP JUMPDEST SWAP2 POP PUSH2 0x102 DUP4 PUSH2 0x142 JUMP JUMPDEST SWAP3 POP DUP3 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SUB DUP3 GT ISZERO PUSH2 0x137 JUMPI PUSH2 0x136 PUSH2 0x14C JUMP JUMPDEST JUMPDEST DUP3 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH2 0x184 DUP2 PUSH2 0x142 JUMP JUMPDEST DUP2 EQ PUSH2 0x18F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 GAS 0xC5 PUSH19 0x598F4D79893DC041296111A23A36A22BBD00D4 0xB1 PUSH23 0x2E272C2342998CA464736F6C6343000803003300000000 ", + "sourceMap": "34:176:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;89:115;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;131:7;163:3;153:6;;:13;;;;;;;:::i;:::-;;;;;;;;187:6;;180:13;;89:115;;;:::o;7:139:1:-;;91:6;78:20;69:29;;107:33;134:5;107:33;:::i;:::-;59:87;;;;:::o;152:262::-;;260:2;248:9;239:7;235:23;231:32;228:2;;;276:1;273;266:12;228:2;319:1;344:53;389:7;380:6;369:9;365:22;344:53;:::i;:::-;334:63;;290:117;218:196;;;;:::o;420:118::-;507:24;525:5;507:24;:::i;:::-;502:3;495:37;485:53;;:::o;544:222::-;;675:2;664:9;660:18;652:26;;688:71;756:1;745:9;741:17;732:6;688:71;:::i;:::-;642:124;;;;:::o;772:305::-;;831:20;849:1;831:20;:::i;:::-;826:25;;865:20;883:1;865:20;:::i;:::-;860:25;;1019:1;951:66;947:74;944:1;941:81;938:2;;;1025:18;;:::i;:::-;938:2;1069:1;1066;1062:9;1055:16;;816:261;;;;:::o;1083:77::-;;1149:5;1138:16;;1128:32;;;:::o;1166:180::-;1214:77;1211:1;1204:88;1311:4;1308:1;1301:15;1335:4;1332:1;1325:15;1352:122;1425:24;1443:5;1425:24;:::i;:::-;1418:5;1415:35;1405:2;;1464:1;1461;1454:12;1405:2;1395:79;:::o" + }, + "gasEstimates": { + "creation": { + "codeDepositCost": "91200", + "executionCost": "141", + "totalCost": "91341" + }, + "external": { "sum(uint256)": "infinite" } + }, + "legacyAssembly": { + ".code": [ + { + "begin": 34, + "end": 210, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 34, + "end": 210, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 210, "name": "MSTORE", "source": 0 }, + { "begin": 34, "end": 210, "name": "CALLVALUE", "source": 0 }, + { "begin": 34, "end": 210, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 210, "name": "ISZERO", "source": 0 }, + { + "begin": 34, + "end": 210, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 34, "end": 210, "name": "JUMPI", "source": 0 }, + { + "begin": 34, + "end": 210, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 210, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 210, "name": "REVERT", "source": 0 }, + { "begin": 34, "end": 210, "name": "tag", "source": 0, "value": "1" }, + { "begin": 34, "end": 210, "name": "JUMPDEST", "source": 0 }, + { "begin": 34, "end": 210, "name": "POP", "source": 0 }, + { + "begin": 34, + "end": 210, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 34, "end": 210, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 210, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 34, + "end": 210, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 210, "name": "CODECOPY", "source": 0 }, + { + "begin": 34, + "end": 210, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 210, "name": "RETURN", "source": 0 } + ], + ".data": { + "0": { + ".auxdata": "a26469706673582212205ac572598f4d79893dc041296111a23a36a22bbd00d4b1762e272c2342998ca464736f6c63430008030033", + ".code": [ + { + "begin": 34, + "end": 210, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 34, + "end": 210, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 210, "name": "MSTORE", "source": 0 }, + { "begin": 34, "end": 210, "name": "CALLVALUE", "source": 0 }, + { "begin": 34, "end": 210, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 210, "name": "ISZERO", "source": 0 }, + { + "begin": 34, + "end": 210, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 34, "end": 210, "name": "JUMPI", "source": 0 }, + { + "begin": 34, + "end": 210, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 210, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 210, "name": "REVERT", "source": 0 }, + { + "begin": 34, + "end": 210, + "name": "tag", + "source": 0, + "value": "1" + }, + { "begin": 34, "end": 210, "name": "JUMPDEST", "source": 0 }, + { "begin": 34, "end": 210, "name": "POP", "source": 0 }, + { + "begin": 34, + "end": 210, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 34, "end": 210, "name": "CALLDATASIZE", "source": 0 }, + { "begin": 34, "end": 210, "name": "LT", "source": 0 }, + { + "begin": 34, + "end": 210, + "name": "PUSH [tag]", + "source": 0, + "value": "2" + }, + { "begin": 34, "end": 210, "name": "JUMPI", "source": 0 }, + { + "begin": 34, + "end": 210, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 210, "name": "CALLDATALOAD", "source": 0 }, + { + "begin": 34, + "end": 210, + "name": "PUSH", + "source": 0, + "value": "E0" + }, + { "begin": 34, "end": 210, "name": "SHR", "source": 0 }, + { "begin": 34, "end": 210, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 210, + "name": "PUSH", + "source": 0, + "value": "188B85B4" + }, + { "begin": 34, "end": 210, "name": "EQ", "source": 0 }, + { + "begin": 34, + "end": 210, + "name": "PUSH [tag]", + "source": 0, + "value": "3" + }, + { "begin": 34, "end": 210, "name": "JUMPI", "source": 0 }, + { + "begin": 34, + "end": 210, + "name": "tag", + "source": 0, + "value": "2" + }, + { "begin": 34, "end": 210, "name": "JUMPDEST", "source": 0 }, + { + "begin": 34, + "end": 210, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 210, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 210, "name": "REVERT", "source": 0 }, + { + "begin": 89, + "end": 204, + "name": "tag", + "source": 0, + "value": "3" + }, + { "begin": 89, "end": 204, "name": "JUMPDEST", "source": 0 }, + { + "begin": 89, + "end": 204, + "name": "PUSH [tag]", + "source": 0, + "value": "4" + }, + { + "begin": 89, + "end": 204, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 89, "end": 204, "name": "DUP1", "source": 0 }, + { "begin": 89, "end": 204, "name": "CALLDATASIZE", "source": 0 }, + { "begin": 89, "end": 204, "name": "SUB", "source": 0 }, + { "begin": 89, "end": 204, "name": "DUP2", "source": 0 }, + { "begin": 89, "end": 204, "name": "ADD", "source": 0 }, + { "begin": 89, "end": 204, "name": "SWAP1", "source": 0 }, + { + "begin": 89, + "end": 204, + "name": "PUSH [tag]", + "source": 0, + "value": "5" + }, + { "begin": 89, "end": 204, "name": "SWAP2", "source": 0 }, + { "begin": 89, "end": 204, "name": "SWAP1", "source": 0 }, + { + "begin": 89, + "end": 204, + "name": "PUSH [tag]", + "source": 0, + "value": "6" + }, + { + "begin": 89, + "end": 204, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 89, + "end": 204, + "name": "tag", + "source": 0, + "value": "5" + }, + { "begin": 89, "end": 204, "name": "JUMPDEST", "source": 0 }, + { + "begin": 89, + "end": 204, + "name": "PUSH [tag]", + "source": 0, + "value": "7" + }, + { + "begin": 89, + "end": 204, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 89, + "end": 204, + "name": "tag", + "source": 0, + "value": "4" + }, + { "begin": 89, "end": 204, "name": "JUMPDEST", "source": 0 }, + { + "begin": 89, + "end": 204, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 89, "end": 204, "name": "MLOAD", "source": 0 }, + { + "begin": 89, + "end": 204, + "name": "PUSH [tag]", + "source": 0, + "value": "8" + }, + { "begin": 89, "end": 204, "name": "SWAP2", "source": 0 }, + { "begin": 89, "end": 204, "name": "SWAP1", "source": 0 }, + { + "begin": 89, + "end": 204, + "name": "PUSH [tag]", + "source": 0, + "value": "9" + }, + { + "begin": 89, + "end": 204, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 89, + "end": 204, + "name": "tag", + "source": 0, + "value": "8" + }, + { "begin": 89, "end": 204, "name": "JUMPDEST", "source": 0 }, + { + "begin": 89, + "end": 204, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 89, "end": 204, "name": "MLOAD", "source": 0 }, + { "begin": 89, "end": 204, "name": "DUP1", "source": 0 }, + { "begin": 89, "end": 204, "name": "SWAP2", "source": 0 }, + { "begin": 89, "end": 204, "name": "SUB", "source": 0 }, + { "begin": 89, "end": 204, "name": "SWAP1", "source": 0 }, + { "begin": 89, "end": 204, "name": "RETURN", "source": 0 }, + { + "begin": 89, + "end": 204, + "name": "tag", + "source": 0, + "value": "7" + }, + { "begin": 89, "end": 204, "name": "JUMPDEST", "source": 0 }, + { + "begin": 131, + "end": 138, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 163, "end": 166, "name": "DUP2", "source": 0 }, + { + "begin": 153, + "end": 159, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 153, "end": 159, "name": "DUP1", "source": 0 }, + { "begin": 153, "end": 166, "name": "DUP3", "source": 0 }, + { "begin": 153, "end": 166, "name": "DUP3", "source": 0 }, + { "begin": 153, "end": 166, "name": "SLOAD", "source": 0 }, + { + "begin": 153, + "end": 166, + "name": "PUSH [tag]", + "source": 0, + "value": "11" + }, + { "begin": 153, "end": 166, "name": "SWAP2", "source": 0 }, + { "begin": 153, "end": 166, "name": "SWAP1", "source": 0 }, + { + "begin": 153, + "end": 166, + "name": "PUSH [tag]", + "source": 0, + "value": "12" + }, + { + "begin": 153, + "end": 166, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 153, + "end": 166, + "name": "tag", + "source": 0, + "value": "11" + }, + { "begin": 153, "end": 166, "name": "JUMPDEST", "source": 0 }, + { "begin": 153, "end": 166, "name": "SWAP3", "source": 0 }, + { "begin": 153, "end": 166, "name": "POP", "source": 0 }, + { "begin": 153, "end": 166, "name": "POP", "source": 0 }, + { "begin": 153, "end": 166, "name": "DUP2", "source": 0 }, + { "begin": 153, "end": 166, "name": "SWAP1", "source": 0 }, + { "begin": 153, "end": 166, "name": "SSTORE", "source": 0 }, + { "begin": 153, "end": 166, "name": "POP", "source": 0 }, + { + "begin": 187, + "end": 193, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 187, "end": 193, "name": "SLOAD", "source": 0 }, + { "begin": 180, "end": 193, "name": "SWAP1", "source": 0 }, + { "begin": 180, "end": 193, "name": "POP", "source": 0 }, + { "begin": 89, "end": 204, "name": "SWAP2", "source": 0 }, + { "begin": 89, "end": 204, "name": "SWAP1", "source": 0 }, + { "begin": 89, "end": 204, "name": "POP", "source": 0 }, + { + "begin": 89, + "end": 204, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { + "begin": 7, + "end": 146, + "name": "tag", + "source": 1, + "value": "14" + }, + { "begin": 7, "end": 146, "name": "JUMPDEST", "source": 1 }, + { + "begin": 7, + "end": 146, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 91, "end": 97, "name": "DUP2", "source": 1 }, + { "begin": 78, "end": 98, "name": "CALLDATALOAD", "source": 1 }, + { "begin": 69, "end": 98, "name": "SWAP1", "source": 1 }, + { "begin": 69, "end": 98, "name": "POP", "source": 1 }, + { + "begin": 107, + "end": 140, + "name": "PUSH [tag]", + "source": 1, + "value": "16" + }, + { "begin": 134, "end": 139, "name": "DUP2", "source": 1 }, + { + "begin": 107, + "end": 140, + "name": "PUSH [tag]", + "source": 1, + "value": "17" + }, + { + "begin": 107, + "end": 140, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 107, + "end": 140, + "name": "tag", + "source": 1, + "value": "16" + }, + { "begin": 107, "end": 140, "name": "JUMPDEST", "source": 1 }, + { "begin": 59, "end": 146, "name": "SWAP3", "source": 1 }, + { "begin": 59, "end": 146, "name": "SWAP2", "source": 1 }, + { "begin": 59, "end": 146, "name": "POP", "source": 1 }, + { "begin": 59, "end": 146, "name": "POP", "source": 1 }, + { + "begin": 59, + "end": 146, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 152, + "end": 414, + "name": "tag", + "source": 1, + "value": "6" + }, + { "begin": 152, "end": 414, "name": "JUMPDEST", "source": 1 }, + { + "begin": 152, + "end": 414, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 260, + "end": 262, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 248, "end": 257, "name": "DUP3", "source": 1 }, + { "begin": 239, "end": 246, "name": "DUP5", "source": 1 }, + { "begin": 235, "end": 258, "name": "SUB", "source": 1 }, + { "begin": 231, "end": 263, "name": "SLT", "source": 1 }, + { "begin": 228, "end": 230, "name": "ISZERO", "source": 1 }, + { + "begin": 228, + "end": 230, + "name": "PUSH [tag]", + "source": 1, + "value": "19" + }, + { "begin": 228, "end": 230, "name": "JUMPI", "source": 1 }, + { + "begin": 276, + "end": 277, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 273, "end": 274, "name": "DUP1", "source": 1 }, + { "begin": 266, "end": 278, "name": "REVERT", "source": 1 }, + { + "begin": 228, + "end": 230, + "name": "tag", + "source": 1, + "value": "19" + }, + { "begin": 228, "end": 230, "name": "JUMPDEST", "source": 1 }, + { + "begin": 319, + "end": 320, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 344, + "end": 397, + "name": "PUSH [tag]", + "source": 1, + "value": "20" + }, + { "begin": 389, "end": 396, "name": "DUP5", "source": 1 }, + { "begin": 380, "end": 386, "name": "DUP3", "source": 1 }, + { "begin": 369, "end": 378, "name": "DUP6", "source": 1 }, + { "begin": 365, "end": 387, "name": "ADD", "source": 1 }, + { + "begin": 344, + "end": 397, + "name": "PUSH [tag]", + "source": 1, + "value": "14" + }, + { + "begin": 344, + "end": 397, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 344, + "end": 397, + "name": "tag", + "source": 1, + "value": "20" + }, + { "begin": 344, "end": 397, "name": "JUMPDEST", "source": 1 }, + { "begin": 334, "end": 397, "name": "SWAP2", "source": 1 }, + { "begin": 334, "end": 397, "name": "POP", "source": 1 }, + { "begin": 290, "end": 407, "name": "POP", "source": 1 }, + { "begin": 218, "end": 414, "name": "SWAP3", "source": 1 }, + { "begin": 218, "end": 414, "name": "SWAP2", "source": 1 }, + { "begin": 218, "end": 414, "name": "POP", "source": 1 }, + { "begin": 218, "end": 414, "name": "POP", "source": 1 }, + { + "begin": 218, + "end": 414, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 420, + "end": 538, + "name": "tag", + "source": 1, + "value": "21" + }, + { "begin": 420, "end": 538, "name": "JUMPDEST", "source": 1 }, + { + "begin": 507, + "end": 531, + "name": "PUSH [tag]", + "source": 1, + "value": "23" + }, + { "begin": 525, "end": 530, "name": "DUP2", "source": 1 }, + { + "begin": 507, + "end": 531, + "name": "PUSH [tag]", + "source": 1, + "value": "24" + }, + { + "begin": 507, + "end": 531, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 507, + "end": 531, + "name": "tag", + "source": 1, + "value": "23" + }, + { "begin": 507, "end": 531, "name": "JUMPDEST", "source": 1 }, + { "begin": 502, "end": 505, "name": "DUP3", "source": 1 }, + { "begin": 495, "end": 532, "name": "MSTORE", "source": 1 }, + { "begin": 485, "end": 538, "name": "POP", "source": 1 }, + { "begin": 485, "end": 538, "name": "POP", "source": 1 }, + { + "begin": 485, + "end": 538, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 544, + "end": 766, + "name": "tag", + "source": 1, + "value": "9" + }, + { "begin": 544, "end": 766, "name": "JUMPDEST", "source": 1 }, + { + "begin": 544, + "end": 766, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 675, + "end": 677, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 664, "end": 673, "name": "DUP3", "source": 1 }, + { "begin": 660, "end": 678, "name": "ADD", "source": 1 }, + { "begin": 652, "end": 678, "name": "SWAP1", "source": 1 }, + { "begin": 652, "end": 678, "name": "POP", "source": 1 }, + { + "begin": 688, + "end": 759, + "name": "PUSH [tag]", + "source": 1, + "value": "26" + }, + { + "begin": 756, + "end": 757, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 745, "end": 754, "name": "DUP4", "source": 1 }, + { "begin": 741, "end": 758, "name": "ADD", "source": 1 }, + { "begin": 732, "end": 738, "name": "DUP5", "source": 1 }, + { + "begin": 688, + "end": 759, + "name": "PUSH [tag]", + "source": 1, + "value": "21" + }, + { + "begin": 688, + "end": 759, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 688, + "end": 759, + "name": "tag", + "source": 1, + "value": "26" + }, + { "begin": 688, "end": 759, "name": "JUMPDEST", "source": 1 }, + { "begin": 642, "end": 766, "name": "SWAP3", "source": 1 }, + { "begin": 642, "end": 766, "name": "SWAP2", "source": 1 }, + { "begin": 642, "end": 766, "name": "POP", "source": 1 }, + { "begin": 642, "end": 766, "name": "POP", "source": 1 }, + { + "begin": 642, + "end": 766, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 772, + "end": 1077, + "name": "tag", + "source": 1, + "value": "12" + }, + { "begin": 772, "end": 1077, "name": "JUMPDEST", "source": 1 }, + { + "begin": 772, + "end": 1077, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 831, + "end": 851, + "name": "PUSH [tag]", + "source": 1, + "value": "28" + }, + { "begin": 849, "end": 850, "name": "DUP3", "source": 1 }, + { + "begin": 831, + "end": 851, + "name": "PUSH [tag]", + "source": 1, + "value": "24" + }, + { + "begin": 831, + "end": 851, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 831, + "end": 851, + "name": "tag", + "source": 1, + "value": "28" + }, + { "begin": 831, "end": 851, "name": "JUMPDEST", "source": 1 }, + { "begin": 826, "end": 851, "name": "SWAP2", "source": 1 }, + { "begin": 826, "end": 851, "name": "POP", "source": 1 }, + { + "begin": 865, + "end": 885, + "name": "PUSH [tag]", + "source": 1, + "value": "29" + }, + { "begin": 883, "end": 884, "name": "DUP4", "source": 1 }, + { + "begin": 865, + "end": 885, + "name": "PUSH [tag]", + "source": 1, + "value": "24" + }, + { + "begin": 865, + "end": 885, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 865, + "end": 885, + "name": "tag", + "source": 1, + "value": "29" + }, + { "begin": 865, "end": 885, "name": "JUMPDEST", "source": 1 }, + { "begin": 860, "end": 885, "name": "SWAP3", "source": 1 }, + { "begin": 860, "end": 885, "name": "POP", "source": 1 }, + { "begin": 1019, "end": 1020, "name": "DUP3", "source": 1 }, + { + "begin": 951, + "end": 1017, + "name": "PUSH", + "source": 1, + "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + }, + { "begin": 947, "end": 1021, "name": "SUB", "source": 1 }, + { "begin": 944, "end": 945, "name": "DUP3", "source": 1 }, + { "begin": 941, "end": 1022, "name": "GT", "source": 1 }, + { "begin": 938, "end": 940, "name": "ISZERO", "source": 1 }, + { + "begin": 938, + "end": 940, + "name": "PUSH [tag]", + "source": 1, + "value": "30" + }, + { "begin": 938, "end": 940, "name": "JUMPI", "source": 1 }, + { + "begin": 1025, + "end": 1043, + "name": "PUSH [tag]", + "source": 1, + "value": "31" + }, + { + "begin": 1025, + "end": 1043, + "name": "PUSH [tag]", + "source": 1, + "value": "32" + }, + { + "begin": 1025, + "end": 1043, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1025, + "end": 1043, + "name": "tag", + "source": 1, + "value": "31" + }, + { "begin": 1025, "end": 1043, "name": "JUMPDEST", "source": 1 }, + { + "begin": 938, + "end": 940, + "name": "tag", + "source": 1, + "value": "30" + }, + { "begin": 938, "end": 940, "name": "JUMPDEST", "source": 1 }, + { "begin": 1069, "end": 1070, "name": "DUP3", "source": 1 }, + { "begin": 1066, "end": 1067, "name": "DUP3", "source": 1 }, + { "begin": 1062, "end": 1071, "name": "ADD", "source": 1 }, + { "begin": 1055, "end": 1071, "name": "SWAP1", "source": 1 }, + { "begin": 1055, "end": 1071, "name": "POP", "source": 1 }, + { "begin": 816, "end": 1077, "name": "SWAP3", "source": 1 }, + { "begin": 816, "end": 1077, "name": "SWAP2", "source": 1 }, + { "begin": 816, "end": 1077, "name": "POP", "source": 1 }, + { "begin": 816, "end": 1077, "name": "POP", "source": 1 }, + { + "begin": 816, + "end": 1077, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1083, + "end": 1160, + "name": "tag", + "source": 1, + "value": "24" + }, + { "begin": 1083, "end": 1160, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1083, + "end": 1160, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1149, "end": 1154, "name": "DUP2", "source": 1 }, + { "begin": 1138, "end": 1154, "name": "SWAP1", "source": 1 }, + { "begin": 1138, "end": 1154, "name": "POP", "source": 1 }, + { "begin": 1128, "end": 1160, "name": "SWAP2", "source": 1 }, + { "begin": 1128, "end": 1160, "name": "SWAP1", "source": 1 }, + { "begin": 1128, "end": 1160, "name": "POP", "source": 1 }, + { + "begin": 1128, + "end": 1160, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1166, + "end": 1346, + "name": "tag", + "source": 1, + "value": "32" + }, + { "begin": 1166, "end": 1346, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1214, + "end": 1291, + "name": "PUSH", + "source": 1, + "value": "4E487B7100000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 1211, + "end": 1212, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1204, "end": 1292, "name": "MSTORE", "source": 1 }, + { + "begin": 1311, + "end": 1315, + "name": "PUSH", + "source": 1, + "value": "11" + }, + { + "begin": 1308, + "end": 1309, + "name": "PUSH", + "source": 1, + "value": "4" + }, + { "begin": 1301, "end": 1316, "name": "MSTORE", "source": 1 }, + { + "begin": 1335, + "end": 1339, + "name": "PUSH", + "source": 1, + "value": "24" + }, + { + "begin": 1332, + "end": 1333, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1325, "end": 1340, "name": "REVERT", "source": 1 }, + { + "begin": 1352, + "end": 1474, + "name": "tag", + "source": 1, + "value": "17" + }, + { "begin": 1352, "end": 1474, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1425, + "end": 1449, + "name": "PUSH [tag]", + "source": 1, + "value": "36" + }, + { "begin": 1443, "end": 1448, "name": "DUP2", "source": 1 }, + { + "begin": 1425, + "end": 1449, + "name": "PUSH [tag]", + "source": 1, + "value": "24" + }, + { + "begin": 1425, + "end": 1449, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1425, + "end": 1449, + "name": "tag", + "source": 1, + "value": "36" + }, + { "begin": 1425, "end": 1449, "name": "JUMPDEST", "source": 1 }, + { "begin": 1418, "end": 1423, "name": "DUP2", "source": 1 }, + { "begin": 1415, "end": 1450, "name": "EQ", "source": 1 }, + { + "begin": 1405, + "end": 1407, + "name": "PUSH [tag]", + "source": 1, + "value": "37" + }, + { "begin": 1405, "end": 1407, "name": "JUMPI", "source": 1 }, + { + "begin": 1464, + "end": 1465, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1461, "end": 1462, "name": "DUP1", "source": 1 }, + { "begin": 1454, "end": 1466, "name": "REVERT", "source": 1 }, + { + "begin": 1405, + "end": 1407, + "name": "tag", + "source": 1, + "value": "37" + }, + { "begin": 1405, "end": 1407, "name": "JUMPDEST", "source": 1 }, + { "begin": 1395, "end": 1474, "name": "POP", "source": 1 }, + { + "begin": 1395, + "end": 1474, + "name": "JUMP", + "source": 1, + "value": "[out]" + } + ] + } + } + }, + "methodIdentifiers": { "sum(uint256)": "188b85b4" } + }, + "ewasm": { "wasm": "" }, + "metadata": "{\"compiler\":{\"version\":\"0.8.3+commit.8d00100c\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"}],\"name\":\"sum\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"main.sol\":\"Incrementer\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"main.sol\":{\"keccak256\":\"0xa5c4b90518b5568be87b2b28df4d947c87c4cbc4acf987f270c9675edf72e313\",\"urls\":[\"bzz-raw://a4f4ddfdcb3351ebdfa95bd60b13cd1f9bdebaf4485fc693909d693a71ec9927\",\"dweb:/ipfs/QmdBLkPgptJM5YnjjKPE7E2UtivDjJ9ypaKz1iwahJQ6gM\"]}},\"version\":1}", + "storageLayout": { + "storage": [ + { + "astId": 3, + "contract": "main.sol:Incrementer", + "label": "number", + "offset": 0, + "slot": "0", + "type": "t_uint256" + } + ], + "types": { + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + }, + "userdoc": { "kind": "user", "methods": {}, "version": 1 } + }, + "sourceCode": "\n pragma solidity >=0.8.0;\n contract Incrementer {\n uint256 number;\n function sum(uint256 num) public returns (uint256){\n number += num;\n return number;\n }\n }" +} diff --git a/tests/contracts/compiled/InfiniteContract.json b/tests/contracts/compiled/InfiniteContract.json new file mode 100644 index 00000000000..e89a9b9afe3 --- /dev/null +++ b/tests/contracts/compiled/InfiniteContract.json @@ -0,0 +1,772 @@ +{ + "byteCode": "0x608060405234801561001057600080fd5b5060bd8061001f6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c80635bec9e6714602d575b600080fd5b60336047565b604051603e91906064565b60405180910390f35b60005b600115605457604a565b90565b605e81607d565b82525050565b6000602082019050607760008301846057565b92915050565b600081905091905056fea264697066735822122081d8942ad65b5431cb61a704d975eb570c9bc1981b78b8829067f91cca53bb2d64736f6c63430008030033", + "contract": { + "abi": [ + { + "inputs": [], + "name": "infinite", + "outputs": [ + { "internalType": "uint256", "name": "d", "type": "uint256" } + ], + "stateMutability": "pure", + "type": "function" + } + ], + "devdoc": { "kind": "dev", "methods": {}, "version": 1 }, + "evm": { + "assembly": " /* \"main.sol\":39:146 contract InfiniteContract {... */\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 /* \"main.sol\":39:146 contract InfiniteContract {... */\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 0x5bec9e67\n eq\n tag_3\n jumpi\n tag_2:\n 0x00\n dup1\n revert\n /* \"main.sol\":75:140 function infinite() public pure returns(uint d) {while (true) {}} */\n tag_3:\n tag_4\n tag_5\n jump\t// in\n tag_4:\n mload(0x40)\n tag_6\n swap2\n swap1\n tag_7\n jump\t// in\n tag_6:\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n return\n tag_5:\n /* \"main.sol\":115:121 uint d */\n 0x00\n /* \"main.sol\":124:139 while (true) {} */\n tag_9:\n /* \"main.sol\":131:135 true */\n 0x01\n /* \"main.sol\":124:139 while (true) {} */\n iszero\n tag_10\n jumpi\n jump(tag_9)\n tag_10:\n /* \"main.sol\":75:140 function infinite() public pure returns(uint d) {while (true) {}} */\n swap1\n jump\t// out\n /* \"#utility.yul\":7:125 */\n tag_12:\n /* \"#utility.yul\":94:118 */\n tag_14\n /* \"#utility.yul\":112:117 */\n dup2\n /* \"#utility.yul\":94:118 */\n tag_15\n jump\t// in\n tag_14:\n /* \"#utility.yul\":89:92 */\n dup3\n /* \"#utility.yul\":82:119 */\n mstore\n /* \"#utility.yul\":72:125 */\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":131:353 */\n tag_7:\n 0x00\n /* \"#utility.yul\":262:264 */\n 0x20\n /* \"#utility.yul\":251:260 */\n dup3\n /* \"#utility.yul\":247:265 */\n add\n /* \"#utility.yul\":239:265 */\n swap1\n pop\n /* \"#utility.yul\":275:346 */\n tag_17\n /* \"#utility.yul\":343:344 */\n 0x00\n /* \"#utility.yul\":332:341 */\n dup4\n /* \"#utility.yul\":328:345 */\n add\n /* \"#utility.yul\":319:325 */\n dup5\n /* \"#utility.yul\":275:346 */\n tag_12\n jump\t// in\n tag_17:\n /* \"#utility.yul\":229:353 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":359:436 */\n tag_15:\n 0x00\n /* \"#utility.yul\":425:430 */\n dup2\n /* \"#utility.yul\":414:430 */\n swap1\n pop\n /* \"#utility.yul\":404:436 */\n swap2\n swap1\n pop\n jump\t// out\n\n auxdata: 0xa264697066735822122081d8942ad65b5431cb61a704d975eb570c9bc1981b78b8829067f91cca53bb2d64736f6c63430008030033\n}\n", + "bytecode": { + "generatedSources": [], + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b5060bd8061001f6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c80635bec9e6714602d575b600080fd5b60336047565b604051603e91906064565b60405180910390f35b60005b600115605457604a565b90565b605e81607d565b82525050565b6000602082019050607760008301846057565b92915050565b600081905091905056fea264697066735822122081d8942ad65b5431cb61a704d975eb570c9bc1981b78b8829067f91cca53bb2d64736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0xBD DUP1 PUSH2 0x1F PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH1 0x28 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x5BEC9E67 EQ PUSH1 0x2D JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x33 PUSH1 0x47 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x3E SWAP2 SWAP1 PUSH1 0x64 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 JUMPDEST PUSH1 0x1 ISZERO PUSH1 0x54 JUMPI PUSH1 0x4A JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x5E DUP2 PUSH1 0x7D JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH1 0x77 PUSH1 0x0 DUP4 ADD DUP5 PUSH1 0x57 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 DUP2 0xD8 SWAP5 0x2A 0xD6 JUMPDEST SLOAD BALANCE 0xCB PUSH2 0xA704 0xD9 PUSH22 0xEB570C9BC1981B78B8829067F91CCA53BB2D64736F6C PUSH4 0x43000803 STOP CALLER ", + "sourceMap": "39:107:0:-:0;;;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "generatedSources": [ + { + "ast": { + "nodeType": "YulBlock", + "src": "0:439:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "72:53:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "89:3:1" + }, + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "112:5:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "94:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "94:24:1" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "82:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "82:37:1" + }, + "nodeType": "YulExpressionStatement", + "src": "82:37:1" + } + ] + }, + "name": "abi_encode_t_uint256_to_t_uint256_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "60:5:1", + "type": "" + }, + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "67:3:1", + "type": "" + } + ], + "src": "7:118:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "229:124:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "239:26:1", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "251:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "262:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "247:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "247:18:1" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "239:4:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "319:6:1" + }, + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "332:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "343:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "328:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "328:17:1" + } + ], + "functionName": { + "name": "abi_encode_t_uint256_to_t_uint256_fromStack", + "nodeType": "YulIdentifier", + "src": "275:43:1" + }, + "nodeType": "YulFunctionCall", + "src": "275:71:1" + }, + "nodeType": "YulExpressionStatement", + "src": "275:71:1" + } + ] + }, + "name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "201:9:1", + "type": "" + }, + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "213:6:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "224:4:1", + "type": "" + } + ], + "src": "131:222:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "404:32:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "414:16:1", + "value": { + "name": "value", + "nodeType": "YulIdentifier", + "src": "425:5:1" + }, + "variableNames": [ + { + "name": "cleaned", + "nodeType": "YulIdentifier", + "src": "414:7:1" + } + ] + } + ] + }, + "name": "cleanup_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "386:5:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "cleaned", + "nodeType": "YulTypedName", + "src": "396:7:1", + "type": "" + } + ], + "src": "359:77:1" + } + ] + }, + "contents": "{\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 function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n}\n", + "id": 1, + "language": "Yul", + "name": "#utility.yul" + } + ], + "immutableReferences": {}, + "linkReferences": {}, + "object": "6080604052348015600f57600080fd5b506004361060285760003560e01c80635bec9e6714602d575b600080fd5b60336047565b604051603e91906064565b60405180910390f35b60005b600115605457604a565b90565b605e81607d565b82525050565b6000602082019050607760008301846057565b92915050565b600081905091905056fea264697066735822122081d8942ad65b5431cb61a704d975eb570c9bc1981b78b8829067f91cca53bb2d64736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH1 0x28 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x5BEC9E67 EQ PUSH1 0x2D JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x33 PUSH1 0x47 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x3E SWAP2 SWAP1 PUSH1 0x64 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 JUMPDEST PUSH1 0x1 ISZERO PUSH1 0x54 JUMPI PUSH1 0x4A JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x5E DUP2 PUSH1 0x7D JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH1 0x77 PUSH1 0x0 DUP4 ADD DUP5 PUSH1 0x57 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 DUP2 0xD8 SWAP5 0x2A 0xD6 JUMPDEST SLOAD BALANCE 0xCB PUSH2 0xA704 0xD9 PUSH22 0xEB570C9BC1981B78B8829067F91CCA53BB2D64736F6C PUSH4 0x43000803 STOP CALLER ", + "sourceMap": "39:107:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;75:65;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;115:6;124:15;131:4;124:15;;;;;;75:65;:::o;7:118:1:-;94:24;112:5;94:24;:::i;:::-;89:3;82:37;72:53;;:::o;131:222::-;;262:2;251:9;247:18;239:26;;275:71;343:1;332:9;328:17;319:6;275:71;:::i;:::-;229:124;;;;:::o;359:77::-;;425:5;414:16;;404:32;;;:::o" + }, + "gasEstimates": { + "creation": { + "codeDepositCost": "37800", + "executionCost": "87", + "totalCost": "37887" + }, + "external": { "infinite()": "infinite" } + }, + "legacyAssembly": { + ".code": [ + { + "begin": 39, + "end": 146, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 39, + "end": 146, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 39, "end": 146, "name": "MSTORE", "source": 0 }, + { "begin": 39, "end": 146, "name": "CALLVALUE", "source": 0 }, + { "begin": 39, "end": 146, "name": "DUP1", "source": 0 }, + { "begin": 39, "end": 146, "name": "ISZERO", "source": 0 }, + { + "begin": 39, + "end": 146, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 39, "end": 146, "name": "JUMPI", "source": 0 }, + { + "begin": 39, + "end": 146, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 146, "name": "DUP1", "source": 0 }, + { "begin": 39, "end": 146, "name": "REVERT", "source": 0 }, + { "begin": 39, "end": 146, "name": "tag", "source": 0, "value": "1" }, + { "begin": 39, "end": 146, "name": "JUMPDEST", "source": 0 }, + { "begin": 39, "end": 146, "name": "POP", "source": 0 }, + { + "begin": 39, + "end": 146, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 39, "end": 146, "name": "DUP1", "source": 0 }, + { + "begin": 39, + "end": 146, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 39, + "end": 146, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 146, "name": "CODECOPY", "source": 0 }, + { + "begin": 39, + "end": 146, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 146, "name": "RETURN", "source": 0 } + ], + ".data": { + "0": { + ".auxdata": "a264697066735822122081d8942ad65b5431cb61a704d975eb570c9bc1981b78b8829067f91cca53bb2d64736f6c63430008030033", + ".code": [ + { + "begin": 39, + "end": 146, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 39, + "end": 146, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 39, "end": 146, "name": "MSTORE", "source": 0 }, + { "begin": 39, "end": 146, "name": "CALLVALUE", "source": 0 }, + { "begin": 39, "end": 146, "name": "DUP1", "source": 0 }, + { "begin": 39, "end": 146, "name": "ISZERO", "source": 0 }, + { + "begin": 39, + "end": 146, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 39, "end": 146, "name": "JUMPI", "source": 0 }, + { + "begin": 39, + "end": 146, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 146, "name": "DUP1", "source": 0 }, + { "begin": 39, "end": 146, "name": "REVERT", "source": 0 }, + { + "begin": 39, + "end": 146, + "name": "tag", + "source": 0, + "value": "1" + }, + { "begin": 39, "end": 146, "name": "JUMPDEST", "source": 0 }, + { "begin": 39, "end": 146, "name": "POP", "source": 0 }, + { + "begin": 39, + "end": 146, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 39, "end": 146, "name": "CALLDATASIZE", "source": 0 }, + { "begin": 39, "end": 146, "name": "LT", "source": 0 }, + { + "begin": 39, + "end": 146, + "name": "PUSH [tag]", + "source": 0, + "value": "2" + }, + { "begin": 39, "end": 146, "name": "JUMPI", "source": 0 }, + { + "begin": 39, + "end": 146, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 146, "name": "CALLDATALOAD", "source": 0 }, + { + "begin": 39, + "end": 146, + "name": "PUSH", + "source": 0, + "value": "E0" + }, + { "begin": 39, "end": 146, "name": "SHR", "source": 0 }, + { "begin": 39, "end": 146, "name": "DUP1", "source": 0 }, + { + "begin": 39, + "end": 146, + "name": "PUSH", + "source": 0, + "value": "5BEC9E67" + }, + { "begin": 39, "end": 146, "name": "EQ", "source": 0 }, + { + "begin": 39, + "end": 146, + "name": "PUSH [tag]", + "source": 0, + "value": "3" + }, + { "begin": 39, "end": 146, "name": "JUMPI", "source": 0 }, + { + "begin": 39, + "end": 146, + "name": "tag", + "source": 0, + "value": "2" + }, + { "begin": 39, "end": 146, "name": "JUMPDEST", "source": 0 }, + { + "begin": 39, + "end": 146, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 146, "name": "DUP1", "source": 0 }, + { "begin": 39, "end": 146, "name": "REVERT", "source": 0 }, + { + "begin": 75, + "end": 140, + "name": "tag", + "source": 0, + "value": "3" + }, + { "begin": 75, "end": 140, "name": "JUMPDEST", "source": 0 }, + { + "begin": 75, + "end": 140, + "name": "PUSH [tag]", + "source": 0, + "value": "4" + }, + { + "begin": 75, + "end": 140, + "name": "PUSH [tag]", + "source": 0, + "value": "5" + }, + { + "begin": 75, + "end": 140, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 75, + "end": 140, + "name": "tag", + "source": 0, + "value": "4" + }, + { "begin": 75, "end": 140, "name": "JUMPDEST", "source": 0 }, + { + "begin": 75, + "end": 140, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 75, "end": 140, "name": "MLOAD", "source": 0 }, + { + "begin": 75, + "end": 140, + "name": "PUSH [tag]", + "source": 0, + "value": "6" + }, + { "begin": 75, "end": 140, "name": "SWAP2", "source": 0 }, + { "begin": 75, "end": 140, "name": "SWAP1", "source": 0 }, + { + "begin": 75, + "end": 140, + "name": "PUSH [tag]", + "source": 0, + "value": "7" + }, + { + "begin": 75, + "end": 140, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 75, + "end": 140, + "name": "tag", + "source": 0, + "value": "6" + }, + { "begin": 75, "end": 140, "name": "JUMPDEST", "source": 0 }, + { + "begin": 75, + "end": 140, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 75, "end": 140, "name": "MLOAD", "source": 0 }, + { "begin": 75, "end": 140, "name": "DUP1", "source": 0 }, + { "begin": 75, "end": 140, "name": "SWAP2", "source": 0 }, + { "begin": 75, "end": 140, "name": "SUB", "source": 0 }, + { "begin": 75, "end": 140, "name": "SWAP1", "source": 0 }, + { "begin": 75, "end": 140, "name": "RETURN", "source": 0 }, + { + "begin": 75, + "end": 140, + "name": "tag", + "source": 0, + "value": "5" + }, + { "begin": 75, "end": 140, "name": "JUMPDEST", "source": 0 }, + { + "begin": 115, + "end": 121, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { + "begin": 124, + "end": 139, + "name": "tag", + "source": 0, + "value": "9" + }, + { "begin": 124, "end": 139, "name": "JUMPDEST", "source": 0 }, + { + "begin": 131, + "end": 135, + "name": "PUSH", + "source": 0, + "value": "1" + }, + { "begin": 124, "end": 139, "name": "ISZERO", "source": 0 }, + { + "begin": 124, + "end": 139, + "name": "PUSH [tag]", + "source": 0, + "value": "10" + }, + { "begin": 124, "end": 139, "name": "JUMPI", "source": 0 }, + { + "begin": 124, + "end": 139, + "name": "PUSH [tag]", + "source": 0, + "value": "9" + }, + { "begin": 124, "end": 139, "name": "JUMP", "source": 0 }, + { + "begin": 124, + "end": 139, + "name": "tag", + "source": 0, + "value": "10" + }, + { "begin": 124, "end": 139, "name": "JUMPDEST", "source": 0 }, + { "begin": 75, "end": 140, "name": "SWAP1", "source": 0 }, + { + "begin": 75, + "end": 140, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { + "begin": 7, + "end": 125, + "name": "tag", + "source": 1, + "value": "12" + }, + { "begin": 7, "end": 125, "name": "JUMPDEST", "source": 1 }, + { + "begin": 94, + "end": 118, + "name": "PUSH [tag]", + "source": 1, + "value": "14" + }, + { "begin": 112, "end": 117, "name": "DUP2", "source": 1 }, + { + "begin": 94, + "end": 118, + "name": "PUSH [tag]", + "source": 1, + "value": "15" + }, + { + "begin": 94, + "end": 118, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 94, + "end": 118, + "name": "tag", + "source": 1, + "value": "14" + }, + { "begin": 94, "end": 118, "name": "JUMPDEST", "source": 1 }, + { "begin": 89, "end": 92, "name": "DUP3", "source": 1 }, + { "begin": 82, "end": 119, "name": "MSTORE", "source": 1 }, + { "begin": 72, "end": 125, "name": "POP", "source": 1 }, + { "begin": 72, "end": 125, "name": "POP", "source": 1 }, + { + "begin": 72, + "end": 125, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 131, + "end": 353, + "name": "tag", + "source": 1, + "value": "7" + }, + { "begin": 131, "end": 353, "name": "JUMPDEST", "source": 1 }, + { + "begin": 131, + "end": 353, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 262, + "end": 264, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 251, "end": 260, "name": "DUP3", "source": 1 }, + { "begin": 247, "end": 265, "name": "ADD", "source": 1 }, + { "begin": 239, "end": 265, "name": "SWAP1", "source": 1 }, + { "begin": 239, "end": 265, "name": "POP", "source": 1 }, + { + "begin": 275, + "end": 346, + "name": "PUSH [tag]", + "source": 1, + "value": "17" + }, + { + "begin": 343, + "end": 344, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 332, "end": 341, "name": "DUP4", "source": 1 }, + { "begin": 328, "end": 345, "name": "ADD", "source": 1 }, + { "begin": 319, "end": 325, "name": "DUP5", "source": 1 }, + { + "begin": 275, + "end": 346, + "name": "PUSH [tag]", + "source": 1, + "value": "12" + }, + { + "begin": 275, + "end": 346, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 275, + "end": 346, + "name": "tag", + "source": 1, + "value": "17" + }, + { "begin": 275, "end": 346, "name": "JUMPDEST", "source": 1 }, + { "begin": 229, "end": 353, "name": "SWAP3", "source": 1 }, + { "begin": 229, "end": 353, "name": "SWAP2", "source": 1 }, + { "begin": 229, "end": 353, "name": "POP", "source": 1 }, + { "begin": 229, "end": 353, "name": "POP", "source": 1 }, + { + "begin": 229, + "end": 353, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 359, + "end": 436, + "name": "tag", + "source": 1, + "value": "15" + }, + { "begin": 359, "end": 436, "name": "JUMPDEST", "source": 1 }, + { + "begin": 359, + "end": 436, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 425, "end": 430, "name": "DUP2", "source": 1 }, + { "begin": 414, "end": 430, "name": "SWAP1", "source": 1 }, + { "begin": 414, "end": 430, "name": "POP", "source": 1 }, + { "begin": 404, "end": 436, "name": "SWAP2", "source": 1 }, + { "begin": 404, "end": 436, "name": "SWAP1", "source": 1 }, + { "begin": 404, "end": 436, "name": "POP", "source": 1 }, + { + "begin": 404, + "end": 436, + "name": "JUMP", + "source": 1, + "value": "[out]" + } + ] + } + } + }, + "methodIdentifiers": { "infinite()": "5bec9e67" } + }, + "ewasm": { "wasm": "" }, + "metadata": "{\"compiler\":{\"version\":\"0.8.3+commit.8d00100c\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"infinite\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"d\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"main.sol\":\"InfiniteContract\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"main.sol\":{\"keccak256\":\"0xdee3f3a75354dcd46705d92919495e78aeb24e54aa4626be18e97550ca5972d9\",\"urls\":[\"bzz-raw://30a5f5362c53875bfac4d739d5419e8815889f410029caade6e159b4f1a70092\",\"dweb:/ipfs/Qmb9jgzJySoTZf8jKfaQUoBgwrWA89FcVAw2h7FKnSfpGj\"]}},\"version\":1}", + "storageLayout": { "storage": [], "types": null }, + "userdoc": { "kind": "user", "methods": {}, "version": 1 } + }, + "sourceCode": "\n pragma solidity >=0.8.0;\n \n contract InfiniteContract {\n function infinite() public pure returns(uint d) {while (true) {}}\n }" +} diff --git a/tests/contracts/compiled/InfiniteContractVar.json b/tests/contracts/compiled/InfiniteContractVar.json new file mode 100644 index 00000000000..fe3d7df9f29 --- /dev/null +++ b/tests/contracts/compiled/InfiniteContractVar.json @@ -0,0 +1,1429 @@ +{ + "byteCode": "0x608060405234801561001057600080fd5b506000808190555061017c806100276000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806306661abd1461003b5780635bec9e6714610059575b600080fd5b610043610063565b604051610050919061009c565b60405180910390f35b610061610069565b005b60005481565b5b60011561008b57600160005461008091906100b7565b60008190555061006a565b565b6100968161010d565b82525050565b60006020820190506100b1600083018461008d565b92915050565b60006100c28261010d565b91506100cd8361010d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561010257610101610117565b5b828201905092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea2646970667358221220bcab0385167dbed28dee34f1c5b30ecfcd67915495f0a32d2eeada8e094193a364736f6c63430008030033", + "contract": { + "abi": [ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, + { + "inputs": [], + "name": "count", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "infinite", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "devdoc": { "kind": "dev", "methods": {}, "version": 1 }, + "evm": { + "assembly": " /* \"main.sol\":39:295 contract InfiniteContractVar {... */\n mstore(0x40, 0x80)\n /* \"main.sol\":110:165 constructor() public {... */\n callvalue\n dup1\n iszero\n tag_1\n jumpi\n 0x00\n dup1\n revert\ntag_1:\n pop\n /* \"main.sol\":153:154 0 */\n 0x00\n /* \"main.sol\":145:150 count */\n dup1\n /* \"main.sol\":145:154 count = 0 */\n dup2\n swap1\n sstore\n pop\n /* \"main.sol\":39:295 contract InfiniteContractVar {... */\n dataSize(sub_0)\n dup1\n dataOffset(sub_0)\n 0x00\n codecopy\n 0x00\n return\nstop\n\nsub_0: assembly {\n /* \"main.sol\":39:295 contract InfiniteContractVar {... */\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 0x06661abd\n eq\n tag_3\n jumpi\n dup1\n 0x5bec9e67\n eq\n tag_4\n jumpi\n tag_2:\n 0x00\n dup1\n revert\n /* \"main.sol\":78:95 uint public count */\n tag_3:\n tag_5\n tag_6\n jump\t// in\n tag_5:\n mload(0x40)\n tag_7\n swap2\n swap1\n tag_8\n jump\t// in\n tag_7:\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n return\n /* \"main.sol\":179:289 function infinite() public {... */\n tag_4:\n tag_9\n tag_10\n jump\t// in\n tag_9:\n stop\n /* \"main.sol\":78:95 uint public count */\n tag_6:\n sload(0x00)\n dup2\n jump\t// out\n /* \"main.sol\":179:289 function infinite() public {... */\n tag_10:\n /* \"main.sol\":220:279 while (true) {... */\n tag_12:\n /* \"main.sol\":227:231 true */\n 0x01\n /* \"main.sol\":220:279 while (true) {... */\n iszero\n tag_13\n jumpi\n /* \"main.sol\":263:264 1 */\n 0x01\n /* \"main.sol\":257:262 count */\n sload(0x00)\n /* \"main.sol\":257:264 count+1 */\n tag_14\n swap2\n swap1\n tag_15\n jump\t// in\n tag_14:\n /* \"main.sol\":251:256 count */\n 0x00\n /* \"main.sol\":251:264 count=count+1 */\n dup2\n swap1\n sstore\n pop\n /* \"main.sol\":220:279 while (true) {... */\n jump(tag_12)\n tag_13:\n /* \"main.sol\":179:289 function infinite() public {... */\n jump\t// out\n /* \"#utility.yul\":7:125 */\n tag_17:\n /* \"#utility.yul\":94:118 */\n tag_19\n /* \"#utility.yul\":112:117 */\n dup2\n /* \"#utility.yul\":94:118 */\n tag_20\n jump\t// in\n tag_19:\n /* \"#utility.yul\":89:92 */\n dup3\n /* \"#utility.yul\":82:119 */\n mstore\n /* \"#utility.yul\":72:125 */\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":131:353 */\n tag_8:\n 0x00\n /* \"#utility.yul\":262:264 */\n 0x20\n /* \"#utility.yul\":251:260 */\n dup3\n /* \"#utility.yul\":247:265 */\n add\n /* \"#utility.yul\":239:265 */\n swap1\n pop\n /* \"#utility.yul\":275:346 */\n tag_22\n /* \"#utility.yul\":343:344 */\n 0x00\n /* \"#utility.yul\":332:341 */\n dup4\n /* \"#utility.yul\":328:345 */\n add\n /* \"#utility.yul\":319:325 */\n dup5\n /* \"#utility.yul\":275:346 */\n tag_17\n jump\t// in\n tag_22:\n /* \"#utility.yul\":229:353 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":359:664 */\n tag_15:\n 0x00\n /* \"#utility.yul\":418:438 */\n tag_24\n /* \"#utility.yul\":436:437 */\n dup3\n /* \"#utility.yul\":418:438 */\n tag_20\n jump\t// in\n tag_24:\n /* \"#utility.yul\":413:438 */\n swap2\n pop\n /* \"#utility.yul\":452:472 */\n tag_25\n /* \"#utility.yul\":470:471 */\n dup4\n /* \"#utility.yul\":452:472 */\n tag_20\n jump\t// in\n tag_25:\n /* \"#utility.yul\":447:472 */\n swap3\n pop\n /* \"#utility.yul\":606:607 */\n dup3\n /* \"#utility.yul\":538:604 */\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\n /* \"#utility.yul\":534:608 */\n sub\n /* \"#utility.yul\":531:532 */\n dup3\n /* \"#utility.yul\":528:609 */\n gt\n /* \"#utility.yul\":525:527 */\n iszero\n tag_26\n jumpi\n /* \"#utility.yul\":612:630 */\n tag_27\n tag_28\n jump\t// in\n tag_27:\n /* \"#utility.yul\":525:527 */\n tag_26:\n /* \"#utility.yul\":656:657 */\n dup3\n /* \"#utility.yul\":653:654 */\n dup3\n /* \"#utility.yul\":649:658 */\n add\n /* \"#utility.yul\":642:658 */\n swap1\n pop\n /* \"#utility.yul\":403:664 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":670:747 */\n tag_20:\n 0x00\n /* \"#utility.yul\":736:741 */\n dup2\n /* \"#utility.yul\":725:741 */\n swap1\n pop\n /* \"#utility.yul\":715:747 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":753:933 */\n tag_28:\n /* \"#utility.yul\":801:878 */\n 0x4e487b7100000000000000000000000000000000000000000000000000000000\n /* \"#utility.yul\":798:799 */\n 0x00\n /* \"#utility.yul\":791:879 */\n mstore\n /* \"#utility.yul\":898:902 */\n 0x11\n /* \"#utility.yul\":895:896 */\n 0x04\n /* \"#utility.yul\":888:903 */\n mstore\n /* \"#utility.yul\":922:926 */\n 0x24\n /* \"#utility.yul\":919:920 */\n 0x00\n /* \"#utility.yul\":912:927 */\n revert\n\n auxdata: 0xa2646970667358221220bcab0385167dbed28dee34f1c5b30ecfcd67915495f0a32d2eeada8e094193a364736f6c63430008030033\n}\n", + "bytecode": { + "generatedSources": [], + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b506000808190555061017c806100276000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806306661abd1461003b5780635bec9e6714610059575b600080fd5b610043610063565b604051610050919061009c565b60405180910390f35b610061610069565b005b60005481565b5b60011561008b57600160005461008091906100b7565b60008190555061006a565b565b6100968161010d565b82525050565b60006020820190506100b1600083018461008d565b92915050565b60006100c28261010d565b91506100cd8361010d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561010257610101610117565b5b828201905092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea2646970667358221220bcab0385167dbed28dee34f1c5b30ecfcd67915495f0a32d2eeada8e094193a364736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 DUP2 SWAP1 SSTORE POP PUSH2 0x17C DUP1 PUSH2 0x27 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 0x6661ABD EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x5BEC9E67 EQ PUSH2 0x59 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x63 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x50 SWAP2 SWAP1 PUSH2 0x9C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x61 PUSH2 0x69 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 SLOAD DUP2 JUMP JUMPDEST JUMPDEST PUSH1 0x1 ISZERO PUSH2 0x8B JUMPI PUSH1 0x1 PUSH1 0x0 SLOAD PUSH2 0x80 SWAP2 SWAP1 PUSH2 0xB7 JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 SSTORE POP PUSH2 0x6A JUMP JUMPDEST JUMP JUMPDEST PUSH2 0x96 DUP2 PUSH2 0x10D JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0xB1 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x8D JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC2 DUP3 PUSH2 0x10D JUMP JUMPDEST SWAP2 POP PUSH2 0xCD DUP4 PUSH2 0x10D JUMP JUMPDEST SWAP3 POP DUP3 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SUB DUP3 GT ISZERO PUSH2 0x102 JUMPI PUSH2 0x101 PUSH2 0x117 JUMP JUMPDEST JUMPDEST DUP3 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xBC 0xAB SUB DUP6 AND PUSH30 0xBED28DEE34F1C5B30ECFCD67915495F0A32D2EEADA8E094193A364736F6C PUSH4 0x43000803 STOP CALLER ", + "sourceMap": "39:256:0:-:0;;;110:55;;;;;;;;;;153:1;145:5;:9;;;;39:256;;;;;;" + }, + "deployedBytecode": { + "generatedSources": [ + { + "ast": { + "nodeType": "YulBlock", + "src": "0:936:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "72:53:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "89:3:1" + }, + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "112:5:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "94:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "94:24:1" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "82:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "82:37:1" + }, + "nodeType": "YulExpressionStatement", + "src": "82:37:1" + } + ] + }, + "name": "abi_encode_t_uint256_to_t_uint256_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "60:5:1", + "type": "" + }, + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "67:3:1", + "type": "" + } + ], + "src": "7:118:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "229:124:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "239:26:1", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "251:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "262:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "247:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "247:18:1" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "239:4:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "319:6:1" + }, + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "332:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "343:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "328:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "328:17:1" + } + ], + "functionName": { + "name": "abi_encode_t_uint256_to_t_uint256_fromStack", + "nodeType": "YulIdentifier", + "src": "275:43:1" + }, + "nodeType": "YulFunctionCall", + "src": "275:71:1" + }, + "nodeType": "YulExpressionStatement", + "src": "275:71:1" + } + ] + }, + "name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "201:9:1", + "type": "" + }, + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "213:6:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "224:4:1", + "type": "" + } + ], + "src": "131:222:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "403:261:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "413:25:1", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "436:1:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "418:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "418:20:1" + }, + "variableNames": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "413:1:1" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "447:25:1", + "value": { + "arguments": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "470:1:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "452:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "452:20:1" + }, + "variableNames": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "447:1:1" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "610:22:1", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nodeType": "YulIdentifier", + "src": "612:16:1" + }, + "nodeType": "YulFunctionCall", + "src": "612:18:1" + }, + "nodeType": "YulExpressionStatement", + "src": "612:18:1" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "531:1:1" + }, + { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "538:66:1", + "type": "", + "value": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "606:1:1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "534:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "534:74:1" + } + ], + "functionName": { + "name": "gt", + "nodeType": "YulIdentifier", + "src": "528:2:1" + }, + "nodeType": "YulFunctionCall", + "src": "528:81:1" + }, + "nodeType": "YulIf", + "src": "525:2:1" + }, + { + "nodeType": "YulAssignment", + "src": "642:16:1", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "653:1:1" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "656:1:1" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "649:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "649:9:1" + }, + "variableNames": [ + { + "name": "sum", + "nodeType": "YulIdentifier", + "src": "642:3:1" + } + ] + } + ] + }, + "name": "checked_add_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "x", + "nodeType": "YulTypedName", + "src": "390:1:1", + "type": "" + }, + { + "name": "y", + "nodeType": "YulTypedName", + "src": "393:1:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "sum", + "nodeType": "YulTypedName", + "src": "399:3:1", + "type": "" + } + ], + "src": "359:305:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "715:32:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "725:16:1", + "value": { + "name": "value", + "nodeType": "YulIdentifier", + "src": "736:5:1" + }, + "variableNames": [ + { + "name": "cleaned", + "nodeType": "YulIdentifier", + "src": "725:7:1" + } + ] + } + ] + }, + "name": "cleanup_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "697:5:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "cleaned", + "nodeType": "YulTypedName", + "src": "707:7:1", + "type": "" + } + ], + "src": "670:77:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "781:152:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "798:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "801:77:1", + "type": "", + "value": "35408467139433450592217433187231851964531694900788300625387963629091585785856" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "791:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "791:88:1" + }, + "nodeType": "YulExpressionStatement", + "src": "791:88:1" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "895:1:1", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "898:4:1", + "type": "", + "value": "0x11" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "888:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "888:15:1" + }, + "nodeType": "YulExpressionStatement", + "src": "888:15:1" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "919:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "922:4:1", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "912:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "912:15:1" + }, + "nodeType": "YulExpressionStatement", + "src": "912:15:1" + } + ] + }, + "name": "panic_error_0x11", + "nodeType": "YulFunctionDefinition", + "src": "753:180:1" + } + ] + }, + "contents": "{\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 function checked_add_t_uint256(x, y) -> sum {\n x := cleanup_t_uint256(x)\n y := cleanup_t_uint256(y)\n\n // overflow, if x > (maxValue - y)\n if gt(x, sub(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, y)) { panic_error_0x11() }\n\n sum := add(x, y)\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function panic_error_0x11() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n\n}\n", + "id": 1, + "language": "Yul", + "name": "#utility.yul" + } + ], + "immutableReferences": {}, + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b50600436106100365760003560e01c806306661abd1461003b5780635bec9e6714610059575b600080fd5b610043610063565b604051610050919061009c565b60405180910390f35b610061610069565b005b60005481565b5b60011561008b57600160005461008091906100b7565b60008190555061006a565b565b6100968161010d565b82525050565b60006020820190506100b1600083018461008d565b92915050565b60006100c28261010d565b91506100cd8361010d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561010257610101610117565b5b828201905092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea2646970667358221220bcab0385167dbed28dee34f1c5b30ecfcd67915495f0a32d2eeada8e094193a364736f6c63430008030033", + "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 0x6661ABD EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x5BEC9E67 EQ PUSH2 0x59 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x63 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x50 SWAP2 SWAP1 PUSH2 0x9C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x61 PUSH2 0x69 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 SLOAD DUP2 JUMP JUMPDEST JUMPDEST PUSH1 0x1 ISZERO PUSH2 0x8B JUMPI PUSH1 0x1 PUSH1 0x0 SLOAD PUSH2 0x80 SWAP2 SWAP1 PUSH2 0xB7 JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 SSTORE POP PUSH2 0x6A JUMP JUMPDEST JUMP JUMPDEST PUSH2 0x96 DUP2 PUSH2 0x10D JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0xB1 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x8D JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC2 DUP3 PUSH2 0x10D JUMP JUMPDEST SWAP2 POP PUSH2 0xCD DUP4 PUSH2 0x10D JUMP JUMPDEST SWAP3 POP DUP3 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SUB DUP3 GT ISZERO PUSH2 0x102 JUMPI PUSH2 0x101 PUSH2 0x117 JUMP JUMPDEST JUMPDEST DUP3 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xBC 0xAB SUB DUP6 AND PUSH30 0xBED28DEE34F1C5B30ECFCD67915495F0A32D2EEADA8E094193A364736F6C PUSH4 0x43000803 STOP CALLER ", + "sourceMap": "39:256:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;78:17;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;179:110;;;:::i;:::-;;78:17;;;;:::o;179:110::-;220:59;227:4;220:59;;;263:1;257:5;;:7;;;;:::i;:::-;251:5;:13;;;;220:59;;;179:110::o;7:118:1:-;94:24;112:5;94:24;:::i;:::-;89:3;82:37;72:53;;:::o;131:222::-;;262:2;251:9;247:18;239:26;;275:71;343:1;332:9;328:17;319:6;275:71;:::i;:::-;229:124;;;;:::o;359:305::-;;418:20;436:1;418:20;:::i;:::-;413:25;;452:20;470:1;452:20;:::i;:::-;447:25;;606:1;538:66;534:74;531:1;528:81;525:2;;;612:18;;:::i;:::-;525:2;656:1;653;649:9;642:16;;403:261;;;;:::o;670:77::-;;736:5;725:16;;715:32;;;:::o;753:180::-;801:77;798:1;791:88;898:4;895:1;888:15;922:4;919:1;912:15" + }, + "gasEstimates": { + "creation": { + "codeDepositCost": "76000", + "executionCost": "5137", + "totalCost": "81137" + }, + "external": { "count()": "1107", "infinite()": "infinite" } + }, + "legacyAssembly": { + ".code": [ + { + "begin": 39, + "end": 295, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 39, + "end": 295, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 39, "end": 295, "name": "MSTORE", "source": 0 }, + { "begin": 110, "end": 165, "name": "CALLVALUE", "source": 0 }, + { "begin": 110, "end": 165, "name": "DUP1", "source": 0 }, + { "begin": 110, "end": 165, "name": "ISZERO", "source": 0 }, + { + "begin": 110, + "end": 165, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 110, "end": 165, "name": "JUMPI", "source": 0 }, + { + "begin": 110, + "end": 165, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 110, "end": 165, "name": "DUP1", "source": 0 }, + { "begin": 110, "end": 165, "name": "REVERT", "source": 0 }, + { + "begin": 110, + "end": 165, + "name": "tag", + "source": 0, + "value": "1" + }, + { "begin": 110, "end": 165, "name": "JUMPDEST", "source": 0 }, + { "begin": 110, "end": 165, "name": "POP", "source": 0 }, + { + "begin": 153, + "end": 154, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 145, "end": 150, "name": "DUP1", "source": 0 }, + { "begin": 145, "end": 154, "name": "DUP2", "source": 0 }, + { "begin": 145, "end": 154, "name": "SWAP1", "source": 0 }, + { "begin": 145, "end": 154, "name": "SSTORE", "source": 0 }, + { "begin": 145, "end": 154, "name": "POP", "source": 0 }, + { + "begin": 39, + "end": 295, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 39, "end": 295, "name": "DUP1", "source": 0 }, + { + "begin": 39, + "end": 295, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 39, + "end": 295, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 295, "name": "CODECOPY", "source": 0 }, + { + "begin": 39, + "end": 295, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 295, "name": "RETURN", "source": 0 } + ], + ".data": { + "0": { + ".auxdata": "a2646970667358221220bcab0385167dbed28dee34f1c5b30ecfcd67915495f0a32d2eeada8e094193a364736f6c63430008030033", + ".code": [ + { + "begin": 39, + "end": 295, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 39, + "end": 295, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 39, "end": 295, "name": "MSTORE", "source": 0 }, + { "begin": 39, "end": 295, "name": "CALLVALUE", "source": 0 }, + { "begin": 39, "end": 295, "name": "DUP1", "source": 0 }, + { "begin": 39, "end": 295, "name": "ISZERO", "source": 0 }, + { + "begin": 39, + "end": 295, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 39, "end": 295, "name": "JUMPI", "source": 0 }, + { + "begin": 39, + "end": 295, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 295, "name": "DUP1", "source": 0 }, + { "begin": 39, "end": 295, "name": "REVERT", "source": 0 }, + { + "begin": 39, + "end": 295, + "name": "tag", + "source": 0, + "value": "1" + }, + { "begin": 39, "end": 295, "name": "JUMPDEST", "source": 0 }, + { "begin": 39, "end": 295, "name": "POP", "source": 0 }, + { + "begin": 39, + "end": 295, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 39, "end": 295, "name": "CALLDATASIZE", "source": 0 }, + { "begin": 39, "end": 295, "name": "LT", "source": 0 }, + { + "begin": 39, + "end": 295, + "name": "PUSH [tag]", + "source": 0, + "value": "2" + }, + { "begin": 39, "end": 295, "name": "JUMPI", "source": 0 }, + { + "begin": 39, + "end": 295, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 295, "name": "CALLDATALOAD", "source": 0 }, + { + "begin": 39, + "end": 295, + "name": "PUSH", + "source": 0, + "value": "E0" + }, + { "begin": 39, "end": 295, "name": "SHR", "source": 0 }, + { "begin": 39, "end": 295, "name": "DUP1", "source": 0 }, + { + "begin": 39, + "end": 295, + "name": "PUSH", + "source": 0, + "value": "6661ABD" + }, + { "begin": 39, "end": 295, "name": "EQ", "source": 0 }, + { + "begin": 39, + "end": 295, + "name": "PUSH [tag]", + "source": 0, + "value": "3" + }, + { "begin": 39, "end": 295, "name": "JUMPI", "source": 0 }, + { "begin": 39, "end": 295, "name": "DUP1", "source": 0 }, + { + "begin": 39, + "end": 295, + "name": "PUSH", + "source": 0, + "value": "5BEC9E67" + }, + { "begin": 39, "end": 295, "name": "EQ", "source": 0 }, + { + "begin": 39, + "end": 295, + "name": "PUSH [tag]", + "source": 0, + "value": "4" + }, + { "begin": 39, "end": 295, "name": "JUMPI", "source": 0 }, + { + "begin": 39, + "end": 295, + "name": "tag", + "source": 0, + "value": "2" + }, + { "begin": 39, "end": 295, "name": "JUMPDEST", "source": 0 }, + { + "begin": 39, + "end": 295, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 295, "name": "DUP1", "source": 0 }, + { "begin": 39, "end": 295, "name": "REVERT", "source": 0 }, + { + "begin": 78, + "end": 95, + "name": "tag", + "source": 0, + "value": "3" + }, + { "begin": 78, "end": 95, "name": "JUMPDEST", "source": 0 }, + { + "begin": 78, + "end": 95, + "name": "PUSH [tag]", + "source": 0, + "value": "5" + }, + { + "begin": 78, + "end": 95, + "name": "PUSH [tag]", + "source": 0, + "value": "6" + }, + { + "begin": 78, + "end": 95, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 78, + "end": 95, + "name": "tag", + "source": 0, + "value": "5" + }, + { "begin": 78, "end": 95, "name": "JUMPDEST", "source": 0 }, + { + "begin": 78, + "end": 95, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 78, "end": 95, "name": "MLOAD", "source": 0 }, + { + "begin": 78, + "end": 95, + "name": "PUSH [tag]", + "source": 0, + "value": "7" + }, + { "begin": 78, "end": 95, "name": "SWAP2", "source": 0 }, + { "begin": 78, "end": 95, "name": "SWAP1", "source": 0 }, + { + "begin": 78, + "end": 95, + "name": "PUSH [tag]", + "source": 0, + "value": "8" + }, + { + "begin": 78, + "end": 95, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 78, + "end": 95, + "name": "tag", + "source": 0, + "value": "7" + }, + { "begin": 78, "end": 95, "name": "JUMPDEST", "source": 0 }, + { + "begin": 78, + "end": 95, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 78, "end": 95, "name": "MLOAD", "source": 0 }, + { "begin": 78, "end": 95, "name": "DUP1", "source": 0 }, + { "begin": 78, "end": 95, "name": "SWAP2", "source": 0 }, + { "begin": 78, "end": 95, "name": "SUB", "source": 0 }, + { "begin": 78, "end": 95, "name": "SWAP1", "source": 0 }, + { "begin": 78, "end": 95, "name": "RETURN", "source": 0 }, + { + "begin": 179, + "end": 289, + "name": "tag", + "source": 0, + "value": "4" + }, + { "begin": 179, "end": 289, "name": "JUMPDEST", "source": 0 }, + { + "begin": 179, + "end": 289, + "name": "PUSH [tag]", + "source": 0, + "value": "9" + }, + { + "begin": 179, + "end": 289, + "name": "PUSH [tag]", + "source": 0, + "value": "10" + }, + { + "begin": 179, + "end": 289, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 179, + "end": 289, + "name": "tag", + "source": 0, + "value": "9" + }, + { "begin": 179, "end": 289, "name": "JUMPDEST", "source": 0 }, + { "begin": 179, "end": 289, "name": "STOP", "source": 0 }, + { + "begin": 78, + "end": 95, + "name": "tag", + "source": 0, + "value": "6" + }, + { "begin": 78, "end": 95, "name": "JUMPDEST", "source": 0 }, + { + "begin": 78, + "end": 95, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 78, "end": 95, "name": "SLOAD", "source": 0 }, + { "begin": 78, "end": 95, "name": "DUP2", "source": 0 }, + { + "begin": 78, + "end": 95, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { + "begin": 179, + "end": 289, + "name": "tag", + "source": 0, + "value": "10" + }, + { "begin": 179, "end": 289, "name": "JUMPDEST", "source": 0 }, + { + "begin": 220, + "end": 279, + "name": "tag", + "source": 0, + "value": "12" + }, + { "begin": 220, "end": 279, "name": "JUMPDEST", "source": 0 }, + { + "begin": 227, + "end": 231, + "name": "PUSH", + "source": 0, + "value": "1" + }, + { "begin": 220, "end": 279, "name": "ISZERO", "source": 0 }, + { + "begin": 220, + "end": 279, + "name": "PUSH [tag]", + "source": 0, + "value": "13" + }, + { "begin": 220, "end": 279, "name": "JUMPI", "source": 0 }, + { + "begin": 263, + "end": 264, + "name": "PUSH", + "source": 0, + "value": "1" + }, + { + "begin": 257, + "end": 262, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 257, "end": 262, "name": "SLOAD", "source": 0 }, + { + "begin": 257, + "end": 264, + "name": "PUSH [tag]", + "source": 0, + "value": "14" + }, + { "begin": 257, "end": 264, "name": "SWAP2", "source": 0 }, + { "begin": 257, "end": 264, "name": "SWAP1", "source": 0 }, + { + "begin": 257, + "end": 264, + "name": "PUSH [tag]", + "source": 0, + "value": "15" + }, + { + "begin": 257, + "end": 264, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 257, + "end": 264, + "name": "tag", + "source": 0, + "value": "14" + }, + { "begin": 257, "end": 264, "name": "JUMPDEST", "source": 0 }, + { + "begin": 251, + "end": 256, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 251, "end": 264, "name": "DUP2", "source": 0 }, + { "begin": 251, "end": 264, "name": "SWAP1", "source": 0 }, + { "begin": 251, "end": 264, "name": "SSTORE", "source": 0 }, + { "begin": 251, "end": 264, "name": "POP", "source": 0 }, + { + "begin": 220, + "end": 279, + "name": "PUSH [tag]", + "source": 0, + "value": "12" + }, + { "begin": 220, "end": 279, "name": "JUMP", "source": 0 }, + { + "begin": 220, + "end": 279, + "name": "tag", + "source": 0, + "value": "13" + }, + { "begin": 220, "end": 279, "name": "JUMPDEST", "source": 0 }, + { + "begin": 179, + "end": 289, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { + "begin": 7, + "end": 125, + "name": "tag", + "source": 1, + "value": "17" + }, + { "begin": 7, "end": 125, "name": "JUMPDEST", "source": 1 }, + { + "begin": 94, + "end": 118, + "name": "PUSH [tag]", + "source": 1, + "value": "19" + }, + { "begin": 112, "end": 117, "name": "DUP2", "source": 1 }, + { + "begin": 94, + "end": 118, + "name": "PUSH [tag]", + "source": 1, + "value": "20" + }, + { + "begin": 94, + "end": 118, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 94, + "end": 118, + "name": "tag", + "source": 1, + "value": "19" + }, + { "begin": 94, "end": 118, "name": "JUMPDEST", "source": 1 }, + { "begin": 89, "end": 92, "name": "DUP3", "source": 1 }, + { "begin": 82, "end": 119, "name": "MSTORE", "source": 1 }, + { "begin": 72, "end": 125, "name": "POP", "source": 1 }, + { "begin": 72, "end": 125, "name": "POP", "source": 1 }, + { + "begin": 72, + "end": 125, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 131, + "end": 353, + "name": "tag", + "source": 1, + "value": "8" + }, + { "begin": 131, "end": 353, "name": "JUMPDEST", "source": 1 }, + { + "begin": 131, + "end": 353, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 262, + "end": 264, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 251, "end": 260, "name": "DUP3", "source": 1 }, + { "begin": 247, "end": 265, "name": "ADD", "source": 1 }, + { "begin": 239, "end": 265, "name": "SWAP1", "source": 1 }, + { "begin": 239, "end": 265, "name": "POP", "source": 1 }, + { + "begin": 275, + "end": 346, + "name": "PUSH [tag]", + "source": 1, + "value": "22" + }, + { + "begin": 343, + "end": 344, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 332, "end": 341, "name": "DUP4", "source": 1 }, + { "begin": 328, "end": 345, "name": "ADD", "source": 1 }, + { "begin": 319, "end": 325, "name": "DUP5", "source": 1 }, + { + "begin": 275, + "end": 346, + "name": "PUSH [tag]", + "source": 1, + "value": "17" + }, + { + "begin": 275, + "end": 346, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 275, + "end": 346, + "name": "tag", + "source": 1, + "value": "22" + }, + { "begin": 275, "end": 346, "name": "JUMPDEST", "source": 1 }, + { "begin": 229, "end": 353, "name": "SWAP3", "source": 1 }, + { "begin": 229, "end": 353, "name": "SWAP2", "source": 1 }, + { "begin": 229, "end": 353, "name": "POP", "source": 1 }, + { "begin": 229, "end": 353, "name": "POP", "source": 1 }, + { + "begin": 229, + "end": 353, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 359, + "end": 664, + "name": "tag", + "source": 1, + "value": "15" + }, + { "begin": 359, "end": 664, "name": "JUMPDEST", "source": 1 }, + { + "begin": 359, + "end": 664, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 418, + "end": 438, + "name": "PUSH [tag]", + "source": 1, + "value": "24" + }, + { "begin": 436, "end": 437, "name": "DUP3", "source": 1 }, + { + "begin": 418, + "end": 438, + "name": "PUSH [tag]", + "source": 1, + "value": "20" + }, + { + "begin": 418, + "end": 438, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 418, + "end": 438, + "name": "tag", + "source": 1, + "value": "24" + }, + { "begin": 418, "end": 438, "name": "JUMPDEST", "source": 1 }, + { "begin": 413, "end": 438, "name": "SWAP2", "source": 1 }, + { "begin": 413, "end": 438, "name": "POP", "source": 1 }, + { + "begin": 452, + "end": 472, + "name": "PUSH [tag]", + "source": 1, + "value": "25" + }, + { "begin": 470, "end": 471, "name": "DUP4", "source": 1 }, + { + "begin": 452, + "end": 472, + "name": "PUSH [tag]", + "source": 1, + "value": "20" + }, + { + "begin": 452, + "end": 472, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 452, + "end": 472, + "name": "tag", + "source": 1, + "value": "25" + }, + { "begin": 452, "end": 472, "name": "JUMPDEST", "source": 1 }, + { "begin": 447, "end": 472, "name": "SWAP3", "source": 1 }, + { "begin": 447, "end": 472, "name": "POP", "source": 1 }, + { "begin": 606, "end": 607, "name": "DUP3", "source": 1 }, + { + "begin": 538, + "end": 604, + "name": "PUSH", + "source": 1, + "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + }, + { "begin": 534, "end": 608, "name": "SUB", "source": 1 }, + { "begin": 531, "end": 532, "name": "DUP3", "source": 1 }, + { "begin": 528, "end": 609, "name": "GT", "source": 1 }, + { "begin": 525, "end": 527, "name": "ISZERO", "source": 1 }, + { + "begin": 525, + "end": 527, + "name": "PUSH [tag]", + "source": 1, + "value": "26" + }, + { "begin": 525, "end": 527, "name": "JUMPI", "source": 1 }, + { + "begin": 612, + "end": 630, + "name": "PUSH [tag]", + "source": 1, + "value": "27" + }, + { + "begin": 612, + "end": 630, + "name": "PUSH [tag]", + "source": 1, + "value": "28" + }, + { + "begin": 612, + "end": 630, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 612, + "end": 630, + "name": "tag", + "source": 1, + "value": "27" + }, + { "begin": 612, "end": 630, "name": "JUMPDEST", "source": 1 }, + { + "begin": 525, + "end": 527, + "name": "tag", + "source": 1, + "value": "26" + }, + { "begin": 525, "end": 527, "name": "JUMPDEST", "source": 1 }, + { "begin": 656, "end": 657, "name": "DUP3", "source": 1 }, + { "begin": 653, "end": 654, "name": "DUP3", "source": 1 }, + { "begin": 649, "end": 658, "name": "ADD", "source": 1 }, + { "begin": 642, "end": 658, "name": "SWAP1", "source": 1 }, + { "begin": 642, "end": 658, "name": "POP", "source": 1 }, + { "begin": 403, "end": 664, "name": "SWAP3", "source": 1 }, + { "begin": 403, "end": 664, "name": "SWAP2", "source": 1 }, + { "begin": 403, "end": 664, "name": "POP", "source": 1 }, + { "begin": 403, "end": 664, "name": "POP", "source": 1 }, + { + "begin": 403, + "end": 664, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 670, + "end": 747, + "name": "tag", + "source": 1, + "value": "20" + }, + { "begin": 670, "end": 747, "name": "JUMPDEST", "source": 1 }, + { + "begin": 670, + "end": 747, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 736, "end": 741, "name": "DUP2", "source": 1 }, + { "begin": 725, "end": 741, "name": "SWAP1", "source": 1 }, + { "begin": 725, "end": 741, "name": "POP", "source": 1 }, + { "begin": 715, "end": 747, "name": "SWAP2", "source": 1 }, + { "begin": 715, "end": 747, "name": "SWAP1", "source": 1 }, + { "begin": 715, "end": 747, "name": "POP", "source": 1 }, + { + "begin": 715, + "end": 747, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 753, + "end": 933, + "name": "tag", + "source": 1, + "value": "28" + }, + { "begin": 753, "end": 933, "name": "JUMPDEST", "source": 1 }, + { + "begin": 801, + "end": 878, + "name": "PUSH", + "source": 1, + "value": "4E487B7100000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 798, + "end": 799, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 791, "end": 879, "name": "MSTORE", "source": 1 }, + { + "begin": 898, + "end": 902, + "name": "PUSH", + "source": 1, + "value": "11" + }, + { + "begin": 895, + "end": 896, + "name": "PUSH", + "source": 1, + "value": "4" + }, + { "begin": 888, "end": 903, "name": "MSTORE", "source": 1 }, + { + "begin": 922, + "end": 926, + "name": "PUSH", + "source": 1, + "value": "24" + }, + { + "begin": 919, + "end": 920, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 912, "end": 927, "name": "REVERT", "source": 1 } + ] + } + } + }, + "methodIdentifiers": { "count()": "06661abd", "infinite()": "5bec9e67" } + }, + "ewasm": { "wasm": "" }, + "metadata": "{\"compiler\":{\"version\":\"0.8.3+commit.8d00100c\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"count\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"infinite\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"main.sol\":\"InfiniteContractVar\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"main.sol\":{\"keccak256\":\"0xcbf39d64fe7bd82974aa5a9bfb42586c61e5bb9108ce181d9ed5e1de9391de09\",\"urls\":[\"bzz-raw://b923edaafc3bd169c716485816211c8e1beabd855c34d9e1ca3702adae418b82\",\"dweb:/ipfs/QmQeXeFbuCmnqG1aSBxwmn5j5M4zPkmUWmbZcXytvYURwC\"]}},\"version\":1}", + "storageLayout": { + "storage": [ + { + "astId": 3, + "contract": "main.sol:InfiniteContractVar", + "label": "count", + "offset": 0, + "slot": "0", + "type": "t_uint256" + } + ], + "types": { + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + }, + "userdoc": { "kind": "user", "methods": {}, "version": 1 } + }, + "sourceCode": "\n pragma solidity >=0.8.0;\n \n contract InfiniteContractVar {\n uint public count;\n \n constructor() public {\n count = 0;\n }\n \n function infinite() public {\n while (true) {\n count=count+1;\n }\n }\n }" +} diff --git a/tests/contracts/compiled/ModularCheck.json b/tests/contracts/compiled/ModularCheck.json new file mode 100644 index 00000000000..44d45af3d9f --- /dev/null +++ b/tests/contracts/compiled/ModularCheck.json @@ -0,0 +1,2206 @@ +{ + "byteCode": "0x608060405234801561001057600080fd5b50600561002760036005600761005660201b60201c565b1461003157600080fd5b600361004760056007600b61005660201b60201c565b1461005157600080fd5b6100a5565b600060405160208152602080820152602060408201528460608201528360808201528260a082015260c05160208160c08460006005600019f161009857600080fd5b8051925050509392505050565b610194806100b46000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80633148f14f14610030575b600080fd5b61004a600480360381019061004591906100c4565b610060565b6040516100579190610122565b60405180910390f35b600060405160208152602080820152602060408201528460608201528360808201528260a082015260c05160208160c08460006005600019f16100a257600080fd5b8051925050509392505050565b6000813590506100be81610147565b92915050565b6000806000606084860312156100d957600080fd5b60006100e7868287016100af565b93505060206100f8868287016100af565b9250506040610109868287016100af565b9150509250925092565b61011c8161013d565b82525050565b60006020820190506101376000830184610113565b92915050565b6000819050919050565b6101508161013d565b811461015b57600080fd5b5056fea26469706673582212205f3f19a3a3bb3f56c5da1cf9b7d05e76435904fa7fe3154211cd2f9911af7b2f64736f6c63430008030033", + "contract": { + "abi": [ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, + { + "inputs": [ + { "internalType": "uint256", "name": "_b", "type": "uint256" }, + { "internalType": "uint256", "name": "_e", "type": "uint256" }, + { "internalType": "uint256", "name": "_m", "type": "uint256" } + ], + "name": "modExp", + "outputs": [ + { "internalType": "uint256", "name": "result", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "devdoc": { "kind": "dev", "methods": {}, "version": 1 }, + "evm": { + "assembly": " /* \"main.sol\":34:1334 contract ModularCheck {... */\n mstore(0x40, 0x80)\n /* \"main.sol\":118:230 constructor() {... */\n callvalue\n dup1\n iszero\n tag_1\n jumpi\n 0x00\n dup1\n revert\ntag_1:\n pop\n /* \"main.sol\":173:174 5 */\n 0x05\n /* \"main.sol\":154:169 modExp(3, 5, 7) */\n tag_4\n /* \"main.sol\":161:162 3 */\n 0x03\n /* \"main.sol\":164:165 5 */\n 0x05\n /* \"main.sol\":167:168 7 */\n 0x07\n /* \"main.sol\":154:160 modExp */\n shl(0x20, tag_5)\n /* \"main.sol\":154:169 modExp(3, 5, 7) */\n 0x20\n shr\n jump\t// in\ntag_4:\n /* \"main.sol\":154:174 modExp(3, 5, 7) == 5 */\n eq\n /* \"main.sol\":146:175 require(modExp(3, 5, 7) == 5) */\n tag_6\n jumpi\n 0x00\n dup1\n revert\ntag_6:\n /* \"main.sol\":217:218 3 */\n 0x03\n /* \"main.sol\":197:213 modExp(5, 7, 11) */\n tag_7\n /* \"main.sol\":204:205 5 */\n 0x05\n /* \"main.sol\":207:208 7 */\n 0x07\n /* \"main.sol\":210:212 11 */\n 0x0b\n /* \"main.sol\":197:203 modExp */\n shl(0x20, tag_5)\n /* \"main.sol\":197:213 modExp(5, 7, 11) */\n 0x20\n shr\n jump\t// in\ntag_7:\n /* \"main.sol\":197:218 modExp(5, 7, 11) == 3 */\n eq\n /* \"main.sol\":189:219 require(modExp(5, 7, 11) == 3) */\n tag_8\n jumpi\n 0x00\n dup1\n revert\ntag_8:\n /* \"main.sol\":34:1334 contract ModularCheck {... */\n jump(tag_9)\n /* \"main.sol\":364:1328 function modExp(uint256 _b, uint256 _e, uint256 _m) public returns (uint256 result) {... */\ntag_5:\n /* \"main.sol\":432:446 uint256 result */\n 0x00\n /* \"main.sol\":549:553 0x40 */\n 0x40\n /* \"main.sol\":543:554 mload(0x40) */\n mload\n /* \"main.sol\":672:676 0x20 */\n 0x20\n /* \"main.sol\":663:670 pointer */\n dup2\n /* \"main.sol\":656:677 mstore(pointer, 0x20) */\n mstore\n /* \"main.sol\":721:725 0x20 */\n 0x20\n /* \"main.sol\":714:718 0x20 */\n dup1\n /* \"main.sol\":705:712 pointer */\n dup3\n /* \"main.sol\":701:719 add(pointer, 0x20) */\n add\n /* \"main.sol\":694:726 mstore(add(pointer, 0x20), 0x20) */\n mstore\n /* \"main.sol\":770:774 0x20 */\n 0x20\n /* \"main.sol\":763:767 0x40 */\n 0x40\n /* \"main.sol\":754:761 pointer */\n dup3\n /* \"main.sol\":750:768 add(pointer, 0x40) */\n add\n /* \"main.sol\":743:775 mstore(add(pointer, 0x40), 0x20) */\n mstore\n /* \"main.sol\":886:888 _b */\n dup5\n /* \"main.sol\":879:883 0x60 */\n 0x60\n /* \"main.sol\":870:877 pointer */\n dup3\n /* \"main.sol\":866:884 add(pointer, 0x60) */\n add\n /* \"main.sol\":859:889 mstore(add(pointer, 0x60), _b) */\n mstore\n /* \"main.sol\":933:935 _e */\n dup4\n /* \"main.sol\":926:930 0x80 */\n 0x80\n /* \"main.sol\":917:924 pointer */\n dup3\n /* \"main.sol\":913:931 add(pointer, 0x80) */\n add\n /* \"main.sol\":906:936 mstore(add(pointer, 0x80), _e) */\n mstore\n /* \"main.sol\":981:983 _m */\n dup3\n /* \"main.sol\":974:978 0xa0 */\n 0xa0\n /* \"main.sol\":965:972 pointer */\n dup3\n /* \"main.sol\":961:979 add(pointer, 0xa0) */\n add\n /* \"main.sol\":954:984 mstore(add(pointer, 0xa0), _m) */\n mstore\n /* \"main.sol\":1056:1060 0xc0 */\n 0xc0\n /* \"main.sol\":1050:1061 mload(0xc0) */\n mload\n /* \"main.sol\":1202:1206 0x20 */\n 0x20\n /* \"main.sol\":1195:1200 value */\n dup2\n /* \"main.sol\":1189:1193 0xc0 */\n 0xc0\n /* \"main.sol\":1180:1187 pointer */\n dup5\n /* \"main.sol\":1177:1178 0 */\n 0x00\n /* \"main.sol\":1171:1175 0x05 */\n 0x05\n /* \"main.sol\":1167:1168 0 */\n 0x00\n /* \"main.sol\":1163:1169 not(0) */\n not\n /* \"main.sol\":1158:1207 call(not(0), 0x05, 0, pointer, 0xc0, value, 0x20) */\n call\n /* \"main.sol\":1148:1150 if */\n tag_11\n jumpi\n /* \"main.sol\":1241:1242 0 */\n 0x00\n /* \"main.sol\":1238:1239 0 */\n dup1\n /* \"main.sol\":1231:1243 revert(0, 0) */\n revert\n /* \"main.sol\":1148:1150 if */\ntag_11:\n /* \"main.sol\":1298:1303 value */\n dup1\n /* \"main.sol\":1292:1304 mload(value) */\n mload\n /* \"main.sol\":1282:1304 result := mload(value) */\n swap3\n pop\n /* \"main.sol\":471:1318 {... */\n pop\n pop\n swap4\n swap3\n pop\n pop\n pop\n jump\t// out\n /* \"main.sol\":34:1334 contract ModularCheck {... */\ntag_9:\n dataSize(sub_0)\n dup1\n dataOffset(sub_0)\n 0x00\n codecopy\n 0x00\n return\nstop\n\nsub_0: assembly {\n /* \"main.sol\":34:1334 contract ModularCheck {... */\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 0x3148f14f\n eq\n tag_3\n jumpi\n tag_2:\n 0x00\n dup1\n revert\n /* \"main.sol\":364:1328 function modExp(uint256 _b, uint256 _e, uint256 _m) public returns (uint256 result) {... */\n tag_3:\n tag_4\n 0x04\n dup1\n calldatasize\n sub\n dup2\n add\n swap1\n tag_5\n swap2\n swap1\n tag_6\n jump\t// in\n tag_5:\n tag_7\n jump\t// in\n tag_4:\n mload(0x40)\n tag_8\n swap2\n swap1\n tag_9\n jump\t// in\n tag_8:\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n return\n tag_7:\n /* \"main.sol\":432:446 uint256 result */\n 0x00\n /* \"main.sol\":549:553 0x40 */\n 0x40\n /* \"main.sol\":543:554 mload(0x40) */\n mload\n /* \"main.sol\":672:676 0x20 */\n 0x20\n /* \"main.sol\":663:670 pointer */\n dup2\n /* \"main.sol\":656:677 mstore(pointer, 0x20) */\n mstore\n /* \"main.sol\":721:725 0x20 */\n 0x20\n /* \"main.sol\":714:718 0x20 */\n dup1\n /* \"main.sol\":705:712 pointer */\n dup3\n /* \"main.sol\":701:719 add(pointer, 0x20) */\n add\n /* \"main.sol\":694:726 mstore(add(pointer, 0x20), 0x20) */\n mstore\n /* \"main.sol\":770:774 0x20 */\n 0x20\n /* \"main.sol\":763:767 0x40 */\n 0x40\n /* \"main.sol\":754:761 pointer */\n dup3\n /* \"main.sol\":750:768 add(pointer, 0x40) */\n add\n /* \"main.sol\":743:775 mstore(add(pointer, 0x40), 0x20) */\n mstore\n /* \"main.sol\":886:888 _b */\n dup5\n /* \"main.sol\":879:883 0x60 */\n 0x60\n /* \"main.sol\":870:877 pointer */\n dup3\n /* \"main.sol\":866:884 add(pointer, 0x60) */\n add\n /* \"main.sol\":859:889 mstore(add(pointer, 0x60), _b) */\n mstore\n /* \"main.sol\":933:935 _e */\n dup4\n /* \"main.sol\":926:930 0x80 */\n 0x80\n /* \"main.sol\":917:924 pointer */\n dup3\n /* \"main.sol\":913:931 add(pointer, 0x80) */\n add\n /* \"main.sol\":906:936 mstore(add(pointer, 0x80), _e) */\n mstore\n /* \"main.sol\":981:983 _m */\n dup3\n /* \"main.sol\":974:978 0xa0 */\n 0xa0\n /* \"main.sol\":965:972 pointer */\n dup3\n /* \"main.sol\":961:979 add(pointer, 0xa0) */\n add\n /* \"main.sol\":954:984 mstore(add(pointer, 0xa0), _m) */\n mstore\n /* \"main.sol\":1056:1060 0xc0 */\n 0xc0\n /* \"main.sol\":1050:1061 mload(0xc0) */\n mload\n /* \"main.sol\":1202:1206 0x20 */\n 0x20\n /* \"main.sol\":1195:1200 value */\n dup2\n /* \"main.sol\":1189:1193 0xc0 */\n 0xc0\n /* \"main.sol\":1180:1187 pointer */\n dup5\n /* \"main.sol\":1177:1178 0 */\n 0x00\n /* \"main.sol\":1171:1175 0x05 */\n 0x05\n /* \"main.sol\":1167:1168 0 */\n 0x00\n /* \"main.sol\":1163:1169 not(0) */\n not\n /* \"main.sol\":1158:1207 call(not(0), 0x05, 0, pointer, 0xc0, value, 0x20) */\n call\n /* \"main.sol\":1148:1150 if */\n tag_11\n jumpi\n /* \"main.sol\":1241:1242 0 */\n 0x00\n /* \"main.sol\":1238:1239 0 */\n dup1\n /* \"main.sol\":1231:1243 revert(0, 0) */\n revert\n /* \"main.sol\":1148:1150 if */\n tag_11:\n /* \"main.sol\":1298:1303 value */\n dup1\n /* \"main.sol\":1292:1304 mload(value) */\n mload\n /* \"main.sol\":1282:1304 result := mload(value) */\n swap3\n pop\n /* \"main.sol\":471:1318 {... */\n pop\n pop\n swap4\n swap3\n pop\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":7:146 */\n tag_13:\n 0x00\n /* \"#utility.yul\":91:97 */\n dup2\n /* \"#utility.yul\":78:98 */\n calldataload\n /* \"#utility.yul\":69:98 */\n swap1\n pop\n /* \"#utility.yul\":107:140 */\n tag_15\n /* \"#utility.yul\":134:139 */\n dup2\n /* \"#utility.yul\":107:140 */\n tag_16\n jump\t// in\n tag_15:\n /* \"#utility.yul\":59:146 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":152:704 */\n tag_6:\n 0x00\n dup1\n 0x00\n /* \"#utility.yul\":294:296 */\n 0x60\n /* \"#utility.yul\":282:291 */\n dup5\n /* \"#utility.yul\":273:280 */\n dup7\n /* \"#utility.yul\":269:292 */\n sub\n /* \"#utility.yul\":265:297 */\n slt\n /* \"#utility.yul\":262:264 */\n iszero\n tag_18\n jumpi\n /* \"#utility.yul\":310:311 */\n 0x00\n /* \"#utility.yul\":307:308 */\n dup1\n /* \"#utility.yul\":300:312 */\n revert\n /* \"#utility.yul\":262:264 */\n tag_18:\n /* \"#utility.yul\":353:354 */\n 0x00\n /* \"#utility.yul\":378:431 */\n tag_19\n /* \"#utility.yul\":423:430 */\n dup7\n /* \"#utility.yul\":414:420 */\n dup3\n /* \"#utility.yul\":403:412 */\n dup8\n /* \"#utility.yul\":399:421 */\n add\n /* \"#utility.yul\":378:431 */\n tag_13\n jump\t// in\n tag_19:\n /* \"#utility.yul\":368:431 */\n swap4\n pop\n /* \"#utility.yul\":324:441 */\n pop\n /* \"#utility.yul\":480:482 */\n 0x20\n /* \"#utility.yul\":506:559 */\n tag_20\n /* \"#utility.yul\":551:558 */\n dup7\n /* \"#utility.yul\":542:548 */\n dup3\n /* \"#utility.yul\":531:540 */\n dup8\n /* \"#utility.yul\":527:549 */\n add\n /* \"#utility.yul\":506:559 */\n tag_13\n jump\t// in\n tag_20:\n /* \"#utility.yul\":496:559 */\n swap3\n pop\n /* \"#utility.yul\":451:569 */\n pop\n /* \"#utility.yul\":608:610 */\n 0x40\n /* \"#utility.yul\":634:687 */\n tag_21\n /* \"#utility.yul\":679:686 */\n dup7\n /* \"#utility.yul\":670:676 */\n dup3\n /* \"#utility.yul\":659:668 */\n dup8\n /* \"#utility.yul\":655:677 */\n add\n /* \"#utility.yul\":634:687 */\n tag_13\n jump\t// in\n tag_21:\n /* \"#utility.yul\":624:687 */\n swap2\n pop\n /* \"#utility.yul\":579:697 */\n pop\n /* \"#utility.yul\":252:704 */\n swap3\n pop\n swap3\n pop\n swap3\n jump\t// out\n /* \"#utility.yul\":710:828 */\n tag_22:\n /* \"#utility.yul\":797:821 */\n tag_24\n /* \"#utility.yul\":815:820 */\n dup2\n /* \"#utility.yul\":797:821 */\n tag_25\n jump\t// in\n tag_24:\n /* \"#utility.yul\":792:795 */\n dup3\n /* \"#utility.yul\":785:822 */\n mstore\n /* \"#utility.yul\":775:828 */\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":834:1056 */\n tag_9:\n 0x00\n /* \"#utility.yul\":965:967 */\n 0x20\n /* \"#utility.yul\":954:963 */\n dup3\n /* \"#utility.yul\":950:968 */\n add\n /* \"#utility.yul\":942:968 */\n swap1\n pop\n /* \"#utility.yul\":978:1049 */\n tag_27\n /* \"#utility.yul\":1046:1047 */\n 0x00\n /* \"#utility.yul\":1035:1044 */\n dup4\n /* \"#utility.yul\":1031:1048 */\n add\n /* \"#utility.yul\":1022:1028 */\n dup5\n /* \"#utility.yul\":978:1049 */\n tag_22\n jump\t// in\n tag_27:\n /* \"#utility.yul\":932:1056 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":1062:1139 */\n tag_25:\n 0x00\n /* \"#utility.yul\":1128:1133 */\n dup2\n /* \"#utility.yul\":1117:1133 */\n swap1\n pop\n /* \"#utility.yul\":1107:1139 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":1145:1267 */\n tag_16:\n /* \"#utility.yul\":1218:1242 */\n tag_30\n /* \"#utility.yul\":1236:1241 */\n dup2\n /* \"#utility.yul\":1218:1242 */\n tag_25\n jump\t// in\n tag_30:\n /* \"#utility.yul\":1211:1216 */\n dup2\n /* \"#utility.yul\":1208:1243 */\n eq\n /* \"#utility.yul\":1198:1200 */\n tag_31\n jumpi\n /* \"#utility.yul\":1257:1258 */\n 0x00\n /* \"#utility.yul\":1254:1255 */\n dup1\n /* \"#utility.yul\":1247:1259 */\n revert\n /* \"#utility.yul\":1198:1200 */\n tag_31:\n /* \"#utility.yul\":1188:1267 */\n pop\n jump\t// out\n\n auxdata: 0xa26469706673582212205f3f19a3a3bb3f56c5da1cf9b7d05e76435904fa7fe3154211cd2f9911af7b2f64736f6c63430008030033\n}\n", + "bytecode": { + "generatedSources": [], + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b50600561002760036005600761005660201b60201c565b1461003157600080fd5b600361004760056007600b61005660201b60201c565b1461005157600080fd5b6100a5565b600060405160208152602080820152602060408201528460608201528360808201528260a082015260c05160208160c08460006005600019f161009857600080fd5b8051925050509392505050565b610194806100b46000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80633148f14f14610030575b600080fd5b61004a600480360381019061004591906100c4565b610060565b6040516100579190610122565b60405180910390f35b600060405160208152602080820152602060408201528460608201528360808201528260a082015260c05160208160c08460006005600019f16100a257600080fd5b8051925050509392505050565b6000813590506100be81610147565b92915050565b6000806000606084860312156100d957600080fd5b60006100e7868287016100af565b93505060206100f8868287016100af565b9250506040610109868287016100af565b9150509250925092565b61011c8161013d565b82525050565b60006020820190506101376000830184610113565b92915050565b6000819050919050565b6101508161013d565b811461015b57600080fd5b5056fea26469706673582212205f3f19a3a3bb3f56c5da1cf9b7d05e76435904fa7fe3154211cd2f9911af7b2f64736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x5 PUSH2 0x27 PUSH1 0x3 PUSH1 0x5 PUSH1 0x7 PUSH2 0x56 PUSH1 0x20 SHL PUSH1 0x20 SHR JUMP JUMPDEST EQ PUSH2 0x31 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3 PUSH2 0x47 PUSH1 0x5 PUSH1 0x7 PUSH1 0xB PUSH2 0x56 PUSH1 0x20 SHL PUSH1 0x20 SHR JUMP JUMPDEST EQ PUSH2 0x51 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0xA5 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 MSTORE PUSH1 0x20 DUP1 DUP3 ADD MSTORE PUSH1 0x20 PUSH1 0x40 DUP3 ADD MSTORE DUP5 PUSH1 0x60 DUP3 ADD MSTORE DUP4 PUSH1 0x80 DUP3 ADD MSTORE DUP3 PUSH1 0xA0 DUP3 ADD MSTORE PUSH1 0xC0 MLOAD PUSH1 0x20 DUP2 PUSH1 0xC0 DUP5 PUSH1 0x0 PUSH1 0x5 PUSH1 0x0 NOT CALL PUSH2 0x98 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 MLOAD SWAP3 POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x194 DUP1 PUSH2 0xB4 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 0x2B JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x3148F14F EQ PUSH2 0x30 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4A PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x45 SWAP2 SWAP1 PUSH2 0xC4 JUMP JUMPDEST PUSH2 0x60 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x57 SWAP2 SWAP1 PUSH2 0x122 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 MSTORE PUSH1 0x20 DUP1 DUP3 ADD MSTORE PUSH1 0x20 PUSH1 0x40 DUP3 ADD MSTORE DUP5 PUSH1 0x60 DUP3 ADD MSTORE DUP4 PUSH1 0x80 DUP3 ADD MSTORE DUP3 PUSH1 0xA0 DUP3 ADD MSTORE PUSH1 0xC0 MLOAD PUSH1 0x20 DUP2 PUSH1 0xC0 DUP5 PUSH1 0x0 PUSH1 0x5 PUSH1 0x0 NOT CALL PUSH2 0xA2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 MLOAD SWAP3 POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xBE DUP2 PUSH2 0x147 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0xD9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0xE7 DUP7 DUP3 DUP8 ADD PUSH2 0xAF JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0xF8 DUP7 DUP3 DUP8 ADD PUSH2 0xAF JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 PUSH2 0x109 DUP7 DUP3 DUP8 ADD PUSH2 0xAF JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH2 0x11C DUP2 PUSH2 0x13D JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x137 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x113 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x150 DUP2 PUSH2 0x13D JUMP JUMPDEST DUP2 EQ PUSH2 0x15B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0x5F EXTCODEHASH NOT LOG3 LOG3 0xBB EXTCODEHASH JUMP 0xC5 0xDA SHR 0xF9 0xB7 0xD0 0x5E PUSH23 0x435904FA7FE3154211CD2F9911AF7B2F64736F6C634300 ADDMOD SUB STOP CALLER ", + "sourceMap": "34:1300:0:-:0;;;118:112;;;;;;;;;;173:1;154:15;161:1;164;167;154:6;;;:15;;:::i;:::-;:20;146:29;;;;;;217:1;197:16;204:1;207;210:2;197:6;;;:16;;:::i;:::-;:21;189:30;;;;;;34:1300;;364:964;432:14;549:4;543:11;672:4;663:7;656:21;721:4;714;705:7;701:18;694:32;770:4;763;754:7;750:18;743:32;886:2;879:4;870:7;866:18;859:30;933:2;926:4;917:7;913:18;906:30;981:2;974:4;965:7;961:18;954:30;1056:4;1050:11;1202:4;1195:5;1189:4;1180:7;1177:1;1171:4;1167:1;1163:6;1158:49;1148:2;;1241:1;1238;1231:12;1148:2;1298:5;1292:12;1282:22;;471:847;;;;;;;:::o;34:1300::-;;;;;;;" + }, + "deployedBytecode": { + "generatedSources": [ + { + "ast": { + "nodeType": "YulBlock", + "src": "0:1270:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "59:87:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "69:29:1", + "value": { + "arguments": [ + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "91:6:1" + } + ], + "functionName": { + "name": "calldataload", + "nodeType": "YulIdentifier", + "src": "78:12:1" + }, + "nodeType": "YulFunctionCall", + "src": "78:20:1" + }, + "variableNames": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "69:5:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "134:5:1" + } + ], + "functionName": { + "name": "validator_revert_t_uint256", + "nodeType": "YulIdentifier", + "src": "107:26:1" + }, + "nodeType": "YulFunctionCall", + "src": "107:33:1" + }, + "nodeType": "YulExpressionStatement", + "src": "107:33:1" + } + ] + }, + "name": "abi_decode_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "37:6:1", + "type": "" + }, + { + "name": "end", + "nodeType": "YulTypedName", + "src": "45:3:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "53:5:1", + "type": "" + } + ], + "src": "7:139:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "252:452:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "298:16:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "307:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "310:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "300:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "300:12:1" + }, + "nodeType": "YulExpressionStatement", + "src": "300:12:1" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "273:7:1" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "282:9:1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "269:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "269:23:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "294:2:1", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "265:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "265:32:1" + }, + "nodeType": "YulIf", + "src": "262:2:1" + }, + { + "nodeType": "YulBlock", + "src": "324:117:1", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "339:15:1", + "value": { + "kind": "number", + "nodeType": "YulLiteral", + "src": "353:1:1", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "343:6:1", + "type": "" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "368:63:1", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "403:9:1" + }, + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "414:6:1" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "399:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "399:22:1" + }, + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "423:7:1" + } + ], + "functionName": { + "name": "abi_decode_t_uint256", + "nodeType": "YulIdentifier", + "src": "378:20:1" + }, + "nodeType": "YulFunctionCall", + "src": "378:53:1" + }, + "variableNames": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "368:6:1" + } + ] + } + ] + }, + { + "nodeType": "YulBlock", + "src": "451:118:1", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "466:16:1", + "value": { + "kind": "number", + "nodeType": "YulLiteral", + "src": "480:2:1", + "type": "", + "value": "32" + }, + "variables": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "470:6:1", + "type": "" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "496:63:1", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "531:9:1" + }, + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "542:6:1" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "527:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "527:22:1" + }, + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "551:7:1" + } + ], + "functionName": { + "name": "abi_decode_t_uint256", + "nodeType": "YulIdentifier", + "src": "506:20:1" + }, + "nodeType": "YulFunctionCall", + "src": "506:53:1" + }, + "variableNames": [ + { + "name": "value1", + "nodeType": "YulIdentifier", + "src": "496:6:1" + } + ] + } + ] + }, + { + "nodeType": "YulBlock", + "src": "579:118:1", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "594:16:1", + "value": { + "kind": "number", + "nodeType": "YulLiteral", + "src": "608:2:1", + "type": "", + "value": "64" + }, + "variables": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "598:6:1", + "type": "" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "624:63:1", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "659:9:1" + }, + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "670:6:1" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "655:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "655:22:1" + }, + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "679:7:1" + } + ], + "functionName": { + "name": "abi_decode_t_uint256", + "nodeType": "YulIdentifier", + "src": "634:20:1" + }, + "nodeType": "YulFunctionCall", + "src": "634:53:1" + }, + "variableNames": [ + { + "name": "value2", + "nodeType": "YulIdentifier", + "src": "624:6:1" + } + ] + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_uint256t_uint256t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "206:9:1", + "type": "" + }, + { + "name": "dataEnd", + "nodeType": "YulTypedName", + "src": "217:7:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "229:6:1", + "type": "" + }, + { + "name": "value1", + "nodeType": "YulTypedName", + "src": "237:6:1", + "type": "" + }, + { + "name": "value2", + "nodeType": "YulTypedName", + "src": "245:6:1", + "type": "" + } + ], + "src": "152:552:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "775:53:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "792:3:1" + }, + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "815:5:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "797:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "797:24:1" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "785:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "785:37:1" + }, + "nodeType": "YulExpressionStatement", + "src": "785:37:1" + } + ] + }, + "name": "abi_encode_t_uint256_to_t_uint256_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "763:5:1", + "type": "" + }, + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "770:3:1", + "type": "" + } + ], + "src": "710:118:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "932:124:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "942:26:1", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "954:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "965:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "950:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "950:18:1" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "942:4:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "1022:6:1" + }, + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "1035:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1046:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1031:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1031:17:1" + } + ], + "functionName": { + "name": "abi_encode_t_uint256_to_t_uint256_fromStack", + "nodeType": "YulIdentifier", + "src": "978:43:1" + }, + "nodeType": "YulFunctionCall", + "src": "978:71:1" + }, + "nodeType": "YulExpressionStatement", + "src": "978:71:1" + } + ] + }, + "name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "904:9:1", + "type": "" + }, + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "916:6:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "927:4:1", + "type": "" + } + ], + "src": "834:222:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1107:32:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "1117:16:1", + "value": { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1128:5:1" + }, + "variableNames": [ + { + "name": "cleaned", + "nodeType": "YulIdentifier", + "src": "1117:7:1" + } + ] + } + ] + }, + "name": "cleanup_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "1089:5:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "cleaned", + "nodeType": "YulTypedName", + "src": "1099:7:1", + "type": "" + } + ], + "src": "1062:77:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1188:79:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "1245:16:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1254:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1257:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "1247:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1247:12:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1247:12:1" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1211:5:1" + }, + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1236:5:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "1218:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "1218:24:1" + } + ], + "functionName": { + "name": "eq", + "nodeType": "YulIdentifier", + "src": "1208:2:1" + }, + "nodeType": "YulFunctionCall", + "src": "1208:35:1" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "1201:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1201:43:1" + }, + "nodeType": "YulIf", + "src": "1198:2:1" + } + ] + }, + "name": "validator_revert_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "1181:5:1", + "type": "" + } + ], + "src": "1145:122:1" + } + ] + }, + "contents": "{\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_uint256t_uint256t_uint256(headStart, dataEnd) -> value0, value1, value2 {\n if slt(sub(dataEnd, headStart), 96) { revert(0, 0) }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_uint256(add(headStart, offset), dataEnd)\n }\n\n {\n\n let offset := 32\n\n value1 := abi_decode_t_uint256(add(headStart, offset), dataEnd)\n }\n\n {\n\n let offset := 64\n\n value2 := 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 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}\n", + "id": 1, + "language": "Yul", + "name": "#utility.yul" + } + ], + "immutableReferences": {}, + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b506004361061002b5760003560e01c80633148f14f14610030575b600080fd5b61004a600480360381019061004591906100c4565b610060565b6040516100579190610122565b60405180910390f35b600060405160208152602080820152602060408201528460608201528360808201528260a082015260c05160208160c08460006005600019f16100a257600080fd5b8051925050509392505050565b6000813590506100be81610147565b92915050565b6000806000606084860312156100d957600080fd5b60006100e7868287016100af565b93505060206100f8868287016100af565b9250506040610109868287016100af565b9150509250925092565b61011c8161013d565b82525050565b60006020820190506101376000830184610113565b92915050565b6000819050919050565b6101508161013d565b811461015b57600080fd5b5056fea26469706673582212205f3f19a3a3bb3f56c5da1cf9b7d05e76435904fa7fe3154211cd2f9911af7b2f64736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x2B JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x3148F14F EQ PUSH2 0x30 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4A PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x45 SWAP2 SWAP1 PUSH2 0xC4 JUMP JUMPDEST PUSH2 0x60 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x57 SWAP2 SWAP1 PUSH2 0x122 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 MSTORE PUSH1 0x20 DUP1 DUP3 ADD MSTORE PUSH1 0x20 PUSH1 0x40 DUP3 ADD MSTORE DUP5 PUSH1 0x60 DUP3 ADD MSTORE DUP4 PUSH1 0x80 DUP3 ADD MSTORE DUP3 PUSH1 0xA0 DUP3 ADD MSTORE PUSH1 0xC0 MLOAD PUSH1 0x20 DUP2 PUSH1 0xC0 DUP5 PUSH1 0x0 PUSH1 0x5 PUSH1 0x0 NOT CALL PUSH2 0xA2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 MLOAD SWAP3 POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xBE DUP2 PUSH2 0x147 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0xD9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0xE7 DUP7 DUP3 DUP8 ADD PUSH2 0xAF JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0xF8 DUP7 DUP3 DUP8 ADD PUSH2 0xAF JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 PUSH2 0x109 DUP7 DUP3 DUP8 ADD PUSH2 0xAF JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH2 0x11C DUP2 PUSH2 0x13D JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x137 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x113 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x150 DUP2 PUSH2 0x13D JUMP JUMPDEST DUP2 EQ PUSH2 0x15B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0x5F EXTCODEHASH NOT LOG3 LOG3 0xBB EXTCODEHASH JUMP 0xC5 0xDA SHR 0xF9 0xB7 0xD0 0x5E PUSH23 0x435904FA7FE3154211CD2F9911AF7B2F64736F6C634300 ADDMOD SUB STOP CALLER ", + "sourceMap": "34:1300:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;364:964;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;432:14;549:4;543:11;672:4;663:7;656:21;721:4;714;705:7;701:18;694:32;770:4;763;754:7;750:18;743:32;886:2;879:4;870:7;866:18;859:30;933:2;926:4;917:7;913:18;906:30;981:2;974:4;965:7;961:18;954:30;1056:4;1050:11;1202:4;1195:5;1189:4;1180:7;1177:1;1171:4;1167:1;1163:6;1158:49;1148:2;;1241:1;1238;1231:12;1148:2;1298:5;1292:12;1282:22;;471:847;;;;;;;:::o;7:139:1:-;;91:6;78:20;69:29;;107:33;134:5;107:33;:::i;:::-;59:87;;;;:::o;152:552::-;;;;294:2;282:9;273:7;269:23;265:32;262:2;;;310:1;307;300:12;262:2;353:1;378:53;423:7;414:6;403:9;399:22;378:53;:::i;:::-;368:63;;324:117;480:2;506:53;551:7;542:6;531:9;527:22;506:53;:::i;:::-;496:63;;451:118;608:2;634:53;679:7;670:6;659:9;655:22;634:53;:::i;:::-;624:63;;579:118;252:452;;;;;:::o;710:118::-;797:24;815:5;797:24;:::i;:::-;792:3;785:37;775:53;;:::o;834:222::-;;965:2;954:9;950:18;942:26;;978:71;1046:1;1035:9;1031:17;1022:6;978:71;:::i;:::-;932:124;;;;:::o;1062:77::-;;1128:5;1117:16;;1107:32;;;:::o;1145:122::-;1218:24;1236:5;1218:24;:::i;:::-;1211:5;1208:35;1198:2;;1257:1;1254;1247:12;1198:2;1188:79;:::o" + }, + "gasEstimates": { + "creation": { + "codeDepositCost": "80800", + "executionCost": "infinite", + "totalCost": "infinite" + }, + "external": { "modExp(uint256,uint256,uint256)": "infinite" } + }, + "legacyAssembly": { + ".code": [ + { + "begin": 34, + "end": 1334, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 34, + "end": 1334, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 1334, "name": "MSTORE", "source": 0 }, + { "begin": 118, "end": 230, "name": "CALLVALUE", "source": 0 }, + { "begin": 118, "end": 230, "name": "DUP1", "source": 0 }, + { "begin": 118, "end": 230, "name": "ISZERO", "source": 0 }, + { + "begin": 118, + "end": 230, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 118, "end": 230, "name": "JUMPI", "source": 0 }, + { + "begin": 118, + "end": 230, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 118, "end": 230, "name": "DUP1", "source": 0 }, + { "begin": 118, "end": 230, "name": "REVERT", "source": 0 }, + { + "begin": 118, + "end": 230, + "name": "tag", + "source": 0, + "value": "1" + }, + { "begin": 118, "end": 230, "name": "JUMPDEST", "source": 0 }, + { "begin": 118, "end": 230, "name": "POP", "source": 0 }, + { + "begin": 173, + "end": 174, + "name": "PUSH", + "source": 0, + "value": "5" + }, + { + "begin": 154, + "end": 169, + "name": "PUSH [tag]", + "source": 0, + "value": "4" + }, + { + "begin": 161, + "end": 162, + "name": "PUSH", + "source": 0, + "value": "3" + }, + { + "begin": 164, + "end": 165, + "name": "PUSH", + "source": 0, + "value": "5" + }, + { + "begin": 167, + "end": 168, + "name": "PUSH", + "source": 0, + "value": "7" + }, + { + "begin": 154, + "end": 160, + "name": "PUSH [tag]", + "source": 0, + "value": "5" + }, + { + "begin": 154, + "end": 160, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 154, "end": 160, "name": "SHL", "source": 0 }, + { + "begin": 154, + "end": 169, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 154, "end": 169, "name": "SHR", "source": 0 }, + { + "begin": 154, + "end": 169, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 154, + "end": 169, + "name": "tag", + "source": 0, + "value": "4" + }, + { "begin": 154, "end": 169, "name": "JUMPDEST", "source": 0 }, + { "begin": 154, "end": 174, "name": "EQ", "source": 0 }, + { + "begin": 146, + "end": 175, + "name": "PUSH [tag]", + "source": 0, + "value": "6" + }, + { "begin": 146, "end": 175, "name": "JUMPI", "source": 0 }, + { + "begin": 146, + "end": 175, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 146, "end": 175, "name": "DUP1", "source": 0 }, + { "begin": 146, "end": 175, "name": "REVERT", "source": 0 }, + { + "begin": 146, + "end": 175, + "name": "tag", + "source": 0, + "value": "6" + }, + { "begin": 146, "end": 175, "name": "JUMPDEST", "source": 0 }, + { + "begin": 217, + "end": 218, + "name": "PUSH", + "source": 0, + "value": "3" + }, + { + "begin": 197, + "end": 213, + "name": "PUSH [tag]", + "source": 0, + "value": "7" + }, + { + "begin": 204, + "end": 205, + "name": "PUSH", + "source": 0, + "value": "5" + }, + { + "begin": 207, + "end": 208, + "name": "PUSH", + "source": 0, + "value": "7" + }, + { + "begin": 210, + "end": 212, + "name": "PUSH", + "source": 0, + "value": "B" + }, + { + "begin": 197, + "end": 203, + "name": "PUSH [tag]", + "source": 0, + "value": "5" + }, + { + "begin": 197, + "end": 203, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 197, "end": 203, "name": "SHL", "source": 0 }, + { + "begin": 197, + "end": 213, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 197, "end": 213, "name": "SHR", "source": 0 }, + { + "begin": 197, + "end": 213, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 197, + "end": 213, + "name": "tag", + "source": 0, + "value": "7" + }, + { "begin": 197, "end": 213, "name": "JUMPDEST", "source": 0 }, + { "begin": 197, "end": 218, "name": "EQ", "source": 0 }, + { + "begin": 189, + "end": 219, + "name": "PUSH [tag]", + "source": 0, + "value": "8" + }, + { "begin": 189, "end": 219, "name": "JUMPI", "source": 0 }, + { + "begin": 189, + "end": 219, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 189, "end": 219, "name": "DUP1", "source": 0 }, + { "begin": 189, "end": 219, "name": "REVERT", "source": 0 }, + { + "begin": 189, + "end": 219, + "name": "tag", + "source": 0, + "value": "8" + }, + { "begin": 189, "end": 219, "name": "JUMPDEST", "source": 0 }, + { + "begin": 34, + "end": 1334, + "name": "PUSH [tag]", + "source": 0, + "value": "9" + }, + { "begin": 34, "end": 1334, "name": "JUMP", "source": 0 }, + { + "begin": 364, + "end": 1328, + "name": "tag", + "source": 0, + "value": "5" + }, + { "begin": 364, "end": 1328, "name": "JUMPDEST", "source": 0 }, + { + "begin": 432, + "end": 446, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { + "begin": 549, + "end": 553, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 543, "end": 554, "name": "MLOAD", "source": 0 }, + { + "begin": 672, + "end": 676, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 663, "end": 670, "name": "DUP2", "source": 0 }, + { "begin": 656, "end": 677, "name": "MSTORE", "source": 0 }, + { + "begin": 721, + "end": 725, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 714, "end": 718, "name": "DUP1", "source": 0 }, + { "begin": 705, "end": 712, "name": "DUP3", "source": 0 }, + { "begin": 701, "end": 719, "name": "ADD", "source": 0 }, + { "begin": 694, "end": 726, "name": "MSTORE", "source": 0 }, + { + "begin": 770, + "end": 774, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { + "begin": 763, + "end": 767, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 754, "end": 761, "name": "DUP3", "source": 0 }, + { "begin": 750, "end": 768, "name": "ADD", "source": 0 }, + { "begin": 743, "end": 775, "name": "MSTORE", "source": 0 }, + { "begin": 886, "end": 888, "name": "DUP5", "source": 0 }, + { + "begin": 879, + "end": 883, + "name": "PUSH", + "source": 0, + "value": "60" + }, + { "begin": 870, "end": 877, "name": "DUP3", "source": 0 }, + { "begin": 866, "end": 884, "name": "ADD", "source": 0 }, + { "begin": 859, "end": 889, "name": "MSTORE", "source": 0 }, + { "begin": 933, "end": 935, "name": "DUP4", "source": 0 }, + { + "begin": 926, + "end": 930, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { "begin": 917, "end": 924, "name": "DUP3", "source": 0 }, + { "begin": 913, "end": 931, "name": "ADD", "source": 0 }, + { "begin": 906, "end": 936, "name": "MSTORE", "source": 0 }, + { "begin": 981, "end": 983, "name": "DUP3", "source": 0 }, + { + "begin": 974, + "end": 978, + "name": "PUSH", + "source": 0, + "value": "A0" + }, + { "begin": 965, "end": 972, "name": "DUP3", "source": 0 }, + { "begin": 961, "end": 979, "name": "ADD", "source": 0 }, + { "begin": 954, "end": 984, "name": "MSTORE", "source": 0 }, + { + "begin": 1056, + "end": 1060, + "name": "PUSH", + "source": 0, + "value": "C0" + }, + { "begin": 1050, "end": 1061, "name": "MLOAD", "source": 0 }, + { + "begin": 1202, + "end": 1206, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 1195, "end": 1200, "name": "DUP2", "source": 0 }, + { + "begin": 1189, + "end": 1193, + "name": "PUSH", + "source": 0, + "value": "C0" + }, + { "begin": 1180, "end": 1187, "name": "DUP5", "source": 0 }, + { + "begin": 1177, + "end": 1178, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { + "begin": 1171, + "end": 1175, + "name": "PUSH", + "source": 0, + "value": "5" + }, + { + "begin": 1167, + "end": 1168, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 1163, "end": 1169, "name": "NOT", "source": 0 }, + { "begin": 1158, "end": 1207, "name": "CALL", "source": 0 }, + { + "begin": 1148, + "end": 1150, + "name": "PUSH [tag]", + "source": 0, + "value": "11" + }, + { "begin": 1148, "end": 1150, "name": "JUMPI", "source": 0 }, + { + "begin": 1241, + "end": 1242, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 1238, "end": 1239, "name": "DUP1", "source": 0 }, + { "begin": 1231, "end": 1243, "name": "REVERT", "source": 0 }, + { + "begin": 1148, + "end": 1150, + "name": "tag", + "source": 0, + "value": "11" + }, + { "begin": 1148, "end": 1150, "name": "JUMPDEST", "source": 0 }, + { "begin": 1298, "end": 1303, "name": "DUP1", "source": 0 }, + { "begin": 1292, "end": 1304, "name": "MLOAD", "source": 0 }, + { "begin": 1282, "end": 1304, "name": "SWAP3", "source": 0 }, + { "begin": 1282, "end": 1304, "name": "POP", "source": 0 }, + { "begin": 471, "end": 1318, "name": "POP", "source": 0 }, + { "begin": 471, "end": 1318, "name": "POP", "source": 0 }, + { "begin": 471, "end": 1318, "name": "SWAP4", "source": 0 }, + { "begin": 471, "end": 1318, "name": "SWAP3", "source": 0 }, + { "begin": 471, "end": 1318, "name": "POP", "source": 0 }, + { "begin": 471, "end": 1318, "name": "POP", "source": 0 }, + { "begin": 471, "end": 1318, "name": "POP", "source": 0 }, + { + "begin": 471, + "end": 1318, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { + "begin": 34, + "end": 1334, + "name": "tag", + "source": 0, + "value": "9" + }, + { "begin": 34, "end": 1334, "name": "JUMPDEST", "source": 0 }, + { + "begin": 34, + "end": 1334, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 34, "end": 1334, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 1334, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 34, + "end": 1334, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 1334, "name": "CODECOPY", "source": 0 }, + { + "begin": 34, + "end": 1334, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 1334, "name": "RETURN", "source": 0 } + ], + ".data": { + "0": { + ".auxdata": "a26469706673582212205f3f19a3a3bb3f56c5da1cf9b7d05e76435904fa7fe3154211cd2f9911af7b2f64736f6c63430008030033", + ".code": [ + { + "begin": 34, + "end": 1334, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 34, + "end": 1334, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 1334, "name": "MSTORE", "source": 0 }, + { "begin": 34, "end": 1334, "name": "CALLVALUE", "source": 0 }, + { "begin": 34, "end": 1334, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 1334, "name": "ISZERO", "source": 0 }, + { + "begin": 34, + "end": 1334, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 34, "end": 1334, "name": "JUMPI", "source": 0 }, + { + "begin": 34, + "end": 1334, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 1334, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 1334, "name": "REVERT", "source": 0 }, + { + "begin": 34, + "end": 1334, + "name": "tag", + "source": 0, + "value": "1" + }, + { "begin": 34, "end": 1334, "name": "JUMPDEST", "source": 0 }, + { "begin": 34, "end": 1334, "name": "POP", "source": 0 }, + { + "begin": 34, + "end": 1334, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 34, "end": 1334, "name": "CALLDATASIZE", "source": 0 }, + { "begin": 34, "end": 1334, "name": "LT", "source": 0 }, + { + "begin": 34, + "end": 1334, + "name": "PUSH [tag]", + "source": 0, + "value": "2" + }, + { "begin": 34, "end": 1334, "name": "JUMPI", "source": 0 }, + { + "begin": 34, + "end": 1334, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 1334, "name": "CALLDATALOAD", "source": 0 }, + { + "begin": 34, + "end": 1334, + "name": "PUSH", + "source": 0, + "value": "E0" + }, + { "begin": 34, "end": 1334, "name": "SHR", "source": 0 }, + { "begin": 34, "end": 1334, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 1334, + "name": "PUSH", + "source": 0, + "value": "3148F14F" + }, + { "begin": 34, "end": 1334, "name": "EQ", "source": 0 }, + { + "begin": 34, + "end": 1334, + "name": "PUSH [tag]", + "source": 0, + "value": "3" + }, + { "begin": 34, "end": 1334, "name": "JUMPI", "source": 0 }, + { + "begin": 34, + "end": 1334, + "name": "tag", + "source": 0, + "value": "2" + }, + { "begin": 34, "end": 1334, "name": "JUMPDEST", "source": 0 }, + { + "begin": 34, + "end": 1334, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 1334, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 1334, "name": "REVERT", "source": 0 }, + { + "begin": 364, + "end": 1328, + "name": "tag", + "source": 0, + "value": "3" + }, + { "begin": 364, "end": 1328, "name": "JUMPDEST", "source": 0 }, + { + "begin": 364, + "end": 1328, + "name": "PUSH [tag]", + "source": 0, + "value": "4" + }, + { + "begin": 364, + "end": 1328, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 364, "end": 1328, "name": "DUP1", "source": 0 }, + { + "begin": 364, + "end": 1328, + "name": "CALLDATASIZE", + "source": 0 + }, + { "begin": 364, "end": 1328, "name": "SUB", "source": 0 }, + { "begin": 364, "end": 1328, "name": "DUP2", "source": 0 }, + { "begin": 364, "end": 1328, "name": "ADD", "source": 0 }, + { "begin": 364, "end": 1328, "name": "SWAP1", "source": 0 }, + { + "begin": 364, + "end": 1328, + "name": "PUSH [tag]", + "source": 0, + "value": "5" + }, + { "begin": 364, "end": 1328, "name": "SWAP2", "source": 0 }, + { "begin": 364, "end": 1328, "name": "SWAP1", "source": 0 }, + { + "begin": 364, + "end": 1328, + "name": "PUSH [tag]", + "source": 0, + "value": "6" + }, + { + "begin": 364, + "end": 1328, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 364, + "end": 1328, + "name": "tag", + "source": 0, + "value": "5" + }, + { "begin": 364, "end": 1328, "name": "JUMPDEST", "source": 0 }, + { + "begin": 364, + "end": 1328, + "name": "PUSH [tag]", + "source": 0, + "value": "7" + }, + { + "begin": 364, + "end": 1328, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 364, + "end": 1328, + "name": "tag", + "source": 0, + "value": "4" + }, + { "begin": 364, "end": 1328, "name": "JUMPDEST", "source": 0 }, + { + "begin": 364, + "end": 1328, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 364, "end": 1328, "name": "MLOAD", "source": 0 }, + { + "begin": 364, + "end": 1328, + "name": "PUSH [tag]", + "source": 0, + "value": "8" + }, + { "begin": 364, "end": 1328, "name": "SWAP2", "source": 0 }, + { "begin": 364, "end": 1328, "name": "SWAP1", "source": 0 }, + { + "begin": 364, + "end": 1328, + "name": "PUSH [tag]", + "source": 0, + "value": "9" + }, + { + "begin": 364, + "end": 1328, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 364, + "end": 1328, + "name": "tag", + "source": 0, + "value": "8" + }, + { "begin": 364, "end": 1328, "name": "JUMPDEST", "source": 0 }, + { + "begin": 364, + "end": 1328, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 364, "end": 1328, "name": "MLOAD", "source": 0 }, + { "begin": 364, "end": 1328, "name": "DUP1", "source": 0 }, + { "begin": 364, "end": 1328, "name": "SWAP2", "source": 0 }, + { "begin": 364, "end": 1328, "name": "SUB", "source": 0 }, + { "begin": 364, "end": 1328, "name": "SWAP1", "source": 0 }, + { "begin": 364, "end": 1328, "name": "RETURN", "source": 0 }, + { + "begin": 364, + "end": 1328, + "name": "tag", + "source": 0, + "value": "7" + }, + { "begin": 364, "end": 1328, "name": "JUMPDEST", "source": 0 }, + { + "begin": 432, + "end": 446, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { + "begin": 549, + "end": 553, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 543, "end": 554, "name": "MLOAD", "source": 0 }, + { + "begin": 672, + "end": 676, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 663, "end": 670, "name": "DUP2", "source": 0 }, + { "begin": 656, "end": 677, "name": "MSTORE", "source": 0 }, + { + "begin": 721, + "end": 725, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 714, "end": 718, "name": "DUP1", "source": 0 }, + { "begin": 705, "end": 712, "name": "DUP3", "source": 0 }, + { "begin": 701, "end": 719, "name": "ADD", "source": 0 }, + { "begin": 694, "end": 726, "name": "MSTORE", "source": 0 }, + { + "begin": 770, + "end": 774, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { + "begin": 763, + "end": 767, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 754, "end": 761, "name": "DUP3", "source": 0 }, + { "begin": 750, "end": 768, "name": "ADD", "source": 0 }, + { "begin": 743, "end": 775, "name": "MSTORE", "source": 0 }, + { "begin": 886, "end": 888, "name": "DUP5", "source": 0 }, + { + "begin": 879, + "end": 883, + "name": "PUSH", + "source": 0, + "value": "60" + }, + { "begin": 870, "end": 877, "name": "DUP3", "source": 0 }, + { "begin": 866, "end": 884, "name": "ADD", "source": 0 }, + { "begin": 859, "end": 889, "name": "MSTORE", "source": 0 }, + { "begin": 933, "end": 935, "name": "DUP4", "source": 0 }, + { + "begin": 926, + "end": 930, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { "begin": 917, "end": 924, "name": "DUP3", "source": 0 }, + { "begin": 913, "end": 931, "name": "ADD", "source": 0 }, + { "begin": 906, "end": 936, "name": "MSTORE", "source": 0 }, + { "begin": 981, "end": 983, "name": "DUP3", "source": 0 }, + { + "begin": 974, + "end": 978, + "name": "PUSH", + "source": 0, + "value": "A0" + }, + { "begin": 965, "end": 972, "name": "DUP3", "source": 0 }, + { "begin": 961, "end": 979, "name": "ADD", "source": 0 }, + { "begin": 954, "end": 984, "name": "MSTORE", "source": 0 }, + { + "begin": 1056, + "end": 1060, + "name": "PUSH", + "source": 0, + "value": "C0" + }, + { "begin": 1050, "end": 1061, "name": "MLOAD", "source": 0 }, + { + "begin": 1202, + "end": 1206, + "name": "PUSH", + "source": 0, + "value": "20" + }, + { "begin": 1195, "end": 1200, "name": "DUP2", "source": 0 }, + { + "begin": 1189, + "end": 1193, + "name": "PUSH", + "source": 0, + "value": "C0" + }, + { "begin": 1180, "end": 1187, "name": "DUP5", "source": 0 }, + { + "begin": 1177, + "end": 1178, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { + "begin": 1171, + "end": 1175, + "name": "PUSH", + "source": 0, + "value": "5" + }, + { + "begin": 1167, + "end": 1168, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 1163, "end": 1169, "name": "NOT", "source": 0 }, + { "begin": 1158, "end": 1207, "name": "CALL", "source": 0 }, + { + "begin": 1148, + "end": 1150, + "name": "PUSH [tag]", + "source": 0, + "value": "11" + }, + { "begin": 1148, "end": 1150, "name": "JUMPI", "source": 0 }, + { + "begin": 1241, + "end": 1242, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 1238, "end": 1239, "name": "DUP1", "source": 0 }, + { "begin": 1231, "end": 1243, "name": "REVERT", "source": 0 }, + { + "begin": 1148, + "end": 1150, + "name": "tag", + "source": 0, + "value": "11" + }, + { "begin": 1148, "end": 1150, "name": "JUMPDEST", "source": 0 }, + { "begin": 1298, "end": 1303, "name": "DUP1", "source": 0 }, + { "begin": 1292, "end": 1304, "name": "MLOAD", "source": 0 }, + { "begin": 1282, "end": 1304, "name": "SWAP3", "source": 0 }, + { "begin": 1282, "end": 1304, "name": "POP", "source": 0 }, + { "begin": 471, "end": 1318, "name": "POP", "source": 0 }, + { "begin": 471, "end": 1318, "name": "POP", "source": 0 }, + { "begin": 471, "end": 1318, "name": "SWAP4", "source": 0 }, + { "begin": 471, "end": 1318, "name": "SWAP3", "source": 0 }, + { "begin": 471, "end": 1318, "name": "POP", "source": 0 }, + { "begin": 471, "end": 1318, "name": "POP", "source": 0 }, + { "begin": 471, "end": 1318, "name": "POP", "source": 0 }, + { + "begin": 471, + "end": 1318, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { + "begin": 7, + "end": 146, + "name": "tag", + "source": 1, + "value": "13" + }, + { "begin": 7, "end": 146, "name": "JUMPDEST", "source": 1 }, + { + "begin": 7, + "end": 146, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 91, "end": 97, "name": "DUP2", "source": 1 }, + { "begin": 78, "end": 98, "name": "CALLDATALOAD", "source": 1 }, + { "begin": 69, "end": 98, "name": "SWAP1", "source": 1 }, + { "begin": 69, "end": 98, "name": "POP", "source": 1 }, + { + "begin": 107, + "end": 140, + "name": "PUSH [tag]", + "source": 1, + "value": "15" + }, + { "begin": 134, "end": 139, "name": "DUP2", "source": 1 }, + { + "begin": 107, + "end": 140, + "name": "PUSH [tag]", + "source": 1, + "value": "16" + }, + { + "begin": 107, + "end": 140, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 107, + "end": 140, + "name": "tag", + "source": 1, + "value": "15" + }, + { "begin": 107, "end": 140, "name": "JUMPDEST", "source": 1 }, + { "begin": 59, "end": 146, "name": "SWAP3", "source": 1 }, + { "begin": 59, "end": 146, "name": "SWAP2", "source": 1 }, + { "begin": 59, "end": 146, "name": "POP", "source": 1 }, + { "begin": 59, "end": 146, "name": "POP", "source": 1 }, + { + "begin": 59, + "end": 146, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 152, + "end": 704, + "name": "tag", + "source": 1, + "value": "6" + }, + { "begin": 152, "end": 704, "name": "JUMPDEST", "source": 1 }, + { + "begin": 152, + "end": 704, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 152, "end": 704, "name": "DUP1", "source": 1 }, + { + "begin": 152, + "end": 704, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 294, + "end": 296, + "name": "PUSH", + "source": 1, + "value": "60" + }, + { "begin": 282, "end": 291, "name": "DUP5", "source": 1 }, + { "begin": 273, "end": 280, "name": "DUP7", "source": 1 }, + { "begin": 269, "end": 292, "name": "SUB", "source": 1 }, + { "begin": 265, "end": 297, "name": "SLT", "source": 1 }, + { "begin": 262, "end": 264, "name": "ISZERO", "source": 1 }, + { + "begin": 262, + "end": 264, + "name": "PUSH [tag]", + "source": 1, + "value": "18" + }, + { "begin": 262, "end": 264, "name": "JUMPI", "source": 1 }, + { + "begin": 310, + "end": 311, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 307, "end": 308, "name": "DUP1", "source": 1 }, + { "begin": 300, "end": 312, "name": "REVERT", "source": 1 }, + { + "begin": 262, + "end": 264, + "name": "tag", + "source": 1, + "value": "18" + }, + { "begin": 262, "end": 264, "name": "JUMPDEST", "source": 1 }, + { + "begin": 353, + "end": 354, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 378, + "end": 431, + "name": "PUSH [tag]", + "source": 1, + "value": "19" + }, + { "begin": 423, "end": 430, "name": "DUP7", "source": 1 }, + { "begin": 414, "end": 420, "name": "DUP3", "source": 1 }, + { "begin": 403, "end": 412, "name": "DUP8", "source": 1 }, + { "begin": 399, "end": 421, "name": "ADD", "source": 1 }, + { + "begin": 378, + "end": 431, + "name": "PUSH [tag]", + "source": 1, + "value": "13" + }, + { + "begin": 378, + "end": 431, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 378, + "end": 431, + "name": "tag", + "source": 1, + "value": "19" + }, + { "begin": 378, "end": 431, "name": "JUMPDEST", "source": 1 }, + { "begin": 368, "end": 431, "name": "SWAP4", "source": 1 }, + { "begin": 368, "end": 431, "name": "POP", "source": 1 }, + { "begin": 324, "end": 441, "name": "POP", "source": 1 }, + { + "begin": 480, + "end": 482, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { + "begin": 506, + "end": 559, + "name": "PUSH [tag]", + "source": 1, + "value": "20" + }, + { "begin": 551, "end": 558, "name": "DUP7", "source": 1 }, + { "begin": 542, "end": 548, "name": "DUP3", "source": 1 }, + { "begin": 531, "end": 540, "name": "DUP8", "source": 1 }, + { "begin": 527, "end": 549, "name": "ADD", "source": 1 }, + { + "begin": 506, + "end": 559, + "name": "PUSH [tag]", + "source": 1, + "value": "13" + }, + { + "begin": 506, + "end": 559, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 506, + "end": 559, + "name": "tag", + "source": 1, + "value": "20" + }, + { "begin": 506, "end": 559, "name": "JUMPDEST", "source": 1 }, + { "begin": 496, "end": 559, "name": "SWAP3", "source": 1 }, + { "begin": 496, "end": 559, "name": "POP", "source": 1 }, + { "begin": 451, "end": 569, "name": "POP", "source": 1 }, + { + "begin": 608, + "end": 610, + "name": "PUSH", + "source": 1, + "value": "40" + }, + { + "begin": 634, + "end": 687, + "name": "PUSH [tag]", + "source": 1, + "value": "21" + }, + { "begin": 679, "end": 686, "name": "DUP7", "source": 1 }, + { "begin": 670, "end": 676, "name": "DUP3", "source": 1 }, + { "begin": 659, "end": 668, "name": "DUP8", "source": 1 }, + { "begin": 655, "end": 677, "name": "ADD", "source": 1 }, + { + "begin": 634, + "end": 687, + "name": "PUSH [tag]", + "source": 1, + "value": "13" + }, + { + "begin": 634, + "end": 687, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 634, + "end": 687, + "name": "tag", + "source": 1, + "value": "21" + }, + { "begin": 634, "end": 687, "name": "JUMPDEST", "source": 1 }, + { "begin": 624, "end": 687, "name": "SWAP2", "source": 1 }, + { "begin": 624, "end": 687, "name": "POP", "source": 1 }, + { "begin": 579, "end": 697, "name": "POP", "source": 1 }, + { "begin": 252, "end": 704, "name": "SWAP3", "source": 1 }, + { "begin": 252, "end": 704, "name": "POP", "source": 1 }, + { "begin": 252, "end": 704, "name": "SWAP3", "source": 1 }, + { "begin": 252, "end": 704, "name": "POP", "source": 1 }, + { "begin": 252, "end": 704, "name": "SWAP3", "source": 1 }, + { + "begin": 252, + "end": 704, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 710, + "end": 828, + "name": "tag", + "source": 1, + "value": "22" + }, + { "begin": 710, "end": 828, "name": "JUMPDEST", "source": 1 }, + { + "begin": 797, + "end": 821, + "name": "PUSH [tag]", + "source": 1, + "value": "24" + }, + { "begin": 815, "end": 820, "name": "DUP2", "source": 1 }, + { + "begin": 797, + "end": 821, + "name": "PUSH [tag]", + "source": 1, + "value": "25" + }, + { + "begin": 797, + "end": 821, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 797, + "end": 821, + "name": "tag", + "source": 1, + "value": "24" + }, + { "begin": 797, "end": 821, "name": "JUMPDEST", "source": 1 }, + { "begin": 792, "end": 795, "name": "DUP3", "source": 1 }, + { "begin": 785, "end": 822, "name": "MSTORE", "source": 1 }, + { "begin": 775, "end": 828, "name": "POP", "source": 1 }, + { "begin": 775, "end": 828, "name": "POP", "source": 1 }, + { + "begin": 775, + "end": 828, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 834, + "end": 1056, + "name": "tag", + "source": 1, + "value": "9" + }, + { "begin": 834, "end": 1056, "name": "JUMPDEST", "source": 1 }, + { + "begin": 834, + "end": 1056, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 965, + "end": 967, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 954, "end": 963, "name": "DUP3", "source": 1 }, + { "begin": 950, "end": 968, "name": "ADD", "source": 1 }, + { "begin": 942, "end": 968, "name": "SWAP1", "source": 1 }, + { "begin": 942, "end": 968, "name": "POP", "source": 1 }, + { + "begin": 978, + "end": 1049, + "name": "PUSH [tag]", + "source": 1, + "value": "27" + }, + { + "begin": 1046, + "end": 1047, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1035, "end": 1044, "name": "DUP4", "source": 1 }, + { "begin": 1031, "end": 1048, "name": "ADD", "source": 1 }, + { "begin": 1022, "end": 1028, "name": "DUP5", "source": 1 }, + { + "begin": 978, + "end": 1049, + "name": "PUSH [tag]", + "source": 1, + "value": "22" + }, + { + "begin": 978, + "end": 1049, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 978, + "end": 1049, + "name": "tag", + "source": 1, + "value": "27" + }, + { "begin": 978, "end": 1049, "name": "JUMPDEST", "source": 1 }, + { "begin": 932, "end": 1056, "name": "SWAP3", "source": 1 }, + { "begin": 932, "end": 1056, "name": "SWAP2", "source": 1 }, + { "begin": 932, "end": 1056, "name": "POP", "source": 1 }, + { "begin": 932, "end": 1056, "name": "POP", "source": 1 }, + { + "begin": 932, + "end": 1056, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1062, + "end": 1139, + "name": "tag", + "source": 1, + "value": "25" + }, + { "begin": 1062, "end": 1139, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1062, + "end": 1139, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1128, "end": 1133, "name": "DUP2", "source": 1 }, + { "begin": 1117, "end": 1133, "name": "SWAP1", "source": 1 }, + { "begin": 1117, "end": 1133, "name": "POP", "source": 1 }, + { "begin": 1107, "end": 1139, "name": "SWAP2", "source": 1 }, + { "begin": 1107, "end": 1139, "name": "SWAP1", "source": 1 }, + { "begin": 1107, "end": 1139, "name": "POP", "source": 1 }, + { + "begin": 1107, + "end": 1139, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1145, + "end": 1267, + "name": "tag", + "source": 1, + "value": "16" + }, + { "begin": 1145, "end": 1267, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1218, + "end": 1242, + "name": "PUSH [tag]", + "source": 1, + "value": "30" + }, + { "begin": 1236, "end": 1241, "name": "DUP2", "source": 1 }, + { + "begin": 1218, + "end": 1242, + "name": "PUSH [tag]", + "source": 1, + "value": "25" + }, + { + "begin": 1218, + "end": 1242, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1218, + "end": 1242, + "name": "tag", + "source": 1, + "value": "30" + }, + { "begin": 1218, "end": 1242, "name": "JUMPDEST", "source": 1 }, + { "begin": 1211, "end": 1216, "name": "DUP2", "source": 1 }, + { "begin": 1208, "end": 1243, "name": "EQ", "source": 1 }, + { + "begin": 1198, + "end": 1200, + "name": "PUSH [tag]", + "source": 1, + "value": "31" + }, + { "begin": 1198, "end": 1200, "name": "JUMPI", "source": 1 }, + { + "begin": 1257, + "end": 1258, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1254, "end": 1255, "name": "DUP1", "source": 1 }, + { "begin": 1247, "end": 1259, "name": "REVERT", "source": 1 }, + { + "begin": 1198, + "end": 1200, + "name": "tag", + "source": 1, + "value": "31" + }, + { "begin": 1198, "end": 1200, "name": "JUMPDEST", "source": 1 }, + { "begin": 1188, "end": 1267, "name": "POP", "source": 1 }, + { + "begin": 1188, + "end": 1267, + "name": "JUMP", + "source": 1, + "value": "[out]" + } + ] + } + } + }, + "methodIdentifiers": { "modExp(uint256,uint256,uint256)": "3148f14f" } + }, + "ewasm": { "wasm": "" }, + "metadata": "{\"compiler\":{\"version\":\"0.8.3+commit.8d00100c\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_b\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_e\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_m\",\"type\":\"uint256\"}],\"name\":\"modExp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"result\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"main.sol\":\"ModularCheck\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"main.sol\":{\"keccak256\":\"0x097512cf9987b49bfe8f0a182553ada97250dc01d384db9cdcaed8ad64079749\",\"urls\":[\"bzz-raw://58b5775c60ddc5d903527600fcd1730275d92f25d2cbe4155407d1dcf1409268\",\"dweb:/ipfs/QmYGYVSziwMp5tgyj6R6WxDScMUSdLTBNuzgjU1DwFHiN5\"]}},\"version\":1}", + "storageLayout": { "storage": [], "types": null }, + "userdoc": { "kind": "user", "methods": {}, "version": 1 } + }, + "sourceCode": "\n pragma solidity >=0.8.0;\n contract ModularCheck {\n // Verify simple modular exponentiation\n constructor() {\n require(modExp(3, 5, 7) == 5);\n require(modExp(5, 7, 11) == 3);\n }\n // Wrapper function to use the precompile.\n // Taken from https://ethereum.stackexchange.com/a/71590/9963\n function modExp(uint256 _b, uint256 _e, uint256 _m) public returns (uint256 result) {\n assembly {\n // Free memory pointer\n let pointer := mload(0x40)\n // Define length of base, exponent and modulus. 0x20 == 32 bytes\n mstore(pointer, 0x20)\n mstore(add(pointer, 0x20), 0x20)\n mstore(add(pointer, 0x40), 0x20)\n // Define variables base, exponent and modulus\n mstore(add(pointer, 0x60), _b)\n mstore(add(pointer, 0x80), _e)\n\n mstore(add(pointer, 0xa0), _m)\n // Store the result\n let value := mload(0xc0)\n // Call the precompiled contract 0x05 = bigModExp\n if iszero(call(not(0), 0x05, 0, pointer, 0xc0, value, 0x20)) {\n revert(0, 0)\n }\n result := mload(value)\n }\n }\n }" +} diff --git a/tests/contracts/compiled/SingleEventContract.json b/tests/contracts/compiled/SingleEventContract.json new file mode 100644 index 00000000000..ec12305e569 --- /dev/null +++ b/tests/contracts/compiled/SingleEventContract.json @@ -0,0 +1,200 @@ +{ + "byteCode": "0x6080604052348015600f57600080fd5b503373ffffffffffffffffffffffffffffffffffffffff167e40d54d5e5b097202376b55bcbaaedd2ee468ce4496f1d30030c4e5308bf94d60405160405180910390a2603f80605f6000396000f3fe6080604052600080fdfea2646970667358221220ae026c320d184ca85465858e1967f27f93db9dc49be1d4cef1c722bf17bc0dc264736f6c63430008030033", + "contract": { + "abi": [ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "Constructed", + "type": "event" + } + ], + "devdoc": { "kind": "dev", "methods": {}, "version": 1 }, + "evm": { + "assembly": " /* \"main.sol\":43:206 contract SingleEventContract {... */\n mstore(0x40, 0x80)\n /* \"main.sol\":133:200 constructor() {... */\n callvalue\n dup1\n iszero\n tag_1\n jumpi\n 0x00\n dup1\n revert\ntag_1:\n pop\n /* \"main.sol\":178:188 msg.sender */\n caller\n /* \"main.sol\":166:189 Constructed(msg.sender) */\n 0xffffffffffffffffffffffffffffffffffffffff\n and\n 0x40d54d5e5b097202376b55bcbaaedd2ee468ce4496f1d30030c4e5308bf94d\n mload(0x40)\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n log2\n /* \"main.sol\":43:206 contract SingleEventContract {... */\n dataSize(sub_0)\n dup1\n dataOffset(sub_0)\n 0x00\n codecopy\n 0x00\n return\nstop\n\nsub_0: assembly {\n /* \"main.sol\":43:206 contract SingleEventContract {... */\n mstore(0x40, 0x80)\n 0x00\n dup1\n revert\n\n auxdata: 0xa2646970667358221220ae026c320d184ca85465858e1967f27f93db9dc49be1d4cef1c722bf17bc0dc264736f6c63430008030033\n}\n", + "bytecode": { + "generatedSources": [], + "linkReferences": {}, + "object": "6080604052348015600f57600080fd5b503373ffffffffffffffffffffffffffffffffffffffff167e40d54d5e5b097202376b55bcbaaedd2ee468ce4496f1d30030c4e5308bf94d60405160405180910390a2603f80605f6000396000f3fe6080604052600080fdfea2646970667358221220ae026c320d184ca85465858e1967f27f93db9dc49be1d4cef1c722bf17bc0dc264736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH31 0x40D54D5E5B097202376B55BCBAAEDD2EE468CE4496F1D30030C4E5308BF94D PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH1 0x3F DUP1 PUSH1 0x5F PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xAE MUL PUSH13 0x320D184CA85465858E1967F27F SWAP4 0xDB SWAP14 0xC4 SWAP12 0xE1 0xD4 0xCE CALL 0xC7 0x22 0xBF OR 0xBC 0xD 0xC2 PUSH5 0x736F6C6343 STOP ADDMOD SUB STOP CALLER ", + "sourceMap": "43:163:0:-:0;;;133:67;;;;;;;;;;178:10;166:23;;;;;;;;;;;;43:163;;;;;;" + }, + "deployedBytecode": { + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "6080604052600080fdfea2646970667358221220ae026c320d184ca85465858e1967f27f93db9dc49be1d4cef1c722bf17bc0dc264736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xAE MUL PUSH13 0x320D184CA85465858E1967F27F SWAP4 0xDB SWAP14 0xC4 SWAP12 0xE1 0xD4 0xCE CALL 0xC7 0x22 0xBF OR 0xBC 0xD 0xC2 PUSH5 0x736F6C6343 STOP ADDMOD SUB STOP CALLER ", + "sourceMap": "43:163:0:-:0;;;;;" + }, + "gasEstimates": { + "creation": { + "codeDepositCost": "12600", + "executionCost": "1226", + "totalCost": "13826" + } + }, + "legacyAssembly": { + ".code": [ + { + "begin": 43, + "end": 206, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 43, + "end": 206, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 43, "end": 206, "name": "MSTORE", "source": 0 }, + { "begin": 133, "end": 200, "name": "CALLVALUE", "source": 0 }, + { "begin": 133, "end": 200, "name": "DUP1", "source": 0 }, + { "begin": 133, "end": 200, "name": "ISZERO", "source": 0 }, + { + "begin": 133, + "end": 200, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 133, "end": 200, "name": "JUMPI", "source": 0 }, + { + "begin": 133, + "end": 200, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 133, "end": 200, "name": "DUP1", "source": 0 }, + { "begin": 133, "end": 200, "name": "REVERT", "source": 0 }, + { + "begin": 133, + "end": 200, + "name": "tag", + "source": 0, + "value": "1" + }, + { "begin": 133, "end": 200, "name": "JUMPDEST", "source": 0 }, + { "begin": 133, "end": 200, "name": "POP", "source": 0 }, + { "begin": 178, "end": 188, "name": "CALLER", "source": 0 }, + { + "begin": 166, + "end": 189, + "name": "PUSH", + "source": 0, + "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + }, + { "begin": 166, "end": 189, "name": "AND", "source": 0 }, + { + "begin": 166, + "end": 189, + "name": "PUSH", + "source": 0, + "value": "40D54D5E5B097202376B55BCBAAEDD2EE468CE4496F1D30030C4E5308BF94D" + }, + { + "begin": 166, + "end": 189, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 166, "end": 189, "name": "MLOAD", "source": 0 }, + { + "begin": 166, + "end": 189, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 166, "end": 189, "name": "MLOAD", "source": 0 }, + { "begin": 166, "end": 189, "name": "DUP1", "source": 0 }, + { "begin": 166, "end": 189, "name": "SWAP2", "source": 0 }, + { "begin": 166, "end": 189, "name": "SUB", "source": 0 }, + { "begin": 166, "end": 189, "name": "SWAP1", "source": 0 }, + { "begin": 166, "end": 189, "name": "LOG2", "source": 0 }, + { + "begin": 43, + "end": 206, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 43, "end": 206, "name": "DUP1", "source": 0 }, + { + "begin": 43, + "end": 206, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 43, + "end": 206, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 43, "end": 206, "name": "CODECOPY", "source": 0 }, + { + "begin": 43, + "end": 206, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 43, "end": 206, "name": "RETURN", "source": 0 } + ], + ".data": { + "0": { + ".auxdata": "a2646970667358221220ae026c320d184ca85465858e1967f27f93db9dc49be1d4cef1c722bf17bc0dc264736f6c63430008030033", + ".code": [ + { + "begin": 43, + "end": 206, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 43, + "end": 206, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 43, "end": 206, "name": "MSTORE", "source": 0 }, + { + "begin": 43, + "end": 206, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 43, "end": 206, "name": "DUP1", "source": 0 }, + { "begin": 43, "end": 206, "name": "REVERT", "source": 0 } + ] + } + } + }, + "methodIdentifiers": {} + }, + "ewasm": { "wasm": "" }, + "metadata": "{\"compiler\":{\"version\":\"0.8.3+commit.8d00100c\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"Constructed\",\"type\":\"event\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"main.sol\":\"SingleEventContract\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"main.sol\":{\"keccak256\":\"0x5bdc4e014e35f9b07112af42347d90a14e9ea3cf8b609e48e93273606b5896b2\",\"urls\":[\"bzz-raw://20d9c0eb3ca1fceec867318c063ab277ffcf57928a325da537cb5f061ea713cf\",\"dweb:/ipfs/QmYHPwfoDdMa7p1oUG44unJ3vHQWSSqaBJ2xVj5dJEvoim\"]}},\"version\":1}", + "storageLayout": { "storage": [], "types": null }, + "userdoc": { "kind": "user", "methods": {}, "version": 1 } + }, + "sourceCode": "\n pragma solidity >=0.8.0;\n \n contract SingleEventContract {\n event Constructed(address indexed owner);\n\n constructor() {\n emit Constructed(msg.sender);\n }\n }" +} diff --git a/tests/contracts/compiled/TestContract.json b/tests/contracts/compiled/TestContract.json new file mode 100644 index 00000000000..b3fb31861c7 --- /dev/null +++ b/tests/contracts/compiled/TestContract.json @@ -0,0 +1,1952 @@ +{ + "byteCode": "0x608060405234801561001057600080fd5b506101be806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c6888fa114610030575b600080fd5b61004a6004803603810190610045919061008b565b610060565b60405161005791906100c3565b60405180910390f35b600060078261006f91906100de565b9050919050565b60008135905061008581610171565b92915050565b60006020828403121561009d57600080fd5b60006100ab84828501610076565b91505092915050565b6100bd81610138565b82525050565b60006020820190506100d860008301846100b4565b92915050565b60006100e982610138565b91506100f483610138565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561012d5761012c610142565b5b828202905092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b61017a81610138565b811461018557600080fd5b5056fea2646970667358221220a82dff050f5e40b874671c1f40e579b5a8c361f5313d1a9d32437222ab6a384c64736f6c63430008030033", + "contract": { + "abi": [ + { + "inputs": [ + { "internalType": "uint256", "name": "a", "type": "uint256" } + ], + "name": "multiply", + "outputs": [ + { "internalType": "uint256", "name": "d", "type": "uint256" } + ], + "stateMutability": "pure", + "type": "function" + } + ], + "devdoc": { "kind": "dev", "methods": {}, "version": 1 }, + "evm": { + "assembly": " /* \"main.sol\":39:167 contract TestContract {... */\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 /* \"main.sol\":39:167 contract TestContract {... */\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 0xc6888fa1\n eq\n tag_3\n jumpi\n tag_2:\n 0x00\n dup1\n revert\n /* \"main.sol\":71:161 function multiply(uint a) public pure returns(uint d) {... */\n tag_3:\n tag_4\n 0x04\n dup1\n calldatasize\n sub\n dup2\n add\n swap1\n tag_5\n swap2\n swap1\n tag_6\n jump\t// in\n tag_5:\n tag_7\n jump\t// in\n tag_4:\n mload(0x40)\n tag_8\n swap2\n swap1\n tag_9\n jump\t// in\n tag_8:\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n return\n tag_7:\n /* \"main.sol\":117:123 uint d */\n 0x00\n /* \"main.sol\":149:150 7 */\n 0x07\n /* \"main.sol\":146:147 a */\n dup3\n /* \"main.sol\":146:150 a *7 */\n tag_11\n swap2\n swap1\n tag_12\n jump\t// in\n tag_11:\n /* \"main.sol\":139:150 return a *7 */\n swap1\n pop\n /* \"main.sol\":71:161 function multiply(uint a) public pure returns(uint d) {... */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":7:146 */\n tag_14:\n 0x00\n /* \"#utility.yul\":91:97 */\n dup2\n /* \"#utility.yul\":78:98 */\n calldataload\n /* \"#utility.yul\":69:98 */\n swap1\n pop\n /* \"#utility.yul\":107:140 */\n tag_16\n /* \"#utility.yul\":134:139 */\n dup2\n /* \"#utility.yul\":107:140 */\n tag_17\n jump\t// in\n tag_16:\n /* \"#utility.yul\":59:146 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":152:414 */\n tag_6:\n 0x00\n /* \"#utility.yul\":260:262 */\n 0x20\n /* \"#utility.yul\":248:257 */\n dup3\n /* \"#utility.yul\":239:246 */\n dup5\n /* \"#utility.yul\":235:258 */\n sub\n /* \"#utility.yul\":231:263 */\n slt\n /* \"#utility.yul\":228:230 */\n iszero\n tag_19\n jumpi\n /* \"#utility.yul\":276:277 */\n 0x00\n /* \"#utility.yul\":273:274 */\n dup1\n /* \"#utility.yul\":266:278 */\n revert\n /* \"#utility.yul\":228:230 */\n tag_19:\n /* \"#utility.yul\":319:320 */\n 0x00\n /* \"#utility.yul\":344:397 */\n tag_20\n /* \"#utility.yul\":389:396 */\n dup5\n /* \"#utility.yul\":380:386 */\n dup3\n /* \"#utility.yul\":369:378 */\n dup6\n /* \"#utility.yul\":365:387 */\n add\n /* \"#utility.yul\":344:397 */\n tag_14\n jump\t// in\n tag_20:\n /* \"#utility.yul\":334:397 */\n swap2\n pop\n /* \"#utility.yul\":290:407 */\n pop\n /* \"#utility.yul\":218:414 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":420:538 */\n tag_21:\n /* \"#utility.yul\":507:531 */\n tag_23\n /* \"#utility.yul\":525:530 */\n dup2\n /* \"#utility.yul\":507:531 */\n tag_24\n jump\t// in\n tag_23:\n /* \"#utility.yul\":502:505 */\n dup3\n /* \"#utility.yul\":495:532 */\n mstore\n /* \"#utility.yul\":485:538 */\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":544:766 */\n tag_9:\n 0x00\n /* \"#utility.yul\":675:677 */\n 0x20\n /* \"#utility.yul\":664:673 */\n dup3\n /* \"#utility.yul\":660:678 */\n add\n /* \"#utility.yul\":652:678 */\n swap1\n pop\n /* \"#utility.yul\":688:759 */\n tag_26\n /* \"#utility.yul\":756:757 */\n 0x00\n /* \"#utility.yul\":745:754 */\n dup4\n /* \"#utility.yul\":741:758 */\n add\n /* \"#utility.yul\":732:738 */\n dup5\n /* \"#utility.yul\":688:759 */\n tag_21\n jump\t// in\n tag_26:\n /* \"#utility.yul\":642:766 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":772:1120 */\n tag_12:\n 0x00\n /* \"#utility.yul\":835:855 */\n tag_28\n /* \"#utility.yul\":853:854 */\n dup3\n /* \"#utility.yul\":835:855 */\n tag_24\n jump\t// in\n tag_28:\n /* \"#utility.yul\":830:855 */\n swap2\n pop\n /* \"#utility.yul\":869:889 */\n tag_29\n /* \"#utility.yul\":887:888 */\n dup4\n /* \"#utility.yul\":869:889 */\n tag_24\n jump\t// in\n tag_29:\n /* \"#utility.yul\":864:889 */\n swap3\n pop\n /* \"#utility.yul\":1057:1058 */\n dup2\n /* \"#utility.yul\":989:1055 */\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\n /* \"#utility.yul\":985:1059 */\n div\n /* \"#utility.yul\":982:983 */\n dup4\n /* \"#utility.yul\":979:1060 */\n gt\n /* \"#utility.yul\":974:975 */\n dup3\n /* \"#utility.yul\":967:976 */\n iszero\n /* \"#utility.yul\":960:977 */\n iszero\n /* \"#utility.yul\":956:1061 */\n and\n /* \"#utility.yul\":953:955 */\n iszero\n tag_30\n jumpi\n /* \"#utility.yul\":1064:1082 */\n tag_31\n tag_32\n jump\t// in\n tag_31:\n /* \"#utility.yul\":953:955 */\n tag_30:\n /* \"#utility.yul\":1112:1113 */\n dup3\n /* \"#utility.yul\":1109:1110 */\n dup3\n /* \"#utility.yul\":1105:1114 */\n mul\n /* \"#utility.yul\":1094:1114 */\n swap1\n pop\n /* \"#utility.yul\":820:1120 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":1126:1203 */\n tag_24:\n 0x00\n /* \"#utility.yul\":1192:1197 */\n dup2\n /* \"#utility.yul\":1181:1197 */\n swap1\n pop\n /* \"#utility.yul\":1171:1203 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":1209:1389 */\n tag_32:\n /* \"#utility.yul\":1257:1334 */\n 0x4e487b7100000000000000000000000000000000000000000000000000000000\n /* \"#utility.yul\":1254:1255 */\n 0x00\n /* \"#utility.yul\":1247:1335 */\n mstore\n /* \"#utility.yul\":1354:1358 */\n 0x11\n /* \"#utility.yul\":1351:1352 */\n 0x04\n /* \"#utility.yul\":1344:1359 */\n mstore\n /* \"#utility.yul\":1378:1382 */\n 0x24\n /* \"#utility.yul\":1375:1376 */\n 0x00\n /* \"#utility.yul\":1368:1383 */\n revert\n /* \"#utility.yul\":1395:1517 */\n tag_17:\n /* \"#utility.yul\":1468:1492 */\n tag_36\n /* \"#utility.yul\":1486:1491 */\n dup2\n /* \"#utility.yul\":1468:1492 */\n tag_24\n jump\t// in\n tag_36:\n /* \"#utility.yul\":1461:1466 */\n dup2\n /* \"#utility.yul\":1458:1493 */\n eq\n /* \"#utility.yul\":1448:1450 */\n tag_37\n jumpi\n /* \"#utility.yul\":1507:1508 */\n 0x00\n /* \"#utility.yul\":1504:1505 */\n dup1\n /* \"#utility.yul\":1497:1509 */\n revert\n /* \"#utility.yul\":1448:1450 */\n tag_37:\n /* \"#utility.yul\":1438:1517 */\n pop\n jump\t// out\n\n auxdata: 0xa2646970667358221220a82dff050f5e40b874671c1f40e579b5a8c361f5313d1a9d32437222ab6a384c64736f6c63430008030033\n}\n", + "bytecode": { + "generatedSources": [], + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b506101be806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c6888fa114610030575b600080fd5b61004a6004803603810190610045919061008b565b610060565b60405161005791906100c3565b60405180910390f35b600060078261006f91906100de565b9050919050565b60008135905061008581610171565b92915050565b60006020828403121561009d57600080fd5b60006100ab84828501610076565b91505092915050565b6100bd81610138565b82525050565b60006020820190506100d860008301846100b4565b92915050565b60006100e982610138565b91506100f483610138565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561012d5761012c610142565b5b828202905092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b61017a81610138565b811461018557600080fd5b5056fea2646970667358221220a82dff050f5e40b874671c1f40e579b5a8c361f5313d1a9d32437222ab6a384c64736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1BE 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 0x2B JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0xC6888FA1 EQ PUSH2 0x30 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4A PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x45 SWAP2 SWAP1 PUSH2 0x8B JUMP JUMPDEST PUSH2 0x60 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x57 SWAP2 SWAP1 PUSH2 0xC3 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 PUSH1 0x7 DUP3 PUSH2 0x6F SWAP2 SWAP1 PUSH2 0xDE JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x85 DUP2 PUSH2 0x171 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x9D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0xAB DUP5 DUP3 DUP6 ADD PUSH2 0x76 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0xBD DUP2 PUSH2 0x138 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0xD8 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0xB4 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xE9 DUP3 PUSH2 0x138 JUMP JUMPDEST SWAP2 POP PUSH2 0xF4 DUP4 PUSH2 0x138 JUMP JUMPDEST SWAP3 POP DUP2 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DIV DUP4 GT DUP3 ISZERO ISZERO AND ISZERO PUSH2 0x12D JUMPI PUSH2 0x12C PUSH2 0x142 JUMP JUMPDEST JUMPDEST DUP3 DUP3 MUL SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH2 0x17A DUP2 PUSH2 0x138 JUMP JUMPDEST DUP2 EQ PUSH2 0x185 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xA8 0x2D SELFDESTRUCT SDIV 0xF 0x5E BLOCKHASH 0xB8 PUSH21 0x671C1F40E579B5A8C361F5313D1A9D32437222AB6A CODESIZE 0x4C PUSH5 0x736F6C6343 STOP ADDMOD SUB STOP CALLER ", + "sourceMap": "39:128:0:-:0;;;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "generatedSources": [ + { + "ast": { + "nodeType": "YulBlock", + "src": "0:1520:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "59:87:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "69:29:1", + "value": { + "arguments": [ + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "91:6:1" + } + ], + "functionName": { + "name": "calldataload", + "nodeType": "YulIdentifier", + "src": "78:12:1" + }, + "nodeType": "YulFunctionCall", + "src": "78:20:1" + }, + "variableNames": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "69:5:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "134:5:1" + } + ], + "functionName": { + "name": "validator_revert_t_uint256", + "nodeType": "YulIdentifier", + "src": "107:26:1" + }, + "nodeType": "YulFunctionCall", + "src": "107:33:1" + }, + "nodeType": "YulExpressionStatement", + "src": "107:33:1" + } + ] + }, + "name": "abi_decode_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "37:6:1", + "type": "" + }, + { + "name": "end", + "nodeType": "YulTypedName", + "src": "45:3:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "53:5:1", + "type": "" + } + ], + "src": "7:139:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "218:196:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "264:16:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "273:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "276:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "266:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "266:12:1" + }, + "nodeType": "YulExpressionStatement", + "src": "266:12:1" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "239:7:1" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "248:9:1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "235:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "235:23:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "260:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "231:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "231:32:1" + }, + "nodeType": "YulIf", + "src": "228:2:1" + }, + { + "nodeType": "YulBlock", + "src": "290:117:1", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "305:15:1", + "value": { + "kind": "number", + "nodeType": "YulLiteral", + "src": "319:1:1", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "309:6:1", + "type": "" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "334:63:1", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "369:9:1" + }, + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "380:6:1" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "365:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "365:22:1" + }, + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "389:7:1" + } + ], + "functionName": { + "name": "abi_decode_t_uint256", + "nodeType": "YulIdentifier", + "src": "344:20:1" + }, + "nodeType": "YulFunctionCall", + "src": "344:53:1" + }, + "variableNames": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "334:6:1" + } + ] + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "188:9:1", + "type": "" + }, + { + "name": "dataEnd", + "nodeType": "YulTypedName", + "src": "199:7:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "211:6:1", + "type": "" + } + ], + "src": "152:262:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "485:53:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "502:3:1" + }, + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "525:5:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "507:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "507:24:1" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "495:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "495:37:1" + }, + "nodeType": "YulExpressionStatement", + "src": "495:37:1" + } + ] + }, + "name": "abi_encode_t_uint256_to_t_uint256_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "473:5:1", + "type": "" + }, + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "480:3:1", + "type": "" + } + ], + "src": "420:118:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "642:124:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "652:26:1", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "664:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "675:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "660:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "660:18:1" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "652:4:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "732:6:1" + }, + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "745:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "756:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "741:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "741:17:1" + } + ], + "functionName": { + "name": "abi_encode_t_uint256_to_t_uint256_fromStack", + "nodeType": "YulIdentifier", + "src": "688:43:1" + }, + "nodeType": "YulFunctionCall", + "src": "688:71:1" + }, + "nodeType": "YulExpressionStatement", + "src": "688:71:1" + } + ] + }, + "name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "614:9:1", + "type": "" + }, + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "626:6:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "637:4:1", + "type": "" + } + ], + "src": "544:222:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "820:300:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "830:25:1", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "853:1:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "835:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "835:20:1" + }, + "variableNames": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "830:1:1" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "864:25:1", + "value": { + "arguments": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "887:1:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "869:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "869:20:1" + }, + "variableNames": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "864:1:1" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1062:22:1", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nodeType": "YulIdentifier", + "src": "1064:16:1" + }, + "nodeType": "YulFunctionCall", + "src": "1064:18:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1064:18:1" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "974:1:1" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "967:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "967:9:1" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "960:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "960:17:1" + }, + { + "arguments": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "982:1:1" + }, + { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "989:66:1", + "type": "", + "value": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + }, + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "1057:1:1" + } + ], + "functionName": { + "name": "div", + "nodeType": "YulIdentifier", + "src": "985:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "985:74:1" + } + ], + "functionName": { + "name": "gt", + "nodeType": "YulIdentifier", + "src": "979:2:1" + }, + "nodeType": "YulFunctionCall", + "src": "979:81:1" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "956:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "956:105:1" + }, + "nodeType": "YulIf", + "src": "953:2:1" + }, + { + "nodeType": "YulAssignment", + "src": "1094:20:1", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "1109:1:1" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "1112:1:1" + } + ], + "functionName": { + "name": "mul", + "nodeType": "YulIdentifier", + "src": "1105:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1105:9:1" + }, + "variableNames": [ + { + "name": "product", + "nodeType": "YulIdentifier", + "src": "1094:7:1" + } + ] + } + ] + }, + "name": "checked_mul_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "x", + "nodeType": "YulTypedName", + "src": "803:1:1", + "type": "" + }, + { + "name": "y", + "nodeType": "YulTypedName", + "src": "806:1:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "product", + "nodeType": "YulTypedName", + "src": "812:7:1", + "type": "" + } + ], + "src": "772:348:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1171:32:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "1181:16:1", + "value": { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1192:5:1" + }, + "variableNames": [ + { + "name": "cleaned", + "nodeType": "YulIdentifier", + "src": "1181:7:1" + } + ] + } + ] + }, + "name": "cleanup_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "1153:5:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "cleaned", + "nodeType": "YulTypedName", + "src": "1163:7:1", + "type": "" + } + ], + "src": "1126:77:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1237:152:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1254:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1257:77:1", + "type": "", + "value": "35408467139433450592217433187231851964531694900788300625387963629091585785856" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "1247:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1247:88:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1247:88:1" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1351:1:1", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1354:4:1", + "type": "", + "value": "0x11" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "1344:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1344:15:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1344:15:1" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1375:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1378:4:1", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "1368:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1368:15:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1368:15:1" + } + ] + }, + "name": "panic_error_0x11", + "nodeType": "YulFunctionDefinition", + "src": "1209:180:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1438:79:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "1495:16:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1504:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1507:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "1497:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1497:12:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1497:12:1" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1461:5:1" + }, + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1486:5:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "1468:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "1468:24:1" + } + ], + "functionName": { + "name": "eq", + "nodeType": "YulIdentifier", + "src": "1458:2:1" + }, + "nodeType": "YulFunctionCall", + "src": "1458:35:1" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "1451:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1451:43:1" + }, + "nodeType": "YulIf", + "src": "1448:2:1" + } + ] + }, + "name": "validator_revert_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "1431:5:1", + "type": "" + } + ], + "src": "1395:122:1" + } + ] + }, + "contents": "{\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(0, 0) }\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 function checked_mul_t_uint256(x, y) -> product {\n x := cleanup_t_uint256(x)\n y := cleanup_t_uint256(y)\n\n // overflow, if x != 0 and y > (maxValue / x)\n if and(iszero(iszero(x)), gt(y, div(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, x))) { panic_error_0x11() }\n\n product := mul(x, y)\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function panic_error_0x11() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n\n function validator_revert_t_uint256(value) {\n if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }\n }\n\n}\n", + "id": 1, + "language": "Yul", + "name": "#utility.yul" + } + ], + "immutableReferences": {}, + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c6888fa114610030575b600080fd5b61004a6004803603810190610045919061008b565b610060565b60405161005791906100c3565b60405180910390f35b600060078261006f91906100de565b9050919050565b60008135905061008581610171565b92915050565b60006020828403121561009d57600080fd5b60006100ab84828501610076565b91505092915050565b6100bd81610138565b82525050565b60006020820190506100d860008301846100b4565b92915050565b60006100e982610138565b91506100f483610138565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561012d5761012c610142565b5b828202905092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b61017a81610138565b811461018557600080fd5b5056fea2646970667358221220a82dff050f5e40b874671c1f40e579b5a8c361f5313d1a9d32437222ab6a384c64736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x2B JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0xC6888FA1 EQ PUSH2 0x30 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4A PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x45 SWAP2 SWAP1 PUSH2 0x8B JUMP JUMPDEST PUSH2 0x60 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x57 SWAP2 SWAP1 PUSH2 0xC3 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 PUSH1 0x7 DUP3 PUSH2 0x6F SWAP2 SWAP1 PUSH2 0xDE JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x85 DUP2 PUSH2 0x171 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x9D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0xAB DUP5 DUP3 DUP6 ADD PUSH2 0x76 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0xBD DUP2 PUSH2 0x138 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0xD8 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0xB4 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xE9 DUP3 PUSH2 0x138 JUMP JUMPDEST SWAP2 POP PUSH2 0xF4 DUP4 PUSH2 0x138 JUMP JUMPDEST SWAP3 POP DUP2 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DIV DUP4 GT DUP3 ISZERO ISZERO AND ISZERO PUSH2 0x12D JUMPI PUSH2 0x12C PUSH2 0x142 JUMP JUMPDEST JUMPDEST DUP3 DUP3 MUL SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH2 0x17A DUP2 PUSH2 0x138 JUMP JUMPDEST DUP2 EQ PUSH2 0x185 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xA8 0x2D SELFDESTRUCT SDIV 0xF 0x5E BLOCKHASH 0xB8 PUSH21 0x671C1F40E579B5A8C361F5313D1A9D32437222AB6A CODESIZE 0x4C PUSH5 0x736F6C6343 STOP ADDMOD SUB STOP CALLER ", + "sourceMap": "39:128:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;71:90;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;117:6;149:1;146;:4;;;;:::i;:::-;139:11;;71:90;;;:::o;7:139:1:-;;91:6;78:20;69:29;;107:33;134:5;107:33;:::i;:::-;59:87;;;;:::o;152:262::-;;260:2;248:9;239:7;235:23;231:32;228:2;;;276:1;273;266:12;228:2;319:1;344:53;389:7;380:6;369:9;365:22;344:53;:::i;:::-;334:63;;290:117;218:196;;;;:::o;420:118::-;507:24;525:5;507:24;:::i;:::-;502:3;495:37;485:53;;:::o;544:222::-;;675:2;664:9;660:18;652:26;;688:71;756:1;745:9;741:17;732:6;688:71;:::i;:::-;642:124;;;;:::o;772:348::-;;835:20;853:1;835:20;:::i;:::-;830:25;;869:20;887:1;869:20;:::i;:::-;864:25;;1057:1;989:66;985:74;982:1;979:81;974:1;967:9;960:17;956:105;953:2;;;1064:18;;:::i;:::-;953:2;1112:1;1109;1105:9;1094:20;;820:300;;;;:::o;1126:77::-;;1192:5;1181:16;;1171:32;;;:::o;1209:180::-;1257:77;1254:1;1247:88;1354:4;1351:1;1344:15;1378:4;1375:1;1368:15;1395:122;1468:24;1486:5;1468:24;:::i;:::-;1461:5;1458:35;1448:2;;1507:1;1504;1497:12;1448:2;1438:79;:::o" + }, + "gasEstimates": { + "creation": { + "codeDepositCost": "89200", + "executionCost": "135", + "totalCost": "89335" + }, + "external": { "multiply(uint256)": "infinite" } + }, + "legacyAssembly": { + ".code": [ + { + "begin": 39, + "end": 167, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 39, + "end": 167, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 39, "end": 167, "name": "MSTORE", "source": 0 }, + { "begin": 39, "end": 167, "name": "CALLVALUE", "source": 0 }, + { "begin": 39, "end": 167, "name": "DUP1", "source": 0 }, + { "begin": 39, "end": 167, "name": "ISZERO", "source": 0 }, + { + "begin": 39, + "end": 167, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 39, "end": 167, "name": "JUMPI", "source": 0 }, + { + "begin": 39, + "end": 167, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 167, "name": "DUP1", "source": 0 }, + { "begin": 39, "end": 167, "name": "REVERT", "source": 0 }, + { "begin": 39, "end": 167, "name": "tag", "source": 0, "value": "1" }, + { "begin": 39, "end": 167, "name": "JUMPDEST", "source": 0 }, + { "begin": 39, "end": 167, "name": "POP", "source": 0 }, + { + "begin": 39, + "end": 167, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 39, "end": 167, "name": "DUP1", "source": 0 }, + { + "begin": 39, + "end": 167, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 39, + "end": 167, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 167, "name": "CODECOPY", "source": 0 }, + { + "begin": 39, + "end": 167, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 167, "name": "RETURN", "source": 0 } + ], + ".data": { + "0": { + ".auxdata": "a2646970667358221220a82dff050f5e40b874671c1f40e579b5a8c361f5313d1a9d32437222ab6a384c64736f6c63430008030033", + ".code": [ + { + "begin": 39, + "end": 167, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 39, + "end": 167, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 39, "end": 167, "name": "MSTORE", "source": 0 }, + { "begin": 39, "end": 167, "name": "CALLVALUE", "source": 0 }, + { "begin": 39, "end": 167, "name": "DUP1", "source": 0 }, + { "begin": 39, "end": 167, "name": "ISZERO", "source": 0 }, + { + "begin": 39, + "end": 167, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 39, "end": 167, "name": "JUMPI", "source": 0 }, + { + "begin": 39, + "end": 167, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 167, "name": "DUP1", "source": 0 }, + { "begin": 39, "end": 167, "name": "REVERT", "source": 0 }, + { + "begin": 39, + "end": 167, + "name": "tag", + "source": 0, + "value": "1" + }, + { "begin": 39, "end": 167, "name": "JUMPDEST", "source": 0 }, + { "begin": 39, "end": 167, "name": "POP", "source": 0 }, + { + "begin": 39, + "end": 167, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 39, "end": 167, "name": "CALLDATASIZE", "source": 0 }, + { "begin": 39, "end": 167, "name": "LT", "source": 0 }, + { + "begin": 39, + "end": 167, + "name": "PUSH [tag]", + "source": 0, + "value": "2" + }, + { "begin": 39, "end": 167, "name": "JUMPI", "source": 0 }, + { + "begin": 39, + "end": 167, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 167, "name": "CALLDATALOAD", "source": 0 }, + { + "begin": 39, + "end": 167, + "name": "PUSH", + "source": 0, + "value": "E0" + }, + { "begin": 39, "end": 167, "name": "SHR", "source": 0 }, + { "begin": 39, "end": 167, "name": "DUP1", "source": 0 }, + { + "begin": 39, + "end": 167, + "name": "PUSH", + "source": 0, + "value": "C6888FA1" + }, + { "begin": 39, "end": 167, "name": "EQ", "source": 0 }, + { + "begin": 39, + "end": 167, + "name": "PUSH [tag]", + "source": 0, + "value": "3" + }, + { "begin": 39, "end": 167, "name": "JUMPI", "source": 0 }, + { + "begin": 39, + "end": 167, + "name": "tag", + "source": 0, + "value": "2" + }, + { "begin": 39, "end": 167, "name": "JUMPDEST", "source": 0 }, + { + "begin": 39, + "end": 167, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 167, "name": "DUP1", "source": 0 }, + { "begin": 39, "end": 167, "name": "REVERT", "source": 0 }, + { + "begin": 71, + "end": 161, + "name": "tag", + "source": 0, + "value": "3" + }, + { "begin": 71, "end": 161, "name": "JUMPDEST", "source": 0 }, + { + "begin": 71, + "end": 161, + "name": "PUSH [tag]", + "source": 0, + "value": "4" + }, + { + "begin": 71, + "end": 161, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 71, "end": 161, "name": "DUP1", "source": 0 }, + { "begin": 71, "end": 161, "name": "CALLDATASIZE", "source": 0 }, + { "begin": 71, "end": 161, "name": "SUB", "source": 0 }, + { "begin": 71, "end": 161, "name": "DUP2", "source": 0 }, + { "begin": 71, "end": 161, "name": "ADD", "source": 0 }, + { "begin": 71, "end": 161, "name": "SWAP1", "source": 0 }, + { + "begin": 71, + "end": 161, + "name": "PUSH [tag]", + "source": 0, + "value": "5" + }, + { "begin": 71, "end": 161, "name": "SWAP2", "source": 0 }, + { "begin": 71, "end": 161, "name": "SWAP1", "source": 0 }, + { + "begin": 71, + "end": 161, + "name": "PUSH [tag]", + "source": 0, + "value": "6" + }, + { + "begin": 71, + "end": 161, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 71, + "end": 161, + "name": "tag", + "source": 0, + "value": "5" + }, + { "begin": 71, "end": 161, "name": "JUMPDEST", "source": 0 }, + { + "begin": 71, + "end": 161, + "name": "PUSH [tag]", + "source": 0, + "value": "7" + }, + { + "begin": 71, + "end": 161, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 71, + "end": 161, + "name": "tag", + "source": 0, + "value": "4" + }, + { "begin": 71, "end": 161, "name": "JUMPDEST", "source": 0 }, + { + "begin": 71, + "end": 161, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 71, "end": 161, "name": "MLOAD", "source": 0 }, + { + "begin": 71, + "end": 161, + "name": "PUSH [tag]", + "source": 0, + "value": "8" + }, + { "begin": 71, "end": 161, "name": "SWAP2", "source": 0 }, + { "begin": 71, "end": 161, "name": "SWAP1", "source": 0 }, + { + "begin": 71, + "end": 161, + "name": "PUSH [tag]", + "source": 0, + "value": "9" + }, + { + "begin": 71, + "end": 161, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 71, + "end": 161, + "name": "tag", + "source": 0, + "value": "8" + }, + { "begin": 71, "end": 161, "name": "JUMPDEST", "source": 0 }, + { + "begin": 71, + "end": 161, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 71, "end": 161, "name": "MLOAD", "source": 0 }, + { "begin": 71, "end": 161, "name": "DUP1", "source": 0 }, + { "begin": 71, "end": 161, "name": "SWAP2", "source": 0 }, + { "begin": 71, "end": 161, "name": "SUB", "source": 0 }, + { "begin": 71, "end": 161, "name": "SWAP1", "source": 0 }, + { "begin": 71, "end": 161, "name": "RETURN", "source": 0 }, + { + "begin": 71, + "end": 161, + "name": "tag", + "source": 0, + "value": "7" + }, + { "begin": 71, "end": 161, "name": "JUMPDEST", "source": 0 }, + { + "begin": 117, + "end": 123, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { + "begin": 149, + "end": 150, + "name": "PUSH", + "source": 0, + "value": "7" + }, + { "begin": 146, "end": 147, "name": "DUP3", "source": 0 }, + { + "begin": 146, + "end": 150, + "name": "PUSH [tag]", + "source": 0, + "value": "11" + }, + { "begin": 146, "end": 150, "name": "SWAP2", "source": 0 }, + { "begin": 146, "end": 150, "name": "SWAP1", "source": 0 }, + { + "begin": 146, + "end": 150, + "name": "PUSH [tag]", + "source": 0, + "value": "12" + }, + { + "begin": 146, + "end": 150, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 146, + "end": 150, + "name": "tag", + "source": 0, + "value": "11" + }, + { "begin": 146, "end": 150, "name": "JUMPDEST", "source": 0 }, + { "begin": 139, "end": 150, "name": "SWAP1", "source": 0 }, + { "begin": 139, "end": 150, "name": "POP", "source": 0 }, + { "begin": 71, "end": 161, "name": "SWAP2", "source": 0 }, + { "begin": 71, "end": 161, "name": "SWAP1", "source": 0 }, + { "begin": 71, "end": 161, "name": "POP", "source": 0 }, + { + "begin": 71, + "end": 161, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { + "begin": 7, + "end": 146, + "name": "tag", + "source": 1, + "value": "14" + }, + { "begin": 7, "end": 146, "name": "JUMPDEST", "source": 1 }, + { + "begin": 7, + "end": 146, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 91, "end": 97, "name": "DUP2", "source": 1 }, + { "begin": 78, "end": 98, "name": "CALLDATALOAD", "source": 1 }, + { "begin": 69, "end": 98, "name": "SWAP1", "source": 1 }, + { "begin": 69, "end": 98, "name": "POP", "source": 1 }, + { + "begin": 107, + "end": 140, + "name": "PUSH [tag]", + "source": 1, + "value": "16" + }, + { "begin": 134, "end": 139, "name": "DUP2", "source": 1 }, + { + "begin": 107, + "end": 140, + "name": "PUSH [tag]", + "source": 1, + "value": "17" + }, + { + "begin": 107, + "end": 140, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 107, + "end": 140, + "name": "tag", + "source": 1, + "value": "16" + }, + { "begin": 107, "end": 140, "name": "JUMPDEST", "source": 1 }, + { "begin": 59, "end": 146, "name": "SWAP3", "source": 1 }, + { "begin": 59, "end": 146, "name": "SWAP2", "source": 1 }, + { "begin": 59, "end": 146, "name": "POP", "source": 1 }, + { "begin": 59, "end": 146, "name": "POP", "source": 1 }, + { + "begin": 59, + "end": 146, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 152, + "end": 414, + "name": "tag", + "source": 1, + "value": "6" + }, + { "begin": 152, "end": 414, "name": "JUMPDEST", "source": 1 }, + { + "begin": 152, + "end": 414, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 260, + "end": 262, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 248, "end": 257, "name": "DUP3", "source": 1 }, + { "begin": 239, "end": 246, "name": "DUP5", "source": 1 }, + { "begin": 235, "end": 258, "name": "SUB", "source": 1 }, + { "begin": 231, "end": 263, "name": "SLT", "source": 1 }, + { "begin": 228, "end": 230, "name": "ISZERO", "source": 1 }, + { + "begin": 228, + "end": 230, + "name": "PUSH [tag]", + "source": 1, + "value": "19" + }, + { "begin": 228, "end": 230, "name": "JUMPI", "source": 1 }, + { + "begin": 276, + "end": 277, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 273, "end": 274, "name": "DUP1", "source": 1 }, + { "begin": 266, "end": 278, "name": "REVERT", "source": 1 }, + { + "begin": 228, + "end": 230, + "name": "tag", + "source": 1, + "value": "19" + }, + { "begin": 228, "end": 230, "name": "JUMPDEST", "source": 1 }, + { + "begin": 319, + "end": 320, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 344, + "end": 397, + "name": "PUSH [tag]", + "source": 1, + "value": "20" + }, + { "begin": 389, "end": 396, "name": "DUP5", "source": 1 }, + { "begin": 380, "end": 386, "name": "DUP3", "source": 1 }, + { "begin": 369, "end": 378, "name": "DUP6", "source": 1 }, + { "begin": 365, "end": 387, "name": "ADD", "source": 1 }, + { + "begin": 344, + "end": 397, + "name": "PUSH [tag]", + "source": 1, + "value": "14" + }, + { + "begin": 344, + "end": 397, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 344, + "end": 397, + "name": "tag", + "source": 1, + "value": "20" + }, + { "begin": 344, "end": 397, "name": "JUMPDEST", "source": 1 }, + { "begin": 334, "end": 397, "name": "SWAP2", "source": 1 }, + { "begin": 334, "end": 397, "name": "POP", "source": 1 }, + { "begin": 290, "end": 407, "name": "POP", "source": 1 }, + { "begin": 218, "end": 414, "name": "SWAP3", "source": 1 }, + { "begin": 218, "end": 414, "name": "SWAP2", "source": 1 }, + { "begin": 218, "end": 414, "name": "POP", "source": 1 }, + { "begin": 218, "end": 414, "name": "POP", "source": 1 }, + { + "begin": 218, + "end": 414, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 420, + "end": 538, + "name": "tag", + "source": 1, + "value": "21" + }, + { "begin": 420, "end": 538, "name": "JUMPDEST", "source": 1 }, + { + "begin": 507, + "end": 531, + "name": "PUSH [tag]", + "source": 1, + "value": "23" + }, + { "begin": 525, "end": 530, "name": "DUP2", "source": 1 }, + { + "begin": 507, + "end": 531, + "name": "PUSH [tag]", + "source": 1, + "value": "24" + }, + { + "begin": 507, + "end": 531, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 507, + "end": 531, + "name": "tag", + "source": 1, + "value": "23" + }, + { "begin": 507, "end": 531, "name": "JUMPDEST", "source": 1 }, + { "begin": 502, "end": 505, "name": "DUP3", "source": 1 }, + { "begin": 495, "end": 532, "name": "MSTORE", "source": 1 }, + { "begin": 485, "end": 538, "name": "POP", "source": 1 }, + { "begin": 485, "end": 538, "name": "POP", "source": 1 }, + { + "begin": 485, + "end": 538, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 544, + "end": 766, + "name": "tag", + "source": 1, + "value": "9" + }, + { "begin": 544, "end": 766, "name": "JUMPDEST", "source": 1 }, + { + "begin": 544, + "end": 766, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 675, + "end": 677, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 664, "end": 673, "name": "DUP3", "source": 1 }, + { "begin": 660, "end": 678, "name": "ADD", "source": 1 }, + { "begin": 652, "end": 678, "name": "SWAP1", "source": 1 }, + { "begin": 652, "end": 678, "name": "POP", "source": 1 }, + { + "begin": 688, + "end": 759, + "name": "PUSH [tag]", + "source": 1, + "value": "26" + }, + { + "begin": 756, + "end": 757, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 745, "end": 754, "name": "DUP4", "source": 1 }, + { "begin": 741, "end": 758, "name": "ADD", "source": 1 }, + { "begin": 732, "end": 738, "name": "DUP5", "source": 1 }, + { + "begin": 688, + "end": 759, + "name": "PUSH [tag]", + "source": 1, + "value": "21" + }, + { + "begin": 688, + "end": 759, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 688, + "end": 759, + "name": "tag", + "source": 1, + "value": "26" + }, + { "begin": 688, "end": 759, "name": "JUMPDEST", "source": 1 }, + { "begin": 642, "end": 766, "name": "SWAP3", "source": 1 }, + { "begin": 642, "end": 766, "name": "SWAP2", "source": 1 }, + { "begin": 642, "end": 766, "name": "POP", "source": 1 }, + { "begin": 642, "end": 766, "name": "POP", "source": 1 }, + { + "begin": 642, + "end": 766, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 772, + "end": 1120, + "name": "tag", + "source": 1, + "value": "12" + }, + { "begin": 772, "end": 1120, "name": "JUMPDEST", "source": 1 }, + { + "begin": 772, + "end": 1120, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 835, + "end": 855, + "name": "PUSH [tag]", + "source": 1, + "value": "28" + }, + { "begin": 853, "end": 854, "name": "DUP3", "source": 1 }, + { + "begin": 835, + "end": 855, + "name": "PUSH [tag]", + "source": 1, + "value": "24" + }, + { + "begin": 835, + "end": 855, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 835, + "end": 855, + "name": "tag", + "source": 1, + "value": "28" + }, + { "begin": 835, "end": 855, "name": "JUMPDEST", "source": 1 }, + { "begin": 830, "end": 855, "name": "SWAP2", "source": 1 }, + { "begin": 830, "end": 855, "name": "POP", "source": 1 }, + { + "begin": 869, + "end": 889, + "name": "PUSH [tag]", + "source": 1, + "value": "29" + }, + { "begin": 887, "end": 888, "name": "DUP4", "source": 1 }, + { + "begin": 869, + "end": 889, + "name": "PUSH [tag]", + "source": 1, + "value": "24" + }, + { + "begin": 869, + "end": 889, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 869, + "end": 889, + "name": "tag", + "source": 1, + "value": "29" + }, + { "begin": 869, "end": 889, "name": "JUMPDEST", "source": 1 }, + { "begin": 864, "end": 889, "name": "SWAP3", "source": 1 }, + { "begin": 864, "end": 889, "name": "POP", "source": 1 }, + { "begin": 1057, "end": 1058, "name": "DUP2", "source": 1 }, + { + "begin": 989, + "end": 1055, + "name": "PUSH", + "source": 1, + "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + }, + { "begin": 985, "end": 1059, "name": "DIV", "source": 1 }, + { "begin": 982, "end": 983, "name": "DUP4", "source": 1 }, + { "begin": 979, "end": 1060, "name": "GT", "source": 1 }, + { "begin": 974, "end": 975, "name": "DUP3", "source": 1 }, + { "begin": 967, "end": 976, "name": "ISZERO", "source": 1 }, + { "begin": 960, "end": 977, "name": "ISZERO", "source": 1 }, + { "begin": 956, "end": 1061, "name": "AND", "source": 1 }, + { "begin": 953, "end": 955, "name": "ISZERO", "source": 1 }, + { + "begin": 953, + "end": 955, + "name": "PUSH [tag]", + "source": 1, + "value": "30" + }, + { "begin": 953, "end": 955, "name": "JUMPI", "source": 1 }, + { + "begin": 1064, + "end": 1082, + "name": "PUSH [tag]", + "source": 1, + "value": "31" + }, + { + "begin": 1064, + "end": 1082, + "name": "PUSH [tag]", + "source": 1, + "value": "32" + }, + { + "begin": 1064, + "end": 1082, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1064, + "end": 1082, + "name": "tag", + "source": 1, + "value": "31" + }, + { "begin": 1064, "end": 1082, "name": "JUMPDEST", "source": 1 }, + { + "begin": 953, + "end": 955, + "name": "tag", + "source": 1, + "value": "30" + }, + { "begin": 953, "end": 955, "name": "JUMPDEST", "source": 1 }, + { "begin": 1112, "end": 1113, "name": "DUP3", "source": 1 }, + { "begin": 1109, "end": 1110, "name": "DUP3", "source": 1 }, + { "begin": 1105, "end": 1114, "name": "MUL", "source": 1 }, + { "begin": 1094, "end": 1114, "name": "SWAP1", "source": 1 }, + { "begin": 1094, "end": 1114, "name": "POP", "source": 1 }, + { "begin": 820, "end": 1120, "name": "SWAP3", "source": 1 }, + { "begin": 820, "end": 1120, "name": "SWAP2", "source": 1 }, + { "begin": 820, "end": 1120, "name": "POP", "source": 1 }, + { "begin": 820, "end": 1120, "name": "POP", "source": 1 }, + { + "begin": 820, + "end": 1120, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1126, + "end": 1203, + "name": "tag", + "source": 1, + "value": "24" + }, + { "begin": 1126, "end": 1203, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1126, + "end": 1203, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1192, "end": 1197, "name": "DUP2", "source": 1 }, + { "begin": 1181, "end": 1197, "name": "SWAP1", "source": 1 }, + { "begin": 1181, "end": 1197, "name": "POP", "source": 1 }, + { "begin": 1171, "end": 1203, "name": "SWAP2", "source": 1 }, + { "begin": 1171, "end": 1203, "name": "SWAP1", "source": 1 }, + { "begin": 1171, "end": 1203, "name": "POP", "source": 1 }, + { + "begin": 1171, + "end": 1203, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1209, + "end": 1389, + "name": "tag", + "source": 1, + "value": "32" + }, + { "begin": 1209, "end": 1389, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1257, + "end": 1334, + "name": "PUSH", + "source": 1, + "value": "4E487B7100000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 1254, + "end": 1255, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1247, "end": 1335, "name": "MSTORE", "source": 1 }, + { + "begin": 1354, + "end": 1358, + "name": "PUSH", + "source": 1, + "value": "11" + }, + { + "begin": 1351, + "end": 1352, + "name": "PUSH", + "source": 1, + "value": "4" + }, + { "begin": 1344, "end": 1359, "name": "MSTORE", "source": 1 }, + { + "begin": 1378, + "end": 1382, + "name": "PUSH", + "source": 1, + "value": "24" + }, + { + "begin": 1375, + "end": 1376, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1368, "end": 1383, "name": "REVERT", "source": 1 }, + { + "begin": 1395, + "end": 1517, + "name": "tag", + "source": 1, + "value": "17" + }, + { "begin": 1395, "end": 1517, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1468, + "end": 1492, + "name": "PUSH [tag]", + "source": 1, + "value": "36" + }, + { "begin": 1486, "end": 1491, "name": "DUP2", "source": 1 }, + { + "begin": 1468, + "end": 1492, + "name": "PUSH [tag]", + "source": 1, + "value": "24" + }, + { + "begin": 1468, + "end": 1492, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1468, + "end": 1492, + "name": "tag", + "source": 1, + "value": "36" + }, + { "begin": 1468, "end": 1492, "name": "JUMPDEST", "source": 1 }, + { "begin": 1461, "end": 1466, "name": "DUP2", "source": 1 }, + { "begin": 1458, "end": 1493, "name": "EQ", "source": 1 }, + { + "begin": 1448, + "end": 1450, + "name": "PUSH [tag]", + "source": 1, + "value": "37" + }, + { "begin": 1448, "end": 1450, "name": "JUMPI", "source": 1 }, + { + "begin": 1507, + "end": 1508, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1504, "end": 1505, "name": "DUP1", "source": 1 }, + { "begin": 1497, "end": 1509, "name": "REVERT", "source": 1 }, + { + "begin": 1448, + "end": 1450, + "name": "tag", + "source": 1, + "value": "37" + }, + { "begin": 1448, "end": 1450, "name": "JUMPDEST", "source": 1 }, + { "begin": 1438, "end": 1517, "name": "POP", "source": 1 }, + { + "begin": 1438, + "end": 1517, + "name": "JUMP", + "source": 1, + "value": "[out]" + } + ] + } + } + }, + "methodIdentifiers": { "multiply(uint256)": "c6888fa1" } + }, + "ewasm": { "wasm": "" }, + "metadata": "{\"compiler\":{\"version\":\"0.8.3+commit.8d00100c\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"a\",\"type\":\"uint256\"}],\"name\":\"multiply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"d\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"main.sol\":\"TestContract\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"main.sol\":{\"keccak256\":\"0x5d29beacc41878230d7981905bb45b41180007e0dbc2d810ff03c7b630b4048a\",\"urls\":[\"bzz-raw://b1fbe1547a505b6904392fc22ab43c61ca28882c7687498a84d4d648b374dc0e\",\"dweb:/ipfs/QmRVHiSGD6nBrUfXf8NX18FVrkitbuoVHj2r1To5k2XK6q\"]}},\"version\":1}", + "storageLayout": { "storage": [], "types": null }, + "userdoc": { "kind": "user", "methods": {}, "version": 1 } + }, + "sourceCode": "\n pragma solidity >=0.8.0;\n \n contract TestContract {\n function multiply(uint a) public pure returns(uint d) {\n return a *7;\n }\n }" +} diff --git a/tests/contracts/compiled/TestContractIncr.json b/tests/contracts/compiled/TestContractIncr.json new file mode 100644 index 00000000000..5e1d9d95a15 --- /dev/null +++ b/tests/contracts/compiled/TestContractIncr.json @@ -0,0 +1,1389 @@ +{ + "byteCode": "0x608060405234801561001057600080fd5b506000808190555061016f806100276000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806306661abd1461003b578063119fbbd414610059575b600080fd5b610043610063565b604051610050919061008f565b60405180910390f35b610061610069565b005b60005481565b600160005461007891906100aa565b600081905550565b61008981610100565b82525050565b60006020820190506100a46000830184610080565b92915050565b60006100b582610100565b91506100c083610100565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156100f5576100f461010a565b5b828201905092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea264697066735822122002917a28b1d30a0337377fff711d257a31fb69e1a5c469a4db8e4393e90b0d2064736f6c63430008030033", + "contract": { + "abi": [ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, + { + "inputs": [], + "name": "count", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "incr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "devdoc": { "kind": "dev", "methods": {}, "version": 1 }, + "evm": { + "assembly": " /* \"main.sol\":39:243 contract TestContractIncr {... */\n mstore(0x40, 0x80)\n /* \"main.sol\":107:162 constructor() public {... */\n callvalue\n dup1\n iszero\n tag_1\n jumpi\n 0x00\n dup1\n revert\ntag_1:\n pop\n /* \"main.sol\":150:151 0 */\n 0x00\n /* \"main.sol\":142:147 count */\n dup1\n /* \"main.sol\":142:151 count = 0 */\n dup2\n swap1\n sstore\n pop\n /* \"main.sol\":39:243 contract TestContractIncr {... */\n dataSize(sub_0)\n dup1\n dataOffset(sub_0)\n 0x00\n codecopy\n 0x00\n return\nstop\n\nsub_0: assembly {\n /* \"main.sol\":39:243 contract TestContractIncr {... */\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 0x06661abd\n eq\n tag_3\n jumpi\n dup1\n 0x119fbbd4\n eq\n tag_4\n jumpi\n tag_2:\n 0x00\n dup1\n revert\n /* \"main.sol\":75:92 uint public count */\n tag_3:\n tag_5\n tag_6\n jump\t// in\n tag_5:\n mload(0x40)\n tag_7\n swap2\n swap1\n tag_8\n jump\t// in\n tag_7:\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n return\n /* \"main.sol\":176:237 function incr() public {... */\n tag_4:\n tag_9\n tag_10\n jump\t// in\n tag_9:\n stop\n /* \"main.sol\":75:92 uint public count */\n tag_6:\n sload(0x00)\n dup2\n jump\t// out\n /* \"main.sol\":176:237 function incr() public {... */\n tag_10:\n /* \"main.sol\":225:226 1 */\n 0x01\n /* \"main.sol\":219:224 count */\n sload(0x00)\n /* \"main.sol\":219:226 count+1 */\n tag_12\n swap2\n swap1\n tag_13\n jump\t// in\n tag_12:\n /* \"main.sol\":213:218 count */\n 0x00\n /* \"main.sol\":213:226 count=count+1 */\n dup2\n swap1\n sstore\n pop\n /* \"main.sol\":176:237 function incr() public {... */\n jump\t// out\n /* \"#utility.yul\":7:125 */\n tag_15:\n /* \"#utility.yul\":94:118 */\n tag_17\n /* \"#utility.yul\":112:117 */\n dup2\n /* \"#utility.yul\":94:118 */\n tag_18\n jump\t// in\n tag_17:\n /* \"#utility.yul\":89:92 */\n dup3\n /* \"#utility.yul\":82:119 */\n mstore\n /* \"#utility.yul\":72:125 */\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":131:353 */\n tag_8:\n 0x00\n /* \"#utility.yul\":262:264 */\n 0x20\n /* \"#utility.yul\":251:260 */\n dup3\n /* \"#utility.yul\":247:265 */\n add\n /* \"#utility.yul\":239:265 */\n swap1\n pop\n /* \"#utility.yul\":275:346 */\n tag_20\n /* \"#utility.yul\":343:344 */\n 0x00\n /* \"#utility.yul\":332:341 */\n dup4\n /* \"#utility.yul\":328:345 */\n add\n /* \"#utility.yul\":319:325 */\n dup5\n /* \"#utility.yul\":275:346 */\n tag_15\n jump\t// in\n tag_20:\n /* \"#utility.yul\":229:353 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":359:664 */\n tag_13:\n 0x00\n /* \"#utility.yul\":418:438 */\n tag_22\n /* \"#utility.yul\":436:437 */\n dup3\n /* \"#utility.yul\":418:438 */\n tag_18\n jump\t// in\n tag_22:\n /* \"#utility.yul\":413:438 */\n swap2\n pop\n /* \"#utility.yul\":452:472 */\n tag_23\n /* \"#utility.yul\":470:471 */\n dup4\n /* \"#utility.yul\":452:472 */\n tag_18\n jump\t// in\n tag_23:\n /* \"#utility.yul\":447:472 */\n swap3\n pop\n /* \"#utility.yul\":606:607 */\n dup3\n /* \"#utility.yul\":538:604 */\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\n /* \"#utility.yul\":534:608 */\n sub\n /* \"#utility.yul\":531:532 */\n dup3\n /* \"#utility.yul\":528:609 */\n gt\n /* \"#utility.yul\":525:527 */\n iszero\n tag_24\n jumpi\n /* \"#utility.yul\":612:630 */\n tag_25\n tag_26\n jump\t// in\n tag_25:\n /* \"#utility.yul\":525:527 */\n tag_24:\n /* \"#utility.yul\":656:657 */\n dup3\n /* \"#utility.yul\":653:654 */\n dup3\n /* \"#utility.yul\":649:658 */\n add\n /* \"#utility.yul\":642:658 */\n swap1\n pop\n /* \"#utility.yul\":403:664 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":670:747 */\n tag_18:\n 0x00\n /* \"#utility.yul\":736:741 */\n dup2\n /* \"#utility.yul\":725:741 */\n swap1\n pop\n /* \"#utility.yul\":715:747 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":753:933 */\n tag_26:\n /* \"#utility.yul\":801:878 */\n 0x4e487b7100000000000000000000000000000000000000000000000000000000\n /* \"#utility.yul\":798:799 */\n 0x00\n /* \"#utility.yul\":791:879 */\n mstore\n /* \"#utility.yul\":898:902 */\n 0x11\n /* \"#utility.yul\":895:896 */\n 0x04\n /* \"#utility.yul\":888:903 */\n mstore\n /* \"#utility.yul\":922:926 */\n 0x24\n /* \"#utility.yul\":919:920 */\n 0x00\n /* \"#utility.yul\":912:927 */\n revert\n\n auxdata: 0xa264697066735822122002917a28b1d30a0337377fff711d257a31fb69e1a5c469a4db8e4393e90b0d2064736f6c63430008030033\n}\n", + "bytecode": { + "generatedSources": [], + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b506000808190555061016f806100276000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806306661abd1461003b578063119fbbd414610059575b600080fd5b610043610063565b604051610050919061008f565b60405180910390f35b610061610069565b005b60005481565b600160005461007891906100aa565b600081905550565b61008981610100565b82525050565b60006020820190506100a46000830184610080565b92915050565b60006100b582610100565b91506100c083610100565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156100f5576100f461010a565b5b828201905092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea264697066735822122002917a28b1d30a0337377fff711d257a31fb69e1a5c469a4db8e4393e90b0d2064736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 DUP2 SWAP1 SSTORE POP PUSH2 0x16F DUP1 PUSH2 0x27 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 0x6661ABD EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x119FBBD4 EQ PUSH2 0x59 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x63 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x50 SWAP2 SWAP1 PUSH2 0x8F JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x61 PUSH2 0x69 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x0 SLOAD PUSH2 0x78 SWAP2 SWAP1 PUSH2 0xAA JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 SSTORE POP JUMP JUMPDEST PUSH2 0x89 DUP2 PUSH2 0x100 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0xA4 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x80 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xB5 DUP3 PUSH2 0x100 JUMP JUMPDEST SWAP2 POP PUSH2 0xC0 DUP4 PUSH2 0x100 JUMP JUMPDEST SWAP3 POP DUP3 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SUB DUP3 GT ISZERO PUSH2 0xF5 JUMPI PUSH2 0xF4 PUSH2 0x10A JUMP JUMPDEST JUMPDEST DUP3 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 MUL SWAP2 PUSH27 0x28B1D30A0337377FFF711D257A31FB69E1A5C469A4DB8E4393E90B 0xD KECCAK256 PUSH5 0x736F6C6343 STOP ADDMOD SUB STOP CALLER ", + "sourceMap": "39:204:0:-:0;;;107:55;;;;;;;;;;150:1;142:5;:9;;;;39:204;;;;;;" + }, + "deployedBytecode": { + "generatedSources": [ + { + "ast": { + "nodeType": "YulBlock", + "src": "0:936:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "72:53:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "89:3:1" + }, + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "112:5:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "94:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "94:24:1" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "82:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "82:37:1" + }, + "nodeType": "YulExpressionStatement", + "src": "82:37:1" + } + ] + }, + "name": "abi_encode_t_uint256_to_t_uint256_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "60:5:1", + "type": "" + }, + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "67:3:1", + "type": "" + } + ], + "src": "7:118:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "229:124:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "239:26:1", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "251:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "262:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "247:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "247:18:1" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "239:4:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "319:6:1" + }, + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "332:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "343:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "328:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "328:17:1" + } + ], + "functionName": { + "name": "abi_encode_t_uint256_to_t_uint256_fromStack", + "nodeType": "YulIdentifier", + "src": "275:43:1" + }, + "nodeType": "YulFunctionCall", + "src": "275:71:1" + }, + "nodeType": "YulExpressionStatement", + "src": "275:71:1" + } + ] + }, + "name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "201:9:1", + "type": "" + }, + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "213:6:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "224:4:1", + "type": "" + } + ], + "src": "131:222:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "403:261:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "413:25:1", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "436:1:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "418:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "418:20:1" + }, + "variableNames": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "413:1:1" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "447:25:1", + "value": { + "arguments": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "470:1:1" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "452:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "452:20:1" + }, + "variableNames": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "447:1:1" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "610:22:1", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nodeType": "YulIdentifier", + "src": "612:16:1" + }, + "nodeType": "YulFunctionCall", + "src": "612:18:1" + }, + "nodeType": "YulExpressionStatement", + "src": "612:18:1" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "531:1:1" + }, + { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "538:66:1", + "type": "", + "value": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "606:1:1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "534:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "534:74:1" + } + ], + "functionName": { + "name": "gt", + "nodeType": "YulIdentifier", + "src": "528:2:1" + }, + "nodeType": "YulFunctionCall", + "src": "528:81:1" + }, + "nodeType": "YulIf", + "src": "525:2:1" + }, + { + "nodeType": "YulAssignment", + "src": "642:16:1", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "653:1:1" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "656:1:1" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "649:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "649:9:1" + }, + "variableNames": [ + { + "name": "sum", + "nodeType": "YulIdentifier", + "src": "642:3:1" + } + ] + } + ] + }, + "name": "checked_add_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "x", + "nodeType": "YulTypedName", + "src": "390:1:1", + "type": "" + }, + { + "name": "y", + "nodeType": "YulTypedName", + "src": "393:1:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "sum", + "nodeType": "YulTypedName", + "src": "399:3:1", + "type": "" + } + ], + "src": "359:305:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "715:32:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "725:16:1", + "value": { + "name": "value", + "nodeType": "YulIdentifier", + "src": "736:5:1" + }, + "variableNames": [ + { + "name": "cleaned", + "nodeType": "YulIdentifier", + "src": "725:7:1" + } + ] + } + ] + }, + "name": "cleanup_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "697:5:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "cleaned", + "nodeType": "YulTypedName", + "src": "707:7:1", + "type": "" + } + ], + "src": "670:77:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "781:152:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "798:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "801:77:1", + "type": "", + "value": "35408467139433450592217433187231851964531694900788300625387963629091585785856" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "791:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "791:88:1" + }, + "nodeType": "YulExpressionStatement", + "src": "791:88:1" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "895:1:1", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "898:4:1", + "type": "", + "value": "0x11" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "888:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "888:15:1" + }, + "nodeType": "YulExpressionStatement", + "src": "888:15:1" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "919:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "922:4:1", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "912:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "912:15:1" + }, + "nodeType": "YulExpressionStatement", + "src": "912:15:1" + } + ] + }, + "name": "panic_error_0x11", + "nodeType": "YulFunctionDefinition", + "src": "753:180:1" + } + ] + }, + "contents": "{\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 function checked_add_t_uint256(x, y) -> sum {\n x := cleanup_t_uint256(x)\n y := cleanup_t_uint256(y)\n\n // overflow, if x > (maxValue - y)\n if gt(x, sub(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, y)) { panic_error_0x11() }\n\n sum := add(x, y)\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function panic_error_0x11() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n\n}\n", + "id": 1, + "language": "Yul", + "name": "#utility.yul" + } + ], + "immutableReferences": {}, + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b50600436106100365760003560e01c806306661abd1461003b578063119fbbd414610059575b600080fd5b610043610063565b604051610050919061008f565b60405180910390f35b610061610069565b005b60005481565b600160005461007891906100aa565b600081905550565b61008981610100565b82525050565b60006020820190506100a46000830184610080565b92915050565b60006100b582610100565b91506100c083610100565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156100f5576100f461010a565b5b828201905092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea264697066735822122002917a28b1d30a0337377fff711d257a31fb69e1a5c469a4db8e4393e90b0d2064736f6c63430008030033", + "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 0x6661ABD EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x119FBBD4 EQ PUSH2 0x59 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x63 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x50 SWAP2 SWAP1 PUSH2 0x8F JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x61 PUSH2 0x69 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x0 SLOAD PUSH2 0x78 SWAP2 SWAP1 PUSH2 0xAA JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 SSTORE POP JUMP JUMPDEST PUSH2 0x89 DUP2 PUSH2 0x100 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0xA4 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x80 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xB5 DUP3 PUSH2 0x100 JUMP JUMPDEST SWAP2 POP PUSH2 0xC0 DUP4 PUSH2 0x100 JUMP JUMPDEST SWAP3 POP DUP3 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SUB DUP3 GT ISZERO PUSH2 0xF5 JUMPI PUSH2 0xF4 PUSH2 0x10A JUMP JUMPDEST JUMPDEST DUP3 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 MUL SWAP2 PUSH27 0x28B1D30A0337377FFF711D257A31FB69E1A5C469A4DB8E4393E90B 0xD KECCAK256 PUSH5 0x736F6C6343 STOP ADDMOD SUB STOP CALLER ", + "sourceMap": "39:204:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;75:17;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;176:61;;;:::i;:::-;;75:17;;;;:::o;176:61::-;225:1;219:5;;:7;;;;:::i;:::-;213:5;:13;;;;176:61::o;7:118:1:-;94:24;112:5;94:24;:::i;:::-;89:3;82:37;72:53;;:::o;131:222::-;;262:2;251:9;247:18;239:26;;275:71;343:1;332:9;328:17;319:6;275:71;:::i;:::-;229:124;;;;:::o;359:305::-;;418:20;436:1;418:20;:::i;:::-;413:25;;452:20;470:1;452:20;:::i;:::-;447:25;;606:1;538:66;534:74;531:1;528:81;525:2;;;612:18;;:::i;:::-;525:2;656:1;653;649:9;642:16;;403:261;;;;:::o;670:77::-;;736:5;725:16;;715:32;;;:::o;753:180::-;801:77;798:1;791:88;898:4;895:1;888:15;922:4;919:1;912:15" + }, + "gasEstimates": { + "creation": { + "codeDepositCost": "73400", + "executionCost": "5137", + "totalCost": "78537" + }, + "external": { "count()": "1107", "incr()": "infinite" } + }, + "legacyAssembly": { + ".code": [ + { + "begin": 39, + "end": 243, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 39, + "end": 243, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 39, "end": 243, "name": "MSTORE", "source": 0 }, + { "begin": 107, "end": 162, "name": "CALLVALUE", "source": 0 }, + { "begin": 107, "end": 162, "name": "DUP1", "source": 0 }, + { "begin": 107, "end": 162, "name": "ISZERO", "source": 0 }, + { + "begin": 107, + "end": 162, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 107, "end": 162, "name": "JUMPI", "source": 0 }, + { + "begin": 107, + "end": 162, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 107, "end": 162, "name": "DUP1", "source": 0 }, + { "begin": 107, "end": 162, "name": "REVERT", "source": 0 }, + { + "begin": 107, + "end": 162, + "name": "tag", + "source": 0, + "value": "1" + }, + { "begin": 107, "end": 162, "name": "JUMPDEST", "source": 0 }, + { "begin": 107, "end": 162, "name": "POP", "source": 0 }, + { + "begin": 150, + "end": 151, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 142, "end": 147, "name": "DUP1", "source": 0 }, + { "begin": 142, "end": 151, "name": "DUP2", "source": 0 }, + { "begin": 142, "end": 151, "name": "SWAP1", "source": 0 }, + { "begin": 142, "end": 151, "name": "SSTORE", "source": 0 }, + { "begin": 142, "end": 151, "name": "POP", "source": 0 }, + { + "begin": 39, + "end": 243, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 39, "end": 243, "name": "DUP1", "source": 0 }, + { + "begin": 39, + "end": 243, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 39, + "end": 243, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 243, "name": "CODECOPY", "source": 0 }, + { + "begin": 39, + "end": 243, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 243, "name": "RETURN", "source": 0 } + ], + ".data": { + "0": { + ".auxdata": "a264697066735822122002917a28b1d30a0337377fff711d257a31fb69e1a5c469a4db8e4393e90b0d2064736f6c63430008030033", + ".code": [ + { + "begin": 39, + "end": 243, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 39, + "end": 243, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 39, "end": 243, "name": "MSTORE", "source": 0 }, + { "begin": 39, "end": 243, "name": "CALLVALUE", "source": 0 }, + { "begin": 39, "end": 243, "name": "DUP1", "source": 0 }, + { "begin": 39, "end": 243, "name": "ISZERO", "source": 0 }, + { + "begin": 39, + "end": 243, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 39, "end": 243, "name": "JUMPI", "source": 0 }, + { + "begin": 39, + "end": 243, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 243, "name": "DUP1", "source": 0 }, + { "begin": 39, "end": 243, "name": "REVERT", "source": 0 }, + { + "begin": 39, + "end": 243, + "name": "tag", + "source": 0, + "value": "1" + }, + { "begin": 39, "end": 243, "name": "JUMPDEST", "source": 0 }, + { "begin": 39, "end": 243, "name": "POP", "source": 0 }, + { + "begin": 39, + "end": 243, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 39, "end": 243, "name": "CALLDATASIZE", "source": 0 }, + { "begin": 39, "end": 243, "name": "LT", "source": 0 }, + { + "begin": 39, + "end": 243, + "name": "PUSH [tag]", + "source": 0, + "value": "2" + }, + { "begin": 39, "end": 243, "name": "JUMPI", "source": 0 }, + { + "begin": 39, + "end": 243, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 243, "name": "CALLDATALOAD", "source": 0 }, + { + "begin": 39, + "end": 243, + "name": "PUSH", + "source": 0, + "value": "E0" + }, + { "begin": 39, "end": 243, "name": "SHR", "source": 0 }, + { "begin": 39, "end": 243, "name": "DUP1", "source": 0 }, + { + "begin": 39, + "end": 243, + "name": "PUSH", + "source": 0, + "value": "6661ABD" + }, + { "begin": 39, "end": 243, "name": "EQ", "source": 0 }, + { + "begin": 39, + "end": 243, + "name": "PUSH [tag]", + "source": 0, + "value": "3" + }, + { "begin": 39, "end": 243, "name": "JUMPI", "source": 0 }, + { "begin": 39, "end": 243, "name": "DUP1", "source": 0 }, + { + "begin": 39, + "end": 243, + "name": "PUSH", + "source": 0, + "value": "119FBBD4" + }, + { "begin": 39, "end": 243, "name": "EQ", "source": 0 }, + { + "begin": 39, + "end": 243, + "name": "PUSH [tag]", + "source": 0, + "value": "4" + }, + { "begin": 39, "end": 243, "name": "JUMPI", "source": 0 }, + { + "begin": 39, + "end": 243, + "name": "tag", + "source": 0, + "value": "2" + }, + { "begin": 39, "end": 243, "name": "JUMPDEST", "source": 0 }, + { + "begin": 39, + "end": 243, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 39, "end": 243, "name": "DUP1", "source": 0 }, + { "begin": 39, "end": 243, "name": "REVERT", "source": 0 }, + { + "begin": 75, + "end": 92, + "name": "tag", + "source": 0, + "value": "3" + }, + { "begin": 75, "end": 92, "name": "JUMPDEST", "source": 0 }, + { + "begin": 75, + "end": 92, + "name": "PUSH [tag]", + "source": 0, + "value": "5" + }, + { + "begin": 75, + "end": 92, + "name": "PUSH [tag]", + "source": 0, + "value": "6" + }, + { + "begin": 75, + "end": 92, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 75, + "end": 92, + "name": "tag", + "source": 0, + "value": "5" + }, + { "begin": 75, "end": 92, "name": "JUMPDEST", "source": 0 }, + { + "begin": 75, + "end": 92, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 75, "end": 92, "name": "MLOAD", "source": 0 }, + { + "begin": 75, + "end": 92, + "name": "PUSH [tag]", + "source": 0, + "value": "7" + }, + { "begin": 75, "end": 92, "name": "SWAP2", "source": 0 }, + { "begin": 75, "end": 92, "name": "SWAP1", "source": 0 }, + { + "begin": 75, + "end": 92, + "name": "PUSH [tag]", + "source": 0, + "value": "8" + }, + { + "begin": 75, + "end": 92, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 75, + "end": 92, + "name": "tag", + "source": 0, + "value": "7" + }, + { "begin": 75, "end": 92, "name": "JUMPDEST", "source": 0 }, + { + "begin": 75, + "end": 92, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 75, "end": 92, "name": "MLOAD", "source": 0 }, + { "begin": 75, "end": 92, "name": "DUP1", "source": 0 }, + { "begin": 75, "end": 92, "name": "SWAP2", "source": 0 }, + { "begin": 75, "end": 92, "name": "SUB", "source": 0 }, + { "begin": 75, "end": 92, "name": "SWAP1", "source": 0 }, + { "begin": 75, "end": 92, "name": "RETURN", "source": 0 }, + { + "begin": 176, + "end": 237, + "name": "tag", + "source": 0, + "value": "4" + }, + { "begin": 176, "end": 237, "name": "JUMPDEST", "source": 0 }, + { + "begin": 176, + "end": 237, + "name": "PUSH [tag]", + "source": 0, + "value": "9" + }, + { + "begin": 176, + "end": 237, + "name": "PUSH [tag]", + "source": 0, + "value": "10" + }, + { + "begin": 176, + "end": 237, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 176, + "end": 237, + "name": "tag", + "source": 0, + "value": "9" + }, + { "begin": 176, "end": 237, "name": "JUMPDEST", "source": 0 }, + { "begin": 176, "end": 237, "name": "STOP", "source": 0 }, + { + "begin": 75, + "end": 92, + "name": "tag", + "source": 0, + "value": "6" + }, + { "begin": 75, "end": 92, "name": "JUMPDEST", "source": 0 }, + { + "begin": 75, + "end": 92, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 75, "end": 92, "name": "SLOAD", "source": 0 }, + { "begin": 75, "end": 92, "name": "DUP2", "source": 0 }, + { + "begin": 75, + "end": 92, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { + "begin": 176, + "end": 237, + "name": "tag", + "source": 0, + "value": "10" + }, + { "begin": 176, "end": 237, "name": "JUMPDEST", "source": 0 }, + { + "begin": 225, + "end": 226, + "name": "PUSH", + "source": 0, + "value": "1" + }, + { + "begin": 219, + "end": 224, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 219, "end": 224, "name": "SLOAD", "source": 0 }, + { + "begin": 219, + "end": 226, + "name": "PUSH [tag]", + "source": 0, + "value": "12" + }, + { "begin": 219, "end": 226, "name": "SWAP2", "source": 0 }, + { "begin": 219, "end": 226, "name": "SWAP1", "source": 0 }, + { + "begin": 219, + "end": 226, + "name": "PUSH [tag]", + "source": 0, + "value": "13" + }, + { + "begin": 219, + "end": 226, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 219, + "end": 226, + "name": "tag", + "source": 0, + "value": "12" + }, + { "begin": 219, "end": 226, "name": "JUMPDEST", "source": 0 }, + { + "begin": 213, + "end": 218, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 213, "end": 226, "name": "DUP2", "source": 0 }, + { "begin": 213, "end": 226, "name": "SWAP1", "source": 0 }, + { "begin": 213, "end": 226, "name": "SSTORE", "source": 0 }, + { "begin": 213, "end": 226, "name": "POP", "source": 0 }, + { + "begin": 176, + "end": 237, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { + "begin": 7, + "end": 125, + "name": "tag", + "source": 1, + "value": "15" + }, + { "begin": 7, "end": 125, "name": "JUMPDEST", "source": 1 }, + { + "begin": 94, + "end": 118, + "name": "PUSH [tag]", + "source": 1, + "value": "17" + }, + { "begin": 112, "end": 117, "name": "DUP2", "source": 1 }, + { + "begin": 94, + "end": 118, + "name": "PUSH [tag]", + "source": 1, + "value": "18" + }, + { + "begin": 94, + "end": 118, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 94, + "end": 118, + "name": "tag", + "source": 1, + "value": "17" + }, + { "begin": 94, "end": 118, "name": "JUMPDEST", "source": 1 }, + { "begin": 89, "end": 92, "name": "DUP3", "source": 1 }, + { "begin": 82, "end": 119, "name": "MSTORE", "source": 1 }, + { "begin": 72, "end": 125, "name": "POP", "source": 1 }, + { "begin": 72, "end": 125, "name": "POP", "source": 1 }, + { + "begin": 72, + "end": 125, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 131, + "end": 353, + "name": "tag", + "source": 1, + "value": "8" + }, + { "begin": 131, "end": 353, "name": "JUMPDEST", "source": 1 }, + { + "begin": 131, + "end": 353, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 262, + "end": 264, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 251, "end": 260, "name": "DUP3", "source": 1 }, + { "begin": 247, "end": 265, "name": "ADD", "source": 1 }, + { "begin": 239, "end": 265, "name": "SWAP1", "source": 1 }, + { "begin": 239, "end": 265, "name": "POP", "source": 1 }, + { + "begin": 275, + "end": 346, + "name": "PUSH [tag]", + "source": 1, + "value": "20" + }, + { + "begin": 343, + "end": 344, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 332, "end": 341, "name": "DUP4", "source": 1 }, + { "begin": 328, "end": 345, "name": "ADD", "source": 1 }, + { "begin": 319, "end": 325, "name": "DUP5", "source": 1 }, + { + "begin": 275, + "end": 346, + "name": "PUSH [tag]", + "source": 1, + "value": "15" + }, + { + "begin": 275, + "end": 346, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 275, + "end": 346, + "name": "tag", + "source": 1, + "value": "20" + }, + { "begin": 275, "end": 346, "name": "JUMPDEST", "source": 1 }, + { "begin": 229, "end": 353, "name": "SWAP3", "source": 1 }, + { "begin": 229, "end": 353, "name": "SWAP2", "source": 1 }, + { "begin": 229, "end": 353, "name": "POP", "source": 1 }, + { "begin": 229, "end": 353, "name": "POP", "source": 1 }, + { + "begin": 229, + "end": 353, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 359, + "end": 664, + "name": "tag", + "source": 1, + "value": "13" + }, + { "begin": 359, "end": 664, "name": "JUMPDEST", "source": 1 }, + { + "begin": 359, + "end": 664, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 418, + "end": 438, + "name": "PUSH [tag]", + "source": 1, + "value": "22" + }, + { "begin": 436, "end": 437, "name": "DUP3", "source": 1 }, + { + "begin": 418, + "end": 438, + "name": "PUSH [tag]", + "source": 1, + "value": "18" + }, + { + "begin": 418, + "end": 438, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 418, + "end": 438, + "name": "tag", + "source": 1, + "value": "22" + }, + { "begin": 418, "end": 438, "name": "JUMPDEST", "source": 1 }, + { "begin": 413, "end": 438, "name": "SWAP2", "source": 1 }, + { "begin": 413, "end": 438, "name": "POP", "source": 1 }, + { + "begin": 452, + "end": 472, + "name": "PUSH [tag]", + "source": 1, + "value": "23" + }, + { "begin": 470, "end": 471, "name": "DUP4", "source": 1 }, + { + "begin": 452, + "end": 472, + "name": "PUSH [tag]", + "source": 1, + "value": "18" + }, + { + "begin": 452, + "end": 472, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 452, + "end": 472, + "name": "tag", + "source": 1, + "value": "23" + }, + { "begin": 452, "end": 472, "name": "JUMPDEST", "source": 1 }, + { "begin": 447, "end": 472, "name": "SWAP3", "source": 1 }, + { "begin": 447, "end": 472, "name": "POP", "source": 1 }, + { "begin": 606, "end": 607, "name": "DUP3", "source": 1 }, + { + "begin": 538, + "end": 604, + "name": "PUSH", + "source": 1, + "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + }, + { "begin": 534, "end": 608, "name": "SUB", "source": 1 }, + { "begin": 531, "end": 532, "name": "DUP3", "source": 1 }, + { "begin": 528, "end": 609, "name": "GT", "source": 1 }, + { "begin": 525, "end": 527, "name": "ISZERO", "source": 1 }, + { + "begin": 525, + "end": 527, + "name": "PUSH [tag]", + "source": 1, + "value": "24" + }, + { "begin": 525, "end": 527, "name": "JUMPI", "source": 1 }, + { + "begin": 612, + "end": 630, + "name": "PUSH [tag]", + "source": 1, + "value": "25" + }, + { + "begin": 612, + "end": 630, + "name": "PUSH [tag]", + "source": 1, + "value": "26" + }, + { + "begin": 612, + "end": 630, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 612, + "end": 630, + "name": "tag", + "source": 1, + "value": "25" + }, + { "begin": 612, "end": 630, "name": "JUMPDEST", "source": 1 }, + { + "begin": 525, + "end": 527, + "name": "tag", + "source": 1, + "value": "24" + }, + { "begin": 525, "end": 527, "name": "JUMPDEST", "source": 1 }, + { "begin": 656, "end": 657, "name": "DUP3", "source": 1 }, + { "begin": 653, "end": 654, "name": "DUP3", "source": 1 }, + { "begin": 649, "end": 658, "name": "ADD", "source": 1 }, + { "begin": 642, "end": 658, "name": "SWAP1", "source": 1 }, + { "begin": 642, "end": 658, "name": "POP", "source": 1 }, + { "begin": 403, "end": 664, "name": "SWAP3", "source": 1 }, + { "begin": 403, "end": 664, "name": "SWAP2", "source": 1 }, + { "begin": 403, "end": 664, "name": "POP", "source": 1 }, + { "begin": 403, "end": 664, "name": "POP", "source": 1 }, + { + "begin": 403, + "end": 664, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 670, + "end": 747, + "name": "tag", + "source": 1, + "value": "18" + }, + { "begin": 670, "end": 747, "name": "JUMPDEST", "source": 1 }, + { + "begin": 670, + "end": 747, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 736, "end": 741, "name": "DUP2", "source": 1 }, + { "begin": 725, "end": 741, "name": "SWAP1", "source": 1 }, + { "begin": 725, "end": 741, "name": "POP", "source": 1 }, + { "begin": 715, "end": 747, "name": "SWAP2", "source": 1 }, + { "begin": 715, "end": 747, "name": "SWAP1", "source": 1 }, + { "begin": 715, "end": 747, "name": "POP", "source": 1 }, + { + "begin": 715, + "end": 747, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 753, + "end": 933, + "name": "tag", + "source": 1, + "value": "26" + }, + { "begin": 753, "end": 933, "name": "JUMPDEST", "source": 1 }, + { + "begin": 801, + "end": 878, + "name": "PUSH", + "source": 1, + "value": "4E487B7100000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 798, + "end": 799, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 791, "end": 879, "name": "MSTORE", "source": 1 }, + { + "begin": 898, + "end": 902, + "name": "PUSH", + "source": 1, + "value": "11" + }, + { + "begin": 895, + "end": 896, + "name": "PUSH", + "source": 1, + "value": "4" + }, + { "begin": 888, "end": 903, "name": "MSTORE", "source": 1 }, + { + "begin": 922, + "end": 926, + "name": "PUSH", + "source": 1, + "value": "24" + }, + { + "begin": 919, + "end": 920, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 912, "end": 927, "name": "REVERT", "source": 1 } + ] + } + } + }, + "methodIdentifiers": { "count()": "06661abd", "incr()": "119fbbd4" } + }, + "ewasm": { "wasm": "" }, + "metadata": "{\"compiler\":{\"version\":\"0.8.3+commit.8d00100c\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"count\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"incr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"main.sol\":\"TestContractIncr\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"main.sol\":{\"keccak256\":\"0x338162b85eaf39a85daac3fe2d3d8e94fad18f74dd7c238709d0500e96f14b71\",\"urls\":[\"bzz-raw://0229ffcdcdfa88d496ad29dc5532ca35e6ab895b46b64762d09e01bc31056af5\",\"dweb:/ipfs/QmeE5zDfodVZWTxxQ6iTJ6W8GKvdL1bKhAR2P1m21ejfzP\"]}},\"version\":1}", + "storageLayout": { + "storage": [ + { + "astId": 3, + "contract": "main.sol:TestContractIncr", + "label": "count", + "offset": 0, + "slot": "0", + "type": "t_uint256" + } + ], + "types": { + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + }, + "userdoc": { "kind": "user", "methods": {}, "version": 1 } + }, + "sourceCode": "\n pragma solidity >=0.8.0;\n \n contract TestContractIncr {\n uint public count;\n \n constructor() public {\n count = 0;\n }\n \n function incr() public {\n count=count+1;\n }\n }" +} diff --git a/tests/contracts/compiled/TraceFilter.json b/tests/contracts/compiled/TraceFilter.json new file mode 100644 index 00000000000..8609ccc938f --- /dev/null +++ b/tests/contracts/compiled/TraceFilter.json @@ -0,0 +1,3710 @@ +{ + "byteCode": "0x608060405234801561001057600080fd5b5060405161041d38038061041d83398181016040528101906100329190610058565b801561003d57600080fd5b506100a4565b6000815190506100528161008d565b92915050565b60006020828403121561006a57600080fd5b600061007884828501610043565b91505092915050565b60008115159050919050565b61009681610081565b81146100a157600080fd5b50565b61036a806100b36000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80635eaf9bc114610051578063a885f4e31461005b578063cb30e69614610077578063f34f161014610081575b600080fd5b61005961009d565b005b6100756004803603810190610070919061025c565b61009f565b005b61007f610162565b005b61009b60048036038101906100969190610285565b610167565b005b565b8073ffffffffffffffffffffffffffffffffffffffff16635eaf9bc16040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156100e757600080fd5b505af11580156100fb573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff1663cb30e6966040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561014757600080fd5b505af115801561015b573d6000803e3d6000fd5b5050505050565b600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a885f4e3826040518263ffffffff1660e01b81526004016101a091906102d0565b600060405180830381600087803b1580156101ba57600080fd5b505af19250505080156101cb575060015b6101d4576101d5565b5b8173ffffffffffffffffffffffffffffffffffffffff1663a885f4e3826040518263ffffffff1660e01b815260040161020e91906102d0565b600060405180830381600087803b15801561022857600080fd5b505af1925050508015610239575060015b61024257610243565b5b5050565b6000813590506102568161031d565b92915050565b60006020828403121561026e57600080fd5b600061027c84828501610247565b91505092915050565b6000806040838503121561029857600080fd5b60006102a685828601610247565b92505060206102b785828601610247565b9150509250929050565b6102ca816102eb565b82525050565b60006020820190506102e560008301846102c1565b92915050565b60006102f6826102fd565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b610326816102eb565b811461033157600080fd5b5056fea26469706673582212205291eb8baa23bd68e06ced1a0bb4490e23327b9d4862aba762c124c73ae04a9764736f6c63430008030033", + "contract": { + "abi": [ + { + "inputs": [ + { "internalType": "bool", "name": "should_revert", "type": "bool" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "call_ok", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "call_revert", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "target0", "type": "address" }, + { "internalType": "address", "name": "target1", "type": "address" } + ], + "name": "subcalls", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "target1", "type": "address" } + ], + "name": "subsubcalls", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "devdoc": { "kind": "dev", "methods": {}, "version": 1 }, + "evm": { + "assembly": " /* \"main.sol\":34:705 contract TraceFilter {... */\n mstore(0x40, 0x80)\n /* \"main.sol\":65:181 constructor(bool should_revert) {... */\n callvalue\n dup1\n iszero\n tag_1\n jumpi\n 0x00\n dup1\n revert\ntag_1:\n pop\n mload(0x40)\n sub(codesize, bytecodeSize)\n dup1\n bytecodeSize\n dup4\n codecopy\n dup2\n dup2\n add\n 0x40\n mstore\n dup2\n add\n swap1\n tag_2\n swap2\n swap1\n tag_3\n jump\t// in\ntag_2:\n /* \"main.sol\":115:128 should_revert */\n dup1\n /* \"main.sol\":111:171 if (should_revert) {... */\n iszero\n tag_6\n jumpi\n /* \"main.sol\":148:156 revert() */\n 0x00\n dup1\n revert\n /* \"main.sol\":111:171 if (should_revert) {... */\ntag_6:\n /* \"main.sol\":65:181 constructor(bool should_revert) {... */\n pop\n /* \"main.sol\":34:705 contract TraceFilter {... */\n jump(tag_7)\n /* \"#utility.yul\":7:144 */\ntag_9:\n 0x00\n /* \"#utility.yul\":92:98 */\n dup2\n /* \"#utility.yul\":86:99 */\n mload\n /* \"#utility.yul\":77:99 */\n swap1\n pop\n /* \"#utility.yul\":108:138 */\n tag_11\n /* \"#utility.yul\":132:137 */\n dup2\n /* \"#utility.yul\":108:138 */\n tag_12\n jump\t// in\ntag_11:\n /* \"#utility.yul\":67:144 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":150:428 */\ntag_3:\n 0x00\n /* \"#utility.yul\":266:268 */\n 0x20\n /* \"#utility.yul\":254:263 */\n dup3\n /* \"#utility.yul\":245:252 */\n dup5\n /* \"#utility.yul\":241:264 */\n sub\n /* \"#utility.yul\":237:269 */\n slt\n /* \"#utility.yul\":234:236 */\n iszero\n tag_14\n jumpi\n /* \"#utility.yul\":282:283 */\n 0x00\n /* \"#utility.yul\":279:280 */\n dup1\n /* \"#utility.yul\":272:284 */\n revert\n /* \"#utility.yul\":234:236 */\ntag_14:\n /* \"#utility.yul\":325:326 */\n 0x00\n /* \"#utility.yul\":350:411 */\n tag_15\n /* \"#utility.yul\":403:410 */\n dup5\n /* \"#utility.yul\":394:400 */\n dup3\n /* \"#utility.yul\":383:392 */\n dup6\n /* \"#utility.yul\":379:401 */\n add\n /* \"#utility.yul\":350:411 */\n tag_9\n jump\t// in\ntag_15:\n /* \"#utility.yul\":340:411 */\n swap2\n pop\n /* \"#utility.yul\":296:421 */\n pop\n /* \"#utility.yul\":224:428 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":434:524 */\ntag_16:\n 0x00\n /* \"#utility.yul\":511:516 */\n dup2\n /* \"#utility.yul\":504:517 */\n iszero\n /* \"#utility.yul\":497:518 */\n iszero\n /* \"#utility.yul\":486:518 */\n swap1\n pop\n /* \"#utility.yul\":476:524 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":530:646 */\ntag_12:\n /* \"#utility.yul\":600:621 */\n tag_19\n /* \"#utility.yul\":615:620 */\n dup2\n /* \"#utility.yul\":600:621 */\n tag_16\n jump\t// in\ntag_19:\n /* \"#utility.yul\":593:598 */\n dup2\n /* \"#utility.yul\":590:622 */\n eq\n /* \"#utility.yul\":580:582 */\n tag_20\n jumpi\n /* \"#utility.yul\":636:637 */\n 0x00\n /* \"#utility.yul\":633:634 */\n dup1\n /* \"#utility.yul\":626:638 */\n revert\n /* \"#utility.yul\":580:582 */\ntag_20:\n /* \"#utility.yul\":570:646 */\n pop\n jump\t// out\n /* \"main.sol\":34:705 contract TraceFilter {... */\ntag_7:\n dataSize(sub_0)\n dup1\n dataOffset(sub_0)\n 0x00\n codecopy\n 0x00\n return\nstop\n\nsub_0: assembly {\n /* \"main.sol\":34:705 contract TraceFilter {... */\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 0x5eaf9bc1\n eq\n tag_3\n jumpi\n dup1\n 0xa885f4e3\n eq\n tag_4\n jumpi\n dup1\n 0xcb30e696\n eq\n tag_5\n jumpi\n dup1\n 0xf34f1610\n eq\n tag_6\n jumpi\n tag_2:\n 0x00\n dup1\n revert\n /* \"main.sol\":195:224 function call_ok() public { } */\n tag_3:\n tag_7\n tag_8\n jump\t// in\n tag_7:\n stop\n /* \"main.sol\":551:699 function subsubcalls(address target1) public {... */\n tag_4:\n tag_9\n 0x04\n dup1\n calldatasize\n sub\n dup2\n add\n swap1\n tag_10\n swap2\n swap1\n tag_11\n jump\t// in\n tag_10:\n tag_12\n jump\t// in\n tag_9:\n stop\n /* \"main.sol\":238:309 function call_revert() public {... */\n tag_5:\n tag_13\n tag_14\n jump\t// in\n tag_13:\n stop\n /* \"main.sol\":323:537 function subcalls(address target0, address target1) public {... */\n tag_6:\n tag_15\n 0x04\n dup1\n calldatasize\n sub\n dup2\n add\n swap1\n tag_16\n swap2\n swap1\n tag_17\n jump\t// in\n tag_16:\n tag_18\n jump\t// in\n tag_15:\n stop\n /* \"main.sol\":195:224 function call_ok() public { } */\n tag_8:\n jump\t// out\n /* \"main.sol\":551:699 function subsubcalls(address target1) public {... */\n tag_12:\n /* \"main.sol\":622:629 target1 */\n dup1\n /* \"main.sol\":610:638 TraceFilter(target1).call_ok */\n 0xffffffffffffffffffffffffffffffffffffffff\n and\n 0x5eaf9bc1\n /* \"main.sol\":610:640 TraceFilter(target1).call_ok() */\n mload(0x40)\n dup2\n 0xffffffff\n and\n 0xe0\n shl\n dup2\n mstore\n 0x04\n add\n 0x00\n mload(0x40)\n dup1\n dup4\n sub\n dup2\n 0x00\n dup8\n dup1\n extcodesize\n iszero\n dup1\n iszero\n tag_21\n jumpi\n 0x00\n dup1\n revert\n tag_21:\n pop\n gas\n call\n iszero\n dup1\n iszero\n tag_23\n jumpi\n returndatasize\n 0x00\n dup1\n returndatacopy\n revert(0x00, returndatasize)\n tag_23:\n pop\n pop\n pop\n pop\n /* \"main.sol\":666:673 target1 */\n dup1\n /* \"main.sol\":654:686 TraceFilter(target1).call_revert */\n 0xffffffffffffffffffffffffffffffffffffffff\n and\n 0xcb30e696\n /* \"main.sol\":654:688 TraceFilter(target1).call_revert() */\n mload(0x40)\n dup2\n 0xffffffff\n and\n 0xe0\n shl\n dup2\n mstore\n 0x04\n add\n 0x00\n mload(0x40)\n dup1\n dup4\n sub\n dup2\n 0x00\n dup8\n dup1\n extcodesize\n iszero\n dup1\n iszero\n tag_24\n jumpi\n 0x00\n dup1\n revert\n tag_24:\n pop\n gas\n call\n iszero\n dup1\n iszero\n tag_26\n jumpi\n returndatasize\n 0x00\n dup1\n returndatacopy\n revert(0x00, returndatasize)\n tag_26:\n pop\n pop\n pop\n pop\n /* \"main.sol\":551:699 function subsubcalls(address target1) public {... */\n pop\n jump\t// out\n /* \"main.sol\":238:309 function call_revert() public {... */\n tag_14:\n /* \"main.sol\":282:290 revert() */\n 0x00\n dup1\n revert\n /* \"main.sol\":323:537 function subcalls(address target0, address target1) public {... */\n tag_18:\n /* \"main.sol\":412:419 target0 */\n dup2\n /* \"main.sol\":400:432 TraceFilter(target0).subsubcalls */\n 0xffffffffffffffffffffffffffffffffffffffff\n and\n 0xa885f4e3\n /* \"main.sol\":433:440 target1 */\n dup3\n /* \"main.sol\":400:441 TraceFilter(target0).subsubcalls(target1) */\n mload(0x40)\n dup3\n 0xffffffff\n and\n 0xe0\n shl\n dup2\n mstore\n 0x04\n add\n tag_29\n swap2\n swap1\n tag_30\n jump\t// in\n tag_29:\n 0x00\n mload(0x40)\n dup1\n dup4\n sub\n dup2\n 0x00\n dup8\n dup1\n extcodesize\n iszero\n dup1\n iszero\n tag_31\n jumpi\n 0x00\n dup1\n revert\n tag_31:\n pop\n gas\n call\n swap3\n pop\n pop\n pop\n dup1\n iszero\n tag_32\n jumpi\n pop\n 0x01\n tag_32:\n /* \"main.sol\":396:455 try TraceFilter(target0).subsubcalls(target1) { } catch { } */\n tag_33\n jumpi\n jump(tag_37)\n tag_33:\n tag_37:\n /* \"main.sol\":484:491 target0 */\n dup2\n /* \"main.sol\":472:504 TraceFilter(target0).subsubcalls */\n 0xffffffffffffffffffffffffffffffffffffffff\n and\n 0xa885f4e3\n /* \"main.sol\":505:512 target1 */\n dup3\n /* \"main.sol\":472:513 TraceFilter(target0).subsubcalls(target1) */\n mload(0x40)\n dup3\n 0xffffffff\n and\n 0xe0\n shl\n dup2\n mstore\n 0x04\n add\n tag_38\n swap2\n swap1\n tag_30\n jump\t// in\n tag_38:\n 0x00\n mload(0x40)\n dup1\n dup4\n sub\n dup2\n 0x00\n dup8\n dup1\n extcodesize\n iszero\n dup1\n iszero\n tag_39\n jumpi\n 0x00\n dup1\n revert\n tag_39:\n pop\n gas\n call\n swap3\n pop\n pop\n pop\n dup1\n iszero\n tag_40\n jumpi\n pop\n 0x01\n tag_40:\n /* \"main.sol\":468:527 try TraceFilter(target0).subsubcalls(target1) { } catch { } */\n tag_41\n jumpi\n jump(tag_45)\n tag_41:\n tag_45:\n /* \"main.sol\":323:537 function subcalls(address target0, address target1) public {... */\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":7:146 */\n tag_47:\n 0x00\n /* \"#utility.yul\":91:97 */\n dup2\n /* \"#utility.yul\":78:98 */\n calldataload\n /* \"#utility.yul\":69:98 */\n swap1\n pop\n /* \"#utility.yul\":107:140 */\n tag_49\n /* \"#utility.yul\":134:139 */\n dup2\n /* \"#utility.yul\":107:140 */\n tag_50\n jump\t// in\n tag_49:\n /* \"#utility.yul\":59:146 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":152:414 */\n tag_11:\n 0x00\n /* \"#utility.yul\":260:262 */\n 0x20\n /* \"#utility.yul\":248:257 */\n dup3\n /* \"#utility.yul\":239:246 */\n dup5\n /* \"#utility.yul\":235:258 */\n sub\n /* \"#utility.yul\":231:263 */\n slt\n /* \"#utility.yul\":228:230 */\n iszero\n tag_52\n jumpi\n /* \"#utility.yul\":276:277 */\n 0x00\n /* \"#utility.yul\":273:274 */\n dup1\n /* \"#utility.yul\":266:278 */\n revert\n /* \"#utility.yul\":228:230 */\n tag_52:\n /* \"#utility.yul\":319:320 */\n 0x00\n /* \"#utility.yul\":344:397 */\n tag_53\n /* \"#utility.yul\":389:396 */\n dup5\n /* \"#utility.yul\":380:386 */\n dup3\n /* \"#utility.yul\":369:378 */\n dup6\n /* \"#utility.yul\":365:387 */\n add\n /* \"#utility.yul\":344:397 */\n tag_47\n jump\t// in\n tag_53:\n /* \"#utility.yul\":334:397 */\n swap2\n pop\n /* \"#utility.yul\":290:407 */\n pop\n /* \"#utility.yul\":218:414 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":420:827 */\n tag_17:\n 0x00\n dup1\n /* \"#utility.yul\":545:547 */\n 0x40\n /* \"#utility.yul\":533:542 */\n dup4\n /* \"#utility.yul\":524:531 */\n dup6\n /* \"#utility.yul\":520:543 */\n sub\n /* \"#utility.yul\":516:548 */\n slt\n /* \"#utility.yul\":513:515 */\n iszero\n tag_55\n jumpi\n /* \"#utility.yul\":561:562 */\n 0x00\n /* \"#utility.yul\":558:559 */\n dup1\n /* \"#utility.yul\":551:563 */\n revert\n /* \"#utility.yul\":513:515 */\n tag_55:\n /* \"#utility.yul\":604:605 */\n 0x00\n /* \"#utility.yul\":629:682 */\n tag_56\n /* \"#utility.yul\":674:681 */\n dup6\n /* \"#utility.yul\":665:671 */\n dup3\n /* \"#utility.yul\":654:663 */\n dup7\n /* \"#utility.yul\":650:672 */\n add\n /* \"#utility.yul\":629:682 */\n tag_47\n jump\t// in\n tag_56:\n /* \"#utility.yul\":619:682 */\n swap3\n pop\n /* \"#utility.yul\":575:692 */\n pop\n /* \"#utility.yul\":731:733 */\n 0x20\n /* \"#utility.yul\":757:810 */\n tag_57\n /* \"#utility.yul\":802:809 */\n dup6\n /* \"#utility.yul\":793:799 */\n dup3\n /* \"#utility.yul\":782:791 */\n dup7\n /* \"#utility.yul\":778:800 */\n add\n /* \"#utility.yul\":757:810 */\n tag_47\n jump\t// in\n tag_57:\n /* \"#utility.yul\":747:810 */\n swap2\n pop\n /* \"#utility.yul\":702:820 */\n pop\n /* \"#utility.yul\":503:827 */\n swap3\n pop\n swap3\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":833:951 */\n tag_58:\n /* \"#utility.yul\":920:944 */\n tag_60\n /* \"#utility.yul\":938:943 */\n dup2\n /* \"#utility.yul\":920:944 */\n tag_61\n jump\t// in\n tag_60:\n /* \"#utility.yul\":915:918 */\n dup3\n /* \"#utility.yul\":908:945 */\n mstore\n /* \"#utility.yul\":898:951 */\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":957:1179 */\n tag_30:\n 0x00\n /* \"#utility.yul\":1088:1090 */\n 0x20\n /* \"#utility.yul\":1077:1086 */\n dup3\n /* \"#utility.yul\":1073:1091 */\n add\n /* \"#utility.yul\":1065:1091 */\n swap1\n pop\n /* \"#utility.yul\":1101:1172 */\n tag_63\n /* \"#utility.yul\":1169:1170 */\n 0x00\n /* \"#utility.yul\":1158:1167 */\n dup4\n /* \"#utility.yul\":1154:1171 */\n add\n /* \"#utility.yul\":1145:1151 */\n dup5\n /* \"#utility.yul\":1101:1172 */\n tag_58\n jump\t// in\n tag_63:\n /* \"#utility.yul\":1055:1179 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":1185:1281 */\n tag_61:\n 0x00\n /* \"#utility.yul\":1251:1275 */\n tag_65\n /* \"#utility.yul\":1269:1274 */\n dup3\n /* \"#utility.yul\":1251:1275 */\n tag_66\n jump\t// in\n tag_65:\n /* \"#utility.yul\":1240:1275 */\n swap1\n pop\n /* \"#utility.yul\":1230:1281 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":1287:1413 */\n tag_66:\n 0x00\n /* \"#utility.yul\":1364:1406 */\n 0xffffffffffffffffffffffffffffffffffffffff\n /* \"#utility.yul\":1357:1362 */\n dup3\n /* \"#utility.yul\":1353:1407 */\n and\n /* \"#utility.yul\":1342:1407 */\n swap1\n pop\n /* \"#utility.yul\":1332:1413 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":1419:1541 */\n tag_50:\n /* \"#utility.yul\":1492:1516 */\n tag_69\n /* \"#utility.yul\":1510:1515 */\n dup2\n /* \"#utility.yul\":1492:1516 */\n tag_61\n jump\t// in\n tag_69:\n /* \"#utility.yul\":1485:1490 */\n dup2\n /* \"#utility.yul\":1482:1517 */\n eq\n /* \"#utility.yul\":1472:1474 */\n tag_70\n jumpi\n /* \"#utility.yul\":1531:1532 */\n 0x00\n /* \"#utility.yul\":1528:1529 */\n dup1\n /* \"#utility.yul\":1521:1533 */\n revert\n /* \"#utility.yul\":1472:1474 */\n tag_70:\n /* \"#utility.yul\":1462:1541 */\n pop\n jump\t// out\n\n auxdata: 0xa26469706673582212205291eb8baa23bd68e06ced1a0bb4490e23327b9d4862aba762c124c73ae04a9764736f6c63430008030033\n}\n", + "bytecode": { + "generatedSources": [ + { + "ast": { + "nodeType": "YulBlock", + "src": "0:649:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "67:77:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "77:22:1", + "value": { + "arguments": [ + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "92:6:1" + } + ], + "functionName": { + "name": "mload", + "nodeType": "YulIdentifier", + "src": "86:5:1" + }, + "nodeType": "YulFunctionCall", + "src": "86:13:1" + }, + "variableNames": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "77:5:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "132:5:1" + } + ], + "functionName": { + "name": "validator_revert_t_bool", + "nodeType": "YulIdentifier", + "src": "108:23:1" + }, + "nodeType": "YulFunctionCall", + "src": "108:30:1" + }, + "nodeType": "YulExpressionStatement", + "src": "108:30:1" + } + ] + }, + "name": "abi_decode_t_bool_fromMemory", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "45:6:1", + "type": "" + }, + { + "name": "end", + "nodeType": "YulTypedName", + "src": "53:3:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "61:5:1", + "type": "" + } + ], + "src": "7:137:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "224:204:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "270:16:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "279:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "282:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "272:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "272:12:1" + }, + "nodeType": "YulExpressionStatement", + "src": "272:12:1" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "245:7:1" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "254:9:1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "241:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "241:23:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "266:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "237:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "237:32:1" + }, + "nodeType": "YulIf", + "src": "234:2:1" + }, + { + "nodeType": "YulBlock", + "src": "296:125:1", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "311:15:1", + "value": { + "kind": "number", + "nodeType": "YulLiteral", + "src": "325:1:1", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "315:6:1", + "type": "" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "340:71:1", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "383:9:1" + }, + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "394:6:1" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "379:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "379:22:1" + }, + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "403:7:1" + } + ], + "functionName": { + "name": "abi_decode_t_bool_fromMemory", + "nodeType": "YulIdentifier", + "src": "350:28:1" + }, + "nodeType": "YulFunctionCall", + "src": "350:61:1" + }, + "variableNames": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "340:6:1" + } + ] + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_bool_fromMemory", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "194:9:1", + "type": "" + }, + { + "name": "dataEnd", + "nodeType": "YulTypedName", + "src": "205:7:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "217:6:1", + "type": "" + } + ], + "src": "150:278:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "476:48:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "486:32:1", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "511:5:1" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "504:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "504:13:1" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "497:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "497:21:1" + }, + "variableNames": [ + { + "name": "cleaned", + "nodeType": "YulIdentifier", + "src": "486:7:1" + } + ] + } + ] + }, + "name": "cleanup_t_bool", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "458:5:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "cleaned", + "nodeType": "YulTypedName", + "src": "468:7:1", + "type": "" + } + ], + "src": "434:90:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "570:76:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "624:16:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "633:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "636:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "626:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "626:12:1" + }, + "nodeType": "YulExpressionStatement", + "src": "626:12:1" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "593:5:1" + }, + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "615:5:1" + } + ], + "functionName": { + "name": "cleanup_t_bool", + "nodeType": "YulIdentifier", + "src": "600:14:1" + }, + "nodeType": "YulFunctionCall", + "src": "600:21:1" + } + ], + "functionName": { + "name": "eq", + "nodeType": "YulIdentifier", + "src": "590:2:1" + }, + "nodeType": "YulFunctionCall", + "src": "590:32:1" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "583:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "583:40:1" + }, + "nodeType": "YulIf", + "src": "580:2:1" + } + ] + }, + "name": "validator_revert_t_bool", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "563:5:1", + "type": "" + } + ], + "src": "530:116:1" + } + ] + }, + "contents": "{\n\n function abi_decode_t_bool_fromMemory(offset, end) -> value {\n value := mload(offset)\n validator_revert_t_bool(value)\n }\n\n function abi_decode_tuple_t_bool_fromMemory(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_bool_fromMemory(add(headStart, offset), dataEnd)\n }\n\n }\n\n function cleanup_t_bool(value) -> cleaned {\n cleaned := iszero(iszero(value))\n }\n\n function validator_revert_t_bool(value) {\n if iszero(eq(value, cleanup_t_bool(value))) { revert(0, 0) }\n }\n\n}\n", + "id": 1, + "language": "Yul", + "name": "#utility.yul" + } + ], + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b5060405161041d38038061041d83398181016040528101906100329190610058565b801561003d57600080fd5b506100a4565b6000815190506100528161008d565b92915050565b60006020828403121561006a57600080fd5b600061007884828501610043565b91505092915050565b60008115159050919050565b61009681610081565b81146100a157600080fd5b50565b61036a806100b36000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80635eaf9bc114610051578063a885f4e31461005b578063cb30e69614610077578063f34f161014610081575b600080fd5b61005961009d565b005b6100756004803603810190610070919061025c565b61009f565b005b61007f610162565b005b61009b60048036038101906100969190610285565b610167565b005b565b8073ffffffffffffffffffffffffffffffffffffffff16635eaf9bc16040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156100e757600080fd5b505af11580156100fb573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff1663cb30e6966040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561014757600080fd5b505af115801561015b573d6000803e3d6000fd5b5050505050565b600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a885f4e3826040518263ffffffff1660e01b81526004016101a091906102d0565b600060405180830381600087803b1580156101ba57600080fd5b505af19250505080156101cb575060015b6101d4576101d5565b5b8173ffffffffffffffffffffffffffffffffffffffff1663a885f4e3826040518263ffffffff1660e01b815260040161020e91906102d0565b600060405180830381600087803b15801561022857600080fd5b505af1925050508015610239575060015b61024257610243565b5b5050565b6000813590506102568161031d565b92915050565b60006020828403121561026e57600080fd5b600061027c84828501610247565b91505092915050565b6000806040838503121561029857600080fd5b60006102a685828601610247565b92505060206102b785828601610247565b9150509250929050565b6102ca816102eb565b82525050565b60006020820190506102e560008301846102c1565b92915050565b60006102f6826102fd565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b610326816102eb565b811461033157600080fd5b5056fea26469706673582212205291eb8baa23bd68e06ced1a0bb4490e23327b9d4862aba762c124c73ae04a9764736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH2 0x41D CODESIZE SUB DUP1 PUSH2 0x41D DUP4 CODECOPY DUP2 DUP2 ADD PUSH1 0x40 MSTORE DUP2 ADD SWAP1 PUSH2 0x32 SWAP2 SWAP1 PUSH2 0x58 JUMP JUMPDEST DUP1 ISZERO PUSH2 0x3D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xA4 JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP PUSH2 0x52 DUP2 PUSH2 0x8D JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x6A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x78 DUP5 DUP3 DUP6 ADD PUSH2 0x43 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 ISZERO ISZERO SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x96 DUP2 PUSH2 0x81 JUMP JUMPDEST DUP2 EQ PUSH2 0xA1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH2 0x36A DUP1 PUSH2 0xB3 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 0x4C JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x5EAF9BC1 EQ PUSH2 0x51 JUMPI DUP1 PUSH4 0xA885F4E3 EQ PUSH2 0x5B JUMPI DUP1 PUSH4 0xCB30E696 EQ PUSH2 0x77 JUMPI DUP1 PUSH4 0xF34F1610 EQ PUSH2 0x81 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x59 PUSH2 0x9D JUMP JUMPDEST STOP JUMPDEST PUSH2 0x75 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x70 SWAP2 SWAP1 PUSH2 0x25C JUMP JUMPDEST PUSH2 0x9F JUMP JUMPDEST STOP JUMPDEST PUSH2 0x7F PUSH2 0x162 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x9B PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x96 SWAP2 SWAP1 PUSH2 0x285 JUMP JUMPDEST PUSH2 0x167 JUMP JUMPDEST STOP JUMPDEST JUMP JUMPDEST DUP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x5EAF9BC1 PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0xE7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xFB JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP DUP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xCB30E696 PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x147 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x15B JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xA885F4E3 DUP3 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1A0 SWAP2 SWAP1 PUSH2 0x2D0 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x1BA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL SWAP3 POP POP POP DUP1 ISZERO PUSH2 0x1CB JUMPI POP PUSH1 0x1 JUMPDEST PUSH2 0x1D4 JUMPI PUSH2 0x1D5 JUMP JUMPDEST JUMPDEST DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xA885F4E3 DUP3 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x20E SWAP2 SWAP1 PUSH2 0x2D0 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x228 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL SWAP3 POP POP POP DUP1 ISZERO PUSH2 0x239 JUMPI POP PUSH1 0x1 JUMPDEST PUSH2 0x242 JUMPI PUSH2 0x243 JUMP JUMPDEST JUMPDEST POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x256 DUP2 PUSH2 0x31D JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x26E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x27C DUP5 DUP3 DUP6 ADD PUSH2 0x247 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x298 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x2A6 DUP6 DUP3 DUP7 ADD PUSH2 0x247 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x2B7 DUP6 DUP3 DUP7 ADD PUSH2 0x247 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH2 0x2CA DUP2 PUSH2 0x2EB JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x2E5 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x2C1 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2F6 DUP3 PUSH2 0x2FD JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x326 DUP2 PUSH2 0x2EB JUMP JUMPDEST DUP2 EQ PUSH2 0x331 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 MSTORE SWAP2 0xEB DUP12 0xAA 0x23 0xBD PUSH9 0xE06CED1A0BB4490E23 ORIGIN PUSH28 0x9D4862ABA762C124C73AE04A9764736F6C6343000803003300000000 ", + "sourceMap": "34:671:0:-:0;;;65:116;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;115:13;111:60;;;148:8;;;111:60;65:116;34:671;;7:137:1;;92:6;86:13;77:22;;108:30;132:5;108:30;:::i;:::-;67:77;;;;:::o;150:278::-;;266:2;254:9;245:7;241:23;237:32;234:2;;;282:1;279;272:12;234:2;325:1;350:61;403:7;394:6;383:9;379:22;350:61;:::i;:::-;340:71;;296:125;224:204;;;;:::o;434:90::-;;511:5;504:13;497:21;486:32;;476:48;;;:::o;530:116::-;600:21;615:5;600:21;:::i;:::-;593:5;590:32;580:2;;636:1;633;626:12;580:2;570:76;:::o;34:671:0:-;;;;;;;" + }, + "deployedBytecode": { + "generatedSources": [ + { + "ast": { + "nodeType": "YulBlock", + "src": "0:1544:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "59:87:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "69:29:1", + "value": { + "arguments": [ + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "91:6:1" + } + ], + "functionName": { + "name": "calldataload", + "nodeType": "YulIdentifier", + "src": "78:12:1" + }, + "nodeType": "YulFunctionCall", + "src": "78:20:1" + }, + "variableNames": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "69:5:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "134:5:1" + } + ], + "functionName": { + "name": "validator_revert_t_address", + "nodeType": "YulIdentifier", + "src": "107:26:1" + }, + "nodeType": "YulFunctionCall", + "src": "107:33:1" + }, + "nodeType": "YulExpressionStatement", + "src": "107:33:1" + } + ] + }, + "name": "abi_decode_t_address", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "37:6:1", + "type": "" + }, + { + "name": "end", + "nodeType": "YulTypedName", + "src": "45:3:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "53:5:1", + "type": "" + } + ], + "src": "7:139:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "218:196:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "264:16:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "273:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "276:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "266:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "266:12:1" + }, + "nodeType": "YulExpressionStatement", + "src": "266:12:1" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "239:7:1" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "248:9:1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "235:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "235:23:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "260:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "231:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "231:32:1" + }, + "nodeType": "YulIf", + "src": "228:2:1" + }, + { + "nodeType": "YulBlock", + "src": "290:117:1", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "305:15:1", + "value": { + "kind": "number", + "nodeType": "YulLiteral", + "src": "319:1:1", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "309:6:1", + "type": "" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "334:63:1", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "369:9:1" + }, + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "380:6:1" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "365:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "365:22:1" + }, + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "389:7:1" + } + ], + "functionName": { + "name": "abi_decode_t_address", + "nodeType": "YulIdentifier", + "src": "344:20:1" + }, + "nodeType": "YulFunctionCall", + "src": "344:53:1" + }, + "variableNames": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "334:6:1" + } + ] + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_address", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "188:9:1", + "type": "" + }, + { + "name": "dataEnd", + "nodeType": "YulTypedName", + "src": "199:7:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "211:6:1", + "type": "" + } + ], + "src": "152:262:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "503:324:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "549:16:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "558:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "561:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "551:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "551:12:1" + }, + "nodeType": "YulExpressionStatement", + "src": "551:12:1" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "524:7:1" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "533:9:1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "520:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "520:23:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "545:2:1", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "516:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "516:32:1" + }, + "nodeType": "YulIf", + "src": "513:2:1" + }, + { + "nodeType": "YulBlock", + "src": "575:117:1", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "590:15:1", + "value": { + "kind": "number", + "nodeType": "YulLiteral", + "src": "604:1:1", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "594:6:1", + "type": "" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "619:63:1", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "654:9:1" + }, + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "665:6:1" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "650:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "650:22:1" + }, + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "674:7:1" + } + ], + "functionName": { + "name": "abi_decode_t_address", + "nodeType": "YulIdentifier", + "src": "629:20:1" + }, + "nodeType": "YulFunctionCall", + "src": "629:53:1" + }, + "variableNames": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "619:6:1" + } + ] + } + ] + }, + { + "nodeType": "YulBlock", + "src": "702:118:1", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "717:16:1", + "value": { + "kind": "number", + "nodeType": "YulLiteral", + "src": "731:2:1", + "type": "", + "value": "32" + }, + "variables": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "721:6:1", + "type": "" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "747:63:1", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "782:9:1" + }, + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "793:6:1" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "778:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "778:22:1" + }, + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "802:7:1" + } + ], + "functionName": { + "name": "abi_decode_t_address", + "nodeType": "YulIdentifier", + "src": "757:20:1" + }, + "nodeType": "YulFunctionCall", + "src": "757:53:1" + }, + "variableNames": [ + { + "name": "value1", + "nodeType": "YulIdentifier", + "src": "747:6:1" + } + ] + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_addresst_address", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "465:9:1", + "type": "" + }, + { + "name": "dataEnd", + "nodeType": "YulTypedName", + "src": "476:7:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "488:6:1", + "type": "" + }, + { + "name": "value1", + "nodeType": "YulTypedName", + "src": "496:6:1", + "type": "" + } + ], + "src": "420:407:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "898:53:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "915:3:1" + }, + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "938:5:1" + } + ], + "functionName": { + "name": "cleanup_t_address", + "nodeType": "YulIdentifier", + "src": "920:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "920:24:1" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "908:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "908:37:1" + }, + "nodeType": "YulExpressionStatement", + "src": "908:37:1" + } + ] + }, + "name": "abi_encode_t_address_to_t_address_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "886:5:1", + "type": "" + }, + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "893:3:1", + "type": "" + } + ], + "src": "833:118:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1055:124:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "1065:26:1", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "1077:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1088:2:1", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1073:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1073:18:1" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "1065:4:1" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "1145:6:1" + }, + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "1158:9:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1169:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1154:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1154:17:1" + } + ], + "functionName": { + "name": "abi_encode_t_address_to_t_address_fromStack", + "nodeType": "YulIdentifier", + "src": "1101:43:1" + }, + "nodeType": "YulFunctionCall", + "src": "1101:71:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1101:71:1" + } + ] + }, + "name": "abi_encode_tuple_t_address__to_t_address__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "1027:9:1", + "type": "" + }, + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "1039:6:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "1050:4:1", + "type": "" + } + ], + "src": "957:222:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1230:51:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "1240:35:1", + "value": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1269:5:1" + } + ], + "functionName": { + "name": "cleanup_t_uint160", + "nodeType": "YulIdentifier", + "src": "1251:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "1251:24:1" + }, + "variableNames": [ + { + "name": "cleaned", + "nodeType": "YulIdentifier", + "src": "1240:7:1" + } + ] + } + ] + }, + "name": "cleanup_t_address", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "1212:5:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "cleaned", + "nodeType": "YulTypedName", + "src": "1222:7:1", + "type": "" + } + ], + "src": "1185:96:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1332:81:1", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "1342:65:1", + "value": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1357:5:1" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1364:42:1", + "type": "", + "value": "0xffffffffffffffffffffffffffffffffffffffff" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "1353:3:1" + }, + "nodeType": "YulFunctionCall", + "src": "1353:54:1" + }, + "variableNames": [ + { + "name": "cleaned", + "nodeType": "YulIdentifier", + "src": "1342:7:1" + } + ] + } + ] + }, + "name": "cleanup_t_uint160", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "1314:5:1", + "type": "" + } + ], + "returnVariables": [ + { + "name": "cleaned", + "nodeType": "YulTypedName", + "src": "1324:7:1", + "type": "" + } + ], + "src": "1287:126:1" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1462:79:1", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "1519:16:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1528:1:1", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1531:1:1", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "1521:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1521:12:1" + }, + "nodeType": "YulExpressionStatement", + "src": "1521:12:1" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1485:5:1" + }, + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1510:5:1" + } + ], + "functionName": { + "name": "cleanup_t_address", + "nodeType": "YulIdentifier", + "src": "1492:17:1" + }, + "nodeType": "YulFunctionCall", + "src": "1492:24:1" + } + ], + "functionName": { + "name": "eq", + "nodeType": "YulIdentifier", + "src": "1482:2:1" + }, + "nodeType": "YulFunctionCall", + "src": "1482:35:1" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "1475:6:1" + }, + "nodeType": "YulFunctionCall", + "src": "1475:43:1" + }, + "nodeType": "YulIf", + "src": "1472:2:1" + } + ] + }, + "name": "validator_revert_t_address", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "1455:5:1", + "type": "" + } + ], + "src": "1419:122:1" + } + ] + }, + "contents": "{\n\n function abi_decode_t_address(offset, end) -> value {\n value := calldataload(offset)\n validator_revert_t_address(value)\n }\n\n function abi_decode_tuple_t_address(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_address(add(headStart, offset), dataEnd)\n }\n\n }\n\n function abi_decode_tuple_t_addresst_address(headStart, dataEnd) -> value0, value1 {\n if slt(sub(dataEnd, headStart), 64) { revert(0, 0) }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_address(add(headStart, offset), dataEnd)\n }\n\n {\n\n let offset := 32\n\n value1 := abi_decode_t_address(add(headStart, offset), dataEnd)\n }\n\n }\n\n function abi_encode_t_address_to_t_address_fromStack(value, pos) {\n mstore(pos, cleanup_t_address(value))\n }\n\n function abi_encode_tuple_t_address__to_t_address__fromStack_reversed(headStart , value0) -> tail {\n tail := add(headStart, 32)\n\n abi_encode_t_address_to_t_address_fromStack(value0, add(headStart, 0))\n\n }\n\n function cleanup_t_address(value) -> cleaned {\n cleaned := cleanup_t_uint160(value)\n }\n\n function cleanup_t_uint160(value) -> cleaned {\n cleaned := and(value, 0xffffffffffffffffffffffffffffffffffffffff)\n }\n\n function validator_revert_t_address(value) {\n if iszero(eq(value, cleanup_t_address(value))) { revert(0, 0) }\n }\n\n}\n", + "id": 1, + "language": "Yul", + "name": "#utility.yul" + } + ], + "immutableReferences": {}, + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b506004361061004c5760003560e01c80635eaf9bc114610051578063a885f4e31461005b578063cb30e69614610077578063f34f161014610081575b600080fd5b61005961009d565b005b6100756004803603810190610070919061025c565b61009f565b005b61007f610162565b005b61009b60048036038101906100969190610285565b610167565b005b565b8073ffffffffffffffffffffffffffffffffffffffff16635eaf9bc16040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156100e757600080fd5b505af11580156100fb573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff1663cb30e6966040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561014757600080fd5b505af115801561015b573d6000803e3d6000fd5b5050505050565b600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a885f4e3826040518263ffffffff1660e01b81526004016101a091906102d0565b600060405180830381600087803b1580156101ba57600080fd5b505af19250505080156101cb575060015b6101d4576101d5565b5b8173ffffffffffffffffffffffffffffffffffffffff1663a885f4e3826040518263ffffffff1660e01b815260040161020e91906102d0565b600060405180830381600087803b15801561022857600080fd5b505af1925050508015610239575060015b61024257610243565b5b5050565b6000813590506102568161031d565b92915050565b60006020828403121561026e57600080fd5b600061027c84828501610247565b91505092915050565b6000806040838503121561029857600080fd5b60006102a685828601610247565b92505060206102b785828601610247565b9150509250929050565b6102ca816102eb565b82525050565b60006020820190506102e560008301846102c1565b92915050565b60006102f6826102fd565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b610326816102eb565b811461033157600080fd5b5056fea26469706673582212205291eb8baa23bd68e06ced1a0bb4490e23327b9d4862aba762c124c73ae04a9764736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x4C JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x5EAF9BC1 EQ PUSH2 0x51 JUMPI DUP1 PUSH4 0xA885F4E3 EQ PUSH2 0x5B JUMPI DUP1 PUSH4 0xCB30E696 EQ PUSH2 0x77 JUMPI DUP1 PUSH4 0xF34F1610 EQ PUSH2 0x81 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x59 PUSH2 0x9D JUMP JUMPDEST STOP JUMPDEST PUSH2 0x75 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x70 SWAP2 SWAP1 PUSH2 0x25C JUMP JUMPDEST PUSH2 0x9F JUMP JUMPDEST STOP JUMPDEST PUSH2 0x7F PUSH2 0x162 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x9B PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x96 SWAP2 SWAP1 PUSH2 0x285 JUMP JUMPDEST PUSH2 0x167 JUMP JUMPDEST STOP JUMPDEST JUMP JUMPDEST DUP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x5EAF9BC1 PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0xE7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xFB JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP DUP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xCB30E696 PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x147 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x15B JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xA885F4E3 DUP3 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1A0 SWAP2 SWAP1 PUSH2 0x2D0 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x1BA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL SWAP3 POP POP POP DUP1 ISZERO PUSH2 0x1CB JUMPI POP PUSH1 0x1 JUMPDEST PUSH2 0x1D4 JUMPI PUSH2 0x1D5 JUMP JUMPDEST JUMPDEST DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xA885F4E3 DUP3 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x20E SWAP2 SWAP1 PUSH2 0x2D0 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x228 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL SWAP3 POP POP POP DUP1 ISZERO PUSH2 0x239 JUMPI POP PUSH1 0x1 JUMPDEST PUSH2 0x242 JUMPI PUSH2 0x243 JUMP JUMPDEST JUMPDEST POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x256 DUP2 PUSH2 0x31D JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x26E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x27C DUP5 DUP3 DUP6 ADD PUSH2 0x247 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x298 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x2A6 DUP6 DUP3 DUP7 ADD PUSH2 0x247 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x2B7 DUP6 DUP3 DUP7 ADD PUSH2 0x247 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH2 0x2CA DUP2 PUSH2 0x2EB JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x2E5 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x2C1 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2F6 DUP3 PUSH2 0x2FD JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x326 DUP2 PUSH2 0x2EB JUMP JUMPDEST DUP2 EQ PUSH2 0x331 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 MSTORE SWAP2 0xEB DUP12 0xAA 0x23 0xBD PUSH9 0xE06CED1A0BB4490E23 ORIGIN PUSH28 0x9D4862ABA762C124C73AE04A9764736F6C6343000803003300000000 ", + "sourceMap": "34:671:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;195:29;;;:::i;:::-;;551:148;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;238:71;;;:::i;:::-;;323:214;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;195:29;:::o;551:148::-;622:7;610:28;;;:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;666:7;654:32;;;:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;551:148;:::o;238:71::-;282:8;;;323:214;412:7;400:32;;;433:7;400:41;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;396:59;;;;;;484:7;472:32;;;505:7;472:41;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;468:59;;;;;;323:214;;:::o;7:139:1:-;;91:6;78:20;69:29;;107:33;134:5;107:33;:::i;:::-;59:87;;;;:::o;152:262::-;;260:2;248:9;239:7;235:23;231:32;228:2;;;276:1;273;266:12;228:2;319:1;344:53;389:7;380:6;369:9;365:22;344:53;:::i;:::-;334:63;;290:117;218:196;;;;:::o;420:407::-;;;545:2;533:9;524:7;520:23;516:32;513:2;;;561:1;558;551:12;513:2;604:1;629:53;674:7;665:6;654:9;650:22;629:53;:::i;:::-;619:63;;575:117;731:2;757:53;802:7;793:6;782:9;778:22;757:53;:::i;:::-;747:63;;702:118;503:324;;;;;:::o;833:118::-;920:24;938:5;920:24;:::i;:::-;915:3;908:37;898:53;;:::o;957:222::-;;1088:2;1077:9;1073:18;1065:26;;1101:71;1169:1;1158:9;1154:17;1145:6;1101:71;:::i;:::-;1055:124;;;;:::o;1185:96::-;;1251:24;1269:5;1251:24;:::i;:::-;1240:35;;1230:51;;;:::o;1287:126::-;;1364:42;1357:5;1353:54;1342:65;;1332:81;;;:::o;1419:122::-;1492:24;1510:5;1492:24;:::i;:::-;1485:5;1482:35;1472:2;;1531:1;1528;1521:12;1472:2;1462:79;:::o" + }, + "gasEstimates": { + "creation": { + "codeDepositCost": "174800", + "executionCost": "infinite", + "totalCost": "infinite" + }, + "external": { + "call_ok()": "122", + "call_revert()": "163", + "subcalls(address,address)": "infinite", + "subsubcalls(address)": "infinite" + } + }, + "legacyAssembly": { + ".code": [ + { + "begin": 34, + "end": 705, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 34, + "end": 705, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 705, "name": "MSTORE", "source": 0 }, + { "begin": 65, "end": 181, "name": "CALLVALUE", "source": 0 }, + { "begin": 65, "end": 181, "name": "DUP1", "source": 0 }, + { "begin": 65, "end": 181, "name": "ISZERO", "source": 0 }, + { + "begin": 65, + "end": 181, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 65, "end": 181, "name": "JUMPI", "source": 0 }, + { + "begin": 65, + "end": 181, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 65, "end": 181, "name": "DUP1", "source": 0 }, + { "begin": 65, "end": 181, "name": "REVERT", "source": 0 }, + { "begin": 65, "end": 181, "name": "tag", "source": 0, "value": "1" }, + { "begin": 65, "end": 181, "name": "JUMPDEST", "source": 0 }, + { "begin": 65, "end": 181, "name": "POP", "source": 0 }, + { + "begin": 65, + "end": 181, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 65, "end": 181, "name": "MLOAD", "source": 0 }, + { "begin": 65, "end": 181, "name": "PUSHSIZE", "source": 0 }, + { "begin": 65, "end": 181, "name": "CODESIZE", "source": 0 }, + { "begin": 65, "end": 181, "name": "SUB", "source": 0 }, + { "begin": 65, "end": 181, "name": "DUP1", "source": 0 }, + { "begin": 65, "end": 181, "name": "PUSHSIZE", "source": 0 }, + { "begin": 65, "end": 181, "name": "DUP4", "source": 0 }, + { "begin": 65, "end": 181, "name": "CODECOPY", "source": 0 }, + { "begin": 65, "end": 181, "name": "DUP2", "source": 0 }, + { "begin": 65, "end": 181, "name": "DUP2", "source": 0 }, + { "begin": 65, "end": 181, "name": "ADD", "source": 0 }, + { + "begin": 65, + "end": 181, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 65, "end": 181, "name": "MSTORE", "source": 0 }, + { "begin": 65, "end": 181, "name": "DUP2", "source": 0 }, + { "begin": 65, "end": 181, "name": "ADD", "source": 0 }, + { "begin": 65, "end": 181, "name": "SWAP1", "source": 0 }, + { + "begin": 65, + "end": 181, + "name": "PUSH [tag]", + "source": 0, + "value": "2" + }, + { "begin": 65, "end": 181, "name": "SWAP2", "source": 0 }, + { "begin": 65, "end": 181, "name": "SWAP1", "source": 0 }, + { + "begin": 65, + "end": 181, + "name": "PUSH [tag]", + "source": 0, + "value": "3" + }, + { + "begin": 65, + "end": 181, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { "begin": 65, "end": 181, "name": "tag", "source": 0, "value": "2" }, + { "begin": 65, "end": 181, "name": "JUMPDEST", "source": 0 }, + { "begin": 115, "end": 128, "name": "DUP1", "source": 0 }, + { "begin": 111, "end": 171, "name": "ISZERO", "source": 0 }, + { + "begin": 111, + "end": 171, + "name": "PUSH [tag]", + "source": 0, + "value": "6" + }, + { "begin": 111, "end": 171, "name": "JUMPI", "source": 0 }, + { + "begin": 148, + "end": 156, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 148, "end": 156, "name": "DUP1", "source": 0 }, + { "begin": 148, "end": 156, "name": "REVERT", "source": 0 }, + { + "begin": 111, + "end": 171, + "name": "tag", + "source": 0, + "value": "6" + }, + { "begin": 111, "end": 171, "name": "JUMPDEST", "source": 0 }, + { "begin": 65, "end": 181, "name": "POP", "source": 0 }, + { + "begin": 34, + "end": 705, + "name": "PUSH [tag]", + "source": 0, + "value": "7" + }, + { "begin": 34, "end": 705, "name": "JUMP", "source": 0 }, + { "begin": 7, "end": 144, "name": "tag", "source": 1, "value": "9" }, + { "begin": 7, "end": 144, "name": "JUMPDEST", "source": 1 }, + { "begin": 7, "end": 144, "name": "PUSH", "source": 1, "value": "0" }, + { "begin": 92, "end": 98, "name": "DUP2", "source": 1 }, + { "begin": 86, "end": 99, "name": "MLOAD", "source": 1 }, + { "begin": 77, "end": 99, "name": "SWAP1", "source": 1 }, + { "begin": 77, "end": 99, "name": "POP", "source": 1 }, + { + "begin": 108, + "end": 138, + "name": "PUSH [tag]", + "source": 1, + "value": "11" + }, + { "begin": 132, "end": 137, "name": "DUP2", "source": 1 }, + { + "begin": 108, + "end": 138, + "name": "PUSH [tag]", + "source": 1, + "value": "12" + }, + { + "begin": 108, + "end": 138, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 108, + "end": 138, + "name": "tag", + "source": 1, + "value": "11" + }, + { "begin": 108, "end": 138, "name": "JUMPDEST", "source": 1 }, + { "begin": 67, "end": 144, "name": "SWAP3", "source": 1 }, + { "begin": 67, "end": 144, "name": "SWAP2", "source": 1 }, + { "begin": 67, "end": 144, "name": "POP", "source": 1 }, + { "begin": 67, "end": 144, "name": "POP", "source": 1 }, + { + "begin": 67, + "end": 144, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 150, + "end": 428, + "name": "tag", + "source": 1, + "value": "3" + }, + { "begin": 150, "end": 428, "name": "JUMPDEST", "source": 1 }, + { + "begin": 150, + "end": 428, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 266, + "end": 268, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 254, "end": 263, "name": "DUP3", "source": 1 }, + { "begin": 245, "end": 252, "name": "DUP5", "source": 1 }, + { "begin": 241, "end": 264, "name": "SUB", "source": 1 }, + { "begin": 237, "end": 269, "name": "SLT", "source": 1 }, + { "begin": 234, "end": 236, "name": "ISZERO", "source": 1 }, + { + "begin": 234, + "end": 236, + "name": "PUSH [tag]", + "source": 1, + "value": "14" + }, + { "begin": 234, "end": 236, "name": "JUMPI", "source": 1 }, + { + "begin": 282, + "end": 283, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 279, "end": 280, "name": "DUP1", "source": 1 }, + { "begin": 272, "end": 284, "name": "REVERT", "source": 1 }, + { + "begin": 234, + "end": 236, + "name": "tag", + "source": 1, + "value": "14" + }, + { "begin": 234, "end": 236, "name": "JUMPDEST", "source": 1 }, + { + "begin": 325, + "end": 326, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 350, + "end": 411, + "name": "PUSH [tag]", + "source": 1, + "value": "15" + }, + { "begin": 403, "end": 410, "name": "DUP5", "source": 1 }, + { "begin": 394, "end": 400, "name": "DUP3", "source": 1 }, + { "begin": 383, "end": 392, "name": "DUP6", "source": 1 }, + { "begin": 379, "end": 401, "name": "ADD", "source": 1 }, + { + "begin": 350, + "end": 411, + "name": "PUSH [tag]", + "source": 1, + "value": "9" + }, + { + "begin": 350, + "end": 411, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 350, + "end": 411, + "name": "tag", + "source": 1, + "value": "15" + }, + { "begin": 350, "end": 411, "name": "JUMPDEST", "source": 1 }, + { "begin": 340, "end": 411, "name": "SWAP2", "source": 1 }, + { "begin": 340, "end": 411, "name": "POP", "source": 1 }, + { "begin": 296, "end": 421, "name": "POP", "source": 1 }, + { "begin": 224, "end": 428, "name": "SWAP3", "source": 1 }, + { "begin": 224, "end": 428, "name": "SWAP2", "source": 1 }, + { "begin": 224, "end": 428, "name": "POP", "source": 1 }, + { "begin": 224, "end": 428, "name": "POP", "source": 1 }, + { + "begin": 224, + "end": 428, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 434, + "end": 524, + "name": "tag", + "source": 1, + "value": "16" + }, + { "begin": 434, "end": 524, "name": "JUMPDEST", "source": 1 }, + { + "begin": 434, + "end": 524, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 511, "end": 516, "name": "DUP2", "source": 1 }, + { "begin": 504, "end": 517, "name": "ISZERO", "source": 1 }, + { "begin": 497, "end": 518, "name": "ISZERO", "source": 1 }, + { "begin": 486, "end": 518, "name": "SWAP1", "source": 1 }, + { "begin": 486, "end": 518, "name": "POP", "source": 1 }, + { "begin": 476, "end": 524, "name": "SWAP2", "source": 1 }, + { "begin": 476, "end": 524, "name": "SWAP1", "source": 1 }, + { "begin": 476, "end": 524, "name": "POP", "source": 1 }, + { + "begin": 476, + "end": 524, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 530, + "end": 646, + "name": "tag", + "source": 1, + "value": "12" + }, + { "begin": 530, "end": 646, "name": "JUMPDEST", "source": 1 }, + { + "begin": 600, + "end": 621, + "name": "PUSH [tag]", + "source": 1, + "value": "19" + }, + { "begin": 615, "end": 620, "name": "DUP2", "source": 1 }, + { + "begin": 600, + "end": 621, + "name": "PUSH [tag]", + "source": 1, + "value": "16" + }, + { + "begin": 600, + "end": 621, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 600, + "end": 621, + "name": "tag", + "source": 1, + "value": "19" + }, + { "begin": 600, "end": 621, "name": "JUMPDEST", "source": 1 }, + { "begin": 593, "end": 598, "name": "DUP2", "source": 1 }, + { "begin": 590, "end": 622, "name": "EQ", "source": 1 }, + { + "begin": 580, + "end": 582, + "name": "PUSH [tag]", + "source": 1, + "value": "20" + }, + { "begin": 580, "end": 582, "name": "JUMPI", "source": 1 }, + { + "begin": 636, + "end": 637, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 633, "end": 634, "name": "DUP1", "source": 1 }, + { "begin": 626, "end": 638, "name": "REVERT", "source": 1 }, + { + "begin": 580, + "end": 582, + "name": "tag", + "source": 1, + "value": "20" + }, + { "begin": 580, "end": 582, "name": "JUMPDEST", "source": 1 }, + { "begin": 570, "end": 646, "name": "POP", "source": 1 }, + { + "begin": 570, + "end": 646, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { "begin": 34, "end": 705, "name": "tag", "source": 0, "value": "7" }, + { "begin": 34, "end": 705, "name": "JUMPDEST", "source": 0 }, + { + "begin": 34, + "end": 705, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { "begin": 34, "end": 705, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 705, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 34, + "end": 705, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 705, "name": "CODECOPY", "source": 0 }, + { + "begin": 34, + "end": 705, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 705, "name": "RETURN", "source": 0 } + ], + ".data": { + "0": { + ".auxdata": "a26469706673582212205291eb8baa23bd68e06ced1a0bb4490e23327b9d4862aba762c124c73ae04a9764736f6c63430008030033", + ".code": [ + { + "begin": 34, + "end": 705, + "name": "PUSH", + "source": 0, + "value": "80" + }, + { + "begin": 34, + "end": 705, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 34, "end": 705, "name": "MSTORE", "source": 0 }, + { "begin": 34, "end": 705, "name": "CALLVALUE", "source": 0 }, + { "begin": 34, "end": 705, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 705, "name": "ISZERO", "source": 0 }, + { + "begin": 34, + "end": 705, + "name": "PUSH [tag]", + "source": 0, + "value": "1" + }, + { "begin": 34, "end": 705, "name": "JUMPI", "source": 0 }, + { + "begin": 34, + "end": 705, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 705, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 705, "name": "REVERT", "source": 0 }, + { + "begin": 34, + "end": 705, + "name": "tag", + "source": 0, + "value": "1" + }, + { "begin": 34, "end": 705, "name": "JUMPDEST", "source": 0 }, + { "begin": 34, "end": 705, "name": "POP", "source": 0 }, + { + "begin": 34, + "end": 705, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 34, "end": 705, "name": "CALLDATASIZE", "source": 0 }, + { "begin": 34, "end": 705, "name": "LT", "source": 0 }, + { + "begin": 34, + "end": 705, + "name": "PUSH [tag]", + "source": 0, + "value": "2" + }, + { "begin": 34, "end": 705, "name": "JUMPI", "source": 0 }, + { + "begin": 34, + "end": 705, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 705, "name": "CALLDATALOAD", "source": 0 }, + { + "begin": 34, + "end": 705, + "name": "PUSH", + "source": 0, + "value": "E0" + }, + { "begin": 34, "end": 705, "name": "SHR", "source": 0 }, + { "begin": 34, "end": 705, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 705, + "name": "PUSH", + "source": 0, + "value": "5EAF9BC1" + }, + { "begin": 34, "end": 705, "name": "EQ", "source": 0 }, + { + "begin": 34, + "end": 705, + "name": "PUSH [tag]", + "source": 0, + "value": "3" + }, + { "begin": 34, "end": 705, "name": "JUMPI", "source": 0 }, + { "begin": 34, "end": 705, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 705, + "name": "PUSH", + "source": 0, + "value": "A885F4E3" + }, + { "begin": 34, "end": 705, "name": "EQ", "source": 0 }, + { + "begin": 34, + "end": 705, + "name": "PUSH [tag]", + "source": 0, + "value": "4" + }, + { "begin": 34, "end": 705, "name": "JUMPI", "source": 0 }, + { "begin": 34, "end": 705, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 705, + "name": "PUSH", + "source": 0, + "value": "CB30E696" + }, + { "begin": 34, "end": 705, "name": "EQ", "source": 0 }, + { + "begin": 34, + "end": 705, + "name": "PUSH [tag]", + "source": 0, + "value": "5" + }, + { "begin": 34, "end": 705, "name": "JUMPI", "source": 0 }, + { "begin": 34, "end": 705, "name": "DUP1", "source": 0 }, + { + "begin": 34, + "end": 705, + "name": "PUSH", + "source": 0, + "value": "F34F1610" + }, + { "begin": 34, "end": 705, "name": "EQ", "source": 0 }, + { + "begin": 34, + "end": 705, + "name": "PUSH [tag]", + "source": 0, + "value": "6" + }, + { "begin": 34, "end": 705, "name": "JUMPI", "source": 0 }, + { + "begin": 34, + "end": 705, + "name": "tag", + "source": 0, + "value": "2" + }, + { "begin": 34, "end": 705, "name": "JUMPDEST", "source": 0 }, + { + "begin": 34, + "end": 705, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 34, "end": 705, "name": "DUP1", "source": 0 }, + { "begin": 34, "end": 705, "name": "REVERT", "source": 0 }, + { + "begin": 195, + "end": 224, + "name": "tag", + "source": 0, + "value": "3" + }, + { "begin": 195, "end": 224, "name": "JUMPDEST", "source": 0 }, + { + "begin": 195, + "end": 224, + "name": "PUSH [tag]", + "source": 0, + "value": "7" + }, + { + "begin": 195, + "end": 224, + "name": "PUSH [tag]", + "source": 0, + "value": "8" + }, + { + "begin": 195, + "end": 224, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 195, + "end": 224, + "name": "tag", + "source": 0, + "value": "7" + }, + { "begin": 195, "end": 224, "name": "JUMPDEST", "source": 0 }, + { "begin": 195, "end": 224, "name": "STOP", "source": 0 }, + { + "begin": 551, + "end": 699, + "name": "tag", + "source": 0, + "value": "4" + }, + { "begin": 551, "end": 699, "name": "JUMPDEST", "source": 0 }, + { + "begin": 551, + "end": 699, + "name": "PUSH [tag]", + "source": 0, + "value": "9" + }, + { + "begin": 551, + "end": 699, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 551, "end": 699, "name": "DUP1", "source": 0 }, + { "begin": 551, "end": 699, "name": "CALLDATASIZE", "source": 0 }, + { "begin": 551, "end": 699, "name": "SUB", "source": 0 }, + { "begin": 551, "end": 699, "name": "DUP2", "source": 0 }, + { "begin": 551, "end": 699, "name": "ADD", "source": 0 }, + { "begin": 551, "end": 699, "name": "SWAP1", "source": 0 }, + { + "begin": 551, + "end": 699, + "name": "PUSH [tag]", + "source": 0, + "value": "10" + }, + { "begin": 551, "end": 699, "name": "SWAP2", "source": 0 }, + { "begin": 551, "end": 699, "name": "SWAP1", "source": 0 }, + { + "begin": 551, + "end": 699, + "name": "PUSH [tag]", + "source": 0, + "value": "11" + }, + { + "begin": 551, + "end": 699, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 551, + "end": 699, + "name": "tag", + "source": 0, + "value": "10" + }, + { "begin": 551, "end": 699, "name": "JUMPDEST", "source": 0 }, + { + "begin": 551, + "end": 699, + "name": "PUSH [tag]", + "source": 0, + "value": "12" + }, + { + "begin": 551, + "end": 699, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 551, + "end": 699, + "name": "tag", + "source": 0, + "value": "9" + }, + { "begin": 551, "end": 699, "name": "JUMPDEST", "source": 0 }, + { "begin": 551, "end": 699, "name": "STOP", "source": 0 }, + { + "begin": 238, + "end": 309, + "name": "tag", + "source": 0, + "value": "5" + }, + { "begin": 238, "end": 309, "name": "JUMPDEST", "source": 0 }, + { + "begin": 238, + "end": 309, + "name": "PUSH [tag]", + "source": 0, + "value": "13" + }, + { + "begin": 238, + "end": 309, + "name": "PUSH [tag]", + "source": 0, + "value": "14" + }, + { + "begin": 238, + "end": 309, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 238, + "end": 309, + "name": "tag", + "source": 0, + "value": "13" + }, + { "begin": 238, "end": 309, "name": "JUMPDEST", "source": 0 }, + { "begin": 238, "end": 309, "name": "STOP", "source": 0 }, + { + "begin": 323, + "end": 537, + "name": "tag", + "source": 0, + "value": "6" + }, + { "begin": 323, "end": 537, "name": "JUMPDEST", "source": 0 }, + { + "begin": 323, + "end": 537, + "name": "PUSH [tag]", + "source": 0, + "value": "15" + }, + { + "begin": 323, + "end": 537, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 323, "end": 537, "name": "DUP1", "source": 0 }, + { "begin": 323, "end": 537, "name": "CALLDATASIZE", "source": 0 }, + { "begin": 323, "end": 537, "name": "SUB", "source": 0 }, + { "begin": 323, "end": 537, "name": "DUP2", "source": 0 }, + { "begin": 323, "end": 537, "name": "ADD", "source": 0 }, + { "begin": 323, "end": 537, "name": "SWAP1", "source": 0 }, + { + "begin": 323, + "end": 537, + "name": "PUSH [tag]", + "source": 0, + "value": "16" + }, + { "begin": 323, "end": 537, "name": "SWAP2", "source": 0 }, + { "begin": 323, "end": 537, "name": "SWAP1", "source": 0 }, + { + "begin": 323, + "end": 537, + "name": "PUSH [tag]", + "source": 0, + "value": "17" + }, + { + "begin": 323, + "end": 537, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 323, + "end": 537, + "name": "tag", + "source": 0, + "value": "16" + }, + { "begin": 323, "end": 537, "name": "JUMPDEST", "source": 0 }, + { + "begin": 323, + "end": 537, + "name": "PUSH [tag]", + "source": 0, + "value": "18" + }, + { + "begin": 323, + "end": 537, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 323, + "end": 537, + "name": "tag", + "source": 0, + "value": "15" + }, + { "begin": 323, "end": 537, "name": "JUMPDEST", "source": 0 }, + { "begin": 323, "end": 537, "name": "STOP", "source": 0 }, + { + "begin": 195, + "end": 224, + "name": "tag", + "source": 0, + "value": "8" + }, + { "begin": 195, "end": 224, "name": "JUMPDEST", "source": 0 }, + { + "begin": 195, + "end": 224, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { + "begin": 551, + "end": 699, + "name": "tag", + "source": 0, + "value": "12" + }, + { "begin": 551, "end": 699, "name": "JUMPDEST", "source": 0 }, + { "begin": 622, "end": 629, "name": "DUP1", "source": 0 }, + { + "begin": 610, + "end": 638, + "name": "PUSH", + "source": 0, + "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + }, + { "begin": 610, "end": 638, "name": "AND", "source": 0 }, + { + "begin": 610, + "end": 638, + "name": "PUSH", + "source": 0, + "value": "5EAF9BC1" + }, + { + "begin": 610, + "end": 640, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 610, "end": 640, "name": "MLOAD", "source": 0 }, + { "begin": 610, "end": 640, "name": "DUP2", "source": 0 }, + { + "begin": 610, + "end": 640, + "name": "PUSH", + "source": 0, + "value": "FFFFFFFF" + }, + { "begin": 610, "end": 640, "name": "AND", "source": 0 }, + { + "begin": 610, + "end": 640, + "name": "PUSH", + "source": 0, + "value": "E0" + }, + { "begin": 610, "end": 640, "name": "SHL", "source": 0 }, + { "begin": 610, "end": 640, "name": "DUP2", "source": 0 }, + { "begin": 610, "end": 640, "name": "MSTORE", "source": 0 }, + { + "begin": 610, + "end": 640, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 610, "end": 640, "name": "ADD", "source": 0 }, + { + "begin": 610, + "end": 640, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { + "begin": 610, + "end": 640, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 610, "end": 640, "name": "MLOAD", "source": 0 }, + { "begin": 610, "end": 640, "name": "DUP1", "source": 0 }, + { "begin": 610, "end": 640, "name": "DUP4", "source": 0 }, + { "begin": 610, "end": 640, "name": "SUB", "source": 0 }, + { "begin": 610, "end": 640, "name": "DUP2", "source": 0 }, + { + "begin": 610, + "end": 640, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 610, "end": 640, "name": "DUP8", "source": 0 }, + { "begin": 610, "end": 640, "name": "DUP1", "source": 0 }, + { "begin": 610, "end": 640, "name": "EXTCODESIZE", "source": 0 }, + { "begin": 610, "end": 640, "name": "ISZERO", "source": 0 }, + { "begin": 610, "end": 640, "name": "DUP1", "source": 0 }, + { "begin": 610, "end": 640, "name": "ISZERO", "source": 0 }, + { + "begin": 610, + "end": 640, + "name": "PUSH [tag]", + "source": 0, + "value": "21" + }, + { "begin": 610, "end": 640, "name": "JUMPI", "source": 0 }, + { + "begin": 610, + "end": 640, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 610, "end": 640, "name": "DUP1", "source": 0 }, + { "begin": 610, "end": 640, "name": "REVERT", "source": 0 }, + { + "begin": 610, + "end": 640, + "name": "tag", + "source": 0, + "value": "21" + }, + { "begin": 610, "end": 640, "name": "JUMPDEST", "source": 0 }, + { "begin": 610, "end": 640, "name": "POP", "source": 0 }, + { "begin": 610, "end": 640, "name": "GAS", "source": 0 }, + { "begin": 610, "end": 640, "name": "CALL", "source": 0 }, + { "begin": 610, "end": 640, "name": "ISZERO", "source": 0 }, + { "begin": 610, "end": 640, "name": "DUP1", "source": 0 }, + { "begin": 610, "end": 640, "name": "ISZERO", "source": 0 }, + { + "begin": 610, + "end": 640, + "name": "PUSH [tag]", + "source": 0, + "value": "23" + }, + { "begin": 610, "end": 640, "name": "JUMPI", "source": 0 }, + { + "begin": 610, + "end": 640, + "name": "RETURNDATASIZE", + "source": 0 + }, + { + "begin": 610, + "end": 640, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 610, "end": 640, "name": "DUP1", "source": 0 }, + { + "begin": 610, + "end": 640, + "name": "RETURNDATACOPY", + "source": 0 + }, + { + "begin": 610, + "end": 640, + "name": "RETURNDATASIZE", + "source": 0 + }, + { + "begin": 610, + "end": 640, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 610, "end": 640, "name": "REVERT", "source": 0 }, + { + "begin": 610, + "end": 640, + "name": "tag", + "source": 0, + "value": "23" + }, + { "begin": 610, "end": 640, "name": "JUMPDEST", "source": 0 }, + { "begin": 610, "end": 640, "name": "POP", "source": 0 }, + { "begin": 610, "end": 640, "name": "POP", "source": 0 }, + { "begin": 610, "end": 640, "name": "POP", "source": 0 }, + { "begin": 610, "end": 640, "name": "POP", "source": 0 }, + { "begin": 666, "end": 673, "name": "DUP1", "source": 0 }, + { + "begin": 654, + "end": 686, + "name": "PUSH", + "source": 0, + "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + }, + { "begin": 654, "end": 686, "name": "AND", "source": 0 }, + { + "begin": 654, + "end": 686, + "name": "PUSH", + "source": 0, + "value": "CB30E696" + }, + { + "begin": 654, + "end": 688, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 654, "end": 688, "name": "MLOAD", "source": 0 }, + { "begin": 654, "end": 688, "name": "DUP2", "source": 0 }, + { + "begin": 654, + "end": 688, + "name": "PUSH", + "source": 0, + "value": "FFFFFFFF" + }, + { "begin": 654, "end": 688, "name": "AND", "source": 0 }, + { + "begin": 654, + "end": 688, + "name": "PUSH", + "source": 0, + "value": "E0" + }, + { "begin": 654, "end": 688, "name": "SHL", "source": 0 }, + { "begin": 654, "end": 688, "name": "DUP2", "source": 0 }, + { "begin": 654, "end": 688, "name": "MSTORE", "source": 0 }, + { + "begin": 654, + "end": 688, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 654, "end": 688, "name": "ADD", "source": 0 }, + { + "begin": 654, + "end": 688, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { + "begin": 654, + "end": 688, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 654, "end": 688, "name": "MLOAD", "source": 0 }, + { "begin": 654, "end": 688, "name": "DUP1", "source": 0 }, + { "begin": 654, "end": 688, "name": "DUP4", "source": 0 }, + { "begin": 654, "end": 688, "name": "SUB", "source": 0 }, + { "begin": 654, "end": 688, "name": "DUP2", "source": 0 }, + { + "begin": 654, + "end": 688, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 654, "end": 688, "name": "DUP8", "source": 0 }, + { "begin": 654, "end": 688, "name": "DUP1", "source": 0 }, + { "begin": 654, "end": 688, "name": "EXTCODESIZE", "source": 0 }, + { "begin": 654, "end": 688, "name": "ISZERO", "source": 0 }, + { "begin": 654, "end": 688, "name": "DUP1", "source": 0 }, + { "begin": 654, "end": 688, "name": "ISZERO", "source": 0 }, + { + "begin": 654, + "end": 688, + "name": "PUSH [tag]", + "source": 0, + "value": "24" + }, + { "begin": 654, "end": 688, "name": "JUMPI", "source": 0 }, + { + "begin": 654, + "end": 688, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 654, "end": 688, "name": "DUP1", "source": 0 }, + { "begin": 654, "end": 688, "name": "REVERT", "source": 0 }, + { + "begin": 654, + "end": 688, + "name": "tag", + "source": 0, + "value": "24" + }, + { "begin": 654, "end": 688, "name": "JUMPDEST", "source": 0 }, + { "begin": 654, "end": 688, "name": "POP", "source": 0 }, + { "begin": 654, "end": 688, "name": "GAS", "source": 0 }, + { "begin": 654, "end": 688, "name": "CALL", "source": 0 }, + { "begin": 654, "end": 688, "name": "ISZERO", "source": 0 }, + { "begin": 654, "end": 688, "name": "DUP1", "source": 0 }, + { "begin": 654, "end": 688, "name": "ISZERO", "source": 0 }, + { + "begin": 654, + "end": 688, + "name": "PUSH [tag]", + "source": 0, + "value": "26" + }, + { "begin": 654, "end": 688, "name": "JUMPI", "source": 0 }, + { + "begin": 654, + "end": 688, + "name": "RETURNDATASIZE", + "source": 0 + }, + { + "begin": 654, + "end": 688, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 654, "end": 688, "name": "DUP1", "source": 0 }, + { + "begin": 654, + "end": 688, + "name": "RETURNDATACOPY", + "source": 0 + }, + { + "begin": 654, + "end": 688, + "name": "RETURNDATASIZE", + "source": 0 + }, + { + "begin": 654, + "end": 688, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 654, "end": 688, "name": "REVERT", "source": 0 }, + { + "begin": 654, + "end": 688, + "name": "tag", + "source": 0, + "value": "26" + }, + { "begin": 654, "end": 688, "name": "JUMPDEST", "source": 0 }, + { "begin": 654, "end": 688, "name": "POP", "source": 0 }, + { "begin": 654, "end": 688, "name": "POP", "source": 0 }, + { "begin": 654, "end": 688, "name": "POP", "source": 0 }, + { "begin": 654, "end": 688, "name": "POP", "source": 0 }, + { "begin": 551, "end": 699, "name": "POP", "source": 0 }, + { + "begin": 551, + "end": 699, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { + "begin": 238, + "end": 309, + "name": "tag", + "source": 0, + "value": "14" + }, + { "begin": 238, "end": 309, "name": "JUMPDEST", "source": 0 }, + { + "begin": 282, + "end": 290, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 282, "end": 290, "name": "DUP1", "source": 0 }, + { "begin": 282, "end": 290, "name": "REVERT", "source": 0 }, + { + "begin": 323, + "end": 537, + "name": "tag", + "source": 0, + "value": "18" + }, + { "begin": 323, "end": 537, "name": "JUMPDEST", "source": 0 }, + { "begin": 412, "end": 419, "name": "DUP2", "source": 0 }, + { + "begin": 400, + "end": 432, + "name": "PUSH", + "source": 0, + "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + }, + { "begin": 400, "end": 432, "name": "AND", "source": 0 }, + { + "begin": 400, + "end": 432, + "name": "PUSH", + "source": 0, + "value": "A885F4E3" + }, + { "begin": 433, "end": 440, "name": "DUP3", "source": 0 }, + { + "begin": 400, + "end": 441, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 400, "end": 441, "name": "MLOAD", "source": 0 }, + { "begin": 400, "end": 441, "name": "DUP3", "source": 0 }, + { + "begin": 400, + "end": 441, + "name": "PUSH", + "source": 0, + "value": "FFFFFFFF" + }, + { "begin": 400, "end": 441, "name": "AND", "source": 0 }, + { + "begin": 400, + "end": 441, + "name": "PUSH", + "source": 0, + "value": "E0" + }, + { "begin": 400, "end": 441, "name": "SHL", "source": 0 }, + { "begin": 400, "end": 441, "name": "DUP2", "source": 0 }, + { "begin": 400, "end": 441, "name": "MSTORE", "source": 0 }, + { + "begin": 400, + "end": 441, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 400, "end": 441, "name": "ADD", "source": 0 }, + { + "begin": 400, + "end": 441, + "name": "PUSH [tag]", + "source": 0, + "value": "29" + }, + { "begin": 400, "end": 441, "name": "SWAP2", "source": 0 }, + { "begin": 400, "end": 441, "name": "SWAP1", "source": 0 }, + { + "begin": 400, + "end": 441, + "name": "PUSH [tag]", + "source": 0, + "value": "30" + }, + { + "begin": 400, + "end": 441, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 400, + "end": 441, + "name": "tag", + "source": 0, + "value": "29" + }, + { "begin": 400, "end": 441, "name": "JUMPDEST", "source": 0 }, + { + "begin": 400, + "end": 441, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { + "begin": 400, + "end": 441, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 400, "end": 441, "name": "MLOAD", "source": 0 }, + { "begin": 400, "end": 441, "name": "DUP1", "source": 0 }, + { "begin": 400, "end": 441, "name": "DUP4", "source": 0 }, + { "begin": 400, "end": 441, "name": "SUB", "source": 0 }, + { "begin": 400, "end": 441, "name": "DUP2", "source": 0 }, + { + "begin": 400, + "end": 441, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 400, "end": 441, "name": "DUP8", "source": 0 }, + { "begin": 400, "end": 441, "name": "DUP1", "source": 0 }, + { "begin": 400, "end": 441, "name": "EXTCODESIZE", "source": 0 }, + { "begin": 400, "end": 441, "name": "ISZERO", "source": 0 }, + { "begin": 400, "end": 441, "name": "DUP1", "source": 0 }, + { "begin": 400, "end": 441, "name": "ISZERO", "source": 0 }, + { + "begin": 400, + "end": 441, + "name": "PUSH [tag]", + "source": 0, + "value": "31" + }, + { "begin": 400, "end": 441, "name": "JUMPI", "source": 0 }, + { + "begin": 400, + "end": 441, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 400, "end": 441, "name": "DUP1", "source": 0 }, + { "begin": 400, "end": 441, "name": "REVERT", "source": 0 }, + { + "begin": 400, + "end": 441, + "name": "tag", + "source": 0, + "value": "31" + }, + { "begin": 400, "end": 441, "name": "JUMPDEST", "source": 0 }, + { "begin": 400, "end": 441, "name": "POP", "source": 0 }, + { "begin": 400, "end": 441, "name": "GAS", "source": 0 }, + { "begin": 400, "end": 441, "name": "CALL", "source": 0 }, + { "begin": 400, "end": 441, "name": "SWAP3", "source": 0 }, + { "begin": 400, "end": 441, "name": "POP", "source": 0 }, + { "begin": 400, "end": 441, "name": "POP", "source": 0 }, + { "begin": 400, "end": 441, "name": "POP", "source": 0 }, + { "begin": 400, "end": 441, "name": "DUP1", "source": 0 }, + { "begin": 400, "end": 441, "name": "ISZERO", "source": 0 }, + { + "begin": 400, + "end": 441, + "name": "PUSH [tag]", + "source": 0, + "value": "32" + }, + { "begin": 400, "end": 441, "name": "JUMPI", "source": 0 }, + { "begin": 400, "end": 441, "name": "POP", "source": 0 }, + { + "begin": 400, + "end": 441, + "name": "PUSH", + "source": 0, + "value": "1" + }, + { + "begin": 400, + "end": 441, + "name": "tag", + "source": 0, + "value": "32" + }, + { "begin": 400, "end": 441, "name": "JUMPDEST", "source": 0 }, + { + "begin": 396, + "end": 455, + "name": "PUSH [tag]", + "source": 0, + "value": "33" + }, + { "begin": 396, "end": 455, "name": "JUMPI", "source": 0 }, + { + "begin": 396, + "end": 455, + "name": "PUSH [tag]", + "source": 0, + "value": "37" + }, + { "begin": 396, "end": 455, "name": "JUMP", "source": 0 }, + { + "begin": 396, + "end": 455, + "name": "tag", + "source": 0, + "value": "33" + }, + { "begin": 396, "end": 455, "name": "JUMPDEST", "source": 0 }, + { + "begin": 396, + "end": 455, + "name": "tag", + "source": 0, + "value": "37" + }, + { "begin": 396, "end": 455, "name": "JUMPDEST", "source": 0 }, + { "begin": 484, "end": 491, "name": "DUP2", "source": 0 }, + { + "begin": 472, + "end": 504, + "name": "PUSH", + "source": 0, + "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + }, + { "begin": 472, "end": 504, "name": "AND", "source": 0 }, + { + "begin": 472, + "end": 504, + "name": "PUSH", + "source": 0, + "value": "A885F4E3" + }, + { "begin": 505, "end": 512, "name": "DUP3", "source": 0 }, + { + "begin": 472, + "end": 513, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 472, "end": 513, "name": "MLOAD", "source": 0 }, + { "begin": 472, "end": 513, "name": "DUP3", "source": 0 }, + { + "begin": 472, + "end": 513, + "name": "PUSH", + "source": 0, + "value": "FFFFFFFF" + }, + { "begin": 472, "end": 513, "name": "AND", "source": 0 }, + { + "begin": 472, + "end": 513, + "name": "PUSH", + "source": 0, + "value": "E0" + }, + { "begin": 472, "end": 513, "name": "SHL", "source": 0 }, + { "begin": 472, "end": 513, "name": "DUP2", "source": 0 }, + { "begin": 472, "end": 513, "name": "MSTORE", "source": 0 }, + { + "begin": 472, + "end": 513, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { "begin": 472, "end": 513, "name": "ADD", "source": 0 }, + { + "begin": 472, + "end": 513, + "name": "PUSH [tag]", + "source": 0, + "value": "38" + }, + { "begin": 472, "end": 513, "name": "SWAP2", "source": 0 }, + { "begin": 472, "end": 513, "name": "SWAP1", "source": 0 }, + { + "begin": 472, + "end": 513, + "name": "PUSH [tag]", + "source": 0, + "value": "30" + }, + { + "begin": 472, + "end": 513, + "name": "JUMP", + "source": 0, + "value": "[in]" + }, + { + "begin": 472, + "end": 513, + "name": "tag", + "source": 0, + "value": "38" + }, + { "begin": 472, "end": 513, "name": "JUMPDEST", "source": 0 }, + { + "begin": 472, + "end": 513, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { + "begin": 472, + "end": 513, + "name": "PUSH", + "source": 0, + "value": "40" + }, + { "begin": 472, "end": 513, "name": "MLOAD", "source": 0 }, + { "begin": 472, "end": 513, "name": "DUP1", "source": 0 }, + { "begin": 472, "end": 513, "name": "DUP4", "source": 0 }, + { "begin": 472, "end": 513, "name": "SUB", "source": 0 }, + { "begin": 472, "end": 513, "name": "DUP2", "source": 0 }, + { + "begin": 472, + "end": 513, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 472, "end": 513, "name": "DUP8", "source": 0 }, + { "begin": 472, "end": 513, "name": "DUP1", "source": 0 }, + { "begin": 472, "end": 513, "name": "EXTCODESIZE", "source": 0 }, + { "begin": 472, "end": 513, "name": "ISZERO", "source": 0 }, + { "begin": 472, "end": 513, "name": "DUP1", "source": 0 }, + { "begin": 472, "end": 513, "name": "ISZERO", "source": 0 }, + { + "begin": 472, + "end": 513, + "name": "PUSH [tag]", + "source": 0, + "value": "39" + }, + { "begin": 472, "end": 513, "name": "JUMPI", "source": 0 }, + { + "begin": 472, + "end": 513, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { "begin": 472, "end": 513, "name": "DUP1", "source": 0 }, + { "begin": 472, "end": 513, "name": "REVERT", "source": 0 }, + { + "begin": 472, + "end": 513, + "name": "tag", + "source": 0, + "value": "39" + }, + { "begin": 472, "end": 513, "name": "JUMPDEST", "source": 0 }, + { "begin": 472, "end": 513, "name": "POP", "source": 0 }, + { "begin": 472, "end": 513, "name": "GAS", "source": 0 }, + { "begin": 472, "end": 513, "name": "CALL", "source": 0 }, + { "begin": 472, "end": 513, "name": "SWAP3", "source": 0 }, + { "begin": 472, "end": 513, "name": "POP", "source": 0 }, + { "begin": 472, "end": 513, "name": "POP", "source": 0 }, + { "begin": 472, "end": 513, "name": "POP", "source": 0 }, + { "begin": 472, "end": 513, "name": "DUP1", "source": 0 }, + { "begin": 472, "end": 513, "name": "ISZERO", "source": 0 }, + { + "begin": 472, + "end": 513, + "name": "PUSH [tag]", + "source": 0, + "value": "40" + }, + { "begin": 472, "end": 513, "name": "JUMPI", "source": 0 }, + { "begin": 472, "end": 513, "name": "POP", "source": 0 }, + { + "begin": 472, + "end": 513, + "name": "PUSH", + "source": 0, + "value": "1" + }, + { + "begin": 472, + "end": 513, + "name": "tag", + "source": 0, + "value": "40" + }, + { "begin": 472, "end": 513, "name": "JUMPDEST", "source": 0 }, + { + "begin": 468, + "end": 527, + "name": "PUSH [tag]", + "source": 0, + "value": "41" + }, + { "begin": 468, "end": 527, "name": "JUMPI", "source": 0 }, + { + "begin": 468, + "end": 527, + "name": "PUSH [tag]", + "source": 0, + "value": "45" + }, + { "begin": 468, "end": 527, "name": "JUMP", "source": 0 }, + { + "begin": 468, + "end": 527, + "name": "tag", + "source": 0, + "value": "41" + }, + { "begin": 468, "end": 527, "name": "JUMPDEST", "source": 0 }, + { + "begin": 468, + "end": 527, + "name": "tag", + "source": 0, + "value": "45" + }, + { "begin": 468, "end": 527, "name": "JUMPDEST", "source": 0 }, + { "begin": 323, "end": 537, "name": "POP", "source": 0 }, + { "begin": 323, "end": 537, "name": "POP", "source": 0 }, + { + "begin": 323, + "end": 537, + "name": "JUMP", + "source": 0, + "value": "[out]" + }, + { + "begin": 7, + "end": 146, + "name": "tag", + "source": 1, + "value": "47" + }, + { "begin": 7, "end": 146, "name": "JUMPDEST", "source": 1 }, + { + "begin": 7, + "end": 146, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 91, "end": 97, "name": "DUP2", "source": 1 }, + { "begin": 78, "end": 98, "name": "CALLDATALOAD", "source": 1 }, + { "begin": 69, "end": 98, "name": "SWAP1", "source": 1 }, + { "begin": 69, "end": 98, "name": "POP", "source": 1 }, + { + "begin": 107, + "end": 140, + "name": "PUSH [tag]", + "source": 1, + "value": "49" + }, + { "begin": 134, "end": 139, "name": "DUP2", "source": 1 }, + { + "begin": 107, + "end": 140, + "name": "PUSH [tag]", + "source": 1, + "value": "50" + }, + { + "begin": 107, + "end": 140, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 107, + "end": 140, + "name": "tag", + "source": 1, + "value": "49" + }, + { "begin": 107, "end": 140, "name": "JUMPDEST", "source": 1 }, + { "begin": 59, "end": 146, "name": "SWAP3", "source": 1 }, + { "begin": 59, "end": 146, "name": "SWAP2", "source": 1 }, + { "begin": 59, "end": 146, "name": "POP", "source": 1 }, + { "begin": 59, "end": 146, "name": "POP", "source": 1 }, + { + "begin": 59, + "end": 146, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 152, + "end": 414, + "name": "tag", + "source": 1, + "value": "11" + }, + { "begin": 152, "end": 414, "name": "JUMPDEST", "source": 1 }, + { + "begin": 152, + "end": 414, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 260, + "end": 262, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 248, "end": 257, "name": "DUP3", "source": 1 }, + { "begin": 239, "end": 246, "name": "DUP5", "source": 1 }, + { "begin": 235, "end": 258, "name": "SUB", "source": 1 }, + { "begin": 231, "end": 263, "name": "SLT", "source": 1 }, + { "begin": 228, "end": 230, "name": "ISZERO", "source": 1 }, + { + "begin": 228, + "end": 230, + "name": "PUSH [tag]", + "source": 1, + "value": "52" + }, + { "begin": 228, "end": 230, "name": "JUMPI", "source": 1 }, + { + "begin": 276, + "end": 277, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 273, "end": 274, "name": "DUP1", "source": 1 }, + { "begin": 266, "end": 278, "name": "REVERT", "source": 1 }, + { + "begin": 228, + "end": 230, + "name": "tag", + "source": 1, + "value": "52" + }, + { "begin": 228, "end": 230, "name": "JUMPDEST", "source": 1 }, + { + "begin": 319, + "end": 320, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 344, + "end": 397, + "name": "PUSH [tag]", + "source": 1, + "value": "53" + }, + { "begin": 389, "end": 396, "name": "DUP5", "source": 1 }, + { "begin": 380, "end": 386, "name": "DUP3", "source": 1 }, + { "begin": 369, "end": 378, "name": "DUP6", "source": 1 }, + { "begin": 365, "end": 387, "name": "ADD", "source": 1 }, + { + "begin": 344, + "end": 397, + "name": "PUSH [tag]", + "source": 1, + "value": "47" + }, + { + "begin": 344, + "end": 397, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 344, + "end": 397, + "name": "tag", + "source": 1, + "value": "53" + }, + { "begin": 344, "end": 397, "name": "JUMPDEST", "source": 1 }, + { "begin": 334, "end": 397, "name": "SWAP2", "source": 1 }, + { "begin": 334, "end": 397, "name": "POP", "source": 1 }, + { "begin": 290, "end": 407, "name": "POP", "source": 1 }, + { "begin": 218, "end": 414, "name": "SWAP3", "source": 1 }, + { "begin": 218, "end": 414, "name": "SWAP2", "source": 1 }, + { "begin": 218, "end": 414, "name": "POP", "source": 1 }, + { "begin": 218, "end": 414, "name": "POP", "source": 1 }, + { + "begin": 218, + "end": 414, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 420, + "end": 827, + "name": "tag", + "source": 1, + "value": "17" + }, + { "begin": 420, "end": 827, "name": "JUMPDEST", "source": 1 }, + { + "begin": 420, + "end": 827, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 420, "end": 827, "name": "DUP1", "source": 1 }, + { + "begin": 545, + "end": 547, + "name": "PUSH", + "source": 1, + "value": "40" + }, + { "begin": 533, "end": 542, "name": "DUP4", "source": 1 }, + { "begin": 524, "end": 531, "name": "DUP6", "source": 1 }, + { "begin": 520, "end": 543, "name": "SUB", "source": 1 }, + { "begin": 516, "end": 548, "name": "SLT", "source": 1 }, + { "begin": 513, "end": 515, "name": "ISZERO", "source": 1 }, + { + "begin": 513, + "end": 515, + "name": "PUSH [tag]", + "source": 1, + "value": "55" + }, + { "begin": 513, "end": 515, "name": "JUMPI", "source": 1 }, + { + "begin": 561, + "end": 562, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 558, "end": 559, "name": "DUP1", "source": 1 }, + { "begin": 551, "end": 563, "name": "REVERT", "source": 1 }, + { + "begin": 513, + "end": 515, + "name": "tag", + "source": 1, + "value": "55" + }, + { "begin": 513, "end": 515, "name": "JUMPDEST", "source": 1 }, + { + "begin": 604, + "end": 605, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 629, + "end": 682, + "name": "PUSH [tag]", + "source": 1, + "value": "56" + }, + { "begin": 674, "end": 681, "name": "DUP6", "source": 1 }, + { "begin": 665, "end": 671, "name": "DUP3", "source": 1 }, + { "begin": 654, "end": 663, "name": "DUP7", "source": 1 }, + { "begin": 650, "end": 672, "name": "ADD", "source": 1 }, + { + "begin": 629, + "end": 682, + "name": "PUSH [tag]", + "source": 1, + "value": "47" + }, + { + "begin": 629, + "end": 682, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 629, + "end": 682, + "name": "tag", + "source": 1, + "value": "56" + }, + { "begin": 629, "end": 682, "name": "JUMPDEST", "source": 1 }, + { "begin": 619, "end": 682, "name": "SWAP3", "source": 1 }, + { "begin": 619, "end": 682, "name": "POP", "source": 1 }, + { "begin": 575, "end": 692, "name": "POP", "source": 1 }, + { + "begin": 731, + "end": 733, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { + "begin": 757, + "end": 810, + "name": "PUSH [tag]", + "source": 1, + "value": "57" + }, + { "begin": 802, "end": 809, "name": "DUP6", "source": 1 }, + { "begin": 793, "end": 799, "name": "DUP3", "source": 1 }, + { "begin": 782, "end": 791, "name": "DUP7", "source": 1 }, + { "begin": 778, "end": 800, "name": "ADD", "source": 1 }, + { + "begin": 757, + "end": 810, + "name": "PUSH [tag]", + "source": 1, + "value": "47" + }, + { + "begin": 757, + "end": 810, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 757, + "end": 810, + "name": "tag", + "source": 1, + "value": "57" + }, + { "begin": 757, "end": 810, "name": "JUMPDEST", "source": 1 }, + { "begin": 747, "end": 810, "name": "SWAP2", "source": 1 }, + { "begin": 747, "end": 810, "name": "POP", "source": 1 }, + { "begin": 702, "end": 820, "name": "POP", "source": 1 }, + { "begin": 503, "end": 827, "name": "SWAP3", "source": 1 }, + { "begin": 503, "end": 827, "name": "POP", "source": 1 }, + { "begin": 503, "end": 827, "name": "SWAP3", "source": 1 }, + { "begin": 503, "end": 827, "name": "SWAP1", "source": 1 }, + { "begin": 503, "end": 827, "name": "POP", "source": 1 }, + { + "begin": 503, + "end": 827, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 833, + "end": 951, + "name": "tag", + "source": 1, + "value": "58" + }, + { "begin": 833, "end": 951, "name": "JUMPDEST", "source": 1 }, + { + "begin": 920, + "end": 944, + "name": "PUSH [tag]", + "source": 1, + "value": "60" + }, + { "begin": 938, "end": 943, "name": "DUP2", "source": 1 }, + { + "begin": 920, + "end": 944, + "name": "PUSH [tag]", + "source": 1, + "value": "61" + }, + { + "begin": 920, + "end": 944, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 920, + "end": 944, + "name": "tag", + "source": 1, + "value": "60" + }, + { "begin": 920, "end": 944, "name": "JUMPDEST", "source": 1 }, + { "begin": 915, "end": 918, "name": "DUP3", "source": 1 }, + { "begin": 908, "end": 945, "name": "MSTORE", "source": 1 }, + { "begin": 898, "end": 951, "name": "POP", "source": 1 }, + { "begin": 898, "end": 951, "name": "POP", "source": 1 }, + { + "begin": 898, + "end": 951, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 957, + "end": 1179, + "name": "tag", + "source": 1, + "value": "30" + }, + { "begin": 957, "end": 1179, "name": "JUMPDEST", "source": 1 }, + { + "begin": 957, + "end": 1179, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 1088, + "end": 1090, + "name": "PUSH", + "source": 1, + "value": "20" + }, + { "begin": 1077, "end": 1086, "name": "DUP3", "source": 1 }, + { "begin": 1073, "end": 1091, "name": "ADD", "source": 1 }, + { "begin": 1065, "end": 1091, "name": "SWAP1", "source": 1 }, + { "begin": 1065, "end": 1091, "name": "POP", "source": 1 }, + { + "begin": 1101, + "end": 1172, + "name": "PUSH [tag]", + "source": 1, + "value": "63" + }, + { + "begin": 1169, + "end": 1170, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1158, "end": 1167, "name": "DUP4", "source": 1 }, + { "begin": 1154, "end": 1171, "name": "ADD", "source": 1 }, + { "begin": 1145, "end": 1151, "name": "DUP5", "source": 1 }, + { + "begin": 1101, + "end": 1172, + "name": "PUSH [tag]", + "source": 1, + "value": "58" + }, + { + "begin": 1101, + "end": 1172, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1101, + "end": 1172, + "name": "tag", + "source": 1, + "value": "63" + }, + { "begin": 1101, "end": 1172, "name": "JUMPDEST", "source": 1 }, + { "begin": 1055, "end": 1179, "name": "SWAP3", "source": 1 }, + { "begin": 1055, "end": 1179, "name": "SWAP2", "source": 1 }, + { "begin": 1055, "end": 1179, "name": "POP", "source": 1 }, + { "begin": 1055, "end": 1179, "name": "POP", "source": 1 }, + { + "begin": 1055, + "end": 1179, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1185, + "end": 1281, + "name": "tag", + "source": 1, + "value": "61" + }, + { "begin": 1185, "end": 1281, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1185, + "end": 1281, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 1251, + "end": 1275, + "name": "PUSH [tag]", + "source": 1, + "value": "65" + }, + { "begin": 1269, "end": 1274, "name": "DUP3", "source": 1 }, + { + "begin": 1251, + "end": 1275, + "name": "PUSH [tag]", + "source": 1, + "value": "66" + }, + { + "begin": 1251, + "end": 1275, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1251, + "end": 1275, + "name": "tag", + "source": 1, + "value": "65" + }, + { "begin": 1251, "end": 1275, "name": "JUMPDEST", "source": 1 }, + { "begin": 1240, "end": 1275, "name": "SWAP1", "source": 1 }, + { "begin": 1240, "end": 1275, "name": "POP", "source": 1 }, + { "begin": 1230, "end": 1281, "name": "SWAP2", "source": 1 }, + { "begin": 1230, "end": 1281, "name": "SWAP1", "source": 1 }, + { "begin": 1230, "end": 1281, "name": "POP", "source": 1 }, + { + "begin": 1230, + "end": 1281, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1287, + "end": 1413, + "name": "tag", + "source": 1, + "value": "66" + }, + { "begin": 1287, "end": 1413, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1287, + "end": 1413, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { + "begin": 1364, + "end": 1406, + "name": "PUSH", + "source": 1, + "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + }, + { "begin": 1357, "end": 1362, "name": "DUP3", "source": 1 }, + { "begin": 1353, "end": 1407, "name": "AND", "source": 1 }, + { "begin": 1342, "end": 1407, "name": "SWAP1", "source": 1 }, + { "begin": 1342, "end": 1407, "name": "POP", "source": 1 }, + { "begin": 1332, "end": 1413, "name": "SWAP2", "source": 1 }, + { "begin": 1332, "end": 1413, "name": "SWAP1", "source": 1 }, + { "begin": 1332, "end": 1413, "name": "POP", "source": 1 }, + { + "begin": 1332, + "end": 1413, + "name": "JUMP", + "source": 1, + "value": "[out]" + }, + { + "begin": 1419, + "end": 1541, + "name": "tag", + "source": 1, + "value": "50" + }, + { "begin": 1419, "end": 1541, "name": "JUMPDEST", "source": 1 }, + { + "begin": 1492, + "end": 1516, + "name": "PUSH [tag]", + "source": 1, + "value": "69" + }, + { "begin": 1510, "end": 1515, "name": "DUP2", "source": 1 }, + { + "begin": 1492, + "end": 1516, + "name": "PUSH [tag]", + "source": 1, + "value": "61" + }, + { + "begin": 1492, + "end": 1516, + "name": "JUMP", + "source": 1, + "value": "[in]" + }, + { + "begin": 1492, + "end": 1516, + "name": "tag", + "source": 1, + "value": "69" + }, + { "begin": 1492, "end": 1516, "name": "JUMPDEST", "source": 1 }, + { "begin": 1485, "end": 1490, "name": "DUP2", "source": 1 }, + { "begin": 1482, "end": 1517, "name": "EQ", "source": 1 }, + { + "begin": 1472, + "end": 1474, + "name": "PUSH [tag]", + "source": 1, + "value": "70" + }, + { "begin": 1472, "end": 1474, "name": "JUMPI", "source": 1 }, + { + "begin": 1531, + "end": 1532, + "name": "PUSH", + "source": 1, + "value": "0" + }, + { "begin": 1528, "end": 1529, "name": "DUP1", "source": 1 }, + { "begin": 1521, "end": 1533, "name": "REVERT", "source": 1 }, + { + "begin": 1472, + "end": 1474, + "name": "tag", + "source": 1, + "value": "70" + }, + { "begin": 1472, "end": 1474, "name": "JUMPDEST", "source": 1 }, + { "begin": 1462, "end": 1541, "name": "POP", "source": 1 }, + { + "begin": 1462, + "end": 1541, + "name": "JUMP", + "source": 1, + "value": "[out]" + } + ] + } + } + }, + "methodIdentifiers": { + "call_ok()": "5eaf9bc1", + "call_revert()": "cb30e696", + "subcalls(address,address)": "f34f1610", + "subsubcalls(address)": "a885f4e3" + } + }, + "ewasm": { "wasm": "" }, + "metadata": "{\"compiler\":{\"version\":\"0.8.3+commit.8d00100c\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"should_revert\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"call_ok\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"call_revert\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"target1\",\"type\":\"address\"}],\"name\":\"subcalls\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target1\",\"type\":\"address\"}],\"name\":\"subsubcalls\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"main.sol\":\"TraceFilter\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"main.sol\":{\"keccak256\":\"0xf153bb9ac8a40ad2b947921abebad02891a26a7b8d73dbe03472330a1a669e83\",\"urls\":[\"bzz-raw://9180f7c6665f2ee8bb90a0ac0330a1df854a37186bfdf68d982995ae884da57c\",\"dweb:/ipfs/QmPcFyzXLPmF99Zjz4ytwYqw5rkKqumEoSHbDxruCdb2Av\"]}},\"version\":1}", + "storageLayout": { "storage": [], "types": null }, + "userdoc": { "kind": "user", "methods": {}, "version": 1 } + }, + "sourceCode": "\n pragma solidity >=0.8.0;\n contract TraceFilter {\n constructor(bool should_revert) {\n if (should_revert) {\n revert();\n }\n }\n \n function call_ok() public { }\n \n function call_revert() public {\n revert(); \n }\n \n function subcalls(address target0, address target1) public {\n try TraceFilter(target0).subsubcalls(target1) { } catch { }\n try TraceFilter(target0).subsubcalls(target1) { } catch { }\n }\n \n function subsubcalls(address target1) public {\n TraceFilter(target1).call_ok();\n TraceFilter(target1).call_revert();\n }\n }" +} diff --git a/tests/contracts/sources.ts b/tests/contracts/sources.ts new file mode 100644 index 00000000000..27c1b570c59 --- /dev/null +++ b/tests/contracts/sources.ts @@ -0,0 +1,288 @@ +export const contractSources: { [key: string]: string } = { + TestContract: ` + pragma solidity >=0.8.0; + + contract TestContract { + function multiply(uint a) public pure returns(uint d) { + return a *7; + } + }`, + FailContract: ` + pragma solidity >=0.8.0; + + contract FailContract { + constructor() public { + require(false); + } + }`, + // simple incremental count contract to test contract with state changes + TestContractIncr: ` + pragma solidity >=0.8.0; + + contract TestContractIncr { + uint public count; + + constructor() public { + count = 0; + } + + function incr() public { + count=count+1; + } + }`, + // infinite loop call + InfiniteContract: ` + pragma solidity >=0.8.0; + + contract InfiniteContract { + function infinite() public pure returns(uint d) {while (true) {}} + }`, + // infinite loop call with variable alocation + InfiniteContractVar: ` + pragma solidity >=0.8.0; + + contract InfiniteContractVar { + uint public count; + + constructor() public { + count = 0; + } + + function infinite() public { + while (true) { + count=count+1; + } + } + }`, + // definite loop call with variable alocation + FiniteLoopContract: ` + pragma solidity >=0.8.0; + + contract FiniteLoopContract { + uint public count; + + constructor() public { + count = 0; + } + + function incr(uint n) public { + uint i=0; + while (i=0.8.0; + + contract SingleEventContract { + event Constructed(address indexed owner); + + constructor() { + emit Constructed(msg.sender); + } + }`, + HashRipmd160: ` + pragma solidity >=0.8.0; + contract HashRipmd160 { + constructor() { + require(ripemd160(bytes ('Hello World!')) == + hex'8476ee4631b9b30ac2754b0ee0c47e161d3f724c'); + } + }`, + Bn128Addition: ` + pragma solidity >=0.8.0; + contract Bn128Addition{ + constructor() { + bool success; + uint256[4] memory input = [ + 0x2243525c5efd4b9c3d3c45ac0ca3fe4dd85e830a4ce6b65fa1eeaee202839703, + 0x301d1d33be6da8e509df21cc35964723180eed7532537db9ae5e7d48f195c915, + 0x18b18acfb4c2c30276db5411368e7185b311dd124691610c5d3b74034e093dc9, + 0x063c909c4720840cb5134cb9f59fa749755796819658d32efc0d288198f37266 + ]; + uint256[2] memory result; + + assembly { + // 0x06 id of the bn256Add precompile + // 0 number of ether to transfer + // 128 size of call parameters, i.e. 128 bytes total + // 64 size of return value, i.e. 64 bytes / 512 bit for a BN256 curve point + success := call(not(0), 0x06, 0, input, 128, result, 64) + } + require(success, "elliptic curve addition failed"); + require( + result[0] == + 0x2bd3e6d0f3b142924f5ca7b49ce5b9d54c4703d7ae5648e61d02268b1a0a9fb7, + "failed"); + require( + result[1] == + 0x21611ce0a6af85915e2f1d70300909ce2e49dfad4a4619c8390cae66cefdb204, + "failed"); + } + }`, + Bn128Multiply: ` + pragma solidity >=0.8.0; + contract Bn128Multiply{ + constructor() { + bool success; + uint256[3] memory input = [ + 0x1a87b0584ce92f4593d161480614f2989035225609f08058ccfa3d0f940febe3, + 0x1a2f3c951f6dadcc7ee9007dff81504b0fcd6d7cf59996efdc33d92bf7f9f8f6, + 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000000 + ]; + uint256[2] memory result; + + assembly { + // 0x07 id of the bn256Mul precompile + // 0 number of ether to transfer + // 96 size of call parameters, i.e. 128 bytes total + // 64 size of return value, i.e. 64 bytes / 512 bit for a BN256 curve point + success := call(not(0), 0x07, 0, input, 96, result, 64) + } + require(success, "elliptic curve addition failed"); + require( + result[0] == + 0x1a87b0584ce92f4593d161480614f2989035225609f08058ccfa3d0f940febe3, + "failed"); + require( + result[1] == + 0x163511ddc1c3f25d396745388200081287b3fd1472d8339d5fecb2eae0830451, + "failed"); + } + }`, + Bn128Pairing: ` + pragma solidity >=0.8.0; + contract Bn128Pairing { + constructor() { + uint256[12] memory input = [ + 0x2eca0c7238bf16e83e7a1e6c5d49540685ff51380f309842a98561558019fc02, + 0x03d3260361bb8451de5ff5ecd17f010ff22f5c31cdf184e9020b06fa5997db84, + 0x1213d2149b006137fcfb23036606f848d638d576a120ca981b5b1a5f9300b3ee, + 0x2276cf730cf493cd95d64677bbb75fc42db72513a4c1e387b476d056f80aa75f, + 0x21ee6226d31426322afcda621464d0611d226783262e21bb3bc86b537e986237, + 0x096df1f82dff337dd5972e32a8ad43e28a78a96a823ef1cd4debe12b6552ea5f, + 0x06967a1237ebfeca9aaae0d6d0bab8e28c198c5a339ef8a2407e31cdac516db9, + 0x22160fa257a5fd5b280642ff47b65eca77e626cb685c84fa6d3b6882a283ddd1, + 0x198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c2, + 0x1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed, + 0x090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b, + 0x12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa + ]; + uint256[1] memory result; + bool success; + assembly { + // 0x08 id of the bn256CheckPairing precompile + // 0 number of ether to transfer + // 0 since we have an array of fixed length, our input starts in 0 + // 384 size of call parameters, i.e. 12*256 bits == 384 bytes + // 32 size of result (one 32 byte boolean!) + success := call(sub(gas(), 2000), 0x08, 0, input, 384, result, 32) + } + require(success, "elliptic curve pairing failed"); + require(result[0] == 1, "failed"); + } + }`, + ModularCheck: ` + pragma solidity >=0.8.0; + contract ModularCheck { + // Verify simple modular exponentiation + constructor() { + require(modExp(3, 5, 7) == 5); + require(modExp(5, 7, 11) == 3); + } + // Wrapper function to use the precompile. + // Taken from https://ethereum.stackexchange.com/a/71590/9963 + function modExp(uint256 _b, uint256 _e, uint256 _m) public returns (uint256 result) { + assembly { + // Free memory pointer + let pointer := mload(0x40) + // Define length of base, exponent and modulus. 0x20 == 32 bytes + mstore(pointer, 0x20) + mstore(add(pointer, 0x20), 0x20) + mstore(add(pointer, 0x40), 0x20) + // Define variables base, exponent and modulus + mstore(add(pointer, 0x60), _b) + mstore(add(pointer, 0x80), _e) + + mstore(add(pointer, 0xa0), _m) + // Store the result + let value := mload(0xc0) + // Call the precompiled contract 0x05 = bigModExp + if iszero(call(not(0), 0x05, 0, pointer, 0xc0, value, 0x20)) { + revert(0, 0) + } + result := mload(value) + } + } + }`, + TraceFilter: ` + pragma solidity >=0.8.0; + contract TraceFilter { + constructor(bool should_revert) { + if (should_revert) { + revert(); + } + } + + function call_ok() public { } + + function call_revert() public { + revert(); + } + + function subcalls(address target0, address target1) public { + try TraceFilter(target0).subsubcalls(target1) { } catch { } + try TraceFilter(target0).subsubcalls(target1) { } catch { } + } + + function subsubcalls(address target1) public { + TraceFilter(target1).call_ok(); + TraceFilter(target1).call_revert(); + } + }`, + Callee: ` + pragma solidity >=0.8.0; + contract Callee { + uint public store; + function addtwo(uint _value) external returns (uint result) { + uint x = 7; + store = _value; + return _value + x; + } + }`, + Caller: ` + pragma solidity >=0.8.0; + interface Callee { + function addtwo(uint _value) external returns (uint result); + } + contract Caller { + Callee internal callee; + uint public store; + function someAction(address _addr, uint _number) public { + callee = Callee(_addr); + store = callee.addtwo(_number); + } + }`, + Incrementer: ` + pragma solidity >=0.8.0; + contract Incrementer { + uint256 number; + function sum(uint256 num) public returns (uint256){ + number += num; + return number; + } + }`, + CheckBlockGasLimit: ` + pragma solidity >=0.8.0; + contract CheckBlockGasLimit { + uint public gaslimit; + uint public chainid; + + constructor() { + gaslimit = block.gaslimit; + chainid = block.chainid; + } + }`, +}; diff --git a/tests/non_ci_tests/test-frontier.ts b/tests/non_ci_tests/test-frontier.ts index c6235de9548..22adf4101de 100644 --- a/tests/non_ci_tests/test-frontier.ts +++ b/tests/non_ci_tests/test-frontier.ts @@ -18,8 +18,6 @@ describeWithFrontier("Frontier RPC (Balance)", `frontier-specs.json`, (context) ); }); it("balance to be updated after transfer", async function () { - this.timeout(15000); - const tx = await context.web3.eth.accounts.signTransaction( { from: GENESIS_ACCOUNT, diff --git a/tests/package-lock.json b/tests/package-lock.json index 6980e4146f2..e90a782eb0c 100644 --- a/tests/package-lock.json +++ b/tests/package-lock.json @@ -13,19 +13,19 @@ } }, "@ethersproject/abi": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.0.7.tgz", - "integrity": "sha512-Cqktk+hSIckwP/W8O47Eef60VwmoSC/L3lY0+dIBhQPCNn9E4V7rwmm2aFrNRRDJfFlGuZ1khkQUOc3oBX+niw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.1.0.tgz", + "integrity": "sha512-N/W9Sbn1/C6Kh2kuHRjf/hX6euMK4+9zdJRBB8sDWmihVntjUAfxbusGZKzDQD8i3szAHhTz8K7XADV5iFNfJw==", "requires": { - "@ethersproject/address": "^5.0.4", - "@ethersproject/bignumber": "^5.0.7", - "@ethersproject/bytes": "^5.0.4", - "@ethersproject/constants": "^5.0.4", - "@ethersproject/hash": "^5.0.4", - "@ethersproject/keccak256": "^5.0.3", - "@ethersproject/logger": "^5.0.5", - "@ethersproject/properties": "^5.0.3", - "@ethersproject/strings": "^5.0.4" + "@ethersproject/address": "^5.1.0", + "@ethersproject/bignumber": "^5.1.0", + "@ethersproject/bytes": "^5.1.0", + "@ethersproject/constants": "^5.1.0", + "@ethersproject/hash": "^5.1.0", + "@ethersproject/keccak256": "^5.1.0", + "@ethersproject/logger": "^5.1.0", + "@ethersproject/properties": "^5.1.0", + "@ethersproject/strings": "^5.1.0" } }, "@ethersproject/abstract-provider": { @@ -110,9 +110,9 @@ } }, "@ethersproject/contracts": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.1.0.tgz", - "integrity": "sha512-dvTMs/4XGSc57cYOW0KjgX1NdTujUu7mNb6PQdJWg08m9ULzPyGZuBkFJnijBcp6vTOCQ59RwjboWgNWw393og==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.1.1.tgz", + "integrity": "sha512-6WwktLJ0DFWU8pDkgH4IGttQHhQN4SnwKFu9h+QYVe48VGWtbDu4W8/q/7QA1u/HWlWMrKxqawPiZUJj0UMvOw==", "requires": { "@ethersproject/abi": "^5.1.0", "@ethersproject/abstract-provider": "^5.1.0", @@ -124,29 +124,6 @@ "@ethersproject/logger": "^5.1.0", "@ethersproject/properties": "^5.1.0", "@ethersproject/transactions": "^5.1.0" - }, - "dependencies": { - "@ethersproject/abi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.1.0.tgz", - "integrity": "sha512-N/W9Sbn1/C6Kh2kuHRjf/hX6euMK4+9zdJRBB8sDWmihVntjUAfxbusGZKzDQD8i3szAHhTz8K7XADV5iFNfJw==", - "requires": { - "@ethersproject/address": "^5.1.0", - "@ethersproject/bignumber": "^5.1.0", - "@ethersproject/bytes": "^5.1.0", - "@ethersproject/constants": "^5.1.0", - "@ethersproject/hash": "^5.1.0", - "@ethersproject/keccak256": "^5.1.0", - "@ethersproject/logger": "^5.1.0", - "@ethersproject/properties": "^5.1.0", - "@ethersproject/strings": "^5.1.0" - } - }, - "js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" - } } }, "@ethersproject/hash": { @@ -181,13 +158,6 @@ "@ethersproject/strings": "^5.1.0", "@ethersproject/transactions": "^5.1.0", "@ethersproject/wordlists": "^5.1.0" - }, - "dependencies": { - "js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" - } } }, "@ethersproject/json-wallets": { @@ -208,13 +178,6 @@ "@ethersproject/transactions": "^5.1.0", "aes-js": "3.0.0", "scrypt-js": "3.0.1" - }, - "dependencies": { - "js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" - } } }, "@ethersproject/keccak256": { @@ -264,9 +227,9 @@ } }, "@ethersproject/providers": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.1.0.tgz", - "integrity": "sha512-FjpZL2lSXrYpQDg2fMjugZ0HjQD9a+2fOOoRhhihh+Z+qi/xZ8vIlPoumrEP1DzIG4DBV6liUqLNqnX2C6FIAA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.1.1.tgz", + "integrity": "sha512-+xWqQh4eLnAePRR5CHSySCVke//NxGSuQEUzGTdDtt0yCbizwlKGm7CrsU0zF8JUcKDrDh36ezzTicOMd5sl9w==", "requires": { "@ethersproject/abstract-provider": "^5.1.0", "@ethersproject/abstract-signer": "^5.1.0", @@ -287,18 +250,6 @@ "@ethersproject/web": "^5.1.0", "bech32": "1.1.4", "ws": "7.2.3" - }, - "dependencies": { - "js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" - }, - "ws": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.3.tgz", - "integrity": "sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ==" - } } }, "@ethersproject/random": { @@ -362,13 +313,6 @@ "@ethersproject/keccak256": "^5.1.0", "@ethersproject/sha2": "^5.1.0", "@ethersproject/strings": "^5.1.0" - }, - "dependencies": { - "js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" - } } }, "@ethersproject/strings": { @@ -382,9 +326,9 @@ } }, "@ethersproject/transactions": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.1.0.tgz", - "integrity": "sha512-s10crRLZEA0Bgv6FGEl/AKkTw9f+RVUrlWDX1rHnD4ZncPFeiV2AJr4nT7QSUhxJdFPvjyKRDb3nEH27dIqcPQ==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.1.1.tgz", + "integrity": "sha512-Nwgbp09ttIVN0OoUBatCXaHxR7grWPHbozJN8v7AXDLrl6nnOIBEMDh+yJTnosSQlFhcyjfTGGN+Mx6R8HdvMw==", "requires": { "@ethersproject/address": "^5.1.0", "@ethersproject/bignumber": "^5.1.0", @@ -427,13 +371,6 @@ "@ethersproject/signing-key": "^5.1.0", "@ethersproject/transactions": "^5.1.0", "@ethersproject/wordlists": "^5.1.0" - }, - "dependencies": { - "js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" - } } }, "@ethersproject/web": { @@ -458,144 +395,137 @@ "@ethersproject/logger": "^5.1.0", "@ethersproject/properties": "^5.1.0", "@ethersproject/strings": "^5.1.0" - }, - "dependencies": { - "js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" - } } }, "@polkadot/api": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-4.4.1.tgz", - "integrity": "sha512-r/zpFYVebp6TYE5SjEH9eYNFQEq4IzNYM6rM65d0nPCbXFVmpzY5hsqPUhiRL6+drdhEO47pgxAow+60Pdx1fg==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-4.6.2.tgz", + "integrity": "sha512-QGLD+K/IcmYIMZklxM//1SUW4s83CHiSm5wplz2Lmasy6uEnM14UGdJ2O9MbObb9ZopSBNsLsMfnvM3JePQ44w==", "requires": { "@babel/runtime": "^7.13.10", - "@polkadot/api-derive": "4.4.1", - "@polkadot/keyring": "^6.0.5", - "@polkadot/metadata": "4.4.1", - "@polkadot/rpc-core": "4.4.1", - "@polkadot/rpc-provider": "4.4.1", - "@polkadot/types": "4.4.1", - "@polkadot/types-known": "4.4.1", - "@polkadot/util": "^6.0.5", - "@polkadot/util-crypto": "^6.0.5", - "@polkadot/x-rxjs": "^6.0.5", + "@polkadot/api-derive": "4.6.2", + "@polkadot/keyring": "^6.2.1", + "@polkadot/metadata": "4.6.2", + "@polkadot/rpc-core": "4.6.2", + "@polkadot/rpc-provider": "4.6.2", + "@polkadot/types": "4.6.2", + "@polkadot/types-known": "4.6.2", + "@polkadot/util": "^6.2.1", + "@polkadot/util-crypto": "^6.2.1", + "@polkadot/x-rxjs": "^6.2.1", "bn.js": "^4.11.9", "eventemitter3": "^4.0.7" } }, "@polkadot/api-derive": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-4.4.1.tgz", - "integrity": "sha512-N+U4S2zT4W9UNaJpOlEn8kvUnchiqvfYXnD1CXhxbn8yLo3jMW/WNJ8KksxxW2jg3RGW24slYVARvYFHBrlFYQ==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-4.6.2.tgz", + "integrity": "sha512-wDcg4qOo0uWJrUoDadApJnPApZbzJSq8huXokbev4AfaGGN8HDnW3XesOBfhW7S1Fga0ZJZMXkrVyrfQH1UzyA==", "requires": { "@babel/runtime": "^7.13.10", - "@polkadot/api": "4.4.1", - "@polkadot/rpc-core": "4.4.1", - "@polkadot/types": "4.4.1", - "@polkadot/util": "^6.0.5", - "@polkadot/util-crypto": "^6.0.5", - "@polkadot/x-rxjs": "^6.0.5", + "@polkadot/api": "4.6.2", + "@polkadot/rpc-core": "4.6.2", + "@polkadot/types": "4.6.2", + "@polkadot/util": "^6.2.1", + "@polkadot/util-crypto": "^6.2.1", + "@polkadot/x-rxjs": "^6.2.1", "bn.js": "^4.11.9" } }, "@polkadot/keyring": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/@polkadot/keyring/-/keyring-6.0.5.tgz", - "integrity": "sha512-v9Tmu+eGZnWpLzxHUj5AIvmfX0uCHWShtF90zvaLvMXLFRWfeuaFnZwdZ+fNkXsrbI0R/w1gRtpFqzsT7QUbVw==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/keyring/-/keyring-6.2.1.tgz", + "integrity": "sha512-0suOIagCC6p6fJw3pEZaXpDP1tPXDGUIQXZaArh+t+TKAG5OJ2HUmeGv3FeiljGnnI7iZmrjrrshx1GSp0B+gA==", "requires": { - "@babel/runtime": "^7.13.9", - "@polkadot/util": "6.0.5", - "@polkadot/util-crypto": "6.0.5" + "@babel/runtime": "^7.13.10", + "@polkadot/util": "6.2.1", + "@polkadot/util-crypto": "6.2.1" } }, "@polkadot/metadata": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/@polkadot/metadata/-/metadata-4.4.1.tgz", - "integrity": "sha512-rkOaB90BkYvWLc1gKfY4/hGtXriWi/8LmopDV241on9ED5q8gvD5gX8gamrHeK7p0IDvUELkP35/0zyKpK2ihw==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/metadata/-/metadata-4.6.2.tgz", + "integrity": "sha512-0v1j0xenHed06sUI8RbWspbSvPH38z4F8RzS4h24z5PaWq4sKwTSqXJjBAeYNRDYSX8WyTACUZsrWinfTQivHA==", "requires": { "@babel/runtime": "^7.13.10", - "@polkadot/types": "4.4.1", - "@polkadot/types-known": "4.4.1", - "@polkadot/util": "^6.0.5", - "@polkadot/util-crypto": "^6.0.5", + "@polkadot/types": "4.6.2", + "@polkadot/types-known": "4.6.2", + "@polkadot/util": "^6.2.1", + "@polkadot/util-crypto": "^6.2.1", "bn.js": "^4.11.9" } }, "@polkadot/networks": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-6.0.5.tgz", - "integrity": "sha512-QSa5RdK43yD4kLsZ6tXIB652bZircaVPOpsZ5JFzxCM4gdxHCSCUeXNVBeh3uqeB3FOZZYzSYeoZHLaXuT3yJw==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-6.2.1.tgz", + "integrity": "sha512-q6qJ5UWea+NICg5tX3cLhBPsfUvQnE4SLnux66zfZcnRdhKNqw34dd2SrVdAW1oIYOm36br/wyQ8oK/MP5URiw==", "requires": { - "@babel/runtime": "^7.13.9" + "@babel/runtime": "^7.13.10" } }, "@polkadot/rpc-core": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-4.4.1.tgz", - "integrity": "sha512-tDN6qt0LYbslHVS4iTlssNaqv5Zepe9do0Edew6oa7b4wAr5zmXbsyhlVQFgaPvi/whNjpcyRF2ZYxhGbEkd6Q==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-4.6.2.tgz", + "integrity": "sha512-WHfDtTJANxT8SPiOy+619Z9vd6HvbQe7XPo6Dv7WCqcMdBRmF1ZDb28UEoT+5fasixe8rVADek5536NOkbqXBQ==", "requires": { "@babel/runtime": "^7.13.10", - "@polkadot/metadata": "4.4.1", - "@polkadot/rpc-provider": "4.4.1", - "@polkadot/types": "4.4.1", - "@polkadot/util": "^6.0.5", - "@polkadot/x-rxjs": "^6.0.5" + "@polkadot/metadata": "4.6.2", + "@polkadot/rpc-provider": "4.6.2", + "@polkadot/types": "4.6.2", + "@polkadot/util": "^6.2.1", + "@polkadot/x-rxjs": "^6.2.1" } }, "@polkadot/rpc-provider": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-4.4.1.tgz", - "integrity": "sha512-6v4iAkFzbeCLaCBvsTVTSyCy+Fp7AzMKySpdB4g/+MG8dupqts5f2BDmlnMFHBlNBDantVpJoMTvfvLfLxJz7g==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-4.6.2.tgz", + "integrity": "sha512-yCdBCQWhQ/RS8ooUAN67w2OZarFI+TrQ196j2LmVacKPjT8+fxXOIcqKwQs+6pYh0svX3v6FJINOc0c9B87tZw==", "requires": { "@babel/runtime": "^7.13.10", - "@polkadot/types": "4.4.1", - "@polkadot/util": "^6.0.5", - "@polkadot/util-crypto": "^6.0.5", - "@polkadot/x-fetch": "^6.0.5", - "@polkadot/x-global": "^6.0.5", - "@polkadot/x-ws": "^6.0.5", + "@polkadot/types": "4.6.2", + "@polkadot/util": "^6.2.1", + "@polkadot/util-crypto": "^6.2.1", + "@polkadot/x-fetch": "^6.2.1", + "@polkadot/x-global": "^6.2.1", + "@polkadot/x-ws": "^6.2.1", "bn.js": "^4.11.9", "eventemitter3": "^4.0.7" } }, "@polkadot/types": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-4.4.1.tgz", - "integrity": "sha512-sP0yqAKmv4WcFYX3fGdZ2xFaLAo1dcTY9gSL4twnG1TYBh1FT9fTux1d0d46VSPM6/+fbTV/HSIBa6wSETRHUQ==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-4.6.2.tgz", + "integrity": "sha512-iH/fdrFmO8qgZmJwRPgYM2AZWde6Et2mlNLejWm9gwqxsTy/2c/Jgf3pWyNqiy46tQOfIeJSwfiVWgRaju9nmA==", "requires": { "@babel/runtime": "^7.13.10", - "@polkadot/metadata": "4.4.1", - "@polkadot/util": "^6.0.5", - "@polkadot/util-crypto": "^6.0.5", - "@polkadot/x-rxjs": "^6.0.5", + "@polkadot/metadata": "4.6.2", + "@polkadot/util": "^6.2.1", + "@polkadot/util-crypto": "^6.2.1", + "@polkadot/x-rxjs": "^6.2.1", "@types/bn.js": "^4.11.6", "bn.js": "^4.11.9" } }, "@polkadot/types-known": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-4.4.1.tgz", - "integrity": "sha512-JPRqRnwxTweDZMWVg+vjFLK2xB3dsJsBUcUGoL96KH8klywk5m07JueRYdNuWhnZ77OloSo+0FvLWC83oBhBfg==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-4.6.2.tgz", + "integrity": "sha512-rRrs9z1Jz6KdV/j26e7PeSy3TcNVbQ7ESwJhouCF9WDeHzam9eACTJY3eZoYBVEXwthUK9OyyzcJQFhjJyumoQ==", "requires": { "@babel/runtime": "^7.13.10", - "@polkadot/networks": "^6.0.5", - "@polkadot/types": "4.4.1", - "@polkadot/util": "^6.0.5", + "@polkadot/networks": "^6.2.1", + "@polkadot/types": "4.6.2", + "@polkadot/util": "^6.2.1", "bn.js": "^4.11.9" } }, "@polkadot/util": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-6.0.5.tgz", - "integrity": "sha512-0EnYdGAXx/Y2MLgCKtlfdKVcURV+Twx+M+auljTeMK8226pR7xMblYuVuO5bxhPWBa1W7+iQloEZ0VRQrIoMDw==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-6.2.1.tgz", + "integrity": "sha512-+r70J4s7b0Mmdz4AxQPO2wYbTJ9/hbKXbtLQzjz7X7T7PcKqWHDzue+b3CGgGq65n2My4PEzVw7qHGAyPdtRVw==", "requires": { - "@babel/runtime": "^7.13.9", - "@polkadot/x-textdecoder": "6.0.5", - "@polkadot/x-textencoder": "6.0.5", + "@babel/runtime": "^7.13.10", + "@polkadot/x-textdecoder": "6.2.1", + "@polkadot/x-textencoder": "6.2.1", "@types/bn.js": "^4.11.6", "bn.js": "^4.11.9", "camelcase": "^5.3.1", @@ -603,15 +533,15 @@ } }, "@polkadot/util-crypto": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-6.0.5.tgz", - "integrity": "sha512-NlzmZzJ1vq2bjnQUU0MUocaT9vuIBGTlB/XCrCw94MyYqX19EllkOKLVMgu6o89xhYeP5rmASRQvTx9ZL9EzRw==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-6.2.1.tgz", + "integrity": "sha512-tj1FsIQoQdXZpGnnptqhoY2aJkHQWHMy6une2CG9qEZ4Ur8X64Yg6sh1DyOgiXjORf3iGlTBed+7zDWXIp0Nxw==", "requires": { - "@babel/runtime": "^7.13.9", - "@polkadot/networks": "6.0.5", - "@polkadot/util": "6.0.5", + "@babel/runtime": "^7.13.10", + "@polkadot/networks": "6.2.1", + "@polkadot/util": "6.2.1", "@polkadot/wasm-crypto": "^4.0.2", - "@polkadot/x-randomvalues": "6.0.5", + "@polkadot/x-randomvalues": "6.2.1", "base-x": "^3.0.8", "base64-js": "^1.5.1", "blakejs": "^1.1.0", @@ -652,71 +582,71 @@ } }, "@polkadot/x-fetch": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/@polkadot/x-fetch/-/x-fetch-6.0.5.tgz", - "integrity": "sha512-LuyIxot8pLnYaYsR1xok7Bjm+s7wxYe27Y66THea6bDL3CrBPQdj74F9i0OIxD1GB+qJqh4mDApiGX3COqssvg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-fetch/-/x-fetch-6.2.1.tgz", + "integrity": "sha512-CnPGO/GlqmGPp/BGmMBmW1NKrwZJqVilMmxzSp85XbyxcK3QlRZDU5TtQ1r1MKAEfutLapqX9Ki8S+jzK4GRuA==", "requires": { - "@babel/runtime": "^7.13.9", - "@polkadot/x-global": "6.0.5", - "@types/node-fetch": "^2.5.8", + "@babel/runtime": "^7.13.10", + "@polkadot/x-global": "6.2.1", + "@types/node-fetch": "^2.5.10", "node-fetch": "^2.6.1" } }, "@polkadot/x-global": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-6.0.5.tgz", - "integrity": "sha512-KjQvICngNdB2Gno0TYJlgjKI0Ia0NPhN1BG6YzcKLO/5ZNzNHkLmowdNb5gprE8uCBnOFXXHwgZAE/nTYya2dg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-6.2.1.tgz", + "integrity": "sha512-j1Hg9ZIujvXjNnTtbWio6E5YX8hMb9zfBq/vevlNa0OrMsCadqEFaM4poMhfYcjFSenSsZlnIBvqfP0zOx8w+A==", "requires": { - "@babel/runtime": "^7.13.9", - "@types/node-fetch": "^2.5.8", + "@babel/runtime": "^7.13.10", + "@types/node-fetch": "^2.5.10", "node-fetch": "^2.6.1" } }, "@polkadot/x-randomvalues": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/@polkadot/x-randomvalues/-/x-randomvalues-6.0.5.tgz", - "integrity": "sha512-MZK6+35vk7hnLW+Jciu5pNwMOkaCRNdsTVfNimzaJpIi6hN27y1X2oD82SRln0X4mKh370eLbvP8i3ylOzWnww==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-randomvalues/-/x-randomvalues-6.2.1.tgz", + "integrity": "sha512-l9K6W44i62e2i5nKJ3/E/f1pd8yuVaMvbf1A4wuvLCgZv37vH1+dZrdSnHXN6i/ZuuixjlmqUNrBW8Bu9HZLpg==", "requires": { - "@babel/runtime": "^7.13.9", - "@polkadot/x-global": "6.0.5" + "@babel/runtime": "^7.13.10", + "@polkadot/x-global": "6.2.1" } }, "@polkadot/x-rxjs": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/@polkadot/x-rxjs/-/x-rxjs-6.0.5.tgz", - "integrity": "sha512-nwMaP69/RzdXbPn8XypIRagMpW46waSraQq4/tGb4h+/Qob+RHxCT68UHKz1gp7kzxhrf85LanE9410A6EYjRw==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-rxjs/-/x-rxjs-6.2.1.tgz", + "integrity": "sha512-NcGC/GKZnbEz2FTdvGiJICfQW+J4wGrK1EAJSjwz2VY/st9SrQOIH1Uzq98Evx1lP8wmmL3RLDw7aNxDUE+rrA==", "requires": { - "@babel/runtime": "^7.13.9", - "rxjs": "^6.6.6" + "@babel/runtime": "^7.13.10", + "rxjs": "^6.6.7" } }, "@polkadot/x-textdecoder": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-6.0.5.tgz", - "integrity": "sha512-Vd2OftcEYxg2jG37lJw5NcZotnOidinN84m1HJszLIQT9vZDnFfN60gobHsuzHaGjEDexe4wqe0PfbgA4MfWIQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-6.2.1.tgz", + "integrity": "sha512-fS8CeQGWSWvUyJXleHWGfP4T8Uv4IOWfSdP8+zQE0E++wMR7ZDQqFIHPdMEoj35YKwEGGscAU1GTEz1V/H5brA==", "requires": { - "@babel/runtime": "^7.13.9", - "@polkadot/x-global": "6.0.5" + "@babel/runtime": "^7.13.10", + "@polkadot/x-global": "6.2.1" } }, "@polkadot/x-textencoder": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-6.0.5.tgz", - "integrity": "sha512-wAheP9/kzpfBw5uU/jCnHtd9uN9XzUPYH81aPbx3X026dXNMa4xpOoroCfEuNu2RtFXm0ONuYfpHxvHUsst9lA==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-6.2.1.tgz", + "integrity": "sha512-uhmY+SGaC5zkOl2Q9YXlWi5Y2FZu3UCezOs8rjwH1N2kP/OdCML1WeSrga4l763DS0xmhLL4B89OGVcX6i4ijA==", "requires": { - "@babel/runtime": "^7.13.9", - "@polkadot/x-global": "6.0.5" + "@babel/runtime": "^7.13.10", + "@polkadot/x-global": "6.2.1" } }, "@polkadot/x-ws": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/@polkadot/x-ws/-/x-ws-6.0.5.tgz", - "integrity": "sha512-J2vUfDjWIwEB/FSIXKZxER2flWqRvWcxvAaN+w6dhxJw8BKl+NYKN8QRrlhcDvbk/PWEEtdjthwV3lyOoeGDLA==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-ws/-/x-ws-6.2.1.tgz", + "integrity": "sha512-n2dVOak1xlLEyBrTygP+Njt9WYVORQGpXeMlqTcRbgJSeYChS8WqCgLUyVzfkqeuYPeS1gG2Op7m2Rxx9Ve9Nw==", "requires": { - "@babel/runtime": "^7.13.9", - "@polkadot/x-global": "6.0.5", + "@babel/runtime": "^7.13.10", + "@polkadot/x-global": "6.2.1", "@types/websocket": "^1.0.2", - "websocket": "^1.0.33" + "websocket": "^1.0.34" } }, "@sindresorhus/is": { @@ -741,9 +671,9 @@ } }, "@types/chai": { - "version": "4.2.15", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.15.tgz", - "integrity": "sha512-rYff6FI+ZTKAPkJUoyz7Udq3GaoDZnxYDEvdEdFZASiA7PoErltHezDishqQiSDWrGxvxmplH304jyzQmjp0AQ==" + "version": "4.2.16", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.16.tgz", + "integrity": "sha512-vI5iOAsez9+roLS3M3+Xx7w+WRuDtSmF8bQkrbcIJ2sC1PcDgVoA0WGpa+bIrJ+y8zqY2oi//fUctkxtIcXJCw==" }, "@types/mocha": { "version": "8.2.2", @@ -751,14 +681,14 @@ "integrity": "sha512-Lwh0lzzqT5Pqh6z61P3c3P5nm6fzQK/MMHl9UKeneAeInVflBSz1O2EkX6gM6xfJd7FBXBY5purtLx7fUiZ7Hw==" }, "@types/node": { - "version": "14.14.28", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.28.tgz", - "integrity": "sha512-lg55ArB+ZiHHbBBttLpzD07akz0QPrZgUODNakeC09i62dnrywr9mFErHuaPlB6I7z+sEbK+IYmplahvplCj2g==" + "version": "14.14.41", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.41.tgz", + "integrity": "sha512-dueRKfaJL4RTtSa7bWeTK1M+VH+Gns73oCgzvYfHZywRCoPSd8EkXBL0mZ9unPTveBn+D9phZBaxuzpwjWkW0g==" }, "@types/node-fetch": { - "version": "2.5.8", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.8.tgz", - "integrity": "sha512-fbjI6ja0N5ZA8TV53RUqzsKNkl9fv8Oj3T7zxW7FGv1GSH7gwJaNF8dzCjrqKaxKeUpTz4yT1DaJFq/omNpGfw==", + "version": "2.5.10", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.10.tgz", + "integrity": "sha512-IpkX0AasN44hgEad0gEF/V6EgR5n69VEqPEgnmoM8GsIGro3PowbWs4tR6IhxUTyPLpOn+fiGG6nrQhcmoCuIQ==", "requires": { "@types/node": "*", "form-data": "^3.0.0" @@ -773,9 +703,9 @@ } }, "@types/secp256k1": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.1.tgz", - "integrity": "sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.2.tgz", + "integrity": "sha512-QMg+9v0bbNJ2peLuHRWxzmy0HRJIG6gFZNhaRSp7S3ggSbCCxiqQB2/ybvhXyhHOCequpNkrx7OavNhrWOsW0A==", "requires": { "@types/node": "*" } @@ -793,6 +723,11 @@ "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==" }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, "accepts": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", @@ -818,6 +753,44 @@ "uri-js": "^4.2.2" } }, + "ansi-align": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", + "integrity": "sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==", + "requires": { + "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, "ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", @@ -837,9 +810,9 @@ } }, "anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", "requires": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -923,9 +896,9 @@ "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" }, "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "base-x": { "version": "3.0.8", @@ -981,9 +954,9 @@ "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" }, "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, "body-parser": { "version": "1.19.0", @@ -1002,6 +975,68 @@ "type-is": "~1.6.17" } }, + "boxen": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-4.2.0.tgz", + "integrity": "sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ==", + "requires": { + "ansi-align": "^3.0.0", + "camelcase": "^5.3.1", + "chalk": "^3.0.0", + "cli-boxes": "^2.2.0", + "string-width": "^4.1.0", + "term-size": "^2.1.0", + "type-fest": "^0.8.1", + "widest-line": "^3.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -1262,6 +1297,11 @@ "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==" + }, "cids": { "version": "0.7.5", "resolved": "https://registry.npmjs.org/cids/-/cids-0.7.5.tgz", @@ -1299,6 +1339,11 @@ "resolved": "https://registry.npmjs.org/class-is/-/class-is-1.1.0.tgz", "integrity": "sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw==" }, + "cli-boxes": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", + "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==" + }, "cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -1368,11 +1413,34 @@ "delayed-stream": "~1.0.0" } }, + "command-exists": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", + "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==" + }, + "commander": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", + "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==" + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, + "configstore": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", + "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", + "requires": { + "dot-prop": "^5.2.0", + "graceful-fs": "^4.1.2", + "make-dir": "^3.0.0", + "unique-string": "^2.0.0", + "write-file-atomic": "^3.0.0", + "xdg-basedir": "^4.0.0" + } + }, "content-disposition": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", @@ -1489,6 +1557,11 @@ "randomfill": "^1.0.3" } }, + "crypto-random-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==" + }, "cuint": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/cuint/-/cuint-0.2.2.tgz", @@ -1545,6 +1618,16 @@ "type-detect": "^4.0.0" } }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" + }, "defer-to-connect": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", @@ -1602,6 +1685,14 @@ "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz", "integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==" }, + "dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "requires": { + "is-obj": "^2.0.0" + } + }, "duplexer3": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", @@ -1720,6 +1811,11 @@ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" }, + "escape-goat": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", + "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==" + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -1762,6 +1858,23 @@ "servify": "^0.1.12", "ws": "^3.0.0", "xhr-request-promise": "^0.1.2" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "ws": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", + "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", + "requires": { + "async-limiter": "~1.0.0", + "safe-buffer": "~5.1.0", + "ultron": "~1.1.0" + } + } } }, "ethereum-bloom-filters": { @@ -1823,9 +1936,9 @@ } }, "ethers": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.1.0.tgz", - "integrity": "sha512-2L6Ge6wMBw02FlRoCLg4E0Elt3khMNlW6ULawa10mMeeZToYJ5+uCfiuTuB+XZ6om1Y7wuO9ZzezP8FsU2M/+g==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.1.2.tgz", + "integrity": "sha512-yM+2bINj7Li9jeKX+hGZ/rFTo6kXcCwZTcCBmAwS+J3bLfyGX/o21fcssuPb9kfR26suCV+98XTWIuTuGiDO5A==", "requires": { "@ethersproject/abi": "5.1.0", "@ethersproject/abstract-provider": "5.1.0", @@ -1836,7 +1949,7 @@ "@ethersproject/bignumber": "5.1.0", "@ethersproject/bytes": "5.1.0", "@ethersproject/constants": "5.1.0", - "@ethersproject/contracts": "5.1.0", + "@ethersproject/contracts": "5.1.1", "@ethersproject/hash": "5.1.0", "@ethersproject/hdnode": "5.1.0", "@ethersproject/json-wallets": "5.1.0", @@ -1845,41 +1958,18 @@ "@ethersproject/networks": "5.1.0", "@ethersproject/pbkdf2": "5.1.0", "@ethersproject/properties": "5.1.0", - "@ethersproject/providers": "5.1.0", + "@ethersproject/providers": "5.1.1", "@ethersproject/random": "5.1.0", "@ethersproject/rlp": "5.1.0", "@ethersproject/sha2": "5.1.0", "@ethersproject/signing-key": "5.1.0", "@ethersproject/solidity": "5.1.0", "@ethersproject/strings": "5.1.0", - "@ethersproject/transactions": "5.1.0", + "@ethersproject/transactions": "5.1.1", "@ethersproject/units": "5.1.0", "@ethersproject/wallet": "5.1.0", "@ethersproject/web": "5.1.0", "@ethersproject/wordlists": "5.1.0" - }, - "dependencies": { - "@ethersproject/abi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.1.0.tgz", - "integrity": "sha512-N/W9Sbn1/C6Kh2kuHRjf/hX6euMK4+9zdJRBB8sDWmihVntjUAfxbusGZKzDQD8i3szAHhTz8K7XADV5iFNfJw==", - "requires": { - "@ethersproject/address": "^5.1.0", - "@ethersproject/bignumber": "^5.1.0", - "@ethersproject/bytes": "^5.1.0", - "@ethersproject/constants": "^5.1.0", - "@ethersproject/hash": "^5.1.0", - "@ethersproject/keccak256": "^5.1.0", - "@ethersproject/logger": "^5.1.0", - "@ethersproject/properties": "^5.1.0", - "@ethersproject/strings": "^5.1.0" - } - }, - "js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" - } } }, "ethjs-unit": { @@ -1974,9 +2064,9 @@ }, "dependencies": { "type": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/type/-/type-2.3.0.tgz", - "integrity": "sha512-rgPIqOdfK/4J9FhiVrZ3cveAjRRo5rsQBAIhnylX874y1DX/kEKSVdLsnuHB6l1KTjHyU01VjiMBHgU2adejyg==" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.5.0.tgz", + "integrity": "sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw==" } } }, @@ -2036,6 +2126,11 @@ "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==" }, + "follow-redirects": { + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.3.tgz", + "integrity": "sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA==" + }, "foreach": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", @@ -2067,13 +2162,25 @@ "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" }, "fs-extra": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", - "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", "requires": { "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + }, + "dependencies": { + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "requires": { + "glob": "^7.1.3" + } + } } }, "fs-minipass": { @@ -2166,6 +2273,14 @@ "process": "^0.11.10" } }, + "global-dirs": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-2.1.0.tgz", + "integrity": "sha512-MG6kdOUh/xBnyo9cJFeIKkLEc1AyFq42QTU4XiX51i2NEdxLxLWXIjEjmqKeSuKR7pAZjTqUVoT2b2huxVLgYQ==", + "requires": { + "ini": "1.3.7" + } + }, "got": { "version": "9.6.0", "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", @@ -2244,6 +2359,11 @@ "has-symbol-support-x": "^1.4.1" } }, + "has-yarn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", + "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==" + }, "hash-base": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", @@ -2345,6 +2465,21 @@ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" }, + "ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=" + }, + "import-lazy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", + "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=" + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -2359,6 +2494,11 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "ini": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz", + "integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==" + }, "ip-regex": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz", @@ -2403,6 +2543,14 @@ "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz", "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==" }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "requires": { + "ci-info": "^2.0.0" + } + }, "is-date-object": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", @@ -2441,11 +2589,25 @@ "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" }, + "is-installed-globally": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.3.2.tgz", + "integrity": "sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g==", + "requires": { + "global-dirs": "^2.0.1", + "is-path-inside": "^3.0.1" + } + }, "is-negative-zero": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==" }, + "is-npm": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-4.0.0.tgz", + "integrity": "sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig==" + }, "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -2456,11 +2618,21 @@ "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.4.tgz", "integrity": "sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==" }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==" + }, "is-object": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.2.tgz", "integrity": "sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA==" }, + "is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==" + }, "is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", @@ -2515,6 +2687,26 @@ "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, + "is-url": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", + "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==" + }, + "is-yarn-global": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", + "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==" + }, + "is2": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/is2/-/is2-2.0.6.tgz", + "integrity": "sha512-+Z62OHOjA6k2sUDOKXoZI3EXv7Fb1K52jpTBLbkfx62bcUeSsrTBLhEquCRDKTx0XE5XbHcG/S2vrtE3lnEDsQ==", + "requires": { + "deep-is": "^0.1.3", + "ip-regex": "^4.1.0", + "is-url": "^1.2.4" + } + }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -2573,9 +2765,9 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", "requires": { "graceful-fs": "^4.1.6" } @@ -2608,6 +2800,22 @@ "json-buffer": "3.0.0" } }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "latest-version": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", + "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", + "requires": { + "package-json": "^6.3.0" + } + }, "locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -2629,6 +2837,21 @@ "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==" }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + } + } + }, "make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -2649,6 +2872,11 @@ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" }, + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=" + }, "merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", @@ -2674,16 +2902,16 @@ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" }, "mime-db": { - "version": "1.46.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.46.0.tgz", - "integrity": "sha512-svXaP8UQRZ5K7or+ZmfNhg2xX3yKDMUzqadsSqi4NCH/KomcH75MAMYAGVlvXn4+b/xOPhS3I2uHKRUzvjY7BQ==" + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz", + "integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==" }, "mime-types": { - "version": "2.1.29", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.29.tgz", - "integrity": "sha512-Y/jMt/S5sR9OaqteJtslsFZKWOIIqMACsJSiHghlCAyhf7jfVYjKBmLiX8OgpWeW+fjJ2b+Az69aPFPkUOY6xQ==", + "version": "2.1.30", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz", + "integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==", "requires": { - "mime-db": "1.46.0" + "mime-db": "1.47.0" } }, "mimic-response": { @@ -2806,11 +3034,6 @@ } } }, - "mocha-steps": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/mocha-steps/-/mocha-steps-1.3.0.tgz", - "integrity": "sha512-KZvpMJTqzLZw3mOb+EEuYi4YZS41C9iTnb7skVFRxHjUd1OYbl64tCMSmpdIRM9LnwIrSOaRfPtNpF5msgv6Eg==" - }, "mock-fs": { "version": "4.13.0", "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.13.0.tgz", @@ -2894,6 +3117,59 @@ "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==" }, + "nodemon": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.7.tgz", + "integrity": "sha512-XHzK69Awgnec9UzHr1kc8EomQh4sjTQ8oRf8TsGrSmHDx9/UmiGG9E/mM3BuTfNeFwdNBvrqQq/RHL0xIeyFOA==", + "requires": { + "chokidar": "^3.2.2", + "debug": "^3.2.6", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.0.4", + "pstree.remy": "^1.1.7", + "semver": "^5.7.1", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.3", + "update-notifier": "^4.1.0" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "requires": { + "abbrev": "1" + } + }, "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -2904,6 +3180,15 @@ "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==" }, + "npm-watch": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/npm-watch/-/npm-watch-0.9.0.tgz", + "integrity": "sha512-C5Rgh5+jvY33K1EH8Qjr1hfpH9Nhasc90QJ0W+JyKg2ogE0LOCZI4xirC8QmywW7XinyBpynwxlrN6aPfjc3Hw==", + "requires": { + "nodemon": "^2.0.7", + "through2": "^4.0.2" + } + }, "number-to-bn": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/number-to-bn/-/number-to-bn-1.7.0.tgz", @@ -2931,9 +3216,9 @@ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, "object-inspect": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", - "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==" + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.2.tgz", + "integrity": "sha512-gz58rdPpadwztRrPjZE9DZLOABUpTGdcANUgOwBFO1C+HZZhePoP83M65WGDmbpwFYJSWqavbl4SgDn4k8RYTA==" }, "object-keys": { "version": "1.1.1", @@ -2975,6 +3260,11 @@ "wrappy": "1" } }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + }, "p-cancelable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", @@ -3009,6 +3299,24 @@ "p-finally": "^1.0.0" } }, + "package-json": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", + "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", + "requires": { + "got": "^9.6.0", + "registry-auth-token": "^4.0.0", + "registry-url": "^5.0.0", + "semver": "^6.2.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + } + } + }, "parse-asn1": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", @@ -3052,9 +3360,9 @@ "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==" }, "pbkdf2": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", - "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", "requires": { "create-hash": "^1.1.2", "create-hmac": "^1.1.4", @@ -3069,9 +3377,9 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==" + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", + "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==" }, "prepend-http": { "version": "2.0.0", @@ -3097,6 +3405,11 @@ "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" }, + "pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==" + }, "public-encrypt": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", @@ -3124,6 +3437,14 @@ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" }, + "pupa": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", + "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==", + "requires": { + "escape-goat": "^2.0.0" + } + }, "qs": { "version": "6.7.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", @@ -3172,6 +3493,24 @@ "unpipe": "1.0.0" } }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" + } + } + }, "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -3195,6 +3534,22 @@ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==" }, + "registry-auth-token": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", + "integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==", + "requires": { + "rc": "^1.2.8" + } + }, + "registry-url": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", + "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", + "requires": { + "rc": "^1.2.8" + } + }, "request": { "version": "2.88.2", "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", @@ -3244,6 +3599,11 @@ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" + }, "responselike": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", @@ -3278,9 +3638,9 @@ } }, "rxjs": { - "version": "6.6.6", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.6.tgz", - "integrity": "sha512-/oTwee4N4iWzAMAL9xdGKjkEHmIwupR3oXbQjCKywF1BeFohswF3vZdogbmEF6pZkOsXTzWkrZszrWpQTByYVg==", + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", "requires": { "tslib": "^1.9.0" } @@ -3315,6 +3675,26 @@ "node-gyp-build": "^4.2.0" } }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "semver-diff": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", + "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", + "requires": { + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + } + } + }, "send": { "version": "0.17.1", "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", @@ -3392,6 +3772,11 @@ "safe-buffer": "^5.0.1" } }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" + }, "simple-concat": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", @@ -3407,6 +3792,22 @@ "simple-concat": "^1.0.0" } }, + "solc": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.8.3.tgz", + "integrity": "sha512-VZvSHtwe2zAsoviClIpWjvrg22bIZ0pLtzFrYD9BtPfR7mhMZYwpptnzRizNaSvMngTR+gB9Ul8IyL5xaC7+jw==", + "requires": { + "command-exists": "^1.2.8", + "commander": "3.0.2", + "follow-redirects": "^1.12.1", + "fs-extra": "^0.30.0", + "js-sha3": "0.8.0", + "memorystream": "^0.3.1", + "require-from-string": "^2.0.0", + "semver": "^5.5.0", + "tmp": "0.0.33" + } + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -3536,6 +3937,16 @@ "xhr-request": "^1.0.1" }, "dependencies": { + "fs-extra": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", + "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, "get-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", @@ -3567,6 +3978,14 @@ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "requires": { + "graceful-fs": "^4.1.6" + } + }, "p-cancelable": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", @@ -3611,11 +4030,56 @@ } } }, + "tcp-port-used": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tcp-port-used/-/tcp-port-used-1.0.2.tgz", + "integrity": "sha512-l7ar8lLUD3XS1V2lfoJlCBaeoaWo/2xfYt81hM7VlvR4RrMVFqfmzfhLVk40hAb368uitje5gPtBRL1m/DGvLA==", + "requires": { + "debug": "4.3.1", + "is2": "^2.0.6" + }, + "dependencies": { + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, + "term-size": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz", + "integrity": "sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==" + }, + "through2": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", + "requires": { + "readable-stream": "3" + } + }, "timed-out": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=" }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "requires": { + "os-tmpdir": "~1.0.2" + } + }, "to-readable-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", @@ -3634,6 +4098,14 @@ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" }, + "touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "requires": { + "nopt": "~1.0.10" + } + }, "tough-cookie": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", @@ -3691,6 +4163,11 @@ "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==" }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" + }, "type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -3729,11 +4206,27 @@ "which-boxed-primitive": "^1.0.2" } }, + "undefsafe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.3.tgz", + "integrity": "sha512-nrXZwwXrD/T/JXeygJqdCO6NZZ1L66HrxM/Z7mIq2oPanoN0F1nLx3lwJMu6AwJY69hdixaFQOuoYsMjE5/C2A==", + "requires": { + "debug": "^2.2.0" + } + }, "underscore": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==" }, + "unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "requires": { + "crypto-random-string": "^2.0.0" + } + }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -3744,6 +4237,45 @@ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" }, + "update-notifier": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.3.tgz", + "integrity": "sha512-Yld6Z0RyCYGB6ckIjffGOSOmHXj1gMeE7aROz4MG+XMkmixBX4jUngrGXNYz7wPKBmtoD4MnBa2Anu7RSKht/A==", + "requires": { + "boxen": "^4.2.0", + "chalk": "^3.0.0", + "configstore": "^5.0.1", + "has-yarn": "^2.1.0", + "import-lazy": "^2.1.0", + "is-ci": "^2.0.0", + "is-installed-globally": "^0.3.1", + "is-npm": "^4.0.0", + "is-yarn-global": "^0.3.0", + "latest-version": "^5.0.0", + "pupa": "^2.0.1", + "semver-diff": "^3.1.1", + "xdg-basedir": "^4.0.0" + }, + "dependencies": { + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -3857,9 +4389,9 @@ }, "dependencies": { "@types/node": { - "version": "12.20.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.7.tgz", - "integrity": "sha512-gWL8VUkg8VRaCAUgG9WmhefMqHmMblxe2rVpMF86nZY/+ZysU+BkAp+3cz03AixWDSSz0ks5WX59yAhv/cDwFA==" + "version": "12.20.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.10.tgz", + "integrity": "sha512-TxCmnSSppKBBOzYzPR2BR25YlX5Oay8z2XGwFBInuA/Co0V9xJhLlW4kjbxKtgeNo3NOMbQP1A5Rc03y+XecPw==" } } }, @@ -3878,9 +4410,9 @@ }, "dependencies": { "@types/node": { - "version": "12.20.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.7.tgz", - "integrity": "sha512-gWL8VUkg8VRaCAUgG9WmhefMqHmMblxe2rVpMF86nZY/+ZysU+BkAp+3cz03AixWDSSz0ks5WX59yAhv/cDwFA==" + "version": "12.20.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.10.tgz", + "integrity": "sha512-TxCmnSSppKBBOzYzPR2BR25YlX5Oay8z2XGwFBInuA/Co0V9xJhLlW4kjbxKtgeNo3NOMbQP1A5Rc03y+XecPw==" } } }, @@ -3980,6 +4512,24 @@ "@ethersproject/abi": "5.0.7", "underscore": "1.9.1", "web3-utils": "1.3.5" + }, + "dependencies": { + "@ethersproject/abi": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.0.7.tgz", + "integrity": "sha512-Cqktk+hSIckwP/W8O47Eef60VwmoSC/L3lY0+dIBhQPCNn9E4V7rwmm2aFrNRRDJfFlGuZ1khkQUOc3oBX+niw==", + "requires": { + "@ethersproject/address": "^5.0.4", + "@ethersproject/bignumber": "^5.0.7", + "@ethersproject/bytes": "^5.0.4", + "@ethersproject/constants": "^5.0.4", + "@ethersproject/hash": "^5.0.4", + "@ethersproject/keccak256": "^5.0.3", + "@ethersproject/logger": "^5.0.5", + "@ethersproject/properties": "^5.0.3", + "@ethersproject/strings": "^5.0.4" + } + } } }, "web3-eth-accounts": { @@ -4072,9 +4622,9 @@ }, "dependencies": { "@types/node": { - "version": "12.20.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.7.tgz", - "integrity": "sha512-gWL8VUkg8VRaCAUgG9WmhefMqHmMblxe2rVpMF86nZY/+ZysU+BkAp+3cz03AixWDSSz0ks5WX59yAhv/cDwFA==" + "version": "12.20.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.10.tgz", + "integrity": "sha512-TxCmnSSppKBBOzYzPR2BR25YlX5Oay8z2XGwFBInuA/Co0V9xJhLlW4kjbxKtgeNo3NOMbQP1A5Rc03y+XecPw==" } } }, @@ -4164,9 +4714,9 @@ } }, "websocket": { - "version": "1.0.33", - "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.33.tgz", - "integrity": "sha512-XwNqM2rN5eh3G2CUQE3OHZj+0xfdH42+OFK6LdC2yqiC0YU8e5UK0nYre220T0IyyN031V/XOvtHvXozvJYFWA==", + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", + "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", "requires": { "bufferutil": "^4.0.1", "debug": "^2.2.0", @@ -4218,6 +4768,44 @@ "string-width": "^1.0.2 || 2" } }, + "widest-line": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", + "requires": { + "string-width": "^4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, "workerpool": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.0.tgz", @@ -4268,23 +4856,27 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, - "ws": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", - "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", "requires": { - "async-limiter": "~1.0.0", - "safe-buffer": "~5.1.0", - "ultron": "~1.1.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" } }, + "ws": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.3.tgz", + "integrity": "sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ==" + }, + "xdg-basedir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", + "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==" + }, "xhr": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.6.0.tgz", @@ -4340,9 +4932,9 @@ } }, "y18n": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.5.tgz", - "integrity": "sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg==" + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" }, "yaeti": { "version": "0.0.6", diff --git a/tests/package.json b/tests/package.json index 254b34da217..94c2d579282 100644 --- a/tests/package.json +++ b/tests/package.json @@ -3,23 +3,54 @@ "version": "1.0.0", "description": "", "main": "index.js", + "watch": { + "build": { + "patterns": [ + "../" + ], + "ignore": [ + "../tests", + "../target", + "../build" + ], + "extensions": "rs", + "quiet": true, + "inherit": true + }, + "test": { + "patterns": [ + "../target/release/moonbeam", + "./tests/**" + ], + "extensions": "ts,html,scss", + "quiet": true, + "inherit": true, + "runOnChangeOnly": true + } + }, "scripts": { - "test-with-logs": "mocha --printlogs -r ts-node/register 'tests/**/*.ts'", - "test": "mocha -r ts-node/register 'tests/**/*.ts'", - "non-ci-test": "mocha -r ts-node/register 'non_ci_tests/**/*.ts'" + "test-with-logs": "mocha --printlogs -r ts-node/register 'tests/**/test-*.ts'", + "pre-build-contracts": "TS_NODE_TRANSPILE_ONLY=true ts-node ./pre-build-contracts.ts && npx prettier -w ./contracts/compiled/*.json", + "test": "TS_NODE_TRANSPILE_ONLY=true mocha --parallel -r ts-node/register 'tests/**/test-*.ts'", + "watch": "npm-watch", + "build": "cargo build --release", + "non-ci-test": "mocha -r ts-node/register 'non_ci_tests/**/test-*.ts'", + "test-single": "mocha -r ts-node/register 'tests/test-balance.ts'" }, "author": "", "license": "ISC", "dependencies": { - "@polkadot/api": "^4.4.1", - "@polkadot/types": "^4.4.1", + "@polkadot/api": "^4.6.2", + "@polkadot/types": "^4.6.2", "@types/chai": "^4.2.11", "@types/mocha": "^8.2.2", "chai": "^4.3.4", "ethers": "^5.1.0", "mocha": "^8.3.2", - "mocha-steps": "^1.3.0", + "npm-watch": "^0.9.0", "rimraf": "^3.0.2", + "solc": "^0.8.3", + "tcp-port-used": "^1.0.2", "ts-node": "9.1", "typescript": "^3.9.6", "web3": "^1.3.5" diff --git a/tests/pre-build-contracts.ts b/tests/pre-build-contracts.ts new file mode 100644 index 00000000000..8f37ff78649 --- /dev/null +++ b/tests/pre-build-contracts.ts @@ -0,0 +1,59 @@ +import solc from "solc"; +import fs from "fs/promises"; +import { contractSources } from "./contracts/sources"; +import { Compiled } from "../tests/util/contracts"; + +function compileSolidity(contractContent: string, contractName: string = "Test"): Compiled { + let result = JSON.parse( + solc.compile( + JSON.stringify({ + language: "Solidity", + sources: { + "main.sol": { + content: contractContent, + }, + }, + settings: { + outputSelection: { + "*": { + "*": ["*"], + }, + }, + }, + }) + ) + ); + + const contract = result.contracts["main.sol"][contractName]; + return { + byteCode: "0x" + contract.evm.bytecode.object, + contract, + sourceCode: contractContent, + }; +} + +// Shouldn't be run concurrently with the same 'name' +async function compile(name: string): Promise { + if (!contractSources[name]) + throw new Error(`Contract name (${name}) doesn't exist in test suite`); + const contractCompiled = compileSolidity(contractSources[name], name); + let compiled = JSON.stringify(contractCompiled); + await fs.mkdir(`contracts/compiled`, { recursive: true }); + await fs.writeFile(`./contracts/compiled/${name}.json`, compiled, { + flag: "w", + }); + console.log("New compiled contract file has been saved!"); + return contractCompiled; +} + +const main = async () => { + for (let name of Object.keys(contractSources)) { + console.log(`Compiling ${name}`); + await compile(name); + } + + // Forcing exit to avoid solc maintaining the process + process.exit(0); +}; + +main(); diff --git a/tests/tests/constants/Callee.json b/tests/tests/constants/Callee.json deleted file mode 100644 index f6f1ce99c61..00000000000 --- a/tests/tests/constants/Callee.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "contractName": "Callee", - "abi": [ - { - "inputs": [ - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - } - ], - "name": "addtwo", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "store", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "linkReferences": {}, - "bytecode": "0x608060405234801561001057600080fd5b5060e78061001f6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c8063975057e7146037578063fd63983b146053575b600080fd5b603d6092565b6040518082815260200191505060405180910390f35b607c60048036036020811015606757600080fd5b81019080803590602001909291905050506098565b6040518082815260200191505060405180910390f35b60005481565b600080600790508260008190555080830191505091905056fea26469706673582212204ac9cd6b4fedb571a3e5bb42d6f06e90328d2a5646b75243a8d4404cca3bc0c564736f6c63430007040033", - "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0xE7 DUP1 PUSH2 0x1F PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH1 0x32 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x975057E7 EQ PUSH1 0x37 JUMPI DUP1 PUSH4 0xFD63983B EQ PUSH1 0x53 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3D PUSH1 0x92 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x7C PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH1 0x67 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH1 0x98 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x7 SWAP1 POP DUP3 PUSH1 0x0 DUP2 SWAP1 SSTORE POP DUP1 DUP4 ADD SWAP2 POP POP SWAP2 SWAP1 POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0x4A 0xC9 0xCD PUSH12 0x4FEDB571A3E5BB42D6F06E90 ORIGIN DUP14 0x2A JUMP CHAINID 0xB7 MSTORE NUMBER 0xA8 0xD4 BLOCKHASH 0x4C 0xCA EXTCODESIZE 0xC0 0xC5 PUSH5 0x736F6C6343 STOP SMOD DIV STOP CALLER ", - "sourceMap": "235:178:0:-:0;;;;;;;;;;;;;;;;;;;" -} diff --git a/tests/tests/constants/Caller.json b/tests/tests/constants/Caller.json deleted file mode 100644 index 09d848752cd..00000000000 --- a/tests/tests/constants/Caller.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "contractName": "Caller", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_addr", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_number", - "type": "uint256" - } - ], - "name": "someAction", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "store", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "linkReferences": {}, - "bytecode": "0x608060405234801561001057600080fd5b506101db806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063398f72231461003b578063975057e714610089575b600080fd5b6100876004803603604081101561005157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506100a7565b005b61009161019f565b6040518082815260200191505060405180910390f35b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fd63983b826040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b15801561015a57600080fd5b505af115801561016e573d6000803e3d6000fd5b505050506040513d602081101561018457600080fd5b81019080805190602001909291905050506001819055505050565b6001548156fea26469706673582212205a75600d7b32d5d1ffd6daaefa83041fe1584487889a2390754a44722f5baa4164736f6c63430007040033", - "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB 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 0x398F7223 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x975057E7 EQ PUSH2 0x89 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x87 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x40 DUP2 LT ISZERO PUSH2 0x51 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xA7 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x91 PUSH2 0x19F JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST DUP2 PUSH1 0x0 DUP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xFD63983B DUP3 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x15A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x16E JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x184 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH1 0x1 DUP2 SWAP1 SSTORE POP POP POP JUMP JUMPDEST PUSH1 0x1 SLOAD DUP2 JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 GAS PUSH22 0x600D7B32D5D1FFD6DAAEFA83041FE1584487889A2390 PUSH22 0x4A44722F5BAA4164736F6C6343000704003300000000 ", - "sourceMap": "24:210:0:-:0;;;;;;;;;;;;;;;;;;;" -} diff --git a/tests/tests/constants/Incrementer.json b/tests/tests/constants/Incrementer.json deleted file mode 100644 index 02fc776dbf9..00000000000 --- a/tests/tests/constants/Incrementer.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "contractName": "Incrementer", - "abi": [ - { - "inputs": [ - { - "internalType": "uint256", - "name": "num", - "type": "uint256" - } - ], - "name": "sum", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "linkReferences": {}, - "bytecode": "0x6080604052348015600f57600080fd5b5060bd8061001e6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063188b85b414602d575b600080fd5b605660048036036020811015604157600080fd5b8101908080359060200190929190505050606c565b6040518082815260200191505060405180910390f35b6000816000808282540192505081905550600054905091905056fea26469706673582212209cfa345bd24fe74702b4d1e0828e151e3052c24448b36898211d29d81d7536f764736f6c634300060c0033", - "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0xBD DUP1 PUSH2 0x1E PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH1 0x28 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x188B85B4 EQ PUSH1 0x2D JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x56 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH1 0x41 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH1 0x6C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP PUSH1 0x0 SLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 SWAP13 STATICCALL CALLVALUE JUMPDEST 0xD2 0x4F 0xE7 SELFBALANCE MUL 0xB4 0xD1 0xE0 DUP3 DUP15 ISZERO 0x1E ADDRESS MSTORE 0xC2 DIFFICULTY 0x48 0xB3 PUSH9 0x98211D29D81D7536F7 PUSH5 0x736F6C6343 STOP MOD 0xC STOP CALLER ", - "sourceMap": "32:148:0:-:0;;;;;;;;;;;;;;;;;;;" -} diff --git a/tests/tests/constants/IncrementerWithEvent.json b/tests/tests/constants/IncrementerWithEvent.json deleted file mode 100644 index 1ea4d7107e8..00000000000 --- a/tests/tests/constants/IncrementerWithEvent.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "contractName": "IncrementerWithEvent", - "abi": [ - { - "constant": true, - "inputs": [], - "name": "count", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "increment", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "who", - "type": "address" - } - ], - "name": "Increment", - "type": "event" - } - ], - "linkReferences": {}, - "bytecode": "0x60806040526000805534801561001457600080fd5b5061013a806100246000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306661abd14610051578063d09de08a1461007c575b600080fd5b34801561005d57600080fd5b50610066610093565b6040518082815260200191505060405180910390f35b34801561008857600080fd5b50610091610099565b005b60005481565b7ffc3a67c9f0b5967ae4041ed898b05ec1fa49d2a3c22336247201d71be6f9712033604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1600160008082825401925050819055505600a165627a7a723058205fd614b5aed0d535e239d8b2622852895ac8aa83d133da106fc82e602cf1568c0029", - "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 SSTORE CALLVALUE DUP1 ISZERO PUSH2 0x14 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x13A DUP1 PUSH2 0x24 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x4C JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x6661ABD EQ PUSH2 0x51 JUMPI DUP1 PUSH4 0xD09DE08A EQ PUSH2 0x7C JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x5D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x66 PUSH2 0x93 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x88 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x91 PUSH2 0x99 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 SLOAD DUP2 JUMP JUMPDEST PUSH32 0xFC3A67C9F0B5967AE4041ED898B05EC1FA49D2A3C22336247201D71BE6F97120 CALLER PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 PUSH1 0x1 PUSH1 0x0 DUP1 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0x5f 0xd6 EQ 0xb5 0xae 0xd0 0xd5 CALLDATALOAD 0xe2 CODECOPY 0xd8 0xb2 PUSH3 0x285289 GAS 0xc8 0xaa DUP4 0xd1 CALLER 0xda LT PUSH16 0xC82E602CF1568C002900000000000000 ", - "sourceMap": "26:220:0:-;;;72:1;49:24;;26:220;8:9:-1;5:2;;;30:1;27;20:12;5:2;26:220:0;;;;;;;" -} diff --git a/tests/tests/constants/TraceFilter.json b/tests/tests/constants/TraceFilter.json deleted file mode 100644 index a2df7d1ce2f..00000000000 --- a/tests/tests/constants/TraceFilter.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "contractName": "TraceFilter", - "abi": [ - { - "inputs": [ - { - "internalType": "bool", - "name": "should_revert", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "call_ok", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "call_revert", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target0", - "type": "address" - }, - { - "internalType": "address", - "name": "target1", - "type": "address" - } - ], - "name": "subcalls", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target1", - "type": "address" - } - ], - "name": "subsubcalls", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "608060405234801561001057600080fd5b506040516103783803806103788339818101604052602081101561003357600080fd5b8101908080519060200190929190505050801561004f57600080fd5b506103198061005f6000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80635eaf9bc114610051578063a885f4e31461005b578063cb30e6961461009f578063f34f1610146100a9575b600080fd5b61005961010d565b005b61009d6004803603602081101561007157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061010f565b005b6100a76101d2565b005b61010b600480360360408110156100bf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506101d7565b005b565b8073ffffffffffffffffffffffffffffffffffffffff16635eaf9bc16040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561015757600080fd5b505af115801561016b573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff1663cb30e6966040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156101b757600080fd5b505af11580156101cb573d6000803e3d6000fd5b5050505050565b600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a885f4e3826040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15801561024057600080fd5b505af1925050508015610251575060015b61025a5761025b565b5b8173ffffffffffffffffffffffffffffffffffffffff1663a885f4e3826040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b1580156102c457600080fd5b505af19250505080156102d5575060015b6102de576102df565b5b505056fea2646970667358221220ee197ab2a083888733b5308bb086dad0368108fe41328cd7752f955e7e67232464736f6c63430007060033", - "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH2 0x378 CODESIZE SUB DUP1 PUSH2 0x378 DUP4 CODECOPY DUP2 DUP2 ADD PUSH1 0x40 MSTORE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x33 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP DUP1 ISZERO PUSH2 0x4F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x319 DUP1 PUSH2 0x5F 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 0x4C JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x5EAF9BC1 EQ PUSH2 0x51 JUMPI DUP1 PUSH4 0xA885F4E3 EQ PUSH2 0x5B JUMPI DUP1 PUSH4 0xCB30E696 EQ PUSH2 0x9F JUMPI DUP1 PUSH4 0xF34F1610 EQ PUSH2 0xA9 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x59 PUSH2 0x10D JUMP JUMPDEST STOP JUMPDEST PUSH2 0x9D PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x71 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x10F JUMP JUMPDEST STOP JUMPDEST PUSH2 0xA7 PUSH2 0x1D2 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x10B PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x40 DUP2 LT ISZERO PUSH2 0xBF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1D7 JUMP JUMPDEST STOP JUMPDEST JUMP JUMPDEST DUP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x5EAF9BC1 PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x157 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x16B JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP DUP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xCB30E696 PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x1B7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x1CB JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xA885F4E3 DUP3 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x240 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL SWAP3 POP POP POP DUP1 ISZERO PUSH2 0x251 JUMPI POP PUSH1 0x1 JUMPDEST PUSH2 0x25A JUMPI PUSH2 0x25B JUMP JUMPDEST JUMPDEST DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xA885F4E3 DUP3 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x2C4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL SWAP3 POP POP POP DUP1 ISZERO PUSH2 0x2D5 JUMPI POP PUSH1 0x1 JUMPDEST PUSH2 0x2DE JUMPI PUSH2 0x2DF JUMP JUMPDEST JUMPDEST POP POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xEE NOT PUSH27 0xB2A083888733B5308BB086DAD0368108FE41328CD7752F955E7E67 0x23 0x24 PUSH5 0x736F6C6343 STOP SMOD MOD STOP CALLER ", - "sourceMap": "25:583:0:-:0;;;52:100;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;98:13;94:52;;;127:8;;;94:52;52:100;25:583;;;;;;" -} diff --git a/tests/tests/constants/TraceFilter.sol b/tests/tests/constants/TraceFilter.sol deleted file mode 100644 index ae955b574cd..00000000000 --- a/tests/tests/constants/TraceFilter.sol +++ /dev/null @@ -1,25 +0,0 @@ -pragma solidity ^0.7.0; - -contract TraceFilter { - constructor(bool should_revert) { - if (should_revert) { - revert(); - } - } - - function call_ok() public { } - - function call_revert() public { - revert(); - } - - function subcalls(address target0, address target1) public { - try TraceFilter(target0).subsubcalls(target1) { } catch { } - try TraceFilter(target0).subsubcalls(target1) { } catch { } - } - - function subsubcalls(address target1) public { - TraceFilter(target1).call_ok(); - TraceFilter(target1).call_revert(); - } -} \ No newline at end of file diff --git a/tests/tests/constants/constants.ts b/tests/tests/constants/constants.ts deleted file mode 100644 index 4845ec32a77..00000000000 --- a/tests/tests/constants/constants.ts +++ /dev/null @@ -1,20 +0,0 @@ -export const PORT = 19931; -export const RPC_PORT = 19932; -export const WS_PORT = 19933; -export const SPECS_PATH = `./moonbeam-test-specs`; - -export const DISPLAY_LOG = process.env.MOONBEAM_LOG || false; -export const MOONBEAM_LOG = process.env.MOONBEAM_LOG || "info"; - -export const BINARY_PATH = process.env.BINARY_PATH || `../target/release/moonbeam`; -export const SPAWNING_TIME = 30000; - -// Test variables -export const GENESIS_ACCOUNT = "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b"; -export const GENESIS_ACCOUNT_PRIVATE_KEY = - "0x99B3C12287537E38C90A9219D4CB074A89A16E9CDB20BF85728EBD97C343E342"; -export const TEST_ACCOUNT = "0x1111111111111111111111111111111111111111"; -export const GLMR = 1_000_000_000_000_000_000n; -export const DEFAULT_GENESIS_BALANCE = 2n ** 80n; -export const DEFAULT_GENESIS_STAKING = 1_000n * GLMR; -export const GENESIS_ACCOUNT_BALANCE = DEFAULT_GENESIS_BALANCE - DEFAULT_GENESIS_STAKING; diff --git a/tests/tests/constants/index.ts b/tests/tests/constants/index.ts deleted file mode 100644 index 970df85a72e..00000000000 --- a/tests/tests/constants/index.ts +++ /dev/null @@ -1,38 +0,0 @@ -export * from "./testContracts"; -export * from "./constants"; -export * from "./transactionConfigs"; - -// TESTING NOTES -// -// BLOCK TESTING -// - block dont seem to have gas limit but it's usually around 1500 tx per block -// and the time it takes to construct the block increases until around 12s for 1500tx -// - after the first 1500tx block, following block have around 100-300 tx per block -// until all blocks are incuded. 10 blockds for 3000tx -// - between 7k and 10k, for some reason block creation doesnt work and we get -// one Pool(ImmediatelyDropped) error -// and Pool(TooLowPriority { old: 0, new: 0 })': 819 for the contract creation - -// 8192 is the number of tx that can be sent to the Pool before it throws an error and drops all tx -// from the pool (we can see in the logs that the ‘ready’ field goes from 8192 to zero) - -// It does say however, 8182/20480kB ready, 819/2048kB future and I’m not sure what that means -// -// INFINITE LOOP -// - infinite loop contract should throw out of gas error, but they don't and -// they are included in the block. -// - there are some rpc errors sometimes -// - the state remains unchanged tho (test with infinite incremental contract) -// -// FINITE LOOP -// - making a 1000 loop incr on a smart contract doesnt pass but doesnt throw -// error either (although it does include the tx in a block) -// => is there a problem with out of gas error -// =>probably because we don't have the concept of gas? -// - posting a tx that goes over the gas limit/tx does throw an out of gas error -// in the debug log but not in js - -//NB: https://github.com/paritytech/frontier/blob/master/frame/ethereum/src/lib.rs -// show that root=0 when error is thrown, -//which is something we can see when fethcing receipt -// also the current block limit is zero diff --git a/tests/tests/constants/testContracts.ts b/tests/tests/constants/testContracts.ts deleted file mode 100644 index e9b8f9d4195..00000000000 --- a/tests/tests/constants/testContracts.ts +++ /dev/null @@ -1,296 +0,0 @@ -import { AbiItem } from "web3-utils"; - -// Solidity: contract test {function multiply(uint a) public pure returns(uint d) {return a * 7;}} -export const TEST_CONTRACT_BYTECODE = - "0x6080604052348015600f57600080fd5b5060ae8061001e6000396000f3fe6080604052348015600f57600080fd" + - "5b506004361060285760003560e01c8063c6888fa114602d575b600080fd5b605660048036036020811015604157" + - "600080fd5b8101908080359060200190929190505050606c565b6040518082815260200191505060405180910390" + - "f35b600060078202905091905056fea265627a7a72315820f06085b229f27f9ad48b2ff3dd9714350c1698a37853" + - "a30136fa6c5a7762af7364736f6c63430005110032"; - -export const TEST_CONTRACT_ABI = { - constant: true, - inputs: [{ internalType: "uint256", name: "a", type: "uint256" }], - name: "multiply", - outputs: [{ internalType: "uint256", name: "d", type: "uint256" }], - payable: false, - stateMutability: "pure", - type: "function", -} as AbiItem; - -export const TEST_CONTRACT_ABI_ETHERS = { - constant: true, - inputs: [{ internalType: "uint256", name: "a", type: "uint256" }], - name: "multiply", - outputs: [{ internalType: "uint256", name: "d", type: "uint256" }], - payable: false, - stateMutability: "pure", - type: "function", -}; - -export const FIRST_CONTRACT_ADDRESS = "0xc2bf5f29a4384b1ab0c063e1c666f02121b6084a"; - -// simple incremental count contract to test contract with state changes - -// Solidity: -// contract Test3 { -// uint public count; - -// constructor() public { -// count = 0; -// } - -// function incr() public { -// count=count+1; -// } -// } -export const TEST_CONTRACT_BYTECODE_INCR = - "6080604052348015600f57600080fd5b506000808190555060a5806100256000396000f3fe608060405234801560" + - "0f57600080fd5b506004361060325760003560e01c806306661abd146037578063119fbbd4146053575b600080fd" + - "5b603d605b565b6040518082815260200191505060405180910390f35b60596061565b005b60005481565b600160" + - "00540160008190555056fea26469706673582212204780263fff0edc01286caed1851cc629033bc25ec1f84995a7" + - "1199017a4623dd64736f6c634300060b0033"; - -export const TEST_CONTRACT_INCR_ABI = [ - { - inputs: [], - stateMutability: "nonpayable", - type: "constructor", - }, - { - inputs: [], - name: "count", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "incr", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, -] as AbiItem[]; - -// infinite loop call - -// Solidity: -// contract test { -// function infinite(uint a) public pure returns(uint d) {while (true) {}} -// } -export const INFINITE_CONTRACT_BYTECODE = - "6080604052348015600f57600080fd5b5060788061001e6000396000f3fe6080604052348015600f57600080fd5b" + - "506004361060285760003560e01c80635bec9e6714602d575b600080fd5b60336035565b005b5b60011560405760" + - "36565b56fea264697066735822122015c7d339c1118112e1d9b33ea79ded52efa22f4e3cefe34097578a63e128f8" + - "a264736f6c63430007040033"; - -export const INFINITE_CONTRACT_ABI = { - inputs: [], - name: "infinite", - outputs: [], - stateMutability: "pure", - type: "function", -} as AbiItem; - -// infinite loop call with variable alocation - -// Solidity: -// contract test { -// function infinite(uint a) public pure returns(uint d) {while (true) {data=data+1;}} -// } -export const INFINITE_CONTRACT_BYTECODE_VAR = - "608060405234801561001057600080fd5b50600160008190555060b0806100276000396000f3fe60806040523480" + - "15600f57600080fd5b506004361060325760003560e01c80635bec9e6714603757806373d4a13a14603f575b6000" + - "80fd5b603d605b565b005b60456074565b6040518082815260200191505060405180910390f35b5b600115607257" + - "600160005401600081905550605c565b565b6000548156fea264697066735822122053e7fd0d4629f7d9cd16b045" + - "6521ea0cf78e595e9627c45ee8a4f27f4119f39c64736f6c634300060b0033"; - -export const INFINITE_CONTRACT_ABI_VAR = [ - { - inputs: [], - stateMutability: "nonpayable", - type: "constructor", - }, - { - inputs: [], - name: "data", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "infinite", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, -] as AbiItem[]; - -// definite loop call with variable alocation - -// Solidity: -// contract Test4 { -// uint public count; - -// constructor() public { -// count = 0; -// } - -// function incr(uint n) public { -// uint i=0; -// while (i { + it("should appear after transfer", async function () { + const testAddress = "0x1111111111111111111111111111111111111111"; + await context.createBlock({ + transactions: [await createTransfer(context.web3, testAddress, 512)], + }); + + const blockHash = await context.polkadotApi.rpc.chain.getBlockHash(1); + const signedBlock = await context.polkadotApi.rpc.chain.getBlock(blockHash); + const allRecords = await context.polkadotApi.query.system.events.at( + signedBlock.block.header.hash + ); + + // map between the extrinsics and events + signedBlock.block.extrinsics.forEach(({ method: { method, section } }, index) => { + // filter the specific events based on the phase and then the + // index of our extrinsic in the block + const events: Event[] = allRecords + .filter(({ phase }) => phase.isApplyExtrinsic && phase.asApplyExtrinsic.eq(index)) + .map(({ event }) => event); + + switch (index) { + // First 3 events: + // timestamp.set:: system.ExtrinsicSuccess + // parachainUpgrade.setValidationData:: system.ExtrinsicSuccess + // authorInherent.setAuthor:: system.ExtrinsicSuccess + case 0: + case 1: + case 2: + expect( + events.length === 1 && context.polkadotApi.events.system.ExtrinsicSuccess.is(events[0]) + ).to.be.true; + break; + // Fourth event: ethereum.transact:: system.NewAccount, balances.Endowed, (?), + // ethereum.Executed, system.ExtrinsicSuccess + case 3: + expect(section === "ethereum" && method === "transact").to.be.true; + expect(events.length === 4); + expect(context.polkadotApi.events.system.NewAccount.is(events[0])).to.be.true; + expect(context.polkadotApi.events.balances.Endowed.is(events[1])).to.be.true; + // TODO: what event was inserted here? + expect(context.polkadotApi.events.ethereum.Executed.is(events[3])).to.be.true; + expect(context.polkadotApi.events.system.ExtrinsicSuccess.is(events[4])).to.be.true; + break; + default: + throw new Error(`Unexpected extrinsic`); + } + }); + }); +}); diff --git a/tests/tests/test-balance-genesis.ts b/tests/tests/test-balance-genesis.ts new file mode 100644 index 00000000000..b59aadaafd5 --- /dev/null +++ b/tests/tests/test-balance-genesis.ts @@ -0,0 +1,18 @@ +import { expect } from "chai"; + +import { GENESIS_ACCOUNT, GENESIS_ACCOUNT_BALANCE } from "../util/constants"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; + +describeDevMoonbeam("Balance genesis", (context) => { + it("should be accessible through web3", async function () { + expect(await context.web3.eth.getBalance(GENESIS_ACCOUNT, 0)).to.equal( + GENESIS_ACCOUNT_BALANCE.toString() + ); + }); + + it("should be accessible through polkadotJs", async function () { + const genesisHash = await context.polkadotApi.rpc.chain.getBlockHash(0); + const account = await context.polkadotApi.query.system.account.at(genesisHash, GENESIS_ACCOUNT); + expect(account.data.free.toString()).to.equal(GENESIS_ACCOUNT_BALANCE.toString()); + }); +}); diff --git a/tests/tests/test-balance-transfer.ts b/tests/tests/test-balance-transfer.ts new file mode 100644 index 00000000000..da5afae3b26 --- /dev/null +++ b/tests/tests/test-balance-transfer.ts @@ -0,0 +1,48 @@ +import { expect } from "chai"; +import { GENESIS_ACCOUNT, GENESIS_ACCOUNT_BALANCE } from "../util/constants"; + +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createTransfer } from "../util/transactions"; + +describeDevMoonbeam("Balance transfer cost", (context) => { + it("should cost 21000", async function () { + const testAccount = "0x1111111111111111111111111111111111111111"; + await context.createBlock({ + transactions: [await createTransfer(context.web3, testAccount, 0)], + }); + + expect(await context.web3.eth.getBalance(GENESIS_ACCOUNT, 1)).to.equal( + (GENESIS_ACCOUNT_BALANCE - 21000n).toString() + ); + }); +}); + +describeDevMoonbeam("Balance transfer", (context) => { + const TEST_ACCOUNT = "0x1111111111111111111111111111111111111111"; + before("Create block with transfer to test account of 512", async () => { + await context.createBlock({ + transactions: [await createTransfer(context.web3, TEST_ACCOUNT, 512)], + }); + }); + + it("should decrease from account", async function () { + // 21000 covers the cost of the transaction + expect(await context.web3.eth.getBalance(GENESIS_ACCOUNT, 1)).to.equal( + (GENESIS_ACCOUNT_BALANCE - 512n - 21000n).toString() + ); + }); + + it("should increase to account", async function () { + expect(await context.web3.eth.getBalance(TEST_ACCOUNT, 0)).to.equal("0"); + expect(await context.web3.eth.getBalance(TEST_ACCOUNT, 1)).to.equal("512"); + }); + + it("should reflect balance identically on polkadot/web3", async function () { + const block1Hash = await context.polkadotApi.rpc.chain.getBlockHash(1); + expect(await context.web3.eth.getBalance(GENESIS_ACCOUNT, 1)).to.equal( + ( + await context.polkadotApi.query.system.account.at(block1Hash, GENESIS_ACCOUNT) + ).data.free.toString() + ); + }); +}); diff --git a/tests/tests/test-balance.ts b/tests/tests/test-balance.ts deleted file mode 100644 index 0950275a2e5..00000000000 --- a/tests/tests/test-balance.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { expect } from "chai"; -import { Keyring } from "@polkadot/keyring"; -import { step } from "mocha-steps"; - -import { createAndFinalizeBlock, describeWithMoonbeam, customRequest } from "./util"; -import { - GENESIS_ACCOUNT, - GENESIS_ACCOUNT_BALANCE, - GENESIS_ACCOUNT_PRIVATE_KEY, - TEST_ACCOUNT, -} from "./constants"; -import { Event } from "@polkadot/types/interfaces"; - -describeWithMoonbeam("Moonbeam RPC (Balance)", `simple-specs.json`, (context) => { - step("genesis balance is setup correctly (web3)", async function () { - expect(await context.web3.eth.getBalance(GENESIS_ACCOUNT)).to.equal( - GENESIS_ACCOUNT_BALANCE.toString() - ); - }); - step("genesis balance is setup correctly (polkadotJs)", async function () { - const account = await context.polkadotApi.query.system.account(GENESIS_ACCOUNT); - expect(account.data.free.toString()).to.equal(GENESIS_ACCOUNT_BALANCE.toString()); - }); - - step("balance to be updated after transfer", async function () { - this.timeout(15000); - - const tx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - to: TEST_ACCOUNT, - value: "0x200", // Must be higher than ExistentialDeposit (0) - gasPrice: "0x01", - gas: "0x100000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - await customRequest(context.web3, "eth_sendRawTransaction", [tx.rawTransaction]); - await createAndFinalizeBlock(context.polkadotApi); - expect(await context.web3.eth.getBalance(GENESIS_ACCOUNT)).to.equal( - (GENESIS_ACCOUNT_BALANCE - 0x200n - 21000n).toString() - ); - expect(await context.web3.eth.getBalance(TEST_ACCOUNT)).to.equal("512"); - }); - - step("read ethereum.transact extrinsic events", async function () { - const signedBlock = await context.polkadotApi.rpc.chain.getBlock(); - const allRecords = await context.polkadotApi.query.system.events.at( - signedBlock.block.header.hash - ); - - // map between the extrinsics and events - signedBlock.block.extrinsics.forEach(({ method: { method, section } }, index) => { - // filter the specific events based on the phase and then the - // index of our extrinsic in the block - const events: Event[] = allRecords - .filter(({ phase }) => phase.isApplyExtrinsic && phase.asApplyExtrinsic.eq(index)) - .map(({ event }) => event); - - switch (index) { - // First 3 events: - // timestamp.set:: system.ExtrinsicSuccess - // parachainUpgrade.setValidationData:: system.ExtrinsicSuccess - // authorInherent.setAuthor:: system.ExtrinsicSuccess - case 0: - case 1: - case 2: - expect( - events.length === 1 && context.polkadotApi.events.system.ExtrinsicSuccess.is(events[0]) - ).to.be.true; - break; - // Fourth event: ethereum.transact:: system.NewAccount, balances.Endowed, (?), - // ethereum.Executed, system.ExtrinsicSuccess - case 3: - expect(section === "ethereum" && method === "transact").to.be.true; - expect(events.length === 4); - expect(context.polkadotApi.events.system.NewAccount.is(events[0])).to.be.true; - expect(context.polkadotApi.events.balances.Endowed.is(events[1])).to.be.true; - // TODO: what event was inserted here? - expect(context.polkadotApi.events.ethereum.Executed.is(events[3])).to.be.true; - expect(context.polkadotApi.events.system.ExtrinsicSuccess.is(events[4])).to.be.true; - break; - default: - throw new Error(`Unexpected extrinsic`); - } - }); - }); - - step("balance should be the same on polkadot/web3", async function () { - this.timeout(15000); - - const tx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - to: TEST_ACCOUNT, - value: "0x200", // Must be higher than ExistentialDeposit (currently 0) - gasPrice: "0x01", - gas: "0x100000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - await customRequest(context.web3, "eth_sendRawTransaction", [tx.rawTransaction]); - await createAndFinalizeBlock(context.polkadotApi); - expect(await context.web3.eth.getBalance(GENESIS_ACCOUNT)).to.equal( - (await context.polkadotApi.query.system.account(GENESIS_ACCOUNT)).data.free.toString() - ); - }); - - const TEST_ACCOUNT_2 = "0x1111111111111111111111111111111111111112"; - - step("transfer from polkadotjs should appear in ethereum", async function () { - this.timeout(15000); - - const keyring = new Keyring({ type: "ethereum" }); - const testAccount = await keyring.createFromUri(GENESIS_ACCOUNT_PRIVATE_KEY); - await context.polkadotApi.tx.balances.transfer(TEST_ACCOUNT_2, 123).signAndSend(testAccount); - - await createAndFinalizeBlock(context.polkadotApi); - expect(await context.web3.eth.getBalance(TEST_ACCOUNT_2)).to.equal("123"); - }); -}); diff --git a/tests/tests/test-block-1.ts b/tests/tests/test-block-1.ts new file mode 100644 index 00000000000..82a7f016f7c --- /dev/null +++ b/tests/tests/test-block-1.ts @@ -0,0 +1,61 @@ +import { expect } from "chai"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; + +describeDevMoonbeam("Block 1", (context) => { + before("Setup: Create empty block", async () => { + await context.createBlock(); + }); + + it("should be at block 1", async function () { + expect(await context.web3.eth.getBlockNumber()).to.equal(1); + }); + + it("should have valid timestamp after block production", async function () { + // Originally ,this test required the timestamp be in the last finve minutes. + // This requirement doesn't make sense when we forge timestamps in manual seal. + const block = await context.web3.eth.getBlock("latest"); + const next5Minutes = Date.now() / 1000 + 300; + expect(block.timestamp).to.be.least(0); + expect(block.timestamp).to.be.below(next5Minutes); + }); + + it("should contain block information", async function () { + const block = await context.web3.eth.getBlock("latest"); + expect(block).to.include({ + author: "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b", + difficulty: "0", + extraData: "0x", + gasLimit: 15000000, + gasUsed: 0, + logsBloom: `0x${"0".repeat(512)}`, + miner: "0x6Be02d1d3665660d22FF9624b7BE0551ee1Ac91b", + number: 1, + receiptsRoot: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + totalDifficulty: "0", + transactionsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + }); + + expect(block.transactions).to.be.a("array").empty; + expect(block.uncles).to.be.a("array").empty; + expect((block as any).sealFields).to.eql([ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000", + ]); + expect(block.hash).to.be.a("string").lengthOf(66); + expect(block.parentHash).to.be.a("string").lengthOf(66); + expect(block.timestamp).to.be.a("number"); + }); + + it("should be accessible by hash", async function () { + const latestBlock = await context.web3.eth.getBlock("latest"); + const block = await context.web3.eth.getBlock(latestBlock.hash); + expect(block.hash).to.be.eq(latestBlock.hash); + }); + + it("should be accessible by number", async function () { + const latestBlock = await context.web3.eth.getBlock("latest"); + const block = await context.web3.eth.getBlock(1); + expect(block.hash).to.be.eq(latestBlock.hash); + }); +}); diff --git a/tests/tests/test-block-2.ts b/tests/tests/test-block-2.ts new file mode 100644 index 00000000000..26e1a936ea3 --- /dev/null +++ b/tests/tests/test-block-2.ts @@ -0,0 +1,20 @@ +import { expect } from "chai"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; + +describeDevMoonbeam("Block 2", (context) => { + before("Setup: Create 2 empty blocks", async () => { + await context.createBlock(); + await context.createBlock(); + }); + + it("should be at block 2", async function () { + expect(await context.web3.eth.getBlockNumber()).to.equal(2); + }); + + it("should include previous block hash as parent", async function () { + const block = await context.web3.eth.getBlock("latest"); + let previousBlock = await context.web3.eth.getBlock(1); + expect(block.hash).to.not.equal(previousBlock.hash); + expect(block.parentHash).to.equal(previousBlock.hash); + }); +}); diff --git a/tests/tests/test-block-gas.ts b/tests/tests/test-block-gas.ts new file mode 100644 index 00000000000..8c36f54d237 --- /dev/null +++ b/tests/tests/test-block-gas.ts @@ -0,0 +1,45 @@ +import { expect } from "chai"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; + +import { EXTRINSIC_GAS_LIMIT } from "../util/constants"; +import { createContract } from "../util/transactions"; +import { customWeb3Request } from "../util/providers"; + +describeDevMoonbeam("Block Gas - Limit", (context) => { + it("should be allowed to the max block gas", async function () { + const { rawTx } = await createContract(context.web3, "TestContract", { + gas: EXTRINSIC_GAS_LIMIT, + }); + const { txResults } = await context.createBlock({ transactions: [rawTx] }); + expect(txResults[0].result).to.not.be.null; + const receipt = await context.web3.eth.getTransaction(txResults[0].result); + expect(receipt.blockHash).to.be.not.null; + }); +}); + +describeDevMoonbeam("Block Gas - Limit", (context) => { + it("should fail setting it over the max block gas", async function () { + const { rawTx } = await createContract(context.web3, "TestContract", { + gas: EXTRINSIC_GAS_LIMIT + 1, + }); + + expect( + ((await customWeb3Request(context.web3, "eth_sendRawTransaction", [rawTx])).error as any) + .message + ).to.equal( + "submit transaction to pool failed: " + + "Pool(InvalidTransaction(InvalidTransaction::ExhaustsResources))" + ); + }); +}); + +describeDevMoonbeam("Block Gas - Limit", (context) => { + // TODO: Joshy to fix block gas access in smart contract + it.skip("should be accessible within a contract", async function () { + const { contract, rawTx } = await createContract(context.web3, "CheckBlockGasLimit"); + await context.createBlock({ transactions: [rawTx] }); + + //console.log("gaslimit", await contract.methods.gaslimit().call()); + expect((await contract.methods.gaslimit().call()) !== "0").to.eq(true); + }); +}); diff --git a/tests/tests/test-block-genesis.ts b/tests/tests/test-block-genesis.ts new file mode 100644 index 00000000000..d7b78e55cac --- /dev/null +++ b/tests/tests/test-block-genesis.ts @@ -0,0 +1,55 @@ +import { expect } from "chai"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; + +describeDevMoonbeam("Block genesis", (context) => { + it("should be at block 0", async function () { + expect(await context.web3.eth.getBlockNumber()).to.equal(0); + }); + + it("should contain block details", async function () { + expect(await context.web3.eth.getBlockNumber()).to.equal(0); + const block = await context.web3.eth.getBlock(0); + expect(block).to.include({ + author: "0x0000000000000000000000000000000000000000", + difficulty: "0", + extraData: "0x", + gasLimit: 15000000, + gasUsed: 0, + logsBloom: `0x${"0".repeat(512)}`, + number: 0, + receiptsRoot: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + totalDifficulty: "0", + transactionsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + }); + + expect(block.transactions).to.be.a("array").empty; + expect(block.uncles).to.be.a("array").empty; + expect((block as any).sealFields).to.eql([ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000", + ]); + expect(block.hash).to.be.a("string").lengthOf(66); + expect(block.parentHash).to.be.a("string").lengthOf(66); + expect(block.timestamp).to.be.a("number"); + }); + + it("should be accessible by hash", async function () { + //fetch block again using hash + const block = await context.web3.eth.getBlock(0); + const blockByHash = await context.web3.eth.getBlock(block.hash); + expect(blockByHash).to.include({ + author: "0x0000000000000000000000000000000000000000", + difficulty: "0", + extraData: "0x", + gasLimit: 15000000, + gasUsed: 0, + logsBloom: `0x${"0".repeat(512)}`, + number: 0, + receiptsRoot: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + totalDifficulty: "0", + transactionsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + }); + }); +}); diff --git a/tests/tests/test-block.ts b/tests/tests/test-block.ts deleted file mode 100644 index 8f3579f0601..00000000000 --- a/tests/tests/test-block.ts +++ /dev/null @@ -1,201 +0,0 @@ -import { expect } from "chai"; -import { step } from "mocha-steps"; -import { contractCreation, GENESIS_ACCOUNT } from "./constants"; - -import { createAndFinalizeBlock, describeWithMoonbeam, fillBlockWithTx } from "./util"; - -describeWithMoonbeam("Moonbeam RPC (Block)", `simple-specs.json`, (context) => { - let previousBlock; - // Those tests are dependant of each other in the given order. - // The reason is to avoid having to restart the node each time - // Running them individually will result in failure - - step("should be at block 0 at genesis", async function () { - expect(await context.web3.eth.getBlockNumber()).to.equal(0); - }); - - step("should return genesis block", async function () { - expect(await context.web3.eth.getBlockNumber()).to.equal(0); - const block = await context.web3.eth.getBlock(0); - expect(block).to.include({ - author: "0x0000000000000000000000000000000000000000", - difficulty: "0", - extraData: "0x", - gasLimit: 15000000, - gasUsed: 0, - logsBloom: `0x${"0".repeat(512)}`, - number: 0, - receiptsRoot: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", - sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", - totalDifficulty: "0", - transactionsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - }); - - expect(block.transactions).to.be.a("array").empty; - expect(block.uncles).to.be.a("array").empty; - expect((block as any).sealFields).to.eql([ - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000", - ]); - expect(block.hash).to.be.a("string").lengthOf(66); - expect(block.parentHash).to.be.a("string").lengthOf(66); - expect(block.timestamp).to.be.a("number"); - }); - - // TODO: unskip this when https://github.com/paritytech/frontier/pull/279 is merged - it.skip("fetch genesis block by hash", async function () { - //fetch block again using hash - const block = await context.web3.eth.getBlock(0); - const blockByHash = await context.web3.eth.getBlock(block.hash); - console.log("blockbyhash", blockByHash); - expect(blockByHash).to.include({ - author: "0x0000000000000000000000000000000000000000", - difficulty: "0", - extraData: "0x", - gasLimit: 4294967295, - gasUsed: 0, - logsBloom: `0x${"0".repeat(512)}`, - number: 0, - receiptsRoot: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", - sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", - totalDifficulty: "0", - transactionsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - }); - }); - - let firstBlockCreated = false; - step("should be at block 1 after block production", async function () { - this.timeout(15000); - await createAndFinalizeBlock(context.polkadotApi); - expect(await context.web3.eth.getBlockNumber()).to.equal(1); - firstBlockCreated = true; - }); - - step("should have valid timestamp after block production", async function () { - // Originally ,this test required the timestamp be in the last finve minutes. - // This requirement doesn't make sense when we forge timestamps in manual seal. - const block = await context.web3.eth.getBlock("latest"); - const next5Minutes = Date.now() / 1000 + 300; - expect(block.timestamp).to.be.least(0); - expect(block.timestamp).to.be.below(next5Minutes); - }); - - step("retrieve block information", async function () { - expect(firstBlockCreated).to.be.true; - - const block = await context.web3.eth.getBlock("latest"); - expect(block).to.include({ - author: "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b", - difficulty: "0", - extraData: "0x", - gasLimit: 15000000, - gasUsed: 0, - //hash: "0x14fe6f7c93597f79b901f8b5d7a84277a90915b8d355959b587e18de34f1dc17", - logsBloom: `0x${"0".repeat(512)}`, - miner: "0x6Be02d1d3665660d22FF9624b7BE0551ee1Ac91b", - number: 1, - //parentHash: "0x04540257811b46d103d9896e7807040e7de5080e285841c5430d1a81588a0ce4", - receiptsRoot: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", - sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", - totalDifficulty: "0", - //transactions: [], - transactionsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - //uncles: [] - }); - previousBlock = block; - - expect(block.transactions).to.be.a("array").empty; - expect(block.uncles).to.be.a("array").empty; - expect((block as any).sealFields).to.eql([ - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000", - ]); - expect(block.hash).to.be.a("string").lengthOf(66); - expect(block.parentHash).to.be.a("string").lengthOf(66); - expect(block.timestamp).to.be.a("number"); - }); - - step("get block by hash", async function () { - const latest_block = await context.web3.eth.getBlock("latest"); - const block = await context.web3.eth.getBlock(latest_block.hash); - expect(block.hash).to.be.eq(latest_block.hash); - }); - - step("get block by number", async function () { - const block = await context.web3.eth.getBlock(1); - expect(block).not.null; - }); - - step("should include previous block hash as parent (block 2)", async function () { - this.timeout(15000); - await createAndFinalizeBlock(context.polkadotApi); - const block = await context.web3.eth.getBlock("latest"); - expect(block.hash).to.not.equal(previousBlock.hash); - expect(block.parentHash).to.equal(previousBlock.hash); - }); - - // tx/block tests - - step("genesis balance enough to make all the transfers", async function () { - expect(Number(await context.web3.eth.getBalance(GENESIS_ACCOUNT))).to.gte(512 * 100000); - }); - - // the maximum number of tx/ blocks is not constant but is always around 1500 - - it("should be able to fill a block with a 1 tx", async function () { - this.timeout(15000); - let { txPassedFirstBlock } = await fillBlockWithTx(context, 1); - expect(txPassedFirstBlock).to.eq(1); - }); - - it.skip("should be able to fill a block with 260 tx", async function () { - this.timeout(15000); - // We have 6_000_000 Gas available for transactions per block. - // Each transaction needs 2_000 (extrinsic cost) + 21_000 (eth cost) - // 6_000_000 / 23_000 = ~260.86 - // The test will send 261 tx and verify the first block contains only 260. - let { txPassed, txPassedFirstBlock } = await fillBlockWithTx(context, 261); - expect(txPassedFirstBlock).to.eq(260); - expect(txPassed).to.eq(261); // including all blocks - }); - - it.skip("should be able to fill a block with 64 contract creations tx", async function () { - this.timeout(15000); - // We have 6_000_000 Gas available for transactions per block. - // Each transaction needs 2_000 (extrinsic cost) + 91019 (contract cost) - // 6_000_000 / 92_019 = ~64.50 - - // The test will send 65 contract tx and verify the first block contains only 64. - let { txPassedFirstBlock } = await fillBlockWithTx(context, 65, contractCreation); - expect(txPassedFirstBlock).to.eq(64); - }); - - // 8192 is the number of tx that can be sent to the Pool - // before it throws an error and drops all tx - - it.skip("should be able to send 8192 tx to the pool and have them all published\ - within the following blocks", async function () { - this.timeout(120000); - let { txPassed } = await fillBlockWithTx(context, 8192); - expect(txPassed).to.eq(8192); - }); - - it.skip("but shouldn't work for 8193", async function () { - this.timeout(120000); - let { txPassed } = await fillBlockWithTx(context, 8193); - expect(txPassed).to.eq(0); - }); - - it.skip("should be able to send 8192 tx to the pool and have them all published\ - within the following blocks - bigger tx", async function () { - this.timeout(120000); - let { txPassed } = await fillBlockWithTx(context, 8192, contractCreation); - expect(txPassed).to.eq(8192); - }); - - it.skip("but shouldn't work for 8193 - bigger tx", async function () { - this.timeout(120000); - let { txPassed } = await fillBlockWithTx(context, 8193, contractCreation); - expect(txPassed).to.eq(0); - }); -}); diff --git a/tests/tests/test-contract-creation.ts b/tests/tests/test-contract-creation.ts new file mode 100644 index 00000000000..b93f4e8f93d --- /dev/null +++ b/tests/tests/test-contract-creation.ts @@ -0,0 +1,41 @@ +import { expect } from "chai"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createContract } from "../util/transactions"; + +describeDevMoonbeam("Contract creation", (context) => { + it("should return the transaction hash", async () => { + const { rawTx } = await createContract(context.web3, "TestContract"); + const { txResults } = await context.createBlock({ transactions: [rawTx] }); + + expect( + txResults[0].result, + "0x286fc7f456a452abb22bc37974fe281164e53ce6381583c8febaa89c92f31c0b" + ); + }); +}); + +describeDevMoonbeam("Contract creation", (context) => { + it("should not contain contract at genesis", async function () { + const { contract, rawTx } = await createContract(context.web3, "TestContract"); + expect(await context.web3.eth.getCode(contract.options.address)).to.deep.equal("0x"); + }); + + it("should store the code on chain", async function () { + const { contract, rawTx } = await createContract(context.web3, "TestContract"); + const { txResults } = await context.createBlock({ transactions: [rawTx] }); + + expect(await context.web3.eth.getCode(contract.options.address)).to.deep.equal( + "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c6888fa114610030575b" + + "600080fd5b61004a6004803603810190610045919061008b565b610060565b60405161005791906100c3565b" + + "60405180910390f35b600060078261006f91906100de565b9050919050565b60008135905061008581610171" + + "565b92915050565b60006020828403121561009d57600080fd5b60006100ab84828501610076565b91505092" + + "915050565b6100bd81610138565b82525050565b60006020820190506100d860008301846100b4565b929150" + + "50565b60006100e982610138565b91506100f483610138565b9250817fffffffffffffffffffffffffffffff" + + "ffffffffffffffffffffffffffffffffff048311821515161561012d5761012c610142565b5b828202905092" + + "915050565b6000819050919050565b7f4e487b71000000000000000000000000000000000000000000000000" + + "00000000600052601160045260246000fd5b61017a81610138565b811461018557600080fd5b5056fea26469" + + "70667358221220a82dff050f5e40b874671c1f40e579b5a8c361f5313d1a9d32437222ab6a384c64736f6c63" + + "430008030033" + ); + }); +}); diff --git a/tests/tests/test-contract-error.ts b/tests/tests/test-contract-error.ts new file mode 100644 index 00000000000..510ecbe9621 --- /dev/null +++ b/tests/tests/test-contract-error.ts @@ -0,0 +1,44 @@ +import { expect } from "chai"; + +import { TransactionReceipt } from "web3-core"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; + +import { createContract, createContractExecution } from "../util/transactions"; + +describeDevMoonbeam("Contract loop error", (context) => { + it("should return OutOfGas on inifinite loop call", async function () { + const { contract, rawTx } = await createContract(context.web3, "InfiniteContract"); + await context.createBlock({ transactions: [rawTx] }); + + await contract.methods + .infinite() + .call({ gas: 12_000_000 }) + .then(() => { + return Promise.reject({ message: "Execution succeeded but should have failed" }); + }) + .catch((err) => expect(err.message).to.equal(`Returned error: out of gas or fund`)); + }); +}); + +describeDevMoonbeam("Contract loop error", (context) => { + it("should fail with OutOfGas on infinite loop transaction", async function () { + const { contract, rawTx } = await createContract(context.web3, "InfiniteContract"); + const infiniteTx = await createContractExecution( + context.web3, + { + contract, + contractCall: contract.methods.infinite(), + }, + { nonce: 1 } + ); + + const { txResults } = await context.createBlock({ + transactions: [rawTx, infiniteTx], + }); + + const receipt: TransactionReceipt = await context.web3.eth.getTransactionReceipt( + txResults[1].result + ); + expect(receipt.status).to.eq(false); + }); +}); diff --git a/tests/tests/test-contract-incr-loop.ts b/tests/tests/test-contract-incr-loop.ts new file mode 100644 index 00000000000..f4e21512b89 --- /dev/null +++ b/tests/tests/test-contract-incr-loop.ts @@ -0,0 +1,30 @@ +import { expect } from "chai"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createContract, createContractExecution } from "../util/transactions"; + +describeDevMoonbeam("Contract loop creation", (context) => { + it("Should be initialized at 0", async () => { + const { contract, rawTx } = await createContract(context.web3, "TestContractIncr"); + await context.createBlock({ transactions: [rawTx] }); + + expect(await contract.methods.count().call()).to.eq("0"); + }); +}); + +describeDevMoonbeam("Contract loop increment", (context) => { + it("should increment contract state", async function () { + const { contract, rawTx } = await createContract(context.web3, "TestContractIncr"); + await context.createBlock({ transactions: [rawTx] }); + + await context.createBlock({ + transactions: [ + await createContractExecution(context.web3, { + contract, + contractCall: contract.methods.incr(), + }), + ], + }); + + expect(await contract.methods.count().call()).to.eq("1"); + }); +}); diff --git a/tests/tests/test-contract-loop-cost.ts b/tests/tests/test-contract-loop-cost.ts new file mode 100644 index 00000000000..ab59c35f41d --- /dev/null +++ b/tests/tests/test-contract-loop-cost.ts @@ -0,0 +1,38 @@ +import { expect } from "chai"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createContract, createContractExecution } from "../util/transactions"; + +[ + { + loop: 1, + gas: 42889, + }, + { + loop: 500, + gas: 1064354, + }, + { + loop: 600, + gas: 1269054, + }, +].forEach(({ loop, gas }) => { + describeDevMoonbeam("Contract loop", (context) => { + it(`should consume ${gas} for ${loop} loop`, async function () { + const { contract, rawTx } = await createContract(context.web3, "FiniteLoopContract"); + await context.createBlock({ transactions: [rawTx] }); + await context.createBlock({ + transactions: [ + await createContractExecution(context.web3, { + contract, + contractCall: contract.methods.incr(loop), + }), + ], + }); + + expect(await contract.methods.count().call()).to.eq(loop.toString()); + + const block = await context.web3.eth.getBlock("latest"); + expect(block.gasUsed).to.eq(gas); + }); + }); +}); diff --git a/tests/tests/test-contract-loops.ts b/tests/tests/test-contract-loops.ts deleted file mode 100644 index 61ff9ad7838..00000000000 --- a/tests/tests/test-contract-loops.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { expect } from "chai"; - -import { TransactionReceipt } from "web3-core"; - -import { callContractFunctionMS, deployContractManualSeal, describeWithMoonbeam } from "./util"; -import { - FINITE_LOOP_CONTRACT_ABI, - FINITE_LOOP_CONTRACT_BYTECODE, - INFINITE_CONTRACT_ABI, - INFINITE_CONTRACT_ABI_VAR, - INFINITE_CONTRACT_BYTECODE, - INFINITE_CONTRACT_BYTECODE_VAR, - TEST_CONTRACT_BYTECODE_INCR, - TEST_CONTRACT_INCR_ABI, -} from "./constants"; - -describeWithMoonbeam("Moonbeam RPC (Contract Loops)", `simple-specs.json`, (context) => { - it("should increment contract state - to check normal contract behavior", async function () { - // // instantiate contract - const contract = await deployContractManualSeal( - context.polkadotApi, - context.web3, - TEST_CONTRACT_BYTECODE_INCR, - TEST_CONTRACT_INCR_ABI - ); - - // check variable initializaion - expect(await contract.methods.count().call()).to.eq("0"); - - // call incr function - let bytesCode: string = await contract.methods.incr().encodeABI(); - await callContractFunctionMS(context, contract.options.address, bytesCode); - - // check variable incrementation - expect(await contract.methods.count().call()).to.eq("1"); - }); - - it("inifinite loop call should return OutOfGas", async function () { - //deploy infinite contract - const contract = await deployContractManualSeal( - context.polkadotApi, - context.web3, - INFINITE_CONTRACT_BYTECODE, - [INFINITE_CONTRACT_ABI] - ); - - // call infinite loop - await contract.methods - .infinite() - .call({ gas: "0x100000" }) - .catch((err) => expect(err.message).to.equal(`Returned error: out of gas or fund`)); - }); - - it("inifinite loop send with incr should return OutOfGas", async function () { - // deploy contract - const contract = await deployContractManualSeal( - context.polkadotApi, - context.web3, - INFINITE_CONTRACT_BYTECODE_VAR, - INFINITE_CONTRACT_ABI_VAR - ); - - //make infinite loop function call - let bytesCode: string = await contract.methods.infinite().encodeABI(); - try { - await callContractFunctionMS(context, contract.options.address, bytesCode); - let block = await context.web3.eth.getBlock("latest"); - const receipt: TransactionReceipt = await context.web3.eth.getTransactionReceipt( - block.transactions[0] - ); - expect(receipt.status).to.eq(false); - } catch (e) { - console.log("error caught", e); - throw new Error(e); - } - }); - - it("finite loop with incr: check gas usage, with normal gas limit,\ - should error before 700 loops", async function () { - // For a normal 1048576 gas limit, loop should revert out of gas between 600 and 700 loops - - //deploy finite loop contract - const contract = await deployContractManualSeal( - context.polkadotApi, - context.web3, - FINITE_LOOP_CONTRACT_BYTECODE, - FINITE_LOOP_CONTRACT_ABI - ); - - //make finite loop function call - async function callLoopIncrContract(nb: number): Promise { - const startIncr: number = Number(await contract.methods.count().call()); - const bytesCode: string = await contract.methods.incr(nb).encodeABI(); - try { - await callContractFunctionMS(context, contract.options.address, bytesCode); - return Number(await contract.methods.count().call()) - startIncr; - } catch (e) { - console.log("error caught", e); - } - } - // 1 loop to make sure it works - expect(await callLoopIncrContract(1)).to.eq(1); - let block = await context.web3.eth.getBlock("latest"); - expect(block.gasUsed).to.eq(42343); //check that gas costs stay the same - - // // 600 loop - expect(await callLoopIncrContract(600)).to.eq(600); - block = await context.web3.eth.getBlock("latest"); - expect(block.gasUsed).to.eq(1024084); //check that gas costs stay the same - - // 700 loop should revert out of gas - expect(await callLoopIncrContract(700)).to.eq(0); - block = await context.web3.eth.getBlock("latest"); - expect(block.gasUsed).to.eq(1048576); //check that gas is the gas limit - const receipt: TransactionReceipt = await context.web3.eth.getTransactionReceipt( - block.transactions[0] - ); - expect(receipt.status).to.eq(false); - }); - // TODO : add test when we have a block limit -}); diff --git a/tests/tests/test-contract-methods.ts b/tests/tests/test-contract-methods.ts index 694e307fa74..44d05ee8d26 100644 --- a/tests/tests/test-contract-methods.ts +++ b/tests/tests/test-contract-methods.ts @@ -1,61 +1,47 @@ import { expect } from "chai"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createContract } from "../util/transactions"; +import { Contract } from "web3-eth-contract"; -import { createAndFinalizeBlock, customRequest, describeWithMoonbeam } from "./util"; -import { - FIRST_CONTRACT_ADDRESS, - GENESIS_ACCOUNT, - GENESIS_ACCOUNT_PRIVATE_KEY, - TEST_CONTRACT_ABI, - TEST_CONTRACT_BYTECODE, -} from "./constants"; +describeDevMoonbeam("Contract creation", (context) => { + let testContract: Contract; + let testContractTx: string; -describeWithMoonbeam("Moonbeam RPC (Contract Methods)", `simple-specs.json`, (context) => { - before("create the contract", async function () { - this.timeout(15000); - const tx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - data: TEST_CONTRACT_BYTECODE, - value: "0x00", - gasPrice: "0x01", - gas: "0x100000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - await customRequest(context.web3, "eth_sendRawTransaction", [tx.rawTransaction]); - await createAndFinalizeBlock(context.polkadotApi); + before("Setup: Create the contract", async function () { + const { contract, rawTx } = await createContract(context.web3, "TestContract"); + const { txResults } = await context.createBlock({ transactions: [rawTx] }); + testContract = contract; + testContractTx = txResults[0].result; }); - it("get transaction by hash", async () => { - const latestBlock = await context.web3.eth.getBlock("latest"); - expect(latestBlock.transactions.length).to.equal(1); - - const tx_hash = latestBlock.transactions[0]; - const tx = await context.web3.eth.getTransaction(tx_hash); - expect(tx.hash).to.equal(tx_hash); + it("should appear in the block transaction list", async () => { + const block = await context.web3.eth.getBlock(1); + const txHash = block.transactions[0]; + expect(txHash).to.equal(testContractTx); }); - it("should return contract method result", async function () { - const contract = new context.web3.eth.Contract([TEST_CONTRACT_ABI], FIRST_CONTRACT_ADDRESS, { - from: GENESIS_ACCOUNT, - gasPrice: "0x01", - }); + it("should be in the transaction list", async () => { + const tx = await context.web3.eth.getTransaction(testContractTx); + expect(tx.hash).to.equal(testContractTx); + }); - expect(await contract.methods.multiply(3).call()).to.equal("21"); + it("should provide callable methods", async function () { + expect(await testContract.methods.multiply(3).call()).to.equal("21"); }); - // Requires error handling - it("should fail for missing parameters", async function () { + + it("should fail for call method with missing parameters", async function () { + // Create a fake contract based on origin deployed contract. + // It make the multiply method supposed to have 0 arguments const contract = new context.web3.eth.Contract( - [{ ...TEST_CONTRACT_ABI, inputs: [] }], - FIRST_CONTRACT_ADDRESS, - { - from: GENESIS_ACCOUNT, - gasPrice: "0x01", - } + [{ ...testContract.options.jsonInterface[0], inputs: [] }], + testContract.options.address ); await contract.methods .multiply() .call() + .then(() => { + return Promise.reject({ message: "Execution succeeded but should have failed" }); + }) .catch((err) => expect(err.message).to.equal( `Returned error: VM Exception while processing transaction: revert` @@ -65,25 +51,27 @@ describeWithMoonbeam("Moonbeam RPC (Contract Methods)", `simple-specs.json`, (co // Requires error handling it("should fail for too many parameters", async function () { + // Create a fake contract based on origin deployed contract. + // It make the multiply method supposed to have 2 arguments const contract = new context.web3.eth.Contract( [ { - ...TEST_CONTRACT_ABI, + ...testContract.options.jsonInterface[0], inputs: [ { internalType: "uint256", name: "a", type: "uint256" }, { internalType: "uint256", name: "b", type: "uint256" }, ], }, ], - FIRST_CONTRACT_ADDRESS, - { - from: GENESIS_ACCOUNT, - gasPrice: "0x01", - } + testContract.options.address ); + await contract.methods .multiply(3, 4) .call() + .then(() => { + return Promise.reject({ message: "Execution succeeded but should have failed" }); + }) .catch((err) => expect(err.message).to.equal( `Returned error: VM Exception while processing transaction: revert` @@ -91,12 +79,13 @@ describeWithMoonbeam("Moonbeam RPC (Contract Methods)", `simple-specs.json`, (co ); }); - // Requires error handling it("should fail for invalid parameters", async function () { + // Create a fake contract based on origin deployed contract. + // It make the multiply method supposed to have a address type argument const contract = new context.web3.eth.Contract( [ { - ...TEST_CONTRACT_ABI, + ...testContract.options.jsonInterface[0], inputs: [ { internalType: "address", @@ -106,12 +95,14 @@ describeWithMoonbeam("Moonbeam RPC (Contract Methods)", `simple-specs.json`, (co ], }, ], - FIRST_CONTRACT_ADDRESS, - { from: GENESIS_ACCOUNT, gasPrice: "0x01" } + testContract.options.address ); await contract.methods .multiply("0x0123456789012345678901234567890123456789") .call() + .then(() => { + return Promise.reject({ message: "Execution succeeded but should have failed" }); + }) .catch((err) => expect(err.message).to.equal( `Returned error: VM Exception while processing transaction: revert` diff --git a/tests/tests/test-contract.ts b/tests/tests/test-contract.ts deleted file mode 100644 index a7c6c7edaaa..00000000000 --- a/tests/tests/test-contract.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { expect } from "chai"; -import { - FIRST_CONTRACT_ADDRESS, - GENESIS_ACCOUNT, - GENESIS_ACCOUNT_PRIVATE_KEY, - TEST_CONTRACT_BYTECODE, -} from "./constants"; - -import { createAndFinalizeBlock, customRequest, describeWithMoonbeam } from "./util"; - -describeWithMoonbeam("Moonbeam RPC (Contract)", `simple-specs.json`, (context) => { - // Those test are ordered. In general this should be avoided, but due to the time it takes - // to spin up a Moonbeam node, it saves a lot of time. - - it("contract creation should return transaction hash", async function () { - this.timeout(15000); - const tx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - data: TEST_CONTRACT_BYTECODE, - value: "0x00", - gasPrice: "0x01", - gas: "0x100000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - - expect( - await customRequest(context.web3, "eth_sendRawTransaction", [tx.rawTransaction]) - ).to.deep.equal({ - id: 1, - jsonrpc: "2.0", - result: "0xe87ed993e4d186748404a52a2d13612eef8356331f30fa6b3fb9bc2c16be2e9c", - }); - - // Verify the contract is not yet stored - expect( - await customRequest(context.web3, "eth_getCode", [FIRST_CONTRACT_ADDRESS]) - ).to.deep.equal({ - id: 1, - jsonrpc: "2.0", - result: "0x", - }); - - // Verify the contract is stored after the block is produced - await createAndFinalizeBlock(context.polkadotApi); - expect( - await customRequest(context.web3, "eth_getCode", [FIRST_CONTRACT_ADDRESS]) - ).to.deep.equal({ - id: 1, - jsonrpc: "2.0", - result: - "0x6080604052348015600f57600080fd5b506004361060285760003560e01c8063c6888fa114602d575b60" + - "0080fd5b605660048036036020811015604157600080fd5b8101908080359060200190929190505050606c" + - "565b6040518082815260200191505060405180910390f35b600060078202905091905056fea265627a7a72" + - "315820f06085b229f27f9ad48b2ff3dd9714350c1698a37853a30136fa6c5a7762af7364736f6c63430005" + - "110032", - }); - }); -}); diff --git a/tests/tests/test-deprecated.ts b/tests/tests/test-deprecated.ts index 7985f0233c0..8ca2d5f16bf 100644 --- a/tests/tests/test-deprecated.ts +++ b/tests/tests/test-deprecated.ts @@ -1,7 +1,8 @@ import { expect } from "chai"; -import { customRequest, describeWithMoonbeam } from "./util"; +import { customWeb3Request } from "../util/providers"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; -describeWithMoonbeam("Moonbeam RPC (Deprecated)", `simple-specs.json`, (context) => { +describeDevMoonbeam("Deprecated RPC", (context) => { // List of deprecated methods [ { method: "eth_getCompilers", params: [] }, @@ -12,8 +13,8 @@ describeWithMoonbeam("Moonbeam RPC (Deprecated)", `simple-specs.json`, (context) }, { method: "eth_compileSerpent", params: ["/* some serpent */"] }, ].forEach(({ method, params }) => { - it(`${method} should be deprecated`, async function () { - expect(await customRequest(context.web3, method, params)).to.deep.equal({ + it(`${method} should be mark as not found`, async function () { + expect(await customWeb3Request(context.web3, method, params)).to.deep.equal({ id: 1, jsonrpc: "2.0", error: { message: `Method not found`, code: -32601 }, diff --git a/tests/tests/test-ethers.ts b/tests/tests/test-ethers.ts index 1e3e823b7e3..d24fa1c09a2 100644 --- a/tests/tests/test-ethers.ts +++ b/tests/tests/test-ethers.ts @@ -1,55 +1,66 @@ -import { createAndFinalizeBlock, describeWithMoonbeam } from "./util"; -import { HttpProvider } from "web3-core"; import { expect } from "chai"; import { ethers } from "ethers"; -import { TEST_CONTRACT_ABI_ETHERS, TEST_CONTRACT_BYTECODE } from "./constants"; +import { GENESIS_ACCOUNT_PRIVATE_KEY } from "../util/constants"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { getCompiled } from "../util/contracts"; -describeWithMoonbeam("Moonbeam RPC (Ethers.js)", `simple-specs.json`, (context) => { - const GENESIS_ACCOUNT_PRIVATE_KEY = - "0x99B3C12287537E38C90A9219D4CB074A89A16E9CDB20BF85728EBD97C343E342"; +describeDevMoonbeam("Ethers.js", (context) => { + it("should get correct network ids", async function () { + expect((await context.ethers.getNetwork()).chainId).to.equal(1281); + }); +}); - it("get network ids", async function () { - // Providers - let prov = context.web3.currentProvider as HttpProvider; - const provider = new ethers.providers.JsonRpcProvider(prov.host); - expect((await provider.getNetwork()).chainId).to.equal(1281); - const providerTestnet = new ethers.providers.JsonRpcProvider( - "https://rpc.testnet.moonbeam.network" +describeDevMoonbeam("Ethers.js contract", (context) => { + it("should be deployable", async function () { + let signer = new ethers.Wallet(GENESIS_ACCOUNT_PRIVATE_KEY, context.ethers); + const contractData = await getCompiled("TestContract"); + const contractFactory = new ethers.ContractFactory( + contractData.contract.abi as ethers.ContractInterface, + contractData.byteCode, + signer ); - expect((await providerTestnet.getNetwork()).chainId).to.equal(1287); - }); - it("deploy contract and interact with it", async function () { - // Providers - let prov = context.web3.currentProvider as HttpProvider; - const provider = new ethers.providers.JsonRpcProvider(prov.host); - let signer = new ethers.Wallet(GENESIS_ACCOUNT_PRIVATE_KEY, provider); + // Must create the block and then wait, because etherjs will wait until + // the contract is mined to return; + let contract = await new Promise(async (resolve) => { + const contractPromise = contractFactory.deploy(); + await context.createBlock(); + resolve(await contractPromise); + }); - // deploy contract - const factory = new ethers.ContractFactory( - [TEST_CONTRACT_ABI_ETHERS] as ethers.ContractInterface, - TEST_CONTRACT_BYTECODE, + expect(contract.address); + expect(await context.web3.eth.getCode(contract.address)).to.be.string; + }); +}); + +describeDevMoonbeam("Ethers.js contract", (context) => { + it("should be callable", async function () { + let signer = new ethers.Wallet(GENESIS_ACCOUNT_PRIVATE_KEY, context.ethers); + const contractData = await getCompiled("TestContract"); + const contractFactory = new ethers.ContractFactory( + contractData.contract.abi as ethers.ContractInterface, + contractData.byteCode, signer ); let contract = await new Promise(async (resolve) => { - const contract = factory.deploy(); - await createAndFinalizeBlock(context.polkadotApi); - resolve(await contract); + const contractPromise = contractFactory.deploy(); + await context.createBlock(); + resolve(await contractPromise); }); - expect(contract.address); - // call method - let res = await new Promise(async (resolve) => { - const re = contract.multiply(3); - await createAndFinalizeBlock(context.polkadotApi); - resolve(await re); + // Must create the block and then wait, because etherjs will wait until + // the contract is mined to return; + let result = await new Promise(async (resolve) => { + const callPromise = contract.multiply(3); + await context.createBlock(); + resolve(await callPromise); }); - expect(res.toString()).to.equal("21"); + expect(result.toString()).to.equal("21"); // Instantiate contract from address const contractFromAddress = new ethers.Contract( contract.address, - [TEST_CONTRACT_ABI_ETHERS] as ethers.ContractInterface, + contractData.contract.abi as ethers.ContractInterface, signer ); expect((await contractFromAddress.multiply(3)).toString()).to.equal("21"); diff --git a/tests/tests/test-ethpool-multiple.ts b/tests/tests/test-ethpool-multiple.ts new file mode 100644 index 00000000000..fd9a15139f3 --- /dev/null +++ b/tests/tests/test-ethpool-multiple.ts @@ -0,0 +1,120 @@ +import { expect } from "chai"; +import { customWeb3Request } from "../util/providers"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createContract } from "../util/transactions"; +import { Transaction } from "web3-core"; + +/* + At rpc-level, there is no interface for retrieving emulated pending transactions - emulated + transactions that exist in the Substrate's pending transaction pool. Instead they are added to a + shared collection (Mutex) with get/set locking to serve requests that ask for this transactions + information before they are included in a block. + We want to test that: + - We resolve multiple promises in parallel that will write in this collection on the rpc-side + - We resolve multiple promises in parallel that will read from this collection on the rpc-side + - We can get the final transaction data once it leaves the pending collection + */ +describeDevMoonbeam("EthPool - Multiple pending transactions", (context) => { + let txHashes: string[]; + + before("Setup: Sending 10 transactions", async function () { + txHashes = await Promise.all( + new Array(10).map(async (_, i) => { + const { rawTx } = await createContract(context.web3, "TestContract", { nonce: i }); + return (await customWeb3Request(context.web3, "eth_sendRawTransaction", [rawTx])).result; + }) + ); + }); + + it("should all be available by hash", async function () { + const txs = ( + await Promise.all( + txHashes.map((txHash) => { + return customWeb3Request(context.web3, "eth_getTransactionByHash", [txHash]); + }) + ) + ).map((response) => response.result as Transaction); + + expect(txs).to.be.lengthOf(10); + for (let i; i < 10; i++) { + expect(txs[i].hash).to.be.equal(txHashes[i]); + } + }); + + it("should all be marked as pending", async function () { + const txs = ( + await Promise.all( + txHashes.map((txHash) => { + return customWeb3Request(context.web3, "eth_getTransactionByHash", [txHash]); + }) + ) + ).map((response) => response.result as Transaction); + + expect(txs).to.be.lengthOf(10); + for (let i; i < 10; i++) { + expect(txs[i].blockNumber).to.be.null; + expect(txs[i].transactionIndex).to.be.null; + } + }); +}); + +describeDevMoonbeam("EthPool - Multiple produced transactions", (context) => { + let txHashes: string[]; + + before("Setup: Sending 10 transactions", async function () { + txHashes = await Promise.all( + new Array(10).map(async (_, i) => { + const { rawTx } = await createContract(context.web3, "TestContract", { nonce: i }); + return (await customWeb3Request(context.web3, "eth_sendRawTransaction", [rawTx])).result; + }) + ); + // Put all the transaction in a produced block + await context.createBlock(); + }); + + it("should all be available by hash", async function () { + const txs = ( + await Promise.all( + txHashes.map((txHash) => { + return customWeb3Request(context.web3, "eth_getTransactionByHash", [txHash]); + }) + ) + ).map((response) => response.result as Transaction); + + expect(txs).to.be.lengthOf(10); + for (let i; i < 10; i++) { + expect(txs[i].hash).to.be.equal(txHashes[i]); + } + }); + + it("should all have assigned block number", async function () { + const txs = ( + await Promise.all( + txHashes.map((txHash) => { + return customWeb3Request(context.web3, "eth_getTransactionByHash", [txHash]); + }) + ) + ).map((response) => response.result as Transaction); + + expect(txs).to.be.lengthOf(10); + for (let i; i < 10; i++) { + expect(txs[i].blockNumber).to.not.be.null; + } + }); + + it("should all have a valid transactionIndex", async function () { + const txs = ( + await Promise.all( + txHashes.map((txHash) => { + return customWeb3Request(context.web3, "eth_getTransactionByHash", [txHash]); + }) + ) + ).map((response) => response.result as Transaction); + + expect(txs).to.be.lengthOf(10); + for (let i; i < 10; i++) { + expect(txs[i].hash).to.be.equal(txHashes[i]); + expect(txs[i].transactionIndex).to.equal(i); + } + }); +}); diff --git a/tests/tests/test-ethpool-nonce-future.ts b/tests/tests/test-ethpool-nonce-future.ts new file mode 100644 index 00000000000..24f93161128 --- /dev/null +++ b/tests/tests/test-ethpool-nonce-future.ts @@ -0,0 +1,53 @@ +import { expect } from "chai"; + +import { createContract, createTransfer } from "../util/transactions"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { customWeb3Request } from "../util/providers"; + +describeDevMoonbeam("EthPool - Future Ethereum transaction", (context) => { + let txHash; + before("Setup: Create a block with transaction", async () => { + const { rawTx } = await createContract(context.web3, "TestContract", { + nonce: 1, + }); + const { txResults } = await context.createBlock({ transactions: [rawTx] }); + txHash = txResults[0].result; + }); + + it("should not be executed until condition is met", async function () { + const transaction = await context.web3.eth.getTransaction(txHash); + expect(transaction.blockNumber).to.be.null; + }); + + // TODO: This is a test once we implement txpool "queued" for ethereum future transaction + it.skip("should appear in the txpool", async function () { + let inspect = await customWeb3Request(context.web3, "txpool_content", []); + expect(inspect.result.pending).to.be.empty; + expect(inspect.result.queued).to.not.be.empty; + }); +}); + +describeDevMoonbeam("EthPool - Future Ethereum transaction", (context) => { + let txHash; + before("Setup: Create a block with transaction", async () => { + const { rawTx } = await createContract(context.web3, "TestContract", { + nonce: 1, + }); + const { txResults } = await context.createBlock({ transactions: [rawTx] }); + txHash = txResults[0].result; + }); + + it("should be executed after condition is met", async function () { + // Create block including transaction with nonce 0 + await context.createBlock({ + transactions: [ + await createTransfer(context.web3, "0x1111111111111111111111111111111111111111", 512, { + nonce: 0, + }), + ], + }); + + const transaction = await context.web3.eth.getTransaction(txHash); + expect(transaction.blockNumber).to.not.be.null; + }); +}); diff --git a/tests/tests/test-event.ts b/tests/tests/test-event.ts new file mode 100644 index 00000000000..510fb424501 --- /dev/null +++ b/tests/tests/test-event.ts @@ -0,0 +1,19 @@ +import { expect } from "chai"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createContract } from "../util/transactions"; +import { GENESIS_ACCOUNT } from "../util/constants"; + +describeDevMoonbeam("Event - Contract", (context) => { + it("should contain event", async function () { + const { rawTx } = await createContract(context.web3, "SingleEventContract", { + from: GENESIS_ACCOUNT, + }); + const { txResults } = await context.createBlock({ transactions: [rawTx] }); + const receipt = await context.web3.eth.getTransactionReceipt(txResults[0].result); + + expect(receipt.logs.length).to.be.eq(1); + expect( + "0x" + receipt.logs[0].topics[1].substring(26, receipt.logs[0].topics[1].length + 1) + ).to.be.eq(GENESIS_ACCOUNT); + }); +}); diff --git a/tests/tests/test-existential-deposit.ts b/tests/tests/test-existential-deposit.ts index 13db1430794..60e44ddc988 100644 --- a/tests/tests/test-existential-deposit.ts +++ b/tests/tests/test-existential-deposit.ts @@ -1,24 +1,23 @@ import { expect } from "chai"; -import { step } from "mocha-steps"; -import { GENESIS_ACCOUNT, GENESIS_ACCOUNT_PRIVATE_KEY, TEST_ACCOUNT } from "./constants"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createTransfer } from "../util/transactions"; +import { GENESIS_ACCOUNT, GENESIS_ACCOUNT_BALANCE } from "../util/constants"; -import { createAndFinalizeBlock, describeWithMoonbeam, customRequest } from "./util"; - -describeWithMoonbeam("Moonbeam RPC (Existential Deposit)", `simple-specs.json`, (context) => { - step("Account is not reaped on zero balance", async function () { - const balance = await context.web3.eth.getBalance(GENESIS_ACCOUNT); - const tx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - to: TEST_ACCOUNT, - value: balance, - gasPrice: "0x00", - gas: "0x100000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - await customRequest(context.web3, "eth_sendRawTransaction", [tx.rawTransaction]); - await createAndFinalizeBlock(context.polkadotApi); +describeDevMoonbeam("Existential Deposit", (context) => { + it("should be disabled (no reaped account on 0 balance)", async function () { + await context.createBlock({ + transactions: [ + await createTransfer( + context.web3, + "0x1111111111111111111111111111111111111111", + GENESIS_ACCOUNT_BALANCE - 21000n, + { + from: GENESIS_ACCOUNT, + gas: 21000, + } + ), + ], + }); expect(parseInt(await context.web3.eth.getBalance(GENESIS_ACCOUNT))).to.eq(0); expect(await context.web3.eth.getTransactionCount(GENESIS_ACCOUNT)).to.eq(1); }); diff --git a/tests/tests/test-filter-api-creation.ts b/tests/tests/test-filter-api-creation.ts new file mode 100644 index 00000000000..9f9c5474f8e --- /dev/null +++ b/tests/tests/test-filter-api-creation.ts @@ -0,0 +1,58 @@ +import { expect } from "chai"; +import { customWeb3Request } from "../util/providers"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createContract } from "../util/transactions"; + +describeDevMoonbeam("Filter API", (context) => { + it("should be able to create a Log filter", async function () { + const { contract, rawTx } = await createContract(context.web3, "SingleEventContract"); + await context.createBlock({ transactions: [rawTx] }); + + const createFilter = await customWeb3Request(context.web3, "eth_newFilter", [ + { + fromBlock: "0x0", + toBlock: "latest", + address: [ + "0xC2Bf5F29a4384b1aB0C063e1c666f02121B6084a", + "0x5c4242beB94dE30b922f57241f1D02f36e906915", + ], + topics: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"], + }, + ]); + expect(createFilter.result).to.be.eq(context.web3.utils.numberToHex(1)); + }); +}); + +describeDevMoonbeam("Filter API - Creating", (context) => { + it("should increment filter id", async function () { + const { contract, rawTx } = await createContract(context.web3, "SingleEventContract"); + await context.createBlock({ transactions: [rawTx] }); + + const createFilter = await customWeb3Request(context.web3, "eth_newFilter", [ + { + fromBlock: "0x1", + toBlock: "0x2", + address: "0xC2Bf5F29a4384b1aB0C063e1c666f02121B6084a", + topics: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"], + }, + ]); + expect(createFilter.result).to.be.eq(context.web3.utils.numberToHex(1)); + + const createFilter2 = await customWeb3Request(context.web3, "eth_newFilter", [ + { + fromBlock: "0x1", + toBlock: "0x2", + address: "0xC2Bf5F29a4384b1aB0C063e1c666f02121B6084a", + topics: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"], + }, + ]); + expect(createFilter2.result).to.be.eq(context.web3.utils.numberToHex(2)); + }); +}); + +describeDevMoonbeam("Filter Block API - Creating", (context) => { + it("should be able to create a Block Log filter", async function () { + const createFilter = await customWeb3Request(context.web3, "eth_newBlockFilter", []); + expect(createFilter.result).to.be.eq(context.web3.utils.numberToHex(1)); + }); +}); diff --git a/tests/tests/test-filter-api-pending.ts b/tests/tests/test-filter-api-pending.ts new file mode 100644 index 00000000000..c9c37695f8c --- /dev/null +++ b/tests/tests/test-filter-api-pending.ts @@ -0,0 +1,12 @@ +import { expect } from "chai"; +import { customWeb3Request } from "../util/providers"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; + +describeDevMoonbeam("Filter Pending Transaction API", (context) => { + it("should not be supported", async function () { + const result = await customWeb3Request(context.web3, "eth_newPendingTransactionFilter", []); + expect(result.error).to.include({ + message: "Method not available.", + }); + }); +}); diff --git a/tests/tests/test-filter-api-polling.ts b/tests/tests/test-filter-api-polling.ts new file mode 100644 index 00000000000..b165b4ff4bc --- /dev/null +++ b/tests/tests/test-filter-api-polling.ts @@ -0,0 +1,83 @@ +import { expect } from "chai"; +import { customWeb3Request } from "../util/providers"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createContract } from "../util/transactions"; + +describeDevMoonbeam("Filter Block API - Polling", (context) => { + it("should return block information", async function () { + const createFilter = await customWeb3Request(context.web3, "eth_newBlockFilter", []); + const block = await context.web3.eth.getBlock("latest"); + + const poll = await customWeb3Request(context.web3, "eth_getFilterChanges", [ + context.web3.utils.numberToHex(createFilter.result), + ]); + expect(poll.result.length).to.be.eq(1); + expect(poll.result[0]).to.be.eq(block.hash); + }); +}); + +describeDevMoonbeam("Filter Block API - Polling", (context) => { + it("should not retrieve previously polled", async function () { + const createFilter = await customWeb3Request(context.web3, "eth_newBlockFilter", []); + + await context.createBlock(); + await customWeb3Request(context.web3, "eth_getFilterChanges", [ + context.web3.utils.numberToHex(createFilter.result), + ]); + + await context.createBlock(); + await context.createBlock(); + + const poll = await customWeb3Request(context.web3, "eth_getFilterChanges", [ + context.web3.utils.numberToHex(createFilter.result), + ]); + + const block2 = await context.web3.eth.getBlock(2); + const block3 = await context.web3.eth.getBlock(3); + + expect(poll.result.length).to.be.eq(2); + expect(poll.result[0]).to.be.eq(block2.hash); + expect(poll.result[1]).to.be.eq(block3.hash); + }); +}); + +describeDevMoonbeam("Filter Block API - Polling", (context) => { + it("should be empty after already polling", async function () { + const createFilter = await customWeb3Request(context.web3, "eth_newBlockFilter", []); + + await context.createBlock(); + await customWeb3Request(context.web3, "eth_getFilterChanges", [ + context.web3.utils.numberToHex(createFilter.result), + ]); + const poll = await customWeb3Request(context.web3, "eth_getFilterChanges", [ + context.web3.utils.numberToHex(createFilter.result), + ]); + + expect(poll.result.length).to.be.eq(0); + }); +}); + +describeDevMoonbeam("Filter Block API - Polling", (context) => { + it("should support filtering created contract", async function () { + const { contract, rawTx } = await createContract(context.web3, "SingleEventContract"); + const { txResults } = await context.createBlock({ transactions: [rawTx] }); + + const receipt = await context.web3.eth.getTransactionReceipt(txResults[0].result); + + const createFilter = await customWeb3Request(context.web3, "eth_newFilter", [ + { + fromBlock: "0x0", + toBlock: "latest", + address: receipt.contractAddress, + topics: receipt.logs[0].topics, + }, + ]); + const poll = await customWeb3Request(context.web3, "eth_getFilterChanges", [ + createFilter.result, + ]); + + expect(poll.result.length).to.be.eq(1); + expect(poll.result[0].address.toLowerCase()).to.be.eq(receipt.contractAddress.toLowerCase()); + expect(poll.result[0].topics).to.be.deep.eq(receipt.logs[0].topics); + }); +}); diff --git a/tests/tests/test-filter-api.ts b/tests/tests/test-filter-api.ts deleted file mode 100644 index 0da84cc85d0..00000000000 --- a/tests/tests/test-filter-api.ts +++ /dev/null @@ -1,314 +0,0 @@ -import { expect } from "chai"; -import { step } from "mocha-steps"; -import { create } from "ts-node"; - -import { createAndFinalizeBlock, describeWithMoonbeam, customRequest } from "./util"; - -describeWithMoonbeam("Moonbeam RPC (EthFilterApi)", `simple-specs.json`, (context) => { - const GENESIS_ACCOUNT = "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b"; - const GENESIS_ACCOUNT_PRIVATE_KEY = - "0x99B3C12287537E38C90A9219D4CB074A89A16E9CDB20BF85728EBD97C343E342"; - - // This reflects the measured gas cost of the transaction at this current point in time. - // It has been known to fluctuate from release to release, so it may need adjustment. - const EXPECTED_TRANSACTION_GAS_COST = 891328; - - const TEST_CONTRACT_BYTECODE = - "0x608060405234801561001057600080fd5b50610041337fffffffffffffffffffffffffffffffffff" + - "ffffffffffffffffffffffffffffff61004660201b60201c565b610291565b600073ffffffffffff" + - "ffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415" + - "6100e9576040517f08c379a000000000000000000000000000000000000000000000000000000000" + - "815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f2074" + - "6865207a65726f20616464726573730081525060200191505060405180910390fd5b610102816002" + - "5461020960201b610c7c1790919060201c565b60028190555061015d816000808573ffffffffffff" + - "ffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260" + - "20019081526020016000205461020960201b610c7c1790919060201c565b6000808473ffffffffff" + - "ffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152" + - "602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff1660" + - "0073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa" + - "952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050" + - "565b600080828401905083811015610287576040517f08c379a00000000000000000000000000000" + - "0000000000000000000000000000815260040180806020018281038252601b8152602001807f5361" + - "66654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060" + - "405180910390fd5b8091505092915050565b610e3a806102a06000396000f3fe6080604052348015" + - "61001057600080fd5b50600436106100885760003560e01c806370a082311161005b57806370a082" + - "31146101fd578063a457c2d714610255578063a9059cbb146102bb578063dd62ed3e146103215761" + - "0088565b8063095ea7b31461008d57806318160ddd146100f357806323b872dd1461011157806339" + - "50935114610197575b600080fd5b6100d9600480360360408110156100a357600080fd5b81019080" + - "803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092" + - "9190505050610399565b604051808215151515815260200191505060405180910390f35b6100fb61" + - "03b7565b6040518082815260200191505060405180910390f35b61017d6004803603606081101561" + - "012757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001" + - "90929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060" + - "2001909291905050506103c1565b604051808215151515815260200191505060405180910390f35b" + - "6101e3600480360360408110156101ad57600080fd5b81019080803573ffffffffffffffffffffff" + - "ffffffffffffffffff1690602001909291908035906020019092919050505061049a565b60405180" + - "8215151515815260200191505060405180910390f35b61023f600480360360208110156102135760" + - "0080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190" + - "50505061054d565b6040518082815260200191505060405180910390f35b6102a160048036036040" + - "81101561026b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16" + - "906020019092919080359060200190929190505050610595565b6040518082151515158152602001" + - "91505060405180910390f35b610307600480360360408110156102d157600080fd5b810190808035" + - "73ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190" + - "505050610662565b604051808215151515815260200191505060405180910390f35b610383600480" + - "3603604081101561033757600080fd5b81019080803573ffffffffffffffffffffffffffffffffff" + - "ffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001" + - "90929190505050610680565b6040518082815260200191505060405180910390f35b60006103ad61" + - "03a6610707565b848461070f565b6001905092915050565b6000600254905090565b60006103ce84" + - "8484610906565b61048f846103da610707565b61048a856040518060600160405280602881526020" + - "01610d7060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffff" + - "ffffffffffffffffffffffffffffffff168152602001908152602001600020600061044061070756" + - "5b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffff" + - "ffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b61070f565b" + - "600190509392505050565b60006105436104a7610707565b8461053e85600160006104b861070756" + - "5b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffff" + - "ffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffff" + - "ffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020" + - "54610c7c90919063ffffffff16565b61070f565b6001905092915050565b60008060008373ffffff" + - "ffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16" + - "8152602001908152602001600020549050919050565b60006106586105a2610707565b8461065385" + - "604051806060016040528060258152602001610de160259139600160006105cc610707565b73ffff" + - "ffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff" + - "16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff16" + - "73ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc" + - "9092919063ffffffff16565b61070f565b6001905092915050565b600061067661066f610707565b" + - "8484610906565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffff" + - "ffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160" + - "002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffff" + - "ffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b" + - "600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffff" + - "ffffffffffff161415610795576040517f08c379a000000000000000000000000000000000000000" + - "0000000000000000008152600401808060200182810382526024815260200180610dbd6024913960" + - "400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273" + - "ffffffffffffffffffffffffffffffffffffffff16141561081b576040517f08c379a00000000000" + - "00000000000000000000000000000000000000000000008152600401808060200182810382526022" + - "815260200180610d286022913960400191505060405180910390fd5b80600160008573ffffffffff" + - "ffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152" + - "60200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffff" + - "ffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ff" + - "ffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffff" + - "ffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051" + - "8082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffff" + - "ffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561098c576040517f" + - "08c379a0000000000000000000000000000000000000000000000000000000008152600401808060" + - "200182810382526025815260200180610d986025913960400191505060405180910390fd5b600073" + - "ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffff" + - "ffffff161415610a12576040517f08c379a000000000000000000000000000000000000000000000" + - "0000000000008152600401808060200182810382526023815260200180610d056023913960400191" + - "505060405180910390fd5b610a7d81604051806060016040528060268152602001610d4a60269139" + - "6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffff" + - "ffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b6000" + - "808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffff" + - "ffffffffff16815260200190815260200160002081905550610b10816000808573ffffffffffffff" + - "ffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020" + - "0190815260200160002054610c7c90919063ffffffff16565b6000808473ffffffffffffffffffff" + - "ffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081" + - "52602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffff" + - "ffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4" + - "a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600083" + - "8311158290610c69576040517f08c379a00000000000000000000000000000000000000000000000" + - "00000000008152600401808060200182810382528381815181526020019150805190602001908083" + - "8360005b83811015610c2e578082015181840152602081019050610c13565b505050509050908101" + - "90601f168015610c5b5780820380516001836020036101000a031916815260200191505b50925050" + - "5060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110" + - "15610cfa576040517f08c379a0000000000000000000000000000000000000000000000000000000" + - "00815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974" + - "696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092" + - "91505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373" + - "45524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a" + - "207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a2074" + - "72616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2074" + - "72616e736665722066726f6d20746865207a65726f206164647265737345524332303a2061707072" + - "6f76652066726f6d20746865207a65726f206164647265737345524332303a206465637265617365" + - "6420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820c7a5ffabf642bda147" + - "00b2de42f8c57b36621af020441df825de45fd2b3e1c5c64736f6c63430005100032"; - - async function sendTransaction(context) { - const tx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - data: TEST_CONTRACT_BYTECODE, - value: "0x00", - gasPrice: "0x01", - gas: "0x" + EXPECTED_TRANSACTION_GAS_COST.toString(16), - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - - await customRequest(context.web3, "eth_sendRawTransaction", [tx.rawTransaction]); - return tx; - } - - step("should create a Log filter and return the ID", async function () { - let create_filter = await customRequest(context.web3, "eth_newFilter", [ - { - fromBlock: "0x0", - toBlock: "latest", - address: [ - "0xC2Bf5F29a4384b1aB0C063e1c666f02121B6084a", - "0x5c4242beB94dE30b922f57241f1D02f36e906915", - ], - topics: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"], - }, - ]); - expect(create_filter.result).to.be.eq("0x1"); - }); - - step("should increment filter ID", async function () { - let create_filter = await customRequest(context.web3, "eth_newFilter", [ - { - fromBlock: "0x1", - toBlock: "0x2", - address: "0xC2Bf5F29a4384b1aB0C063e1c666f02121B6084a", - topics: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"], - }, - ]); - expect(create_filter.result).to.be.eq("0x2"); - }); - - step("should create a Block filter and return the ID", async function () { - let create_filter = await customRequest(context.web3, "eth_newBlockFilter", []); - expect(create_filter.result).to.be.eq("0x3"); - }); - - step( - "should return unsupported error for Pending Transaction filter creation", - async function () { - let r = await customRequest(context.web3, "eth_newPendingTransactionFilter", []); - expect(r.error).to.include({ - message: "Method not available.", - }); - } - ); - - step("should return responses for Block filter polling.", async function () { - let block = await context.web3.eth.getBlock(0); - let poll = await customRequest(context.web3, "eth_getFilterChanges", ["0x3"]); - - expect(poll.result.length).to.be.eq(1); - expect(poll.result[0]).to.be.eq(block.hash); - - await createAndFinalizeBlock(context.polkadotApi); - - block = await context.web3.eth.getBlock(1); - poll = await customRequest(context.web3, "eth_getFilterChanges", ["0x3"]); - - expect(poll.result.length).to.be.eq(1); - expect(poll.result[0]).to.be.eq(block.hash); - - await createAndFinalizeBlock(context.polkadotApi); - await createAndFinalizeBlock(context.polkadotApi); - - block = await context.web3.eth.getBlock(2); - let block_b = await context.web3.eth.getBlock(3); - poll = await customRequest(context.web3, "eth_getFilterChanges", ["0x3"]); - - expect(poll.result.length).to.be.eq(2); - expect(poll.result[0]).to.be.eq(block.hash); - expect(poll.result[1]).to.be.eq(block_b.hash); - }); - - step("should return responses for Log filter polling.", async function () { - // Create contract. - let tx = await sendTransaction(context); - await createAndFinalizeBlock(context.polkadotApi); - let receipt = await context.web3.eth.getTransactionReceipt(tx.transactionHash); - - expect(receipt.logs.length).to.be.eq(1); - - // Create a filter for the created contract. - let create_filter = await customRequest(context.web3, "eth_newFilter", [ - { - fromBlock: "0x0", - toBlock: "latest", - address: receipt.contractAddress, - topics: receipt.logs[0].topics, - }, - ]); - let poll = await customRequest(context.web3, "eth_getFilterChanges", [create_filter.result]); - - expect(poll.result.length).to.be.eq(1); - expect(poll.result[0].address.toLowerCase()).to.be.eq(receipt.contractAddress.toLowerCase()); - expect(poll.result[0].topics).to.be.deep.eq(receipt.logs[0].topics); - - // A subsequent request must be empty. - poll = await customRequest(context.web3, "eth_getFilterChanges", [create_filter.result]); - expect(poll.result.length).to.be.eq(0); - }); - - step("should return response for raw Log filter request.", async function () { - // Create contract. - let tx = await sendTransaction(context); - await createAndFinalizeBlock(context.polkadotApi); - let receipt = await context.web3.eth.getTransactionReceipt(tx.transactionHash); - - expect(receipt.logs.length).to.be.eq(1); - - // Create a filter for the created contract. - let create_filter = await customRequest(context.web3, "eth_newFilter", [ - { - fromBlock: "0x0", - toBlock: "latest", - address: receipt.contractAddress, - topics: receipt.logs[0].topics, - }, - ]); - let poll = await customRequest(context.web3, "eth_getFilterLogs", [create_filter.result]); - - expect(poll.result.length).to.be.eq(1); - expect(poll.result[0].address.toLowerCase()).to.be.eq(receipt.contractAddress.toLowerCase()); - expect(poll.result[0].topics).to.be.deep.eq(receipt.logs[0].topics); - - // A subsequent request must return the same response. - poll = await customRequest(context.web3, "eth_getFilterLogs", [create_filter.result]); - - expect(poll.result.length).to.be.eq(1); - expect(poll.result[0].address.toLowerCase()).to.be.eq(receipt.contractAddress.toLowerCase()); - expect(poll.result[0].topics).to.be.deep.eq(receipt.logs[0].topics); - }); - - step("should uninstall created filters.", async function () { - let create_filter = await customRequest(context.web3, "eth_newBlockFilter", []); - let filter_id = create_filter.result; - - // Should return true when removed from the filter pool. - let uninstall = await customRequest(context.web3, "eth_uninstallFilter", [filter_id]); - expect(uninstall.result).to.be.eq(true); - - // Should return error if does not exist. - let r = await customRequest(context.web3, "eth_uninstallFilter", [filter_id]); - expect(r.error).to.include({ - message: "Filter id 6 does not exist.", - }); - }); - - step("should drain the filter pool.", async function () { - this.timeout(15000); - const block_lifespan_threshold = 100; - - let create_filter = await customRequest(context.web3, "eth_newBlockFilter", []); - let filter_id = create_filter.result; - - for (let i = 0; i <= block_lifespan_threshold; i++) { - await createAndFinalizeBlock(context.polkadotApi); - } - - let r = await customRequest(context.web3, "eth_getFilterChanges", [filter_id]); - expect(r.error).to.include({ - message: "Filter id 6 does not exist.", - }); - }); - - step("should have a filter pool max size of 500.", async function () { - const max_filter_pool = 500; - - for (let i = 0; i < max_filter_pool; i++) { - await customRequest(context.web3, "eth_newBlockFilter", []); - } - - let r = await customRequest(context.web3, "eth_newBlockFilter", []); - expect(r.error).to.include({ - message: "Filter pool is full (limit 500).", - }); - }); -}); diff --git a/tests/tests/test-fork-chain.ts b/tests/tests/test-fork-chain.ts new file mode 100644 index 00000000000..2f8876011f2 --- /dev/null +++ b/tests/tests/test-fork-chain.ts @@ -0,0 +1,52 @@ +import { expect } from "chai"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createTransfer } from "../util/transactions"; + +import { TEST_ACCOUNT } from "../util/constants"; + +describeDevMoonbeam("Fork", (context) => { + it("should change best chain to the longest chain", async function () { + // Creation of the best chain so far, with blocks 0-1-2 + await context.createBlock({ finalize: false }); + await context.createBlock({ finalize: false }); + + // Lets grab the ethereum block hashes so far + let ethHash1 = (await context.web3.eth.getBlock(1)).hash; + let ethHash2 = (await context.web3.eth.getBlock(2)).hash; + + // Now lets fork the chain + let currentHeight = await context.web3.eth.getBlockNumber(); + // We start parenting to the genesis + let parentHash = await context.polkadotApi.rpc.chain.getBlockHash(0); + for (let i = 0; i <= currentHeight; i++) { + parentHash = (await context.createBlock({ parentHash, finalize: false })).block.hash; + } + + // We created at 1 block more than the previous best chain. We should be in the best chain now + // Ethereum blocks should have changed + expect(await context.web3.eth.getBlockNumber()).to.equal(currentHeight + 1); + expect((await context.web3.eth.getBlock(1)).hash).to.not.equal(ethHash1); + expect((await context.web3.eth.getBlock(2)).hash).to.not.equal(ethHash2); + }); +}); + +describeDevMoonbeam("Fork", (context) => { + it("should discard lost transaction on fork", async function () { + // Creation of the best chain so far, with blocks 0-1-2 and a transfer in block 2 + await context.createBlock({ finalize: false }); + const { txResults } = await context.createBlock({ + finalize: false, + transactions: [await createTransfer(context.web3, TEST_ACCOUNT, 512)], + }); + const insertedTx = txResults[0].result; + expect(await context.web3.eth.getTransaction(insertedTx)).to.not.be.null; + + // Fork + let parentHash = await context.polkadotApi.rpc.chain.getBlockHash(0); + parentHash = (await context.createBlock({ parentHash, finalize: false })).block.hash; + parentHash = (await context.createBlock({ parentHash, finalize: false })).block.hash; + parentHash = (await context.createBlock({ parentHash, finalize: false })).block.hash; + + expect(await context.web3.eth.getTransaction(insertedTx)).to.be.null; + }); +}); diff --git a/tests/tests/test-gas-contract-creation.ts b/tests/tests/test-gas-contract-creation.ts new file mode 100644 index 00000000000..b473db8559d --- /dev/null +++ b/tests/tests/test-gas-contract-creation.ts @@ -0,0 +1,17 @@ +import { expect } from "chai"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; + +import { GENESIS_ACCOUNT } from "../util/constants"; +import { getCompiled } from "../util/contracts"; + +describeDevMoonbeam("Estimate Gas - Contract creation", (context) => { + it("should return contract creation gas cost", async function () { + const contract = await getCompiled("TestContract"); + expect( + await context.web3.eth.estimateGas({ + from: GENESIS_ACCOUNT, + data: contract.byteCode, + }) + ).to.equal(149143); + }); +}); diff --git a/tests/tests/test-gas-estimation.ts b/tests/tests/test-gas-estimation.ts new file mode 100644 index 00000000000..7e26070cbe4 --- /dev/null +++ b/tests/tests/test-gas-estimation.ts @@ -0,0 +1,55 @@ +import { expect } from "chai"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; + +import { createContract } from "../util/transactions"; +import { Contract } from "web3-eth-contract"; + +describeDevMoonbeam("Estimate Gas - Multiply", (context) => { + let multContract: Contract; + + before("Setup: Create simple context", async function () { + const { contract, rawTx } = await createContract(context.web3, "TestContract"); + await context.createBlock({ transactions: [rawTx] }); + multContract = contract; + }); + + it("should return correct gas estimation", async function () { + expect(await multContract.methods.multiply(3).estimateGas()).to.equal(21994); + }); + + it("should work without gas limit", async function () { + expect( + await multContract.methods.multiply(3).estimateGas({ + gas: null, + }) + ).to.equal(21994); + }); + + it("should work with gas limit", async function () { + expect( + await multContract.methods.multiply(3).estimateGas({ + gas: 21994, + }) + ).to.equal(21994); + }); + + it("should ignore from balance (?)", async function () { + expect( + await multContract.methods.multiply(3).estimateGas({ + gas: 21994, + }) + ).to.equal(21994); + }); + + it("should fail with a lower gas limit", async function () { + await multContract.methods + .multiply(3) + .estimateGas({ + gas: 21993, + }) + .then(() => { + return Promise.reject({ message: "Execution succeeded but should have failed" }); + }) + .catch((err) => expect(err.message).to.equal(`Returned error: out of gas or fund`)); + }); +}); diff --git a/tests/tests/test-gas.ts b/tests/tests/test-gas.ts deleted file mode 100644 index 381c319d0cc..00000000000 --- a/tests/tests/test-gas.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { expect } from "chai"; - -import { describeWithMoonbeam, customRequest, createAndFinalizeBlock } from "./util"; -import { AbiItem } from "web3-utils"; -import { - FIRST_CONTRACT_ADDRESS, - GENESIS_ACCOUNT, - GENESIS_ACCOUNT_PRIVATE_KEY, - // Solidity: - // contract test { - // function multiply(uint a) public pure returns(uint d) {return a * 7;} - // } - TEST_CONTRACT_BYTECODE, - TEST_CONTRACT_ABI, -} from "./constants"; - -describeWithMoonbeam("Moonbeam RPC (Gas)", `simple-specs.json`, (context) => { - // Those test are ordered. In general this should be avoided, but due to the time it takes - // to spin up a Moonbeam node, it saves a lot of time. - - it("eth_estimateGas for contract creation", async function () { - expect( - await context.web3.eth.estimateGas({ - from: GENESIS_ACCOUNT, - data: TEST_CONTRACT_BYTECODE, - }) - ).to.equal(91019); - }); - - it("eth_estimateGas for contract call", async function () { - const contract = new context.web3.eth.Contract([TEST_CONTRACT_ABI], FIRST_CONTRACT_ADDRESS, { - from: GENESIS_ACCOUNT, - gasPrice: "0x01", - }); - - expect(await contract.methods.multiply(3).estimateGas()).to.equal(21204); - }); - - it("eth_estimateGas without gas_limit should pass", async function () { - const contract = new context.web3.eth.Contract([TEST_CONTRACT_ABI], FIRST_CONTRACT_ADDRESS, { - from: GENESIS_ACCOUNT, - }); - - expect(await contract.methods.multiply(3).estimateGas()).to.equal(21204); - }); - - // Current gas per second - const GAS_PER_SECOND = 40_000_000; - // The real computation is 1_000_000_000_000 / 40_000_000, but we simplify to avoid bigint. - const GAS_PER_WEIGHT = 1_000_000 / 40; - - // Our weight limit is 500ms. - const BLOCK_TX_LIMIT = GAS_PER_SECOND * 0.5; - - // Current implementation is limiting block transactions to 75% of the block gas limit - const BLOCK_TX_GAS_LIMIT = BLOCK_TX_LIMIT * 0.75; - const EXTRINSIC_BASE_COST = 125_000_000 / GAS_PER_WEIGHT; // 125_000_000 Weight per extrinsics - - // Maximum extrinsic weight is taken from the max allowed transaction weight per block, - // minus the block initialization (10%) and minus the extrinsic base cost. - const EXTRINSIC_GAS_LIMIT = BLOCK_TX_GAS_LIMIT - BLOCK_TX_LIMIT * 0.1 - EXTRINSIC_BASE_COST; - - it("gas limit should be fine up to the weight limit", async function () { - const nonce = await context.web3.eth.getTransactionCount(GENESIS_ACCOUNT); - const goodTx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - data: TEST_CONTRACT_BYTECODE, - value: "0x00", - gasPrice: "0x01", - gas: EXTRINSIC_GAS_LIMIT, // Todo: fix (remove eth base cost) - nonce, - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - let resp = await customRequest(context.web3, "eth_sendRawTransaction", [goodTx.rawTransaction]); - expect(resp.result).to.be.length(66); - }); - - it("gas limit should be limited by weight", async function () { - const nonce = await context.web3.eth.getTransactionCount(GENESIS_ACCOUNT); - const badTx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - data: TEST_CONTRACT_BYTECODE, - value: "0x00", - gasPrice: "0x01", - gas: EXTRINSIC_GAS_LIMIT + 1, - nonce: nonce, - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - expect( - ((await customRequest(context.web3, "eth_sendRawTransaction", [badTx.rawTransaction])) - .error as any).message - ).to.equal( - "submit transaction to pool failed: " + - "Pool(InvalidTransaction(InvalidTransaction::ExhaustsResources))" - ); - }); -}); diff --git a/tests/tests/test-nonce.ts b/tests/tests/test-nonce.ts index f6ae78df043..232b70bf605 100644 --- a/tests/tests/test-nonce.ts +++ b/tests/tests/test-nonce.ts @@ -1,71 +1,75 @@ import { expect } from "chai"; -import { step } from "mocha-steps"; -import { createAndFinalizeBlock, describeWithMoonbeam, customRequest } from "./util"; -import { Keyring } from "@polkadot/keyring"; -import { GENESIS_ACCOUNT, GENESIS_ACCOUNT_PRIVATE_KEY, TEST_ACCOUNT } from "./constants"; +import { GENESIS_ACCOUNT } from "../util/constants"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createTransfer } from "../util/transactions"; +import { customWeb3Request } from "../util/providers"; -describeWithMoonbeam("Moonbeam RPC (Nonce)", `simple-specs.json`, (context) => { - step("get nonce", async function () { - this.timeout(10_000); - const tx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - to: TEST_ACCOUNT, - value: "0x200", - gasPrice: "0x01", - gas: "0x100000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - - expect(await context.web3.eth.getTransactionCount(GENESIS_ACCOUNT, "earliest")).to.eq(0); +describeDevMoonbeam("Nonce - Initial", (context) => { + it("should be at 0 before using it", async function () { + expect( + await context.web3.eth.getTransactionCount("0x1111111111111111111111111111111111111111") + ).to.eq(0); + }); - await customRequest(context.web3, "eth_sendRawTransaction", [tx.rawTransaction]); + it("should be at 0 for genesis account", async function () { + expect(await context.web3.eth.getTransactionCount(GENESIS_ACCOUNT)).to.eq(0); + }); - expect(await context.web3.eth.getTransactionCount(GENESIS_ACCOUNT, "latest")).to.eq(0); - expect(await context.web3.eth.getTransactionCount(GENESIS_ACCOUNT, "pending")).to.eq(1); + it("should stay at 0 before block is created", async function () { + await customWeb3Request(context.web3, "eth_sendRawTransaction", [ + await createTransfer(context.web3, GENESIS_ACCOUNT, 512), + ]); + expect(await context.web3.eth.getTransactionCount(GENESIS_ACCOUNT)).to.eq(0); + }); +}); - await createAndFinalizeBlock(context.polkadotApi); +describeDevMoonbeam("Nonce - Previous block", (context) => { + before("Setup: Create block with transfer", async () => { + await context.createBlock({ + transactions: [ + await createTransfer(context.web3, "0x1111111111111111111111111111111111111111", 512), + ], + }); + }); + it("should be at 0 after transferring", async function () { + expect(await context.web3.eth.getTransactionCount(GENESIS_ACCOUNT, 0)).to.eq(0); + }); +}); - expect(await context.web3.eth.getTransactionCount(GENESIS_ACCOUNT, "latest")).to.eq(1); +describeDevMoonbeam("Nonce - Pending transaction", (context) => { + before("Setup: Create block with transfer", async () => { + await customWeb3Request(context.web3, "eth_sendRawTransaction", [ + await createTransfer(context.web3, "0x1111111111111111111111111111111111111111", 512), + ]); + }); + it("should not increase transaction count", async function () { + expect(await context.web3.eth.getTransactionCount(GENESIS_ACCOUNT)).to.eq(0); + }); + it("should not increase transaction count in latest block", async function () { + expect(await context.web3.eth.getTransactionCount(GENESIS_ACCOUNT, "latest")).to.eq(0); + }); + it("should increase transaction count in pending block", async function () { expect(await context.web3.eth.getTransactionCount(GENESIS_ACCOUNT, "pending")).to.eq(1); - expect(await context.web3.eth.getTransactionCount(GENESIS_ACCOUNT, "earliest")).to.eq(0); }); +}); - it("nonce should not be reset to 0 when emptying dust accounts", async function () { - this.timeout(15000); - - const testAccountPrivateKey1 = context.web3.utils.randomHex(32); - const testAccountPrivateKey2 = context.web3.utils.randomHex(32); - const keyring = new Keyring({ type: "ethereum" }); - const testAccount1 = await keyring.addFromUri(testAccountPrivateKey1, null, "ethereum"); - const testAccount2 = await keyring.addFromUri(testAccountPrivateKey2, null, "ethereum"); - const genesisAccount = await keyring.addFromUri(GENESIS_ACCOUNT_PRIVATE_KEY, null, "ethereum"); - - const info = await context.polkadotApi.tx.balances - .transfer(testAccount1.address, 1) - .paymentInfo(genesisAccount); - - // We should estimate the fee to ensure we are transferring enough funds - const fee = info.partialFee.toNumber(); - - await context.polkadotApi.tx.balances - .transfer(testAccount1.address, fee + 1) - .signAndSend(genesisAccount); - await createAndFinalizeBlock(context.polkadotApi); - - await context.polkadotApi.tx.balances - .transfer(testAccount2.address, 1) - .signAndSend(testAccount1); - - await createAndFinalizeBlock(context.polkadotApi); +describeDevMoonbeam("Nonce - Transferring", (context) => { + it("Setup: Sending token", async function () { + await context.createBlock({ + transactions: [ + await createTransfer(context.web3, "0x1111111111111111111111111111111111111111", 512), + ], + }); + }); - const { nonce, data: balance } = await context.polkadotApi.query.system.account( - testAccount1.address - ); + it("should increase the sender nonce", async function () { + expect(await context.web3.eth.getTransactionCount(GENESIS_ACCOUNT)).to.eq(1); + }); - expect(nonce.toNumber()).to.equal(1); - expect(balance.free.toNumber()).to.equal(0); + it("should not increase the receiver nonce", async function () { + expect( + await context.web3.eth.getTransactionCount("0x1111111111111111111111111111111111111111") + ).to.eq(0); }); }); diff --git a/tests/tests/test-pending-pool.ts b/tests/tests/test-pending-pool.ts deleted file mode 100644 index 5021beae8b6..00000000000 --- a/tests/tests/test-pending-pool.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { expect } from "chai"; -import { GENESIS_ACCOUNT, GENESIS_ACCOUNT_PRIVATE_KEY, TEST_CONTRACT_BYTECODE } from "./constants"; - -import { createAndFinalizeBlock, customRequest, describeWithMoonbeam } from "./util"; - -describeWithMoonbeam("Frontier RPC (Pending Pool)", `simple-specs.json`, (context) => { - // Solidity: contract test { function multiply(uint a) public pure returns(uint d) - // {return a * 7;}} - - it("should return a pending transaction", async function () { - this.timeout(15000); - const tx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - data: TEST_CONTRACT_BYTECODE, - value: "0x00", - gasPrice: "0x01", - gas: "0x100000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - - const tx_hash = ( - await customRequest(context.web3, "eth_sendRawTransaction", [tx.rawTransaction]) - ).result; - - const pending_transaction = ( - await customRequest(context.web3, "eth_getTransactionByHash", [tx_hash]) - ).result; - // pending transactions do not know yet to which block they belong to - expect(pending_transaction).to.include({ - blockNumber: null, - hash: tx_hash, - publicKey: - "0x624f720eae676a04111631c9ca338c11d0f5a80ee42210c6be72983ceb620fbf645a96f951529f" + - "a2d70750432d11b7caba5270c4d677255be90b3871c8c58069", - r: "0xe6f6ef2c1072b0e4a6b91f6b8ca408478814611124a54f3bb5c02c039e9541f1", - s: "0x5c3a49963649c8812de3aa8b84adf77c14e74eea6191a7827e1273158007bac8", - v: "0xa26", - }); - - await createAndFinalizeBlock(context.polkadotApi); - - const processed_transaction = ( - await customRequest(context.web3, "eth_getTransactionByHash", [tx_hash]) - ).result; - expect(processed_transaction).to.include({ - blockNumber: "0x1", - hash: tx_hash, - publicKey: - "0x624f720eae676a04111631c9ca338c11d0f5a80ee42210c6be72983ceb620fbf645a96f951529f" + - "a2d70750432d11b7caba5270c4d677255be90b3871c8c58069", - r: "0xe6f6ef2c1072b0e4a6b91f6b8ca408478814611124a54f3bb5c02c039e9541f1", - s: "0x5c3a49963649c8812de3aa8b84adf77c14e74eea6191a7827e1273158007bac8", - v: "0xa26", - }); - }); -}); diff --git a/tests/tests/test-polkadot-api.ts b/tests/tests/test-polkadot-api.ts index 0827e7d8227..1801d1d98e5 100644 --- a/tests/tests/test-polkadot-api.ts +++ b/tests/tests/test-polkadot-api.ts @@ -1,44 +1,49 @@ import { expect } from "chai"; -import { Keyring } from "@polkadot/keyring"; -import { step } from "mocha-steps"; -import { createAndFinalizeBlock, describeWithMoonbeam } from "./util"; import { AnyTuple, IEvent } from "@polkadot/types/types"; -import { GENESIS_ACCOUNT, GENESIS_ACCOUNT_PRIVATE_KEY } from "./constants"; +import { GENESIS_ACCOUNT } from "../util/constants"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import Keyring from "@polkadot/keyring"; +import { GENESIS_ACCOUNT_PRIVATE_KEY } from "../util/constants"; -describeWithMoonbeam("Moonbeam Polkadot API", `simple-specs.json`, (context) => { - step("api can retrieve last header", async function () { +describeDevMoonbeam("Polkadot API - Header", (context) => { + it("should return genesis block", async function () { const lastHeader = await context.polkadotApi.rpc.chain.getHeader(); expect(Number(lastHeader.number) >= 0).to.be.true; }); +}); - step("api can retrieve last block", async function () { - const signedBlock = await context.polkadotApi.rpc.chain.getBlock(); - expect(signedBlock.block.header.number.toNumber() >= 0).to.be.true; +describeDevMoonbeam("Polkadot API", (context) => { + before("Setup: Create empty block", async () => { + await context.createBlock(); }); - const TEST_ACCOUNT_2 = "0x1111111111111111111111111111111111111112"; + it("should return latest header number", async function () { + const lastHeader = await context.polkadotApi.rpc.chain.getHeader(); + expect(Number(lastHeader.number)).to.be.at.least(0); + }); - step("transfer from polkadotjs should appear in ethereum", async function () { - this.timeout(30000); + it("should return latest block number", async function () { + const signedBlock = await context.polkadotApi.rpc.chain.getBlock(); + expect(signedBlock.block.header.number.toNumber() >= 0).to.be.true; + }); +}); +describeDevMoonbeam("Polkadot API - Transfers", (context) => { + const testAccount = "0x1111111111111111111111111111111111111111"; + before("Setup: Create empty block with balance.transfer", async () => { const keyring = new Keyring({ type: "ethereum" }); - const testAccount = await keyring.addFromUri(GENESIS_ACCOUNT_PRIVATE_KEY, null, "ethereum"); - try { - let hash = await context.polkadotApi.tx.balances - .transfer(TEST_ACCOUNT_2, 123) - .signAndSend(testAccount); - } catch (e) { - expect(false, "error during polkadot api transfer" + e); - } - // TODO: do some testing with the hash - await createAndFinalizeBlock(context.polkadotApi); - expect(await context.web3.eth.getBalance(TEST_ACCOUNT_2)).to.equal("123"); + const genesisAccount = await keyring.addFromUri(GENESIS_ACCOUNT_PRIVATE_KEY, null, "ethereum"); + await context.polkadotApi.tx.balances.transfer(testAccount, 123).signAndSend(genesisAccount); + await context.createBlock(); + }); + + it("should be stored on chain", async function () { + expect(await context.web3.eth.getBalance(testAccount)).to.equal("123"); }); - step("read extrinsic information", async function () { + it("should appear in extrinsics", async function () { const signedBlock = await context.polkadotApi.rpc.chain.getBlock(); - expect(signedBlock.block.header.number.toNumber() >= 0).to.be.true; // Expecting 4 extrinsics so far: // timestamp, author, the parachain validation data and the balances transfer. @@ -46,7 +51,6 @@ describeWithMoonbeam("Moonbeam Polkadot API", `simple-specs.json`, (context) => signedBlock.block.extrinsics.forEach((ex, index) => { const { - isSigned, method: { args, method, section }, } = ex; const message = `${section}.${method}(${args.map((a) => a.toString()).join(", ")})`; @@ -63,10 +67,10 @@ describeWithMoonbeam("Moonbeam Polkadot API", `simple-specs.json`, (context) => ); break; case 3: - expect(ex.signer.toString().toLocaleLowerCase()).to.eq(GENESIS_ACCOUNT); expect(message).to.eq( - `balances.transfer(0x1111111111111111111111111111111111111112, 123)` + `balances.transfer(0x1111111111111111111111111111111111111111, 123)` ); + expect(ex.signer.toString().toLocaleLowerCase()).to.eq(GENESIS_ACCOUNT); break; default: throw new Error(`Unexpected extrinsic: ${message}`); @@ -74,7 +78,7 @@ describeWithMoonbeam("Moonbeam Polkadot API", `simple-specs.json`, (context) => }); }); - step("read extrinsic events", async function () { + it("should appear in events", async function () { const signedBlock = await context.polkadotApi.rpc.chain.getBlock(); const allRecords = await context.polkadotApi.query.system.events.at( signedBlock.block.header.hash diff --git a/tests/tests/test-precompile-bn128add.ts b/tests/tests/test-precompile-bn128add.ts new file mode 100644 index 00000000000..bf070d60b90 --- /dev/null +++ b/tests/tests/test-precompile-bn128add.ts @@ -0,0 +1,17 @@ +import { expect } from "chai"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createContract } from "../util/transactions"; + +describeDevMoonbeam("Precompiles - bn128add", (context) => { + it("should be accessible from a smart contract", async function () { + const { rawTx } = await createContract(context.web3, "Bn128Addition"); + await context.createBlock({ transactions: [rawTx] }); + + // Because the call to bn128add is in the constructor of HashRipmd160, verifying the code + // is enough. + expect(await context.web3.eth.getCode("0xc2bf5f29a4384b1ab0c063e1c666f02121b6084a")).equals( + "0x6080604052600080fdfea2646970667358221220a18633c4ec2f5fd19918720cc9181bf5" + + "3e954372785d2b34c64298c5275b4d5264736f6c63430008030033" + ); + }); +}); diff --git a/tests/tests/test-precompile-bn128mul.ts b/tests/tests/test-precompile-bn128mul.ts new file mode 100644 index 00000000000..6c34cfc5abf --- /dev/null +++ b/tests/tests/test-precompile-bn128mul.ts @@ -0,0 +1,17 @@ +import { expect } from "chai"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createContract } from "../util/transactions"; + +describeDevMoonbeam("Precompiles - bn128mul", (context) => { + it("should be accessible from a smart contract", async function () { + const { rawTx } = await createContract(context.web3, "Bn128Multiply"); + await context.createBlock({ transactions: [rawTx] }); + + // Because the call to bn128mul is in the constructor of HashRipmd160, verifying the code + // is enough. + expect(await context.web3.eth.getCode("0xc2bf5f29a4384b1ab0c063e1c666f02121b6084a")).equals( + "0x6080604052600080fdfea26469706673582212209a97bc97d5e3a377e8298e3b3a72b24963" + + "abb30bc27bb2266ae137b12aac8cc964736f6c63430008030033" + ); + }); +}); diff --git a/tests/tests/test-precompile-bn128pairing.ts b/tests/tests/test-precompile-bn128pairing.ts new file mode 100644 index 00000000000..ecd071899dd --- /dev/null +++ b/tests/tests/test-precompile-bn128pairing.ts @@ -0,0 +1,17 @@ +import { expect } from "chai"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createContract } from "../util/transactions"; + +describeDevMoonbeam("Precompiles - bn128Pairing", (context) => { + it("should be accessible from a smart contract", async function () { + const { rawTx } = await createContract(context.web3, "Bn128Pairing"); + await context.createBlock({ transactions: [rawTx] }); + + // Because the call to bn128mul is in the constructor of HashRipmd160, verifying the code + // is enough. + expect(await context.web3.eth.getCode("0xc2bf5f29a4384b1ab0c063e1c666f02121b6084a")).equals( + "0x6080604052600080fdfea2646970667358221220e90355f07d7a4ae3a9df347abcddaab" + + "722cb5be69464e1ff818d231c9ee0b8de64736f6c63430008030033" + ); + }); +}); diff --git a/tests/tests/test-precompile-modexp.ts b/tests/tests/test-precompile-modexp.ts new file mode 100644 index 00000000000..42743bb8806 --- /dev/null +++ b/tests/tests/test-precompile-modexp.ts @@ -0,0 +1,16 @@ +import { expect } from "chai"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createContract } from "../util/transactions"; + +describeDevMoonbeam("Precompiles - ModExp", (context) => { + it("should be accessible from a smart contract", async function () { + // See also the ModExp unit tests at + // github.com/paritytech/frontier/blob/378221a4/frame/evm/precompile/modexp/src/lib.rs#L101 + const { contract, rawTx } = await createContract(context.web3, "ModularCheck"); + const { txResults } = await context.createBlock({ transactions: [rawTx] }); + + // The contract should deploy successfully and the receipt should show success. + const receipt = await context.web3.eth.getTransactionReceipt(txResults[0].result); + expect(receipt.status).to.be.true; + }); +}); diff --git a/tests/tests/test-precompile-ripemd160.ts b/tests/tests/test-precompile-ripemd160.ts new file mode 100644 index 00000000000..d00caff54e5 --- /dev/null +++ b/tests/tests/test-precompile-ripemd160.ts @@ -0,0 +1,38 @@ +import { expect } from "chai"; +import { GENESIS_ACCOUNT } from "../util/constants"; +import { customWeb3Request } from "../util/providers"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createContract } from "../util/transactions"; + +describeDevMoonbeam("Precompiles - ripemd160 ", (context) => { + it("should be valid", async function () { + const txCall = await customWeb3Request(context.web3, "eth_call", [ + { + from: GENESIS_ACCOUNT, + value: "0x0", + gas: "0x10000", + gasPrice: "0x01", + to: "0x0000000000000000000000000000000000000003", + data: `0x${Buffer.from("Hello world!").toString("hex")}`, + }, + ]); + + expect(txCall.result).equals( + "0x0000000000000000000000007f772647d88750add82d8e1a7a3e5c0902a346a3" + ); + }); +}); + +describeDevMoonbeam("Precompiles - ripemd160 ", (context) => { + it("should be accessible from a smart contract", async function () { + const { contract, rawTx } = await createContract(context.web3, "HashRipmd160"); + await context.createBlock({ transactions: [rawTx] }); + + // Because the call to ripemd160 is in the constructor of HashRipmd160, verifying the code + // is enough + expect(await context.web3.eth.getCode("0xc2bf5f29a4384b1ab0c063e1c666f02121b6084a")).equals( + "0x6080604052600080fdfea26469706673582212202a18a661fdf5ea3600714f19a16e1681d5c651e" + + "3b23f5a55166c1372b7f4119b64736f6c63430008030033" + ); + }); +}); diff --git a/tests/tests/test-precompiles.ts b/tests/tests/test-precompiles.ts deleted file mode 100644 index 67586c8e96c..00000000000 --- a/tests/tests/test-precompiles.ts +++ /dev/null @@ -1,361 +0,0 @@ -import { expect } from "chai"; -import { createAndFinalizeBlock, customRequest, describeWithMoonbeam } from "./util"; - -// All test for the RPC - -describeWithMoonbeam("Moonbeam (Precompiles)", `simple-specs.json`, (context) => { - /* - * pragma solidity ^0.7.0; - * contract HashRipmd160{ - * constructor() { - * require(ripemd160(bytes ('Hello World!')) == - * hex'8476ee4631b9b30ac2754b0ee0c47e161d3f724c'); - * } - * } - */ - const RIPEMD160_CONTRACT_BYTECODE = - "608060405234801561001057600080fd5b507f8476ee4631b9b30ac275" + - "4b0ee0c47e161d3f724c00000000000000000000000060036040518060400160405280600c81526020017f48656c" + - "6c6f20576f726c642100000000000000000000000000000000000000008152506040518082805190602001908083" + - "835b6020831061009d578051825260208201915060208101905060208303925061007a565b600183602003610100" + - "0a038019825116818451168082178552505050505050905001915050602060405180830381855afa1580156100df" + - "573d6000803e3d6000fd5b5050506040515160601b6bffffffffffffffffffffffff19161461010257600080fd5b" + - "603f806101106000396000f3fe6080604052600080fdfea26469706673582212202febccafbee65a134279d3397f" + - "ecfc56a3d2125987802a91add0260c7efa94d264736f6c634300060c0033"; - - /* pragma solidity ^0.7.0; - * contract Bn128Addition{ - * constructor() { - * bool success; - * uint256[4] memory input = [ - * 0x2243525c5efd4b9c3d3c45ac0ca3fe4dd85e830a4ce6b65fa1eeaee202839703, - * 0x301d1d33be6da8e509df21cc35964723180eed7532537db9ae5e7d48f195c915, - * 0x18b18acfb4c2c30276db5411368e7185b311dd124691610c5d3b74034e093dc9, - * 0x063c909c4720840cb5134cb9f59fa749755796819658d32efc0d288198f37266 - * ]; - * uint256[2] memory result; - * - * assembly { - * // 0x06 id of the bn256Add precompile - * // 0 number of ether to transfer - * // 128 size of call parameters, i.e. 128 bytes total - * // 64 size of return value, i.e. 64 bytes / 512 bit for a BN256 curve point - * success := call(not(0), 0x06, 0, input, 128, result, 64) - * } - * require(success, "elliptic curve addition failed"); - * require( - * result[0] == - * 0x2bd3e6d0f3b142924f5ca7b49ce5b9d54c4703d7ae5648e61d02268b1a0a9fb7, - * "failed"); - * require( - * result[1] == - * 0x21611ce0a6af85915e2f1d70300909ce2e49dfad4a4619c8390cae66cefdb204, - * "failed"); - * } - *} - */ - - const BN128ADD_CONTRACT_BYTECODE = - "608060405234801561001057600080fd5b5060008060405180608001604" + - "052807f2243525c5efd4b9c3d3c45ac0ca3fe4dd85e830a4ce6b65fa1eeaee20283970381526020017f301d1d3" + - "3be6da8e509df21cc35964723180eed7532537db9ae5e7d48f195c91581526020017f18b18acfb4c2c30276db5" + - "411368e7185b311dd124691610c5d3b74034e093dc981526020017f063c909c4720840cb5134cb9f59fa749755" + - "796819658d32efc0d288198f3726681525090506100bf610296565b60408160808460006006600019f19250826" + - "10142576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018" + - "0806020018281038252601e8152602001807f656c6c6970746963206375727665206164646974696f6e2066616" + - "96c6564000081525060200191505060405180910390fd5b7f2bd3e6d0f3b142924f5ca7b49ce5b9d54c4703d7a" + - "e5648e61d02268b1a0a9fb78160006002811061017057fe5b6020020151146101e8576040517f08c379a000000" + - "000000000000000000000000000000000000000000000000000815260040180806020018281038252600681526" + - "02001807f6661696c6564000000000000000000000000000000000000000000000000000081525060200191505" + - "060405180910390fd5b7f21611ce0a6af85915e2f1d70300909ce2e49dfad4a4619c8390cae66cefdb20481600" + - "16002811061021657fe5b60200201511461028e576040517f08c379a0000000000000000000000000000000000" + - "0000000000000000000000081526004018080602001828103825260068152602001807f6661696c65640000000" + - "00000000000000000000000000000000000000000000081525060200191505060405180910390fd5b505050610" + - "2b8565b6040518060400160405280600290602082028036833780820191505090505090565b603f806102c6600" + - "0396000f3fe6080604052600080fdfea264697066735822122075fa7407f63bde9752715fbe31095ab6ad9273e" + - "2d758ca548cdb9d581cc4fcd264736f6c63430007060033"; - - /*pragma solidity ^0.7.0; - * contract Bn128Addition{ - * constructor() { - * bool success; - * uint256[3] memory input = [ - * 0x070a8d6a982153cae4be29d434e8faef8a47b274a053f5a4ee2a6c9c13c31e5c, - * 0x031b8ce914eba3a9ffb989f9cdd5b0f01943074bf4f0f315690ec3cec6981afc, - * 0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd46 - * ]; - * uint256[2] memory result; - * - * assembly { - * // 0x07 id of the bn256Mul precompile - * // 0 number of ether to transfer - * // 96 size of call parameters, i.e. 96 bytes total - * // 64 size of return value, i.e. 64 bytes / 512 bit for a BN256 curve point - * success := call(not(0), 0x07, 0, input, 96, result, 64) - * } - * require(success, "elliptic curve multiplication failed"); - * require( - * result[0] == - * 0x025a6f4181d2b4ea8b724290ffb40156eb0adb514c688556eb79cdea0752c2bb, - * "failed"); - * require( - * result[1] == - * 0x2eff3f31dea215f1eb86023a133a996eb6300b44da664d64251d05381bb8a02e, - * "failed"); - * } - * } - */ - - const BN128_MUL_CONTRACT_BYTECODE = - "608060405234801561001057600080fd5b506000806040518060600160" + - "4052807f070a8d6a982153cae4be29d434e8faef8a47b274a053f5a4ee2a6c9c13c31e5c81526020017f031b8c" + - "e914eba3a9ffb989f9cdd5b0f01943074bf4f0f315690ec3cec6981afc81526020017f30644e72e131a029b850" + - "45b68181585d97816a916871ca8d3c208c16d87cfd468152509050610099610253565b60408160608460006007" + - "600019f19250826100ff576040517f08c379a00000000000000000000000000000000000000000000000000000" + - "000081526004018080602001828103825260248152602001806102c26024913960400191505060405180910390" + - "fd5b7f025a6f4181d2b4ea8b724290ffb40156eb0adb514c688556eb79cdea0752c2bb8160006002811061012d" + - "57fe5b6020020151146101a5576040517f08c379a0000000000000000000000000000000000000000000000000" + - "0000000081526004018080602001828103825260068152602001807f6661696c65640000000000000000000000" + - "00000000000000000000000000000081525060200191505060405180910390fd5b7f2eff3f31dea215f1eb8602" + - "3a133a996eb6300b44da664d64251d05381bb8a02e816001600281106101d357fe5b60200201511461024b5760" + - "40517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001" + - "828103825260068152602001807f6661696c656400000000000000000000000000000000000000000000000000" + - "0081525060200191505060405180910390fd5b505050610275565b604051806040016040528060029060208202" + - "8036833780820191505090505090565b603f806102836000396000f3fe6080604052600080fdfea26469706673" + - "5822122075cd0f518b5eecae53e271cd43201f7af10ba181ece35fe769e037d2ce152f9864736f6c6343000706" + - "0033656c6c6970746963206375727665206d756c7469706c69636174696f6e206661696c6564"; - - /* - * pragma solidity ^0.7.0; - * contract Bn128Pairing{ - * constructor() { - * uint256[12] memory input = [ - * 0x2eca0c7238bf16e83e7a1e6c5d49540685ff51380f309842a98561558019fc02, - * 0x03d3260361bb8451de5ff5ecd17f010ff22f5c31cdf184e9020b06fa5997db84, - * 0x1213d2149b006137fcfb23036606f848d638d576a120ca981b5b1a5f9300b3ee, - * 0x2276cf730cf493cd95d64677bbb75fc42db72513a4c1e387b476d056f80aa75f, - * 0x21ee6226d31426322afcda621464d0611d226783262e21bb3bc86b537e986237, - * 0x096df1f82dff337dd5972e32a8ad43e28a78a96a823ef1cd4debe12b6552ea5f, - * 0x06967a1237ebfeca9aaae0d6d0bab8e28c198c5a339ef8a2407e31cdac516db9, - * 0x22160fa257a5fd5b280642ff47b65eca77e626cb685c84fa6d3b6882a283ddd1, - * 0x198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c2, - * 0x1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed, - * 0x090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b, - * 0x12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa - * ]; - * uint256[1] memory result; - * bool success; - * assembly { - * // 0x08 id of the bn256CheckPairing precompile - * // 0 number of ether to transfer - * // 0 since we have an array of fixed length, our input starts in 0 - * // 384 size of call parameters, i.e. 12*256 bits == 384 bytes - * // 32 size of result (one 32 byte boolean!) - * success := call(sub(gas(), 2000), 0x08, 0, input, 384, result, 32) - * } - * require(success, "elliptic curve pairing failed"); - * require(result[0] == 1, "failed"); - * } - * } - */ - - const BN128_PAIRING_CONTRACT_BYTECODE = - "608060405234801561001057600080fd5b50600060405180610180" + - "01604052807f2eca0c7238bf16e83e7a1e6c5d49540685ff51380f309842a98561558019fc0281526020017f03" + - "d3260361bb8451de5ff5ecd17f010ff22f5c31cdf184e9020b06fa5997db8481526020017f1213d2149b006137" + - "fcfb23036606f848d638d576a120ca981b5b1a5f9300b3ee81526020017f2276cf730cf493cd95d64677bbb75f" + - "c42db72513a4c1e387b476d056f80aa75f81526020017f21ee6226d31426322afcda621464d0611d226783262e" + - "21bb3bc86b537e98623781526020017f096df1f82dff337dd5972e32a8ad43e28a78a96a823ef1cd4debe12b65" + - "52ea5f81526020017f06967a1237ebfeca9aaae0d6d0bab8e28c198c5a339ef8a2407e31cdac516db981526020" + - "017f22160fa257a5fd5b280642ff47b65eca77e626cb685c84fa6d3b6882a283ddd181526020017f198e939392" + - "0d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c281526020017f1800deef121f1e76426a0066" + - "5e5c4479674322d4f75edadd46debd5cd992f6ed81526020017f090689d0585ff075ec9e99ad690c3395bc4b31" + - "3370b38ef355acdadcd122975b81526020017f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6" + - "cc0166fa7daa81525090506101ef610306565b600060208261018085600060086107d05a03f190508061027757" + - "6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020" + - "018281038252601d8152602001807f656c6c69707469632063757276652070616972696e67206661696c656400" + - "000081525060200191505060405180910390fd5b60018260006001811061028657fe5b6020020151146102fe57" + - "6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020" + - "01828103825260068152602001807f6661696c6564000000000000000000000000000000000000000000000000" + - "000081525060200191505060405180910390fd5b505050610328565b6040518060200160405280600190602082" + - "028036833780820191505090505090565b603f806103366000396000f3fe6080604052600080fdfea264697066" + - "73582212202c2287769364a973256a3d99b3689d357bf3f403e981a27be30121349505bb5c64736f6c63430007" + - "060033"; - /* - * pragma solidity ^0.7.0; - * - * contract ModularCheck { - * - * // Verify simple modular exponentiation - * constructor() { - * require(modExp(3, 5, 7) == 5); - * require(modExp(5, 7, 11) == 3); - * } - * - * // Wrapper function to use the precompile. - * // Taken from https://ethereum.stackexchange.com/a/71590/9963 - * function modExp(uint256 _b, uint256 _e, uint256 _m) public returns (uint256 result) { - * assembly { - * // Free memory pointer - * let pointer := mload(0x40) - * - * // Define length of base, exponent and modulus. 0x20 == 32 bytes - * mstore(pointer, 0x20) - * mstore(add(pointer, 0x20), 0x20) - * mstore(add(pointer, 0x40), 0x20) - * - * // Define variables base, exponent and modulus - * mstore(add(pointer, 0x60), _b) - * mstore(add(pointer, 0x80), _e) - - * mstore(add(pointer, 0xa0), _m) - * // Store the result - * let value := mload(0xc0) - * - * // Call the precompiled contract 0x05 = bigModExp - * if iszero(call(not(0), 0x05, 0, pointer, 0xc0, value, 0x20)) { - * revert(0, 0) - * } - * - * result := mload(value) - * } - * } - * } - */ - const MODEXP_CONTRACT_BYTECODE = - "608060405234801561001057600080fd5b50600561002760036005600761005660201b60201c565b146100315760" + - "0080fd5b600361004760056007600b61005660201b60201c565b1461005157600080fd5b6100a5565b6000604051" + - "60208152602080820152602060408201528460608201528360808201528260a082015260c05160208160c0846000" + - "6005600019f161009857600080fd5b8051925050509392505050565b610104806100b46000396000f3fe60806040" + - "52348015600f57600080fd5b506004361060285760003560e01c80633148f14f14602d575b600080fd5b606a6004" + - "8036036060811015604157600080fd5b810190808035906020019092919080359060200190929190803590602001" + - "909291905050506080565b6040518082815260200191505060405180910390f35b60006040516020815260208082" + - "0152602060408201528460608201528360808201528260a082015260c05160208160c08460006005600019f160c1" + - "57600080fd5b805192505050939250505056fea26469706673582212204d7e7dcd400a3b0d5772d63f43f37a9855" + - "d556cdcdf0f7991cb39169ce7871ce64736f6c63430007000033"; - const GENESIS_ACCOUNT = "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b"; - const GENESIS_ACCOUNT_PRIVATE_KEY = - "0x99B3C12287537E38C90A9219D4CB074A89A16E9CDB20BF85728EBD97C343E342"; - - it("ripemd160 should be valid", async function () { - const tx_call = await customRequest(context.web3, "eth_call", [ - { - from: GENESIS_ACCOUNT, - value: "0x0", - gas: "0x10000", - gasPrice: "0x01", - to: "0x0000000000000000000000000000000000000003", - data: `0x${Buffer.from("Hello world!").toString("hex")}`, - }, - ]); - - expect(tx_call.result).equals( - "0x0000000000000000000000007f772647d88750add82d8e1a7a3e5c0902a346a3" - ); - }); - - it("ripemd160 is valid inside a contract", async function () { - this.timeout(15000); - const tx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - data: RIPEMD160_CONTRACT_BYTECODE, - value: "0x00", - gasPrice: "0x01", - gas: "0x100000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - await customRequest(context.web3, "eth_sendRawTransaction", [tx.rawTransaction]); - await createAndFinalizeBlock(context.polkadotApi); - expect(await context.web3.eth.getCode("0xc2bf5f29a4384b1ab0c063e1c666f02121b6084a")).equals( - "0x6080604052600080fdfea26469706673582212202febccafbee65a134279d3397fecfc56a3d21259" + - "87802a91add0260c7efa94d264736f6c634300060c0033" - ); - }); - - it("ModExp is valid inside a contract", async function () { - // See also the ModExp unit tests at - // github.com/paritytech/frontier/blob/378221a4/frame/evm/precompile/modexp/src/lib.rs#L101 - this.timeout(15000); - const { rawTransaction, transactionHash } = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - data: MODEXP_CONTRACT_BYTECODE, - value: "0x00", - gasPrice: "0x01", - gas: "0x100000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - await customRequest(context.web3, "eth_sendRawTransaction", [rawTransaction]); - await createAndFinalizeBlock(context.polkadotApi); - - // The contract should deploy successfully and the receipt should show success. - let receipt = await customRequest(context.web3, "eth_getTransactionReceipt", [transactionHash]); - expect(receipt.result.status).equals("0x1"); - }); - - it("bn128add is valid inside a contract", async function () { - this.timeout(15000); - const tx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - data: BN128ADD_CONTRACT_BYTECODE, - value: "0x00", - gasPrice: "0x01", - gas: "0x100000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - await customRequest(context.web3, "eth_sendRawTransaction", [tx.rawTransaction]); - await createAndFinalizeBlock(context.polkadotApi); - var receipt = await context.web3.eth.getTransactionReceipt(tx.transactionHash); - expect(await context.web3.eth.getCode(receipt.contractAddress)).equals( - "0x6080604052600080fdfea264697066735822122075fa7407f63bde9752715fbe31095ab6ad9273e2" + - "d758ca548cdb9d581cc4fcd264736f6c63430007060033" - ); - }); - - it("bn128mul is valid inside a contract", async function () { - this.timeout(15000); - const tx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - data: BN128_MUL_CONTRACT_BYTECODE, - value: "0x00", - gasPrice: "0x01", - gas: "0x100000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - await customRequest(context.web3, "eth_sendRawTransaction", [tx.rawTransaction]); - await createAndFinalizeBlock(context.polkadotApi); - var receipt = await context.web3.eth.getTransactionReceipt(tx.transactionHash); - expect(await context.web3.eth.getCode(receipt.contractAddress)).equals( - "0x6080604052600080fdfea264697066735822122075cd0f518b5eecae53e271cd43201f7af10ba181" + - "ece35fe769e037d2ce152f9864736f6c63430007060033" - ); - }); - - it("bn128Pairing is valid inside a contract", async function () { - this.timeout(15000); - const tx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - data: BN128_PAIRING_CONTRACT_BYTECODE, - value: "0x00", - gasPrice: "0x01", - gas: "0x100000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - await customRequest(context.web3, "eth_sendRawTransaction", [tx.rawTransaction]); - await createAndFinalizeBlock(context.polkadotApi); - var receipt = await context.web3.eth.getTransactionReceipt(tx.transactionHash); - expect(await context.web3.eth.getCode(receipt.contractAddress)).equals( - "0x6080604052600080fdfea26469706673582212202c2287769364a973256a3d99b3689d357bf3f403e9" + - "81a27be30121349505bb5c64736f6c63430007060033" - ); - }); -}); diff --git a/tests/tests/test-receipt-revert.ts b/tests/tests/test-receipt-revert.ts new file mode 100644 index 00000000000..3bb38807edb --- /dev/null +++ b/tests/tests/test-receipt-revert.ts @@ -0,0 +1,24 @@ +import { expect } from "chai"; + +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createContract } from "../util/transactions"; + +describeDevMoonbeam("Receipt - Revert", (context) => { + it("should generate a receipt", async function () { + const { rawTx } = await createContract(context.web3, "FailContract"); + const { txResults } = await context.createBlock({ transactions: [rawTx] }); + const receipt = await context.web3.eth.getTransactionReceipt(txResults[0].result); + + expect(receipt.status).to.be.false; + expect(receipt).to.include({ + blockNumber: 1, + contractAddress: "0xC2Bf5F29a4384b1aB0C063e1c666f02121B6084a", + cumulativeGasUsed: 54600, + from: "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b", + gasUsed: 54600, + to: null, + transactionHash: txResults[0].result, + transactionIndex: 0, + }); + }); +}); diff --git a/tests/tests/test-receipt.ts b/tests/tests/test-receipt.ts index eb66ecc4177..1895b8d6575 100644 --- a/tests/tests/test-receipt.ts +++ b/tests/tests/test-receipt.ts @@ -1,60 +1,29 @@ import { expect } from "chai"; -import { Keyring } from "@polkadot/keyring"; -import { step } from "mocha-steps"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createContract } from "../util/transactions"; +import { GENESIS_ACCOUNT } from "../util/constants"; -import { createAndFinalizeBlock, describeWithMoonbeam, customRequest } from "./util"; - -const INCREMENTER = require("./constants/IncrementerWithEvent.json"); - -const GENESIS_ACCOUNT = "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b"; -const GENESIS_ACCOUNT_PRIVATE_KEY = - "0x99B3C12287537E38C90A9219D4CB074A89A16E9CDB20BF85728EBD97C343E342"; - -describeWithMoonbeam("Moonbeam RPC (Receipt)", `simple-specs.json`, (context) => { - step("Receipt and events logs should contain valid values", async function () { - const createTx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - data: INCREMENTER.bytecode, - value: "0x00", - gasPrice: "0x01", - gas: "0x100000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - let send = await customRequest(context.web3, "eth_sendRawTransaction", [ - createTx.rawTransaction, - ]); - await createAndFinalizeBlock(context.polkadotApi); - let receipt = await context.web3.eth.getTransactionReceipt(send.result); - const contractAddress = receipt.contractAddress; - const contract = new context.web3.eth.Contract(INCREMENTER.abi, contractAddress); - - const callTx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - to: contractAddress, - gas: "0x100000", - value: "0x00", - data: contract.methods.increment().encodeABI(), - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); +describeDevMoonbeam("Receipt - Contract", (context) => { + let txHash; + let eventContract; + before("Setup: Create block with contract", async () => { + const { contract, rawTx } = await createContract(context.web3, "SingleEventContract", { + from: GENESIS_ACCOUNT, + }); + const { txResults } = await context.createBlock({ transactions: [rawTx] }); + txHash = txResults[0].result; + eventContract = contract; + }); - send = await customRequest(context.web3, "eth_sendRawTransaction", [callTx.rawTransaction]); - await createAndFinalizeBlock(context.polkadotApi); - const block = await context.web3.eth.getBlock(2); - receipt = await context.web3.eth.getTransactionReceipt(send.result); + it("Should generate receipt", async function () { + const block = await context.web3.eth.getBlock(1); + const receipt = await context.web3.eth.getTransactionReceipt(txHash); expect(receipt.blockHash).to.be.eq(block.hash); expect(receipt.blockNumber).to.be.eq(block.number); expect(receipt.from).to.be.eq(GENESIS_ACCOUNT); expect(receipt.logs.length).to.be.eq(1); - expect(receipt.logs[0].address).to.be.eq(contractAddress); + expect(receipt.logs[0].address).to.be.eq(eventContract.options.address); expect(receipt.logs[0].blockHash).to.be.eq(block.hash); - expect("0x" + receipt.logs[0].data.substring(26, receipt.logs[0].data.length + 1)).to.be.eq( - GENESIS_ACCOUNT - ); - expect(receipt.logs[0].transactionHash).to.be.eq(send.result); }); }); diff --git a/tests/tests/test-revert-receipt.ts b/tests/tests/test-revert-receipt.ts deleted file mode 100644 index bc9f67e5c09..00000000000 --- a/tests/tests/test-revert-receipt.ts +++ /dev/null @@ -1,105 +0,0 @@ -import { expect } from "chai"; - -import { createAndFinalizeBlock, customRequest, describeWithMoonbeam } from "./util"; - -describeWithMoonbeam("Frontier RPC (Constructor Revert)", `simple-specs.json`, (context) => { - const GENESIS_ACCOUNT = "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b"; - const GENESIS_ACCOUNT_PRIVATE_KEY = - "0x99B3C12287537E38C90A9219D4CB074A89A16E9CDB20BF85728EBD97C343E342"; - - // ``` - // pragma solidity >=0.4.22 <0.7.0; - // - // contract WillFail { - // constructor() public { - // require(false); - // } - // } - // ``` - const FAIL_BYTECODE = - "6080604052348015600f57600080fd5b506000601a57600080fd5b603f8060276000396000f3fe60806040526000" + - "80fdfea26469706673582212209f2bb2a4cf155a0e7b26bd34bb01e9b645a92c82e55c5dbdb4b37f8c326edbee64" + - "736f6c63430006060033"; - const GOOD_BYTECODE = - "6080604052348015600f57600080fd5b506001601a57600080fd5b603f8060276000396000f3fe60806040526000" + - "80fdfea2646970667358221220c70bc8b03cdfdf57b5f6c4131b836f9c2c4df01b8202f530555333f2a00e4b8364" + - "736f6c63430006060033"; - - it("should provide a tx receipt after successful deployment", async function () { - this.timeout(15000); - const GOOD_TX_HASH = "0x410f72144e2c0e8b48091f5675422b7a8013335cfdb5e83825c5f27cd991ac8c"; - - const tx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - data: GOOD_BYTECODE, - value: "0x00", - gasPrice: "0x01", - gas: "0x100000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - - expect( - await customRequest(context.web3, "eth_sendRawTransaction", [tx.rawTransaction]) - ).to.deep.equal({ - id: 1, - jsonrpc: "2.0", - result: GOOD_TX_HASH, - }); - - // Verify the receipt exists after the block is created - await createAndFinalizeBlock(context.polkadotApi); - const receipt = await context.web3.eth.getTransactionReceipt(GOOD_TX_HASH); - expect(receipt).to.include({ - blockNumber: 1, - contractAddress: "0xC2Bf5F29a4384b1aB0C063e1c666f02121B6084a", - cumulativeGasUsed: 67231, - from: "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b", - gasUsed: 67231, - to: null, - transactionHash: GOOD_TX_HASH, - transactionIndex: 0, - status: true, - }); - }); - - it("should provide a tx receipt after failed deployment", async function () { - this.timeout(15000); - // Transaction hash depends on which nonce we're using. This hash is for nonce 2. - const FAIL_TX_HASH = "0xe5ba0bd6229c3315cefa16312b6f3674a5f928aed1b7f397596b724fb259c5ba"; - - const tx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - data: FAIL_BYTECODE, - value: "0x00", - gasPrice: "0x01", - gas: "0x100000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - - expect( - await customRequest(context.web3, "eth_sendRawTransaction", [tx.rawTransaction]) - ).to.deep.equal({ - id: 1, - jsonrpc: "2.0", - result: FAIL_TX_HASH, - }); - - await createAndFinalizeBlock(context.polkadotApi); - const receipt = await context.web3.eth.getTransactionReceipt(FAIL_TX_HASH); - expect(receipt).to.include({ - blockNumber: 2, - contractAddress: "0x5c4242beB94dE30b922f57241f1D02f36e906915", - cumulativeGasUsed: 54600, - from: "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b", - gasUsed: 54600, - to: null, - transactionHash: FAIL_TX_HASH, - transactionIndex: 0, - status: false, - }); - }); -}); diff --git a/tests/tests/test-rpc-constants.ts b/tests/tests/test-rpc-constants.ts index acd0fc2ddb5..db457b32e27 100644 --- a/tests/tests/test-rpc-constants.ts +++ b/tests/tests/test-rpc-constants.ts @@ -1,9 +1,7 @@ import { expect } from "chai"; -import { createAndFinalizeBlock, customRequest, describeWithMoonbeam } from "./util"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; -// All test for the RPC - -describeWithMoonbeam("Moonbeam RPC (Constant)", `simple-specs.json`, (context) => { +describeDevMoonbeam("RPC Constants", (context) => { it("should have 0 hashrate", async function () { expect(await context.web3.eth.getHashrate()).to.equal(0); }); diff --git a/tests/tests/test-stake.ts b/tests/tests/test-stake.ts index ab4e0c6251c..fbaa6dc3709 100644 --- a/tests/tests/test-stake.ts +++ b/tests/tests/test-stake.ts @@ -1,23 +1,20 @@ import { expect } from "chai"; -import { step } from "mocha-steps"; -import { describeWithMoonbeam } from "./util"; -import { GLMR } from "./constants"; +import { DEFAULT_GENESIS_STAKING, GENESIS_ACCOUNT } from "../util/constants"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; -describeWithMoonbeam("Moonbeam RPC (Stake)", `simple-specs.json`, (context) => { - const GENESIS_ACCOUNT = "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b"; - const GENESIS_STAKED = 1_000n * GLMR; - step("collator bond reserved in genesis", async function () { +describeDevMoonbeam("Staking - Genesis", (context) => { + it("should match collator reserved bond reserved", async function () { const account = await context.polkadotApi.query.system.account(GENESIS_ACCOUNT); - expect(account.data.reserved.toString()).to.equal(GENESIS_STAKED.toString()); + expect(account.data.reserved.toString()).to.equal(DEFAULT_GENESIS_STAKING.toString()); }); - step("collator set in genesis", async function () { + it("should include collator from the specs", async function () { const collators = await context.polkadotApi.query.parachainStaking.selectedCandidates(); expect((collators[0] as Buffer).toString("hex").toLowerCase()).equal(GENESIS_ACCOUNT); }); - it("candidates set in genesis", async function () { + it("should have collator state as defined in the specs", async function () { const candidates = await context.polkadotApi.query.parachainStaking.collatorState( GENESIS_ACCOUNT ); @@ -25,7 +22,7 @@ describeWithMoonbeam("Moonbeam RPC (Stake)", `simple-specs.json`, (context) => { expect(candidates.toHuman()["state"]).equal("Active"); }); - it("inflation set in genesis", async function () { + it("should have inflation matching specs", async function () { const inflationInfo = await context.polkadotApi.query.parachainStaking.inflationConfig(); // { // expect: { diff --git a/tests/tests/test-subscription-logs.ts b/tests/tests/test-subscription-logs.ts new file mode 100644 index 00000000000..94193568a06 --- /dev/null +++ b/tests/tests/test-subscription-logs.ts @@ -0,0 +1,224 @@ +import { expect } from "chai"; +import { web3Subscribe } from "../util/providers"; + +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createContract } from "../util/transactions"; + +describeDevMoonbeam("Subscription - Logs", (context) => { + let web3Ws; + before("Setup: Create empty block", async () => { + web3Ws = await context.createWeb3("ws"); + }); + + it("should send a notification on new transaction", async function () { + const subscription = web3Subscribe(web3Ws, "logs", {}); + + await new Promise((resolve) => { + subscription.once("connected", resolve); + }); + + const dataPromise = new Promise((resolve) => { + subscription.once("data", resolve); + }); + + const { rawTx } = await createContract(context.web3, "SingleEventContract"); + await context.createBlock({ + transactions: [rawTx], + }); + + const data = await dataPromise; + subscription.unsubscribe(); + + const block = await context.web3.eth.getBlock("latest"); + expect(data).to.include({ + blockHash: block.hash, + blockNumber: block.number, + data: "0x", + logIndex: 0, + removed: false, + transactionHash: block.transactions[0], + transactionIndex: 0, + transactionLogIndex: "0x0", + }); + }); +}); + +describeDevMoonbeam("Subscription - Logs", (context) => { + let web3Ws; + + let subSingleAddPromise; + let subMultiAddPromise; + let subTopicPromise; + let subTopicWildcardPromise; + let subTopicListPromise; + let subTopicCondPromise; + let subTopicMultiCondPromise; + let subTopicWildAndCondPromise; + + before("Setup: Create all subs and a block with transfer", async () => { + web3Ws = await context.createWeb3("ws"); + + const subSingleAdd = web3Subscribe(web3Ws, "logs", { + address: "0xC2Bf5F29a4384b1aB0C063e1c666f02121B6084a", + }); + + const subMultiAdd = web3Subscribe(web3Ws, "logs", { + address: [ + "0xF8cef78E923919054037a1D03662bBD884fF4edf", + "0x42e2EE7Ba8975c473157634Ac2AF4098190fc741", + "0x5c4242beB94dE30b922f57241f1D02f36e906915", + "0xC2Bf5F29a4384b1aB0C063e1c666f02121B6084a", + ], + }); + + const subTopic = web3Subscribe(web3Ws, "logs", { + topics: ["0x0040d54d5e5b097202376b55bcbaaedd2ee468ce4496f1d30030c4e5308bf94d"], + }); + + const subTopicWildcard = web3Subscribe(web3Ws, "logs", { + topics: [null, "0x0000000000000000000000006be02d1d3665660d22ff9624b7be0551ee1ac91b"], + }); + + const subTopicList = web3Subscribe(web3Ws, "logs", { + topics: [ + ["0x0040d54d5e5b097202376b55bcbaaedd2ee468ce4496f1d30030c4e5308bf94d"], + ["0x0000000000000000000000006be02d1d3665660d22ff9624b7be0551ee1ac91b"], + ], + }); + + const subTopicCond = web3Subscribe(web3Ws, "logs", { + topics: [ + "0x0040d54d5e5b097202376b55bcbaaedd2ee468ce4496f1d30030c4e5308bf94d", + ["0x0000000000000000000000006be02d1d3665660d22ff9624b7be0551ee1ac91b"], + ], + }); + + const subTopicMultiCond = web3Subscribe(web3Ws, "logs", { + topics: [ + "0x0040d54d5e5b097202376b55bcbaaedd2ee468ce4496f1d30030c4e5308bf94d", + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000006be02d1d3665660d22ff9624b7be0551ee1ac91b", + ], + ], + }); + + const subTopicWildAndCond = web3Subscribe(web3Ws, "logs", { + topics: [ + null, + [ + "0x0000000000000000000000006be02d1d3665660d22ff9624b7be0551ee1ac91b", + "0x0000000000000000000000000000000000000000000000000000000000000000", + ], + null, + ], + }); + + await Promise.all( + [ + subSingleAdd, + subMultiAdd, + subTopic, + subTopicWildcard, + subTopicList, + subTopicCond, + subTopicMultiCond, + subTopicWildAndCond, + ].map((sub, index) => { + new Promise((resolve) => { + sub.once("connected", resolve); + }); + }) + ); + + const subData = (sub) => { + return new Promise((resolve) => { + sub.once("data", resolve); + }); + }; + + subSingleAddPromise = subData(subSingleAdd); + subMultiAddPromise = subData(subMultiAdd); + subTopicPromise = subData(subTopic); + subTopicWildcardPromise = subData(subTopicWildcard); + subTopicListPromise = subData(subTopicList); + subTopicCondPromise = subData(subTopicCond); + subTopicMultiCondPromise = subData(subTopicMultiCond); + subTopicWildAndCondPromise = subData(subTopicWildAndCond); + + const { rawTx } = await createContract(context.web3, "SingleEventContract"); + await context.createBlock({ + transactions: [rawTx], + }); + }); + + it("should be able to filter by address", async function () { + const data = await subSingleAddPromise; + expect(data).to.include({ blockNumber: 1 }); + }); + + it("should be able to filter by multiple addresses", async function () { + const data = await subMultiAddPromise; + expect(data).to.include({ blockNumber: 1 }); + }); + + it("should be able to filter by topic", async function () { + const data = await subTopicPromise; + expect(data).to.include({ blockNumber: 1 }); + }); + + it("should be able to filter by topic wildcards", async function () { + const data = await subTopicWildcardPromise; + expect(data).to.include({ blockNumber: 1 }); + }); + + it("should be able to filter by topic list", async function () { + const data = await subTopicListPromise; + expect(data).to.include({ blockNumber: 1 }); + }); + + it("should be able to filter by topic conditional parameters", async function () { + const data = await subTopicCondPromise; + expect(data).to.include({ blockNumber: 1 }); + }); + + it("should support multiple topic conditional parameters", async function () { + const data = await subTopicMultiCondPromise; + expect(data).to.include({ blockNumber: 1 }); + }); + + it("should combine topic wildcards and conditional parameters", async function () { + const data = await subTopicWildAndCondPromise; + expect(data).to.include({ blockNumber: 1 }); + }); +}); + +describeDevMoonbeam("Subscription - Reverted transaction", (context) => { + // TODO: Telmo to verify if this statement is true + it.skip("should not send logs", async function () { + const web3Ws = await context.createWeb3("ws"); + const subscription = web3Subscribe(web3Ws, "logs", {}); + await new Promise((resolve) => { + subscription.once("connected", resolve); + }); + + // Expected to fail because of not enough fund to pay the deployment + const { rawTx } = await createContract(context.web3, "SingleEventContract", { + from: "0x1111111111111111111111111111111111111111", + }); + await context.createBlock({ + transactions: [rawTx], + }); + + const data = await new Promise((resolve) => { + let result = null; + subscription.once("data", (d) => (result = d)); + setTimeout(() => resolve(result), 1000); + // wait for 1 second to make sure a notification would have time to arrive. + // (This one is not supposed to arrive because the transaction ran out of gas.) + }); + + subscription.unsubscribe(); + expect(data).to.be.null; + }); +}); diff --git a/tests/tests/test-subscription-past-events.ts b/tests/tests/test-subscription-past-events.ts new file mode 100644 index 00000000000..fc9386acfce --- /dev/null +++ b/tests/tests/test-subscription-past-events.ts @@ -0,0 +1,109 @@ +import { expect } from "chai"; +import { createContract } from "../util/transactions"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { web3Subscribe } from "../util/providers"; + +describeDevMoonbeam("Subscription - Past Events", (context) => { + let web3Ws; + + before("Setup: Create 4 blocks with transfer", async () => { + web3Ws = await context.createWeb3("ws"); + + const { rawTx: rawTx1 } = await createContract(context.web3, "SingleEventContract", { + nonce: 0, + }); + const { rawTx: rawTx2 } = await createContract(context.web3, "SingleEventContract", { + nonce: 1, + }); + const { rawTx: rawTx3 } = await createContract(context.web3, "SingleEventContract", { + nonce: 2, + }); + const { rawTx: rawTx4 } = await createContract(context.web3, "SingleEventContract", { + nonce: 3, + }); + + await context.createBlock({ + transactions: [rawTx1, rawTx2, rawTx3, rawTx4], + }); + }); + + it("should be retrieved by topic", async function () { + const subscription = web3Subscribe(web3Ws, "logs", { + fromBlock: "0x0", + topics: ["0x0040d54d5e5b097202376b55bcbaaedd2ee468ce4496f1d30030c4e5308bf94d"], + }); + + const data = await new Promise((resolve) => { + const data = []; + subscription.on("data", function (d: any) { + data.push(d); + if (data.length == 4) resolve(data); + }); + }); + subscription.unsubscribe(); + + expect(data).to.not.be.empty; + }); + + it("should be retrieved by address", async function () { + const subscription = web3Subscribe(web3Ws, "logs", { + fromBlock: "0x0", + address: "0xC2Bf5F29a4384b1aB0C063e1c666f02121B6084a", + }); + + const data = await new Promise((resolve) => { + const data = []; + subscription.on("data", function (d: any) { + data.push(d); + if (data.length == 1) resolve(data); + }); + }); + subscription.unsubscribe(); + + expect(data).to.not.be.empty; + }); + + it("should be retrieved by address + topic", async function () { + const subscription = web3Subscribe(web3Ws, "logs", { + fromBlock: "0x0", + topics: ["0x0040d54d5e5b097202376b55bcbaaedd2ee468ce4496f1d30030c4e5308bf94d"], + address: "0xC2Bf5F29a4384b1aB0C063e1c666f02121B6084a", + }); + + const data = await new Promise((resolve) => { + const data = []; + subscription.on("data", function (d: any) { + data.push(d); + if (data.length == 1) resolve(data); + }); + }); + subscription.unsubscribe(); + + expect(data).to.not.be.empty; + }); + + it("should be retrieved by multiple addresses", async function () { + const subscription = web3Subscribe(web3Ws, "logs", { + fromBlock: "0x0", + topics: ["0x0040d54d5e5b097202376b55bcbaaedd2ee468ce4496f1d30030c4e5308bf94d"], + address: [ + "0xe573BCA813c741229ffB2488F7856C6cAa841041", + "0xF8cef78E923919054037a1D03662bBD884fF4edf", + "0x42e2EE7Ba8975c473157634Ac2AF4098190fc741", + "0x5c4242beB94dE30b922f57241f1D02f36e906915", + "0xC2Bf5F29a4384b1aB0C063e1c666f02121B6084a", + ], + }); + + const data = await new Promise((resolve) => { + const data = []; + subscription.on("data", function (d: any) { + data.push(d); + if (data.length == 4) resolve(data); + }); + }); + subscription.unsubscribe(); + + expect(data).to.not.be.empty; + }); +}); diff --git a/tests/tests/test-subscription.ts b/tests/tests/test-subscription.ts index 7106a302d1b..2c4726a03e4 100644 --- a/tests/tests/test-subscription.ts +++ b/tests/tests/test-subscription.ts @@ -1,526 +1,90 @@ import { expect } from "chai"; -import { step } from "mocha-steps"; -import { Subscription as Web3Subscription } from "web3-core-subscriptions"; +import { customWeb3Request, web3Subscribe } from "../util/providers"; import { BlockHeader } from "web3-eth"; -import { Log } from "web3-core"; -import { createAndFinalizeBlock, customRequest, describeWithMoonbeam } from "./util"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createTransfer } from "../util/transactions"; -// Extra type because web3 is not well typed -interface Subscription extends Web3Subscription { - once: (type: "data" | "connected", handler: (data: T) => void) => Subscription; -} +describeDevMoonbeam("Subscription", (context) => { + let web3Ws; + before("Setup: Create empty block", async () => { + web3Ws = await context.createWeb3("ws"); + }); -describeWithMoonbeam( - "Frontier RPC (Subscription)", - `simple-specs.json`, - (context) => { - let logs_generated = 0; // TODO: remove global variable used by tests + it("should return a valid subscriptionId", async function () { + const subscription = web3Subscribe(web3Ws, "newBlockHeaders"); + const subscriptionId = await new Promise((resolve) => subscription.once("connected", resolve)); - const GENESIS_ACCOUNT = "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b"; - const GENESIS_ACCOUNT_PRIVATE_KEY = - "0x99B3C12287537E38C90A9219D4CB074A89A16E9CDB20BF85728EBD97C343E342"; + subscription.unsubscribe(); + expect(subscriptionId).to.have.lengthOf(34); + }); +}); - // This reflects the measured gas cost of the transaction at this current point in time. - // It has been known to fluctuate from release to release, so it may need adjustment. - const EXPECTED_TRANSACTION_GAS_COST = 891328; +describeDevMoonbeam("Subscription - Block headers", (context) => { + let web3Ws; + before("Setup: Create empty block", async () => { + web3Ws = await context.createWeb3("ws"); + }); - const TEST_CONTRACT_BYTECODE = - "0x608060405234801561001057600080fd5b50610041337fffffffffffffffffffffffffffffffffffffffffff" + - "ffffffffffffffffffffff61004660201b60201c565b610291565b600073ffffffffffffffffffffffffffffff" + - "ffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156100e9576040517f08c379a00000" + - "0000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152" + - "602001807f45524332303a206d696e7420746f20746865207a65726f2061646472657373008152506020019150" + - "5060405180910390fd5b6101028160025461020960201b610c7c1790919060201c565b60028190555061015d81" + - "6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffff" + - "ffff1681526020019081526020016000205461020960201b610c7c1790919060201c565b6000808473ffffffff" + - "ffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190" + - "8152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffff" + - "ffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523" + - "b3ef836040518082815260200191505060405180910390a35050565b6000808284019050838110156102875760" + - "40517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001" + - "8281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f7700000000" + - "0081525060200191505060405180910390fd5b8091505092915050565b610e3a806102a06000396000f3fe6080" + - "60405234801561001057600080fd5b50600436106100885760003560e01c806370a082311161005b57806370a0" + - "8231146101fd578063a457c2d714610255578063a9059cbb146102bb578063dd62ed3e1461032157610088565b" + - "8063095ea7b31461008d57806318160ddd146100f357806323b872dd146101115780633950935114610197575b" + - "600080fd5b6100d9600480360360408110156100a357600080fd5b81019080803573ffffffffffffffffffffff" + - "ffffffffffffffffff16906020019092919080359060200190929190505050610399565b604051808215151515" + - "815260200191505060405180910390f35b6100fb6103b7565b6040518082815260200191505060405180910390" + - "f35b61017d6004803603606081101561012757600080fd5b81019080803573ffffffffffffffffffffffffffff" + - "ffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092" + - "9190803590602001909291905050506103c1565b604051808215151515815260200191505060405180910390f3" + - "5b6101e3600480360360408110156101ad57600080fd5b81019080803573ffffffffffffffffffffffffffffff" + - "ffffffffff1690602001909291908035906020019092919050505061049a565b60405180821515151581526020" + - "0191505060405180910390f35b61023f6004803603602081101561021357600080fd5b81019080803573ffffff" + - "ffffffffffffffffffffffffffffffffff16906020019092919050505061054d565b6040518082815260200191" + - "505060405180910390f35b6102a16004803603604081101561026b57600080fd5b81019080803573ffffffffff" + - "ffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610595565b604051" + - "808215151515815260200191505060405180910390f35b610307600480360360408110156102d157600080fd5b" + - "81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291" + - "90505050610662565b604051808215151515815260200191505060405180910390f35b61038360048036036040" + - "81101561033757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190" + - "929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610680565b6040" + - "518082815260200191505060405180910390f35b60006103ad6103a6610707565b848461070f565b6001905092" + - "915050565b6000600254905090565b60006103ce848484610906565b61048f846103da610707565b61048a8560" + - "4051806060016040528060288152602001610d7060289139600160008b73ffffffffffffffffffffffffffffff" + - "ffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061" + - "0440610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffff" + - "ffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b61070f565b60019050" + - "9392505050565b60006105436104a7610707565b8461053e85600160006104b8610707565b73ffffffffffffff" + - "ffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260" + - "200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffff" + - "ffffffffffff16815260200190815260200160002054610c7c90919063ffffffff16565b61070f565b60019050" + - "92915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffff" + - "ffffffffffffffffffff168152602001908152602001600020549050919050565b60006106586105a261070756" + - "5b8461065385604051806060016040528060258152602001610de160259139600160006105cc610707565b73ff" + - "ffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260" + - "200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffff" + - "ffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b6107" + - "0f565b6001905092915050565b600061067661066f610707565b8484610906565b6001905092915050565b6000" + - "600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffff" + - "ffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ff" + - "ffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000" + - "33905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffff" + - "ffffffffffffff161415610795576040517f08c379a00000000000000000000000000000000000000000000000" + - "00000000008152600401808060200182810382526024815260200180610dbd6024913960400191505060405180" + - "910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffff" + - "ffffffffffff16141561081b576040517f08c379a0000000000000000000000000000000000000000000000000" + - "000000008152600401808060200182810382526022815260200180610d28602291396040019150506040518091" + - "0390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffff" + - "ffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffff" + - "ffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173" + - "ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f" + - "8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051808281526020019150" + - "5060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffff" + - "ffffffffffffffffffffffffffffff16141561098c576040517f08c379a0000000000000000000000000000000" + - "000000000000000000000000008152600401808060200182810382526025815260200180610d98602591396040" + - "0191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffff" + - "ffffffffffffffffffffffffffff161415610a12576040517f08c379a000000000000000000000000000000000" + - "0000000000000000000000008152600401808060200182810382526023815260200180610d0560239139604001" + - "91505060405180910390fd5b610a7d81604051806060016040528060268152602001610d4a6026913960008087" + - "73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681" + - "5260200190815260200160002054610bbc9092919063ffffffff16565b6000808573ffffffffffffffffffffff" + - "ffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000" + - "2081905550610b10816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffff" + - "ffffffffffffffffffffff16815260200190815260200160002054610c7c90919063ffffffff16565b60008084" + - "73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681" + - "52602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffff" + - "ffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f5" + - "5a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610c6957" + - "6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020" + - "01828103825283818151815260200191508051906020019080838360005b83811015610c2e5780820151818401" + - "52602081019050610c13565b50505050905090810190601f168015610c5b578082038051600183602003610100" + - "0a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b" + - "600080828401905083811015610cfa576040517f08c379a0000000000000000000000000000000000000000000" + - "00000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a2061646469" + - "74696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056" + - "fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206170" + - "70726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f75" + - "6e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e742065786365" + - "65647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164" + - "647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332" + - "303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820c7a5ff" + - "abf642bda14700b2de42f8c57b36621af020441df825de45fd2b3e1c5c64736f6c63430005100032"; - async function sendTransaction(context, extraData = {}) { - const tx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - data: TEST_CONTRACT_BYTECODE, - value: "0x00", - gasPrice: "0x01", - gas: "0x" + EXPECTED_TRANSACTION_GAS_COST.toString(16), - ...extraData, - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - await customRequest(context.web3, "eth_sendRawTransaction", [tx.rawTransaction]); - return tx; - } + it("should send notification on new block", async function () { + const subscription = web3Subscribe(web3Ws, "newBlockHeaders"); + await new Promise((resolve) => subscription.once("connected", resolve)); - // Little helper to hack web3 that are not complete. - function web3Subscribe(type: "newBlockHeaders"): Subscription; - function web3Subscribe(type: "pendingTransactions"): Subscription; - function web3Subscribe(type: "logs", params: {}): Subscription; - function web3Subscribe(type: "newBlockHeaders" | "pendingTransactions" | "logs", params?: any) { - return (context.web3.eth as any).subscribe(...arguments); - } - - step("should connect", async function () { - await createAndFinalizeBlock(context.polkadotApi); - // @ts-ignore - expect(context.web3.currentProvider.connected).to.equal(true); - }); - - step("should subscribe", async function () { - const subscription = web3Subscribe("newBlockHeaders"); - const subscriptionId = await new Promise((resolve) => - subscription.once("connected", resolve) - ); - - subscription.unsubscribe(); - expect(subscriptionId).to.have.lengthOf(34); - }); - - step("should get newHeads stream", async function () { - const subscription = web3Subscribe("newBlockHeaders"); - const data = await new Promise((resolve) => { - createAndFinalizeBlock(context.polkadotApi); - subscription.once("data", resolve); - }); - subscription.unsubscribe(); - - expect(data).to.include({ - author: "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b", - difficulty: "0", - extraData: "0x", - logsBloom: `0x${"0".repeat(512)}`, - miner: "0x6Be02d1d3665660d22FF9624b7BE0551ee1Ac91b", - receiptsRoot: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", - sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", - transactionsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - }); - expect((data as any).sealFields).to.eql([ - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000", - ]); - }); - - step("should get newPendingTransactions stream", async function () { - const subscription = web3Subscribe("pendingTransactions"); - await new Promise((resolve) => subscription.once("connected", resolve)); - - const tx = await sendTransaction(context); - const data = await new Promise((resolve) => { - createAndFinalizeBlock(context.polkadotApi); - subscription.once("data", resolve); - }); - logs_generated += 1; //TODO: this is wrong, test should not be dependant of other tests - subscription.unsubscribe(); - - expect(data).to.be.not.null; - expect(tx["transactionHash"]).to.be.eq(data); - }); - - step("should subscribe to all logs", async function () { - const subscription = web3Subscribe("logs", {}); - - await new Promise((resolve) => { - subscription.once("connected", resolve); - }); - - await sendTransaction(context); - const data = await new Promise((resolve) => { - createAndFinalizeBlock(context.polkadotApi); - subscription.once("data", resolve); - }); - logs_generated += 1; - subscription.unsubscribe(); - - const block = await context.web3.eth.getBlock("latest"); - expect(data).to.include({ - blockHash: block.hash, - blockNumber: block.number, - data: "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - logIndex: 0, - removed: false, - transactionHash: block.transactions[0], - transactionIndex: 0, - transactionLogIndex: "0x0", - }); + await context.createBlock({ + transactions: [ + await createTransfer(context.web3, "0x1111111111111111111111111111111111111111", 0), + ], }); - step("should subscribe to logs by address", async function () { - const subscription = web3Subscribe("logs", { - address: "0x42e2EE7Ba8975c473157634Ac2AF4098190fc741", - }); - - await new Promise((resolve) => { - subscription.once("connected", resolve); - }); - - await sendTransaction(context); - const data = await new Promise((resolve) => { - createAndFinalizeBlock(context.polkadotApi); - subscription.once("data", resolve); - }); - subscription.unsubscribe(); - - expect(data).to.not.be.null; - }); - - step("should subscribe to logs by multiple addresses", async function () { - const subscription = web3Subscribe("logs", { - address: [ - "0xF8cef78E923919054037a1D03662bBD884fF4edf", - "0x42e2EE7Ba8975c473157634Ac2AF4098190fc741", - "0x5c4242beB94dE30b922f57241f1D02f36e906915", - "0xC2Bf5F29a4384b1aB0C063e1c666f02121B6084a", - ], - }); - - await new Promise((resolve) => { - subscription.once("connected", resolve); - }); - - await sendTransaction(context); - const data = await new Promise((resolve) => { - createAndFinalizeBlock(context.polkadotApi); - subscription.once("data", resolve); - }); - logs_generated += 1; - subscription.unsubscribe(); - - expect(data).to.not.be.null; + const data = await new Promise((resolve) => { + subscription.once("data", resolve); }); + subscription.unsubscribe(); - step("should subscribe to logs by topic", async function () { - const subscription = web3Subscribe("logs", { - topics: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"], - }); - - await new Promise((resolve) => { - subscription.once("connected", resolve); - }); - - await sendTransaction(context); - const data = await new Promise((resolve) => { - createAndFinalizeBlock(context.polkadotApi); - subscription.once("data", resolve); - }); - logs_generated += 1; - subscription.unsubscribe(); - - expect(data).to.not.be.null; - }); - - step("should get past events #1: by topic", async function () { - const subscription = web3Subscribe("logs", { - fromBlock: "0x0", - topics: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"], - }); - - const data = await new Promise((resolve) => { - const data = []; - subscription.on("data", function (d: any) { - data.push(d); - if (data.length == logs_generated) resolve(data); - }); - }); - subscription.unsubscribe(); - - expect(data).to.not.be.empty; + expect(data).to.include({ + author: "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b", + difficulty: "0", + extraData: "0x", + logsBloom: `0x${"0".repeat(512)}`, + miner: "0x6Be02d1d3665660d22FF9624b7BE0551ee1Ac91b", + receiptsRoot: "0x3f9d4f18305cd0de20569ab8f7efb114f6374c65d0f02fbc80fd275317b1d375", + sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + transactionsRoot: "0xfe6c195567b1b64b0e1e48b79e75ee25fa56a23540b207f94d83c4dbb1835631", }); + expect((data as any).sealFields).to.eql([ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000", + ]); + }); +}); - step("should get past events #2: by address", async function () { - const subscription = web3Subscribe("logs", { - fromBlock: "0x0", - address: "0x42e2EE7Ba8975c473157634Ac2AF4098190fc741", - }); +describeDevMoonbeam("Subscription - Pending transactions", (context) => { + let web3Ws; + before("Setup: Create empty block", async () => { + web3Ws = await context.createWeb3("ws"); + }); - const data = await new Promise((resolve) => { - const data = []; - subscription.on("data", function (d: any) { - data.push(d); - if (data.length == 1) resolve(data); - }); - }); - subscription.unsubscribe(); + // TODO: Inspect why it requires to produce a block to receive the notification + it.skip("should send notification on new transaction", async function () { + const subscription = web3Subscribe(web3Ws, "pendingTransactions"); + await new Promise((resolve) => subscription.once("connected", resolve)); - expect(data).to.not.be.empty; + const dataP = new Promise((resolve) => { + subscription.once("data", resolve); }); - step("should get past events #3: by address + topic", async function () { - const subscription = web3Subscribe("logs", { - fromBlock: "0x0", - topics: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"], - address: "0xC2Bf5F29a4384b1aB0C063e1c666f02121B6084a", - }); + const { result } = await customWeb3Request(context.web3, "eth_sendRawTransaction", [ + await createTransfer(context.web3, "0x1111111111111111111111111111111111111111", 0), + ]); - const data = await new Promise((resolve) => { - const data = []; - subscription.on("data", function (d: any) { - data.push(d); - if (data.length == 1) resolve(data); - }); - }); - subscription.unsubscribe(); + // This test passes if you produce the block + // await context.createBlock(); - expect(data).to.not.be.empty; - }); + const data = await dataP; - step("should get past events #3: multiple addresses", async function () { - const subscription = web3Subscribe("logs", { - fromBlock: "0x0", - topics: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"], - address: [ - "0xe573BCA813c741229ffB2488F7856C6cAa841041", - "0xF8cef78E923919054037a1D03662bBD884fF4edf", - "0x42e2EE7Ba8975c473157634Ac2AF4098190fc741", - "0x5c4242beB94dE30b922f57241f1D02f36e906915", - "0xC2Bf5F29a4384b1aB0C063e1c666f02121B6084a", - ], - }); + subscription.unsubscribe(); - const data = await new Promise((resolve) => { - const data = []; - subscription.on("data", function (d: any) { - data.push(d); - if (data.length == logs_generated) resolve(data); - }); - }); - subscription.unsubscribe(); - - expect(data).to.not.be.empty; - }); - - step("should support topic wildcards", async function () { - const subscription = web3Subscribe("logs", { - topics: [null, "0x0000000000000000000000000000000000000000000000000000000000000000"], - }); - - await new Promise((resolve) => { - subscription.once("connected", resolve); - }); - - await sendTransaction(context); - const data = await new Promise((resolve) => { - createAndFinalizeBlock(context.polkadotApi); - subscription.once("data", resolve); - }); - logs_generated += 1; - subscription.unsubscribe(); - - expect(data).to.not.be.null; - }); - - step("should support single values wrapped around a sequence", async function () { - const subscription = web3Subscribe("logs", { - topics: [ - ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"], - ["0x0000000000000000000000000000000000000000000000000000000000000000"], - ], - }); - - await new Promise((resolve) => { - subscription.once("connected", resolve); - }); - - const tx = await sendTransaction(context); - const data = await new Promise((resolve) => { - createAndFinalizeBlock(context.polkadotApi); - subscription.once("data", resolve); - }); - logs_generated += 1; - subscription.unsubscribe(); - - expect(data).to.not.be.null; - }); - - step("should support topic conditional parameters", async function () { - const subscription = web3Subscribe("logs", { - topics: [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - [ - "0x0000000000000000000000006be02d1d3665660d22ff9624b7be0551ee1ac91b", - "0x0000000000000000000000000000000000000000000000000000000000000000", - ], - ], - }); - - await new Promise((resolve) => { - subscription.once("connected", resolve); - }); - const tx = await sendTransaction(context); - const data = await new Promise((resolve) => { - createAndFinalizeBlock(context.polkadotApi); - subscription.once("data", resolve); - }); - logs_generated += 1; - subscription.unsubscribe(); - - expect(data).to.not.be.null; - }); - - step("should support multiple topic conditional parameters", async function () { - const subscription = web3Subscribe("logs", { - topics: [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - [ - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000006be02d1d3665660d22ff9624b7be0551ee1ac91b", - ], - [ - "0x0000000000000000000000006be02d1d3665660d22ff9624b7be0551ee1ac91b", - "0x0000000000000000000000000000000000000000000000000000000000000000", - ], - ], - }); - - await new Promise((resolve) => { - subscription.once("connected", resolve); - }); - - const tx = await sendTransaction(context); - const data = await new Promise((resolve) => { - createAndFinalizeBlock(context.polkadotApi); - subscription.once("data", resolve); - }); - logs_generated += 1; - subscription.unsubscribe(); - - expect(data).to.not.be.null; - }); - - step("should combine topic wildcards and conditional parameters", async function () { - const subscription = web3Subscribe("logs", { - topics: [ - null, - [ - "0x0000000000000000000000006be02d1d3665660d22ff9624b7be0551ee1ac91b", - "0x0000000000000000000000000000000000000000000000000000000000000000", - ], - null, - ], - }); - - await new Promise((resolve) => { - subscription.once("connected", resolve); - }); - - await sendTransaction(context); - const data = await new Promise((resolve) => { - createAndFinalizeBlock(context.polkadotApi); - subscription.once("data", resolve); - }); - logs_generated += 1; - subscription.unsubscribe(); - - expect(data).to.not.be.null; - }); - - step("should not receive log when contract fails", async function () { - const subscription = web3Subscribe("logs", {}); - - await new Promise((resolve) => { - subscription.once("connected", resolve); - }); - - await sendTransaction(context, { - gas: "0x" + (EXPECTED_TRANSACTION_GAS_COST - 1).toString(16), // lower than expected by 1 - }); - - const data = await new Promise((resolve) => { - createAndFinalizeBlock(context.polkadotApi); - let result = null; - subscription.once("data", (d) => (result = d)); - setTimeout(() => resolve(result), 1000); - // wait for 1 second to make sure a notification would have time to arrive. - // (This one is not supposed to arrive because the transaction ran out of gas.) - }); - subscription.unsubscribe(); - expect(data).to.be.null; - }); - }, - "ws" -); + expect(data).to.be.not.null; + expect(result).to.be.eq(data); + }); +}); diff --git a/tests/tests/test-trace-filter.ts b/tests/tests/test-trace-filter.ts index fe38bdd3254..b083f34158d 100644 --- a/tests/tests/test-trace-filter.ts +++ b/tests/tests/test-trace-filter.ts @@ -1,112 +1,84 @@ import { expect } from "chai"; -import { step } from "mocha-steps"; - -import { createAndFinalizeBlock, describeWithMoonbeam, customRequest } from "./util"; - -const CONTRACT = require("./constants/TraceFilter.json"); - -const GENESIS_ACCOUNT = "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b"; -const GENESIS_ACCOUNT_PRIVATE_KEY = - "0x99B3C12287537E38C90A9219D4CB074A89A16E9CDB20BF85728EBD97C343E342"; - -const address0 = "0xc2bf5f29a4384b1ab0c063e1c666f02121b6084a"; -const address1 = "0x42e2ee7ba8975c473157634ac2af4098190fc741"; -const address2 = "0xf8cef78e923919054037a1d03662bbd884ff4edf"; - -describeWithMoonbeam("Moonbeam RPC (trace_filter)", `simple-specs.json`, (context) => { - step("Replay succeeding CREATE", async function () { - // Deploy contract - const contract = new context.web3.eth.Contract(CONTRACT.abi); - const contract_deploy = contract.deploy({ - data: CONTRACT.bytecode, - arguments: [false], // don't revert +import { customWeb3Request } from "../util/providers"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createContract, createContractExecution } from "../util/transactions"; +import { GENESIS_ACCOUNT } from "../util/constants"; + +const GENESIS_CONTRACT_ADDRESSES = [ + "0xc2bf5f29a4384b1ab0c063e1c666f02121b6084a", + "0x42e2ee7ba8975c473157634ac2af4098190fc741", + "0xf8cef78e923919054037a1d03662bbd884ff4edf", +]; + +describeDevMoonbeam("Trace filter - Contract creation ", (context) => { + before("Setup: Create 4 blocks with TraceFilter contracts", async function () { + const { contract, rawTx } = await createContract(context.web3, "TraceFilter", {}, [false]); + await context.createBlock({ transactions: [rawTx] }); + + const { rawTx: rawTx2 } = await createContract(context.web3, "TraceFilter", {}, [true]); + await context.createBlock({ transactions: [rawTx2] }); + + const { rawTx: rawTx3 } = await createContract(context.web3, "TraceFilter", {}, [false]); + const { rawTx: rawTx4 } = await createContract(context.web3, "TraceFilter", { nonce: 3 }, [ + false, + ]); + await context.createBlock({ transactions: [rawTx3, rawTx4] }); + + await context.createBlock({ + transactions: [ + await createContractExecution(context.web3, { + contract, + contractCall: contract.methods.subcalls( + GENESIS_CONTRACT_ADDRESSES[1], + GENESIS_CONTRACT_ADDRESSES[2] + ), + }), + ], }); + }); - const tx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - data: contract_deploy.encodeABI(), - value: "0x00", - gasPrice: "0x01", - gas: "0x500000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - - let send = await customRequest(context.web3, "eth_sendRawTransaction", [tx.rawTransaction]); - - await createAndFinalizeBlock(context.polkadotApi); - - // Perform RPC call. - let response = await customRequest(context.web3, "trace_filter", [ + it("should be able to replay deployed contract", async function () { + let response = await customWeb3Request(context.web3, "trace_filter", [ { fromBlock: "0x01", toBlock: "0x01", }, ]); - // console.log(JSON.stringify(response)); - expect(response.result.length).to.equal(1); - expect(response.result[0].action.creationMethod).to.equal("create"); - expect(response.result[0].action.from).to.equal("0x6be02d1d3665660d22ff9624b7be0551ee1ac91b"); - expect(response.result[0].action.gas).to.equal("0x4ffead"); - expect(response.result[0].action.init).to.be.a("string"); - expect(response.result[0].action.value).to.equal("0x0"); - expect(response.result[0].blockHash).to.be.a("string"); - expect(response.result[0].blockNumber).to.equal(1); - expect(response.result[0].result.address).to.equal( - "0xc2bf5f29a4384b1ab0c063e1c666f02121b6084a" - ); - expect(response.result[0].result.code).to.be.a("string"); - expect(response.result[0].result.gasUsed).to.equal("0x153"); - expect(response.result[0].error).to.equal(undefined); - expect(response.result[0].subtraces).to.equal(0); - expect(response.result[0].traceAddress.length).to.equal(0); - expect(response.result[0].transactionHash).to.equal( - "0x282fdd0b08fd385bbc233cffd5679ee703fc6b4c5b54d6096ae47fa92372790e" - ); - expect(response.result[0].transactionPosition).to.equal(0); - expect(response.result[0].type).to.equal("create"); - }); - - step("Replay reverting CREATE", async function () { - // Deploy contract - const contract = new context.web3.eth.Contract(CONTRACT.abi); - const contract_deploy = contract.deploy({ - data: CONTRACT.bytecode, - arguments: [true], // revert + expect(response.result[0].action).to.include({ + creationMethod: "create", + from: "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b", + gas: "0xb718d7", + value: "0x0", + }); + expect(response.result[0].result).to.include({ + address: "0xc2bf5f29a4384b1ab0c063e1c666f02121b6084a", + gasUsed: "0x229", }); - const tx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - data: contract_deploy.encodeABI(), - value: "0x00", - gasPrice: "0x01", - gas: "0x500000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - - let send = await customRequest(context.web3, "eth_sendRawTransaction", [tx.rawTransaction]); - - await createAndFinalizeBlock(context.polkadotApi); + expect(response.result[0]).to.include({ + blockNumber: 1, + subtraces: 0, + transactionHash: "0x5301ed3a9a1be6001cf261f4197169fd6bc24804270be3c7de19fffdb63ad198", + transactionPosition: 0, + type: "create", + }); + }); + it("should be able to replay reverted contract", async function () { // Perform RPC call. - let response = await customRequest(context.web3, "trace_filter", [ + let response = await customWeb3Request(context.web3, "trace_filter", [ { fromBlock: "0x02", toBlock: "0x02", }, ]); - // console.log(JSON.stringify(response)); - expect(response.result.length).to.equal(1); expect(response.result[0].action.creationMethod).to.equal("create"); expect(response.result[0].action.from).to.equal("0x6be02d1d3665660d22ff9624b7be0551ee1ac91b"); - expect(response.result[0].action.gas).to.equal("0x4fff44"); + expect(response.result[0].action.gas).to.equal("0xb7198c"); expect(response.result[0].action.init).to.be.a("string"); expect(response.result[0].action.value).to.equal("0x0"); expect(response.result[0].blockHash).to.be.a("string"); @@ -116,41 +88,15 @@ describeWithMoonbeam("Moonbeam RPC (trace_filter)", `simple-specs.json`, (contex expect(response.result[0].subtraces).to.equal(0); expect(response.result[0].traceAddress.length).to.equal(0); expect(response.result[0].transactionHash).to.equal( - "0x214cf6578d15751c7d5e68ad7167f2b7bcbb0023be155cd55cd1fb059e238c89" + "0x0ddcb527475b0d5e6a45ba6d9bb367c18a7142b5919247f5dd521c744fcd22a3" ); expect(response.result[0].transactionPosition).to.equal(0); expect(response.result[0].type).to.equal("create"); }); - step("Multiple transactions in the same block + trace over multiple blocks", async function () { - const contract = new context.web3.eth.Contract(CONTRACT.abi); - - // Deploy 2 more contracts - for (var i = 0; i < 2; i++) { - const contract_deploy = contract.deploy({ - data: CONTRACT.bytecode, - arguments: [false], // don't revert - }); - - const tx = await context.web3.eth.accounts.signTransaction( - { - nonce: 2 + i, - from: GENESIS_ACCOUNT, - data: contract_deploy.encodeABI(), - value: "0x00", - gasPrice: "0x01", - gas: "0x100000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - - let send = await customRequest(context.web3, "eth_sendRawTransaction", [tx.rawTransaction]); - } - - await createAndFinalizeBlock(context.polkadotApi); - + it("should be able to trace through multiple blocks", async function () { // Perform RPC call. - let response = await customRequest(context.web3, "trace_filter", [ + let response = await customWeb3Request(context.web3, "trace_filter", [ { fromBlock: "0x02", toBlock: "0x03", @@ -164,40 +110,17 @@ describeWithMoonbeam("Moonbeam RPC (trace_filter)", `simple-specs.json`, (contex expect(response.result[1].transactionPosition).to.equal(0); expect(response.result[2].blockNumber).to.equal(3); expect(response.result[2].transactionPosition).to.equal(1); - - // console.log(JSON.stringify(response)); }); - step("Call with subcalls, some reverting", async function () { - const contract = new context.web3.eth.Contract(CONTRACT.abi); - - const contract_call = contract.methods.subcalls(address1, address2); - - const tx = await context.web3.eth.accounts.signTransaction( - { - to: address0, - from: GENESIS_ACCOUNT, - data: contract_call.encodeABI(), - value: "0x00", - gasPrice: "0x01", - gas: "0x500000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - - let send = await customRequest(context.web3, "eth_sendRawTransaction", [tx.rawTransaction]); - - await createAndFinalizeBlock(context.polkadotApi); - + it("should be able to trace sub-call with reverts", async function () { // Perform RPC call. - let response = await customRequest(context.web3, "trace_filter", [ + let response = await customWeb3Request(context.web3, "trace_filter", [ { fromBlock: "0x04", toBlock: "0x04", }, ]); - // console.log(JSON.stringify(response)); expect(response.result.length).to.equal(7); expect(response.result[0].subtraces).to.equal(2); expect(response.result[0].traceAddress).to.deep.equal([]); @@ -215,15 +138,14 @@ describeWithMoonbeam("Moonbeam RPC (trace_filter)", `simple-specs.json`, (contex expect(response.result[6].traceAddress).to.deep.equal([1, 1]); }); - step("Request range of blocks", async function () { - let response = await customRequest(context.web3, "trace_filter", [ + it("should support tracing range of blocks", async function () { + let response = await customWeb3Request(context.web3, "trace_filter", [ { fromBlock: "0x03", toBlock: "0x04", }, ]); - // console.log(JSON.stringify(response)); expect(response.result.length).to.equal(9); expect(response.result[0].blockNumber).to.equal(3); expect(response.result[0].transactionPosition).to.equal(0); @@ -245,8 +167,8 @@ describeWithMoonbeam("Moonbeam RPC (trace_filter)", `simple-specs.json`, (contex expect(response.result[8].transactionPosition).to.equal(0); }); - step("Filter fromAddress", async function () { - let response = await customRequest(context.web3, "trace_filter", [ + it("should support filtering trace per fromAddress", async function () { + let response = await customWeb3Request(context.web3, "trace_filter", [ { fromBlock: "0x03", toBlock: "0x04", @@ -257,35 +179,54 @@ describeWithMoonbeam("Moonbeam RPC (trace_filter)", `simple-specs.json`, (contex expect(response.result.length).to.equal(3); }); - step("Filter toAddress", async function () { - let response = await customRequest(context.web3, "trace_filter", [ + it("should support filtering trace per toAddress", async function () { + let response = await customWeb3Request(context.web3, "trace_filter", [ { fromBlock: "0x03", toBlock: "0x04", - toAddress: [address2], + toAddress: [GENESIS_CONTRACT_ADDRESSES[2]], }, ]); expect(response.result.length).to.equal(4); }); - step("Should accept a max. 500 count request", async function () { - let response = await customRequest(context.web3, "trace_filter", [ + it("should handle pagination", async function () { + let response = await customWeb3Request(context.web3, "trace_filter", [ + { + fromBlock: "0x03", + toBlock: "0x04", + count: 2, + after: 1, + }, + ]); + + expect(response.result.length).to.equal(2); + expect(response.result[0].blockNumber).to.equal(3); + expect(response.result[0].transactionPosition).to.equal(1); + expect(response.result[1].blockNumber).to.equal(4); + expect(response.result[1].transactionPosition).to.equal(0); + }); + + it("should succeed for 500 traces request", async function () { + let response = await customWeb3Request(context.web3, "trace_filter", [ { fromBlock: "0x01", toBlock: "0x04", count: 500, }, ]); - expect(response.hasOwnProperty("error")).to.eq(false); - response = await customRequest(context.web3, "trace_filter", [ + expect(response.error).to.not.exist; + }); + + it("should fail for 501 traces request", async function () { + let response = await customWeb3Request(context.web3, "trace_filter", [ { fromBlock: "0x01", toBlock: "0x04", count: 501, }, ]); - expect(response.hasOwnProperty("error")).to.eq(true); expect(response.error).to.deep.eq({ code: -32603, message: "count (501) can't be greater than maximum (500)", diff --git a/tests/tests/test-trace.ts b/tests/tests/test-trace.ts index 620c1ab5b30..2d2979090df 100644 --- a/tests/tests/test-trace.ts +++ b/tests/tests/test-trace.ts @@ -1,85 +1,54 @@ import { expect } from "chai"; -import { Keyring } from "@polkadot/keyring"; -import { step } from "mocha-steps"; +import { customWeb3Request } from "../util/providers"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { GENESIS_ACCOUNT, GENESIS_ACCOUNT_PRIVATE_KEY } from "../util/constants"; +import { createContract } from "../util/transactions"; -import { createAndFinalizeBlock, describeWithMoonbeam, customRequest } from "./util"; - -const INCREMENTER = require("./constants/Incrementer.json"); -const CALLEE = require("./constants/Callee.json"); -const CALLER = require("./constants/Caller.json"); -const BS_TRACER = require("./constants/blockscout_tracer.min.json"); - -const GENESIS_ACCOUNT = "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b"; -const GENESIS_ACCOUNT_PRIVATE_KEY = - "0x99B3C12287537E38C90A9219D4CB074A89A16E9CDB20BF85728EBD97C343E342"; +const BS_TRACER = require("../util/tracer/blockscout_tracer.min.json"); async function nested(context) { - // Create Callee contract. - const calleeTx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - data: CALLEE.bytecode, - value: "0x00", - gasPrice: "0x01", - gas: "0x100000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY + let nonce = await context.web3.eth.getTransactionCount(GENESIS_ACCOUNT); + const { contract: callee, rawTx: rawTx1 } = await createContract( + context.web3, + "Callee", + { nonce: nonce++ }, + [] ); - let send = await customRequest(context.web3, "eth_sendRawTransaction", [calleeTx.rawTransaction]); - await createAndFinalizeBlock(context.polkadotApi); - let receipt = await context.web3.eth.getTransactionReceipt(send.result); - const callee_addr = receipt.contractAddress; - const callee = new context.web3.eth.Contract(CALLEE.abi, callee_addr); - // Create Caller contract. - const callerTx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - data: CALLER.bytecode, - value: "0x00", - gasPrice: "0x01", - gas: "0x100000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY + + const { contract: caller, rawTx: rawTx2 } = await createContract( + context.web3, + "Caller", + { nonce: nonce++ }, + [] ); - send = await customRequest(context.web3, "eth_sendRawTransaction", [callerTx.rawTransaction]); - await createAndFinalizeBlock(context.polkadotApi); - receipt = await context.web3.eth.getTransactionReceipt(send.result); - const caller_addr = receipt.contractAddress; - const caller = new context.web3.eth.Contract(CALLER.abi, caller_addr); + await context.createBlock({ + transactions: [rawTx1, rawTx2], + }); + + const calleeAddr = callee.options.address; + const callerAddr = caller.options.address; + // Nested call let callTx = await context.web3.eth.accounts.signTransaction( { from: GENESIS_ACCOUNT, - to: caller_addr, + to: callerAddr, gas: "0x100000", value: "0x00", - data: caller.methods.someAction(callee_addr, 6).encodeABI(), // calls callee + data: caller.methods.someAction(calleeAddr, 6).encodeABI(), // calls callee }, GENESIS_ACCOUNT_PRIVATE_KEY ); - return await customRequest(context.web3, "eth_sendRawTransaction", [callTx.rawTransaction]); + return await customWeb3Request(context.web3, "eth_sendRawTransaction", [callTx.rawTransaction]); } -describeWithMoonbeam("Moonbeam RPC (Trace)", `simple-specs.json`, (context) => { - step("[Raw] should replay over an intermediate state", async function () { - const createTx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - data: INCREMENTER.bytecode, - value: "0x00", - gasPrice: "0x01", - gas: "0x100000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - let send = await customRequest(context.web3, "eth_sendRawTransaction", [ - createTx.rawTransaction, - ]); - await createAndFinalizeBlock(context.polkadotApi); - let receipt = await context.web3.eth.getTransactionReceipt(send.result); - // This contract's `sum` method receives a number as an argument, increments the storage and - // returns the current value. - let contract = new context.web3.eth.Contract(INCREMENTER.abi, receipt.contractAddress); +describeDevMoonbeam("Trace", (context) => { + it("should replay over an intermediate state", async function () { + const { contract, rawTx } = await createContract(context.web3, "Incrementer", {}, [false]); + const { txResults } = await context.createBlock({ + transactions: [rawTx], + }); + let receipt = await context.web3.eth.getTransactionReceipt(txResults[0].result); // In our case, the total number of transactions == the max value of the incrementer. // If we trace the last transaction of the block, should return the total number of @@ -88,50 +57,50 @@ describeWithMoonbeam("Moonbeam RPC (Trace)", `simple-specs.json`, (context) => { // // So we set 5 different target txs for a single block: the 1st, 3 intermediate, and // the last. - const total_txs = 10; + const totalTxs = 10; let targets = [1, 2, 5, 8, 10]; - let iteration = 0; let txs = []; - let num_txs; // Create 10 transactions in a block. - for (num_txs = 1; num_txs <= total_txs; num_txs++) { + for (let numTxs = 1; numTxs <= totalTxs; numTxs++) { let callTx = await context.web3.eth.accounts.signTransaction( { from: GENESIS_ACCOUNT, to: receipt.contractAddress, gas: "0x100000", value: "0x00", - nonce: num_txs, + nonce: numTxs, data: contract.methods.sum(1).encodeABI(), // increments by one }, GENESIS_ACCOUNT_PRIVATE_KEY ); - send = await customRequest(context.web3, "eth_sendRawTransaction", [callTx.rawTransaction]); - txs.push(send.result); + const data = await customWeb3Request(context.web3, "eth_sendRawTransaction", [ + callTx.rawTransaction, + ]); + txs.push(data.result); } - await createAndFinalizeBlock(context.polkadotApi); + await context.createBlock(); // Trace 5 target transactions on it. for (let target of targets) { let index = target - 1; - let receipt = await context.web3.eth.getTransactionReceipt(txs[index]); + await context.web3.eth.getTransactionReceipt(txs[index]); - let intermediate_tx = await customRequest(context.web3, "debug_traceTransaction", [ + let intermediateTx = await customWeb3Request(context.web3, "debug_traceTransaction", [ txs[index], ]); - let evm_result = context.web3.utils.hexToNumber("0x" + intermediate_tx.result.returnValue); + let evmResult = context.web3.utils.hexToNumber("0x" + intermediateTx.result.returnValue); // console.log(`Matching target ${target} against evm result ${evm_result}`); - expect(evm_result).to.equal(target); + expect(evmResult).to.equal(target); } }); - step("[Raw] should trace nested contract calls", async function () { + it("should trace nested contract calls", async function () { const send = await nested(context); - await createAndFinalizeBlock(context.polkadotApi); - let traceTx = await customRequest(context.web3, "debug_traceTransaction", [send.result]); + await context.createBlock(); + let traceTx = await customWeb3Request(context.web3, "debug_traceTransaction", [send.result]); let logs = []; for (let log of traceTx.result.stepLogs) { if (logs.length == 1) { @@ -141,15 +110,15 @@ describeWithMoonbeam("Moonbeam RPC (Trace)", `simple-specs.json`, (context) => { logs.push(log); } } - expect(logs.length).to.be.equal(2); + expect(logs).to.be.lengthOf(2); expect(logs[0].depth).to.be.equal(2); expect(logs[1].depth).to.be.equal(1); }); - step("[Raw] should use optional disable parameters", async function () { + it("should use optional disable parameters", async function () { const send = await nested(context); - await createAndFinalizeBlock(context.polkadotApi); - let traceTx = await customRequest(context.web3, "debug_traceTransaction", [ + await context.createBlock(); + let traceTx = await customWeb3Request(context.web3, "debug_traceTransaction", [ send.result, { disableMemory: true, disableStack: true, disableStorage: true }, ]); @@ -166,15 +135,15 @@ describeWithMoonbeam("Moonbeam RPC (Trace)", `simple-specs.json`, (context) => { expect(logs.length).to.be.equal(0); }); - step("[Blockscout] should trace nested contract calls", async function () { + it("should format as request (Blockscout)", async function () { const send = await nested(context); - await createAndFinalizeBlock(context.polkadotApi); - let traceTx = await customRequest(context.web3, "debug_traceTransaction", [ + await context.createBlock(); + let traceTx = await customWeb3Request(context.web3, "debug_traceTransaction", [ send.result, { tracer: BS_TRACER.body }, ]); let entries = traceTx.result; - expect(entries.length).to.be.equal(2); + expect(entries).to.be.lengthOf(2); let resCaller = entries[0]; let resCallee = entries[1]; expect(resCaller.callType).to.be.equal("call"); diff --git a/tests/tests/test-txpool-future-eth.ts b/tests/tests/test-txpool-future-eth.ts new file mode 100644 index 00000000000..cf99e8a6880 --- /dev/null +++ b/tests/tests/test-txpool-future-eth.ts @@ -0,0 +1,31 @@ +import { expect } from "chai"; + +import { createContract } from "../util/transactions"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { customWeb3Request } from "../util/providers"; + +describeDevMoonbeam("TxPool - Genesis", (context) => { + it("should be empty", async function () { + let inspect = await customWeb3Request(context.web3, "txpool_inspect", []); + expect(inspect.result.pending).to.be.empty; + let content = await customWeb3Request(context.web3, "txpool_content", []); + expect(content.result.pending).to.be.empty; + }); +}); + +describeDevMoonbeam("TxPool - New block", (context) => { + before("Setup: Create transaction and empty block", async () => { + const { rawTx } = await createContract(context.web3, "TestContract", { + gas: 1048576, + }); + await context.createBlock({ transactions: [rawTx] }); + await context.createBlock(); + }); + + it("should reset the txpool", async function () { + let inspect = await customWeb3Request(context.web3, "txpool_inspect", []); + expect(inspect.result.pending).to.be.empty; + let content = await customWeb3Request(context.web3, "txpool_content", []); + expect(content.result.pending).to.be.empty; + }); +}); diff --git a/tests/tests/test-txpool-limits.ts b/tests/tests/test-txpool-limits.ts new file mode 100644 index 00000000000..619a46f30c8 --- /dev/null +++ b/tests/tests/test-txpool-limits.ts @@ -0,0 +1,19 @@ +import { describeDevMoonbeam } from "../util/setup-dev-tests"; + +describeDevMoonbeam("TxPool - Limits", (context) => { + it.skip("should be able to fill a block with 260 tx", async function () {}); + + it.skip("should be able to fill a block with 64 contract creations tx", async function () {}); + + // 8192 is the number of tx that can be sent to the Pool + // before it throws an error and drops all tx + it.skip("should be able to send 8192 tx to the pool and have them all published\ + within the following blocks", async function () {}); + + it.skip("shouldn't work for 8193", async function () {}); + + it.skip("should be able to send 8192 tx to the pool and have them all published\ + within the following blocks - bigger tx", async function () {}); + + it.skip("shouldn't work for 8193 - bigger tx", async function () {}); +}); diff --git a/tests/tests/test-txpool-pending.ts b/tests/tests/test-txpool-pending.ts new file mode 100644 index 00000000000..5ffeab13c89 --- /dev/null +++ b/tests/tests/test-txpool-pending.ts @@ -0,0 +1,98 @@ +import { expect } from "chai"; +import { Contract } from "web3-eth-contract"; + +import { GENESIS_ACCOUNT } from "../util/constants"; +import { createContract, createContractExecution } from "../util/transactions"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { customWeb3Request } from "../util/providers"; + +describeDevMoonbeam("TxPool - Pending Ethereum transaction", (context) => { + let txHash; + before("Setup: Create transaction", async () => { + const { rawTx } = await createContract(context.web3, "TestContract", { + gas: 1048576, + }); + txHash = (await customWeb3Request(context.web3, "eth_sendRawTransaction", [rawTx])).result; + }); + + it("should appear in the txpool inspection", async function () { + let inspect = await customWeb3Request(context.web3, "txpool_inspect", []); + let data = inspect.result.pending[GENESIS_ACCOUNT][context.web3.utils.toHex(0)]; + expect(data).to.not.be.undefined; + expect(data).to.be.equal( + "0x0000000000000000000000000000000000000000: 0 wei + 1048576 gas x 1 wei" + ); + }); + + it("should be marked as pending", async function () { + const pendingTransaction = ( + await customWeb3Request(context.web3, "eth_getTransactionByHash", [txHash]) + ).result; + // pending transactions do not know yet to which block they belong to + expect(pendingTransaction).to.include({ + blockNumber: null, + hash: txHash, + }); + }); + + it("should appear in the txpool content", async function () { + let content = await customWeb3Request(context.web3, "txpool_content", []); + + const data = content.result.pending[GENESIS_ACCOUNT][context.web3.utils.toHex(0)]; + expect(data).to.include({ + blockHash: "0x0000000000000000000000000000000000000000000000000000000000000000", + blockNumber: null, + from: GENESIS_ACCOUNT.toString(), + gas: "0x100000", + gasPrice: "0x1", + nonce: context.web3.utils.toHex(0), + to: "0x0000000000000000000000000000000000000000", + value: "0x0", + }); + }); +}); + +describeDevMoonbeam("TxPool - Ethereum Contract Call", (context) => { + let testContract: Contract; + + before("Setup: Create contract block and add call transaction", async () => { + const { contract, rawTx } = await createContract(context.web3, "TestContract", { + gas: 1048576, + }); + testContract = contract; + await context.createBlock({ transactions: [rawTx] }); + + await customWeb3Request(context.web3, "eth_sendRawTransaction", [ + await createContractExecution(context.web3, { + contract, + contractCall: contract.methods.multiply(5), + }), + ]); + }); + + it("should appear in the txpool inspection", async function () { + const contractAddress = testContract.options.address; + const inspect = await customWeb3Request(context.web3, "txpool_inspect", []); + const data = inspect.result.pending[GENESIS_ACCOUNT][context.web3.utils.toHex(1)]; + + expect(data).to.not.be.undefined; + expect(data).to.be.equal( + contractAddress.toString().toLowerCase() + ": 0 wei + 12000000 gas x 1 wei" + ); + }); + + it("should appear in the txpool content", async function () { + const content = await customWeb3Request(context.web3, "txpool_content", []); + const data = content.result.pending[GENESIS_ACCOUNT][context.web3.utils.toHex(1)]; + expect(data).to.include({ + blockHash: "0x0000000000000000000000000000000000000000000000000000000000000000", + blockNumber: null, + from: GENESIS_ACCOUNT.toString(), + gas: "0xb71b00", + gasPrice: "0x1", + nonce: context.web3.utils.toHex(1), + to: testContract.options.address.toString().toLowerCase(), + value: "0x0", + }); + }); +}); diff --git a/tests/tests/test-txpool-reset.ts b/tests/tests/test-txpool-reset.ts new file mode 100644 index 00000000000..cf99e8a6880 --- /dev/null +++ b/tests/tests/test-txpool-reset.ts @@ -0,0 +1,31 @@ +import { expect } from "chai"; + +import { createContract } from "../util/transactions"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { customWeb3Request } from "../util/providers"; + +describeDevMoonbeam("TxPool - Genesis", (context) => { + it("should be empty", async function () { + let inspect = await customWeb3Request(context.web3, "txpool_inspect", []); + expect(inspect.result.pending).to.be.empty; + let content = await customWeb3Request(context.web3, "txpool_content", []); + expect(content.result.pending).to.be.empty; + }); +}); + +describeDevMoonbeam("TxPool - New block", (context) => { + before("Setup: Create transaction and empty block", async () => { + const { rawTx } = await createContract(context.web3, "TestContract", { + gas: 1048576, + }); + await context.createBlock({ transactions: [rawTx] }); + await context.createBlock(); + }); + + it("should reset the txpool", async function () { + let inspect = await customWeb3Request(context.web3, "txpool_inspect", []); + expect(inspect.result.pending).to.be.empty; + let content = await customWeb3Request(context.web3, "txpool_content", []); + expect(content.result.pending).to.be.empty; + }); +}); diff --git a/tests/tests/test-txpool.ts b/tests/tests/test-txpool.ts deleted file mode 100644 index 795e5b6f10d..00000000000 --- a/tests/tests/test-txpool.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { expect } from "chai"; - -import { createAndFinalizeBlock, customRequest, describeWithMoonbeam } from "./util"; -import { ERC20_BYTECODE } from "./constants/testContracts"; -import { GENESIS_ACCOUNT, GENESIS_ACCOUNT_PRIVATE_KEY } from "./constants"; - -let txContract, contractAddress; - -describeWithMoonbeam("Moonbeam RPC (TxPool RPC module)", `simple-specs.json`, (context) => { - it("should get pending pool information on Create", async function () { - const tx = await context.web3.eth.accounts.signTransaction( - { - from: GENESIS_ACCOUNT, - data: ERC20_BYTECODE, - value: "0x00", - gasPrice: "0x01", - gas: "0x100000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - txContract = await customRequest(context.web3, "eth_sendRawTransaction", [tx.rawTransaction]); - - let inspect = await customRequest(context.web3, "txpool_inspect", []); - - let data = inspect.result.pending[GENESIS_ACCOUNT]["0x0"]; - expect(data).to.not.be.undefined; - expect(data).to.be.equal( - "0x0000000000000000000000000000000000000000: 0 wei + 1048576 gas x 1 wei" - ); - - let content = await customRequest(context.web3, "txpool_content", []); - - data = content.result.pending[GENESIS_ACCOUNT]["0x0"]; - expect(data).to.include({ - blockHash: "0x0000000000000000000000000000000000000000000000000000000000000000", - blockNumber: null, - from: "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b", - gas: "0x100000", - gasPrice: "0x1", - hash: "0x6073b838b5cb04e04e57d6f25dd9387ff2a3d1de5c9a7bd89206f269cb64fe1b", - nonce: "0x0", - to: "0x0000000000000000000000000000000000000000", - value: "0x0", - }); - }); - - it("pool should be empty after producing a block", async function () { - await createAndFinalizeBlock(context.polkadotApi); - - const receipt = await context.web3.eth.getTransactionReceipt(txContract.result); - - contractAddress = receipt.contractAddress; - - let inspect = await customRequest(context.web3, "txpool_inspect", []); - let data = inspect.result.pending[GENESIS_ACCOUNT]; - expect(data).to.be.undefined; - - let content = await customRequest(context.web3, "txpool_content", []); - data = content.result.pending[GENESIS_ACCOUNT]; - expect(data).to.be.undefined; - }); - - it("should get pending pool information on Call", async function () { - const transferFnCode = `a9059cbb000000000000000000000000`; - const tokensToTransfer = `00000000000000000000000000000000000000000000000000000000000000dd`; - const inputCode = `0x${transferFnCode}${GENESIS_ACCOUNT.substring(2)}${tokensToTransfer}`; - - const tx = await context.web3.eth.accounts.signTransaction( - { - to: contractAddress, - data: inputCode, - value: "0x00", - gasPrice: "0x01", - gas: "0x100000", - }, - GENESIS_ACCOUNT_PRIVATE_KEY - ); - await customRequest(context.web3, "eth_sendRawTransaction", [tx.rawTransaction]); - - let inspect = await customRequest(context.web3, "txpool_inspect", []); - - let data = inspect.result.pending[GENESIS_ACCOUNT]["0x1"]; - - expect(data).to.not.be.undefined; - expect(data).to.be.equal( - "0xc2bf5f29a4384b1ab0c063e1c666f02121b6084a: 0 wei + 1048576 gas x 1 wei" - ); - - let content = await customRequest(context.web3, "txpool_content", []); - - data = content.result.pending[GENESIS_ACCOUNT]["0x1"]; - expect(data).to.include({ - blockHash: "0x0000000000000000000000000000000000000000000000000000000000000000", - blockNumber: null, - from: "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b", - gas: "0x100000", - gasPrice: "0x1", - hash: "0x82e9940df25dec4f57030478ff848728e38e55cffd031cd6f43b3c114863544d", - nonce: "0x1", - to: "0xc2bf5f29a4384b1ab0c063e1c666f02121b6084a", - value: "0x0", - }); - }); -}); diff --git a/tests/tests/test-version.ts b/tests/tests/test-version.ts index 882a32715fc..72b1b7e2b05 100644 --- a/tests/tests/test-version.ts +++ b/tests/tests/test-version.ts @@ -1,13 +1,21 @@ import { expect } from "chai"; -import { step } from "mocha-steps"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; +import { createContract } from "../util/transactions"; -import { describeWithMoonbeam } from "./util"; - -describeWithMoonbeam("Moonbeam RPC (Version)", `simple-specs.json`, (context) => { - step("eth_chainId should match", async function () { +describeDevMoonbeam("Version RPC", (context) => { + it("should return 1281 for eth_chainId", async function () { expect(await context.web3.eth.getChainId()).to.equal(1281); }); - step("net_version should match", async function () { + it("should return 1281 for net_version", async function () { expect(await context.web3.eth.net.getId()).to.equal(1281); }); }); + +describeDevMoonbeam("Version - ChainId", (context) => { + it("should be accessible within a contract", async function () { + const { contract, rawTx } = await createContract(context.web3, "CheckBlockGasLimit"); + await context.createBlock({ transactions: [rawTx] }); + + expect(await contract.methods.chainid().call()).to.equal("1281"); + }); +}); diff --git a/tests/tests/test-web3api.ts b/tests/tests/test-web3api.ts index d5a35b52f99..e5552edaa58 100644 --- a/tests/tests/test-web3api.ts +++ b/tests/tests/test-web3api.ts @@ -1,8 +1,9 @@ import { expect } from "chai"; -import { describeWithMoonbeam, customRequest } from "./util"; +import { customWeb3Request } from "../util/providers"; +import { describeDevMoonbeam } from "../util/setup-dev-tests"; -describeWithMoonbeam("Moonbeam RPC (Web3Api)", `simple-specs.json`, (context) => { - it("should get client version", async function () { +describeDevMoonbeam("Web3Api Information", (context) => { + it("should include client version", async function () { const version = await context.web3.eth.getNodeInfo(); let specName: string = await context.polkadotApi.runtimeVersion.specName.toString(); let specVersion: string = await context.polkadotApi.runtimeVersion.specVersion.toString(); @@ -11,11 +12,11 @@ describeWithMoonbeam("Moonbeam RPC (Web3Api)", `simple-specs.json`, (context) => expect(version).to.be.match(regex); }); - it("should remote sha3", async function () { + it("should provide sha3 hashing", async function () { const data = context.web3.utils.stringToHex("hello"); - const hash = await customRequest(context.web3, "web3_sha3", [data]); - const local_hash = context.web3.utils.sha3("hello"); - expect(hash.result).to.be.equal(local_hash); + const hash = await customWeb3Request(context.web3, "web3_sha3", [data]); + const localhash = context.web3.utils.sha3("hello"); + expect(hash.result).to.be.equal(localhash); }); it("should report peer count in hex", async function () { @@ -24,7 +25,7 @@ describeWithMoonbeam("Moonbeam RPC (Web3Api)", `simple-specs.json`, (context) => // related: frontier commits 677548c and 78fb3bc - const result = await customRequest(context.web3, "net_peerCount", []); + const result = await customWeb3Request(context.web3, "net_peerCount", []); // TODO: this is really just testing that the result comes back as a string, not that it's // expressed in hex (as opposed to decimal) diff --git a/tests/tests/util/fillBlockWithTx.ts b/tests/tests/util/fillBlockWithTx.ts deleted file mode 100644 index ccdc207f06b..00000000000 --- a/tests/tests/util/fillBlockWithTx.ts +++ /dev/null @@ -1,188 +0,0 @@ -import Web3 from "web3"; - -import { JsonRpcResponse } from "web3-core-helpers"; -import { SignedTransaction, TransactionConfig } from "web3-core"; -import { - basicTransfertx, - CompleteTransactionConfig, - GENESIS_ACCOUNT, - GENESIS_ACCOUNT_PRIVATE_KEY, -} from "../constants"; -import { wrappedCustomRequest } from "./web3Requests"; -import { createAndFinalizeBlock } from "."; -import { Context, log } from "./testWithMoonbeam"; - -function isSignedTransaction(tx: Error | SignedTransaction): tx is SignedTransaction { - return (tx as SignedTransaction).rawTransaction !== undefined; -} -function isJsonRpcResponse(res: Error | JsonRpcResponse): res is JsonRpcResponse { - return (res as JsonRpcResponse).jsonrpc !== undefined; -} - -// sign tx with error catching -async function wrappedSignTx( - web3: Web3, - txConfig: TransactionConfig, - privateKey: string -): Promise { - try { - let tx = await web3.eth.accounts.signTransaction(txConfig, privateKey); - return tx; - } catch (e) { - return new Error(e.toString()); - } -} - -// Sign tx sequentially -async function serialSignTx( - web3: Web3, - n: number, - startingNonce: number, - customTxConfig: TransactionConfig -): Promise<(Error | SignedTransaction)[]> { - const resArray = []; - for (let index = 0; index < n; index++) { - resArray.push( - await wrappedSignTx( - web3, - { ...customTxConfig, nonce: startingNonce + index }, - GENESIS_ACCOUNT_PRIVATE_KEY - ) - ); - } - return resArray; -} - -// Send tx to the pool sequentially -async function serialSendTx( - web3: Web3, - n: number, - _txList: (Error | SignedTransaction)[] -): Promise<(Error | JsonRpcResponse)[]> { - const resArray = []; - for (let index = 0; index < n; index++) { - if (isSignedTransaction(_txList[index])) { - resArray.push( - await wrappedCustomRequest(web3, "eth_sendRawTransaction", [ - (_txList[index] as SignedTransaction).rawTransaction, - ]) - ); - } else { - resArray.push(_txList[index] as Error); - } - } - return resArray; -} - -interface FillBlockReport { - txPassed: number; - txPassedFirstBlock: number; - numberOfBlocks: number; - signingTime: number; - sendingTime: number; -} - -export interface ErrorReport { - [key: string]: { - [key: string]: number; - }; -} - -// This function sends a batch of signed transactions to the pool and records both -// how many tx were included in the first block and the total number of tx that were -// included in a block -// By default, the tx is a simple transfer, but a TransactionConfig can be specified as an option -export async function fillBlockWithTx( - context: Context, - numberOfTx: number, - customTxConfig: CompleteTransactionConfig = basicTransfertx -): Promise { - let nonce: number = await context.web3.eth.getTransactionCount(GENESIS_ACCOUNT); - - const numberArray = new Array(numberOfTx).fill(1); - - let errorReport: ErrorReport = { - signing: {}, - customreq: {}, - }; - - function reportError(e, domain: string) { - let message: string = e.error ? e.error.message : e.message ? e.message : JSON.stringify(e); - if (errorReport[domain][message]) { - errorReport[domain][message] += 1; - } else { - errorReport[domain][message] = 1; - } - } - - const startSigningTime: number = Date.now(); - - // First sign all transactions - - let txList: (Error | SignedTransaction)[] = await serialSignTx( - context.web3, - numberOfTx, - nonce, - customTxConfig as any // needed as the web3 types don't support chainId but the code does. - ); - - const signingTime: number = Date.now() - startSigningTime; - - log("Time it took to sign " + txList.length + " tx is " + signingTime / 1000 + " seconds"); - - const startSendingTime: number = Date.now(); - - //Then, send them to the pool - - let respList: (Error | JsonRpcResponse)[] = await serialSendTx(context.web3, numberOfTx, txList); - - respList.forEach((res) => { - if (isJsonRpcResponse(res) && res.error) { - reportError(res.error, "customreq"); - } else if (!isJsonRpcResponse(res)) { - reportError(res, "signing"); - } - }); - - const sendingTime: number = Date.now() - startSendingTime; - - log("Time it took to send " + respList.length + " tx is " + sendingTime / 1000 + " seconds"); - - log("Error Report : ", errorReport); - - log("created block in ", (await createAndFinalizeBlock(context.polkadotApi)) / 1000, " seconds"); - - let numberOfBlocks = 0; - let block = await context.web3.eth.getBlock("latest"); - let txPassed: number = block.transactions.length; - const txPassedFirstBlock: number = txPassed; - log( - "block.gasUsed", - block.gasUsed, - "block.number", - block.number, - "block.transactions.length", - block.transactions.length - ); - - let i: number = 2; - - while (block.transactions.length !== 0) { - await createAndFinalizeBlock(context.polkadotApi); - - block = await context.web3.eth.getBlock("latest"); - log( - "following block, block" + i + ".gasUsed", - block.gasUsed, - "block" + i + ".number", - block.number, - "block" + i + ".transactions.length", - block.transactions.length - ); - txPassed += block.transactions.length; - numberOfTx += 1; - i += 1; - } - - return { txPassed, txPassedFirstBlock, sendingTime, signingTime, numberOfBlocks }; -} diff --git a/tests/tests/util/index.ts b/tests/tests/util/index.ts deleted file mode 100644 index e131112517b..00000000000 --- a/tests/tests/util/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -export { startMoonbeamNode, describeWithMoonbeam } from "./testWithMoonbeam"; -export { fillBlockWithTx } from "./fillBlockWithTx"; -export { - customRequest, - wrappedCustomRequest, - deployContractManualSeal, - callContractFunctionMS, -} from "./web3Requests"; -export { createAndFinalizeBlock } from "./polkadotApiRequests"; diff --git a/tests/tests/util/polkadotApiRequests.ts b/tests/tests/util/polkadotApiRequests.ts deleted file mode 100644 index e01fe746ecd..00000000000 --- a/tests/tests/util/polkadotApiRequests.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { ApiPromise } from "@polkadot/api"; - -// Create a block and finalize it. -// It will include all previously executed transactions since the last finalized block. -export async function createAndFinalizeBlock(api: ApiPromise): Promise { - const startTime: number = Date.now(); - try { - await api.rpc.engine.createBlock(true, true); - } catch (e) { - console.log("ERROR DURING BLOCK FINALIZATION", e); - } - return Date.now() - startTime; -} diff --git a/tests/tests/util/testWithFrontier.ts b/tests/tests/util/testWithFrontier.ts deleted file mode 100644 index 7762ab157da..00000000000 --- a/tests/tests/util/testWithFrontier.ts +++ /dev/null @@ -1,123 +0,0 @@ -import Web3 from "web3"; - -import { spawn, ChildProcess } from "child_process"; -import { DISPLAY_LOG, PORT, RPC_PORT, SPAWNING_TIME, WS_PORT } from "../constants"; -import { customRequest } from "./web3Requests"; - -const SPECS_PATH = `./moonbeam-test-specs`; - -const FRONTIER_LOG = process.env.FRONTIER_LOG || "info"; - -const BINARY_PATH = `../../frontier/target/debug/frontier-template-node`; - -// Build with `cargo build --no-default-features --features=manual-seal` -export async function startFrontierNode( - specFilename: string, - provider?: string -): Promise<{ web3: Web3; binary: ChildProcess }> { - var web3; - if (!provider || provider == "http") { - web3 = new Web3(`http://localhost:${RPC_PORT}`); - } - - const cmd = BINARY_PATH; - const args = [ - `--chain=${SPECS_PATH}/${specFilename}`, - `--validator`, // Required by manual sealing to author the blocks - `--execution=Native`, // Faster execution using native - `--no-telemetry`, - `--no-prometheus`, - `--sealing=Manual`, - `--no-grandpa`, - `--force-authoring`, - `-l${FRONTIER_LOG}`, - `--port=${PORT}`, - `--rpc-port=${RPC_PORT}`, - `--ws-port=${WS_PORT}`, - `--tmp`, - ]; - const binary = spawn(cmd, args); - - binary.on("error", (err) => { - if ((err as any).errno == "ENOENT") { - console.error(`\x1b[31mMissing Frontier binary (${BINARY_PATH})`); - } else { - console.error(err); - } - process.exit(1); - }); - - const binaryLogs = []; - await new Promise((resolve) => { - const timer = setTimeout(() => { - console.error(`\x1b[31m Failed to start Frontier Template Node.\x1b[0m`); - console.error(`Command: ${cmd} ${args.join(" ")}`); - console.error(`Logs:`); - console.error(binaryLogs.map((chunk) => chunk.toString()).join("\n")); - process.exit(1); - }, SPAWNING_TIME - 2000); - - const onData = async (chunk) => { - if (DISPLAY_LOG) { - console.log(chunk.toString()); - } - binaryLogs.push(chunk); - if (chunk.toString().match(/Manual Seal Ready/)) { - if (!provider || provider == "http") { - // This is needed as the EVM runtime needs to warmup with a first call - await web3.eth.getChainId(); - } - - clearTimeout(timer); - if (!DISPLAY_LOG) { - binary.stderr.off("data", onData); - binary.stdout.off("data", onData); - } - // console.log(`\x1b[31m Starting RPC\x1b[0m`); - resolve(); - } - }; - binary.stderr.on("data", onData); - binary.stdout.on("data", onData); - }); - - if (provider == "ws") { - web3 = new Web3(`ws://localhost:${WS_PORT}`); - } - - return { web3, binary }; -} -export function describeWithFrontier( - title: string, - specFilename: string, - cb: (context: { web3: Web3 }) => void, - provider?: string -) { - describe(title, () => { - let context: { web3: Web3 } = { web3: null }; - let binary: ChildProcess; - // Making sure the Frontier node has started - before("Starting Frontier Test Node", async function () { - this.timeout(SPAWNING_TIME); - const init = await startFrontierNode(specFilename, provider); - context.web3 = init.web3; - binary = init.binary; - }); - - after(async function () { - //console.log(`\x1b[31m Killing RPC\x1b[0m`); - binary ? binary.kill() : null; - }); - - cb(context); - }); -} - -// Create a block and finalize it. -// It will include all previously executed transactions since the last finalized block. -export async function createAndFinalizeBlockWithFrontier(web3: Web3) { - const response = await customRequest(web3, "engine_createBlock", [true, true, null]); - if (!response.result) { - throw new Error(`Unexpected result: ${JSON.stringify(response)}`); - } -} diff --git a/tests/tests/util/testWithMoonbeam.ts b/tests/tests/util/testWithMoonbeam.ts deleted file mode 100644 index ef039ba0294..00000000000 --- a/tests/tests/util/testWithMoonbeam.ts +++ /dev/null @@ -1,159 +0,0 @@ -import Web3 from "web3"; -import { ApiPromise, WsProvider } from "@polkadot/api"; -import { typesBundle } from "../../../moonbeam-types-bundle"; - -import { spawn, ChildProcess, ChildProcessWithoutNullStreams } from "child_process"; -import { - BINARY_PATH, - DISPLAY_LOG, - MOONBEAM_LOG, - PORT, - RPC_PORT, - SPAWNING_TIME, - WS_PORT, -} from "../constants"; -import { ErrorReport } from "./fillBlockWithTx"; - -export function log(...msg: (string | number | ErrorReport)[]) { - if (process.argv && process.argv[2] && process.argv[2] === "--printlogs") { - console.log(...msg); - } -} - -export interface Context { - web3: Web3; - - // WsProvider for the PolkadotJs API - wsProvider: WsProvider; - polkadotApi: ApiPromise; -} - -let runningNode: ChildProcessWithoutNullStreams; - -export async function startMoonbeamNode( - //TODO Make this parameter optional and just default to development. - // For now I'm just ignoring the param and hardcoding development below. - specFilename: string, - provider?: string -): Promise<{ context: Context; runningNode: ChildProcess }> { - let web3; - if (!provider || provider == "http") { - web3 = new Web3(`http://localhost:${RPC_PORT}`); - } - - const cmd = BINARY_PATH; - const args = [ - `--execution=Native`, // Faster execution using native - `--no-telemetry`, - `--no-prometheus`, - `--dev`, - `--ethapi=txpool,debug,trace`, - `--sealing=manual`, - `-l${MOONBEAM_LOG}`, - `--port=${PORT}`, - `--rpc-port=${RPC_PORT}`, - `--ws-port=${WS_PORT}`, - `--tmp`, - ]; - runningNode = spawn(cmd, args); - runningNode.on("error", (err) => { - if ((err as any).errno == "ENOENT") { - console.error( - `\x1b[31mMissing Moonbeam binary ` + - `(${BINARY_PATH}).\nPlease compile the Moonbeam project\x1b[0m` - ); - } else { - console.error(err); - } - process.exit(1); - }); - - const binaryLogs = []; - await new Promise((resolve) => { - const timer = setTimeout(() => { - console.error(`\x1b[31m Failed to start Moonbeam Test Node.\x1b[0m`); - console.error(`Command: ${cmd} ${args.join(" ")}`); - console.error(`Logs:`); - console.error(binaryLogs.map((chunk) => chunk.toString()).join("\n")); - process.exit(1); - }, SPAWNING_TIME - 2000); - - const onData = async (chunk) => { - if (DISPLAY_LOG) { - console.log(chunk.toString()); - } - binaryLogs.push(chunk); - if (chunk.toString().match(/Development Service Ready/)) { - if (!provider || provider == "http") { - // This is needed as the EVM runtime needs to warmup with a first call - await web3.eth.getChainId(); - } - - clearTimeout(timer); - if (!DISPLAY_LOG) { - runningNode.stderr.off("data", onData); - runningNode.stdout.off("data", onData); - } - // console.log(`\x1b[31m Starting RPC\x1b[0m`); - resolve(); - } - }; - runningNode.stderr.on("data", onData); - runningNode.stdout.on("data", onData); - }); - - const wsProvider = new WsProvider(`ws://localhost:${WS_PORT}`); - const polkadotApi = await ApiPromise.create({ - provider: wsProvider, - typesBundle: typesBundle as any, - }); - - if (provider == "ws") { - web3 = new Web3(`ws://localhost:${WS_PORT}`); - } - - return { context: { web3, polkadotApi, wsProvider }, runningNode }; -} - -// Kill all processes when exiting. -process.on("exit", function () { - runningNode ? runningNode.kill() : null; -}); - -// Handle ctrl+c to trigger `exit`. -process.on("SIGINT", function () { - process.exit(2); -}); - -export function describeWithMoonbeam( - title: string, - specFilename: string, - cb: (context: Context) => void, - provider?: string -) { - describe(title, () => { - let context: Context = { web3: null, wsProvider: null, polkadotApi: null }; - let binary: ChildProcess; - - // Making sure the Moonbeam node has started - before("Starting Moonbeam Test Node", async function () { - this.timeout(SPAWNING_TIME); - const init = await startMoonbeamNode(specFilename, provider); - // Context is given prior to this assignement, so doing - // context = init.context will fail because it replace the variable; - context.web3 = init.context.web3; - context.wsProvider = init.context.wsProvider; - context.polkadotApi = init.context.polkadotApi; - binary = init.runningNode; - }); - - after(async function () { - // console.log(`\x1b[31m Killing RPC\x1b[0m`); - context.wsProvider.disconnect(); - binary.kill(); - binary = null; - }); - - cb(context); - }); -} diff --git a/tests/tests/util/web3Requests.ts b/tests/tests/util/web3Requests.ts deleted file mode 100644 index 9a7754d8668..00000000000 --- a/tests/tests/util/web3Requests.ts +++ /dev/null @@ -1,109 +0,0 @@ -import Web3 from "web3"; -import { JsonRpcResponse } from "web3-core-helpers"; -import { TransactionReceipt } from "web3-core"; -import { AbiItem } from "web3-utils"; -import { Contract } from "web3-eth-contract"; -import { GENESIS_ACCOUNT, GENESIS_ACCOUNT_PRIVATE_KEY } from "../constants"; -import { createAndFinalizeBlock } from "./polkadotApiRequests"; -import { ApiPromise } from "@polkadot/api"; -import { Context } from "./testWithMoonbeam"; - -// make a web3 request, adapted to manual seal testing -export async function customRequest(web3: Web3, method: string, params: any[]) { - return new Promise((resolve, reject) => { - (web3.currentProvider as any).send( - { - jsonrpc: "2.0", - id: 1, - method, - params, - }, - (error: Error | null, result?: JsonRpcResponse) => { - if (error) { - reject( - `Failed to send custom request (${method} (${params.join(",")})): ${ - error.message || error.toString() - }` - ); - } - resolve(result); - } - ); - }); -} - -// wrap the above function to catch errors and return them into a JsonRpc format -export async function wrappedCustomRequest( - web3: Web3, - method: string, - params: any[] -): Promise { - try { - let resp = await customRequest(web3, method, params); - return resp; - } catch (e) { - return { - jsonrpc: "req error", - id: 0, - error: typeof e === "string" ? e.toString() : JSON.stringify(e), - }; - } -} - -// Deploy and instantiate a contract with manuel seal -export async function deployContractManualSeal( - api: ApiPromise, - web3: Web3, - contractByteCode: string, - contractABI: AbiItem[], - account: string = GENESIS_ACCOUNT, - privateKey: string = GENESIS_ACCOUNT_PRIVATE_KEY -): Promise { - const tx = await web3.eth.accounts.signTransaction( - { - from: account, - data: contractByteCode, - value: "0x00", - gasPrice: "0x01", - gas: "0x100000", - }, - privateKey - ); - await customRequest(web3, "eth_sendRawTransaction", [tx.rawTransaction]); - await createAndFinalizeBlock(api); - let rcpt: TransactionReceipt = await web3.eth.getTransactionReceipt(tx.transactionHash); - return new web3.eth.Contract(contractABI, rcpt.contractAddress); -} - -interface FnCallOptions { - account?: string; - privateKey?: string; - gas?: string; -} - -// Call a function from a contract instance using manual seal -export async function callContractFunctionMS( - context: Context, - contractAddress: string, - bytesCode: string, - options?: FnCallOptions -) { - try { - const contractCall = { - from: options && options.account ? options.account : GENESIS_ACCOUNT, - to: contractAddress, - data: bytesCode, - gasPrice: "0x01", - gas: options && options.gas ? options.gas : "0x100000", - }; - const txCall = await context.web3.eth.accounts.signTransaction( - contractCall, - options && options.privateKey ? options.privateKey : GENESIS_ACCOUNT_PRIVATE_KEY - ); - await customRequest(context.web3, "eth_sendRawTransaction", [txCall.rawTransaction]); - return await createAndFinalizeBlock(context.polkadotApi); - } catch (e) { - console.log("error caught during callContractFunctionMS", e); - throw new Error(e); - } -} diff --git a/tests/util/block.ts b/tests/util/block.ts new file mode 100644 index 00000000000..17dff487bf3 --- /dev/null +++ b/tests/util/block.ts @@ -0,0 +1,28 @@ +import { ApiPromise } from "@polkadot/api"; +import { BlockHash } from "@polkadot/types/interfaces/chain"; + +export async function createAndFinalizeBlock( + api: ApiPromise, + parentHash?: BlockHash, + finalize: boolean = true +): Promise<{ + duration: number; + hash: BlockHash; +}> { + const startTime: number = Date.now(); + let hash = undefined; + try { + if (parentHash == undefined) { + hash = (await api.rpc.engine.createBlock(true, finalize)).toJSON()["hash"]; + } else { + hash = (await api.rpc.engine.createBlock(true, finalize, parentHash)).toJSON()["hash"]; + } + } catch (e) { + console.log("ERROR DURING BLOCK FINALIZATION", e); + } + + return { + duration: Date.now() - startTime, + hash, + }; +} diff --git a/tests/util/constants.ts b/tests/util/constants.ts new file mode 100644 index 00000000000..d5729d78806 --- /dev/null +++ b/tests/util/constants.ts @@ -0,0 +1,35 @@ +export const SPECS_PATH = `./moonbeam-test-specs`; + +export const DEBUG_MODE = process.env.DEBUG_MODE || false; +export const DISPLAY_LOG = process.env.MOONBEAM_LOG || false; +export const MOONBEAM_LOG = process.env.MOONBEAM_LOG || "info"; + +export const BINARY_PATH = process.env.BINARY_PATH || `../target/release/moonbeam`; +export const SPAWNING_TIME = 30000; + +// Test variables +export const GENESIS_ACCOUNT = "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b"; +export const GENESIS_ACCOUNT_PRIVATE_KEY = + "0x99B3C12287537E38C90A9219D4CB074A89A16E9CDB20BF85728EBD97C343E342"; +export const TEST_ACCOUNT = "0x1111111111111111111111111111111111111111"; +export const GLMR = 1_000_000_000_000_000_000n; +export const DEFAULT_GENESIS_BALANCE = 2n ** 80n; +export const DEFAULT_GENESIS_STAKING = 1_000n * GLMR; +export const GENESIS_ACCOUNT_BALANCE = DEFAULT_GENESIS_BALANCE - DEFAULT_GENESIS_STAKING; + +// Current gas per second +export const GAS_PER_SECOND = 40_000_000; +// The real computation is 1_000_000_000_000 / 40_000_000, but we simplify to avoid bigint. +export const GAS_PER_WEIGHT = 1_000_000 / 40; + +// Our weight limit is 500ms. +export const BLOCK_TX_LIMIT = GAS_PER_SECOND * 0.5; + +// Current implementation is limiting block transactions to 75% of the block gas limit +export const BLOCK_TX_GAS_LIMIT = BLOCK_TX_LIMIT * 0.75; +// 125_000_000 Weight per extrinsics +export const EXTRINSIC_BASE_COST = 125_000_000 / GAS_PER_WEIGHT; + +// Maximum extrinsic weight is taken from the max allowed transaction weight per block, +// minus the block initialization (10%) and minus the extrinsic base cost. +export const EXTRINSIC_GAS_LIMIT = BLOCK_TX_GAS_LIMIT - BLOCK_TX_LIMIT * 0.1 - EXTRINSIC_BASE_COST; diff --git a/tests/util/contracts.ts b/tests/util/contracts.ts new file mode 100644 index 00000000000..2d41df16edf --- /dev/null +++ b/tests/util/contracts.ts @@ -0,0 +1,74 @@ +import { customWeb3Request } from "./providers"; +import { TransactionReceipt } from "web3-core"; +import { AbiItem } from "web3-utils"; +import { Contract } from "web3-eth-contract"; +import Web3 from "web3"; + +import { GENESIS_ACCOUNT, GENESIS_ACCOUNT_PRIVATE_KEY } from "./constants"; +import { contractSources } from "../contracts/sources"; + +export interface Compiled { + byteCode: string; + contract: any; + sourceCode: string; +} + +const contracts: { [name: string]: Compiled } = {}; +const contractObs: { [name: string]: ((Compiled) => void)[] } = {}; +export async function getCompiled(name: string): Promise { + if (!contractSources[name]) { + throw new Error(`Contract name (${name}) doesn't exist in test suite`); + } + if (contracts[name]) { + return contracts[name]; + } + const promise = new Promise((resolve) => { + const shouldLoad = !contractObs[name]; + if (!contractObs[name]) { + contractObs[name] = []; + } + contractObs[name].push(resolve); + if (shouldLoad) { + // Will load the contract async and callback all the promise waiting for this contract. + setImmediate(() => { + try { + contracts[name] = require(`../contracts/compiled/${name}.json`); + } catch (e) { + throw new Error( + `Contract name ${name} is not compiled. (should be done in mochaGlobalSetup)` + ); + } + + // Call back all the pending promises and clear the list. + contractObs[name].forEach((resolvePending) => { + resolvePending(contracts[name]); + }); + delete contractObs[name]; + }); + } + }); + return promise; +} + +// Deploy and instantiate a contract with manuel seal +export async function deployContractManualSeal( + web3: Web3, + contractByteCode: string, + contractABI: AbiItem[], + account: string = GENESIS_ACCOUNT, + privateKey: string = GENESIS_ACCOUNT_PRIVATE_KEY +): Promise { + const tx = await web3.eth.accounts.signTransaction( + { + from: account, + data: contractByteCode, + value: "0x00", + gasPrice: "0x01", + gas: "0x100000", + }, + privateKey + ); + await customWeb3Request(web3, "eth_sendRawTransaction", [tx.rawTransaction]); + let rcpt: TransactionReceipt = await web3.eth.getTransactionReceipt(tx.transactionHash); + return new web3.eth.Contract(contractABI, rcpt.contractAddress); +} diff --git a/tests/util/dev-node.ts b/tests/util/dev-node.ts new file mode 100644 index 00000000000..c31658f7070 --- /dev/null +++ b/tests/util/dev-node.ts @@ -0,0 +1,129 @@ +import tcpPortUsed from "tcp-port-used"; +import { spawn, ChildProcess } from "child_process"; +import { BINARY_PATH, DISPLAY_LOG, MOONBEAM_LOG, SPAWNING_TIME } from "./constants"; + +export async function findAvailablePorts() { + const availablePorts = await Promise.all( + [null, null, null].map(async (_, index) => { + let selectedPort = 0; + let port = 1024 + index * 20000 + (process.pid % 20000); + let endingPort = 65535; + while (!selectedPort && port < endingPort) { + const inUse = await tcpPortUsed.check(port, "127.0.0.1"); + if (!inUse) { + selectedPort = port; + } + port++; + } + if (!selectedPort) { + throw new Error(`No available port`); + } + return selectedPort; + }) + ); + + return { + p2pPort: availablePorts[0], + rpcPort: availablePorts[1], + wsPort: availablePorts[2], + }; +} + +// Stores if the node has already started. +// It is used when a test file contains multiple describeDevMoonbeam. Those are +// executed within the same PID and so would generate a race condition if started +// at the same time. +let nodeStarted = false; + +// This will start a moonbeam dev node, only 1 at a time (check every 100ms). +// This will prevent race condition on the findAvailablePorts which uses the PID of the process +export async function startMoonbeamDevNode(): Promise<{ + p2pPort: number; + rpcPort: number; + wsPort: number; + runningNode: ChildProcess; +}> { + while (nodeStarted) { + // Wait 100ms to see if the node is free + await new Promise((resolve) => { + setTimeout(resolve, 100); + }); + } + nodeStarted = true; + const { p2pPort, rpcPort, wsPort } = await findAvailablePorts(); + + const cmd = BINARY_PATH; + const args = [ + `--execution=Native`, // Faster execution using native + `--no-telemetry`, + `--no-prometheus`, + `--dev`, + `--ethapi=txpool,debug,trace`, + `--sealing=manual`, + `-l${MOONBEAM_LOG}`, + `--port=${p2pPort}`, + `--rpc-port=${rpcPort}`, + `--ws-port=${wsPort}`, + `--tmp`, + ]; + + const onProcessExit = function () { + runningNode && runningNode.kill(); + }; + const onProcessInterrupt = function () { + process.exit(2); + }; + + let runningNode: ChildProcess = null; + process.once("exit", onProcessExit); + process.once("SIGINT", onProcessInterrupt); + runningNode = spawn(cmd, args); + + runningNode.once("exit", () => { + process.removeListener("exit", onProcessExit); + process.removeListener("SIGINT", onProcessInterrupt); + nodeStarted = false; + }); + + runningNode.on("error", (err) => { + if ((err as any).errno == "ENOENT") { + console.error( + `\x1b[31mMissing Moonbeam binary ` + + `(${BINARY_PATH}).\nPlease compile the Moonbeam project\x1b[0m` + ); + } else { + console.error(err); + } + process.exit(1); + }); + + const binaryLogs = []; + await new Promise((resolve) => { + const timer = setTimeout(() => { + console.error(`\x1b[31m Failed to start Moonbeam Test Node.\x1b[0m`); + console.error(`Command: ${cmd} ${args.join(" ")}`); + console.error(`Logs:`); + console.error(binaryLogs.map((chunk) => chunk.toString()).join("\n")); + process.exit(1); + }, SPAWNING_TIME - 2000); + + const onData = async (chunk) => { + if (DISPLAY_LOG) { + console.log(chunk.toString()); + } + binaryLogs.push(chunk); + if (chunk.toString().match(/Development Service Ready/)) { + clearTimeout(timer); + if (!DISPLAY_LOG) { + runningNode.stderr.off("data", onData); + runningNode.stdout.off("data", onData); + } + resolve(); + } + }; + runningNode.stderr.on("data", onData); + runningNode.stdout.on("data", onData); + }); + + return { p2pPort, rpcPort, wsPort, runningNode }; +} diff --git a/tests/util/logging.ts b/tests/util/logging.ts new file mode 100644 index 00000000000..20f532ee73d --- /dev/null +++ b/tests/util/logging.ts @@ -0,0 +1,5 @@ +export function log(...msg: any[]) { + if (process.argv && process.argv[2] && process.argv[2] === "--printlogs") { + console.log(...msg); + } +} diff --git a/tests/util/providers.ts b/tests/util/providers.ts new file mode 100644 index 00000000000..bad7999f182 --- /dev/null +++ b/tests/util/providers.ts @@ -0,0 +1,81 @@ +import Web3 from "web3"; +import { ApiPromise, WsProvider } from "@polkadot/api"; +import { typesBundle } from "../../moonbeam-types-bundle"; +import { JsonRpcResponse } from "web3-core-helpers"; +import { ethers } from "ethers"; +import { GENESIS_ACCOUNT_PRIVATE_KEY } from "./constants"; +import { Subscription as Web3Subscription } from "web3-core-subscriptions"; +import { BlockHeader } from "web3-eth"; +import { Log } from "web3-core"; + +export async function customWeb3Request(web3: Web3, method: string, params: any[]) { + return new Promise((resolve, reject) => { + (web3.currentProvider as any).send( + { + jsonrpc: "2.0", + id: 1, + method, + params, + }, + (error: Error | null, result?: JsonRpcResponse) => { + if (error) { + reject( + `Failed to send custom request (${method} (${params.join(",")})): ${ + error.message || error.toString() + }` + ); + } + resolve(result); + } + ); + }); +} + +// Extra type because web3 is not well typed +export interface Subscription extends Web3Subscription { + once: (type: "data" | "connected", handler: (data: T) => void) => Subscription; +} + +// Little helper to hack web3 that are not complete. +export function web3Subscribe(web3: Web3, type: "newBlockHeaders"): Subscription; +export function web3Subscribe(web3: Web3, type: "pendingTransactions"): Subscription; +export function web3Subscribe(web3: Web3, type: "logs", params: {}): Subscription; +export function web3Subscribe( + web3: Web3, + type: "newBlockHeaders" | "pendingTransactions" | "logs", + params?: any +) { + return (web3.eth as any).subscribe(...[].slice.call(arguments, 1)); +} + +export type EnhancedWeb3 = Web3 & { + customRequest: (method: string, params: any[]) => Promise; +}; + +export const provideWeb3Api = async (port: number, protocol: "ws" | "http" = "http") => { + const web3 = + protocol == "ws" + ? new Web3(`ws://localhost:${port}`) // TODO: restore support for + : new Web3(`http://localhost:${port}`); + + // Adding genesis account for convenience + web3.eth.accounts.wallet.add(GENESIS_ACCOUNT_PRIVATE_KEY); + + // Hack to add customRequest method. + (web3 as any).customRequest = (method: string, params: any[]) => + customWeb3Request(web3, method, params); + + return web3 as EnhancedWeb3; +}; + +export const providePolkadotApi = async (port: number) => { + return await ApiPromise.create({ + initWasm: false, + provider: new WsProvider(`ws://localhost:${port}`), + typesBundle: typesBundle as any, + }); +}; + +export const provideEthersApi = async (port: number) => { + return new ethers.providers.JsonRpcProvider(`http://localhost:${port}`); +}; diff --git a/tests/util/setup-dev-tests.ts b/tests/util/setup-dev-tests.ts new file mode 100644 index 00000000000..2af2e8d5445 --- /dev/null +++ b/tests/util/setup-dev-tests.ts @@ -0,0 +1,138 @@ +import { ApiPromise, WsProvider } from "@polkadot/api"; +import { JsonRpcResponse } from "web3-core-helpers"; +import { BlockHash } from "@polkadot/types/interfaces/chain"; +import { ethers } from "ethers"; +import { startMoonbeamDevNode } from "./dev-node"; +import { + provideWeb3Api, + provideEthersApi, + providePolkadotApi, + EnhancedWeb3, + customWeb3Request, +} from "./providers"; +import { ChildProcess } from "child_process"; +import { createAndFinalizeBlock } from "./block"; +import { SPAWNING_TIME, DEBUG_MODE } from "./constants"; +import { HttpProvider } from "web3-core"; + +export interface BlockCreation { + parentHash?: BlockHash; + finalize?: boolean; + transactions?: string[]; +} + +export interface DevTestContext { + createWeb3: (protocol?: "ws" | "http") => Promise; + createEthers: () => Promise; + createPolkadotApi: () => Promise; + + createBlock: ( + options?: BlockCreation + ) => Promise<{ + txResults: JsonRpcResponse[]; + block: { + duration: number; + hash: BlockHash; + }; + }>; + + // We also provided singleton providers for simplicity + web3: EnhancedWeb3; + ethers: ethers.providers.JsonRpcProvider; + polkadotApi: ApiPromise; +} + +interface InternalDevTestContext extends DevTestContext { + _polkadotApis: ApiPromise[]; + _web3Providers: HttpProvider[]; +} + +export function describeDevMoonbeam(title: string, cb: (context: DevTestContext) => void) { + describe(title, function () { + // Set timeout to 5000 for all tests. + this.timeout(5000); + + // The context is initialized empty to allow passing a reference + // and to be filled once the node information is retrieved + let context: InternalDevTestContext = {} as InternalDevTestContext; + + // The currently running node for this describe + let moonbeamProcess: ChildProcess; + + // Making sure the Moonbeam node has started + before("Starting Moonbeam Test Node", async function () { + this.timeout(SPAWNING_TIME); + const init = !DEBUG_MODE + ? await startMoonbeamDevNode() + : { + runningNode: null, + p2pPort: 19931, + wsPort: 19933, + rpcPort: 19932, + }; + moonbeamProcess = init.runningNode; + + // Context is given prior to this assignement, so doing + // context = init.context will fail because it replace the variable; + + context._polkadotApis = []; + context._web3Providers = []; + moonbeamProcess = init.runningNode; + + context.createWeb3 = async (protocol: "ws" | "http" = "http") => { + const provider = + protocol == "ws" + ? await provideWeb3Api(init.wsPort, "ws") + : await provideWeb3Api(init.rpcPort, "http"); + context._web3Providers.push((provider as any)._provider); + return provider; + }; + context.createEthers = async () => provideEthersApi(init.rpcPort); + context.createPolkadotApi = async () => { + const apiPromise = await providePolkadotApi(init.wsPort); + // We keep track of the polkadotApis to close them at the end of the test + context._polkadotApis.push(apiPromise); + await apiPromise.isReady; + // Necessary hack to allow polkadotApi to finish its internal metadata loading + // apiPromise.isReady unfortunately doesn't wait for those properly + await new Promise((resolve) => { + setTimeout(resolve, 100); + }); + + return apiPromise; + }; + + context.polkadotApi = await context.createPolkadotApi(); + context.web3 = await context.createWeb3(); + context.ethers = await context.createEthers(); + + context.createBlock = async (options: BlockCreation = {}) => { + let { parentHash, finalize, transactions = [] } = options; + + let txResults = await Promise.all( + transactions.map((t) => customWeb3Request(context.web3, "eth_sendRawTransaction", [t])) + ); + const block = await createAndFinalizeBlock(context.polkadotApi, parentHash, finalize); + return { + txResults, + block, + }; + }; + }); + + after(async function () { + await Promise.all(context._web3Providers.map((p) => p.disconnect())); + await Promise.all(context._polkadotApis.map((p) => p.disconnect())); + + if (moonbeamProcess) { + await new Promise((resolve) => { + moonbeamProcess.once("exit", resolve); + moonbeamProcess.kill(); + moonbeamProcess = null; + }); + } + }); + + cb(context); + }); +} diff --git a/tests/tests/constants/blockscout_tracer.min.json b/tests/util/tracer/blockscout_tracer.min.json similarity index 100% rename from tests/tests/constants/blockscout_tracer.min.json rename to tests/util/tracer/blockscout_tracer.min.json diff --git a/tests/util/transactions.ts b/tests/util/transactions.ts new file mode 100644 index 00000000000..7e87bc1e96f --- /dev/null +++ b/tests/util/transactions.ts @@ -0,0 +1,122 @@ +import { GENESIS_ACCOUNT, GENESIS_ACCOUNT_PRIVATE_KEY } from "./constants"; +import Web3 from "web3"; +import * as RLP from "rlp"; +import { getCompiled } from "./contracts"; +import { Contract } from "web3-eth-contract"; +const debug = require("debug")("test:transaction"); + +export interface TransactionOptions { + from?: string; + to?: string; + privateKey?: string; + nonce?: number; + gas?: string | number; + gasPrice?: string | number; + value?: string | number | BigInt; + data?: string; +} + +const GENESIS_TRANSACTION: TransactionOptions = { + from: GENESIS_ACCOUNT, + privateKey: GENESIS_ACCOUNT_PRIVATE_KEY, + nonce: null, + gas: 12_000_000, + gasPrice: 1, + value: "0x00", +}; + +export const createTransaction = async ( + web3: Web3, + options: TransactionOptions +): Promise => { + const gas = options.gas || 12_000_000; + const gasPrice = options.gasPrice !== undefined ? options.gasPrice : 1; + const value = options.value !== undefined ? options.value : "0x00"; + const from = options.from || GENESIS_ACCOUNT; + const privateKey = + options.privateKey !== undefined ? options.privateKey : GENESIS_ACCOUNT_PRIVATE_KEY; + + const data = { + from, + to: options.to, + value: value && value.toString(), + gasPrice, + gas, + nonce: options.nonce, + data: options.data, + }; + debug("Sending transaction", { + ...data, + data: !data.data + ? "" + : data.data.length < 80 + ? data.data + : data.data.substr(0, 7) + "..." + data.data.substr(data.data.length - 5), + }); + const tx = await web3.eth.accounts.signTransaction(data, privateKey); + return tx.rawTransaction; +}; + +export const createTransfer = async ( + web3: Web3, + to: string, + value: number | string | BigInt, + options: TransactionOptions = GENESIS_TRANSACTION +): Promise => { + return await createTransaction(web3, { ...options, value, to }); +}; + +// Will create the transaction to deploy a contract. +// This requires to compute the nonce. It can't be used multiple times in the same block from the +// same from +export async function createContract( + web3: Web3, + contractName: string, + options: TransactionOptions = GENESIS_TRANSACTION, + contractArguments: any[] = [] +): Promise<{ rawTx: string; contract: Contract }> { + const contractCompiled = await getCompiled(contractName); + const from = options.from !== undefined ? options.from : GENESIS_ACCOUNT; + const nonce = options.nonce || (await web3.eth.getTransactionCount(from)); + const contractAddress = + "0x" + + web3.utils + .sha3(RLP.encode([from, nonce]) as any) + .slice(12) + .substring(14); + + const contract = new web3.eth.Contract(contractCompiled.contract.abi, contractAddress); + const data = contract + .deploy({ + data: contractCompiled.byteCode, + arguments: contractArguments, + }) + .encodeABI(); + + const rawTx = await createTransaction(web3, { ...options, from, nonce, data }); + + return { + rawTx, + contract, + }; +} + +// Will create the transaction to execute a contract function. +// This requires to compute the nonce. It can't be used multiple times in the same block from the +// same from +export async function createContractExecution( + web3: Web3, + execution: { + contract: Contract; + contractCall: any; + }, + options: TransactionOptions = GENESIS_TRANSACTION +) { + const tx = await createTransaction(web3, { + ...options, + to: execution.contract.options.address, + data: execution.contractCall.encodeABI(), + }); + + return tx; +}