Created
April 30, 2021 10:49
-
-
Save ali2210/432bdf0381d77cc6fc43c3689d30a051 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=
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
| // 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; | |
| } | |
| } |
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": "608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506064600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610458806100c66000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806312514bba14610051578063ae90b2131461006d578063c71daccb1461008b578063e3d670d7146100a9575b600080fd5b61006b600480360381019061006691906102b6565b6100d9565b005b610075610153565b60405161008291906102fd565b60405180910390f35b610093610177565b6040516100a09190610318565b60405180910390f35b6100c360048036038101906100be919061028d565b61024b565b6040516100d09190610318565b60405180910390f35b80600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546101499190610333565b9250508190555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054116101e557600080fd5b600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905090565b60016020528060005260406000206000915090505481565b600081359050610272816103f4565b92915050565b6000813590506102878161040b565b92915050565b60006020828403121561029f57600080fd5b60006102ad84828501610263565b91505092915050565b6000602082840312156102c857600080fd5b60006102d684828501610278565b91505092915050565b6102e881610389565b82525050565b6102f7816103bb565b82525050565b600060208201905061031260008301846102df565b92915050565b600060208201905061032d60008301846102ee565b92915050565b600061033e826103bb565b9150610349836103bb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561037e5761037d6103c5565b5b828201905092915050565b60006103948261039b565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6103fd81610389565b811461040857600080fd5b50565b610414816103bb565b811461041f57600080fd5b5056fea26469706673582212203766cbddbaaf030183bee3bf97fa6d1dba2511ea67ecde57c3f9802860edcc1464736f6c63430008010033", | |
| "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP 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 PUSH1 0x64 PUSH1 0x1 PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP PUSH2 0x458 DUP1 PUSH2 0xC6 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 0x4C JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x12514BBA EQ PUSH2 0x51 JUMPI DUP1 PUSH4 0xAE90B213 EQ PUSH2 0x6D JUMPI DUP1 PUSH4 0xC71DACCB EQ PUSH2 0x8B JUMPI DUP1 PUSH4 0xE3D670D7 EQ PUSH2 0xA9 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x6B PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x66 SWAP2 SWAP1 PUSH2 0x2B6 JUMP JUMPDEST PUSH2 0xD9 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x75 PUSH2 0x153 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x82 SWAP2 SWAP1 PUSH2 0x2FD JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x93 PUSH2 0x177 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xA0 SWAP2 SWAP1 PUSH2 0x318 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0xC3 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0xBE SWAP2 SWAP1 PUSH2 0x28D JUMP JUMPDEST PUSH2 0x24B JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xD0 SWAP2 SWAP1 PUSH2 0x318 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST DUP1 PUSH1 0x1 PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD PUSH2 0x149 SWAP2 SWAP1 PUSH2 0x333 JUMP JUMPDEST SWAP3 POP POP DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1 PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD GT PUSH2 0x1E5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x272 DUP2 PUSH2 0x3F4 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x287 DUP2 PUSH2 0x40B JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x29F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x2AD DUP5 DUP3 DUP6 ADD PUSH2 0x263 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x2C8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x2D6 DUP5 DUP3 DUP6 ADD PUSH2 0x278 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x2E8 DUP2 PUSH2 0x389 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x2F7 DUP2 PUSH2 0x3BB JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x312 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x2DF JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x32D PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x2EE JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x33E DUP3 PUSH2 0x3BB JUMP JUMPDEST SWAP2 POP PUSH2 0x349 DUP4 PUSH2 0x3BB JUMP JUMPDEST SWAP3 POP DUP3 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SUB DUP3 GT ISZERO PUSH2 0x37E JUMPI PUSH2 0x37D PUSH2 0x3C5 JUMP JUMPDEST JUMPDEST DUP3 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x394 DUP3 PUSH2 0x39B 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 PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH2 0x3FD DUP2 PUSH2 0x389 JUMP JUMPDEST DUP2 EQ PUSH2 0x408 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH2 0x414 DUP2 PUSH2 0x3BB JUMP JUMPDEST DUP2 EQ PUSH2 0x41F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 CALLDATACOPY PUSH7 0xCBDDBAAF030183 0xBE 0xE3 0xBF SWAP8 STATICCALL PUSH14 0x1DBA2511EA67ECDE57C3F9802860 0xED 0xCC EQ PUSH5 0x736F6C6343 STOP ADDMOD ADD STOP CALLER ", | |
| "sourceMap": "34:402:0:-:0;;;130:82;;;;;;;;;;167:10;159:5;;:18;;;;;;;;;;;;;;;;;;203:3;186:7;:14;194:5;;;;;;;;;;;186:14;;;;;;;;;;;;;;;:20;;;;34:402;;;;;;" | |
| }, | |
| "deployedBytecode": { | |
| "generatedSources": [ | |
| { | |
| "ast": { | |
| "nodeType": "YulBlock", | |
| "src": "0:2604: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_address", | |
| "nodeType": "YulIdentifier", | |
| "src": "107:26:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "107:33:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "107:33:1" | |
| } | |
| ] | |
| }, | |
| "name": "abi_decode_t_address", | |
| "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": "204:87:1", | |
| "statements": [ | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "214:29:1", | |
| "value": { | |
| "arguments": [ | |
| { | |
| "name": "offset", | |
| "nodeType": "YulIdentifier", | |
| "src": "236:6:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "calldataload", | |
| "nodeType": "YulIdentifier", | |
| "src": "223:12:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "223:20:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulIdentifier", | |
| "src": "214:5:1" | |
| } | |
| ] | |
| }, | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulIdentifier", | |
| "src": "279:5:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "validator_revert_t_uint256", | |
| "nodeType": "YulIdentifier", | |
| "src": "252:26:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "252:33:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "252:33:1" | |
| } | |
| ] | |
| }, | |
| "name": "abi_decode_t_uint256", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "offset", | |
| "nodeType": "YulTypedName", | |
| "src": "182:6:1", | |
| "type": "" | |
| }, | |
| { | |
| "name": "end", | |
| "nodeType": "YulTypedName", | |
| "src": "190:3:1", | |
| "type": "" | |
| } | |
| ], | |
| "returnVariables": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulTypedName", | |
| "src": "198:5:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "152:139:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "363:196:1", | |
| "statements": [ | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "409:16:1", | |
| "statements": [ | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "418:1:1", | |
| "type": "", | |
| "value": "0" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "421:1:1", | |
| "type": "", | |
| "value": "0" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "revert", | |
| "nodeType": "YulIdentifier", | |
| "src": "411:6:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "411:12:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "411:12:1" | |
| } | |
| ] | |
| }, | |
| "condition": { | |
| "arguments": [ | |
| { | |
| "arguments": [ | |
| { | |
| "name": "dataEnd", | |
| "nodeType": "YulIdentifier", | |
| "src": "384:7:1" | |
| }, | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulIdentifier", | |
| "src": "393:9:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "sub", | |
| "nodeType": "YulIdentifier", | |
| "src": "380:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "380:23:1" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "405:2:1", | |
| "type": "", | |
| "value": "32" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "slt", | |
| "nodeType": "YulIdentifier", | |
| "src": "376:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "376:32:1" | |
| }, | |
| "nodeType": "YulIf", | |
| "src": "373:2:1" | |
| }, | |
| { | |
| "nodeType": "YulBlock", | |
| "src": "435:117:1", | |
| "statements": [ | |
| { | |
| "nodeType": "YulVariableDeclaration", | |
| "src": "450:15:1", | |
| "value": { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "464:1:1", | |
| "type": "", | |
| "value": "0" | |
| }, | |
| "variables": [ | |
| { | |
| "name": "offset", | |
| "nodeType": "YulTypedName", | |
| "src": "454:6:1", | |
| "type": "" | |
| } | |
| ] | |
| }, | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "479:63:1", | |
| "value": { | |
| "arguments": [ | |
| { | |
| "arguments": [ | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulIdentifier", | |
| "src": "514:9:1" | |
| }, | |
| { | |
| "name": "offset", | |
| "nodeType": "YulIdentifier", | |
| "src": "525:6:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "add", | |
| "nodeType": "YulIdentifier", | |
| "src": "510:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "510:22:1" | |
| }, | |
| { | |
| "name": "dataEnd", | |
| "nodeType": "YulIdentifier", | |
| "src": "534:7:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "abi_decode_t_address", | |
| "nodeType": "YulIdentifier", | |
| "src": "489:20:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "489:53:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "value0", | |
| "nodeType": "YulIdentifier", | |
| "src": "479:6:1" | |
| } | |
| ] | |
| } | |
| ] | |
| } | |
| ] | |
| }, | |
| "name": "abi_decode_tuple_t_address", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulTypedName", | |
| "src": "333:9:1", | |
| "type": "" | |
| }, | |
| { | |
| "name": "dataEnd", | |
| "nodeType": "YulTypedName", | |
| "src": "344:7:1", | |
| "type": "" | |
| } | |
| ], | |
| "returnVariables": [ | |
| { | |
| "name": "value0", | |
| "nodeType": "YulTypedName", | |
| "src": "356:6:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "297:262:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "631:196:1", | |
| "statements": [ | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "677:16:1", | |
| "statements": [ | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "686:1:1", | |
| "type": "", | |
| "value": "0" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "689:1:1", | |
| "type": "", | |
| "value": "0" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "revert", | |
| "nodeType": "YulIdentifier", | |
| "src": "679:6:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "679:12:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "679:12:1" | |
| } | |
| ] | |
| }, | |
| "condition": { | |
| "arguments": [ | |
| { | |
| "arguments": [ | |
| { | |
| "name": "dataEnd", | |
| "nodeType": "YulIdentifier", | |
| "src": "652:7:1" | |
| }, | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulIdentifier", | |
| "src": "661:9:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "sub", | |
| "nodeType": "YulIdentifier", | |
| "src": "648:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "648:23:1" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "673:2:1", | |
| "type": "", | |
| "value": "32" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "slt", | |
| "nodeType": "YulIdentifier", | |
| "src": "644:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "644:32:1" | |
| }, | |
| "nodeType": "YulIf", | |
| "src": "641:2:1" | |
| }, | |
| { | |
| "nodeType": "YulBlock", | |
| "src": "703:117:1", | |
| "statements": [ | |
| { | |
| "nodeType": "YulVariableDeclaration", | |
| "src": "718:15:1", | |
| "value": { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "732:1:1", | |
| "type": "", | |
| "value": "0" | |
| }, | |
| "variables": [ | |
| { | |
| "name": "offset", | |
| "nodeType": "YulTypedName", | |
| "src": "722:6:1", | |
| "type": "" | |
| } | |
| ] | |
| }, | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "747:63:1", | |
| "value": { | |
| "arguments": [ | |
| { | |
| "arguments": [ | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulIdentifier", | |
| "src": "782:9:1" | |
| }, | |
| { | |
| "name": "offset", | |
| "nodeType": "YulIdentifier", | |
| "src": "793:6:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "add", | |
| "nodeType": "YulIdentifier", | |
| "src": "778:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "778:22:1" | |
| }, | |
| { | |
| "name": "dataEnd", | |
| "nodeType": "YulIdentifier", | |
| "src": "802:7:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "abi_decode_t_uint256", | |
| "nodeType": "YulIdentifier", | |
| "src": "757:20:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "757:53:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "value0", | |
| "nodeType": "YulIdentifier", | |
| "src": "747:6:1" | |
| } | |
| ] | |
| } | |
| ] | |
| } | |
| ] | |
| }, | |
| "name": "abi_decode_tuple_t_uint256", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulTypedName", | |
| "src": "601:9:1", | |
| "type": "" | |
| }, | |
| { | |
| "name": "dataEnd", | |
| "nodeType": "YulTypedName", | |
| "src": "612:7:1", | |
| "type": "" | |
| } | |
| ], | |
| "returnVariables": [ | |
| { | |
| "name": "value0", | |
| "nodeType": "YulTypedName", | |
| "src": "624:6:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "565:262:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "898:53:1", | |
| "statements": [ | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "name": "pos", | |
| "nodeType": "YulIdentifier", | |
| "src": "915:3:1" | |
| }, | |
| { | |
| "arguments": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulIdentifier", | |
| "src": "938:5:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "cleanup_t_address", | |
| "nodeType": "YulIdentifier", | |
| "src": "920:17:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "920:24:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "mstore", | |
| "nodeType": "YulIdentifier", | |
| "src": "908:6:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "908:37:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "908:37:1" | |
| } | |
| ] | |
| }, | |
| "name": "abi_encode_t_address_to_t_address_fromStack", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulTypedName", | |
| "src": "886:5:1", | |
| "type": "" | |
| }, | |
| { | |
| "name": "pos", | |
| "nodeType": "YulTypedName", | |
| "src": "893:3:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "833:118:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "1022:53:1", | |
| "statements": [ | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "name": "pos", | |
| "nodeType": "YulIdentifier", | |
| "src": "1039:3:1" | |
| }, | |
| { | |
| "arguments": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulIdentifier", | |
| "src": "1062:5:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "cleanup_t_uint256", | |
| "nodeType": "YulIdentifier", | |
| "src": "1044:17:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1044:24:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "mstore", | |
| "nodeType": "YulIdentifier", | |
| "src": "1032:6:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1032:37:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "1032:37:1" | |
| } | |
| ] | |
| }, | |
| "name": "abi_encode_t_uint256_to_t_uint256_fromStack", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulTypedName", | |
| "src": "1010:5:1", | |
| "type": "" | |
| }, | |
| { | |
| "name": "pos", | |
| "nodeType": "YulTypedName", | |
| "src": "1017:3:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "957:118:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "1179:124:1", | |
| "statements": [ | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "1189:26:1", | |
| "value": { | |
| "arguments": [ | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulIdentifier", | |
| "src": "1201:9:1" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "1212:2:1", | |
| "type": "", | |
| "value": "32" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "add", | |
| "nodeType": "YulIdentifier", | |
| "src": "1197:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1197:18:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "tail", | |
| "nodeType": "YulIdentifier", | |
| "src": "1189:4:1" | |
| } | |
| ] | |
| }, | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "name": "value0", | |
| "nodeType": "YulIdentifier", | |
| "src": "1269:6:1" | |
| }, | |
| { | |
| "arguments": [ | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulIdentifier", | |
| "src": "1282:9:1" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "1293:1:1", | |
| "type": "", | |
| "value": "0" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "add", | |
| "nodeType": "YulIdentifier", | |
| "src": "1278:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1278:17:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "abi_encode_t_address_to_t_address_fromStack", | |
| "nodeType": "YulIdentifier", | |
| "src": "1225:43:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1225:71:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "1225:71:1" | |
| } | |
| ] | |
| }, | |
| "name": "abi_encode_tuple_t_address__to_t_address__fromStack_reversed", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulTypedName", | |
| "src": "1151:9:1", | |
| "type": "" | |
| }, | |
| { | |
| "name": "value0", | |
| "nodeType": "YulTypedName", | |
| "src": "1163:6:1", | |
| "type": "" | |
| } | |
| ], | |
| "returnVariables": [ | |
| { | |
| "name": "tail", | |
| "nodeType": "YulTypedName", | |
| "src": "1174:4:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "1081:222:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "1407:124:1", | |
| "statements": [ | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "1417:26:1", | |
| "value": { | |
| "arguments": [ | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulIdentifier", | |
| "src": "1429:9:1" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "1440:2:1", | |
| "type": "", | |
| "value": "32" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "add", | |
| "nodeType": "YulIdentifier", | |
| "src": "1425:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1425:18:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "tail", | |
| "nodeType": "YulIdentifier", | |
| "src": "1417:4:1" | |
| } | |
| ] | |
| }, | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "name": "value0", | |
| "nodeType": "YulIdentifier", | |
| "src": "1497:6:1" | |
| }, | |
| { | |
| "arguments": [ | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulIdentifier", | |
| "src": "1510:9:1" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "1521:1:1", | |
| "type": "", | |
| "value": "0" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "add", | |
| "nodeType": "YulIdentifier", | |
| "src": "1506:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1506:17:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "abi_encode_t_uint256_to_t_uint256_fromStack", | |
| "nodeType": "YulIdentifier", | |
| "src": "1453:43:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1453:71:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "1453:71:1" | |
| } | |
| ] | |
| }, | |
| "name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "headStart", | |
| "nodeType": "YulTypedName", | |
| "src": "1379:9:1", | |
| "type": "" | |
| }, | |
| { | |
| "name": "value0", | |
| "nodeType": "YulTypedName", | |
| "src": "1391:6:1", | |
| "type": "" | |
| } | |
| ], | |
| "returnVariables": [ | |
| { | |
| "name": "tail", | |
| "nodeType": "YulTypedName", | |
| "src": "1402:4:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "1309:222:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "1581:261:1", | |
| "statements": [ | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "1591:25:1", | |
| "value": { | |
| "arguments": [ | |
| { | |
| "name": "x", | |
| "nodeType": "YulIdentifier", | |
| "src": "1614:1:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "cleanup_t_uint256", | |
| "nodeType": "YulIdentifier", | |
| "src": "1596:17:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1596:20:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "x", | |
| "nodeType": "YulIdentifier", | |
| "src": "1591:1:1" | |
| } | |
| ] | |
| }, | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "1625:25:1", | |
| "value": { | |
| "arguments": [ | |
| { | |
| "name": "y", | |
| "nodeType": "YulIdentifier", | |
| "src": "1648:1:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "cleanup_t_uint256", | |
| "nodeType": "YulIdentifier", | |
| "src": "1630:17:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1630:20:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "y", | |
| "nodeType": "YulIdentifier", | |
| "src": "1625:1:1" | |
| } | |
| ] | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "1788:22:1", | |
| "statements": [ | |
| { | |
| "expression": { | |
| "arguments": [], | |
| "functionName": { | |
| "name": "panic_error_0x11", | |
| "nodeType": "YulIdentifier", | |
| "src": "1790:16:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1790:18:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "1790:18:1" | |
| } | |
| ] | |
| }, | |
| "condition": { | |
| "arguments": [ | |
| { | |
| "name": "x", | |
| "nodeType": "YulIdentifier", | |
| "src": "1709:1:1" | |
| }, | |
| { | |
| "arguments": [ | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "1716:66:1", | |
| "type": "", | |
| "value": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" | |
| }, | |
| { | |
| "name": "y", | |
| "nodeType": "YulIdentifier", | |
| "src": "1784:1:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "sub", | |
| "nodeType": "YulIdentifier", | |
| "src": "1712:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1712:74:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "gt", | |
| "nodeType": "YulIdentifier", | |
| "src": "1706:2:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1706:81:1" | |
| }, | |
| "nodeType": "YulIf", | |
| "src": "1703:2:1" | |
| }, | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "1820:16:1", | |
| "value": { | |
| "arguments": [ | |
| { | |
| "name": "x", | |
| "nodeType": "YulIdentifier", | |
| "src": "1831:1:1" | |
| }, | |
| { | |
| "name": "y", | |
| "nodeType": "YulIdentifier", | |
| "src": "1834:1:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "add", | |
| "nodeType": "YulIdentifier", | |
| "src": "1827:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1827:9:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "sum", | |
| "nodeType": "YulIdentifier", | |
| "src": "1820:3:1" | |
| } | |
| ] | |
| } | |
| ] | |
| }, | |
| "name": "checked_add_t_uint256", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "x", | |
| "nodeType": "YulTypedName", | |
| "src": "1568:1:1", | |
| "type": "" | |
| }, | |
| { | |
| "name": "y", | |
| "nodeType": "YulTypedName", | |
| "src": "1571:1:1", | |
| "type": "" | |
| } | |
| ], | |
| "returnVariables": [ | |
| { | |
| "name": "sum", | |
| "nodeType": "YulTypedName", | |
| "src": "1577:3:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "1537:305:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "1893:51:1", | |
| "statements": [ | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "1903:35:1", | |
| "value": { | |
| "arguments": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulIdentifier", | |
| "src": "1932:5:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "cleanup_t_uint160", | |
| "nodeType": "YulIdentifier", | |
| "src": "1914:17:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "1914:24:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "cleaned", | |
| "nodeType": "YulIdentifier", | |
| "src": "1903:7:1" | |
| } | |
| ] | |
| } | |
| ] | |
| }, | |
| "name": "cleanup_t_address", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulTypedName", | |
| "src": "1875:5:1", | |
| "type": "" | |
| } | |
| ], | |
| "returnVariables": [ | |
| { | |
| "name": "cleaned", | |
| "nodeType": "YulTypedName", | |
| "src": "1885:7:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "1848:96:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "1995:81:1", | |
| "statements": [ | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "2005:65:1", | |
| "value": { | |
| "arguments": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulIdentifier", | |
| "src": "2020:5:1" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "2027:42:1", | |
| "type": "", | |
| "value": "0xffffffffffffffffffffffffffffffffffffffff" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "and", | |
| "nodeType": "YulIdentifier", | |
| "src": "2016:3:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2016:54:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "cleaned", | |
| "nodeType": "YulIdentifier", | |
| "src": "2005:7:1" | |
| } | |
| ] | |
| } | |
| ] | |
| }, | |
| "name": "cleanup_t_uint160", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulTypedName", | |
| "src": "1977:5:1", | |
| "type": "" | |
| } | |
| ], | |
| "returnVariables": [ | |
| { | |
| "name": "cleaned", | |
| "nodeType": "YulTypedName", | |
| "src": "1987:7:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "1950:126:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "2127:32:1", | |
| "statements": [ | |
| { | |
| "nodeType": "YulAssignment", | |
| "src": "2137:16:1", | |
| "value": { | |
| "name": "value", | |
| "nodeType": "YulIdentifier", | |
| "src": "2148:5:1" | |
| }, | |
| "variableNames": [ | |
| { | |
| "name": "cleaned", | |
| "nodeType": "YulIdentifier", | |
| "src": "2137:7:1" | |
| } | |
| ] | |
| } | |
| ] | |
| }, | |
| "name": "cleanup_t_uint256", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulTypedName", | |
| "src": "2109:5:1", | |
| "type": "" | |
| } | |
| ], | |
| "returnVariables": [ | |
| { | |
| "name": "cleaned", | |
| "nodeType": "YulTypedName", | |
| "src": "2119:7:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "2082:77:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "2193:152:1", | |
| "statements": [ | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "2210:1:1", | |
| "type": "", | |
| "value": "0" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "2213:77:1", | |
| "type": "", | |
| "value": "35408467139433450592217433187231851964531694900788300625387963629091585785856" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "mstore", | |
| "nodeType": "YulIdentifier", | |
| "src": "2203:6:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2203:88:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "2203:88:1" | |
| }, | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "2307:1:1", | |
| "type": "", | |
| "value": "4" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "2310:4:1", | |
| "type": "", | |
| "value": "0x11" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "mstore", | |
| "nodeType": "YulIdentifier", | |
| "src": "2300:6:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2300:15:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "2300:15:1" | |
| }, | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "2331:1:1", | |
| "type": "", | |
| "value": "0" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "2334:4:1", | |
| "type": "", | |
| "value": "0x24" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "revert", | |
| "nodeType": "YulIdentifier", | |
| "src": "2324:6:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2324:15:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "2324:15:1" | |
| } | |
| ] | |
| }, | |
| "name": "panic_error_0x11", | |
| "nodeType": "YulFunctionDefinition", | |
| "src": "2165:180:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "2394:79:1", | |
| "statements": [ | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "2451:16:1", | |
| "statements": [ | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "2460:1:1", | |
| "type": "", | |
| "value": "0" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "2463:1:1", | |
| "type": "", | |
| "value": "0" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "revert", | |
| "nodeType": "YulIdentifier", | |
| "src": "2453:6:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2453:12:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "2453:12:1" | |
| } | |
| ] | |
| }, | |
| "condition": { | |
| "arguments": [ | |
| { | |
| "arguments": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulIdentifier", | |
| "src": "2417:5:1" | |
| }, | |
| { | |
| "arguments": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulIdentifier", | |
| "src": "2442:5:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "cleanup_t_address", | |
| "nodeType": "YulIdentifier", | |
| "src": "2424:17:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2424:24:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "eq", | |
| "nodeType": "YulIdentifier", | |
| "src": "2414:2:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2414:35:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "iszero", | |
| "nodeType": "YulIdentifier", | |
| "src": "2407:6:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2407:43:1" | |
| }, | |
| "nodeType": "YulIf", | |
| "src": "2404:2:1" | |
| } | |
| ] | |
| }, | |
| "name": "validator_revert_t_address", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulTypedName", | |
| "src": "2387:5:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "2351:122:1" | |
| }, | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "2522:79:1", | |
| "statements": [ | |
| { | |
| "body": { | |
| "nodeType": "YulBlock", | |
| "src": "2579:16:1", | |
| "statements": [ | |
| { | |
| "expression": { | |
| "arguments": [ | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "2588:1:1", | |
| "type": "", | |
| "value": "0" | |
| }, | |
| { | |
| "kind": "number", | |
| "nodeType": "YulLiteral", | |
| "src": "2591:1:1", | |
| "type": "", | |
| "value": "0" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "revert", | |
| "nodeType": "YulIdentifier", | |
| "src": "2581:6:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2581:12:1" | |
| }, | |
| "nodeType": "YulExpressionStatement", | |
| "src": "2581:12:1" | |
| } | |
| ] | |
| }, | |
| "condition": { | |
| "arguments": [ | |
| { | |
| "arguments": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulIdentifier", | |
| "src": "2545:5:1" | |
| }, | |
| { | |
| "arguments": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulIdentifier", | |
| "src": "2570:5:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "cleanup_t_uint256", | |
| "nodeType": "YulIdentifier", | |
| "src": "2552:17:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2552:24:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "eq", | |
| "nodeType": "YulIdentifier", | |
| "src": "2542:2:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2542:35:1" | |
| } | |
| ], | |
| "functionName": { | |
| "name": "iszero", | |
| "nodeType": "YulIdentifier", | |
| "src": "2535:6:1" | |
| }, | |
| "nodeType": "YulFunctionCall", | |
| "src": "2535:43:1" | |
| }, | |
| "nodeType": "YulIf", | |
| "src": "2532:2:1" | |
| } | |
| ] | |
| }, | |
| "name": "validator_revert_t_uint256", | |
| "nodeType": "YulFunctionDefinition", | |
| "parameters": [ | |
| { | |
| "name": "value", | |
| "nodeType": "YulTypedName", | |
| "src": "2515:5:1", | |
| "type": "" | |
| } | |
| ], | |
| "src": "2479:122:1" | |
| } | |
| ] | |
| }, | |
| "contents": "{\n\n function abi_decode_t_address(offset, end) -> value {\n value := calldataload(offset)\n validator_revert_t_address(value)\n }\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_address(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(add(headStart, offset), dataEnd)\n }\n\n }\n\n function abi_decode_tuple_t_uint256(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_uint256(add(headStart, offset), dataEnd)\n }\n\n }\n\n function abi_encode_t_address_to_t_address_fromStack(value, pos) {\n mstore(pos, cleanup_t_address(value))\n }\n\n function abi_encode_t_uint256_to_t_uint256_fromStack(value, pos) {\n mstore(pos, cleanup_t_uint256(value))\n }\n\n function abi_encode_tuple_t_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_uint256__to_t_uint256__fromStack_reversed(headStart , value0) -> tail {\n tail := add(headStart, 32)\n\n abi_encode_t_uint256_to_t_uint256_fromStack(value0, add(headStart, 0))\n\n }\n\n function checked_add_t_uint256(x, y) -> sum {\n x := cleanup_t_uint256(x)\n y := cleanup_t_uint256(y)\n\n // overflow, if x > (maxValue - y)\n if gt(x, sub(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, y)) { panic_error_0x11() }\n\n sum := add(x, y)\n }\n\n function cleanup_t_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 panic_error_0x11() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n\n function validator_revert_t_address(value) {\n if iszero(eq(value, cleanup_t_address(value))) { revert(0, 0) }\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": "608060405234801561001057600080fd5b506004361061004c5760003560e01c806312514bba14610051578063ae90b2131461006d578063c71daccb1461008b578063e3d670d7146100a9575b600080fd5b61006b600480360381019061006691906102b6565b6100d9565b005b610075610153565b60405161008291906102fd565b60405180910390f35b610093610177565b6040516100a09190610318565b60405180910390f35b6100c360048036038101906100be919061028d565b61024b565b6040516100d09190610318565b60405180910390f35b80600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546101499190610333565b9250508190555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054116101e557600080fd5b600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905090565b60016020528060005260406000206000915090505481565b600081359050610272816103f4565b92915050565b6000813590506102878161040b565b92915050565b60006020828403121561029f57600080fd5b60006102ad84828501610263565b91505092915050565b6000602082840312156102c857600080fd5b60006102d684828501610278565b91505092915050565b6102e881610389565b82525050565b6102f7816103bb565b82525050565b600060208201905061031260008301846102df565b92915050565b600060208201905061032d60008301846102ee565b92915050565b600061033e826103bb565b9150610349836103bb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561037e5761037d6103c5565b5b828201905092915050565b60006103948261039b565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6103fd81610389565b811461040857600080fd5b50565b610414816103bb565b811461041f57600080fd5b5056fea26469706673582212203766cbddbaaf030183bee3bf97fa6d1dba2511ea67ecde57c3f9802860edcc1464736f6c63430008010033", | |
| "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x4C JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x12514BBA EQ PUSH2 0x51 JUMPI DUP1 PUSH4 0xAE90B213 EQ PUSH2 0x6D JUMPI DUP1 PUSH4 0xC71DACCB EQ PUSH2 0x8B JUMPI DUP1 PUSH4 0xE3D670D7 EQ PUSH2 0xA9 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x6B PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x66 SWAP2 SWAP1 PUSH2 0x2B6 JUMP JUMPDEST PUSH2 0xD9 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x75 PUSH2 0x153 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x82 SWAP2 SWAP1 PUSH2 0x2FD JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x93 PUSH2 0x177 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xA0 SWAP2 SWAP1 PUSH2 0x318 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0xC3 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0xBE SWAP2 SWAP1 PUSH2 0x28D JUMP JUMPDEST PUSH2 0x24B JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xD0 SWAP2 SWAP1 PUSH2 0x318 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST DUP1 PUSH1 0x1 PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD PUSH2 0x149 SWAP2 SWAP1 PUSH2 0x333 JUMP JUMPDEST SWAP3 POP POP DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1 PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD GT PUSH2 0x1E5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x272 DUP2 PUSH2 0x3F4 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x287 DUP2 PUSH2 0x40B JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x29F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x2AD DUP5 DUP3 DUP6 ADD PUSH2 0x263 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x2C8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x2D6 DUP5 DUP3 DUP6 ADD PUSH2 0x278 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x2E8 DUP2 PUSH2 0x389 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x2F7 DUP2 PUSH2 0x3BB JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x312 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x2DF JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x32D PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x2EE JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x33E DUP3 PUSH2 0x3BB JUMP JUMPDEST SWAP2 POP PUSH2 0x349 DUP4 PUSH2 0x3BB JUMP JUMPDEST SWAP3 POP DUP3 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SUB DUP3 GT ISZERO PUSH2 0x37E JUMPI PUSH2 0x37D PUSH2 0x3C5 JUMP JUMPDEST JUMPDEST DUP3 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x394 DUP3 PUSH2 0x39B 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 PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH2 0x3FD DUP2 PUSH2 0x389 JUMP JUMPDEST DUP2 EQ PUSH2 0x408 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH2 0x414 DUP2 PUSH2 0x3BB JUMP JUMPDEST DUP2 EQ PUSH2 0x41F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 CALLDATACOPY PUSH7 0xCBDDBAAF030183 0xBE 0xE3 0xBF SWAP8 STATICCALL PUSH14 0x1DBA2511EA67ECDE57C3F9802860 0xED 0xCC EQ PUSH5 0x736F6C6343 STOP ADDMOD ADD STOP CALLER ", | |
| "sourceMap": "34:402:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;352:79;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;53:20;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;220:124;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;79:43;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;352:79;419:6;402:7;:14;410:5;;;;;;;;;;;402:14;;;;;;;;;;;;;;;;:23;;;;;;;:::i;:::-;;;;;;;;352:79;:::o;53:20::-;;;;;;;;;;;;:::o;220:124::-;264:7;306:1;289:7;:14;297:5;;;;;;;;;;;289:14;;;;;;;;;;;;;;;;:18;281:27;;;;;;324:7;:14;332:5;;;;;;;;;;;324:14;;;;;;;;;;;;;;;;317:21;;220:124;:::o;79:43::-;;;;;;;;;;;;;;;;;:::o;7:139:1:-;;91:6;78:20;69:29;;107:33;134:5;107:33;:::i;:::-;59:87;;;;:::o;152:139::-;;236:6;223:20;214:29;;252:33;279:5;252:33;:::i;:::-;204:87;;;;:::o;297:262::-;;405:2;393:9;384:7;380:23;376:32;373:2;;;421:1;418;411:12;373:2;464:1;489:53;534:7;525:6;514:9;510:22;489:53;:::i;:::-;479:63;;435:117;363:196;;;;:::o;565:262::-;;673:2;661:9;652:7;648:23;644:32;641:2;;;689:1;686;679:12;641:2;732:1;757:53;802:7;793:6;782:9;778:22;757:53;:::i;:::-;747:63;;703:117;631:196;;;;:::o;833:118::-;920:24;938:5;920:24;:::i;:::-;915:3;908:37;898:53;;:::o;957:118::-;1044:24;1062:5;1044:24;:::i;:::-;1039:3;1032:37;1022:53;;:::o;1081:222::-;;1212:2;1201:9;1197:18;1189:26;;1225:71;1293:1;1282:9;1278:17;1269:6;1225:71;:::i;:::-;1179:124;;;;:::o;1309:222::-;;1440:2;1429:9;1425:18;1417:26;;1453:71;1521:1;1510:9;1506:17;1497:6;1453:71;:::i;:::-;1407:124;;;;:::o;1537:305::-;;1596:20;1614:1;1596:20;:::i;:::-;1591:25;;1630:20;1648:1;1630:20;:::i;:::-;1625:25;;1784:1;1716:66;1712:74;1709:1;1706:81;1703:2;;;1790:18;;:::i;:::-;1703:2;1834:1;1831;1827:9;1820:16;;1581:261;;;;:::o;1848:96::-;;1914:24;1932:5;1914:24;:::i;:::-;1903:35;;1893:51;;;:::o;1950:126::-;;2027:42;2020:5;2016:54;2005:65;;1995:81;;;:::o;2082:77::-;;2148:5;2137:16;;2127:32;;;:::o;2165:180::-;2213:77;2210:1;2203:88;2310:4;2307:1;2300:15;2334:4;2331:1;2324:15;2351:122;2424:24;2442:5;2424:24;:::i;:::-;2417:5;2414:35;2404:2;;2463:1;2460;2453:12;2404:2;2394:79;:::o;2479:122::-;2552:24;2570:5;2552:24;:::i;:::-;2545:5;2542:35;2532:2;;2591:1;2588;2581:12;2532:2;2522:79;:::o" | |
| }, | |
| "gasEstimates": { | |
| "creation": { | |
| "codeDepositCost": "222400", | |
| "executionCost": "42069", | |
| "totalCost": "264469" | |
| }, | |
| "external": { | |
| "balance(address)": "1558", | |
| "checkBalance()": "3834", | |
| "payee()": "1211", | |
| "transfer(uint256)": "infinite" | |
| } | |
| }, | |
| "methodIdentifiers": { | |
| "balance(address)": "e3d670d7", | |
| "checkBalance()": "c71daccb", | |
| "payee()": "ae90b213", | |
| "transfer(uint256)": "12514bba" | |
| } | |
| }, | |
| "abi": [ | |
| { | |
| "inputs": [], | |
| "stateMutability": "nonpayable", | |
| "type": "constructor" | |
| }, | |
| { | |
| "inputs": [ | |
| { | |
| "internalType": "address", | |
| "name": "", | |
| "type": "address" | |
| } | |
| ], | |
| "name": "balance", | |
| "outputs": [ | |
| { | |
| "internalType": "uint256", | |
| "name": "", | |
| "type": "uint256" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [], | |
| "name": "checkBalance", | |
| "outputs": [ | |
| { | |
| "internalType": "uint256", | |
| "name": "", | |
| "type": "uint256" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [], | |
| "name": "payee", | |
| "outputs": [ | |
| { | |
| "internalType": "address", | |
| "name": "", | |
| "type": "address" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [ | |
| { | |
| "internalType": "uint256", | |
| "name": "amount", | |
| "type": "uint256" | |
| } | |
| ], | |
| "name": "transfer", | |
| "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.1+commit.df193b15" | |
| }, | |
| "language": "Solidity", | |
| "output": { | |
| "abi": [ | |
| { | |
| "inputs": [], | |
| "stateMutability": "nonpayable", | |
| "type": "constructor" | |
| }, | |
| { | |
| "inputs": [ | |
| { | |
| "internalType": "address", | |
| "name": "", | |
| "type": "address" | |
| } | |
| ], | |
| "name": "balance", | |
| "outputs": [ | |
| { | |
| "internalType": "uint256", | |
| "name": "", | |
| "type": "uint256" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [], | |
| "name": "checkBalance", | |
| "outputs": [ | |
| { | |
| "internalType": "uint256", | |
| "name": "", | |
| "type": "uint256" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [], | |
| "name": "payee", | |
| "outputs": [ | |
| { | |
| "internalType": "address", | |
| "name": "", | |
| "type": "address" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [ | |
| { | |
| "internalType": "uint256", | |
| "name": "amount", | |
| "type": "uint256" | |
| } | |
| ], | |
| "name": "transfer", | |
| "outputs": [], | |
| "stateMutability": "nonpayable", | |
| "type": "function" | |
| } | |
| ], | |
| "devdoc": { | |
| "kind": "dev", | |
| "methods": {}, | |
| "version": 1 | |
| }, | |
| "userdoc": { | |
| "kind": "user", | |
| "methods": {}, | |
| "version": 1 | |
| } | |
| }, | |
| "settings": { | |
| "compilationTarget": { | |
| "userContracts/contract.sol": "coin" | |
| }, | |
| "evmVersion": "istanbul", | |
| "libraries": {}, | |
| "metadata": { | |
| "bytecodeHash": "ipfs" | |
| }, | |
| "optimizer": { | |
| "enabled": false, | |
| "runs": 200 | |
| }, | |
| "remappings": [] | |
| }, | |
| "sources": { | |
| "userContracts/contract.sol": { | |
| "keccak256": "0xadadc1b5e90cba0fbace32a31d3fbc9118cc74bc2124581e99caac6b37354f4b", | |
| "urls": [ | |
| "bzz-raw://b4700b9354d8e801990983745a40150ad247ad8ce79e0dc3f8a82f50b22b7e06", | |
| "dweb:/ipfs/QmcEL6ziqcwQ4BvBDqYzuzHwx4ZwHTubh2n5KEeHXGuPbD" | |
| ] | |
| } | |
| }, | |
| "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.7.0 <0.9.0; | |
| contract coin{ | |
| address public payee ; | |
| mapping (address => uint256) public balance; | |
| constructor() public{ | |
| payee = msg.sender; | |
| balance[payee] = 100; | |
| } | |
| function checkBalance() public view returns(uint256){ | |
| require(balance[payee] > 0); | |
| return balance[payee]; | |
| } | |
| function transfer(uint256 amount) public { | |
| balance[payee]+= amount; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment