Skip to content

Instantly share code, notes, and snippets.

@jeremyroman
Created May 4, 2021 01:47
Show Gist options
  • Save jeremyroman/741ce79e6c320612186b1c5fa0edecf1 to your computer and use it in GitHub Desktop.
Save jeremyroman/741ce79e6c320612186b1c5fa0edecf1 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.1+commit.df193b15.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": [
{
"ast": {
"nodeType": "YulBlock",
"src": "0:326:4",
"statements": [
{
"nodeType": "YulBlock",
"src": "6:3:4",
"statements": []
},
{
"body": {
"nodeType": "YulBlock",
"src": "95:229:4",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "141:26:4",
"statements": [
{
"expression": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "150:6:4"
},
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "158:6:4"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "143:6:4"
},
"nodeType": "YulFunctionCall",
"src": "143:22:4"
},
"nodeType": "YulExpressionStatement",
"src": "143:22:4"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "116:7:4"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "125:9:4"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "112:3:4"
},
"nodeType": "YulFunctionCall",
"src": "112:23:4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "137:2:4",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "slt",
"nodeType": "YulIdentifier",
"src": "108:3:4"
},
"nodeType": "YulFunctionCall",
"src": "108:32:4"
},
"nodeType": "YulIf",
"src": "105:2:4"
},
{
"nodeType": "YulVariableDeclaration",
"src": "176:29:4",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "195:9:4"
}
],
"functionName": {
"name": "mload",
"nodeType": "YulIdentifier",
"src": "189:5:4"
},
"nodeType": "YulFunctionCall",
"src": "189:16:4"
},
"variables": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "180:5:4",
"type": ""
}
]
},
{
"body": {
"nodeType": "YulBlock",
"src": "268:26:4",
"statements": [
{
"expression": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "277:6:4"
},
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "285:6:4"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "270:6:4"
},
"nodeType": "YulFunctionCall",
"src": "270:22:4"
},
"nodeType": "YulExpressionStatement",
"src": "270:22:4"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "227:5:4"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "238:5:4"
},
{
"arguments": [
{
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "253:3:4",
"type": "",
"value": "160"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "258:1:4",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "shl",
"nodeType": "YulIdentifier",
"src": "249:3:4"
},
"nodeType": "YulFunctionCall",
"src": "249:11:4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "262:1:4",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "245:3:4"
},
"nodeType": "YulFunctionCall",
"src": "245:19:4"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "234:3:4"
},
"nodeType": "YulFunctionCall",
"src": "234:31:4"
}
],
"functionName": {
"name": "eq",
"nodeType": "YulIdentifier",
"src": "224:2:4"
},
"nodeType": "YulFunctionCall",
"src": "224:42:4"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "217:6:4"
},
"nodeType": "YulFunctionCall",
"src": "217:50:4"
},
"nodeType": "YulIf",
"src": "214:2:4"
},
{
"nodeType": "YulAssignment",
"src": "303:15:4",
"value": {
"name": "value",
"nodeType": "YulIdentifier",
"src": "313:5:4"
},
"variableNames": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "303:6:4"
}
]
}
]
},
"name": "abi_decode_tuple_t_address_fromMemory",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "61:9:4",
"type": ""
},
{
"name": "dataEnd",
"nodeType": "YulTypedName",
"src": "72:7:4",
"type": ""
}
],
"returnVariables": [
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "84:6:4",
"type": ""
}
],
"src": "14:310:4"
}
]
},
"contents": "{\n { }\n function abi_decode_tuple_t_address_fromMemory(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(value0, value0) }\n let value := mload(headStart)\n if iszero(eq(value, and(value, sub(shl(160, 1), 1)))) { revert(value0, value0) }\n value0 := value\n }\n}",
"id": 4,
"language": "Yul",
"name": "#utility.yul"
}
],
"linkReferences": {},
"object": "60a0604052624f1a0060015560001960025534801561001d57600080fd5b506040516108ca3803806108ca83398101604081905261003c916100bf565b3360601b60805261004c81610052565b506100ed565b6000546001600160a01b038281169116146100bc57600080546040516001600160a01b03808516939216917f768099735d1c322a05a5b9d7b76d99682a1833d3f7055e5ede25e0f2eeaa8c6d91a3600080546001600160a01b0319166001600160a01b0383161790555b50565b6000602082840312156100d0578081fd5b81516001600160a01b03811681146100e6578182fd5b9392505050565b60805160601c61077961015160003960008181610117015281816101a60152818161023c0152818161027b015281816102b201528181610328015281816103cb01528181610444015281816104fa0152818161057001526105f001526107796000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c8063a1db978211610071578063a1db978214610139578063a69df4b51461015c578063aa082a9d14610164578063dc0706571461016d578063f3e414f814610180578063f83d08ba1461019357600080fd5b80630519da32146100ae57806338af3eed146100ca5780634dafe21d146100f557806383197ef01461010a5780638da5cb5b14610112575b600080fd5b6100b760015481565b6040519081526020015b60405180910390f35b6000546100dd906001600160a01b031681565b6040516001600160a01b0390911681526020016100c1565b610108610103366004610707565b61019b565b005b610108610231565b6100dd7f000000000000000000000000000000000000000000000000000000000000000081565b61014c6101473660046106be565b6102a5565b60405190151581526020016100c1565b6101086103c0565b6100b760025481565b61010861017b3660046106a4565b610439565b61010861018e3660046106be565b6104ef565b6101086105e5565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146101e3576040516282b42960e81b815260040160405180910390fd5b806001541461022e5760015460408051918252602082018390527fdcace7f1f80d98250e2a4be8026783cd9c970e6ff4c3c1f22ecddfe0bcffe1bb910160405180910390a160018190555b50565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610279576040516282b42960e81b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316ff5b6000336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806102f557506000546001600160a01b0316331480156102f557506002544210155b610311576040516282b42960e81b815260040160405180910390fd5b6040516323b872dd60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152336024830152604482018490528416906323b872dd90606401602060405180830381600087803b15801561038157600080fd5b505af1158015610395573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b991906106e7565b9392505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480159061040457506000546001600160a01b03163314155b15610421576040516282b42960e81b815260040160405180910390fd5b61043760015442610432919061071f565b61064d565b565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610481576040516282b42960e81b815260040160405180910390fd5b6000546001600160a01b0382811691161461022e57600080546040516001600160a01b03808516939216917f768099735d1c322a05a5b9d7b76d99682a1833d3f7055e5ede25e0f2eeaa8c6d91a3600080546001600160a01b0383166001600160a01b031990911617905550565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061053d57506000546001600160a01b03163314801561053d57506002544210155b610559576040516282b42960e81b815260040160405180910390fd5b604051632142170760e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152336024830152604482018390528316906342842e0e90606401600060405180830381600087803b1580156105c957600080fd5b505af11580156105dd573d6000803e3d6000fd5b505050505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480159061062957506000546001600160a01b03163314155b15610646576040516282b42960e81b815260040160405180910390fd5b6104376000195b60028190556040518181527f161a157b96e5ccf8b82f1fef24d328ea796c0e604b770d9ffd5bbceaa4af1e149060200160405180910390a150565b80356001600160a01b038116811461069f57600080fd5b919050565b6000602082840312156106b5578081fd5b6103b982610688565b600080604083850312156106d0578081fd5b6106d983610688565b946020939093013593505050565b6000602082840312156106f8578081fd5b815180151581146103b9578182fd5b600060208284031215610718578081fd5b5035919050565b6000821982111561073e57634e487b7160e01b81526011600452602481fd5b50019056fea264697066735822122008e8fdd2569502d58f70327c4db71decf983f998207faf1374a56c73c78d529564736f6c63430008040033",
"opcodes": "PUSH1 0xA0 PUSH1 0x40 MSTORE PUSH3 0x4F1A00 PUSH1 0x1 SSTORE PUSH1 0x0 NOT PUSH1 0x2 SSTORE CALLVALUE DUP1 ISZERO PUSH2 0x1D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH2 0x8CA CODESIZE SUB DUP1 PUSH2 0x8CA DUP4 CODECOPY DUP2 ADD PUSH1 0x40 DUP2 SWAP1 MSTORE PUSH2 0x3C SWAP2 PUSH2 0xBF JUMP JUMPDEST CALLER PUSH1 0x60 SHL PUSH1 0x80 MSTORE PUSH2 0x4C DUP2 PUSH2 0x52 JUMP JUMPDEST POP PUSH2 0xED JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 DUP2 AND SWAP2 AND EQ PUSH2 0xBC JUMPI PUSH1 0x0 DUP1 SLOAD PUSH1 0x40 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP1 DUP6 AND SWAP4 SWAP3 AND SWAP2 PUSH32 0x768099735D1C322A05A5B9D7B76D99682A1833D3F7055E5EDE25E0F2EEAA8C6D SWAP2 LOG3 PUSH1 0x0 DUP1 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT AND PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 AND OR SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xD0 JUMPI DUP1 DUP2 REVERT JUMPDEST DUP2 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND DUP2 EQ PUSH2 0xE6 JUMPI DUP2 DUP3 REVERT JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x80 MLOAD PUSH1 0x60 SHR PUSH2 0x779 PUSH2 0x151 PUSH1 0x0 CODECOPY PUSH1 0x0 DUP2 DUP2 PUSH2 0x117 ADD MSTORE DUP2 DUP2 PUSH2 0x1A6 ADD MSTORE DUP2 DUP2 PUSH2 0x23C ADD MSTORE DUP2 DUP2 PUSH2 0x27B ADD MSTORE DUP2 DUP2 PUSH2 0x2B2 ADD MSTORE DUP2 DUP2 PUSH2 0x328 ADD MSTORE DUP2 DUP2 PUSH2 0x3CB ADD MSTORE DUP2 DUP2 PUSH2 0x444 ADD MSTORE DUP2 DUP2 PUSH2 0x4FA ADD MSTORE DUP2 DUP2 PUSH2 0x570 ADD MSTORE PUSH2 0x5F0 ADD MSTORE PUSH2 0x779 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 0xA9 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0xA1DB9782 GT PUSH2 0x71 JUMPI DUP1 PUSH4 0xA1DB9782 EQ PUSH2 0x139 JUMPI DUP1 PUSH4 0xA69DF4B5 EQ PUSH2 0x15C JUMPI DUP1 PUSH4 0xAA082A9D EQ PUSH2 0x164 JUMPI DUP1 PUSH4 0xDC070657 EQ PUSH2 0x16D JUMPI DUP1 PUSH4 0xF3E414F8 EQ PUSH2 0x180 JUMPI DUP1 PUSH4 0xF83D08BA EQ PUSH2 0x193 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH4 0x519DA32 EQ PUSH2 0xAE JUMPI DUP1 PUSH4 0x38AF3EED EQ PUSH2 0xCA JUMPI DUP1 PUSH4 0x4DAFE21D EQ PUSH2 0xF5 JUMPI DUP1 PUSH4 0x83197EF0 EQ PUSH2 0x10A JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x112 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0xB7 PUSH1 0x1 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 SLOAD PUSH2 0xDD SWAP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP1 SWAP2 AND DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0xC1 JUMP JUMPDEST PUSH2 0x108 PUSH2 0x103 CALLDATASIZE PUSH1 0x4 PUSH2 0x707 JUMP JUMPDEST PUSH2 0x19B JUMP JUMPDEST STOP JUMPDEST PUSH2 0x108 PUSH2 0x231 JUMP JUMPDEST PUSH2 0xDD PUSH32 0x0 DUP2 JUMP JUMPDEST PUSH2 0x14C PUSH2 0x147 CALLDATASIZE PUSH1 0x4 PUSH2 0x6BE JUMP JUMPDEST PUSH2 0x2A5 JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0xC1 JUMP JUMPDEST PUSH2 0x108 PUSH2 0x3C0 JUMP JUMPDEST PUSH2 0xB7 PUSH1 0x2 SLOAD DUP2 JUMP JUMPDEST PUSH2 0x108 PUSH2 0x17B CALLDATASIZE PUSH1 0x4 PUSH2 0x6A4 JUMP JUMPDEST PUSH2 0x439 JUMP JUMPDEST PUSH2 0x108 PUSH2 0x18E CALLDATASIZE PUSH1 0x4 PUSH2 0x6BE JUMP JUMPDEST PUSH2 0x4EF JUMP JUMPDEST PUSH2 0x108 PUSH2 0x5E5 JUMP JUMPDEST CALLER PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB PUSH32 0x0 AND EQ PUSH2 0x1E3 JUMPI PUSH1 0x40 MLOAD PUSH3 0x82B429 PUSH1 0xE8 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP1 PUSH1 0x1 SLOAD EQ PUSH2 0x22E JUMPI PUSH1 0x1 SLOAD PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE PUSH1 0x20 DUP3 ADD DUP4 SWAP1 MSTORE PUSH32 0xDCACE7F1F80D98250E2A4BE8026783CD9C970E6FF4C3C1F22ECDDFE0BCFFE1BB SWAP2 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 PUSH1 0x1 DUP2 SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST CALLER PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB PUSH32 0x0 AND EQ PUSH2 0x279 JUMPI PUSH1 0x40 MLOAD PUSH3 0x82B429 PUSH1 0xE8 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH32 0x0 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND SELFDESTRUCT JUMPDEST PUSH1 0x0 CALLER PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB PUSH32 0x0 AND EQ DUP1 PUSH2 0x2F5 JUMPI POP PUSH1 0x0 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ DUP1 ISZERO PUSH2 0x2F5 JUMPI POP PUSH1 0x2 SLOAD TIMESTAMP LT ISZERO JUMPDEST PUSH2 0x311 JUMPI PUSH1 0x40 MLOAD PUSH3 0x82B429 PUSH1 0xE8 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x40 MLOAD PUSH4 0x23B872DD PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB PUSH32 0x0 DUP2 AND PUSH1 0x4 DUP4 ADD MSTORE CALLER PUSH1 0x24 DUP4 ADD MSTORE PUSH1 0x44 DUP3 ADD DUP5 SWAP1 MSTORE DUP5 AND SWAP1 PUSH4 0x23B872DD SWAP1 PUSH1 0x64 ADD PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x381 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x395 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x3B9 SWAP2 SWAP1 PUSH2 0x6E7 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB PUSH32 0x0 AND EQ DUP1 ISZERO SWAP1 PUSH2 0x404 JUMPI POP PUSH1 0x0 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ ISZERO JUMPDEST ISZERO PUSH2 0x421 JUMPI PUSH1 0x40 MLOAD PUSH3 0x82B429 PUSH1 0xE8 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x437 PUSH1 0x1 SLOAD TIMESTAMP PUSH2 0x432 SWAP2 SWAP1 PUSH2 0x71F JUMP JUMPDEST PUSH2 0x64D JUMP JUMPDEST JUMP JUMPDEST CALLER PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB PUSH32 0x0 AND EQ PUSH2 0x481 JUMPI PUSH1 0x40 MLOAD PUSH3 0x82B429 PUSH1 0xE8 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 DUP2 AND SWAP2 AND EQ PUSH2 0x22E JUMPI PUSH1 0x0 DUP1 SLOAD PUSH1 0x40 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP1 DUP6 AND SWAP4 SWAP3 AND SWAP2 PUSH32 0x768099735D1C322A05A5B9D7B76D99682A1833D3F7055E5EDE25E0F2EEAA8C6D SWAP2 LOG3 PUSH1 0x0 DUP1 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 AND PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT SWAP1 SWAP2 AND OR SWAP1 SSTORE POP JUMP JUMPDEST CALLER PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB PUSH32 0x0 AND EQ DUP1 PUSH2 0x53D JUMPI POP PUSH1 0x0 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ DUP1 ISZERO PUSH2 0x53D JUMPI POP PUSH1 0x2 SLOAD TIMESTAMP LT ISZERO JUMPDEST PUSH2 0x559 JUMPI PUSH1 0x40 MLOAD PUSH3 0x82B429 PUSH1 0xE8 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x40 MLOAD PUSH4 0x21421707 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB PUSH32 0x0 DUP2 AND PUSH1 0x4 DUP4 ADD MSTORE CALLER PUSH1 0x24 DUP4 ADD MSTORE PUSH1 0x44 DUP3 ADD DUP4 SWAP1 MSTORE DUP4 AND SWAP1 PUSH4 0x42842E0E SWAP1 PUSH1 0x64 ADD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x5C9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x5DD JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST CALLER PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB PUSH32 0x0 AND EQ DUP1 ISZERO SWAP1 PUSH2 0x629 JUMPI POP PUSH1 0x0 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ ISZERO JUMPDEST ISZERO PUSH2 0x646 JUMPI PUSH1 0x40 MLOAD PUSH3 0x82B429 PUSH1 0xE8 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x437 PUSH1 0x0 NOT JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE PUSH1 0x40 MLOAD DUP2 DUP2 MSTORE PUSH32 0x161A157B96E5CCF8B82F1FEF24D328EA796C0E604B770D9FFD5BBCEAA4AF1E14 SWAP1 PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP JUMP JUMPDEST DUP1 CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND DUP2 EQ PUSH2 0x69F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x6B5 JUMPI DUP1 DUP2 REVERT JUMPDEST PUSH2 0x3B9 DUP3 PUSH2 0x688 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x6D0 JUMPI DUP1 DUP2 REVERT JUMPDEST PUSH2 0x6D9 DUP4 PUSH2 0x688 JUMP JUMPDEST SWAP5 PUSH1 0x20 SWAP4 SWAP1 SWAP4 ADD CALLDATALOAD SWAP4 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x6F8 JUMPI DUP1 DUP2 REVERT JUMPDEST DUP2 MLOAD DUP1 ISZERO ISZERO DUP2 EQ PUSH2 0x3B9 JUMPI DUP2 DUP3 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x718 JUMPI DUP1 DUP2 REVERT JUMPDEST POP CALLDATALOAD SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP3 NOT DUP3 GT ISZERO PUSH2 0x73E JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 DUP2 REVERT JUMPDEST POP ADD SWAP1 JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 ADDMOD 0xE8 REVERT 0xD2 JUMP SWAP6 MUL 0xD5 DUP16 PUSH17 0x327C4DB71DECF983F998207FAF1374A56C PUSH20 0xC78D529564736F6C634300080400330000000000 ",
"sourceMap": "234:2568:0:-:0;;;366:7;340:33;;-1:-1:-1;;379:44:0;;1144:117;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1204:10;1188:27;;;;1225:29;1241:12;1225:15;:29::i;:::-;1144:117;234:2568;;2421:232;2494:11;;-1:-1:-1;;;;;2494:30:0;;;:11;;:30;2490:157;;2564:11;;;2545:48;;-1:-1:-1;;;;;2545:48:0;;;;2564:11;;;2545:48;;;2607:11;:29;;-1:-1:-1;;;;;;2607:29:0;-1:-1:-1;;;;;2607:29:0;;;;;2490:157;2421:232;:::o;14:310:4:-;84:6;137:2;125:9;116:7;112:23;108:32;105:2;;;158:6;150;143:22;105:2;189:16;;-1:-1:-1;;;;;234:31:4;;224:42;;214:2;;285:6;277;270:22;214:2;313:5;95:229;-1:-1:-1;;;95:229:4:o;:::-;234:2568:0;;;;;;;;;;;;"
},
"deployedBytecode": {
"generatedSources": [
{
"ast": {
"nodeType": "YulBlock",
"src": "0:2837:4",
"statements": [
{
"nodeType": "YulBlock",
"src": "6:3:4",
"statements": []
},
{
"body": {
"nodeType": "YulBlock",
"src": "63:124:4",
"statements": [
{
"nodeType": "YulAssignment",
"src": "73:29:4",
"value": {
"arguments": [
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "95:6:4"
}
],
"functionName": {
"name": "calldataload",
"nodeType": "YulIdentifier",
"src": "82:12:4"
},
"nodeType": "YulFunctionCall",
"src": "82:20:4"
},
"variableNames": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "73:5:4"
}
]
},
{
"body": {
"nodeType": "YulBlock",
"src": "165:16:4",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "174:1:4",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "177:1:4",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "167:6:4"
},
"nodeType": "YulFunctionCall",
"src": "167:12:4"
},
"nodeType": "YulExpressionStatement",
"src": "167:12:4"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "124:5:4"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "135:5:4"
},
{
"arguments": [
{
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "150:3:4",
"type": "",
"value": "160"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "155:1:4",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "shl",
"nodeType": "YulIdentifier",
"src": "146:3:4"
},
"nodeType": "YulFunctionCall",
"src": "146:11:4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "159:1:4",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "142:3:4"
},
"nodeType": "YulFunctionCall",
"src": "142:19:4"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "131:3:4"
},
"nodeType": "YulFunctionCall",
"src": "131:31:4"
}
],
"functionName": {
"name": "eq",
"nodeType": "YulIdentifier",
"src": "121:2:4"
},
"nodeType": "YulFunctionCall",
"src": "121:42:4"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "114:6:4"
},
"nodeType": "YulFunctionCall",
"src": "114:50:4"
},
"nodeType": "YulIf",
"src": "111:2:4"
}
]
},
"name": "abi_decode_address",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "42:6:4",
"type": ""
}
],
"returnVariables": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "53:5:4",
"type": ""
}
],
"src": "14:173:4"
},
{
"body": {
"nodeType": "YulBlock",
"src": "262:126:4",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "308:26:4",
"statements": [
{
"expression": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "317:6:4"
},
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "325:6:4"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "310:6:4"
},
"nodeType": "YulFunctionCall",
"src": "310:22:4"
},
"nodeType": "YulExpressionStatement",
"src": "310:22:4"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "283:7:4"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "292:9:4"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "279:3:4"
},
"nodeType": "YulFunctionCall",
"src": "279:23:4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "304:2:4",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "slt",
"nodeType": "YulIdentifier",
"src": "275:3:4"
},
"nodeType": "YulFunctionCall",
"src": "275:32:4"
},
"nodeType": "YulIf",
"src": "272:2:4"
},
{
"nodeType": "YulAssignment",
"src": "343:39:4",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "372:9:4"
}
],
"functionName": {
"name": "abi_decode_address",
"nodeType": "YulIdentifier",
"src": "353:18:4"
},
"nodeType": "YulFunctionCall",
"src": "353:29:4"
},
"variableNames": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "343:6:4"
}
]
}
]
},
"name": "abi_decode_tuple_t_address",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "228:9:4",
"type": ""
},
{
"name": "dataEnd",
"nodeType": "YulTypedName",
"src": "239:7:4",
"type": ""
}
],
"returnVariables": [
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "251:6:4",
"type": ""
}
],
"src": "192:196:4"
},
{
"body": {
"nodeType": "YulBlock",
"src": "480:177:4",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "526:26:4",
"statements": [
{
"expression": {
"arguments": [
{
"name": "value1",
"nodeType": "YulIdentifier",
"src": "535:6:4"
},
{
"name": "value1",
"nodeType": "YulIdentifier",
"src": "543:6:4"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "528:6:4"
},
"nodeType": "YulFunctionCall",
"src": "528:22:4"
},
"nodeType": "YulExpressionStatement",
"src": "528:22:4"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "501:7:4"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "510:9:4"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "497:3:4"
},
"nodeType": "YulFunctionCall",
"src": "497:23:4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "522:2:4",
"type": "",
"value": "64"
}
],
"functionName": {
"name": "slt",
"nodeType": "YulIdentifier",
"src": "493:3:4"
},
"nodeType": "YulFunctionCall",
"src": "493:32:4"
},
"nodeType": "YulIf",
"src": "490:2:4"
},
{
"nodeType": "YulAssignment",
"src": "561:39:4",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "590:9:4"
}
],
"functionName": {
"name": "abi_decode_address",
"nodeType": "YulIdentifier",
"src": "571:18:4"
},
"nodeType": "YulFunctionCall",
"src": "571:29:4"
},
"variableNames": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "561:6:4"
}
]
},
{
"nodeType": "YulAssignment",
"src": "609:42:4",
"value": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "636:9:4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "647:2:4",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "632:3:4"
},
"nodeType": "YulFunctionCall",
"src": "632:18:4"
}
],
"functionName": {
"name": "calldataload",
"nodeType": "YulIdentifier",
"src": "619:12:4"
},
"nodeType": "YulFunctionCall",
"src": "619:32:4"
},
"variableNames": [
{
"name": "value1",
"nodeType": "YulIdentifier",
"src": "609:6:4"
}
]
}
]
},
"name": "abi_decode_tuple_t_addresst_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "438:9:4",
"type": ""
},
{
"name": "dataEnd",
"nodeType": "YulTypedName",
"src": "449:7:4",
"type": ""
}
],
"returnVariables": [
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "461:6:4",
"type": ""
},
{
"name": "value1",
"nodeType": "YulTypedName",
"src": "469:6:4",
"type": ""
}
],
"src": "393:264:4"
},
{
"body": {
"nodeType": "YulBlock",
"src": "740:219:4",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "786:26:4",
"statements": [
{
"expression": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "795:6:4"
},
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "803:6:4"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "788:6:4"
},
"nodeType": "YulFunctionCall",
"src": "788:22:4"
},
"nodeType": "YulExpressionStatement",
"src": "788:22:4"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "761:7:4"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "770:9:4"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "757:3:4"
},
"nodeType": "YulFunctionCall",
"src": "757:23:4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "782:2:4",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "slt",
"nodeType": "YulIdentifier",
"src": "753:3:4"
},
"nodeType": "YulFunctionCall",
"src": "753:32:4"
},
"nodeType": "YulIf",
"src": "750:2:4"
},
{
"nodeType": "YulVariableDeclaration",
"src": "821:29:4",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "840:9:4"
}
],
"functionName": {
"name": "mload",
"nodeType": "YulIdentifier",
"src": "834:5:4"
},
"nodeType": "YulFunctionCall",
"src": "834:16:4"
},
"variables": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "825:5:4",
"type": ""
}
]
},
{
"body": {
"nodeType": "YulBlock",
"src": "903:26:4",
"statements": [
{
"expression": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "912:6:4"
},
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "920:6:4"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "905:6:4"
},
"nodeType": "YulFunctionCall",
"src": "905:22:4"
},
"nodeType": "YulExpressionStatement",
"src": "905:22:4"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "872:5:4"
},
{
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "893:5:4"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "886:6:4"
},
"nodeType": "YulFunctionCall",
"src": "886:13:4"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "879:6:4"
},
"nodeType": "YulFunctionCall",
"src": "879:21:4"
}
],
"functionName": {
"name": "eq",
"nodeType": "YulIdentifier",
"src": "869:2:4"
},
"nodeType": "YulFunctionCall",
"src": "869:32:4"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "862:6:4"
},
"nodeType": "YulFunctionCall",
"src": "862:40:4"
},
"nodeType": "YulIf",
"src": "859:2:4"
},
{
"nodeType": "YulAssignment",
"src": "938:15:4",
"value": {
"name": "value",
"nodeType": "YulIdentifier",
"src": "948:5:4"
},
"variableNames": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "938:6:4"
}
]
}
]
},
"name": "abi_decode_tuple_t_bool_fromMemory",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "706:9:4",
"type": ""
},
{
"name": "dataEnd",
"nodeType": "YulTypedName",
"src": "717:7:4",
"type": ""
}
],
"returnVariables": [
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "729:6:4",
"type": ""
}
],
"src": "662:297:4"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1034:120:4",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "1080:26:4",
"statements": [
{
"expression": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "1089:6:4"
},
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "1097:6:4"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "1082:6:4"
},
"nodeType": "YulFunctionCall",
"src": "1082:22:4"
},
"nodeType": "YulExpressionStatement",
"src": "1082:22:4"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "1055:7:4"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1064:9:4"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "1051:3:4"
},
"nodeType": "YulFunctionCall",
"src": "1051:23:4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1076:2:4",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "slt",
"nodeType": "YulIdentifier",
"src": "1047:3:4"
},
"nodeType": "YulFunctionCall",
"src": "1047:32:4"
},
"nodeType": "YulIf",
"src": "1044:2:4"
},
{
"nodeType": "YulAssignment",
"src": "1115:33:4",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1138:9:4"
}
],
"functionName": {
"name": "calldataload",
"nodeType": "YulIdentifier",
"src": "1125:12:4"
},
"nodeType": "YulFunctionCall",
"src": "1125:23:4"
},
"variableNames": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "1115:6:4"
}
]
}
]
},
"name": "abi_decode_tuple_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "1000:9:4",
"type": ""
},
{
"name": "dataEnd",
"nodeType": "YulTypedName",
"src": "1011:7:4",
"type": ""
}
],
"returnVariables": [
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "1023:6:4",
"type": ""
}
],
"src": "964:190:4"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1260:102:4",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1270:26:4",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1282:9:4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1293:2:4",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1278:3:4"
},
"nodeType": "YulFunctionCall",
"src": "1278:18:4"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "1270:4:4"
}
]
},
{
"expression": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1312:9:4"
},
{
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "1327:6:4"
},
{
"arguments": [
{
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1343:3:4",
"type": "",
"value": "160"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1348:1:4",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "shl",
"nodeType": "YulIdentifier",
"src": "1339:3:4"
},
"nodeType": "YulFunctionCall",
"src": "1339:11:4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1352:1:4",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "1335:3:4"
},
"nodeType": "YulFunctionCall",
"src": "1335:19:4"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "1323:3:4"
},
"nodeType": "YulFunctionCall",
"src": "1323:32:4"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1305:6:4"
},
"nodeType": "YulFunctionCall",
"src": "1305:51:4"
},
"nodeType": "YulExpressionStatement",
"src": "1305:51:4"
}
]
},
"name": "abi_encode_tuple_t_address__to_t_address__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "1229:9:4",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "1240:6:4",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "1251:4:4",
"type": ""
}
],
"src": "1159:203:4"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1484:102:4",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1494:26:4",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1506:9:4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1517:2:4",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1502:3:4"
},
"nodeType": "YulFunctionCall",
"src": "1502:18:4"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "1494:4:4"
}
]
},
{
"expression": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1536:9:4"
},
{
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "1551:6:4"
},
{
"arguments": [
{
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1567:3:4",
"type": "",
"value": "160"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1572:1:4",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "shl",
"nodeType": "YulIdentifier",
"src": "1563:3:4"
},
"nodeType": "YulFunctionCall",
"src": "1563:11:4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1576:1:4",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "1559:3:4"
},
"nodeType": "YulFunctionCall",
"src": "1559:19:4"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "1547:3:4"
},
"nodeType": "YulFunctionCall",
"src": "1547:32:4"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1529:6:4"
},
"nodeType": "YulFunctionCall",
"src": "1529:51:4"
},
"nodeType": "YulExpressionStatement",
"src": "1529:51:4"
}
]
},
"name": "abi_encode_tuple_t_address_payable__to_t_address_payable__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "1453:9:4",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "1464:6:4",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "1475:4:4",
"type": ""
}
],
"src": "1367:219:4"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1756:218:4",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1766:26:4",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1778:9:4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1789:2:4",
"type": "",
"value": "96"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1774:3:4"
},
"nodeType": "YulFunctionCall",
"src": "1774:18:4"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "1766:4:4"
}
]
},
{
"nodeType": "YulVariableDeclaration",
"src": "1801:29:4",
"value": {
"arguments": [
{
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1819:3:4",
"type": "",
"value": "160"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1824:1:4",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "shl",
"nodeType": "YulIdentifier",
"src": "1815:3:4"
},
"nodeType": "YulFunctionCall",
"src": "1815:11:4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1828:1:4",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "1811:3:4"
},
"nodeType": "YulFunctionCall",
"src": "1811:19:4"
},
"variables": [
{
"name": "_1",
"nodeType": "YulTypedName",
"src": "1805:2:4",
"type": ""
}
]
},
{
"expression": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1846:9:4"
},
{
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "1861:6:4"
},
{
"name": "_1",
"nodeType": "YulIdentifier",
"src": "1869:2:4"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "1857:3:4"
},
"nodeType": "YulFunctionCall",
"src": "1857:15:4"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1839:6:4"
},
"nodeType": "YulFunctionCall",
"src": "1839:34:4"
},
"nodeType": "YulExpressionStatement",
"src": "1839:34:4"
},
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1893:9:4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1904:2:4",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1889:3:4"
},
"nodeType": "YulFunctionCall",
"src": "1889:18:4"
},
{
"arguments": [
{
"name": "value1",
"nodeType": "YulIdentifier",
"src": "1913:6:4"
},
{
"name": "_1",
"nodeType": "YulIdentifier",
"src": "1921:2:4"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "1909:3:4"
},
"nodeType": "YulFunctionCall",
"src": "1909:15:4"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1882:6:4"
},
"nodeType": "YulFunctionCall",
"src": "1882:43:4"
},
"nodeType": "YulExpressionStatement",
"src": "1882:43:4"
},
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1945:9:4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1956:2:4",
"type": "",
"value": "64"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1941:3:4"
},
"nodeType": "YulFunctionCall",
"src": "1941:18:4"
},
{
"name": "value2",
"nodeType": "YulIdentifier",
"src": "1961:6:4"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1934:6:4"
},
"nodeType": "YulFunctionCall",
"src": "1934:34:4"
},
"nodeType": "YulExpressionStatement",
"src": "1934:34:4"
}
]
},
"name": "abi_encode_tuple_t_address_payable_t_address_t_uint256__to_t_address_t_address_t_uint256__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "1709:9:4",
"type": ""
},
{
"name": "value2",
"nodeType": "YulTypedName",
"src": "1720:6:4",
"type": ""
},
{
"name": "value1",
"nodeType": "YulTypedName",
"src": "1728:6:4",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "1736:6:4",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "1747:4:4",
"type": ""
}
],
"src": "1591:383:4"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2074:92:4",
"statements": [
{
"nodeType": "YulAssignment",
"src": "2084:26:4",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "2096:9:4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2107:2:4",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "2092:3:4"
},
"nodeType": "YulFunctionCall",
"src": "2092:18:4"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "2084:4:4"
}
]
},
{
"expression": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "2126:9:4"
},
{
"arguments": [
{
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "2151:6:4"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "2144:6:4"
},
"nodeType": "YulFunctionCall",
"src": "2144:14:4"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "2137:6:4"
},
"nodeType": "YulFunctionCall",
"src": "2137:22:4"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "2119:6:4"
},
"nodeType": "YulFunctionCall",
"src": "2119:41:4"
},
"nodeType": "YulExpressionStatement",
"src": "2119:41:4"
}
]
},
"name": "abi_encode_tuple_t_bool__to_t_bool__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "2043:9:4",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "2054:6:4",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "2065:4:4",
"type": ""
}
],
"src": "1979:187:4"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2272:76:4",
"statements": [
{
"nodeType": "YulAssignment",
"src": "2282:26:4",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "2294:9:4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2305:2:4",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "2290:3:4"
},
"nodeType": "YulFunctionCall",
"src": "2290:18:4"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "2282:4:4"
}
]
},
{
"expression": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "2324:9:4"
},
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "2335:6:4"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "2317:6:4"
},
"nodeType": "YulFunctionCall",
"src": "2317:25:4"
},
"nodeType": "YulExpressionStatement",
"src": "2317:25:4"
}
]
},
"name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "2241:9:4",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "2252:6:4",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "2263:4:4",
"type": ""
}
],
"src": "2171:177:4"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2482:119:4",
"statements": [
{
"nodeType": "YulAssignment",
"src": "2492:26:4",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "2504:9:4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2515:2:4",
"type": "",
"value": "64"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "2500:3:4"
},
"nodeType": "YulFunctionCall",
"src": "2500:18:4"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "2492:4:4"
}
]
},
{
"expression": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "2534:9:4"
},
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "2545:6:4"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "2527:6:4"
},
"nodeType": "YulFunctionCall",
"src": "2527:25:4"
},
"nodeType": "YulExpressionStatement",
"src": "2527:25:4"
},
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "2572:9:4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2583:2:4",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "2568:3:4"
},
"nodeType": "YulFunctionCall",
"src": "2568:18:4"
},
{
"name": "value1",
"nodeType": "YulIdentifier",
"src": "2588:6:4"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "2561:6:4"
},
"nodeType": "YulFunctionCall",
"src": "2561:34:4"
},
"nodeType": "YulExpressionStatement",
"src": "2561:34:4"
}
]
},
"name": "abi_encode_tuple_t_uint256_t_uint256__to_t_uint256_t_uint256__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "2443:9:4",
"type": ""
},
{
"name": "value1",
"nodeType": "YulTypedName",
"src": "2454:6:4",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "2462:6:4",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "2473:4:4",
"type": ""
}
],
"src": "2353:248:4"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2654:181:4",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "2689:115:4",
"statements": [
{
"expression": {
"arguments": [
{
"name": "sum",
"nodeType": "YulIdentifier",
"src": "2710:3:4"
},
{
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2719:3:4",
"type": "",
"value": "224"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2724:10:4",
"type": "",
"value": "0x4e487b71"
}
],
"functionName": {
"name": "shl",
"nodeType": "YulIdentifier",
"src": "2715:3:4"
},
"nodeType": "YulFunctionCall",
"src": "2715:20:4"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "2703:6:4"
},
"nodeType": "YulFunctionCall",
"src": "2703:33:4"
},
"nodeType": "YulExpressionStatement",
"src": "2703:33:4"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2756:1:4",
"type": "",
"value": "4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2759:4:4",
"type": "",
"value": "0x11"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "2749:6:4"
},
"nodeType": "YulFunctionCall",
"src": "2749:15:4"
},
"nodeType": "YulExpressionStatement",
"src": "2749:15:4"
},
{
"expression": {
"arguments": [
{
"name": "sum",
"nodeType": "YulIdentifier",
"src": "2784:3:4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2789:4:4",
"type": "",
"value": "0x24"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "2777:6:4"
},
"nodeType": "YulFunctionCall",
"src": "2777:17:4"
},
"nodeType": "YulExpressionStatement",
"src": "2777:17:4"
}
]
},
"condition": {
"arguments": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "2670:1:4"
},
{
"arguments": [
{
"name": "y",
"nodeType": "YulIdentifier",
"src": "2677:1:4"
}
],
"functionName": {
"name": "not",
"nodeType": "YulIdentifier",
"src": "2673:3:4"
},
"nodeType": "YulFunctionCall",
"src": "2673:6:4"
}
],
"functionName": {
"name": "gt",
"nodeType": "YulIdentifier",
"src": "2667:2:4"
},
"nodeType": "YulFunctionCall",
"src": "2667:13:4"
},
"nodeType": "YulIf",
"src": "2664:2:4"
},
{
"nodeType": "YulAssignment",
"src": "2813:16:4",
"value": {
"arguments": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "2824:1:4"
},
{
"name": "y",
"nodeType": "YulIdentifier",
"src": "2827:1:4"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "2820:3:4"
},
"nodeType": "YulFunctionCall",
"src": "2820:9:4"
},
"variableNames": [
{
"name": "sum",
"nodeType": "YulIdentifier",
"src": "2813:3:4"
}
]
}
]
},
"name": "checked_add_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "x",
"nodeType": "YulTypedName",
"src": "2637:1:4",
"type": ""
},
{
"name": "y",
"nodeType": "YulTypedName",
"src": "2640:1:4",
"type": ""
}
],
"returnVariables": [
{
"name": "sum",
"nodeType": "YulTypedName",
"src": "2646:3:4",
"type": ""
}
],
"src": "2606:229:4"
}
]
},
"contents": "{\n { }\n function abi_decode_address(offset) -> value\n {\n value := calldataload(offset)\n if iszero(eq(value, and(value, sub(shl(160, 1), 1)))) { revert(0, 0) }\n }\n function abi_decode_tuple_t_address(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(value0, value0) }\n value0 := abi_decode_address(headStart)\n }\n function abi_decode_tuple_t_addresst_uint256(headStart, dataEnd) -> value0, value1\n {\n if slt(sub(dataEnd, headStart), 64) { revert(value1, value1) }\n value0 := abi_decode_address(headStart)\n value1 := calldataload(add(headStart, 32))\n }\n function abi_decode_tuple_t_bool_fromMemory(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(value0, value0) }\n let value := mload(headStart)\n if iszero(eq(value, iszero(iszero(value)))) { revert(value0, value0) }\n value0 := value\n }\n function abi_decode_tuple_t_uint256(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(value0, value0) }\n value0 := calldataload(headStart)\n }\n function abi_encode_tuple_t_address__to_t_address__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n }\n function abi_encode_tuple_t_address_payable__to_t_address_payable__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n }\n function abi_encode_tuple_t_address_payable_t_address_t_uint256__to_t_address_t_address_t_uint256__fromStack_reversed(headStart, value2, value1, value0) -> tail\n {\n tail := add(headStart, 96)\n let _1 := sub(shl(160, 1), 1)\n mstore(headStart, and(value0, _1))\n mstore(add(headStart, 32), and(value1, _1))\n mstore(add(headStart, 64), value2)\n }\n function abi_encode_tuple_t_bool__to_t_bool__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, iszero(iszero(value0)))\n }\n function abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, value0)\n }\n function abi_encode_tuple_t_uint256_t_uint256__to_t_uint256_t_uint256__fromStack_reversed(headStart, value1, value0) -> tail\n {\n tail := add(headStart, 64)\n mstore(headStart, value0)\n mstore(add(headStart, 32), value1)\n }\n function checked_add_t_uint256(x, y) -> sum\n {\n if gt(x, not(y))\n {\n mstore(sum, shl(224, 0x4e487b71))\n mstore(4, 0x11)\n revert(sum, 0x24)\n }\n sum := add(x, y)\n }\n}",
"id": 4,
"language": "Yul",
"name": "#utility.yul"
}
],
"immutableReferences": {
"6": [
{
"length": 32,
"start": 279
},
{
"length": 32,
"start": 422
},
{
"length": 32,
"start": 572
},
{
"length": 32,
"start": 635
},
{
"length": 32,
"start": 690
},
{
"length": 32,
"start": 808
},
{
"length": 32,
"start": 971
},
{
"length": 32,
"start": 1092
},
{
"length": 32,
"start": 1274
},
{
"length": 32,
"start": 1392
},
{
"length": 32,
"start": 1520
}
]
},
"linkReferences": {},
"object": "608060405234801561001057600080fd5b50600436106100a95760003560e01c8063a1db978211610071578063a1db978214610139578063a69df4b51461015c578063aa082a9d14610164578063dc0706571461016d578063f3e414f814610180578063f83d08ba1461019357600080fd5b80630519da32146100ae57806338af3eed146100ca5780634dafe21d146100f557806383197ef01461010a5780638da5cb5b14610112575b600080fd5b6100b760015481565b6040519081526020015b60405180910390f35b6000546100dd906001600160a01b031681565b6040516001600160a01b0390911681526020016100c1565b610108610103366004610707565b61019b565b005b610108610231565b6100dd7f000000000000000000000000000000000000000000000000000000000000000081565b61014c6101473660046106be565b6102a5565b60405190151581526020016100c1565b6101086103c0565b6100b760025481565b61010861017b3660046106a4565b610439565b61010861018e3660046106be565b6104ef565b6101086105e5565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146101e3576040516282b42960e81b815260040160405180910390fd5b806001541461022e5760015460408051918252602082018390527fdcace7f1f80d98250e2a4be8026783cd9c970e6ff4c3c1f22ecddfe0bcffe1bb910160405180910390a160018190555b50565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610279576040516282b42960e81b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316ff5b6000336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806102f557506000546001600160a01b0316331480156102f557506002544210155b610311576040516282b42960e81b815260040160405180910390fd5b6040516323b872dd60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152336024830152604482018490528416906323b872dd90606401602060405180830381600087803b15801561038157600080fd5b505af1158015610395573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b991906106e7565b9392505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480159061040457506000546001600160a01b03163314155b15610421576040516282b42960e81b815260040160405180910390fd5b61043760015442610432919061071f565b61064d565b565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610481576040516282b42960e81b815260040160405180910390fd5b6000546001600160a01b0382811691161461022e57600080546040516001600160a01b03808516939216917f768099735d1c322a05a5b9d7b76d99682a1833d3f7055e5ede25e0f2eeaa8c6d91a3600080546001600160a01b0383166001600160a01b031990911617905550565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061053d57506000546001600160a01b03163314801561053d57506002544210155b610559576040516282b42960e81b815260040160405180910390fd5b604051632142170760e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152336024830152604482018390528316906342842e0e90606401600060405180830381600087803b1580156105c957600080fd5b505af11580156105dd573d6000803e3d6000fd5b505050505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480159061062957506000546001600160a01b03163314155b15610646576040516282b42960e81b815260040160405180910390fd5b6104376000195b60028190556040518181527f161a157b96e5ccf8b82f1fef24d328ea796c0e604b770d9ffd5bbceaa4af1e149060200160405180910390a150565b80356001600160a01b038116811461069f57600080fd5b919050565b6000602082840312156106b5578081fd5b6103b982610688565b600080604083850312156106d0578081fd5b6106d983610688565b946020939093013593505050565b6000602082840312156106f8578081fd5b815180151581146103b9578182fd5b600060208284031215610718578081fd5b5035919050565b6000821982111561073e57634e487b7160e01b81526011600452602481fd5b50019056fea264697066735822122008e8fdd2569502d58f70327c4db71decf983f998207faf1374a56c73c78d529564736f6c63430008040033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0xA9 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0xA1DB9782 GT PUSH2 0x71 JUMPI DUP1 PUSH4 0xA1DB9782 EQ PUSH2 0x139 JUMPI DUP1 PUSH4 0xA69DF4B5 EQ PUSH2 0x15C JUMPI DUP1 PUSH4 0xAA082A9D EQ PUSH2 0x164 JUMPI DUP1 PUSH4 0xDC070657 EQ PUSH2 0x16D JUMPI DUP1 PUSH4 0xF3E414F8 EQ PUSH2 0x180 JUMPI DUP1 PUSH4 0xF83D08BA EQ PUSH2 0x193 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH4 0x519DA32 EQ PUSH2 0xAE JUMPI DUP1 PUSH4 0x38AF3EED EQ PUSH2 0xCA JUMPI DUP1 PUSH4 0x4DAFE21D EQ PUSH2 0xF5 JUMPI DUP1 PUSH4 0x83197EF0 EQ PUSH2 0x10A JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x112 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0xB7 PUSH1 0x1 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 SLOAD PUSH2 0xDD SWAP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP1 SWAP2 AND DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0xC1 JUMP JUMPDEST PUSH2 0x108 PUSH2 0x103 CALLDATASIZE PUSH1 0x4 PUSH2 0x707 JUMP JUMPDEST PUSH2 0x19B JUMP JUMPDEST STOP JUMPDEST PUSH2 0x108 PUSH2 0x231 JUMP JUMPDEST PUSH2 0xDD PUSH32 0x0 DUP2 JUMP JUMPDEST PUSH2 0x14C PUSH2 0x147 CALLDATASIZE PUSH1 0x4 PUSH2 0x6BE JUMP JUMPDEST PUSH2 0x2A5 JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0xC1 JUMP JUMPDEST PUSH2 0x108 PUSH2 0x3C0 JUMP JUMPDEST PUSH2 0xB7 PUSH1 0x2 SLOAD DUP2 JUMP JUMPDEST PUSH2 0x108 PUSH2 0x17B CALLDATASIZE PUSH1 0x4 PUSH2 0x6A4 JUMP JUMPDEST PUSH2 0x439 JUMP JUMPDEST PUSH2 0x108 PUSH2 0x18E CALLDATASIZE PUSH1 0x4 PUSH2 0x6BE JUMP JUMPDEST PUSH2 0x4EF JUMP JUMPDEST PUSH2 0x108 PUSH2 0x5E5 JUMP JUMPDEST CALLER PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB PUSH32 0x0 AND EQ PUSH2 0x1E3 JUMPI PUSH1 0x40 MLOAD PUSH3 0x82B429 PUSH1 0xE8 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP1 PUSH1 0x1 SLOAD EQ PUSH2 0x22E JUMPI PUSH1 0x1 SLOAD PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE PUSH1 0x20 DUP3 ADD DUP4 SWAP1 MSTORE PUSH32 0xDCACE7F1F80D98250E2A4BE8026783CD9C970E6FF4C3C1F22ECDDFE0BCFFE1BB SWAP2 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 PUSH1 0x1 DUP2 SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST CALLER PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB PUSH32 0x0 AND EQ PUSH2 0x279 JUMPI PUSH1 0x40 MLOAD PUSH3 0x82B429 PUSH1 0xE8 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH32 0x0 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND SELFDESTRUCT JUMPDEST PUSH1 0x0 CALLER PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB PUSH32 0x0 AND EQ DUP1 PUSH2 0x2F5 JUMPI POP PUSH1 0x0 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ DUP1 ISZERO PUSH2 0x2F5 JUMPI POP PUSH1 0x2 SLOAD TIMESTAMP LT ISZERO JUMPDEST PUSH2 0x311 JUMPI PUSH1 0x40 MLOAD PUSH3 0x82B429 PUSH1 0xE8 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x40 MLOAD PUSH4 0x23B872DD PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB PUSH32 0x0 DUP2 AND PUSH1 0x4 DUP4 ADD MSTORE CALLER PUSH1 0x24 DUP4 ADD MSTORE PUSH1 0x44 DUP3 ADD DUP5 SWAP1 MSTORE DUP5 AND SWAP1 PUSH4 0x23B872DD SWAP1 PUSH1 0x64 ADD PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x381 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x395 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x3B9 SWAP2 SWAP1 PUSH2 0x6E7 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB PUSH32 0x0 AND EQ DUP1 ISZERO SWAP1 PUSH2 0x404 JUMPI POP PUSH1 0x0 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ ISZERO JUMPDEST ISZERO PUSH2 0x421 JUMPI PUSH1 0x40 MLOAD PUSH3 0x82B429 PUSH1 0xE8 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x437 PUSH1 0x1 SLOAD TIMESTAMP PUSH2 0x432 SWAP2 SWAP1 PUSH2 0x71F JUMP JUMPDEST PUSH2 0x64D JUMP JUMPDEST JUMP JUMPDEST CALLER PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB PUSH32 0x0 AND EQ PUSH2 0x481 JUMPI PUSH1 0x40 MLOAD PUSH3 0x82B429 PUSH1 0xE8 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 DUP2 AND SWAP2 AND EQ PUSH2 0x22E JUMPI PUSH1 0x0 DUP1 SLOAD PUSH1 0x40 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP1 DUP6 AND SWAP4 SWAP3 AND SWAP2 PUSH32 0x768099735D1C322A05A5B9D7B76D99682A1833D3F7055E5EDE25E0F2EEAA8C6D SWAP2 LOG3 PUSH1 0x0 DUP1 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 AND PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT SWAP1 SWAP2 AND OR SWAP1 SSTORE POP JUMP JUMPDEST CALLER PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB PUSH32 0x0 AND EQ DUP1 PUSH2 0x53D JUMPI POP PUSH1 0x0 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ DUP1 ISZERO PUSH2 0x53D JUMPI POP PUSH1 0x2 SLOAD TIMESTAMP LT ISZERO JUMPDEST PUSH2 0x559 JUMPI PUSH1 0x40 MLOAD PUSH3 0x82B429 PUSH1 0xE8 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x40 MLOAD PUSH4 0x21421707 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB PUSH32 0x0 DUP2 AND PUSH1 0x4 DUP4 ADD MSTORE CALLER PUSH1 0x24 DUP4 ADD MSTORE PUSH1 0x44 DUP3 ADD DUP4 SWAP1 MSTORE DUP4 AND SWAP1 PUSH4 0x42842E0E SWAP1 PUSH1 0x64 ADD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x5C9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x5DD JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST CALLER PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB PUSH32 0x0 AND EQ DUP1 ISZERO SWAP1 PUSH2 0x629 JUMPI POP PUSH1 0x0 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ ISZERO JUMPDEST ISZERO PUSH2 0x646 JUMPI PUSH1 0x40 MLOAD PUSH3 0x82B429 PUSH1 0xE8 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x437 PUSH1 0x0 NOT JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE PUSH1 0x40 MLOAD DUP2 DUP2 MSTORE PUSH32 0x161A157B96E5CCF8B82F1FEF24D328EA796C0E604B770D9FFD5BBCEAA4AF1E14 SWAP1 PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP JUMP JUMPDEST DUP1 CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND DUP2 EQ PUSH2 0x69F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x6B5 JUMPI DUP1 DUP2 REVERT JUMPDEST PUSH2 0x3B9 DUP3 PUSH2 0x688 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x6D0 JUMPI DUP1 DUP2 REVERT JUMPDEST PUSH2 0x6D9 DUP4 PUSH2 0x688 JUMP JUMPDEST SWAP5 PUSH1 0x20 SWAP4 SWAP1 SWAP4 ADD CALLDATALOAD SWAP4 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x6F8 JUMPI DUP1 DUP2 REVERT JUMPDEST DUP2 MLOAD DUP1 ISZERO ISZERO DUP2 EQ PUSH2 0x3B9 JUMPI DUP2 DUP3 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x718 JUMPI DUP1 DUP2 REVERT JUMPDEST POP CALLDATALOAD SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP3 NOT DUP3 GT ISZERO PUSH2 0x73E JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 DUP2 REVERT JUMPDEST POP ADD SWAP1 JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 ADDMOD 0xE8 REVERT 0xD2 JUMP SWAP6 MUL 0xD5 DUP16 PUSH17 0x327C4DB71DECF983F998207FAF1374A56C PUSH20 0xC78D529564736F6C634300080400330000000000 ",
"sourceMap": "234:2568:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;340:33;;;;;;;;;2317:25:4;;;2305:2;2290:18;340:33:0;;;;;;;;308:26;;;;;-1:-1:-1;;;;;308:26:0;;;;;;-1:-1:-1;;;;;1323:32:4;;;1305:51;;1293:2;1278:18;308:26:0;1260:102:4;1597:217:0;;;;;;:::i;:::-;;:::i;:::-;;1267:74;;;:::i;264:38::-;;;;;2041:191;;;;;;:::i;:::-;;:::i;:::-;;;2144:14:4;;2137:22;2119:41;;2107:2;2092:18;2041:191:0;2074:92:4;1922:113:0;;;:::i;379:44::-;;;;;;1347:244;;;;;;:::i;:::-;;:::i;2238:177::-;;;;;;:::i;:::-;;:::i;1820:96::-;;;:::i;1597:217::-;698:10;-1:-1:-1;;;;;712:5:0;698:19;;694:58;;738:14;;-1:-1:-1;;;738:14:0;;;;;;;;;;;694:58;1688:9:::1;1673:11;;:24;1669:139;;1737:11;::::0;1718:42:::1;::::0;;2527:25:4;;;2583:2;2568:18;;2561:34;;;1718:42:0::1;::::0;2500:18:4;1718:42:0::1;;;;;;;1774:11;:23:::0;;;1669:139:::1;1597:217:::0;:::o;1267:74::-;698:10;-1:-1:-1;;;;;712:5:0;698:19;;694:58;;738:14;;-1:-1:-1;;;738:14:0;;;;;;;;;;;694:58;1328:5:::1;-1:-1:-1::0;;;;;1315:19:0::1;;2041:191:::0;2139:4;970:10;-1:-1:-1;;;;;984:5:0;970:19;;;:102;;-1:-1:-1;1022:11:0;;-1:-1:-1;;;;;1022:11:0;1008:10;:25;:63;;;;;1056:15;;1037;:34;;1008:63;964:157;;1096:14;;-1:-1:-1;;;1096:14:0;;;;;;;;;;;964:157;2162:63:::1;::::0;-1:-1:-1;;;2162:63:0;;-1:-1:-1;;;;;2198:5:0::1;1857:15:4::0;;2162:63:0::1;::::0;::::1;1839:34:4::0;2205:10:0::1;1889:18:4::0;;;1882:43;1941:18;;;1934:34;;;2162:35:0;::::1;::::0;::::1;::::0;1774:18:4;;2162:63:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;2155:70:::0;2041:191;-1:-1:-1;;;2041:191:0:o;1922:113::-;820:10;-1:-1:-1;;;;;834:5:0;820:19;;;;;:48;;-1:-1:-1;857:11:0;;-1:-1:-1;;;;;857:11:0;843:10;:25;;820:48;816:87;;;889:14;;-1:-1:-1;;;889:14:0;;;;;;;;;;;816:87;1978:50:::1;2016:11;;1998:15;:29;;;;:::i;:::-;1978:19;:50::i;:::-;1922:113::o:0;1347:244::-;698:10;-1:-1:-1;;;;;712:5:0;698:19;;694:58;;738:14;;-1:-1:-1;;;738:14:0;;;;;;;;;;;694:58;1432:11:::1;::::0;-1:-1:-1;;;;;1432:30:0;;::::1;:11:::0;::::1;:30;1428:157;;1502:11;::::0;;1483:48:::1;::::0;-1:-1:-1;;;;;1483:48:0;;::::1;::::0;1502:11;::::1;::::0;1483:48:::1;::::0;::::1;1545:11;:29:::0;;-1:-1:-1;;;;;1545:29:0;::::1;-1:-1:-1::0;;;;;;1545:29:0;;::::1;;::::0;;1347:244;:::o;2238:177::-;970:10;-1:-1:-1;;;;;984:5:0;970:19;;;:102;;-1:-1:-1;1022:11:0;;-1:-1:-1;;;;;1022:11:0;1008:10;:25;:63;;;;;1056:15;;1037;:34;;1008:63;964:157;;1096:14;;-1:-1:-1;;;1096:14:0;;;;;;;;;;;964:157;2339:69:::1;::::0;-1:-1:-1;;;2339:69:0;;-1:-1:-1;;;;;2380:5:0::1;1857:15:4::0;;2339:69:0::1;::::0;::::1;1839:34:4::0;2387:10:0::1;1889:18:4::0;;;1882:43;1941:18;;;1934:34;;;2339:40:0;::::1;::::0;::::1;::::0;1774:18:4;;2339:69:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;2238:177:::0;;:::o;1820:96::-;820:10;-1:-1:-1;;;;;834:5:0;820:19;;;;;:48;;-1:-1:-1;857:11:0;;-1:-1:-1;;;;;857:11:0;843:10;:25;;820:48;816:87;;;889:14;;-1:-1:-1;;;889:14:0;;;;;;;;;;;816:87;1874:35:::1;-1:-1:-1::0;;2659:141:0;2723:15;:27;;;2765:28;;2317:25:4;;;2765:28:0;;2305:2:4;2290:18;2765:28:0;;;;;;;2659:141;:::o;14:173:4:-;82:20;;-1:-1:-1;;;;;131:31:4;;121:42;;111:2;;177:1;174;167:12;111:2;63:124;;;:::o;192:196::-;251:6;304:2;292:9;283:7;279:23;275:32;272:2;;;325:6;317;310:22;272:2;353:29;372:9;353:29;:::i;393:264::-;461:6;469;522:2;510:9;501:7;497:23;493:32;490:2;;;543:6;535;528:22;490:2;571:29;590:9;571:29;:::i;:::-;561:39;647:2;632:18;;;;619:32;;-1:-1:-1;;;480:177:4:o;662:297::-;729:6;782:2;770:9;761:7;757:23;753:32;750:2;;;803:6;795;788:22;750:2;840:9;834:16;893:5;886:13;879:21;872:5;869:32;859:2;;920:6;912;905:22;964:190;1023:6;1076:2;1064:9;1055:7;1051:23;1047:32;1044:2;;;1097:6;1089;1082:22;1044:2;-1:-1:-1;1125:23:4;;1034:120;-1:-1:-1;1034:120:4:o;2606:229::-;2646:3;2677:1;2673:6;2670:1;2667:13;2664:2;;;-1:-1:-1;;;2703:33:4;;2759:4;2756:1;2749:15;2789:4;2710:3;2777:17;2664:2;-1:-1:-1;2820:9:4;;2654:181::o"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "382600",
"executionCost": "infinite",
"totalCost": "infinite"
},
"external": {
"beneficiary()": "1060",
"changeBeneficiary(address)": "infinite",
"changeUnlockDelay(uint256)": "infinite",
"destroy()": "infinite",
"lock()": "infinite",
"owner()": "infinite",
"unlock()": "infinite",
"unlockDelay()": "985",
"unlockTimestamp()": "1028",
"withdrawERC20(address,uint256)": "infinite",
"withdrawERC721(address,uint256)": "infinite"
},
"internal": {
"_setBeneficiary(address)": "infinite",
"_setUnlockTimestamp(uint256)": "infinite"
}
},
"methodIdentifiers": {
"beneficiary()": "38af3eed",
"changeBeneficiary(address)": "dc070657",
"changeUnlockDelay(uint256)": "4dafe21d",
"destroy()": "83197ef0",
"lock()": "f83d08ba",
"owner()": "8da5cb5b",
"unlock()": "a69df4b5",
"unlockDelay()": "0519da32",
"unlockTimestamp()": "aa082a9d",
"withdrawERC20(address,uint256)": "a1db9782",
"withdrawERC721(address,uint256)": "f3e414f8"
}
},
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_beneficiary",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "Unauthorized",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "oldBeneficiary",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newBeneficiary",
"type": "address"
}
],
"name": "BeneficiaryChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "oldDelay",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "newDelay",
"type": "uint256"
}
],
"name": "UnlockDelayChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "unlockTimestamp",
"type": "uint256"
}
],
"name": "UnlockTimeChanged",
"type": "event"
},
{
"inputs": [],
"name": "beneficiary",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_newBeneficiary",
"type": "address"
}
],
"name": "changeBeneficiary",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_newDelay",
"type": "uint256"
}
],
"name": "changeUnlockDelay",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "destroy",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "lock",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address payable",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "unlock",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "unlockDelay",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "unlockTimestamp",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_tokenContract",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "withdrawERC20",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_tokenContract",
"type": "address"
},
{
"internalType": "uint256",
"name": "_tokenId",
"type": "uint256"
}
],
"name": "withdrawERC721",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.4+commit.c7e474f2"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_beneficiary",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "Unauthorized",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "oldBeneficiary",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newBeneficiary",
"type": "address"
}
],
"name": "BeneficiaryChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "oldDelay",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "newDelay",
"type": "uint256"
}
],
"name": "UnlockDelayChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "unlockTimestamp",
"type": "uint256"
}
],
"name": "UnlockTimeChanged",
"type": "event"
},
{
"inputs": [],
"name": "beneficiary",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_newBeneficiary",
"type": "address"
}
],
"name": "changeBeneficiary",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_newDelay",
"type": "uint256"
}
],
"name": "changeUnlockDelay",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "destroy",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "lock",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address payable",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "unlock",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "unlockDelay",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "unlockTimestamp",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_tokenContract",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "withdrawERC20",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_tokenContract",
"type": "address"
},
{
"internalType": "uint256",
"name": "_tokenId",
"type": "uint256"
}
],
"name": "withdrawERC721",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"details": "Releases ERC20 and ERC721 tokens after a time if not cancelled.",
"kind": "dev",
"methods": {},
"title": "Estate timelock",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/EstateTimelock.sol": "EstateTimelock"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
},
"sources": {
"contracts/EstateTimelock.sol": {
"keccak256": "0xa172351ffeda523378a94db852ecc8380123c8180311c8918a36da2a463f6ad5",
"license": "MIT",
"urls": [
"bzz-raw://6dd4093e61241216f0e688a28cd6bcab63c62aeb59e9bec14e136780e2f8ef40",
"dweb:/ipfs/QmQkgqxyXu62zbygA9cVxsTMUUqgzsvXCbiGDNYiA8HXqp"
]
},
"contracts/interfaces/IERC165.sol": {
"keccak256": "0xcbdc7f360dd1c6b4baa0f490a4cfd116b4764e2febca95d43931dd37bfc5dc7b",
"license": "MIT",
"urls": [
"bzz-raw://655f990f5603fc59430eb99628185953c8ebf1755bbf93f99165a5a0111d35bc",
"dweb:/ipfs/QmWQvrqnUUUq9rihbDAqHvDooDnDs8RKqiY5V6x7aRdZh5"
]
},
"contracts/interfaces/IERC20.sol": {
"keccak256": "0x19bf0be24de7d62cdbfea6e691111acaa38a0252578db018d61a547970fe766e",
"license": "MIT",
"urls": [
"bzz-raw://409368f5fcbbf21f6d824f35f47754a7aa69bd76cda0d12df7b93384de192207",
"dweb:/ipfs/QmT1j8sZ2vj4mPgR2sU9XMpXEpvRz3kyYZFGvmXtExf9W4"
]
},
"contracts/interfaces/IERC721.sol": {
"keccak256": "0xd747ee37f2eb3db4b79fc9d8030cce4723280d3adf1e35e3b5d1d6426ed928bd",
"license": "MIT",
"urls": [
"bzz-raw://a006ed62ba5817506f08b7796c711fdca53ad14bd8984c1e7fba6a0fc4c6bf03",
"dweb:/ipfs/QmS39z5Say2VhZmJ5LTuNJZAmghA4EwVGHHGtFVqVjegJC"
]
}
},
"version": 1
}
{
"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": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"methodIdentifiers": {
"allowance(address,address)": "dd62ed3e",
"approve(address,uint256)": "095ea7b3",
"balanceOf(address)": "70a08231",
"totalSupply()": "18160ddd",
"transfer(address,uint256)": "a9059cbb",
"transferFrom(address,address,uint256)": "23b872dd"
}
},
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.4+commit.c7e474f2"
},
"language": "Solidity",
"output": {
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"details": "Interface of the ERC20 standard as defined in the EIP.",
"events": {
"Approval(address,address,uint256)": {
"details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance."
},
"Transfer(address,address,uint256)": {
"details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero."
}
},
"kind": "dev",
"methods": {
"allowance(address,address)": {
"details": "Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through {transferFrom}. This is zero by default. This value changes when {approve} or {transferFrom} are called."
},
"approve(address,uint256)": {
"details": "Sets `amount` as the allowance of `spender` over the caller's tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 Emits an {Approval} event."
},
"balanceOf(address)": {
"details": "Returns the amount of tokens owned by `account`."
},
"totalSupply()": {
"details": "Returns the amount of tokens in existence."
},
"transfer(address,uint256)": {
"details": "Moves `amount` tokens from the caller's account to `recipient`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event."
},
"transferFrom(address,address,uint256)": {
"details": "Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event."
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/IERC20.sol": "IERC20"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"contracts/IERC20.sol": {
"keccak256": "0x19bf0be24de7d62cdbfea6e691111acaa38a0252578db018d61a547970fe766e",
"license": "MIT",
"urls": [
"bzz-raw://409368f5fcbbf21f6d824f35f47754a7aa69bd76cda0d12df7b93384de192207",
"dweb:/ipfs/QmT1j8sZ2vj4mPgR2sU9XMpXEpvRz3kyYZFGvmXtExf9W4"
]
}
},
"version": 1
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./interfaces/IERC20.sol";
import "./interfaces/IERC721.sol";
/**
* @title Estate timelock
* @dev Releases ERC20 and ERC721 tokens after a time if not cancelled.
*/
contract EstateTimelock {
address payable public immutable owner;
address public beneficiary;
uint public unlockDelay = 60 days;
uint public unlockTimestamp = type(uint).max;
event BeneficiaryChanged(address indexed oldBeneficiary, address indexed newBeneficiary);
event UnlockDelayChanged(uint oldDelay, uint newDelay);
event UnlockTimeChanged(uint unlockTimestamp);
error Unauthorized();
modifier ownerOnly() {
if (msg.sender != owner)
revert Unauthorized();
_;
}
modifier beneficiaryOrOwner() {
if (msg.sender != owner && msg.sender != beneficiary)
revert Unauthorized();
_;
}
modifier unlockedOrOwner() {
if (!(msg.sender == owner ||
(msg.sender == beneficiary && block.timestamp >= unlockTimestamp))) {
revert Unauthorized();
}
_;
}
constructor(address _beneficiary) {
owner = payable(msg.sender);
_setBeneficiary(_beneficiary);
}
function destroy() external ownerOnly {
selfdestruct(owner);
}
function changeBeneficiary(address _newBeneficiary) external ownerOnly {
if (beneficiary != _newBeneficiary) {
emit BeneficiaryChanged(beneficiary, _newBeneficiary);
beneficiary = _newBeneficiary;
}
}
function changeUnlockDelay(uint _newDelay) external ownerOnly {
if (unlockDelay != _newDelay) {
emit UnlockDelayChanged(unlockDelay, _newDelay);
unlockDelay = _newDelay;
}
}
function lock() external beneficiaryOrOwner {
_setUnlockTimestamp(type(uint).max);
}
function unlock() external beneficiaryOrOwner {
_setUnlockTimestamp(block.timestamp + unlockDelay);
}
function withdrawERC20(address _tokenContract, uint256 _amount) external unlockedOrOwner returns (bool) {
return IERC20(_tokenContract).transferFrom(owner, msg.sender, _amount);
}
function withdrawERC721(address _tokenContract, uint256 _tokenId) external unlockedOrOwner {
IERC721(_tokenContract).safeTransferFrom(owner, msg.sender, _tokenId);
}
function _setBeneficiary(address _newBeneficiary) internal {
if (beneficiary != _newBeneficiary) {
emit BeneficiaryChanged(beneficiary, _newBeneficiary);
beneficiary = _newBeneficiary;
}
}
function _setUnlockTimestamp(uint _newValue) internal {
unlockTimestamp = _newValue;
emit UnlockTimeChanged(_newValue);
}
}
{
"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": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"methodIdentifiers": {
"allowance(address,address)": "dd62ed3e",
"approve(address,uint256)": "095ea7b3",
"balanceOf(address)": "70a08231",
"totalSupply()": "18160ddd",
"transfer(address,uint256)": "a9059cbb",
"transferFrom(address,address,uint256)": "23b872dd"
}
},
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.4+commit.c7e474f2"
},
"language": "Solidity",
"output": {
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"details": "Interface of the ERC20 standard as defined in the EIP.",
"events": {
"Approval(address,address,uint256)": {
"details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance."
},
"Transfer(address,address,uint256)": {
"details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero."
}
},
"kind": "dev",
"methods": {
"allowance(address,address)": {
"details": "Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through {transferFrom}. This is zero by default. This value changes when {approve} or {transferFrom} are called."
},
"approve(address,uint256)": {
"details": "Sets `amount` as the allowance of `spender` over the caller's tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 Emits an {Approval} event."
},
"balanceOf(address)": {
"details": "Returns the amount of tokens owned by `account`."
},
"totalSupply()": {
"details": "Returns the amount of tokens in existence."
},
"transfer(address,uint256)": {
"details": "Moves `amount` tokens from the caller's account to `recipient`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event."
},
"transferFrom(address,address,uint256)": {
"details": "Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event."
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/interfaces/IERC20.sol": "IERC20"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
},
"sources": {
"contracts/interfaces/IERC20.sol": {
"keccak256": "0x19bf0be24de7d62cdbfea6e691111acaa38a0252578db018d61a547970fe766e",
"license": "MIT",
"urls": [
"bzz-raw://409368f5fcbbf21f6d824f35f47754a7aa69bd76cda0d12df7b93384de192207",
"dweb:/ipfs/QmT1j8sZ2vj4mPgR2sU9XMpXEpvRz3kyYZFGvmXtExf9W4"
]
}
},
"version": 1
}
{
"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": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"methodIdentifiers": {
"approve(address,uint256)": "095ea7b3",
"balanceOf(address)": "70a08231",
"getApproved(uint256)": "081812fc",
"isApprovedForAll(address,address)": "e985e9c5",
"ownerOf(uint256)": "6352211e",
"safeTransferFrom(address,address,uint256)": "42842e0e",
"safeTransferFrom(address,address,uint256,bytes)": "b88d4fde",
"setApprovalForAll(address,bool)": "a22cb465",
"supportsInterface(bytes4)": "01ffc9a7",
"transferFrom(address,address,uint256)": "23b872dd"
}
},
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "approved",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "operator",
"type": "address"
},
{
"indexed": false,
"internalType": "bool",
"name": "approved",
"type": "bool"
}
],
"name": "ApprovalForAll",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "approve",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "balance",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "getApproved",
"outputs": [
{
"internalType": "address",
"name": "operator",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "operator",
"type": "address"
}
],
"name": "isApprovedForAll",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "ownerOf",
"outputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "safeTransferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "safeTransferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "operator",
"type": "address"
},
{
"internalType": "bool",
"name": "_approved",
"type": "bool"
}
],
"name": "setApprovalForAll",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes4",
"name": "interfaceId",
"type": "bytes4"
}
],
"name": "supportsInterface",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.4+commit.c7e474f2"
},
"language": "Solidity",
"output": {
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "approved",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "operator",
"type": "address"
},
{
"indexed": false,
"internalType": "bool",
"name": "approved",
"type": "bool"
}
],
"name": "ApprovalForAll",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "approve",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "balance",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "getApproved",
"outputs": [
{
"internalType": "address",
"name": "operator",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "operator",
"type": "address"
}
],
"name": "isApprovedForAll",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "ownerOf",
"outputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "safeTransferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "safeTransferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "operator",
"type": "address"
},
{
"internalType": "bool",
"name": "_approved",
"type": "bool"
}
],
"name": "setApprovalForAll",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes4",
"name": "interfaceId",
"type": "bytes4"
}
],
"name": "supportsInterface",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"details": "Required interface of an ERC721 compliant contract.",
"events": {
"Approval(address,address,uint256)": {
"details": "Emitted when `owner` enables `approved` to manage the `tokenId` token."
},
"ApprovalForAll(address,address,bool)": {
"details": "Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets."
},
"Transfer(address,address,uint256)": {
"details": "Emitted when `tokenId` token is transferred from `from` to `to`."
}
},
"kind": "dev",
"methods": {
"approve(address,uint256)": {
"details": "Gives permission to `to` to transfer `tokenId` token to another account. The approval is cleared when the token is transferred. Only a single account can be approved at a time, so approving the zero address clears previous approvals. Requirements: - The caller must own the token or be an approved operator. - `tokenId` must exist. Emits an {Approval} event."
},
"balanceOf(address)": {
"details": "Returns the number of tokens in ``owner``'s account."
},
"getApproved(uint256)": {
"details": "Returns the account approved for `tokenId` token. Requirements: - `tokenId` must exist."
},
"isApprovedForAll(address,address)": {
"details": "Returns if the `operator` is allowed to manage all of the assets of `owner`. See {setApprovalForAll}"
},
"ownerOf(uint256)": {
"details": "Returns the owner of the `tokenId` token. Requirements: - `tokenId` must exist."
},
"safeTransferFrom(address,address,uint256)": {
"details": "Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients are aware of the ERC721 protocol to prevent tokens from being forever locked. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `tokenId` token must exist and be owned by `from`. - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. Emits a {Transfer} event."
},
"safeTransferFrom(address,address,uint256,bytes)": {
"details": "Safely transfers `tokenId` token from `from` to `to`. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `tokenId` token must exist and be owned by `from`. - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. Emits a {Transfer} event."
},
"setApprovalForAll(address,bool)": {
"details": "Approve or remove `operator` as an operator for the caller. Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. Requirements: - The `operator` cannot be the caller. Emits an {ApprovalForAll} event."
},
"supportsInterface(bytes4)": {
"details": "Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas."
},
"transferFrom(address,address,uint256)": {
"details": "Transfers `tokenId` token from `from` to `to`. WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. Emits a {Transfer} event."
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/interfaces/IERC721.sol": "IERC721"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"contracts/interfaces/IERC165.sol": {
"keccak256": "0xcbdc7f360dd1c6b4baa0f490a4cfd116b4764e2febca95d43931dd37bfc5dc7b",
"license": "MIT",
"urls": [
"bzz-raw://655f990f5603fc59430eb99628185953c8ebf1755bbf93f99165a5a0111d35bc",
"dweb:/ipfs/QmWQvrqnUUUq9rihbDAqHvDooDnDs8RKqiY5V6x7aRdZh5"
]
},
"contracts/interfaces/IERC721.sol": {
"keccak256": "0xd747ee37f2eb3db4b79fc9d8030cce4723280d3adf1e35e3b5d1d6426ed928bd",
"license": "MIT",
"urls": [
"bzz-raw://a006ed62ba5817506f08b7796c711fdca53ad14bd8984c1e7fba6a0fc4c6bf03",
"dweb:/ipfs/QmS39z5Say2VhZmJ5LTuNJZAmghA4EwVGHHGtFVqVjegJC"
]
}
},
"version": 1
}
// SPDX-License-Identifier: MIT
// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/0a905d674b2c7ad2656d3ae6f85b27b002649c9f/contracts/utils/introspection/IERC165.sol
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// SPDX-License-Identifier: MIT
// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/0a905d674b2c7ad2656d3ae6f85b27b002649c9f/contracts/token/ERC20/IERC20.sol
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// SPDX-License-Identifier: MIT
// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/0a905d674b2c7ad2656d3ae6f85b27b002649c9f/contracts/token/ERC721/IERC721.sol
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}
// 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 = 'EstateTimelock' // Change this for other 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: [accounts[1]]
})
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)
}
})()
// 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/3_Ballot.sol";
contract BallotTest {
bytes32[] proposalNames;
Ballot ballotToTest;
function beforeAll () public {
proposalNames.push(bytes32("candidate1"));
ballotToTest = new Ballot(proposalNames);
}
function checkWinningProposal () public {
ballotToTest.vote(0);
Assert.equal(ballotToTest.winningProposal(), uint(0), "proposal at index 0 should be the winning proposal");
Assert.equal(ballotToTest.winnerName(), bytes32("candidate1"), "candidate1 should be the winner name");
}
function checkWinninProposalWithReturnValue () public view returns (bool) {
return ballotToTest.winningProposal() == 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment