Created
November 21, 2021 15:26
-
-
Save redsx/50644ece58df16e1d20ee19d20a161a0 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.7+commit.e28d00a7.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
| 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. |
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
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity >=0.7.0 <0.9.0; | |
| /** | |
| * @title Storage | |
| * @dev Store & retrieve value in a variable | |
| */ | |
| contract Storage { | |
| uint256 number; | |
| /** | |
| * @dev Store value in variable | |
| * @param num value to store | |
| */ | |
| function store(uint256 num) public { | |
| number = num; | |
| } | |
| /** | |
| * @dev Return value | |
| * @return value of 'number' | |
| */ | |
| function retrieve() public view returns (uint256){ | |
| return number; | |
| } | |
| } |
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
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity >=0.7.0 <0.9.0; | |
| /** | |
| * @title Owner | |
| * @dev Set & change owner | |
| */ | |
| contract Owner { | |
| address private owner; | |
| // event for EVM logging | |
| event OwnerSet(address indexed oldOwner, address indexed newOwner); | |
| // modifier to check if caller is owner | |
| modifier isOwner() { | |
| // If the first argument of 'require' evaluates to 'false', execution terminates and all | |
| // changes to the state and to Ether balances are reverted. | |
| // This used to consume all gas in old EVM versions, but not anymore. | |
| // It is often a good idea to use 'require' to check if functions are called correctly. | |
| // As a second argument, you can also provide an explanation about what went wrong. | |
| require(msg.sender == owner, "Caller is not owner"); | |
| _; | |
| } | |
| /** | |
| * @dev Set contract deployer as owner | |
| */ | |
| constructor() { | |
| owner = msg.sender; // 'msg.sender' is sender of current call, contract deployer for a constructor | |
| emit OwnerSet(address(0), owner); | |
| } | |
| /** | |
| * @dev Change owner | |
| * @param newOwner address of new owner | |
| */ | |
| function changeOwner(address newOwner) public isOwner { | |
| emit OwnerSet(owner, newOwner); | |
| owner = newOwner; | |
| } | |
| /** | |
| * @dev Return owner address | |
| * @return address of owner | |
| */ | |
| function getOwner() external view returns (address) { | |
| return owner; | |
| } | |
| } |
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
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity >=0.7.0 <0.9.0; | |
| /** | |
| * @title Ballot | |
| * @dev Implements voting process along with vote delegation | |
| */ | |
| contract Ballot { | |
| struct Voter { | |
| uint weight; // weight is accumulated by delegation | |
| bool voted; // if true, that person already voted | |
| address delegate; // person delegated to | |
| uint vote; // index of the voted proposal | |
| } | |
| struct Proposal { | |
| // If you can limit the length to a certain number of bytes, | |
| // always use one of bytes1 to bytes32 because they are much cheaper | |
| bytes32 name; // short name (up to 32 bytes) | |
| uint voteCount; // number of accumulated votes | |
| } | |
| address public chairperson; | |
| mapping(address => Voter) public voters; | |
| Proposal[] public proposals; | |
| /** | |
| * @dev Create a new ballot to choose one of 'proposalNames'. | |
| * @param proposalNames names of proposals | |
| */ | |
| constructor(bytes32[] memory proposalNames) { | |
| chairperson = msg.sender; | |
| voters[chairperson].weight = 1; | |
| for (uint i = 0; i < proposalNames.length; i++) { | |
| // 'Proposal({...})' creates a temporary | |
| // Proposal object and 'proposals.push(...)' | |
| // appends it to the end of 'proposals'. | |
| proposals.push(Proposal({ | |
| name: proposalNames[i], | |
| voteCount: 0 | |
| })); | |
| } | |
| } | |
| /** | |
| * @dev Give 'voter' the right to vote on this ballot. May only be called by 'chairperson'. | |
| * @param voter address of voter | |
| */ | |
| function giveRightToVote(address voter) public { | |
| require( | |
| msg.sender == chairperson, | |
| "Only chairperson can give right to vote." | |
| ); | |
| require( | |
| !voters[voter].voted, | |
| "The voter already voted." | |
| ); | |
| require(voters[voter].weight == 0); | |
| voters[voter].weight = 1; | |
| } | |
| /** | |
| * @dev Delegate your vote to the voter 'to'. | |
| * @param to address to which vote is delegated | |
| */ | |
| function delegate(address to) public { | |
| Voter storage sender = voters[msg.sender]; | |
| require(!sender.voted, "You already voted."); | |
| require(to != msg.sender, "Self-delegation is disallowed."); | |
| while (voters[to].delegate != address(0)) { | |
| to = voters[to].delegate; | |
| // We found a loop in the delegation, not allowed. | |
| require(to != msg.sender, "Found loop in delegation."); | |
| } | |
| sender.voted = true; | |
| sender.delegate = to; | |
| Voter storage delegate_ = voters[to]; | |
| if (delegate_.voted) { | |
| // If the delegate already voted, | |
| // directly add to the number of votes | |
| proposals[delegate_.vote].voteCount += sender.weight; | |
| } else { | |
| // If the delegate did not vote yet, | |
| // add to her weight. | |
| delegate_.weight += sender.weight; | |
| } | |
| } | |
| /** | |
| * @dev Give your vote (including votes delegated to you) to proposal 'proposals[proposal].name'. | |
| * @param proposal index of proposal in the proposals array | |
| */ | |
| function vote(uint proposal) public { | |
| Voter storage sender = voters[msg.sender]; | |
| require(sender.weight != 0, "Has no right to vote"); | |
| require(!sender.voted, "Already voted."); | |
| sender.voted = true; | |
| sender.vote = proposal; | |
| // If 'proposal' is out of the range of the array, | |
| // this will throw automatically and revert all | |
| // changes. | |
| proposals[proposal].voteCount += sender.weight; | |
| } | |
| /** | |
| * @dev Computes the winning proposal taking all previous votes into account. | |
| * @return winningProposal_ index of winning proposal in the proposals array | |
| */ | |
| function winningProposal() public view | |
| returns (uint winningProposal_) | |
| { | |
| uint winningVoteCount = 0; | |
| for (uint p = 0; p < proposals.length; p++) { | |
| if (proposals[p].voteCount > winningVoteCount) { | |
| winningVoteCount = proposals[p].voteCount; | |
| winningProposal_ = p; | |
| } | |
| } | |
| } | |
| /** | |
| * @dev Calls winningProposal() function to get the index of the winner contained in the proposals array and then | |
| * @return winnerName_ the name of the winner | |
| */ | |
| function winnerName() public view | |
| returns (bytes32 winnerName_) | |
| { | |
| winnerName_ = proposals[winningProposal()].name; | |
| } | |
| } |
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": { | |
| "functionDebugData": {}, | |
| "generatedSources": [], | |
| "linkReferences": {}, | |
| "object": "6080604052336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555034801561005057600080fd5b50610327806100606000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063445df0ac146100465780638da5cb5b14610064578063fdacd57614610082575b600080fd5b61004e61009e565b60405161005b919061021e565b60405180910390f35b61006c6100a4565b60405161007991906101e3565b60405180910390f35b61009c60048036038101906100979190610175565b6100c8565b005b60015481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610156576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161014d906101fe565b60405180910390fd5b8060018190555050565b60008135905061016f816102da565b92915050565b60006020828403121561018b5761018a610286565b5b600061019984828501610160565b91505092915050565b6101ab8161024a565b82525050565b60006101be603383610239565b91506101c98261028b565b604082019050919050565b6101dd8161027c565b82525050565b60006020820190506101f860008301846101a2565b92915050565b60006020820190508181036000830152610217816101b1565b9050919050565b600060208201905061023360008301846101d4565b92915050565b600082825260208201905092915050565b60006102558261025c565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600080fd5b7f546869732066756e6374696f6e206973207265737472696374656420746f207460008201527f686520636f6e74726163742773206f776e657200000000000000000000000000602082015250565b6102e38161027c565b81146102ee57600080fd5b5056fea2646970667358221220d5288d5a306f342529149d95bc7098b3b221c97d8d2c19ed83ad8fbfa93bfc4564736f6c63430008070033", | |
| "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLER PUSH1 0x0 DUP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP CALLVALUE DUP1 ISZERO PUSH2 0x50 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x327 DUP1 PUSH2 0x60 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 0x41 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x445DF0AC EQ PUSH2 0x46 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x64 JUMPI DUP1 PUSH4 0xFDACD576 EQ PUSH2 0x82 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4E PUSH2 0x9E JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x5B SWAP2 SWAP1 PUSH2 0x21E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x6C PUSH2 0xA4 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x79 SWAP2 SWAP1 PUSH2 0x1E3 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x9C PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x97 SWAP2 SWAP1 PUSH2 0x175 JUMP JUMPDEST PUSH2 0xC8 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x1 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x156 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x14D SWAP1 PUSH2 0x1FE JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP1 PUSH1 0x1 DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x16F DUP2 PUSH2 0x2DA JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x18B JUMPI PUSH2 0x18A PUSH2 0x286 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x199 DUP5 DUP3 DUP6 ADD PUSH2 0x160 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x1AB DUP2 PUSH2 0x24A JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1BE PUSH1 0x33 DUP4 PUSH2 0x239 JUMP JUMPDEST SWAP2 POP PUSH2 0x1C9 DUP3 PUSH2 0x28B JUMP JUMPDEST PUSH1 0x40 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x1DD DUP2 PUSH2 0x27C JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x1F8 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1A2 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x217 DUP2 PUSH2 0x1B1 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x233 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1D4 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x255 DUP3 PUSH2 0x25C JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH32 0x546869732066756E6374696F6E206973207265737472696374656420746F2074 PUSH1 0x0 DUP3 ADD MSTORE PUSH32 0x686520636F6E74726163742773206F776E657200000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH2 0x2E3 DUP2 PUSH2 0x27C JUMP JUMPDEST DUP2 EQ PUSH2 0x2EE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xD5 0x28 DUP14 GAS ADDRESS PUSH16 0x342529149D95BC7098B3B221C97D8D2C NOT 0xED DUP4 0xAD DUP16 0xBF 0xA9 EXTCODESIZE 0xFC GASLIMIT PUSH5 0x736F6C6343 STOP ADDMOD SMOD STOP CALLER ", | |
| "sourceMap": "69:367:0:-:0;;;117:10;94:33;;;;;;;;;;;;;;;;;;;;69:367;;;;;;;;;;;;;;;;" | |
| }, | |
| "deployedBytecode": { | |
| "functionDebugData": { | |
| "@last_completed_migration_7": { | |
| "entryPoint": 158, | |
| "id": 7, | |
| "parameterSlots": 0, | |
| "returnSlots": 0 | |
| }, | |
| "@owner_5": { | |
| "entryPoint": 164, | |
| "id": 5, | |
| "parameterSlots": 0, | |
| "returnSlots": 0 | |
| }, | |
| "@setCompleted_31": { | |
| "entryPoint": 200, | |
| "id": 31, | |
| "parameterSlots": 1, | |
| "returnSlots": 0 | |
| }, | |
| "abi_decode_t_uint256": { | |
| "entryPoint": 352, | |
| "id": null, | |
| "parameterSlots": 2, | |
| "returnSlots": 1 | |
| }, | |
| "abi_decode_tuple_t_uint256": { | |
| "entryPoint": 373, | |
| "id": null, | |
| "parameterSlots": 2, | |
| "returnSlots": 1 | |
| }, | |
| "abi_encode_t_address_to_t_address_fromStack": { | |
| "entryPoint": 418, | |
| "id": null, | |
| "parameterSlots": 2, | |
| "returnSlots": 0 | |
| }, | |
| "abi_encode_t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1_to_t_string_memory_ptr_fromStack": { | |
| "entryPoint": 433, | |
| "id": null, | |
| "parameterSlots": 1, | |
| "returnSlots": 1 | |
| }, | |
| "abi_encode_t_uint256_to_t_uint256_fromStack": { | |
| "entryPoint": 468, | |
| "id": null, | |
| "parameterSlots": 2, | |
| "returnSlots": 0 | |
| }, | |
| "abi_encode_tuple_t_address__to_t_address__fromStack_reversed": { | |
| "entryPoint": 483, | |
| "id": null, | |
| "parameterSlots": 2, | |
| "returnSlots": 1 | |
| }, | |
| "abi_encode_tuple_t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1__to_t_string_memory_ptr__fromStack_reversed": { | |
| "entryPoint": 510, | |
| "id": null, | |
| "parameterSlots": 1, | |
| "returnSlots": 1 | |
| }, | |
| "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed": { | |
| "entryPoint": 542, | |
| "id": null, | |
| "parameterSlots": 2, | |
| "returnSlots": 1 | |
| }, | |
| "allocate_unbounded": { | |
| "entryPoint": null, | |
| "id": null, | |
| "parameterSlots": 0, | |
| "returnSlots": 1 | |
| }, | |
| "array_storeLengthForEncoding_t_string_memory_ptr_fromStack": { | |
| "entryPoint": 569, | |
| "id": null, | |
| "parameterSlots": 2, | |
| "returnSlots": 1 | |
| }, | |
| "cleanup_t_address": { | |
| "entryPoint": 586, | |
| "id": null, | |
| "parameterSlots": 1, | |
| "returnSlots": 1 | |
| }, | |
| "cleanup_t_uint160": { | |
| "entryPoint": 604, | |
| "id": null, | |
| "parameterSlots": 1, | |
| "returnSlots": 1 | |
| }, | |
| "cleanup_t_uint256": { | |
| "entryPoint": 636, | |
| "id": null, | |
| "parameterSlots": 1, | |
| "returnSlots": 1 | |
| }, | |
| "revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db": { | |
| "entryPoint": null, | |
| "id": null, | |
| "parameterSlots": 0, | |
| "returnSlots": 0 | |
| }, | |
| "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b": { | |
| "entryPoint": 646, | |
| "id": null, | |
| "parameterSlots": 0, | |
| "returnSlots": 0 | |
| }, | |
| "store_literal_in_memory_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1": { | |
| "entryPoint": 651, | |
| "id": null, | |
| "parameterSlots": 1, | |
| "returnSlots": 0 | |
| }, | |
| "validator_revert_t_uint256": { | |
| "entryPoint": 730, | |
| "id": null, | |
| "parameterSlots": 1, | |
| "returnSlots": 0 | |
| } | |
| }, | |
| "generatedSources": [ | |
| { | |
| "ast": { | |
| "nodeType": "YulBlock", | |
| "src": "0:3176:1", | |
| "statements": [ | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "59:87:1", | |
| "statements": [ | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "69:29:1", | |
| "value": { | |
| "arguments": [ | |
| { | |
| "name": "offset", | |
| "nodeType": "YulIdentifier", | |
| "src": "91:6:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "calldataload", | |
| "nodeType": "YulIdentifier", | |
| "src": "78:12:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "78:20:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulIdentifier", | |
| "src": "69:5:1" | |
| } | |
| ] | |
| }, | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulIdentifier", | |
| "src": "134:5:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "validator_revert_t_uint256", | |
| "nodeType": "YulIdentifier", | |
| "src": "107:26:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "107:33:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "107:33:1" | |
| } | |
| ] | |
| }, | |
| "name": "abi_decode_t_uint256", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "offset", | |
| "nodeType": "YulTypedName", | |
| "src": "37:6:1", | |
| "type": "" | |
| }, | |
| { | |
| "name": "end", | |
| "nodeType": "YulTypedName", | |
| "src": "45:3:1", | |
| "type": "" | |
| } | |
| ], | |
| "returnVariables": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulTypedName", | |
| "src": "53:5:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "7:139:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "218:263:1", | |
| "statements": [ | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "264:83:1", | |
| "statements": [ | |
| { | |
| "expression": { | |
| "arguments": [], | |
| "functionName": { | |
| "name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", | |
| "nodeType": "YulIdentifier", | |
| "src": "266:77:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "266:79:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "266:79:1" | |
| } | |
| ] | |
| }, | |
| "condition": { | |
| "arguments": [ | |
| { | |
| "arguments": [ | |
| { | |
| "name": "dataEnd", | |
| "nodeType": "YulIdentifier", | |
| "src": "239:7:1" | |
| }, | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulIdentifier", | |
| "src": "248:9:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "sub", | |
| "nodeType": "YulIdentifier", | |
| "src": "235:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "235:23:1" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "260:2:1", | |
| "type": "", | |
| "value": "32" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "slt", | |
| "nodeType": "YulIdentifier", | |
| "src": "231:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "231:32:1" | |
| }, | |
| "nodeType": "YulIf", | |
| "src": "228:119:1" | |
| }, | |
| { | |
| "nodeType": "YulBlock", | |
| "src": "357:117:1", | |
| "statements": [ | |
| { | |
| "nodeType": "YulVariableDeclaration", | |
| "src": "372:15:1", | |
| "value": { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "386:1:1", | |
| "type": "", | |
| "value": "0" | |
| }, | |
| "variables": [ | |
| { | |
| "name": "offset", | |
| "nodeType": "YulTypedName", | |
| "src": "376:6:1", | |
| "type": "" | |
| } | |
| ] | |
| }, | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "401:63:1", | |
| "value": { | |
| "arguments": [ | |
| { | |
| "arguments": [ | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulIdentifier", | |
| "src": "436:9:1" | |
| }, | |
| { | |
| "name": "offset", | |
| "nodeType": "YulIdentifier", | |
| "src": "447:6:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "add", | |
| "nodeType": "YulIdentifier", | |
| "src": "432:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "432:22:1" | |
| }, | |
| { | |
| "name": "dataEnd", | |
| "nodeType": "YulIdentifier", | |
| "src": "456:7:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "abi_decode_t_uint256", | |
| "nodeType": "YulIdentifier", | |
| "src": "411:20:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "411:53:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "value0", | |
| "nodeType": "YulIdentifier", | |
| "src": "401:6:1" | |
| } | |
| ] | |
| } | |
| ] | |
| } | |
| ] | |
| }, | |
| "name": "abi_decode_tuple_t_uint256", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulTypedName", | |
| "src": "188:9:1", | |
| "type": "" | |
| }, | |
| { | |
| "name": "dataEnd", | |
| "nodeType": "YulTypedName", | |
| "src": "199:7:1", | |
| "type": "" | |
| } | |
| ], | |
| "returnVariables": [ | |
| { | |
| "name": "value0", | |
| "nodeType": "YulTypedName", | |
| "src": "211:6:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "152:329:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "552:53:1", | |
| "statements": [ | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "name": "pos", | |
| "nodeType": "YulIdentifier", | |
| "src": "569:3:1" | |
| }, | |
| { | |
| "arguments": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulIdentifier", | |
| "src": "592:5:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "cleanup_t_address", | |
| "nodeType": "YulIdentifier", | |
| "src": "574:17:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "574:24:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "mstore", | |
| "nodeType": "YulIdentifier", | |
| "src": "562:6:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "562:37:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "562:37:1" | |
| } | |
| ] | |
| }, | |
| "name": "abi_encode_t_address_to_t_address_fromStack", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulTypedName", | |
| "src": "540:5:1", | |
| "type": "" | |
| }, | |
| { | |
| "name": "pos", | |
| "nodeType": "YulTypedName", | |
| "src": "547:3:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "487:118:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "757:220:1", | |
| "statements": [ | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "767:74:1", | |
| "value": { | |
| "arguments": [ | |
| { | |
| "name": "pos", | |
| "nodeType": "YulIdentifier", | |
| "src": "833:3:1" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "838:2:1", | |
| "type": "", | |
| "value": "51" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", | |
| "nodeType": "YulIdentifier", | |
| "src": "774:58:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "774:67:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "pos", | |
| "nodeType": "YulIdentifier", | |
| "src": "767:3:1" | |
| } | |
| ] | |
| }, | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "name": "pos", | |
| "nodeType": "YulIdentifier", | |
| "src": "939:3:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "store_literal_in_memory_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1", | |
| "nodeType": "YulIdentifier", | |
| "src": "850:88:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "850:93:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "850:93:1" | |
| }, | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "952:19:1", | |
| "value": { | |
| "arguments": [ | |
| { | |
| "name": "pos", | |
| "nodeType": "YulIdentifier", | |
| "src": "963:3:1" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "968:2:1", | |
| "type": "", | |
| "value": "64" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "add", | |
| "nodeType": "YulIdentifier", | |
| "src": "959:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "959:12:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "end", | |
| "nodeType": "YulIdentifier", | |
| "src": "952:3:1" | |
| } | |
| ] | |
| } | |
| ] | |
| }, | |
| "name": "abi_encode_t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1_to_t_string_memory_ptr_fromStack", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "pos", | |
| "nodeType": "YulTypedName", | |
| "src": "745:3:1", | |
| "type": "" | |
| } | |
| ], | |
| "returnVariables": [ | |
| { | |
| "name": "end", | |
| "nodeType": "YulTypedName", | |
| "src": "753:3:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "611:366:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "1048:53:1", | |
| "statements": [ | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "name": "pos", | |
| "nodeType": "YulIdentifier", | |
| "src": "1065:3:1" | |
| }, | |
| { | |
| "arguments": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulIdentifier", | |
| "src": "1088:5:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "cleanup_t_uint256", | |
| "nodeType": "YulIdentifier", | |
| "src": "1070:17:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1070:24:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "mstore", | |
| "nodeType": "YulIdentifier", | |
| "src": "1058:6:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1058:37:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "1058:37:1" | |
| } | |
| ] | |
| }, | |
| "name": "abi_encode_t_uint256_to_t_uint256_fromStack", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulTypedName", | |
| "src": "1036:5:1", | |
| "type": "" | |
| }, | |
| { | |
| "name": "pos", | |
| "nodeType": "YulTypedName", | |
| "src": "1043:3:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "983:118:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "1205:124:1", | |
| "statements": [ | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "1215:26:1", | |
| "value": { | |
| "arguments": [ | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulIdentifier", | |
| "src": "1227:9:1" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "1238:2:1", | |
| "type": "", | |
| "value": "32" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "add", | |
| "nodeType": "YulIdentifier", | |
| "src": "1223:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1223:18:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "tail", | |
| "nodeType": "YulIdentifier", | |
| "src": "1215:4:1" | |
| } | |
| ] | |
| }, | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "name": "value0", | |
| "nodeType": "YulIdentifier", | |
| "src": "1295:6:1" | |
| }, | |
| { | |
| "arguments": [ | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulIdentifier", | |
| "src": "1308:9:1" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "1319:1:1", | |
| "type": "", | |
| "value": "0" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "add", | |
| "nodeType": "YulIdentifier", | |
| "src": "1304:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1304:17:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "abi_encode_t_address_to_t_address_fromStack", | |
| "nodeType": "YulIdentifier", | |
| "src": "1251:43:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1251:71:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "1251:71:1" | |
| } | |
| ] | |
| }, | |
| "name": "abi_encode_tuple_t_address__to_t_address__fromStack_reversed", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulTypedName", | |
| "src": "1177:9:1", | |
| "type": "" | |
| }, | |
| { | |
| "name": "value0", | |
| "nodeType": "YulTypedName", | |
| "src": "1189:6:1", | |
| "type": "" | |
| } | |
| ], | |
| "returnVariables": [ | |
| { | |
| "name": "tail", | |
| "nodeType": "YulTypedName", | |
| "src": "1200:4:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "1107:222:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "1506:248:1", | |
| "statements": [ | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "1516:26:1", | |
| "value": { | |
| "arguments": [ | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulIdentifier", | |
| "src": "1528:9:1" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "1539:2:1", | |
| "type": "", | |
| "value": "32" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "add", | |
| "nodeType": "YulIdentifier", | |
| "src": "1524:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1524:18:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "tail", | |
| "nodeType": "YulIdentifier", | |
| "src": "1516:4:1" | |
| } | |
| ] | |
| }, | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "arguments": [ | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulIdentifier", | |
| "src": "1563:9:1" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "1574:1:1", | |
| "type": "", | |
| "value": "0" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "add", | |
| "nodeType": "YulIdentifier", | |
| "src": "1559:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1559:17:1" | |
| }, | |
| { | |
| "arguments": [ | |
| { | |
| "name": "tail", | |
| "nodeType": "YulIdentifier", | |
| "src": "1582:4:1" | |
| }, | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulIdentifier", | |
| "src": "1588:9:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "sub", | |
| "nodeType": "YulIdentifier", | |
| "src": "1578:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1578:20:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "mstore", | |
| "nodeType": "YulIdentifier", | |
| "src": "1552:6:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1552:47:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "1552:47:1" | |
| }, | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "1608:139:1", | |
| "value": { | |
| "arguments": [ | |
| { | |
| "name": "tail", | |
| "nodeType": "YulIdentifier", | |
| "src": "1742:4:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "abi_encode_t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1_to_t_string_memory_ptr_fromStack", | |
| "nodeType": "YulIdentifier", | |
| "src": "1616:124:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1616:131:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "tail", | |
| "nodeType": "YulIdentifier", | |
| "src": "1608:4:1" | |
| } | |
| ] | |
| } | |
| ] | |
| }, | |
| "name": "abi_encode_tuple_t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1__to_t_string_memory_ptr__fromStack_reversed", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulTypedName", | |
| "src": "1486:9:1", | |
| "type": "" | |
| } | |
| ], | |
| "returnVariables": [ | |
| { | |
| "name": "tail", | |
| "nodeType": "YulTypedName", | |
| "src": "1501:4:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "1335:419:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "1858:124:1", | |
| "statements": [ | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "1868:26:1", | |
| "value": { | |
| "arguments": [ | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulIdentifier", | |
| "src": "1880:9:1" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "1891:2:1", | |
| "type": "", | |
| "value": "32" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "add", | |
| "nodeType": "YulIdentifier", | |
| "src": "1876:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1876:18:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "tail", | |
| "nodeType": "YulIdentifier", | |
| "src": "1868:4:1" | |
| } | |
| ] | |
| }, | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "name": "value0", | |
| "nodeType": "YulIdentifier", | |
| "src": "1948:6:1" | |
| }, | |
| { | |
| "arguments": [ | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulIdentifier", | |
| "src": "1961:9:1" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "1972:1:1", | |
| "type": "", | |
| "value": "0" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "add", | |
| "nodeType": "YulIdentifier", | |
| "src": "1957:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1957:17:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "abi_encode_t_uint256_to_t_uint256_fromStack", | |
| "nodeType": "YulIdentifier", | |
| "src": "1904:43:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1904:71:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "1904:71:1" | |
| } | |
| ] | |
| }, | |
| "name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulTypedName", | |
| "src": "1830:9:1", | |
| "type": "" | |
| }, | |
| { | |
| "name": "value0", | |
| "nodeType": "YulTypedName", | |
| "src": "1842:6:1", | |
| "type": "" | |
| } | |
| ], | |
| "returnVariables": [ | |
| { | |
| "name": "tail", | |
| "nodeType": "YulTypedName", | |
| "src": "1853:4:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "1760:222:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "2028:35:1", | |
| "statements": [ | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "2038:19:1", | |
| "value": { | |
| "arguments": [ | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "2054:2:1", | |
| "type": "", | |
| "value": "64" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "mload", | |
| "nodeType": "YulIdentifier", | |
| "src": "2048:5:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2048:9:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "memPtr", | |
| "nodeType": "YulIdentifier", | |
| "src": "2038:6:1" | |
| } | |
| ] | |
| } | |
| ] | |
| }, | |
| "name": "allocate_unbounded", | |
| "nodeType": "YulFunctionDefinition", | |
| "returnVariables": [ | |
| { | |
| "name": "memPtr", | |
| "nodeType": "YulTypedName", | |
| "src": "2021:6:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "1988:75:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "2165:73:1", | |
| "statements": [ | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "name": "pos", | |
| "nodeType": "YulIdentifier", | |
| "src": "2182:3:1" | |
| }, | |
| { | |
| "name": "length", | |
| "nodeType": "YulIdentifier", | |
| "src": "2187:6:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "mstore", | |
| "nodeType": "YulIdentifier", | |
| "src": "2175:6:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2175:19:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "2175:19:1" | |
| }, | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "2203:29:1", | |
| "value": { | |
| "arguments": [ | |
| { | |
| "name": "pos", | |
| "nodeType": "YulIdentifier", | |
| "src": "2222:3:1" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "2227:4:1", | |
| "type": "", | |
| "value": "0x20" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "add", | |
| "nodeType": "YulIdentifier", | |
| "src": "2218:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2218:14:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "updated_pos", | |
| "nodeType": "YulIdentifier", | |
| "src": "2203:11:1" | |
| } | |
| ] | |
| } | |
| ] | |
| }, | |
| "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "pos", | |
| "nodeType": "YulTypedName", | |
| "src": "2137:3:1", | |
| "type": "" | |
| }, | |
| { | |
| "name": "length", | |
| "nodeType": "YulTypedName", | |
| "src": "2142:6:1", | |
| "type": "" | |
| } | |
| ], | |
| "returnVariables": [ | |
| { | |
| "name": "updated_pos", | |
| "nodeType": "YulTypedName", | |
| "src": "2153:11:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "2069:169:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "2289:51:1", | |
| "statements": [ | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "2299:35:1", | |
| "value": { | |
| "arguments": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulIdentifier", | |
| "src": "2328:5:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "cleanup_t_uint160", | |
| "nodeType": "YulIdentifier", | |
| "src": "2310:17:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2310:24:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "cleaned", | |
| "nodeType": "YulIdentifier", | |
| "src": "2299:7:1" | |
| } | |
| ] | |
| } | |
| ] | |
| }, | |
| "name": "cleanup_t_address", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulTypedName", | |
| "src": "2271:5:1", | |
| "type": "" | |
| } | |
| ], | |
| "returnVariables": [ | |
| { | |
| "name": "cleaned", | |
| "nodeType": "YulTypedName", | |
| "src": "2281:7:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "2244:96:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "2391:81:1", | |
| "statements": [ | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "2401:65:1", | |
| "value": { | |
| "arguments": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulIdentifier", | |
| "src": "2416:5:1" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "2423:42:1", | |
| "type": "", | |
| "value": "0xffffffffffffffffffffffffffffffffffffffff" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "and", | |
| "nodeType": "YulIdentifier", | |
| "src": "2412:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2412:54:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "cleaned", | |
| "nodeType": "YulIdentifier", | |
| "src": "2401:7:1" | |
| } | |
| ] | |
| } | |
| ] | |
| }, | |
| "name": "cleanup_t_uint160", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulTypedName", | |
| "src": "2373:5:1", | |
| "type": "" | |
| } | |
| ], | |
| "returnVariables": [ | |
| { | |
| "name": "cleaned", | |
| "nodeType": "YulTypedName", | |
| "src": "2383:7:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "2346:126:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "2523:32:1", | |
| "statements": [ | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "2533:16:1", | |
| "value": { | |
| "name": "value", | |
| "nodeType": "YulIdentifier", | |
| "src": "2544:5:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "cleaned", | |
| "nodeType": "YulIdentifier", | |
| "src": "2533:7:1" | |
| } | |
| ] | |
| } | |
| ] | |
| }, | |
| "name": "cleanup_t_uint256", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulTypedName", | |
| "src": "2505:5:1", | |
| "type": "" | |
| } | |
| ], | |
| "returnVariables": [ | |
| { | |
| "name": "cleaned", | |
| "nodeType": "YulTypedName", | |
| "src": "2515:7:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "2478:77:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "2650:28:1", | |
| "statements": [ | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "2667:1:1", | |
| "type": "", | |
| "value": "0" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "2670:1:1", | |
| "type": "", | |
| "value": "0" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "revert", | |
| "nodeType": "YulIdentifier", | |
| "src": "2660:6:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2660:12:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "2660:12:1" | |
| } | |
| ] | |
| }, | |
| "name": "revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db", | |
| "nodeType": "YulFunctionDefinition", | |
| "src": "2561:117:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "2773:28:1", | |
| "statements": [ | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "2790:1:1", | |
| "type": "", | |
| "value": "0" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "2793:1:1", | |
| "type": "", | |
| "value": "0" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "revert", | |
| "nodeType": "YulIdentifier", | |
| "src": "2783:6:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2783:12:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "2783:12:1" | |
| } | |
| ] | |
| }, | |
| "name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", | |
| "nodeType": "YulFunctionDefinition", | |
| "src": "2684:117:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "2913:132:1", | |
| "statements": [ | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "arguments": [ | |
| { | |
| "name": "memPtr", | |
| "nodeType": "YulIdentifier", | |
| "src": "2935:6:1" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "2943:1:1", | |
| "type": "", | |
| "value": "0" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "add", | |
| "nodeType": "YulIdentifier", | |
| "src": "2931:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2931:14:1" | |
| }, | |
| { | |
| "hexValue": "546869732066756e6374696f6e206973207265737472696374656420746f2074", | |
| "kind": "string", | |
| "nodeType": "YulLiteral", | |
| "src": "2947:34:1", | |
| "type": "", | |
| "value": "This function is restricted to t" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "mstore", | |
| "nodeType": "YulIdentifier", | |
| "src": "2924:6:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2924:58:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "2924:58:1" | |
| }, | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "arguments": [ | |
| { | |
| "name": "memPtr", | |
| "nodeType": "YulIdentifier", | |
| "src": "3003:6:1" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "3011:2:1", | |
| "type": "", | |
| "value": "32" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "add", | |
| "nodeType": "YulIdentifier", | |
| "src": "2999:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2999:15:1" | |
| }, | |
| { | |
| "hexValue": "686520636f6e74726163742773206f776e6572", | |
| "kind": "string", | |
| "nodeType": "YulLiteral", | |
| "src": "3016:21:1", | |
| "type": "", | |
| "value": "he contract's owner" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "mstore", | |
| "nodeType": "YulIdentifier", | |
| "src": "2992:6:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2992:46:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "2992:46:1" | |
| } | |
| ] | |
| }, | |
| "name": "store_literal_in_memory_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "memPtr", | |
| "nodeType": "YulTypedName", | |
| "src": "2905:6:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "2807:238:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "3094:79:1", | |
| "statements": [ | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "3151:16:1", | |
| "statements": [ | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "3160:1:1", | |
| "type": "", | |
| "value": "0" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "3163:1:1", | |
| "type": "", | |
| "value": "0" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "revert", | |
| "nodeType": "YulIdentifier", | |
| "src": "3153:6:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "3153:12:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "3153:12:1" | |
| } | |
| ] | |
| }, | |
| "condition": { | |
| "arguments": [ | |
| { | |
| "arguments": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulIdentifier", | |
| "src": "3117:5:1" | |
| }, | |
| { | |
| "arguments": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulIdentifier", | |
| "src": "3142:5:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "cleanup_t_uint256", | |
| "nodeType": "YulIdentifier", | |
| "src": "3124:17:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "3124:24:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "eq", | |
| "nodeType": "YulIdentifier", | |
| "src": "3114:2:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "3114:35:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "iszero", | |
| "nodeType": "YulIdentifier", | |
| "src": "3107:6:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "3107:43:1" | |
| }, | |
| "nodeType": "YulIf", | |
| "src": "3104:63:1" | |
| } | |
| ] | |
| }, | |
| "name": "validator_revert_t_uint256", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulTypedName", | |
| "src": "3087:5:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "3051:122:1" | |
| } | |
| ] | |
| }, | |
| "contents": "{\n\n function abi_decode_t_uint256(offset, end) -> value {\n value := calldataload(offset)\n validator_revert_t_uint256(value)\n }\n\n function abi_decode_tuple_t_uint256(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_uint256(add(headStart, offset), dataEnd)\n }\n\n }\n\n function abi_encode_t_address_to_t_address_fromStack(value, pos) {\n mstore(pos, cleanup_t_address(value))\n }\n\n function abi_encode_t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 51)\n store_literal_in_memory_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1(pos)\n end := add(pos, 64)\n }\n\n function abi_encode_t_uint256_to_t_uint256_fromStack(value, pos) {\n mstore(pos, cleanup_t_uint256(value))\n }\n\n function abi_encode_tuple_t_address__to_t_address__fromStack_reversed(headStart , value0) -> tail {\n tail := add(headStart, 32)\n\n abi_encode_t_address_to_t_address_fromStack(value0, add(headStart, 0))\n\n }\n\n function abi_encode_tuple_t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n function abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed(headStart , value0) -> tail {\n tail := add(headStart, 32)\n\n abi_encode_t_uint256_to_t_uint256_fromStack(value0, add(headStart, 0))\n\n }\n\n function allocate_unbounded() -> memPtr {\n memPtr := mload(64)\n }\n\n function array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, length) -> updated_pos {\n mstore(pos, length)\n updated_pos := add(pos, 0x20)\n }\n\n function cleanup_t_address(value) -> cleaned {\n cleaned := cleanup_t_uint160(value)\n }\n\n function cleanup_t_uint160(value) -> cleaned {\n cleaned := and(value, 0xffffffffffffffffffffffffffffffffffffffff)\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() {\n revert(0, 0)\n }\n\n function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {\n revert(0, 0)\n }\n\n function store_literal_in_memory_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1(memPtr) {\n\n mstore(add(memPtr, 0), \"This function is restricted to t\")\n\n mstore(add(memPtr, 32), \"he contract's owner\")\n\n }\n\n function validator_revert_t_uint256(value) {\n if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }\n }\n\n}\n", | |
| "id": 1, | |
| "language": "Yul", | |
| "name": "#utility.yul" | |
| } | |
| ], | |
| "immutableReferences": {}, | |
| "linkReferences": {}, | |
| "object": "608060405234801561001057600080fd5b50600436106100415760003560e01c8063445df0ac146100465780638da5cb5b14610064578063fdacd57614610082575b600080fd5b61004e61009e565b60405161005b919061021e565b60405180910390f35b61006c6100a4565b60405161007991906101e3565b60405180910390f35b61009c60048036038101906100979190610175565b6100c8565b005b60015481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610156576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161014d906101fe565b60405180910390fd5b8060018190555050565b60008135905061016f816102da565b92915050565b60006020828403121561018b5761018a610286565b5b600061019984828501610160565b91505092915050565b6101ab8161024a565b82525050565b60006101be603383610239565b91506101c98261028b565b604082019050919050565b6101dd8161027c565b82525050565b60006020820190506101f860008301846101a2565b92915050565b60006020820190508181036000830152610217816101b1565b9050919050565b600060208201905061023360008301846101d4565b92915050565b600082825260208201905092915050565b60006102558261025c565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600080fd5b7f546869732066756e6374696f6e206973207265737472696374656420746f207460008201527f686520636f6e74726163742773206f776e657200000000000000000000000000602082015250565b6102e38161027c565b81146102ee57600080fd5b5056fea2646970667358221220d5288d5a306f342529149d95bc7098b3b221c97d8d2c19ed83ad8fbfa93bfc4564736f6c63430008070033", | |
| "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x41 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x445DF0AC EQ PUSH2 0x46 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x64 JUMPI DUP1 PUSH4 0xFDACD576 EQ PUSH2 0x82 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4E PUSH2 0x9E JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x5B SWAP2 SWAP1 PUSH2 0x21E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x6C PUSH2 0xA4 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x79 SWAP2 SWAP1 PUSH2 0x1E3 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x9C PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x97 SWAP2 SWAP1 PUSH2 0x175 JUMP JUMPDEST PUSH2 0xC8 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x1 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x156 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x14D SWAP1 PUSH2 0x1FE JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP1 PUSH1 0x1 DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x16F DUP2 PUSH2 0x2DA JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x18B JUMPI PUSH2 0x18A PUSH2 0x286 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x199 DUP5 DUP3 DUP6 ADD PUSH2 0x160 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x1AB DUP2 PUSH2 0x24A JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1BE PUSH1 0x33 DUP4 PUSH2 0x239 JUMP JUMPDEST SWAP2 POP PUSH2 0x1C9 DUP3 PUSH2 0x28B JUMP JUMPDEST PUSH1 0x40 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x1DD DUP2 PUSH2 0x27C JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x1F8 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1A2 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x217 DUP2 PUSH2 0x1B1 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x233 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1D4 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x255 DUP3 PUSH2 0x25C JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH32 0x546869732066756E6374696F6E206973207265737472696374656420746F2074 PUSH1 0x0 DUP3 ADD MSTORE PUSH32 0x686520636F6E74726163742773206F776E657200000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH2 0x2E3 DUP2 PUSH2 0x27C JUMP JUMPDEST DUP2 EQ PUSH2 0x2EE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xD5 0x28 DUP14 GAS ADDRESS PUSH16 0x342529149D95BC7098B3B221C97D8D2C NOT 0xED DUP4 0xAD DUP16 0xBF 0xA9 EXTCODESIZE 0xFC GASLIMIT PUSH5 0x736F6C6343 STOP ADDMOD SMOD STOP CALLER ", | |
| "sourceMap": "69:367:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;132:36;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;94:33;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;328:105;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;132:36;;;;:::o;94:33::-;;;;;;;;;;;;:::o;328:105::-;234:5;;;;;;;;;;220:19;;:10;:19;;;204:104;;;;;;;;;;;;:::i;:::-;;;;;;;;;418:9:::1;391:24;:36;;;;328:105:::0;:::o;7:139:1:-;53:5;91:6;78:20;69:29;;107:33;134:5;107:33;:::i;:::-;7:139;;;;:::o;152:329::-;211:6;260:2;248:9;239:7;235:23;231:32;228:119;;;266:79;;:::i;:::-;228:119;386:1;411:53;456:7;447:6;436:9;432:22;411:53;:::i;:::-;401:63;;357:117;152:329;;;;:::o;487:118::-;574:24;592:5;574:24;:::i;:::-;569:3;562:37;487:118;;:::o;611:366::-;753:3;774:67;838:2;833:3;774:67;:::i;:::-;767:74;;850:93;939:3;850:93;:::i;:::-;968:2;963:3;959:12;952:19;;611:366;;;:::o;983:118::-;1070:24;1088:5;1070:24;:::i;:::-;1065:3;1058:37;983:118;;:::o;1107:222::-;1200:4;1238:2;1227:9;1223:18;1215:26;;1251:71;1319:1;1308:9;1304:17;1295:6;1251:71;:::i;:::-;1107:222;;;;:::o;1335:419::-;1501:4;1539:2;1528:9;1524:18;1516:26;;1588:9;1582:4;1578:20;1574:1;1563:9;1559:17;1552:47;1616:131;1742:4;1616:131;:::i;:::-;1608:139;;1335:419;;;:::o;1760:222::-;1853:4;1891:2;1880:9;1876:18;1868:26;;1904:71;1972:1;1961:9;1957:17;1948:6;1904:71;:::i;:::-;1760:222;;;;:::o;2069:169::-;2153:11;2187:6;2182:3;2175:19;2227:4;2222:3;2218:14;2203:29;;2069:169;;;;:::o;2244:96::-;2281:7;2310:24;2328:5;2310:24;:::i;:::-;2299:35;;2244:96;;;:::o;2346:126::-;2383:7;2423:42;2416:5;2412:54;2401:65;;2346:126;;;:::o;2478:77::-;2515:7;2544:5;2533:16;;2478:77;;;:::o;2684:117::-;2793:1;2790;2783:12;2807:238;2947:34;2943:1;2935:6;2931:14;2924:58;3016:21;3011:2;3003:6;2999:15;2992:46;2807:238;:::o;3051:122::-;3124:24;3142:5;3124:24;:::i;:::-;3117:5;3114:35;3104:63;;3163:1;3160;3153:12;3104:63;3051:122;:::o" | |
| }, | |
| "gasEstimates": { | |
| "creation": { | |
| "codeDepositCost": "161400", | |
| "executionCost": "24474", | |
| "totalCost": "185874" | |
| }, | |
| "external": { | |
| "last_completed_migration()": "2407", | |
| "owner()": "2511", | |
| "setCompleted(uint256)": "24709" | |
| } | |
| }, | |
| "methodIdentifiers": { | |
| "last_completed_migration()": "445df0ac", | |
| "owner()": "8da5cb5b", | |
| "setCompleted(uint256)": "fdacd576" | |
| } | |
| }, | |
| "abi": [ | |
| { | |
| "inputs": [], | |
| "name": "last_completed_migration", | |
| "outputs": [ | |
| { | |
| "internalType": "uint256", | |
| "name": "", | |
| "type": "uint256" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [], | |
| "name": "owner", | |
| "outputs": [ | |
| { | |
| "internalType": "address", | |
| "name": "", | |
| "type": "address" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [ | |
| { | |
| "internalType": "uint256", | |
| "name": "completed", | |
| "type": "uint256" | |
| } | |
| ], | |
| "name": "setCompleted", | |
| "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.7+commit.e28d00a7" | |
| }, | |
| "language": "Solidity", | |
| "output": { | |
| "abi": [ | |
| { | |
| "inputs": [], | |
| "name": "last_completed_migration", | |
| "outputs": [ | |
| { | |
| "internalType": "uint256", | |
| "name": "", | |
| "type": "uint256" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [], | |
| "name": "owner", | |
| "outputs": [ | |
| { | |
| "internalType": "address", | |
| "name": "", | |
| "type": "address" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [ | |
| { | |
| "internalType": "uint256", | |
| "name": "completed", | |
| "type": "uint256" | |
| } | |
| ], | |
| "name": "setCompleted", | |
| "outputs": [], | |
| "stateMutability": "nonpayable", | |
| "type": "function" | |
| } | |
| ], | |
| "devdoc": { | |
| "kind": "dev", | |
| "methods": {}, | |
| "version": 1 | |
| }, | |
| "userdoc": { | |
| "kind": "user", | |
| "methods": {}, | |
| "version": 1 | |
| } | |
| }, | |
| "settings": { | |
| "compilationTarget": { | |
| "contracts/test.sol": "Migrations" | |
| }, | |
| "evmVersion": "london", | |
| "libraries": {}, | |
| "metadata": { | |
| "bytecodeHash": "ipfs" | |
| }, | |
| "optimizer": { | |
| "enabled": false, | |
| "runs": 200 | |
| }, | |
| "remappings": [] | |
| }, | |
| "sources": { | |
| "contracts/test.sol": { | |
| "keccak256": "0x70cf7ad76347f1e37197351f671d6033be2f1d514fd6f018d495c85494b951f0", | |
| "license": "MIT", | |
| "urls": [ | |
| "bzz-raw://27096293ae0ec55dd0562229d2b8050a95b348452d2e23f09909778a80a55b70", | |
| "dweb:/ipfs/QmUUicCTuEZUPrXpma1CQ65oey85gwTrhw7UAsCiqANeca" | |
| ] | |
| } | |
| }, | |
| "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
| // SPDX-License-Identifier: MIT | |
| pragma solidity >=0.4.22 <0.9.0; | |
| contract Migrations { | |
| address public owner = msg.sender; | |
| uint public last_completed_migration; | |
| modifier restricted() { | |
| require( | |
| msg.sender == owner, | |
| "This function is restricted to the contract's owner" | |
| ); | |
| _; | |
| } | |
| function setCompleted(uint completed) public restricted { | |
| last_completed_migration = completed; | |
| } | |
| } |
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
| // 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) | |
| } | |
| })() |
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
| // Right click on the script name and hit "Run" to execute | |
| (async () => { | |
| try { | |
| console.log('Running deployWithWeb3 script...') | |
| const contractName = 'Storage' // Change this for other contract | |
| const constructorArgs = [] // Put constructor args (if any) here for your contract | |
| // Note that the script needs the ABI which is generated from the compilation artifact. | |
| // Make sure contract is compiled and artifacts are generated | |
| const artifactsPath = `browser/contracts/artifacts/${contractName}.json` // Change this for different path | |
| const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath)) | |
| const accounts = await web3.eth.getAccounts() | |
| let contract = new web3.eth.Contract(metadata.abi) | |
| contract = contract.deploy({ | |
| data: metadata.data.bytecode.object, | |
| arguments: constructorArgs | |
| }) | |
| const newContractInstance = await contract.send({ | |
| from: accounts[0], | |
| gas: 1500000, | |
| gasPrice: '30000000000' | |
| }) | |
| console.log('Contract deployed at address: ', newContractInstance.options.address) | |
| } catch (e) { | |
| console.log(e.message) | |
| } | |
| })() |
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
| // 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