Created
June 21, 2021 16:27
-
-
Save Saurabgami977/025ab9373ca20156a99049e94ea86723 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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": "608060405234801561001057600080fd5b506101a3806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c806348c981e214610030575b600080fd5b61004a600480360381019061004591906100fb565b61004c565b005b8073ffffffffffffffffffffffffffffffffffffffff166108fc670de0b6b3a76400009081150290604051600060405180830381858888f1935050505015801561009a573d6000803e3d6000fd5b508073ffffffffffffffffffffffffffffffffffffffff166108fc60649081150290604051600060405180830381858888f193505050501580156100e2573d6000803e3d6000fd5b5050565b6000813590506100f581610156565b92915050565b60006020828403121561010d57600080fd5b600061011b848285016100e6565b91505092915050565b600061012f82610136565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b61015f81610124565b811461016a57600080fd5b5056fea26469706673582212200d27769719f950dccb5986cee0b893ead3141c6f7918c84931dbc54101b71b1d64736f6c63430008040033", | |
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1A3 DUP1 PUSH2 0x20 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x2B JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x48C981E2 EQ PUSH2 0x30 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4A PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x45 SWAP2 SWAP1 PUSH2 0xFB JUMP JUMPDEST PUSH2 0x4C JUMP JUMPDEST STOP JUMPDEST DUP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH2 0x8FC PUSH8 0xDE0B6B3A7640000 SWAP1 DUP2 ISZERO MUL SWAP1 PUSH1 0x40 MLOAD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0x9A JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP DUP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH2 0x8FC PUSH1 0x64 SWAP1 DUP2 ISZERO MUL SWAP1 PUSH1 0x40 MLOAD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0xE2 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xF5 DUP2 PUSH2 0x156 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x10D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x11B DUP5 DUP3 DUP6 ADD PUSH2 0xE6 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x12F DUP3 PUSH2 0x136 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x15F DUP2 PUSH2 0x124 JUMP JUMPDEST DUP2 EQ PUSH2 0x16A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xD 0x27 PUSH23 0x9719F950DCCB5986CEE0B893EAD3141C6F7918C84931DB 0xC5 COINBASE ADD 0xB7 SHL SAR PUSH5 0x736F6C6343 STOP ADDMOD DIV STOP CALLER ", | |
"sourceMap": "25:288:0:-:0;;;;;;;;;;;;;;;;;;;" | |
}, | |
"deployedBytecode": { | |
"generatedSources": [ | |
{ | |
"ast": { | |
"nodeType": "YulBlock", | |
"src": "0:835:1", | |
"statements": [ | |
{ | |
"body": { | |
"nodeType": "YulBlock", | |
"src": "67:95:1", | |
"statements": [ | |
{ | |
"nodeType": "YulAssignment", | |
"src": "77:29:1", | |
"value": { | |
"arguments": [ | |
{ | |
"name": "offset", | |
"nodeType": "YulIdentifier", | |
"src": "99:6:1" | |
} | |
], | |
"functionName": { | |
"name": "calldataload", | |
"nodeType": "YulIdentifier", | |
"src": "86:12:1" | |
}, | |
"nodeType": "YulFunctionCall", | |
"src": "86:20:1" | |
}, | |
"variableNames": [ | |
{ | |
"name": "value", | |
"nodeType": "YulIdentifier", | |
"src": "77:5:1" | |
} | |
] | |
}, | |
{ | |
"expression": { | |
"arguments": [ | |
{ | |
"name": "value", | |
"nodeType": "YulIdentifier", | |
"src": "150:5:1" | |
} | |
], | |
"functionName": { | |
"name": "validator_revert_t_address_payable", | |
"nodeType": "YulIdentifier", | |
"src": "115:34:1" | |
}, | |
"nodeType": "YulFunctionCall", | |
"src": "115:41:1" | |
}, | |
"nodeType": "YulExpressionStatement", | |
"src": "115:41:1" | |
} | |
] | |
}, | |
"name": "abi_decode_t_address_payable", | |
"nodeType": "YulFunctionDefinition", | |
"parameters": [ | |
{ | |
"name": "offset", | |
"nodeType": "YulTypedName", | |
"src": "45:6:1", | |
"type": "" | |
}, | |
{ | |
"name": "end", | |
"nodeType": "YulTypedName", | |
"src": "53:3:1", | |
"type": "" | |
} | |
], | |
"returnVariables": [ | |
{ | |
"name": "value", | |
"nodeType": "YulTypedName", | |
"src": "61:5:1", | |
"type": "" | |
} | |
], | |
"src": "7:155:1" | |
}, | |
{ | |
"body": { | |
"nodeType": "YulBlock", | |
"src": "242:204:1", | |
"statements": [ | |
{ | |
"body": { | |
"nodeType": "YulBlock", | |
"src": "288:16:1", | |
"statements": [ | |
{ | |
"expression": { | |
"arguments": [ | |
{ | |
"kind": "number", | |
"nodeType": "YulLiteral", | |
"src": "297:1:1", | |
"type": "", | |
"value": "0" | |
}, | |
{ | |
"kind": "number", | |
"nodeType": "YulLiteral", | |
"src": "300:1:1", | |
"type": "", | |
"value": "0" | |
} | |
], | |
"functionName": { | |
"name": "revert", | |
"nodeType": "YulIdentifier", | |
"src": "290:6:1" | |
}, | |
"nodeType": "YulFunctionCall", | |
"src": "290:12:1" | |
}, | |
"nodeType": "YulExpressionStatement", | |
"src": "290:12:1" | |
} | |
] | |
}, | |
"condition": { | |
"arguments": [ | |
{ | |
"arguments": [ | |
{ | |
"name": "dataEnd", | |
"nodeType": "YulIdentifier", | |
"src": "263:7:1" | |
}, | |
{ | |
"name": "headStart", | |
"nodeType": "YulIdentifier", | |
"src": "272:9:1" | |
} | |
], | |
"functionName": { | |
"name": "sub", | |
"nodeType": "YulIdentifier", | |
"src": "259:3:1" | |
}, | |
"nodeType": "YulFunctionCall", | |
"src": "259:23:1" | |
}, | |
{ | |
"kind": "number", | |
"nodeType": "YulLiteral", | |
"src": "284:2:1", | |
"type": "", | |
"value": "32" | |
} | |
], | |
"functionName": { | |
"name": "slt", | |
"nodeType": "YulIdentifier", | |
"src": "255:3:1" | |
}, | |
"nodeType": "YulFunctionCall", | |
"src": "255:32:1" | |
}, | |
"nodeType": "YulIf", | |
"src": "252:2:1" | |
}, | |
{ | |
"nodeType": "YulBlock", | |
"src": "314:125:1", | |
"statements": [ | |
{ | |
"nodeType": "YulVariableDeclaration", | |
"src": "329:15:1", | |
"value": { | |
"kind": "number", | |
"nodeType": "YulLiteral", | |
"src": "343:1:1", | |
"type": "", | |
"value": "0" | |
}, | |
"variables": [ | |
{ | |
"name": "offset", | |
"nodeType": "YulTypedName", | |
"src": "333:6:1", | |
"type": "" | |
} | |
] | |
}, | |
{ | |
"nodeType": "YulAssignment", | |
"src": "358:71:1", | |
"value": { | |
"arguments": [ | |
{ | |
"arguments": [ | |
{ | |
"name": "headStart", | |
"nodeType": "YulIdentifier", | |
"src": "401:9:1" | |
}, | |
{ | |
"name": "offset", | |
"nodeType": "YulIdentifier", | |
"src": "412:6:1" | |
} | |
], | |
"functionName": { | |
"name": "add", | |
"nodeType": "YulIdentifier", | |
"src": "397:3:1" | |
}, | |
"nodeType": "YulFunctionCall", | |
"src": "397:22:1" | |
}, | |
{ | |
"name": "dataEnd", | |
"nodeType": "YulIdentifier", | |
"src": "421:7:1" | |
} | |
], | |
"functionName": { | |
"name": "abi_decode_t_address_payable", | |
"nodeType": "YulIdentifier", | |
"src": "368:28:1" | |
}, | |
"nodeType": "YulFunctionCall", | |
"src": "368:61:1" | |
}, | |
"variableNames": [ | |
{ | |
"name": "value0", | |
"nodeType": "YulIdentifier", | |
"src": "358:6:1" | |
} | |
] | |
} | |
] | |
} | |
] | |
}, | |
"name": "abi_decode_tuple_t_address_payable", | |
"nodeType": "YulFunctionDefinition", | |
"parameters": [ | |
{ | |
"name": "headStart", | |
"nodeType": "YulTypedName", | |
"src": "212:9:1", | |
"type": "" | |
}, | |
{ | |
"name": "dataEnd", | |
"nodeType": "YulTypedName", | |
"src": "223:7:1", | |
"type": "" | |
} | |
], | |
"returnVariables": [ | |
{ | |
"name": "value0", | |
"nodeType": "YulTypedName", | |
"src": "235:6:1", | |
"type": "" | |
} | |
], | |
"src": "168:278:1" | |
}, | |
{ | |
"body": { | |
"nodeType": "YulBlock", | |
"src": "505:51:1", | |
"statements": [ | |
{ | |
"nodeType": "YulAssignment", | |
"src": "515:35:1", | |
"value": { | |
"arguments": [ | |
{ | |
"name": "value", | |
"nodeType": "YulIdentifier", | |
"src": "544:5:1" | |
} | |
], | |
"functionName": { | |
"name": "cleanup_t_uint160", | |
"nodeType": "YulIdentifier", | |
"src": "526:17:1" | |
}, | |
"nodeType": "YulFunctionCall", | |
"src": "526:24:1" | |
}, | |
"variableNames": [ | |
{ | |
"name": "cleaned", | |
"nodeType": "YulIdentifier", | |
"src": "515:7:1" | |
} | |
] | |
} | |
] | |
}, | |
"name": "cleanup_t_address_payable", | |
"nodeType": "YulFunctionDefinition", | |
"parameters": [ | |
{ | |
"name": "value", | |
"nodeType": "YulTypedName", | |
"src": "487:5:1", | |
"type": "" | |
} | |
], | |
"returnVariables": [ | |
{ | |
"name": "cleaned", | |
"nodeType": "YulTypedName", | |
"src": "497:7:1", | |
"type": "" | |
} | |
], | |
"src": "452:104:1" | |
}, | |
{ | |
"body": { | |
"nodeType": "YulBlock", | |
"src": "607:81:1", | |
"statements": [ | |
{ | |
"nodeType": "YulAssignment", | |
"src": "617:65:1", | |
"value": { | |
"arguments": [ | |
{ | |
"name": "value", | |
"nodeType": "YulIdentifier", | |
"src": "632:5:1" | |
}, | |
{ | |
"kind": "number", | |
"nodeType": "YulLiteral", | |
"src": "639:42:1", | |
"type": "", | |
"value": "0xffffffffffffffffffffffffffffffffffffffff" | |
} | |
], | |
"functionName": { | |
"name": "and", | |
"nodeType": "YulIdentifier", | |
"src": "628:3:1" | |
}, | |
"nodeType": "YulFunctionCall", | |
"src": "628:54:1" | |
}, | |
"variableNames": [ | |
{ | |
"name": "cleaned", | |
"nodeType": "YulIdentifier", | |
"src": "617:7:1" | |
} | |
] | |
} | |
] | |
}, | |
"name": "cleanup_t_uint160", | |
"nodeType": "YulFunctionDefinition", | |
"parameters": [ | |
{ | |
"name": "value", | |
"nodeType": "YulTypedName", | |
"src": "589:5:1", | |
"type": "" | |
} | |
], | |
"returnVariables": [ | |
{ | |
"name": "cleaned", | |
"nodeType": "YulTypedName", | |
"src": "599:7:1", | |
"type": "" | |
} | |
], | |
"src": "562:126:1" | |
}, | |
{ | |
"body": { | |
"nodeType": "YulBlock", | |
"src": "745:87:1", | |
"statements": [ | |
{ | |
"body": { | |
"nodeType": "YulBlock", | |
"src": "810:16:1", | |
"statements": [ | |
{ | |
"expression": { | |
"arguments": [ | |
{ | |
"kind": "number", | |
"nodeType": "YulLiteral", | |
"src": "819:1:1", | |
"type": "", | |
"value": "0" | |
}, | |
{ | |
"kind": "number", | |
"nodeType": "YulLiteral", | |
"src": "822:1:1", | |
"type": "", | |
"value": "0" | |
} | |
], | |
"functionName": { | |
"name": "revert", | |
"nodeType": "YulIdentifier", | |
"src": "812:6:1" | |
}, | |
"nodeType": "YulFunctionCall", | |
"src": "812:12:1" | |
}, | |
"nodeType": "YulExpressionStatement", | |
"src": "812:12:1" | |
} | |
] | |
}, | |
"condition": { | |
"arguments": [ | |
{ | |
"arguments": [ | |
{ | |
"name": "value", | |
"nodeType": "YulIdentifier", | |
"src": "768:5:1" | |
}, | |
{ | |
"arguments": [ | |
{ | |
"name": "value", | |
"nodeType": "YulIdentifier", | |
"src": "801:5:1" | |
} | |
], | |
"functionName": { | |
"name": "cleanup_t_address_payable", | |
"nodeType": "YulIdentifier", | |
"src": "775:25:1" | |
}, | |
"nodeType": "YulFunctionCall", | |
"src": "775:32:1" | |
} | |
], | |
"functionName": { | |
"name": "eq", | |
"nodeType": "YulIdentifier", | |
"src": "765:2:1" | |
}, | |
"nodeType": "YulFunctionCall", | |
"src": "765:43:1" | |
} | |
], | |
"functionName": { | |
"name": "iszero", | |
"nodeType": "YulIdentifier", | |
"src": "758:6:1" | |
}, | |
"nodeType": "YulFunctionCall", | |
"src": "758:51:1" | |
}, | |
"nodeType": "YulIf", | |
"src": "755:2:1" | |
} | |
] | |
}, | |
"name": "validator_revert_t_address_payable", | |
"nodeType": "YulFunctionDefinition", | |
"parameters": [ | |
{ | |
"name": "value", | |
"nodeType": "YulTypedName", | |
"src": "738:5:1", | |
"type": "" | |
} | |
], | |
"src": "694:138:1" | |
} | |
] | |
}, | |
"contents": "{\n\n function abi_decode_t_address_payable(offset, end) -> value {\n value := calldataload(offset)\n validator_revert_t_address_payable(value)\n }\n\n function abi_decode_tuple_t_address_payable(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_address_payable(add(headStart, offset), dataEnd)\n }\n\n }\n\n function cleanup_t_address_payable(value) -> cleaned {\n cleaned := cleanup_t_uint160(value)\n }\n\n function cleanup_t_uint160(value) -> cleaned {\n cleaned := and(value, 0xffffffffffffffffffffffffffffffffffffffff)\n }\n\n function validator_revert_t_address_payable(value) {\n if iszero(eq(value, cleanup_t_address_payable(value))) { revert(0, 0) }\n }\n\n}\n", | |
"id": 1, | |
"language": "Yul", | |
"name": "#utility.yul" | |
} | |
], | |
"immutableReferences": {}, | |
"linkReferences": {}, | |
"object": "608060405234801561001057600080fd5b506004361061002b5760003560e01c806348c981e214610030575b600080fd5b61004a600480360381019061004591906100fb565b61004c565b005b8073ffffffffffffffffffffffffffffffffffffffff166108fc670de0b6b3a76400009081150290604051600060405180830381858888f1935050505015801561009a573d6000803e3d6000fd5b508073ffffffffffffffffffffffffffffffffffffffff166108fc60649081150290604051600060405180830381858888f193505050501580156100e2573d6000803e3d6000fd5b5050565b6000813590506100f581610156565b92915050565b60006020828403121561010d57600080fd5b600061011b848285016100e6565b91505092915050565b600061012f82610136565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b61015f81610124565b811461016a57600080fd5b5056fea26469706673582212200d27769719f950dccb5986cee0b893ead3141c6f7918c84931dbc54101b71b1d64736f6c63430008040033", | |
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x2B JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x48C981E2 EQ PUSH2 0x30 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4A PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x45 SWAP2 SWAP1 PUSH2 0xFB JUMP JUMPDEST PUSH2 0x4C JUMP JUMPDEST STOP JUMPDEST DUP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH2 0x8FC PUSH8 0xDE0B6B3A7640000 SWAP1 DUP2 ISZERO MUL SWAP1 PUSH1 0x40 MLOAD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0x9A JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP DUP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH2 0x8FC PUSH1 0x64 SWAP1 DUP2 ISZERO MUL SWAP1 PUSH1 0x40 MLOAD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0xE2 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xF5 DUP2 PUSH2 0x156 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x10D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x11B DUP5 DUP3 DUP6 ADD PUSH2 0xE6 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x12F DUP3 PUSH2 0x136 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x15F DUP2 PUSH2 0x124 JUMP JUMPDEST DUP2 EQ PUSH2 0x16A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xD 0x27 PUSH23 0x9719F950DCCB5986CEE0B893EAD3141C6F7918C84931DB 0xC5 COINBASE ADD 0xB7 SHL SAR PUSH5 0x736F6C6343 STOP ADDMOD DIV STOP CALLER ", | |
"sourceMap": "25:288:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;96:210;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;161:9;:18;;:27;180:7;161:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;267:9;:18;;:23;286:3;267:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;96:210;:::o;7:155:1:-;61:5;99:6;86:20;77:29;;115:41;150:5;115:41;:::i;:::-;67:95;;;;:::o;168:278::-;235:6;284:2;272:9;263:7;259:23;255:32;252:2;;;300:1;297;290:12;252:2;343:1;368:61;421:7;412:6;401:9;397:22;368:61;:::i;:::-;358:71;;314:125;242:204;;;;:::o;452:104::-;497:7;526:24;544:5;526:24;:::i;:::-;515:35;;505:51;;;:::o;562:126::-;599:7;639:42;632:5;628:54;617:65;;607:81;;;:::o;694:138::-;775:32;801:5;775:32;:::i;:::-;768:5;765:43;755:2;;822:1;819;812:12;755:2;745:87;:::o" | |
}, | |
"gasEstimates": { | |
"creation": { | |
"codeDepositCost": "83800", | |
"executionCost": "135", | |
"totalCost": "83935" | |
}, | |
"external": { | |
"sendEther(address)": "infinite" | |
} | |
}, | |
"methodIdentifiers": { | |
"sendEther(address)": "48c981e2" | |
} | |
}, | |
"abi": [ | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address payable", | |
"name": "recipient", | |
"type": "address" | |
} | |
], | |
"name": "sendEther", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"compiler": { | |
"version": "0.8.4+commit.c7e474f2" | |
}, | |
"language": "Solidity", | |
"output": { | |
"abi": [ | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address payable", | |
"name": "recipient", | |
"type": "address" | |
} | |
], | |
"name": "sendEther", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
} | |
], | |
"devdoc": { | |
"kind": "dev", | |
"methods": {}, | |
"version": 1 | |
}, | |
"userdoc": { | |
"kind": "user", | |
"methods": {}, | |
"version": 1 | |
} | |
}, | |
"settings": { | |
"compilationTarget": { | |
"fromContract.sol": "MyContract" | |
}, | |
"evmVersion": "istanbul", | |
"libraries": {}, | |
"metadata": { | |
"bytecodeHash": "ipfs" | |
}, | |
"optimizer": { | |
"enabled": false, | |
"runs": 200 | |
}, | |
"remappings": [] | |
}, | |
"sources": { | |
"fromContract.sol": { | |
"keccak256": "0xfe45ba7e013409b84fe0b62d8965772220712eb091d2cc28b4183406d0d536df", | |
"urls": [ | |
"bzz-raw://ab3f542093f2635c31cfd8d36249e71356e4f1750da9666681ac3a9461ceed94", | |
"dweb:/ipfs/QmPfmnRqZAj3q22N6zbc5sG8YTg3CnqwedB8oqpaxVqLvm" | |
] | |
} | |
}, | |
"version": 1 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.8.4; | |
contract MyContract { | |
event NewTrade( | |
uint indexed date, | |
address indexed from, | |
address indexed to, | |
uint amount | |
); | |
function trade(address _to, uint _amount) external{ | |
emit NewTrade(block.timestamp, msg.sender, _to, _amount); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.8.4; | |
contract MyContract { | |
address payable [] recipients; | |
function sendEther(address payable recipient) external { | |
recipient.transfer(1 ether); | |
//transfer 1 etehr from this smart contract to recipient | |
recipient.transfer(100); | |
msg.sender.transfer(100); | |
recipient.send(1 ether); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.8.4; | |
contract MyContract { | |
// 1. Storage | |
uint a; | |
struct User { | |
string name; | |
} | |
User[] users; | |
function foo () external { | |
uint b; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.8.4; | |
contract MyContract { | |
mapping(address => uint) balances; | |
function invest() external payable{ | |
if(msg.value < 1000){ | |
revert(); | |
} | |
balances[msg.sender] += msg.value; | |
} | |
function balaceOf() external view returns(uint){ | |
return address(this).balance; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment