Skip to content

Instantly share code, notes, and snippets.

@Redouane64
Created August 16, 2021 16:18
Show Gist options
  • Select an option

  • Save Redouane64/50676ef02f5badd588f7181557edc783 to your computer and use it in GitHub Desktop.

Select an option

Save Redouane64/50676ef02f5badd588f7181557edc783 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.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
The 'scripts' folder contains example async/await scripts for deploying the 'Storage' contract.
For the deployment of any other contract, 'contractName' and 'constructorArgs' should be updated (along with other code if required).
Scripts have full access to the web3.js and ethers.js libraries.
To run a script, right click on file name in the file explorer and click 'Run'. Remember, Solidity file must already be compiled.
Output from script will appear in remix terminal.
{
"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
},
"görli:5": {
"linkReferences": {},
"autoDeployLib": true
},
"Custom": {
"linkReferences": {},
"autoDeployLib": true
}
},
"data": {
"bytecode": {
"generatedSources": [],
"linkReferences": {},
"object": "60806040526000805534801561001457600080fd5b5061022d806100246000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063209652551461003b5780635b9af12b14610059575b600080fd5b610043610075565b6040516100509190610136565b60405180910390f35b610073600480360381019061006e91906100fe565b61007e565b005b60008054905090565b8060008082825461008f9190610151565b925050819055503373ffffffffffffffffffffffffffffffffffffffff167f80e3dfc82dac669767f8c28c515c9c0d2dc71547c4462a90bbad6fc3863490ff6000546040516100de9190610136565b60405180910390a250565b6000813590506100f8816101e0565b92915050565b60006020828403121561011057600080fd5b600061011e848285016100e9565b91505092915050565b610130816101a7565b82525050565b600060208201905061014b6000830184610127565b92915050565b600061015c826101a7565b9150610167836101a7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561019c5761019b6101b1565b5b828201905092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6101e9816101a7565b81146101f457600080fd5b5056fea2646970667358221220c64503ce3eefe46862370c3b1706bf2ef5e2210984aa6d43d45d735e30fb2bdd64736f6c63430008040033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 SSTORE CALLVALUE DUP1 ISZERO PUSH2 0x14 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x22D DUP1 PUSH2 0x24 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 0x20965255 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x5B9AF12B EQ PUSH2 0x59 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x75 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x50 SWAP2 SWAP1 PUSH2 0x136 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 0xFE JUMP JUMPDEST PUSH2 0x7E JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 POP SWAP1 JUMP JUMPDEST DUP1 PUSH1 0x0 DUP1 DUP3 DUP3 SLOAD PUSH2 0x8F SWAP2 SWAP1 PUSH2 0x151 JUMP JUMPDEST SWAP3 POP POP DUP2 SWAP1 SSTORE POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x80E3DFC82DAC669767F8C28C515C9C0D2DC71547C4462A90BBAD6FC3863490FF PUSH1 0x0 SLOAD PUSH1 0x40 MLOAD PUSH2 0xDE SWAP2 SWAP1 PUSH2 0x136 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xF8 DUP2 PUSH2 0x1E0 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x110 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x11E DUP5 DUP3 DUP6 ADD PUSH2 0xE9 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x130 DUP2 PUSH2 0x1A7 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x14B PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x127 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x15C DUP3 PUSH2 0x1A7 JUMP JUMPDEST SWAP2 POP PUSH2 0x167 DUP4 PUSH2 0x1A7 JUMP JUMPDEST SWAP3 POP DUP3 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SUB DUP3 GT ISZERO PUSH2 0x19C JUMPI PUSH2 0x19B PUSH2 0x1B1 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 0x1E9 DUP2 PUSH2 0x1A7 JUMP JUMPDEST DUP2 EQ PUSH2 0x1F4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xC6 GASLIMIT SUB 0xCE RETURNDATACOPY 0xEF 0xE4 PUSH9 0x62370C3B1706BF2EF5 0xE2 0x21 MULMOD DUP5 0xAA PUSH14 0x43D45D735E30FB2BDD64736F6C63 NUMBER STOP ADDMOD DIV STOP CALLER ",
"sourceMap": "70:365:0:-:0;;;126:1;101:26;;70:365;;;;;;;;;;;;;;;;"
},
"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": "608060405234801561001057600080fd5b50600436106100365760003560e01c8063209652551461003b5780635b9af12b14610059575b600080fd5b610043610075565b6040516100509190610136565b60405180910390f35b610073600480360381019061006e91906100fe565b61007e565b005b60008054905090565b8060008082825461008f9190610151565b925050819055503373ffffffffffffffffffffffffffffffffffffffff167f80e3dfc82dac669767f8c28c515c9c0d2dc71547c4462a90bbad6fc3863490ff6000546040516100de9190610136565b60405180910390a250565b6000813590506100f8816101e0565b92915050565b60006020828403121561011057600080fd5b600061011e848285016100e9565b91505092915050565b610130816101a7565b82525050565b600060208201905061014b6000830184610127565b92915050565b600061015c826101a7565b9150610167836101a7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561019c5761019b6101b1565b5b828201905092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6101e9816101a7565b81146101f457600080fd5b5056fea2646970667358221220c64503ce3eefe46862370c3b1706bf2ef5e2210984aa6d43d45d735e30fb2bdd64736f6c63430008040033",
"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 0x20965255 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x5B9AF12B EQ PUSH2 0x59 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x75 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x50 SWAP2 SWAP1 PUSH2 0x136 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 0xFE JUMP JUMPDEST PUSH2 0x7E JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 POP SWAP1 JUMP JUMPDEST DUP1 PUSH1 0x0 DUP1 DUP3 DUP3 SLOAD PUSH2 0x8F SWAP2 SWAP1 PUSH2 0x151 JUMP JUMPDEST SWAP3 POP POP DUP2 SWAP1 SSTORE POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x80E3DFC82DAC669767F8C28C515C9C0D2DC71547C4462A90BBAD6FC3863490FF PUSH1 0x0 SLOAD PUSH1 0x40 MLOAD PUSH2 0xDE SWAP2 SWAP1 PUSH2 0x136 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xF8 DUP2 PUSH2 0x1E0 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x110 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x11E DUP5 DUP3 DUP6 ADD PUSH2 0xE9 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x130 DUP2 PUSH2 0x1A7 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x14B PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x127 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x15C DUP3 PUSH2 0x1A7 JUMP JUMPDEST SWAP2 POP PUSH2 0x167 DUP4 PUSH2 0x1A7 JUMP JUMPDEST SWAP3 POP DUP3 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SUB DUP3 GT ISZERO PUSH2 0x19C JUMPI PUSH2 0x19B PUSH2 0x1B1 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 0x1E9 DUP2 PUSH2 0x1A7 JUMP JUMPDEST DUP2 EQ PUSH2 0x1F4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xC6 GASLIMIT SUB 0xCE RETURNDATACOPY 0xEF 0xE4 PUSH9 0x62370C3B1706BF2EF5 0xE2 0x21 MULMOD DUP5 0xAA PUSH14 0x43D45D735E30FB2BDD64736F6C63 NUMBER STOP ADDMOD DIV STOP CALLER ",
"sourceMap": "70:365:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;354:79;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;227:117;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;354:79;394:7;420:6;;413:13;;354:79;:::o;227:117::-;287:5;277:6;;:15;;;;;;;:::i;:::-;;;;;;;;318:10;307:30;;;330:6;;307:30;;;;;;:::i;:::-;;;;;;;;227:117;:::o;7:139:1:-;53:5;91:6;78:20;69:29;;107:33;134:5;107:33;:::i;:::-;59:87;;;;:::o;152:262::-;211:6;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::-;637:4;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::-;812:3;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::-;1120:7;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": "111400",
"executionCost": "5165",
"totalCost": "116565"
},
"external": {
"addValue(uint256)": "infinite",
"getValue()": "1115"
}
},
"methodIdentifiers": {
"addValue(uint256)": "5b9af12b",
"getValue()": "20965255"
}
},
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "valueAdded",
"type": "event"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "addValue",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getValue",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.4+commit.c7e474f2"
},
"language": "Solidity",
"output": {
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "valueAdded",
"type": "event"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "addValue",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getValue",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/hello-world.sol": "HelloWorld"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"contracts/hello-world.sol": {
"keccak256": "0xcbb791fc7d708f71549eb5dc450e597e6311c67f820e808fa7892117735c46e7",
"license": "GPL-3.0",
"urls": [
"bzz-raw://6e7b491901a4a08a74490a0434f3a0848219ac5a5efbf31cac571efc0620d4d3",
"dweb:/ipfs/QmeSeCJAqSx7g4mcB52xgNFJYmtDtHvbcLdMbNKsJnnQ8r"
]
}
},
"version": 1
}
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract HelloWorld {
uint256 private _value = 0;
event valueAdded (
address indexed sender,
uint256 value
);
function addValue(uint256 value) public {
_value += value;
emit valueAdded(msg.sender, _value);
}
function getValue() public view returns(uint256) {
return _value;
}
}
// Right click on the script name and hit "Run" to execute
(async () => {
try {
console.log('Running deployWithEthers script...')
const contractName = 'Storage' // Change this for other contract
const constructorArgs = [] // Put constructor args (if any) here for your contract
// Note that the script needs the ABI which is generated from the compilation artifact.
// Make sure contract is compiled and artifacts are generated
const artifactsPath = `browser/contracts/artifacts/${contractName}.json` // Change this for different path
const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath))
// 'web3Provider' is a remix global variable object
const signer = (new ethers.providers.Web3Provider(web3Provider)).getSigner()
let factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer);
let contract = await factory.deploy(...constructorArgs);
console.log('Contract Address: ', contract.address);
// The contract is NOT deployed yet; we must wait until it is mined
await contract.deployed()
console.log('Deployment successful.')
} catch (e) {
console.log(e.message)
}
})()
// Right click on the script name and hit "Run" to execute
(async () => {
try {
console.log('Running deployWithWeb3 script...')
const contractName = 'Storage' // Change this for other contract
const constructorArgs = [] // Put constructor args (if any) here for your contract
// Note that the script needs the ABI which is generated from the compilation artifact.
// Make sure contract is compiled and artifacts are generated
const artifactsPath = `browser/contracts/artifacts/${contractName}.json` // Change this for different path
const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath))
const accounts = await web3.eth.getAccounts()
let contract = new web3.eth.Contract(metadata.abi)
contract = contract.deploy({
data: metadata.data.bytecode.object,
arguments: constructorArgs
})
const newContractInstance = await contract.send({
from: accounts[0],
gas: 1500000,
gasPrice: '30000000000'
})
console.log('Contract deployed at address: ', newContractInstance.options.address)
} catch (e) {
console.log(e.message)
}
})()
{
"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
},
"görli:5": {
"linkReferences": {},
"autoDeployLib": true
},
"Custom": {
"linkReferences": {},
"autoDeployLib": true
}
},
"data": {
"bytecode": {
"generatedSources": [],
"linkReferences": {},
"object": "60806040526000805534801561001457600080fd5b5061022d806100246000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063209652551461003b5780635b9af12b14610059575b600080fd5b610043610075565b6040516100509190610136565b60405180910390f35b610073600480360381019061006e91906100fe565b61007e565b005b60008054905090565b8060008082825461008f9190610151565b925050819055503373ffffffffffffffffffffffffffffffffffffffff167f80e3dfc82dac669767f8c28c515c9c0d2dc71547c4462a90bbad6fc3863490ff6000546040516100de9190610136565b60405180910390a250565b6000813590506100f8816101e0565b92915050565b60006020828403121561011057600080fd5b600061011e848285016100e9565b91505092915050565b610130816101a7565b82525050565b600060208201905061014b6000830184610127565b92915050565b600061015c826101a7565b9150610167836101a7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561019c5761019b6101b1565b5b828201905092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6101e9816101a7565b81146101f457600080fd5b5056fea2646970667358221220c64503ce3eefe46862370c3b1706bf2ef5e2210984aa6d43d45d735e30fb2bdd64736f6c63430008040033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 SSTORE CALLVALUE DUP1 ISZERO PUSH2 0x14 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x22D DUP1 PUSH2 0x24 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 0x20965255 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x5B9AF12B EQ PUSH2 0x59 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x75 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x50 SWAP2 SWAP1 PUSH2 0x136 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 0xFE JUMP JUMPDEST PUSH2 0x7E JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 POP SWAP1 JUMP JUMPDEST DUP1 PUSH1 0x0 DUP1 DUP3 DUP3 SLOAD PUSH2 0x8F SWAP2 SWAP1 PUSH2 0x151 JUMP JUMPDEST SWAP3 POP POP DUP2 SWAP1 SSTORE POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x80E3DFC82DAC669767F8C28C515C9C0D2DC71547C4462A90BBAD6FC3863490FF PUSH1 0x0 SLOAD PUSH1 0x40 MLOAD PUSH2 0xDE SWAP2 SWAP1 PUSH2 0x136 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xF8 DUP2 PUSH2 0x1E0 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x110 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x11E DUP5 DUP3 DUP6 ADD PUSH2 0xE9 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x130 DUP2 PUSH2 0x1A7 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x14B PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x127 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x15C DUP3 PUSH2 0x1A7 JUMP JUMPDEST SWAP2 POP PUSH2 0x167 DUP4 PUSH2 0x1A7 JUMP JUMPDEST SWAP3 POP DUP3 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SUB DUP3 GT ISZERO PUSH2 0x19C JUMPI PUSH2 0x19B PUSH2 0x1B1 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 0x1E9 DUP2 PUSH2 0x1A7 JUMP JUMPDEST DUP2 EQ PUSH2 0x1F4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xC6 GASLIMIT SUB 0xCE RETURNDATACOPY 0xEF 0xE4 PUSH9 0x62370C3B1706BF2EF5 0xE2 0x21 MULMOD DUP5 0xAA PUSH14 0x43D45D735E30FB2BDD64736F6C63 NUMBER STOP ADDMOD DIV STOP CALLER ",
"sourceMap": "70:365:0:-:0;;;126:1;101:26;;70:365;;;;;;;;;;;;;;;;"
},
"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": "608060405234801561001057600080fd5b50600436106100365760003560e01c8063209652551461003b5780635b9af12b14610059575b600080fd5b610043610075565b6040516100509190610136565b60405180910390f35b610073600480360381019061006e91906100fe565b61007e565b005b60008054905090565b8060008082825461008f9190610151565b925050819055503373ffffffffffffffffffffffffffffffffffffffff167f80e3dfc82dac669767f8c28c515c9c0d2dc71547c4462a90bbad6fc3863490ff6000546040516100de9190610136565b60405180910390a250565b6000813590506100f8816101e0565b92915050565b60006020828403121561011057600080fd5b600061011e848285016100e9565b91505092915050565b610130816101a7565b82525050565b600060208201905061014b6000830184610127565b92915050565b600061015c826101a7565b9150610167836101a7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561019c5761019b6101b1565b5b828201905092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6101e9816101a7565b81146101f457600080fd5b5056fea2646970667358221220c64503ce3eefe46862370c3b1706bf2ef5e2210984aa6d43d45d735e30fb2bdd64736f6c63430008040033",
"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 0x20965255 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x5B9AF12B EQ PUSH2 0x59 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x75 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x50 SWAP2 SWAP1 PUSH2 0x136 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 0xFE JUMP JUMPDEST PUSH2 0x7E JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 POP SWAP1 JUMP JUMPDEST DUP1 PUSH1 0x0 DUP1 DUP3 DUP3 SLOAD PUSH2 0x8F SWAP2 SWAP1 PUSH2 0x151 JUMP JUMPDEST SWAP3 POP POP DUP2 SWAP1 SSTORE POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x80E3DFC82DAC669767F8C28C515C9C0D2DC71547C4462A90BBAD6FC3863490FF PUSH1 0x0 SLOAD PUSH1 0x40 MLOAD PUSH2 0xDE SWAP2 SWAP1 PUSH2 0x136 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xF8 DUP2 PUSH2 0x1E0 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x110 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x11E DUP5 DUP3 DUP6 ADD PUSH2 0xE9 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x130 DUP2 PUSH2 0x1A7 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x14B PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x127 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x15C DUP3 PUSH2 0x1A7 JUMP JUMPDEST SWAP2 POP PUSH2 0x167 DUP4 PUSH2 0x1A7 JUMP JUMPDEST SWAP3 POP DUP3 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SUB DUP3 GT ISZERO PUSH2 0x19C JUMPI PUSH2 0x19B PUSH2 0x1B1 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 0x1E9 DUP2 PUSH2 0x1A7 JUMP JUMPDEST DUP2 EQ PUSH2 0x1F4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xC6 GASLIMIT SUB 0xCE RETURNDATACOPY 0xEF 0xE4 PUSH9 0x62370C3B1706BF2EF5 0xE2 0x21 MULMOD DUP5 0xAA PUSH14 0x43D45D735E30FB2BDD64736F6C63 NUMBER STOP ADDMOD DIV STOP CALLER ",
"sourceMap": "70:365:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;354:79;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;227:117;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;354:79;394:7;420:6;;413:13;;354:79;:::o;227:117::-;287:5;277:6;;:15;;;;;;;:::i;:::-;;;;;;;;318:10;307:30;;;330:6;;307:30;;;;;;:::i;:::-;;;;;;;;227:117;:::o;7:139:1:-;53:5;91:6;78:20;69:29;;107:33;134:5;107:33;:::i;:::-;59:87;;;;:::o;152:262::-;211:6;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::-;637:4;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::-;812:3;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::-;1120:7;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": "111400",
"executionCost": "5165",
"totalCost": "116565"
},
"external": {
"addValue(uint256)": "infinite",
"getValue()": "1115"
}
},
"methodIdentifiers": {
"addValue(uint256)": "5b9af12b",
"getValue()": "20965255"
}
},
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "valueAdded",
"type": "event"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "addValue",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getValue",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.4+commit.c7e474f2"
},
"language": "Solidity",
"output": {
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "valueAdded",
"type": "event"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "addValue",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getValue",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/hello-world.sol": "HelloWorld"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"contracts/hello-world.sol": {
"keccak256": "0xcbb791fc7d708f71549eb5dc450e597e6311c67f820e808fa7892117735c46e7",
"license": "GPL-3.0",
"urls": [
"bzz-raw://6e7b491901a4a08a74490a0434f3a0848219ac5a5efbf31cac571efc0620d4d3",
"dweb:/ipfs/QmeSeCJAqSx7g4mcB52xgNFJYmtDtHvbcLdMbNKsJnnQ8r"
]
}
},
"version": 1
}
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
import "remix_tests.sol"; // this import is automatically injected by Remix.
import "../contracts/hello-world.sol";
contract BallotTest {
HelloWorld hw;
function beforeAll () public {
hw = new HelloWorld();
}
function initialValueIsZero () public {
Assert.equal(hw.getValue(), uint256(0), "invalid initial state");
}
function valueAdded () public {
hw.addValue(99);
Assert.equal(hw.getValue(), uint256(99), "value weren't added");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment