Skip to content

Instantly share code, notes, and snippets.

@yangfei4913438
Created April 18, 2023 09:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yangfei4913438/f18f2da957b517700364aa20f5332305 to your computer and use it in GitHub Desktop.
Save yangfei4913438/f18f2da957b517700364aa20f5332305 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.18+commit.87f61d96.js&optimize=false&runs=200&gist=
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = https://github.com/yangfei4913438/web3-study.git
[http]
corsProxy = https://corsproxy.remixproject.org/
[branch "main"]
merge = refs/heads/main
remote = origin
ref: refs/heads/main
DIRCd>Z ���d>Z ���$��2*j�.�f����a�Rvrp�LICENSEd>Z ���d>Z ���%��w���9d�d�t�-k���"� README.md����4x��=� �]v
�tOc������r��@Y���n(�8w���9d�d�t�-k���"�*j�.�f����a�Rvrp�{�O�/gE��ZF�J�3�����D�Z�UP�i�����k ��.���&:M�x7ۘ0�>�k_�����z-]�� \x�
PACK�(x�u��n�@��<�[Y���gWJ�,^�b�lb� 06�5l�.饗>Y��E����mF��|ӵi
� �HA(��b)�(I����P�QNges�E}W4-X�%�:�~������gp?��,-��8���t�K��W �P���(�����Xv]�Zvz���iSV��y�}��Z��s��/�j԰�C�6��7��}����&*��cWu�Nu��j*�^��yk\0�������j��vg۲��D���>/�&�p�?���#�|�2��A��4�SlIl޶�,��0��i�ӹx��ݲ�X����������z�+����P��'n��ܬI}� ��T �V8x16�&�N/���:B�.�Iu��2���G��U���E�DZ6/�W�^A�8>�6�����8�a�0]�; u�†�1��)���|���w���]ܖ���^�$�uq��(.��ޯ��&�+��Ņ�ӓ�{�M�j�$9�,Y��K2IO��g������l4���g�eWF�{�ߛ��7�x�340031Q��tv� ve�����/���g��6&��TVTp��$�����U/7�AL�����)sRV����~y��1���Cx�]RKn�0����@H�v�-�1QI4(:���D[,d��9L��'+�[tFv�����y�q! 䮱C�����4�}ᶹ��?|��u���=�������w�-�xp!8?� ���n�`?�C�m��Z�;h�z����zx��.�m������N�a���s=Zn��7�F<h}s:�!֑�v��ncgᦺn��M$��{���s �.v�a�!��!������4<�{wpWZ�" AO���u;������]�hAoO���S� �x�G��"8�=y}U7͐�#���;x���;�R�i������6�*4��}��d��C��Q�Ę�V������r��G�z�@8�^��
]����������3}�xxW�p������{�_��ܬ� +Xj�(3�� ��}��Z��Z� �K�5^n�,�ė�UJ3Y,s)�&�4_e�|��
�Ʋ�A�"�BIQX!t��'��\�M��Ҕ�9W8,�62]�\�r���H�!l)˹FQ���#+�@<���s�b|��5�T-7Z>, ,T� ,�*�\\��T�sY$��?�iK!�f4vQ녠�q��F��l��4� ���eu-+�ײ�@�Z �8qCM �W�
E o.�#�^U�2�sĪh�,>߳���Wl�x�SV(OM2�-.)M��1��]�d�.k�
 ��.���&:M�x7ۘ0�>�k
7b0f7fb34fbe2f6745a9ca5a46f1b04a8033a78c
7b0f7fb34fbe2f6745a9ca5a46f1b04a8033a78c

web3-study

web3学习

MIT License
Copyright (c) 2023 Fei Yang (杨飞)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
{
"id": "a515f61bc26a8c699bebc10a3543bdfc",
"_format": "hh-sol-build-info-1",
"solcVersion": "0.8.18",
"solcLongVersion": "0.8.18+commit.87f61d96",
"input": {
"language": "Solidity",
"sources": {
"week1-1/Counter.sol": {
"content": "pragma solidity ^0.8.0;\n\ncontract Counter {\n uint public counter;\n constructor() {\n counter = 0;\n }\n function add() public {\n counter = counter + 1;\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"": [
"ast"
],
"*": [
"abi",
"metadata",
"devdoc",
"userdoc",
"storageLayout",
"evm.legacyAssembly",
"evm.bytecode",
"evm.deployedBytecode",
"evm.methodIdentifiers",
"evm.gasEstimates",
"evm.assembly"
]
}
}
}
},
"output": {
"contracts": {
"week1-1/Counter.sol": {
"Counter": {
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "add",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "counter",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"evm": {
"assembly": " /* \"week1-1/Counter.sol\":25:164 contract Counter {... */\n mstore(0x40, 0x80)\n /* \"week1-1/Counter.sol\":69:105 constructor() {... */\n callvalue\n dup1\n iszero\n tag_1\n jumpi\n 0x00\n dup1\n revert\ntag_1:\n pop\n /* \"week1-1/Counter.sol\":99:100 0 */\n 0x00\n /* \"week1-1/Counter.sol\":89:96 counter */\n dup1\n /* \"week1-1/Counter.sol\":89:100 counter = 0 */\n dup2\n swap1\n sstore\n pop\n /* \"week1-1/Counter.sol\":25:164 contract Counter {... */\n dataSize(sub_0)\n dup1\n dataOffset(sub_0)\n 0x00\n codecopy\n 0x00\n return\nstop\n\nsub_0: assembly {\n /* \"week1-1/Counter.sol\":25:164 contract Counter {... */\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 0x4f2be91f\n eq\n tag_3\n jumpi\n dup1\n 0x61bc221a\n eq\n tag_4\n jumpi\n tag_2:\n 0x00\n dup1\n revert\n /* \"week1-1/Counter.sol\":108:162 function add() public {... */\n tag_3:\n tag_5\n tag_6\n jump\t// in\n tag_5:\n stop\n /* \"week1-1/Counter.sol\":46:65 uint public counter */\n tag_4:\n tag_7\n tag_8\n jump\t// in\n tag_7:\n mload(0x40)\n tag_9\n swap2\n swap1\n tag_10\n jump\t// in\n tag_9:\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n return\n /* \"week1-1/Counter.sol\":108:162 function add() public {... */\n tag_6:\n /* \"week1-1/Counter.sol\":156:157 1 */\n 0x01\n /* \"week1-1/Counter.sol\":146:153 counter */\n sload(0x00)\n /* \"week1-1/Counter.sol\":146:157 counter + 1 */\n tag_12\n swap2\n swap1\n tag_13\n jump\t// in\n tag_12:\n /* \"week1-1/Counter.sol\":136:143 counter */\n 0x00\n /* \"week1-1/Counter.sol\":136:157 counter = counter + 1 */\n dup2\n swap1\n sstore\n pop\n /* \"week1-1/Counter.sol\":108:162 function add() public {... */\n jump\t// out\n /* \"week1-1/Counter.sol\":46:65 uint public counter */\n tag_8:\n sload(0x00)\n dup2\n jump\t// out\n /* \"#utility.yul\":7:84 */\n tag_14:\n /* \"#utility.yul\":44:51 */\n 0x00\n /* \"#utility.yul\":73:78 */\n dup2\n /* \"#utility.yul\":62:78 */\n swap1\n pop\n /* \"#utility.yul\":7:84 */\n swap2\n swap1\n pop\n jump\t// out\n /* \"#utility.yul\":90:208 */\n tag_15:\n /* \"#utility.yul\":177:201 */\n tag_20\n /* \"#utility.yul\":195:200 */\n dup2\n /* \"#utility.yul\":177:201 */\n tag_14\n jump\t// in\n tag_20:\n /* \"#utility.yul\":172:175 */\n dup3\n /* \"#utility.yul\":165:202 */\n mstore\n /* \"#utility.yul\":90:208 */\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":214:436 */\n tag_10:\n /* \"#utility.yul\":307:311 */\n 0x00\n /* \"#utility.yul\":345:347 */\n 0x20\n /* \"#utility.yul\":334:343 */\n dup3\n /* \"#utility.yul\":330:348 */\n add\n /* \"#utility.yul\":322:348 */\n swap1\n pop\n /* \"#utility.yul\":358:429 */\n tag_22\n /* \"#utility.yul\":426:427 */\n 0x00\n /* \"#utility.yul\":415:424 */\n dup4\n /* \"#utility.yul\":411:428 */\n add\n /* \"#utility.yul\":402:408 */\n dup5\n /* \"#utility.yul\":358:429 */\n tag_15\n jump\t// in\n tag_22:\n /* \"#utility.yul\":214:436 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"#utility.yul\":442:622 */\n tag_16:\n /* \"#utility.yul\":490:567 */\n 0x4e487b7100000000000000000000000000000000000000000000000000000000\n /* \"#utility.yul\":487:488 */\n 0x00\n /* \"#utility.yul\":480:568 */\n mstore\n /* \"#utility.yul\":587:591 */\n 0x11\n /* \"#utility.yul\":584:585 */\n 0x04\n /* \"#utility.yul\":577:592 */\n mstore\n /* \"#utility.yul\":611:615 */\n 0x24\n /* \"#utility.yul\":608:609 */\n 0x00\n /* \"#utility.yul\":601:616 */\n revert\n /* \"#utility.yul\":628:819 */\n tag_13:\n /* \"#utility.yul\":668:671 */\n 0x00\n /* \"#utility.yul\":687:707 */\n tag_25\n /* \"#utility.yul\":705:706 */\n dup3\n /* \"#utility.yul\":687:707 */\n tag_14\n jump\t// in\n tag_25:\n /* \"#utility.yul\":682:707 */\n swap2\n pop\n /* \"#utility.yul\":721:741 */\n tag_26\n /* \"#utility.yul\":739:740 */\n dup4\n /* \"#utility.yul\":721:741 */\n tag_14\n jump\t// in\n tag_26:\n /* \"#utility.yul\":716:741 */\n swap3\n pop\n /* \"#utility.yul\":764:765 */\n dup3\n /* \"#utility.yul\":761:762 */\n dup3\n /* \"#utility.yul\":757:766 */\n add\n /* \"#utility.yul\":750:766 */\n swap1\n pop\n /* \"#utility.yul\":785:788 */\n dup1\n /* \"#utility.yul\":782:783 */\n dup3\n /* \"#utility.yul\":779:789 */\n gt\n /* \"#utility.yul\":776:812 */\n iszero\n tag_27\n jumpi\n /* \"#utility.yul\":792:810 */\n tag_28\n tag_16\n jump\t// in\n tag_28:\n /* \"#utility.yul\":776:812 */\n tag_27:\n /* \"#utility.yul\":628:819 */\n swap3\n swap2\n pop\n pop\n jump\t// out\n\n auxdata: 0xa264697066735822122014d0563855745310f016f63c1a57d548c86abd75978d14d540142c2245e6b1b564736f6c63430008120033\n}\n",
"bytecode": {
"functionDebugData": {
"@_11": {
"entryPoint": null,
"id": 11,
"parameterSlots": 0,
"returnSlots": 0
}
},
"generatedSources": [],
"linkReferences": {},
"object": "608060405234801561001057600080fd5b506000808190555061014d806100276000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634f2be91f1461003b57806361bc221a14610045575b600080fd5b610043610063565b005b61004d61007a565b60405161005a9190610099565b60405180910390f35b600160005461007291906100e3565b600081905550565b60005481565b6000819050919050565b61009381610080565b82525050565b60006020820190506100ae600083018461008a565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006100ee82610080565b91506100f983610080565b9250828201905080821115610111576101106100b4565b5b9291505056fea264697066735822122014d0563855745310f016f63c1a57d548c86abd75978d14d540142c2245e6b1b564736f6c63430008120033",
"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 0x14D 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 0x4F2BE91F EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x61BC221A EQ PUSH2 0x45 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x63 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x4D PUSH2 0x7A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x5A SWAP2 SWAP1 PUSH2 0x99 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x1 PUSH1 0x0 SLOAD PUSH2 0x72 SWAP2 SWAP1 PUSH2 0xE3 JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 SSTORE POP JUMP JUMPDEST PUSH1 0x0 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x93 DUP2 PUSH2 0x80 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0xAE PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x8A JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 PUSH2 0xEE DUP3 PUSH2 0x80 JUMP JUMPDEST SWAP2 POP PUSH2 0xF9 DUP4 PUSH2 0x80 JUMP JUMPDEST SWAP3 POP DUP3 DUP3 ADD SWAP1 POP DUP1 DUP3 GT ISZERO PUSH2 0x111 JUMPI PUSH2 0x110 PUSH2 0xB4 JUMP JUMPDEST JUMPDEST SWAP3 SWAP2 POP POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 EQ 0xD0 JUMP CODESIZE SSTORE PUSH21 0x5310F016F63C1A57D548C86ABD75978D14D540142C 0x22 GASLIMIT 0xE6 0xB1 0xB5 PUSH5 0x736F6C6343 STOP ADDMOD SLT STOP CALLER ",
"sourceMap": "25:139:0:-:0;;;69:36;;;;;;;;;;99:1;89:7;:11;;;;25:139;;;;;;"
},
"deployedBytecode": {
"functionDebugData": {
"@add_21": {
"entryPoint": 99,
"id": 21,
"parameterSlots": 0,
"returnSlots": 0
},
"@counter_3": {
"entryPoint": 122,
"id": 3,
"parameterSlots": 0,
"returnSlots": 0
},
"abi_encode_t_uint256_to_t_uint256_fromStack": {
"entryPoint": 138,
"id": null,
"parameterSlots": 2,
"returnSlots": 0
},
"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed": {
"entryPoint": 153,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"checked_add_t_uint256": {
"entryPoint": 227,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"cleanup_t_uint256": {
"entryPoint": 128,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"panic_error_0x11": {
"entryPoint": 180,
"id": null,
"parameterSlots": 0,
"returnSlots": 0
}
},
"generatedSources": [
{
"ast": {
"nodeType": "YulBlock",
"src": "0:822:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "52:32:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "62:16:1",
"value": {
"name": "value",
"nodeType": "YulIdentifier",
"src": "73:5:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "62:7:1"
}
]
}
]
},
"name": "cleanup_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "34:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "44:7:1",
"type": ""
}
],
"src": "7:77:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "155:53:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "172:3:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "195:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "177:17:1"
},
"nodeType": "YulFunctionCall",
"src": "177:24:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "165:6:1"
},
"nodeType": "YulFunctionCall",
"src": "165:37:1"
},
"nodeType": "YulExpressionStatement",
"src": "165:37:1"
}
]
},
"name": "abi_encode_t_uint256_to_t_uint256_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "143:5:1",
"type": ""
},
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "150:3:1",
"type": ""
}
],
"src": "90:118:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "312:124:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "322:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "334:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "345:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "330:3:1"
},
"nodeType": "YulFunctionCall",
"src": "330:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "322:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "402:6:1"
},
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "415:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "426:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "411:3:1"
},
"nodeType": "YulFunctionCall",
"src": "411:17:1"
}
],
"functionName": {
"name": "abi_encode_t_uint256_to_t_uint256_fromStack",
"nodeType": "YulIdentifier",
"src": "358:43:1"
},
"nodeType": "YulFunctionCall",
"src": "358:71:1"
},
"nodeType": "YulExpressionStatement",
"src": "358:71:1"
}
]
},
"name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "284:9:1",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "296:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "307:4:1",
"type": ""
}
],
"src": "214:222:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "470:152:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "487:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "490:77:1",
"type": "",
"value": "35408467139433450592217433187231851964531694900788300625387963629091585785856"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "480:6:1"
},
"nodeType": "YulFunctionCall",
"src": "480:88:1"
},
"nodeType": "YulExpressionStatement",
"src": "480:88:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "584:1:1",
"type": "",
"value": "4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "587:4:1",
"type": "",
"value": "0x11"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "577:6:1"
},
"nodeType": "YulFunctionCall",
"src": "577:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "577:15:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "608:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "611:4:1",
"type": "",
"value": "0x24"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "601:6:1"
},
"nodeType": "YulFunctionCall",
"src": "601:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "601:15:1"
}
]
},
"name": "panic_error_0x11",
"nodeType": "YulFunctionDefinition",
"src": "442:180:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "672:147:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "682:25:1",
"value": {
"arguments": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "705:1:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "687:17:1"
},
"nodeType": "YulFunctionCall",
"src": "687:20:1"
},
"variableNames": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "682:1:1"
}
]
},
{
"nodeType": "YulAssignment",
"src": "716:25:1",
"value": {
"arguments": [
{
"name": "y",
"nodeType": "YulIdentifier",
"src": "739:1:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "721:17:1"
},
"nodeType": "YulFunctionCall",
"src": "721:20:1"
},
"variableNames": [
{
"name": "y",
"nodeType": "YulIdentifier",
"src": "716:1:1"
}
]
},
{
"nodeType": "YulAssignment",
"src": "750:16:1",
"value": {
"arguments": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "761:1:1"
},
{
"name": "y",
"nodeType": "YulIdentifier",
"src": "764:1:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "757:3:1"
},
"nodeType": "YulFunctionCall",
"src": "757:9:1"
},
"variableNames": [
{
"name": "sum",
"nodeType": "YulIdentifier",
"src": "750:3:1"
}
]
},
{
"body": {
"nodeType": "YulBlock",
"src": "790:22:1",
"statements": [
{
"expression": {
"arguments": [],
"functionName": {
"name": "panic_error_0x11",
"nodeType": "YulIdentifier",
"src": "792:16:1"
},
"nodeType": "YulFunctionCall",
"src": "792:18:1"
},
"nodeType": "YulExpressionStatement",
"src": "792:18:1"
}
]
},
"condition": {
"arguments": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "782:1:1"
},
{
"name": "sum",
"nodeType": "YulIdentifier",
"src": "785:3:1"
}
],
"functionName": {
"name": "gt",
"nodeType": "YulIdentifier",
"src": "779:2:1"
},
"nodeType": "YulFunctionCall",
"src": "779:10:1"
},
"nodeType": "YulIf",
"src": "776:36:1"
}
]
},
"name": "checked_add_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "x",
"nodeType": "YulTypedName",
"src": "659:1:1",
"type": ""
},
{
"name": "y",
"nodeType": "YulTypedName",
"src": "662:1:1",
"type": ""
}
],
"returnVariables": [
{
"name": "sum",
"nodeType": "YulTypedName",
"src": "668:3:1",
"type": ""
}
],
"src": "628:191:1"
}
]
},
"contents": "{\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\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 panic_error_0x11() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n\n function checked_add_t_uint256(x, y) -> sum {\n x := cleanup_t_uint256(x)\n y := cleanup_t_uint256(y)\n sum := add(x, y)\n\n if gt(x, sum) { panic_error_0x11() }\n\n }\n\n}\n",
"id": 1,
"language": "Yul",
"name": "#utility.yul"
}
],
"immutableReferences": {},
"linkReferences": {},
"object": "608060405234801561001057600080fd5b50600436106100365760003560e01c80634f2be91f1461003b57806361bc221a14610045575b600080fd5b610043610063565b005b61004d61007a565b60405161005a9190610099565b60405180910390f35b600160005461007291906100e3565b600081905550565b60005481565b6000819050919050565b61009381610080565b82525050565b60006020820190506100ae600083018461008a565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006100ee82610080565b91506100f983610080565b9250828201905080821115610111576101106100b4565b5b9291505056fea264697066735822122014d0563855745310f016f63c1a57d548c86abd75978d14d540142c2245e6b1b564736f6c63430008120033",
"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 0x4F2BE91F EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x61BC221A EQ PUSH2 0x45 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x63 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x4D PUSH2 0x7A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x5A SWAP2 SWAP1 PUSH2 0x99 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x1 PUSH1 0x0 SLOAD PUSH2 0x72 SWAP2 SWAP1 PUSH2 0xE3 JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 SSTORE POP JUMP JUMPDEST PUSH1 0x0 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x93 DUP2 PUSH2 0x80 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0xAE PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x8A JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 PUSH2 0xEE DUP3 PUSH2 0x80 JUMP JUMPDEST SWAP2 POP PUSH2 0xF9 DUP4 PUSH2 0x80 JUMP JUMPDEST SWAP3 POP DUP3 DUP3 ADD SWAP1 POP DUP1 DUP3 GT ISZERO PUSH2 0x111 JUMPI PUSH2 0x110 PUSH2 0xB4 JUMP JUMPDEST JUMPDEST SWAP3 SWAP2 POP POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 EQ 0xD0 JUMP CODESIZE SSTORE PUSH21 0x5310F016F63C1A57D548C86ABD75978D14D540142C 0x22 GASLIMIT 0xE6 0xB1 0xB5 PUSH5 0x736F6C6343 STOP ADDMOD SLT STOP CALLER ",
"sourceMap": "25:139:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;108:54;;;:::i;:::-;;46:19;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;108:54;156:1;146:7;;:11;;;;:::i;:::-;136:7;:21;;;;108:54::o;46:19::-;;;;:::o;7:77:1:-;44:7;73:5;62:16;;7:77;;;:::o;90:118::-;177:24;195:5;177:24;:::i;:::-;172:3;165:37;90:118;;:::o;214:222::-;307:4;345:2;334:9;330:18;322:26;;358:71;426:1;415:9;411:17;402:6;358:71;:::i;:::-;214:222;;;;:::o;442:180::-;490:77;487:1;480:88;587:4;584:1;577:15;611:4;608:1;601:15;628:191;668:3;687:20;705:1;687:20;:::i;:::-;682:25;;721:20;739:1;721:20;:::i;:::-;716:25;;764:1;761;757:9;750:16;;785:3;782:1;779:10;776:36;;;792:18;;:::i;:::-;776:36;628:191;;;;:::o"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "66600",
"executionCost": "5131",
"totalCost": "71731"
},
"external": {
"add()": "infinite",
"counter()": "2429"
}
},
"legacyAssembly": {
".code": [
{
"begin": 25,
"end": 164,
"name": "PUSH",
"source": 0,
"value": "80"
},
{
"begin": 25,
"end": 164,
"name": "PUSH",
"source": 0,
"value": "40"
},
{
"begin": 25,
"end": 164,
"name": "MSTORE",
"source": 0
},
{
"begin": 69,
"end": 105,
"name": "CALLVALUE",
"source": 0
},
{
"begin": 69,
"end": 105,
"name": "DUP1",
"source": 0
},
{
"begin": 69,
"end": 105,
"name": "ISZERO",
"source": 0
},
{
"begin": 69,
"end": 105,
"name": "PUSH [tag]",
"source": 0,
"value": "1"
},
{
"begin": 69,
"end": 105,
"name": "JUMPI",
"source": 0
},
{
"begin": 69,
"end": 105,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 69,
"end": 105,
"name": "DUP1",
"source": 0
},
{
"begin": 69,
"end": 105,
"name": "REVERT",
"source": 0
},
{
"begin": 69,
"end": 105,
"name": "tag",
"source": 0,
"value": "1"
},
{
"begin": 69,
"end": 105,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 69,
"end": 105,
"name": "POP",
"source": 0
},
{
"begin": 99,
"end": 100,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 89,
"end": 96,
"name": "DUP1",
"source": 0
},
{
"begin": 89,
"end": 100,
"name": "DUP2",
"source": 0
},
{
"begin": 89,
"end": 100,
"name": "SWAP1",
"source": 0
},
{
"begin": 89,
"end": 100,
"name": "SSTORE",
"source": 0
},
{
"begin": 89,
"end": 100,
"name": "POP",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "PUSH #[$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 25,
"end": 164,
"name": "DUP1",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "PUSH [$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 25,
"end": 164,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 25,
"end": 164,
"name": "CODECOPY",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 25,
"end": 164,
"name": "RETURN",
"source": 0
}
],
".data": {
"0": {
".auxdata": "a264697066735822122014d0563855745310f016f63c1a57d548c86abd75978d14d540142c2245e6b1b564736f6c63430008120033",
".code": [
{
"begin": 25,
"end": 164,
"name": "PUSH",
"source": 0,
"value": "80"
},
{
"begin": 25,
"end": 164,
"name": "PUSH",
"source": 0,
"value": "40"
},
{
"begin": 25,
"end": 164,
"name": "MSTORE",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "CALLVALUE",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "DUP1",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "ISZERO",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "PUSH [tag]",
"source": 0,
"value": "1"
},
{
"begin": 25,
"end": 164,
"name": "JUMPI",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 25,
"end": 164,
"name": "DUP1",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "REVERT",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "tag",
"source": 0,
"value": "1"
},
{
"begin": 25,
"end": 164,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "POP",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "PUSH",
"source": 0,
"value": "4"
},
{
"begin": 25,
"end": 164,
"name": "CALLDATASIZE",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "LT",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "PUSH [tag]",
"source": 0,
"value": "2"
},
{
"begin": 25,
"end": 164,
"name": "JUMPI",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 25,
"end": 164,
"name": "CALLDATALOAD",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "PUSH",
"source": 0,
"value": "E0"
},
{
"begin": 25,
"end": 164,
"name": "SHR",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "DUP1",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "PUSH",
"source": 0,
"value": "4F2BE91F"
},
{
"begin": 25,
"end": 164,
"name": "EQ",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "PUSH [tag]",
"source": 0,
"value": "3"
},
{
"begin": 25,
"end": 164,
"name": "JUMPI",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "DUP1",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "PUSH",
"source": 0,
"value": "61BC221A"
},
{
"begin": 25,
"end": 164,
"name": "EQ",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "PUSH [tag]",
"source": 0,
"value": "4"
},
{
"begin": 25,
"end": 164,
"name": "JUMPI",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "tag",
"source": 0,
"value": "2"
},
{
"begin": 25,
"end": 164,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 25,
"end": 164,
"name": "DUP1",
"source": 0
},
{
"begin": 25,
"end": 164,
"name": "REVERT",
"source": 0
},
{
"begin": 108,
"end": 162,
"name": "tag",
"source": 0,
"value": "3"
},
{
"begin": 108,
"end": 162,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 108,
"end": 162,
"name": "PUSH [tag]",
"source": 0,
"value": "5"
},
{
"begin": 108,
"end": 162,
"name": "PUSH [tag]",
"source": 0,
"value": "6"
},
{
"begin": 108,
"end": 162,
"jumpType": "[in]",
"name": "JUMP",
"source": 0
},
{
"begin": 108,
"end": 162,
"name": "tag",
"source": 0,
"value": "5"
},
{
"begin": 108,
"end": 162,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 108,
"end": 162,
"name": "STOP",
"source": 0
},
{
"begin": 46,
"end": 65,
"name": "tag",
"source": 0,
"value": "4"
},
{
"begin": 46,
"end": 65,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 46,
"end": 65,
"name": "PUSH [tag]",
"source": 0,
"value": "7"
},
{
"begin": 46,
"end": 65,
"name": "PUSH [tag]",
"source": 0,
"value": "8"
},
{
"begin": 46,
"end": 65,
"jumpType": "[in]",
"name": "JUMP",
"source": 0
},
{
"begin": 46,
"end": 65,
"name": "tag",
"source": 0,
"value": "7"
},
{
"begin": 46,
"end": 65,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 46,
"end": 65,
"name": "PUSH",
"source": 0,
"value": "40"
},
{
"begin": 46,
"end": 65,
"name": "MLOAD",
"source": 0
},
{
"begin": 46,
"end": 65,
"name": "PUSH [tag]",
"source": 0,
"value": "9"
},
{
"begin": 46,
"end": 65,
"name": "SWAP2",
"source": 0
},
{
"begin": 46,
"end": 65,
"name": "SWAP1",
"source": 0
},
{
"begin": 46,
"end": 65,
"name": "PUSH [tag]",
"source": 0,
"value": "10"
},
{
"begin": 46,
"end": 65,
"jumpType": "[in]",
"name": "JUMP",
"source": 0
},
{
"begin": 46,
"end": 65,
"name": "tag",
"source": 0,
"value": "9"
},
{
"begin": 46,
"end": 65,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 46,
"end": 65,
"name": "PUSH",
"source": 0,
"value": "40"
},
{
"begin": 46,
"end": 65,
"name": "MLOAD",
"source": 0
},
{
"begin": 46,
"end": 65,
"name": "DUP1",
"source": 0
},
{
"begin": 46,
"end": 65,
"name": "SWAP2",
"source": 0
},
{
"begin": 46,
"end": 65,
"name": "SUB",
"source": 0
},
{
"begin": 46,
"end": 65,
"name": "SWAP1",
"source": 0
},
{
"begin": 46,
"end": 65,
"name": "RETURN",
"source": 0
},
{
"begin": 108,
"end": 162,
"name": "tag",
"source": 0,
"value": "6"
},
{
"begin": 108,
"end": 162,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 156,
"end": 157,
"name": "PUSH",
"source": 0,
"value": "1"
},
{
"begin": 146,
"end": 153,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 146,
"end": 153,
"name": "SLOAD",
"source": 0
},
{
"begin": 146,
"end": 157,
"name": "PUSH [tag]",
"source": 0,
"value": "12"
},
{
"begin": 146,
"end": 157,
"name": "SWAP2",
"source": 0
},
{
"begin": 146,
"end": 157,
"name": "SWAP1",
"source": 0
},
{
"begin": 146,
"end": 157,
"name": "PUSH [tag]",
"source": 0,
"value": "13"
},
{
"begin": 146,
"end": 157,
"jumpType": "[in]",
"name": "JUMP",
"source": 0
},
{
"begin": 146,
"end": 157,
"name": "tag",
"source": 0,
"value": "12"
},
{
"begin": 146,
"end": 157,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 136,
"end": 143,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 136,
"end": 157,
"name": "DUP2",
"source": 0
},
{
"begin": 136,
"end": 157,
"name": "SWAP1",
"source": 0
},
{
"begin": 136,
"end": 157,
"name": "SSTORE",
"source": 0
},
{
"begin": 136,
"end": 157,
"name": "POP",
"source": 0
},
{
"begin": 108,
"end": 162,
"jumpType": "[out]",
"name": "JUMP",
"source": 0
},
{
"begin": 46,
"end": 65,
"name": "tag",
"source": 0,
"value": "8"
},
{
"begin": 46,
"end": 65,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 46,
"end": 65,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 46,
"end": 65,
"name": "SLOAD",
"source": 0
},
{
"begin": 46,
"end": 65,
"name": "DUP2",
"source": 0
},
{
"begin": 46,
"end": 65,
"jumpType": "[out]",
"name": "JUMP",
"source": 0
},
{
"begin": 7,
"end": 84,
"name": "tag",
"source": 1,
"value": "14"
},
{
"begin": 7,
"end": 84,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 44,
"end": 51,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 73,
"end": 78,
"name": "DUP2",
"source": 1
},
{
"begin": 62,
"end": 78,
"name": "SWAP1",
"source": 1
},
{
"begin": 62,
"end": 78,
"name": "POP",
"source": 1
},
{
"begin": 7,
"end": 84,
"name": "SWAP2",
"source": 1
},
{
"begin": 7,
"end": 84,
"name": "SWAP1",
"source": 1
},
{
"begin": 7,
"end": 84,
"name": "POP",
"source": 1
},
{
"begin": 7,
"end": 84,
"jumpType": "[out]",
"name": "JUMP",
"source": 1
},
{
"begin": 90,
"end": 208,
"name": "tag",
"source": 1,
"value": "15"
},
{
"begin": 90,
"end": 208,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 177,
"end": 201,
"name": "PUSH [tag]",
"source": 1,
"value": "20"
},
{
"begin": 195,
"end": 200,
"name": "DUP2",
"source": 1
},
{
"begin": 177,
"end": 201,
"name": "PUSH [tag]",
"source": 1,
"value": "14"
},
{
"begin": 177,
"end": 201,
"jumpType": "[in]",
"name": "JUMP",
"source": 1
},
{
"begin": 177,
"end": 201,
"name": "tag",
"source": 1,
"value": "20"
},
{
"begin": 177,
"end": 201,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 172,
"end": 175,
"name": "DUP3",
"source": 1
},
{
"begin": 165,
"end": 202,
"name": "MSTORE",
"source": 1
},
{
"begin": 90,
"end": 208,
"name": "POP",
"source": 1
},
{
"begin": 90,
"end": 208,
"name": "POP",
"source": 1
},
{
"begin": 90,
"end": 208,
"jumpType": "[out]",
"name": "JUMP",
"source": 1
},
{
"begin": 214,
"end": 436,
"name": "tag",
"source": 1,
"value": "10"
},
{
"begin": 214,
"end": 436,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 307,
"end": 311,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 345,
"end": 347,
"name": "PUSH",
"source": 1,
"value": "20"
},
{
"begin": 334,
"end": 343,
"name": "DUP3",
"source": 1
},
{
"begin": 330,
"end": 348,
"name": "ADD",
"source": 1
},
{
"begin": 322,
"end": 348,
"name": "SWAP1",
"source": 1
},
{
"begin": 322,
"end": 348,
"name": "POP",
"source": 1
},
{
"begin": 358,
"end": 429,
"name": "PUSH [tag]",
"source": 1,
"value": "22"
},
{
"begin": 426,
"end": 427,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 415,
"end": 424,
"name": "DUP4",
"source": 1
},
{
"begin": 411,
"end": 428,
"name": "ADD",
"source": 1
},
{
"begin": 402,
"end": 408,
"name": "DUP5",
"source": 1
},
{
"begin": 358,
"end": 429,
"name": "PUSH [tag]",
"source": 1,
"value": "15"
},
{
"begin": 358,
"end": 429,
"jumpType": "[in]",
"name": "JUMP",
"source": 1
},
{
"begin": 358,
"end": 429,
"name": "tag",
"source": 1,
"value": "22"
},
{
"begin": 358,
"end": 429,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 214,
"end": 436,
"name": "SWAP3",
"source": 1
},
{
"begin": 214,
"end": 436,
"name": "SWAP2",
"source": 1
},
{
"begin": 214,
"end": 436,
"name": "POP",
"source": 1
},
{
"begin": 214,
"end": 436,
"name": "POP",
"source": 1
},
{
"begin": 214,
"end": 436,
"jumpType": "[out]",
"name": "JUMP",
"source": 1
},
{
"begin": 442,
"end": 622,
"name": "tag",
"source": 1,
"value": "16"
},
{
"begin": 442,
"end": 622,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 490,
"end": 567,
"name": "PUSH",
"source": 1,
"value": "4E487B7100000000000000000000000000000000000000000000000000000000"
},
{
"begin": 487,
"end": 488,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 480,
"end": 568,
"name": "MSTORE",
"source": 1
},
{
"begin": 587,
"end": 591,
"name": "PUSH",
"source": 1,
"value": "11"
},
{
"begin": 584,
"end": 585,
"name": "PUSH",
"source": 1,
"value": "4"
},
{
"begin": 577,
"end": 592,
"name": "MSTORE",
"source": 1
},
{
"begin": 611,
"end": 615,
"name": "PUSH",
"source": 1,
"value": "24"
},
{
"begin": 608,
"end": 609,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 601,
"end": 616,
"name": "REVERT",
"source": 1
},
{
"begin": 628,
"end": 819,
"name": "tag",
"source": 1,
"value": "13"
},
{
"begin": 628,
"end": 819,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 668,
"end": 671,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 687,
"end": 707,
"name": "PUSH [tag]",
"source": 1,
"value": "25"
},
{
"begin": 705,
"end": 706,
"name": "DUP3",
"source": 1
},
{
"begin": 687,
"end": 707,
"name": "PUSH [tag]",
"source": 1,
"value": "14"
},
{
"begin": 687,
"end": 707,
"jumpType": "[in]",
"name": "JUMP",
"source": 1
},
{
"begin": 687,
"end": 707,
"name": "tag",
"source": 1,
"value": "25"
},
{
"begin": 687,
"end": 707,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 682,
"end": 707,
"name": "SWAP2",
"source": 1
},
{
"begin": 682,
"end": 707,
"name": "POP",
"source": 1
},
{
"begin": 721,
"end": 741,
"name": "PUSH [tag]",
"source": 1,
"value": "26"
},
{
"begin": 739,
"end": 740,
"name": "DUP4",
"source": 1
},
{
"begin": 721,
"end": 741,
"name": "PUSH [tag]",
"source": 1,
"value": "14"
},
{
"begin": 721,
"end": 741,
"jumpType": "[in]",
"name": "JUMP",
"source": 1
},
{
"begin": 721,
"end": 741,
"name": "tag",
"source": 1,
"value": "26"
},
{
"begin": 721,
"end": 741,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 716,
"end": 741,
"name": "SWAP3",
"source": 1
},
{
"begin": 716,
"end": 741,
"name": "POP",
"source": 1
},
{
"begin": 764,
"end": 765,
"name": "DUP3",
"source": 1
},
{
"begin": 761,
"end": 762,
"name": "DUP3",
"source": 1
},
{
"begin": 757,
"end": 766,
"name": "ADD",
"source": 1
},
{
"begin": 750,
"end": 766,
"name": "SWAP1",
"source": 1
},
{
"begin": 750,
"end": 766,
"name": "POP",
"source": 1
},
{
"begin": 785,
"end": 788,
"name": "DUP1",
"source": 1
},
{
"begin": 782,
"end": 783,
"name": "DUP3",
"source": 1
},
{
"begin": 779,
"end": 789,
"name": "GT",
"source": 1
},
{
"begin": 776,
"end": 812,
"name": "ISZERO",
"source": 1
},
{
"begin": 776,
"end": 812,
"name": "PUSH [tag]",
"source": 1,
"value": "27"
},
{
"begin": 776,
"end": 812,
"name": "JUMPI",
"source": 1
},
{
"begin": 792,
"end": 810,
"name": "PUSH [tag]",
"source": 1,
"value": "28"
},
{
"begin": 792,
"end": 810,
"name": "PUSH [tag]",
"source": 1,
"value": "16"
},
{
"begin": 792,
"end": 810,
"jumpType": "[in]",
"name": "JUMP",
"source": 1
},
{
"begin": 792,
"end": 810,
"name": "tag",
"source": 1,
"value": "28"
},
{
"begin": 792,
"end": 810,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 776,
"end": 812,
"name": "tag",
"source": 1,
"value": "27"
},
{
"begin": 776,
"end": 812,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 628,
"end": 819,
"name": "SWAP3",
"source": 1
},
{
"begin": 628,
"end": 819,
"name": "SWAP2",
"source": 1
},
{
"begin": 628,
"end": 819,
"name": "POP",
"source": 1
},
{
"begin": 628,
"end": 819,
"name": "POP",
"source": 1
},
{
"begin": 628,
"end": 819,
"jumpType": "[out]",
"name": "JUMP",
"source": 1
}
]
}
},
"sourceList": [
"week1-1/Counter.sol",
"#utility.yul"
]
},
"methodIdentifiers": {
"add()": "4f2be91f",
"counter()": "61bc221a"
}
},
"metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"add\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"counter\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"week1-1/Counter.sol\":\"Counter\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"week1-1/Counter.sol\":{\"keccak256\":\"0x741015c0a6394fe46b8aa30e7289e0de5e522a811fe0521ab7be54960a09c972\",\"urls\":[\"bzz-raw://1685eed0f48bf2bfb708205b86a6aca0e48579cf1986d268c7bc3b20b24f42f0\",\"dweb:/ipfs/QmR34BS5Xt8WeJiV8PDZX5L4RSiVVuFeNv1hgNhDgkckf5\"]}},\"version\":1}",
"storageLayout": {
"storage": [
{
"astId": 3,
"contract": "week1-1/Counter.sol:Counter",
"label": "counter",
"offset": 0,
"slot": "0",
"type": "t_uint256"
}
],
"types": {
"t_uint256": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
}
}
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
}
}
},
"errors": [
{
"component": "general",
"errorCode": "1878",
"formattedMessage": "Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: <SPDX-License>\" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.\n--> week1-1/Counter.sol\n\n",
"message": "SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: <SPDX-License>\" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.",
"severity": "warning",
"sourceLocation": {
"end": -1,
"file": "week1-1/Counter.sol",
"start": -1
},
"type": "Warning"
}
],
"sources": {
"week1-1/Counter.sol": {
"ast": {
"absolutePath": "week1-1/Counter.sol",
"exportedSymbols": {
"Counter": [
22
]
},
"id": 23,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"^",
"0.8",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:23:0"
},
{
"abstract": false,
"baseContracts": [],
"canonicalName": "Counter",
"contractDependencies": [],
"contractKind": "contract",
"fullyImplemented": true,
"id": 22,
"linearizedBaseContracts": [
22
],
"name": "Counter",
"nameLocation": "34:7:0",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"functionSelector": "61bc221a",
"id": 3,
"mutability": "mutable",
"name": "counter",
"nameLocation": "58:7:0",
"nodeType": "VariableDeclaration",
"scope": 22,
"src": "46:19:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "46:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "public"
},
{
"body": {
"id": 10,
"nodeType": "Block",
"src": "83:22:0",
"statements": [
{
"expression": {
"id": 8,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 6,
"name": "counter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "89:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"hexValue": "30",
"id": 7,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "99:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "89:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 9,
"nodeType": "ExpressionStatement",
"src": "89:11:0"
}
]
},
"id": 11,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 4,
"nodeType": "ParameterList",
"parameters": [],
"src": "80:2:0"
},
"returnParameters": {
"id": 5,
"nodeType": "ParameterList",
"parameters": [],
"src": "83:0:0"
},
"scope": 22,
"src": "69:36:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 20,
"nodeType": "Block",
"src": "130:32:0",
"statements": [
{
"expression": {
"id": 18,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 14,
"name": "counter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "136:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 17,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 15,
"name": "counter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "146:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"hexValue": "31",
"id": 16,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "156:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "146:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "136:21:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 19,
"nodeType": "ExpressionStatement",
"src": "136:21:0"
}
]
},
"functionSelector": "4f2be91f",
"id": 21,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "add",
"nameLocation": "117:3:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 12,
"nodeType": "ParameterList",
"parameters": [],
"src": "120:2:0"
},
"returnParameters": {
"id": 13,
"nodeType": "ParameterList",
"parameters": [],
"src": "130:0:0"
},
"scope": 22,
"src": "108:54:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"scope": 23,
"src": "25:139:0",
"usedErrors": []
}
],
"src": "0:165:0"
},
"id": 0
}
}
}
}
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
"ropsten:3": {
"linkReferences": {},
"autoDeployLib": true
},
"rinkeby:4": {
"linkReferences": {},
"autoDeployLib": true
},
"kovan:42": {
"linkReferences": {},
"autoDeployLib": true
},
"goerli:5": {
"linkReferences": {},
"autoDeployLib": true
},
"Custom": {
"linkReferences": {},
"autoDeployLib": true
}
},
"data": {
"bytecode": {
"functionDebugData": {
"@_11": {
"entryPoint": null,
"id": 11,
"parameterSlots": 0,
"returnSlots": 0
}
},
"generatedSources": [],
"linkReferences": {},
"object": "608060405234801561001057600080fd5b506000808190555061014d806100276000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634f2be91f1461003b57806361bc221a14610045575b600080fd5b610043610063565b005b61004d61007a565b60405161005a9190610099565b60405180910390f35b600160005461007291906100e3565b600081905550565b60005481565b6000819050919050565b61009381610080565b82525050565b60006020820190506100ae600083018461008a565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006100ee82610080565b91506100f983610080565b9250828201905080821115610111576101106100b4565b5b9291505056fea264697066735822122014d0563855745310f016f63c1a57d548c86abd75978d14d540142c2245e6b1b564736f6c63430008120033",
"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 0x14D 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 0x4F2BE91F EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x61BC221A EQ PUSH2 0x45 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x63 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x4D PUSH2 0x7A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x5A SWAP2 SWAP1 PUSH2 0x99 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x1 PUSH1 0x0 SLOAD PUSH2 0x72 SWAP2 SWAP1 PUSH2 0xE3 JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 SSTORE POP JUMP JUMPDEST PUSH1 0x0 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x93 DUP2 PUSH2 0x80 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0xAE PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x8A JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 PUSH2 0xEE DUP3 PUSH2 0x80 JUMP JUMPDEST SWAP2 POP PUSH2 0xF9 DUP4 PUSH2 0x80 JUMP JUMPDEST SWAP3 POP DUP3 DUP3 ADD SWAP1 POP DUP1 DUP3 GT ISZERO PUSH2 0x111 JUMPI PUSH2 0x110 PUSH2 0xB4 JUMP JUMPDEST JUMPDEST SWAP3 SWAP2 POP POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 EQ 0xD0 JUMP CODESIZE SSTORE PUSH21 0x5310F016F63C1A57D548C86ABD75978D14D540142C 0x22 GASLIMIT 0xE6 0xB1 0xB5 PUSH5 0x736F6C6343 STOP ADDMOD SLT STOP CALLER ",
"sourceMap": "25:139:0:-:0;;;69:36;;;;;;;;;;99:1;89:7;:11;;;;25:139;;;;;;"
},
"deployedBytecode": {
"functionDebugData": {
"@add_21": {
"entryPoint": 99,
"id": 21,
"parameterSlots": 0,
"returnSlots": 0
},
"@counter_3": {
"entryPoint": 122,
"id": 3,
"parameterSlots": 0,
"returnSlots": 0
},
"abi_encode_t_uint256_to_t_uint256_fromStack": {
"entryPoint": 138,
"id": null,
"parameterSlots": 2,
"returnSlots": 0
},
"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed": {
"entryPoint": 153,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"checked_add_t_uint256": {
"entryPoint": 227,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"cleanup_t_uint256": {
"entryPoint": 128,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"panic_error_0x11": {
"entryPoint": 180,
"id": null,
"parameterSlots": 0,
"returnSlots": 0
}
},
"generatedSources": [
{
"ast": {
"nodeType": "YulBlock",
"src": "0:822:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "52:32:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "62:16:1",
"value": {
"name": "value",
"nodeType": "YulIdentifier",
"src": "73:5:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "62:7:1"
}
]
}
]
},
"name": "cleanup_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "34:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "44:7:1",
"type": ""
}
],
"src": "7:77:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "155:53:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "172:3:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "195:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "177:17:1"
},
"nodeType": "YulFunctionCall",
"src": "177:24:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "165:6:1"
},
"nodeType": "YulFunctionCall",
"src": "165:37:1"
},
"nodeType": "YulExpressionStatement",
"src": "165:37:1"
}
]
},
"name": "abi_encode_t_uint256_to_t_uint256_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "143:5:1",
"type": ""
},
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "150:3:1",
"type": ""
}
],
"src": "90:118:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "312:124:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "322:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "334:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "345:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "330:3:1"
},
"nodeType": "YulFunctionCall",
"src": "330:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "322:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "402:6:1"
},
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "415:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "426:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "411:3:1"
},
"nodeType": "YulFunctionCall",
"src": "411:17:1"
}
],
"functionName": {
"name": "abi_encode_t_uint256_to_t_uint256_fromStack",
"nodeType": "YulIdentifier",
"src": "358:43:1"
},
"nodeType": "YulFunctionCall",
"src": "358:71:1"
},
"nodeType": "YulExpressionStatement",
"src": "358:71:1"
}
]
},
"name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "284:9:1",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "296:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "307:4:1",
"type": ""
}
],
"src": "214:222:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "470:152:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "487:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "490:77:1",
"type": "",
"value": "35408467139433450592217433187231851964531694900788300625387963629091585785856"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "480:6:1"
},
"nodeType": "YulFunctionCall",
"src": "480:88:1"
},
"nodeType": "YulExpressionStatement",
"src": "480:88:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "584:1:1",
"type": "",
"value": "4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "587:4:1",
"type": "",
"value": "0x11"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "577:6:1"
},
"nodeType": "YulFunctionCall",
"src": "577:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "577:15:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "608:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "611:4:1",
"type": "",
"value": "0x24"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "601:6:1"
},
"nodeType": "YulFunctionCall",
"src": "601:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "601:15:1"
}
]
},
"name": "panic_error_0x11",
"nodeType": "YulFunctionDefinition",
"src": "442:180:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "672:147:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "682:25:1",
"value": {
"arguments": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "705:1:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "687:17:1"
},
"nodeType": "YulFunctionCall",
"src": "687:20:1"
},
"variableNames": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "682:1:1"
}
]
},
{
"nodeType": "YulAssignment",
"src": "716:25:1",
"value": {
"arguments": [
{
"name": "y",
"nodeType": "YulIdentifier",
"src": "739:1:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "721:17:1"
},
"nodeType": "YulFunctionCall",
"src": "721:20:1"
},
"variableNames": [
{
"name": "y",
"nodeType": "YulIdentifier",
"src": "716:1:1"
}
]
},
{
"nodeType": "YulAssignment",
"src": "750:16:1",
"value": {
"arguments": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "761:1:1"
},
{
"name": "y",
"nodeType": "YulIdentifier",
"src": "764:1:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "757:3:1"
},
"nodeType": "YulFunctionCall",
"src": "757:9:1"
},
"variableNames": [
{
"name": "sum",
"nodeType": "YulIdentifier",
"src": "750:3:1"
}
]
},
{
"body": {
"nodeType": "YulBlock",
"src": "790:22:1",
"statements": [
{
"expression": {
"arguments": [],
"functionName": {
"name": "panic_error_0x11",
"nodeType": "YulIdentifier",
"src": "792:16:1"
},
"nodeType": "YulFunctionCall",
"src": "792:18:1"
},
"nodeType": "YulExpressionStatement",
"src": "792:18:1"
}
]
},
"condition": {
"arguments": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "782:1:1"
},
{
"name": "sum",
"nodeType": "YulIdentifier",
"src": "785:3:1"
}
],
"functionName": {
"name": "gt",
"nodeType": "YulIdentifier",
"src": "779:2:1"
},
"nodeType": "YulFunctionCall",
"src": "779:10:1"
},
"nodeType": "YulIf",
"src": "776:36:1"
}
]
},
"name": "checked_add_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "x",
"nodeType": "YulTypedName",
"src": "659:1:1",
"type": ""
},
{
"name": "y",
"nodeType": "YulTypedName",
"src": "662:1:1",
"type": ""
}
],
"returnVariables": [
{
"name": "sum",
"nodeType": "YulTypedName",
"src": "668:3:1",
"type": ""
}
],
"src": "628:191:1"
}
]
},
"contents": "{\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\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 panic_error_0x11() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n\n function checked_add_t_uint256(x, y) -> sum {\n x := cleanup_t_uint256(x)\n y := cleanup_t_uint256(y)\n sum := add(x, y)\n\n if gt(x, sum) { panic_error_0x11() }\n\n }\n\n}\n",
"id": 1,
"language": "Yul",
"name": "#utility.yul"
}
],
"immutableReferences": {},
"linkReferences": {},
"object": "608060405234801561001057600080fd5b50600436106100365760003560e01c80634f2be91f1461003b57806361bc221a14610045575b600080fd5b610043610063565b005b61004d61007a565b60405161005a9190610099565b60405180910390f35b600160005461007291906100e3565b600081905550565b60005481565b6000819050919050565b61009381610080565b82525050565b60006020820190506100ae600083018461008a565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006100ee82610080565b91506100f983610080565b9250828201905080821115610111576101106100b4565b5b9291505056fea264697066735822122014d0563855745310f016f63c1a57d548c86abd75978d14d540142c2245e6b1b564736f6c63430008120033",
"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 0x4F2BE91F EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x61BC221A EQ PUSH2 0x45 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x63 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x4D PUSH2 0x7A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x5A SWAP2 SWAP1 PUSH2 0x99 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x1 PUSH1 0x0 SLOAD PUSH2 0x72 SWAP2 SWAP1 PUSH2 0xE3 JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 SSTORE POP JUMP JUMPDEST PUSH1 0x0 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x93 DUP2 PUSH2 0x80 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0xAE PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x8A JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 PUSH2 0xEE DUP3 PUSH2 0x80 JUMP JUMPDEST SWAP2 POP PUSH2 0xF9 DUP4 PUSH2 0x80 JUMP JUMPDEST SWAP3 POP DUP3 DUP3 ADD SWAP1 POP DUP1 DUP3 GT ISZERO PUSH2 0x111 JUMPI PUSH2 0x110 PUSH2 0xB4 JUMP JUMPDEST JUMPDEST SWAP3 SWAP2 POP POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 EQ 0xD0 JUMP CODESIZE SSTORE PUSH21 0x5310F016F63C1A57D548C86ABD75978D14D540142C 0x22 GASLIMIT 0xE6 0xB1 0xB5 PUSH5 0x736F6C6343 STOP ADDMOD SLT STOP CALLER ",
"sourceMap": "25:139:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;108:54;;;:::i;:::-;;46:19;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;108:54;156:1;146:7;;:11;;;;:::i;:::-;136:7;:21;;;;108:54::o;46:19::-;;;;:::o;7:77:1:-;44:7;73:5;62:16;;7:77;;;:::o;90:118::-;177:24;195:5;177:24;:::i;:::-;172:3;165:37;90:118;;:::o;214:222::-;307:4;345:2;334:9;330:18;322:26;;358:71;426:1;415:9;411:17;402:6;358:71;:::i;:::-;214:222;;;;:::o;442:180::-;490:77;487:1;480:88;587:4;584:1;577:15;611:4;608:1;601:15;628:191;668:3;687:20;705:1;687:20;:::i;:::-;682:25;;721:20;739:1;721:20;:::i;:::-;716:25;;764:1;761;757:9;750:16;;785:3;782:1;779:10;776:36;;;792:18;;:::i;:::-;776:36;628:191;;;;:::o"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "66600",
"executionCost": "5131",
"totalCost": "71731"
},
"external": {
"add()": "infinite",
"counter()": "2429"
}
},
"methodIdentifiers": {
"add()": "4f2be91f",
"counter()": "61bc221a"
}
},
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "add",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "counter",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.18+commit.87f61d96"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "add",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "counter",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"week1-1/Counter.sol": "Counter"
},
"evmVersion": "paris",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"week1-1/Counter.sol": {
"keccak256": "0x741015c0a6394fe46b8aa30e7289e0de5e522a811fe0521ab7be54960a09c972",
"urls": [
"bzz-raw://1685eed0f48bf2bfb708205b86a6aca0e48579cf1986d268c7bc3b20b24f42f0",
"dweb:/ipfs/QmR34BS5Xt8WeJiV8PDZX5L4RSiVVuFeNv1hgNhDgkckf5"
]
}
},
"version": 1
}
pragma solidity ^0.8.0;
contract Counter {
uint public counter;
constructor() {
counter = 0;
}
function add() public {
counter = counter + 1;
}
}
{
"accounts": {
"account{0}": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
},
"linkReferences": {},
"transactions": [
{
"timestamp": 1681808091260,
"record": {
"value": "100000000000000000000",
"inputs": "()",
"parameters": [],
"name": "",
"type": "constructor",
"abi": "0x0ffc622e10205916801f643cc35abcacee78290ad65896d6b0bf9726364298f5",
"contractName": "Counter",
"bytecode": "608060405234801561001057600080fd5b506000808190555061014d806100276000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634f2be91f1461003b57806361bc221a14610045575b600080fd5b610043610063565b005b61004d61007a565b60405161005a9190610099565b60405180910390f35b600160005461007291906100e3565b600081905550565b60005481565b6000819050919050565b61009381610080565b82525050565b60006020820190506100ae600083018461008a565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006100ee82610080565b91506100f983610080565b9250828201905080821115610111576101106100b4565b5b9291505056fea264697066735822122014d0563855745310f016f63c1a57d548c86abd75978d14d540142c2245e6b1b564736f6c63430008120033",
"linkReferences": {},
"from": "account{0}"
}
},
{
"timestamp": 1681808145362,
"record": {
"value": "1",
"inputs": "()",
"parameters": [],
"name": "",
"type": "constructor",
"abi": "0x0ffc622e10205916801f643cc35abcacee78290ad65896d6b0bf9726364298f5",
"contractName": "Counter",
"bytecode": "608060405234801561001057600080fd5b506000808190555061014d806100276000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634f2be91f1461003b57806361bc221a14610045575b600080fd5b610043610063565b005b61004d61007a565b60405161005a9190610099565b60405180910390f35b600160005461007291906100e3565b600081905550565b60005481565b6000819050919050565b61009381610080565b82525050565b60006020820190506100ae600083018461008a565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006100ee82610080565b91506100f983610080565b9250828201905080821115610111576101106100b4565b5b9291505056fea264697066735822122014d0563855745310f016f63c1a57d548c86abd75978d14d540142c2245e6b1b564736f6c63430008120033",
"linkReferences": {},
"from": "account{0}"
}
}
],
"abis": {
"0x0ffc622e10205916801f643cc35abcacee78290ad65896d6b0bf9726364298f5": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "add",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "counter",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
]
}
}
{
"accounts": {
"account{0}": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
},
"linkReferences": {},
"transactions": [
{
"timestamp": 1681808091260,
"record": {
"value": "100000000000000000000",
"inputs": "()",
"parameters": [],
"name": "",
"type": "constructor",
"abi": "0x0ffc622e10205916801f643cc35abcacee78290ad65896d6b0bf9726364298f5",
"contractName": "Counter",
"bytecode": "608060405234801561001057600080fd5b506000808190555061014d806100276000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634f2be91f1461003b57806361bc221a14610045575b600080fd5b610043610063565b005b61004d61007a565b60405161005a9190610099565b60405180910390f35b600160005461007291906100e3565b600081905550565b60005481565b6000819050919050565b61009381610080565b82525050565b60006020820190506100ae600083018461008a565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006100ee82610080565b91506100f983610080565b9250828201905080821115610111576101106100b4565b5b9291505056fea264697066735822122014d0563855745310f016f63c1a57d548c86abd75978d14d540142c2245e6b1b564736f6c63430008120033",
"linkReferences": {},
"from": "account{0}"
}
},
{
"timestamp": 1681808145362,
"record": {
"value": "1",
"inputs": "()",
"parameters": [],
"name": "",
"type": "constructor",
"abi": "0x0ffc622e10205916801f643cc35abcacee78290ad65896d6b0bf9726364298f5",
"contractName": "Counter",
"bytecode": "608060405234801561001057600080fd5b506000808190555061014d806100276000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634f2be91f1461003b57806361bc221a14610045575b600080fd5b610043610063565b005b61004d61007a565b60405161005a9190610099565b60405180910390f35b600160005461007291906100e3565b600081905550565b60005481565b6000819050919050565b61009381610080565b82525050565b60006020820190506100ae600083018461008a565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006100ee82610080565b91506100f983610080565b9250828201905080821115610111576101106100b4565b5b9291505056fea264697066735822122014d0563855745310f016f63c1a57d548c86abd75978d14d540142c2245e6b1b564736f6c63430008120033",
"linkReferences": {},
"from": "account{0}"
}
}
],
"abis": {
"0x0ffc622e10205916801f643cc35abcacee78290ad65896d6b0bf9726364298f5": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "add",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "counter",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment