Skip to content

Instantly share code, notes, and snippets.

@taruscript
Created April 29, 2021 16:03
Show Gist options
  • Save taruscript/bcce00f24ca635ca7c75305bd5fd828a to your computer and use it in GitHub Desktop.
Save taruscript/bcce00f24ca635ca7c75305bd5fd828a to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.1+commit.df193b15.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
The 'scripts' folder contains example async/await scripts for deploying the 'Storage' contract.
For the deployment of any other contract, 'contractName' and 'constructorArgs' should be updated (along with other code if required).
Scripts have full access to the web3.js and ethers.js libraries.
To run a script, right click on file name in the file explorer and click 'Run'. Remember, Solidity file must already be compiled.
Output from script will appear in remix terminal.
// 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;
}
}
// 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;
}
}
// 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;
}
}
{
"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": "608060405234801561001057600080fd5b506105bd806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80633d0c46d0146100465780636a226a491461006457806386f79edb14610080575b600080fd5b61004e6100b0565b60405161005b91906103c5565b60405180910390f35b61007e600480360381019061007991906102f1565b6100bc565b005b61009a60048036038101906100959190610332565b6100fb565b6040516100a791906103a3565b60405180910390f35b60008080549050905090565b6000819080600181540180825580915050600190039060005260206000200160009091909190915090805190602001906100f79291906101d1565b5050565b606060008281548110610137577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001805461014c9061049e565b80601f01602080910402602001604051908101604052809291908181526020018280546101789061049e565b80156101c55780601f1061019a576101008083540402835291602001916101c5565b820191906000526020600020905b8154815290600101906020018083116101a857829003601f168201915b50505050509050919050565b8280546101dd9061049e565b90600052602060002090601f0160209004810192826101ff5760008555610246565b82601f1061021857805160ff1916838001178555610246565b82800160010185558215610246579182015b8281111561024557825182559160200191906001019061022a565b5b5090506102539190610257565b5090565b5b80821115610270576000816000905550600101610258565b5090565b600061028761028284610405565b6103e0565b90508281526020810184848401111561029f57600080fd5b6102aa84828561045c565b509392505050565b600082601f8301126102c357600080fd5b81356102d3848260208601610274565b91505092915050565b6000813590506102eb81610570565b92915050565b60006020828403121561030357600080fd5b600082013567ffffffffffffffff81111561031d57600080fd5b610329848285016102b2565b91505092915050565b60006020828403121561034457600080fd5b6000610352848285016102dc565b91505092915050565b600061036682610436565b6103708185610441565b935061038081856020860161046b565b6103898161055f565b840191505092915050565b61039d81610452565b82525050565b600060208201905081810360008301526103bd818461035b565b905092915050565b60006020820190506103da6000830184610394565b92915050565b60006103ea6103fb565b90506103f682826104d0565b919050565b6000604051905090565b600067ffffffffffffffff8211156104205761041f610530565b5b6104298261055f565b9050602081019050919050565b600081519050919050565b600082825260208201905092915050565b6000819050919050565b82818337600083830152505050565b60005b8381101561048957808201518184015260208101905061046e565b83811115610498576000848401525b50505050565b600060028204905060018216806104b657607f821691505b602082108114156104ca576104c9610501565b5b50919050565b6104d98261055f565b810181811067ffffffffffffffff821117156104f8576104f7610530565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b61057981610452565b811461058457600080fd5b5056fea2646970667358221220ddc3f4d05ed1ddbdbefc60dc2930c09812c60450ee175520daa76afc8355145d64736f6c63430008010033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x5BD DUP1 PUSH2 0x20 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x41 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x3D0C46D0 EQ PUSH2 0x46 JUMPI DUP1 PUSH4 0x6A226A49 EQ PUSH2 0x64 JUMPI DUP1 PUSH4 0x86F79EDB EQ PUSH2 0x80 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4E PUSH2 0xB0 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x5B SWAP2 SWAP1 PUSH2 0x3C5 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x7E PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x79 SWAP2 SWAP1 PUSH2 0x2F1 JUMP JUMPDEST PUSH2 0xBC JUMP JUMPDEST STOP JUMPDEST PUSH2 0x9A PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x95 SWAP2 SWAP1 PUSH2 0x332 JUMP JUMPDEST PUSH2 0xFB JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xA7 SWAP2 SWAP1 PUSH2 0x3A3 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 DUP1 DUP1 SLOAD SWAP1 POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 DUP1 PUSH1 0x1 DUP2 SLOAD ADD DUP1 DUP3 SSTORE DUP1 SWAP2 POP POP PUSH1 0x1 SWAP1 SUB SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SWAP2 SWAP1 SWAP2 SWAP1 SWAP2 POP SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0xF7 SWAP3 SWAP2 SWAP1 PUSH2 0x1D1 JUMP JUMPDEST POP POP JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP3 DUP2 SLOAD DUP2 LT PUSH2 0x137 JUMPI PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x32 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD DUP1 SLOAD PUSH2 0x14C SWAP1 PUSH2 0x49E JUMP JUMPDEST DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH2 0x178 SWAP1 PUSH2 0x49E JUMP JUMPDEST DUP1 ISZERO PUSH2 0x1C5 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x19A JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x1C5 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1A8 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH2 0x1DD SWAP1 PUSH2 0x49E JUMP JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH2 0x1FF JUMPI PUSH1 0x0 DUP6 SSTORE PUSH2 0x246 JUMP JUMPDEST DUP3 PUSH1 0x1F LT PUSH2 0x218 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x246 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x246 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x245 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x22A JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x253 SWAP2 SWAP1 PUSH2 0x257 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x270 JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH2 0x258 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x287 PUSH2 0x282 DUP5 PUSH2 0x405 JUMP JUMPDEST PUSH2 0x3E0 JUMP JUMPDEST SWAP1 POP DUP3 DUP2 MSTORE PUSH1 0x20 DUP2 ADD DUP5 DUP5 DUP5 ADD GT ISZERO PUSH2 0x29F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x2AA DUP5 DUP3 DUP6 PUSH2 0x45C JUMP JUMPDEST POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH1 0x1F DUP4 ADD SLT PUSH2 0x2C3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x2D3 DUP5 DUP3 PUSH1 0x20 DUP7 ADD PUSH2 0x274 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x2EB DUP2 PUSH2 0x570 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x303 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x31D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x329 DUP5 DUP3 DUP6 ADD PUSH2 0x2B2 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x344 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x352 DUP5 DUP3 DUP6 ADD PUSH2 0x2DC JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x366 DUP3 PUSH2 0x436 JUMP JUMPDEST PUSH2 0x370 DUP2 DUP6 PUSH2 0x441 JUMP JUMPDEST SWAP4 POP PUSH2 0x380 DUP2 DUP6 PUSH1 0x20 DUP7 ADD PUSH2 0x46B JUMP JUMPDEST PUSH2 0x389 DUP2 PUSH2 0x55F JUMP JUMPDEST DUP5 ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x39D DUP2 PUSH2 0x452 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x3BD DUP2 DUP5 PUSH2 0x35B JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x3DA PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x394 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x3EA PUSH2 0x3FB JUMP JUMPDEST SWAP1 POP PUSH2 0x3F6 DUP3 DUP3 PUSH2 0x4D0 JUMP JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x420 JUMPI PUSH2 0x41F PUSH2 0x530 JUMP JUMPDEST JUMPDEST PUSH2 0x429 DUP3 PUSH2 0x55F JUMP JUMPDEST SWAP1 POP PUSH1 0x20 DUP2 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST DUP3 DUP2 DUP4 CALLDATACOPY PUSH1 0x0 DUP4 DUP4 ADD MSTORE POP POP POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x489 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x46E JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x498 JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x2 DUP3 DIV SWAP1 POP PUSH1 0x1 DUP3 AND DUP1 PUSH2 0x4B6 JUMPI PUSH1 0x7F DUP3 AND SWAP2 POP JUMPDEST PUSH1 0x20 DUP3 LT DUP2 EQ ISZERO PUSH2 0x4CA JUMPI PUSH2 0x4C9 PUSH2 0x501 JUMP JUMPDEST JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x4D9 DUP3 PUSH2 0x55F JUMP JUMPDEST DUP2 ADD DUP2 DUP2 LT PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT OR ISZERO PUSH2 0x4F8 JUMPI PUSH2 0x4F7 PUSH2 0x530 JUMP JUMPDEST JUMPDEST DUP1 PUSH1 0x40 MSTORE POP POP POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x22 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x41 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x579 DUP2 PUSH2 0x452 JUMP JUMPDEST DUP2 EQ PUSH2 0x584 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xDD 0xC3 DELEGATECALL 0xD0 0x5E 0xD1 0xDD 0xBD 0xBE 0xFC PUSH1 0xDC 0x29 ADDRESS 0xC0 SWAP9 SLT 0xC6 DIV POP 0xEE OR SSTORE KECCAK256 0xDA 0xA7 PUSH11 0xFC8355145D64736F6C6343 STOP ADDMOD ADD STOP CALLER ",
"sourceMap": "70:371:0:-:0;;;;;;;;;;;;;;;;;;;"
},
"deployedBytecode": {
"generatedSources": [
{
"ast": {
"nodeType": "YulBlock",
"src": "0:5070:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "91:261:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "101:75:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "168:6:1"
}
],
"functionName": {
"name": "array_allocation_size_t_string_memory_ptr",
"nodeType": "YulIdentifier",
"src": "126:41:1"
},
"nodeType": "YulFunctionCall",
"src": "126:49:1"
}
],
"functionName": {
"name": "allocate_memory",
"nodeType": "YulIdentifier",
"src": "110:15:1"
},
"nodeType": "YulFunctionCall",
"src": "110:66:1"
},
"variableNames": [
{
"name": "array",
"nodeType": "YulIdentifier",
"src": "101:5:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "array",
"nodeType": "YulIdentifier",
"src": "192:5:1"
},
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "199:6:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "185:6:1"
},
"nodeType": "YulFunctionCall",
"src": "185:21:1"
},
"nodeType": "YulExpressionStatement",
"src": "185:21:1"
},
{
"nodeType": "YulVariableDeclaration",
"src": "215:27:1",
"value": {
"arguments": [
{
"name": "array",
"nodeType": "YulIdentifier",
"src": "230:5:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "237:4:1",
"type": "",
"value": "0x20"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "226:3:1"
},
"nodeType": "YulFunctionCall",
"src": "226:16:1"
},
"variables": [
{
"name": "dst",
"nodeType": "YulTypedName",
"src": "219:3:1",
"type": ""
}
]
},
{
"body": {
"nodeType": "YulBlock",
"src": "280:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "289:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "292:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "282:6:1"
},
"nodeType": "YulFunctionCall",
"src": "282:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "282:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "src",
"nodeType": "YulIdentifier",
"src": "261:3:1"
},
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "266:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "257:3:1"
},
"nodeType": "YulFunctionCall",
"src": "257:16:1"
},
{
"name": "end",
"nodeType": "YulIdentifier",
"src": "275:3:1"
}
],
"functionName": {
"name": "gt",
"nodeType": "YulIdentifier",
"src": "254:2:1"
},
"nodeType": "YulFunctionCall",
"src": "254:25:1"
},
"nodeType": "YulIf",
"src": "251:2:1"
},
{
"expression": {
"arguments": [
{
"name": "src",
"nodeType": "YulIdentifier",
"src": "329:3:1"
},
{
"name": "dst",
"nodeType": "YulIdentifier",
"src": "334:3:1"
},
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "339:6:1"
}
],
"functionName": {
"name": "copy_calldata_to_memory",
"nodeType": "YulIdentifier",
"src": "305:23:1"
},
"nodeType": "YulFunctionCall",
"src": "305:41:1"
},
"nodeType": "YulExpressionStatement",
"src": "305:41:1"
}
]
},
"name": "abi_decode_available_length_t_string_memory_ptr",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "src",
"nodeType": "YulTypedName",
"src": "64:3:1",
"type": ""
},
{
"name": "length",
"nodeType": "YulTypedName",
"src": "69:6:1",
"type": ""
},
{
"name": "end",
"nodeType": "YulTypedName",
"src": "77:3:1",
"type": ""
}
],
"returnVariables": [
{
"name": "array",
"nodeType": "YulTypedName",
"src": "85:5:1",
"type": ""
}
],
"src": "7:345:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "434:211:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "483:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "492:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "495:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "485:6:1"
},
"nodeType": "YulFunctionCall",
"src": "485:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "485:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"arguments": [
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "462:6:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "470:4:1",
"type": "",
"value": "0x1f"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "458:3:1"
},
"nodeType": "YulFunctionCall",
"src": "458:17:1"
},
{
"name": "end",
"nodeType": "YulIdentifier",
"src": "477:3:1"
}
],
"functionName": {
"name": "slt",
"nodeType": "YulIdentifier",
"src": "454:3:1"
},
"nodeType": "YulFunctionCall",
"src": "454:27:1"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "447:6:1"
},
"nodeType": "YulFunctionCall",
"src": "447:35:1"
},
"nodeType": "YulIf",
"src": "444:2:1"
},
{
"nodeType": "YulVariableDeclaration",
"src": "508:34:1",
"value": {
"arguments": [
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "535:6:1"
}
],
"functionName": {
"name": "calldataload",
"nodeType": "YulIdentifier",
"src": "522:12:1"
},
"nodeType": "YulFunctionCall",
"src": "522:20:1"
},
"variables": [
{
"name": "length",
"nodeType": "YulTypedName",
"src": "512:6:1",
"type": ""
}
]
},
{
"nodeType": "YulAssignment",
"src": "551:88:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "612:6:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "620:4:1",
"type": "",
"value": "0x20"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "608:3:1"
},
"nodeType": "YulFunctionCall",
"src": "608:17:1"
},
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "627:6:1"
},
{
"name": "end",
"nodeType": "YulIdentifier",
"src": "635:3:1"
}
],
"functionName": {
"name": "abi_decode_available_length_t_string_memory_ptr",
"nodeType": "YulIdentifier",
"src": "560:47:1"
},
"nodeType": "YulFunctionCall",
"src": "560:79:1"
},
"variableNames": [
{
"name": "array",
"nodeType": "YulIdentifier",
"src": "551:5:1"
}
]
}
]
},
"name": "abi_decode_t_string_memory_ptr",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "412:6:1",
"type": ""
},
{
"name": "end",
"nodeType": "YulTypedName",
"src": "420:3:1",
"type": ""
}
],
"returnVariables": [
{
"name": "array",
"nodeType": "YulTypedName",
"src": "428:5:1",
"type": ""
}
],
"src": "372:273:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "703:87:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "713:29:1",
"value": {
"arguments": [
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "735:6:1"
}
],
"functionName": {
"name": "calldataload",
"nodeType": "YulIdentifier",
"src": "722:12:1"
},
"nodeType": "YulFunctionCall",
"src": "722:20:1"
},
"variableNames": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "713:5:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "778:5:1"
}
],
"functionName": {
"name": "validator_revert_t_uint256",
"nodeType": "YulIdentifier",
"src": "751:26:1"
},
"nodeType": "YulFunctionCall",
"src": "751:33:1"
},
"nodeType": "YulExpressionStatement",
"src": "751:33:1"
}
]
},
"name": "abi_decode_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "681:6:1",
"type": ""
},
{
"name": "end",
"nodeType": "YulTypedName",
"src": "689:3:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "697:5:1",
"type": ""
}
],
"src": "651:139:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "872:299:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "918:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "927:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "930:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "920:6:1"
},
"nodeType": "YulFunctionCall",
"src": "920:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "920:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "893:7:1"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "902:9:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "889:3:1"
},
"nodeType": "YulFunctionCall",
"src": "889:23:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "914:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "slt",
"nodeType": "YulIdentifier",
"src": "885:3:1"
},
"nodeType": "YulFunctionCall",
"src": "885:32:1"
},
"nodeType": "YulIf",
"src": "882:2:1"
},
{
"nodeType": "YulBlock",
"src": "944:220:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "959:45:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "990:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1001:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "986:3:1"
},
"nodeType": "YulFunctionCall",
"src": "986:17:1"
}
],
"functionName": {
"name": "calldataload",
"nodeType": "YulIdentifier",
"src": "973:12:1"
},
"nodeType": "YulFunctionCall",
"src": "973:31:1"
},
"variables": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "963:6:1",
"type": ""
}
]
},
{
"body": {
"nodeType": "YulBlock",
"src": "1051:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1060:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1063:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "1053:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1053:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "1053:12:1"
}
]
},
"condition": {
"arguments": [
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "1023:6:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1031:18:1",
"type": "",
"value": "0xffffffffffffffff"
}
],
"functionName": {
"name": "gt",
"nodeType": "YulIdentifier",
"src": "1020:2:1"
},
"nodeType": "YulFunctionCall",
"src": "1020:30:1"
},
"nodeType": "YulIf",
"src": "1017:2:1"
},
{
"nodeType": "YulAssignment",
"src": "1081:73:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1126:9:1"
},
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "1137:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1122:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1122:22:1"
},
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "1146:7:1"
}
],
"functionName": {
"name": "abi_decode_t_string_memory_ptr",
"nodeType": "YulIdentifier",
"src": "1091:30:1"
},
"nodeType": "YulFunctionCall",
"src": "1091:63:1"
},
"variableNames": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "1081:6:1"
}
]
}
]
}
]
},
"name": "abi_decode_tuple_t_string_memory_ptr",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "842:9:1",
"type": ""
},
{
"name": "dataEnd",
"nodeType": "YulTypedName",
"src": "853:7:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "865:6:1",
"type": ""
}
],
"src": "796:375:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1243:196:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "1289:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1298:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1301:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "1291:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1291:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "1291:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "1264:7:1"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1273:9:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "1260:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1260:23:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1285:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "slt",
"nodeType": "YulIdentifier",
"src": "1256:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1256:32:1"
},
"nodeType": "YulIf",
"src": "1253:2:1"
},
{
"nodeType": "YulBlock",
"src": "1315:117:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "1330:15:1",
"value": {
"kind": "number",
"nodeType": "YulLiteral",
"src": "1344:1:1",
"type": "",
"value": "0"
},
"variables": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "1334:6:1",
"type": ""
}
]
},
{
"nodeType": "YulAssignment",
"src": "1359:63:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1394:9:1"
},
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "1405:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1390:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1390:22:1"
},
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "1414:7:1"
}
],
"functionName": {
"name": "abi_decode_t_uint256",
"nodeType": "YulIdentifier",
"src": "1369:20:1"
},
"nodeType": "YulFunctionCall",
"src": "1369:53:1"
},
"variableNames": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "1359:6:1"
}
]
}
]
}
]
},
"name": "abi_decode_tuple_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "1213:9:1",
"type": ""
},
{
"name": "dataEnd",
"nodeType": "YulTypedName",
"src": "1224:7:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "1236:6:1",
"type": ""
}
],
"src": "1177:262:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1537:272:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "1547:53:1",
"value": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1594:5:1"
}
],
"functionName": {
"name": "array_length_t_string_memory_ptr",
"nodeType": "YulIdentifier",
"src": "1561:32:1"
},
"nodeType": "YulFunctionCall",
"src": "1561:39:1"
},
"variables": [
{
"name": "length",
"nodeType": "YulTypedName",
"src": "1551:6:1",
"type": ""
}
]
},
{
"nodeType": "YulAssignment",
"src": "1609:78:1",
"value": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "1675:3:1"
},
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "1680:6:1"
}
],
"functionName": {
"name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack",
"nodeType": "YulIdentifier",
"src": "1616:58:1"
},
"nodeType": "YulFunctionCall",
"src": "1616:71:1"
},
"variableNames": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "1609:3:1"
}
]
},
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1722:5:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1729:4:1",
"type": "",
"value": "0x20"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1718:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1718:16:1"
},
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "1736:3:1"
},
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "1741:6:1"
}
],
"functionName": {
"name": "copy_memory_to_memory",
"nodeType": "YulIdentifier",
"src": "1696:21:1"
},
"nodeType": "YulFunctionCall",
"src": "1696:52:1"
},
"nodeType": "YulExpressionStatement",
"src": "1696:52:1"
},
{
"nodeType": "YulAssignment",
"src": "1757:46:1",
"value": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "1768:3:1"
},
{
"arguments": [
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "1795:6:1"
}
],
"functionName": {
"name": "round_up_to_mul_of_32",
"nodeType": "YulIdentifier",
"src": "1773:21:1"
},
"nodeType": "YulFunctionCall",
"src": "1773:29:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1764:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1764:39:1"
},
"variableNames": [
{
"name": "end",
"nodeType": "YulIdentifier",
"src": "1757:3:1"
}
]
}
]
},
"name": "abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1518:5:1",
"type": ""
},
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "1525:3:1",
"type": ""
}
],
"returnVariables": [
{
"name": "end",
"nodeType": "YulTypedName",
"src": "1533:3:1",
"type": ""
}
],
"src": "1445:364:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1880:53:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "1897:3:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1920:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "1902:17:1"
},
"nodeType": "YulFunctionCall",
"src": "1902:24:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1890:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1890:37:1"
},
"nodeType": "YulExpressionStatement",
"src": "1890:37:1"
}
]
},
"name": "abi_encode_t_uint256_to_t_uint256_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1868:5:1",
"type": ""
},
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "1875:3:1",
"type": ""
}
],
"src": "1815:118:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2057:195:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "2067:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "2079:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2090:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "2075:3:1"
},
"nodeType": "YulFunctionCall",
"src": "2075:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "2067:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "2114:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2125:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "2110:3:1"
},
"nodeType": "YulFunctionCall",
"src": "2110:17:1"
},
{
"arguments": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "2133:4:1"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "2139:9:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "2129:3:1"
},
"nodeType": "YulFunctionCall",
"src": "2129:20:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "2103:6:1"
},
"nodeType": "YulFunctionCall",
"src": "2103:47:1"
},
"nodeType": "YulExpressionStatement",
"src": "2103:47:1"
},
{
"nodeType": "YulAssignment",
"src": "2159:86:1",
"value": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "2231:6:1"
},
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "2240:4:1"
}
],
"functionName": {
"name": "abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack",
"nodeType": "YulIdentifier",
"src": "2167:63:1"
},
"nodeType": "YulFunctionCall",
"src": "2167:78:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "2159:4:1"
}
]
}
]
},
"name": "abi_encode_tuple_t_string_memory_ptr__to_t_string_memory_ptr__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "2029:9:1",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "2041:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "2052:4:1",
"type": ""
}
],
"src": "1939:313:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2356:124:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "2366:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "2378:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2389:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "2374:3:1"
},
"nodeType": "YulFunctionCall",
"src": "2374:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "2366:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "2446:6:1"
},
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "2459:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2470:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "2455:3:1"
},
"nodeType": "YulFunctionCall",
"src": "2455:17:1"
}
],
"functionName": {
"name": "abi_encode_t_uint256_to_t_uint256_fromStack",
"nodeType": "YulIdentifier",
"src": "2402:43:1"
},
"nodeType": "YulFunctionCall",
"src": "2402:71:1"
},
"nodeType": "YulExpressionStatement",
"src": "2402:71:1"
}
]
},
"name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "2328:9:1",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "2340:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "2351:4:1",
"type": ""
}
],
"src": "2258:222:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2527:88:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "2537:30:1",
"value": {
"arguments": [],
"functionName": {
"name": "allocate_unbounded",
"nodeType": "YulIdentifier",
"src": "2547:18:1"
},
"nodeType": "YulFunctionCall",
"src": "2547:20:1"
},
"variableNames": [
{
"name": "memPtr",
"nodeType": "YulIdentifier",
"src": "2537:6:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "memPtr",
"nodeType": "YulIdentifier",
"src": "2596:6:1"
},
{
"name": "size",
"nodeType": "YulIdentifier",
"src": "2604:4:1"
}
],
"functionName": {
"name": "finalize_allocation",
"nodeType": "YulIdentifier",
"src": "2576:19:1"
},
"nodeType": "YulFunctionCall",
"src": "2576:33:1"
},
"nodeType": "YulExpressionStatement",
"src": "2576:33:1"
}
]
},
"name": "allocate_memory",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "size",
"nodeType": "YulTypedName",
"src": "2511:4:1",
"type": ""
}
],
"returnVariables": [
{
"name": "memPtr",
"nodeType": "YulTypedName",
"src": "2520:6:1",
"type": ""
}
],
"src": "2486:129:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2661:35:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "2671:19:1",
"value": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2687:2:1",
"type": "",
"value": "64"
}
],
"functionName": {
"name": "mload",
"nodeType": "YulIdentifier",
"src": "2681:5:1"
},
"nodeType": "YulFunctionCall",
"src": "2681:9:1"
},
"variableNames": [
{
"name": "memPtr",
"nodeType": "YulIdentifier",
"src": "2671:6:1"
}
]
}
]
},
"name": "allocate_unbounded",
"nodeType": "YulFunctionDefinition",
"returnVariables": [
{
"name": "memPtr",
"nodeType": "YulTypedName",
"src": "2654:6:1",
"type": ""
}
],
"src": "2621:75:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2769:241:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "2874:22:1",
"statements": [
{
"expression": {
"arguments": [],
"functionName": {
"name": "panic_error_0x41",
"nodeType": "YulIdentifier",
"src": "2876:16:1"
},
"nodeType": "YulFunctionCall",
"src": "2876:18:1"
},
"nodeType": "YulExpressionStatement",
"src": "2876:18:1"
}
]
},
"condition": {
"arguments": [
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "2846:6:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2854:18:1",
"type": "",
"value": "0xffffffffffffffff"
}
],
"functionName": {
"name": "gt",
"nodeType": "YulIdentifier",
"src": "2843:2:1"
},
"nodeType": "YulFunctionCall",
"src": "2843:30:1"
},
"nodeType": "YulIf",
"src": "2840:2:1"
},
{
"nodeType": "YulAssignment",
"src": "2906:37:1",
"value": {
"arguments": [
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "2936:6:1"
}
],
"functionName": {
"name": "round_up_to_mul_of_32",
"nodeType": "YulIdentifier",
"src": "2914:21:1"
},
"nodeType": "YulFunctionCall",
"src": "2914:29:1"
},
"variableNames": [
{
"name": "size",
"nodeType": "YulIdentifier",
"src": "2906:4:1"
}
]
},
{
"nodeType": "YulAssignment",
"src": "2980:23:1",
"value": {
"arguments": [
{
"name": "size",
"nodeType": "YulIdentifier",
"src": "2992:4:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2998:4:1",
"type": "",
"value": "0x20"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "2988:3:1"
},
"nodeType": "YulFunctionCall",
"src": "2988:15:1"
},
"variableNames": [
{
"name": "size",
"nodeType": "YulIdentifier",
"src": "2980:4:1"
}
]
}
]
},
"name": "array_allocation_size_t_string_memory_ptr",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "length",
"nodeType": "YulTypedName",
"src": "2753:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "size",
"nodeType": "YulTypedName",
"src": "2764:4:1",
"type": ""
}
],
"src": "2702:308:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "3075:40:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "3086:22:1",
"value": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "3102:5:1"
}
],
"functionName": {
"name": "mload",
"nodeType": "YulIdentifier",
"src": "3096:5:1"
},
"nodeType": "YulFunctionCall",
"src": "3096:12:1"
},
"variableNames": [
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "3086:6:1"
}
]
}
]
},
"name": "array_length_t_string_memory_ptr",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "3058:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "length",
"nodeType": "YulTypedName",
"src": "3068:6:1",
"type": ""
}
],
"src": "3016:99:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "3217:73:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "3234:3:1"
},
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "3239:6:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "3227:6:1"
},
"nodeType": "YulFunctionCall",
"src": "3227:19:1"
},
"nodeType": "YulExpressionStatement",
"src": "3227:19:1"
},
{
"nodeType": "YulAssignment",
"src": "3255:29:1",
"value": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "3274:3:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3279:4:1",
"type": "",
"value": "0x20"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "3270:3:1"
},
"nodeType": "YulFunctionCall",
"src": "3270:14:1"
},
"variableNames": [
{
"name": "updated_pos",
"nodeType": "YulIdentifier",
"src": "3255:11:1"
}
]
}
]
},
"name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "3189:3:1",
"type": ""
},
{
"name": "length",
"nodeType": "YulTypedName",
"src": "3194:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "updated_pos",
"nodeType": "YulTypedName",
"src": "3205:11:1",
"type": ""
}
],
"src": "3121:169:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "3341:32:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "3351:16:1",
"value": {
"name": "value",
"nodeType": "YulIdentifier",
"src": "3362:5:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "3351:7:1"
}
]
}
]
},
"name": "cleanup_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "3323:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "3333:7:1",
"type": ""
}
],
"src": "3296:77:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "3430:103:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "dst",
"nodeType": "YulIdentifier",
"src": "3453:3:1"
},
{
"name": "src",
"nodeType": "YulIdentifier",
"src": "3458:3:1"
},
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "3463:6:1"
}
],
"functionName": {
"name": "calldatacopy",
"nodeType": "YulIdentifier",
"src": "3440:12:1"
},
"nodeType": "YulFunctionCall",
"src": "3440:30:1"
},
"nodeType": "YulExpressionStatement",
"src": "3440:30:1"
},
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "dst",
"nodeType": "YulIdentifier",
"src": "3511:3:1"
},
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "3516:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "3507:3:1"
},
"nodeType": "YulFunctionCall",
"src": "3507:16:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3525:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "3500:6:1"
},
"nodeType": "YulFunctionCall",
"src": "3500:27:1"
},
"nodeType": "YulExpressionStatement",
"src": "3500:27:1"
}
]
},
"name": "copy_calldata_to_memory",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "src",
"nodeType": "YulTypedName",
"src": "3412:3:1",
"type": ""
},
{
"name": "dst",
"nodeType": "YulTypedName",
"src": "3417:3:1",
"type": ""
},
{
"name": "length",
"nodeType": "YulTypedName",
"src": "3422:6:1",
"type": ""
}
],
"src": "3379:154:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "3588:258:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "3598:10:1",
"value": {
"kind": "number",
"nodeType": "YulLiteral",
"src": "3607:1:1",
"type": "",
"value": "0"
},
"variables": [
{
"name": "i",
"nodeType": "YulTypedName",
"src": "3602:1:1",
"type": ""
}
]
},
{
"body": {
"nodeType": "YulBlock",
"src": "3667:63:1",
"statements": [
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "dst",
"nodeType": "YulIdentifier",
"src": "3692:3:1"
},
{
"name": "i",
"nodeType": "YulIdentifier",
"src": "3697:1:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "3688:3:1"
},
"nodeType": "YulFunctionCall",
"src": "3688:11:1"
},
{
"arguments": [
{
"arguments": [
{
"name": "src",
"nodeType": "YulIdentifier",
"src": "3711:3:1"
},
{
"name": "i",
"nodeType": "YulIdentifier",
"src": "3716:1:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "3707:3:1"
},
"nodeType": "YulFunctionCall",
"src": "3707:11:1"
}
],
"functionName": {
"name": "mload",
"nodeType": "YulIdentifier",
"src": "3701:5:1"
},
"nodeType": "YulFunctionCall",
"src": "3701:18:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "3681:6:1"
},
"nodeType": "YulFunctionCall",
"src": "3681:39:1"
},
"nodeType": "YulExpressionStatement",
"src": "3681:39:1"
}
]
},
"condition": {
"arguments": [
{
"name": "i",
"nodeType": "YulIdentifier",
"src": "3628:1:1"
},
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "3631:6:1"
}
],
"functionName": {
"name": "lt",
"nodeType": "YulIdentifier",
"src": "3625:2:1"
},
"nodeType": "YulFunctionCall",
"src": "3625:13:1"
},
"nodeType": "YulForLoop",
"post": {
"nodeType": "YulBlock",
"src": "3639:19:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "3641:15:1",
"value": {
"arguments": [
{
"name": "i",
"nodeType": "YulIdentifier",
"src": "3650:1:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3653:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "3646:3:1"
},
"nodeType": "YulFunctionCall",
"src": "3646:10:1"
},
"variableNames": [
{
"name": "i",
"nodeType": "YulIdentifier",
"src": "3641:1:1"
}
]
}
]
},
"pre": {
"nodeType": "YulBlock",
"src": "3621:3:1",
"statements": []
},
"src": "3617:113:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "3764:76:1",
"statements": [
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "dst",
"nodeType": "YulIdentifier",
"src": "3814:3:1"
},
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "3819:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "3810:3:1"
},
"nodeType": "YulFunctionCall",
"src": "3810:16:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3828:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "3803:6:1"
},
"nodeType": "YulFunctionCall",
"src": "3803:27:1"
},
"nodeType": "YulExpressionStatement",
"src": "3803:27:1"
}
]
},
"condition": {
"arguments": [
{
"name": "i",
"nodeType": "YulIdentifier",
"src": "3745:1:1"
},
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "3748:6:1"
}
],
"functionName": {
"name": "gt",
"nodeType": "YulIdentifier",
"src": "3742:2:1"
},
"nodeType": "YulFunctionCall",
"src": "3742:13:1"
},
"nodeType": "YulIf",
"src": "3739:2:1"
}
]
},
"name": "copy_memory_to_memory",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "src",
"nodeType": "YulTypedName",
"src": "3570:3:1",
"type": ""
},
{
"name": "dst",
"nodeType": "YulTypedName",
"src": "3575:3:1",
"type": ""
},
{
"name": "length",
"nodeType": "YulTypedName",
"src": "3580:6:1",
"type": ""
}
],
"src": "3539:307:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "3903:269:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "3913:22:1",
"value": {
"arguments": [
{
"name": "data",
"nodeType": "YulIdentifier",
"src": "3927:4:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3933:1:1",
"type": "",
"value": "2"
}
],
"functionName": {
"name": "div",
"nodeType": "YulIdentifier",
"src": "3923:3:1"
},
"nodeType": "YulFunctionCall",
"src": "3923:12:1"
},
"variableNames": [
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "3913:6:1"
}
]
},
{
"nodeType": "YulVariableDeclaration",
"src": "3944:38:1",
"value": {
"arguments": [
{
"name": "data",
"nodeType": "YulIdentifier",
"src": "3974:4:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3980:1:1",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "3970:3:1"
},
"nodeType": "YulFunctionCall",
"src": "3970:12:1"
},
"variables": [
{
"name": "outOfPlaceEncoding",
"nodeType": "YulTypedName",
"src": "3948:18:1",
"type": ""
}
]
},
{
"body": {
"nodeType": "YulBlock",
"src": "4021:51:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "4035:27:1",
"value": {
"arguments": [
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "4049:6:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "4057:4:1",
"type": "",
"value": "0x7f"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "4045:3:1"
},
"nodeType": "YulFunctionCall",
"src": "4045:17:1"
},
"variableNames": [
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "4035:6:1"
}
]
}
]
},
"condition": {
"arguments": [
{
"name": "outOfPlaceEncoding",
"nodeType": "YulIdentifier",
"src": "4001:18:1"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "3994:6:1"
},
"nodeType": "YulFunctionCall",
"src": "3994:26:1"
},
"nodeType": "YulIf",
"src": "3991:2:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "4124:42:1",
"statements": [
{
"expression": {
"arguments": [],
"functionName": {
"name": "panic_error_0x22",
"nodeType": "YulIdentifier",
"src": "4138:16:1"
},
"nodeType": "YulFunctionCall",
"src": "4138:18:1"
},
"nodeType": "YulExpressionStatement",
"src": "4138:18:1"
}
]
},
"condition": {
"arguments": [
{
"name": "outOfPlaceEncoding",
"nodeType": "YulIdentifier",
"src": "4088:18:1"
},
{
"arguments": [
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "4111:6:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "4119:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "lt",
"nodeType": "YulIdentifier",
"src": "4108:2:1"
},
"nodeType": "YulFunctionCall",
"src": "4108:14:1"
}
],
"functionName": {
"name": "eq",
"nodeType": "YulIdentifier",
"src": "4085:2:1"
},
"nodeType": "YulFunctionCall",
"src": "4085:38:1"
},
"nodeType": "YulIf",
"src": "4082:2:1"
}
]
},
"name": "extract_byte_array_length",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "data",
"nodeType": "YulTypedName",
"src": "3887:4:1",
"type": ""
}
],
"returnVariables": [
{
"name": "length",
"nodeType": "YulTypedName",
"src": "3896:6:1",
"type": ""
}
],
"src": "3852:320:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "4221:238:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "4231:58:1",
"value": {
"arguments": [
{
"name": "memPtr",
"nodeType": "YulIdentifier",
"src": "4253:6:1"
},
{
"arguments": [
{
"name": "size",
"nodeType": "YulIdentifier",
"src": "4283:4:1"
}
],
"functionName": {
"name": "round_up_to_mul_of_32",
"nodeType": "YulIdentifier",
"src": "4261:21:1"
},
"nodeType": "YulFunctionCall",
"src": "4261:27:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "4249:3:1"
},
"nodeType": "YulFunctionCall",
"src": "4249:40:1"
},
"variables": [
{
"name": "newFreePtr",
"nodeType": "YulTypedName",
"src": "4235:10:1",
"type": ""
}
]
},
{
"body": {
"nodeType": "YulBlock",
"src": "4400:22:1",
"statements": [
{
"expression": {
"arguments": [],
"functionName": {
"name": "panic_error_0x41",
"nodeType": "YulIdentifier",
"src": "4402:16:1"
},
"nodeType": "YulFunctionCall",
"src": "4402:18:1"
},
"nodeType": "YulExpressionStatement",
"src": "4402:18:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "newFreePtr",
"nodeType": "YulIdentifier",
"src": "4343:10:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "4355:18:1",
"type": "",
"value": "0xffffffffffffffff"
}
],
"functionName": {
"name": "gt",
"nodeType": "YulIdentifier",
"src": "4340:2:1"
},
"nodeType": "YulFunctionCall",
"src": "4340:34:1"
},
{
"arguments": [
{
"name": "newFreePtr",
"nodeType": "YulIdentifier",
"src": "4379:10:1"
},
{
"name": "memPtr",
"nodeType": "YulIdentifier",
"src": "4391:6:1"
}
],
"functionName": {
"name": "lt",
"nodeType": "YulIdentifier",
"src": "4376:2:1"
},
"nodeType": "YulFunctionCall",
"src": "4376:22:1"
}
],
"functionName": {
"name": "or",
"nodeType": "YulIdentifier",
"src": "4337:2:1"
},
"nodeType": "YulFunctionCall",
"src": "4337:62:1"
},
"nodeType": "YulIf",
"src": "4334:2:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "4438:2:1",
"type": "",
"value": "64"
},
{
"name": "newFreePtr",
"nodeType": "YulIdentifier",
"src": "4442:10:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "4431:6:1"
},
"nodeType": "YulFunctionCall",
"src": "4431:22:1"
},
"nodeType": "YulExpressionStatement",
"src": "4431:22:1"
}
]
},
"name": "finalize_allocation",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "memPtr",
"nodeType": "YulTypedName",
"src": "4207:6:1",
"type": ""
},
{
"name": "size",
"nodeType": "YulTypedName",
"src": "4215:4:1",
"type": ""
}
],
"src": "4178:281:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "4493:152:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "4510:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "4513:77:1",
"type": "",
"value": "35408467139433450592217433187231851964531694900788300625387963629091585785856"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "4503:6:1"
},
"nodeType": "YulFunctionCall",
"src": "4503:88:1"
},
"nodeType": "YulExpressionStatement",
"src": "4503:88:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "4607:1:1",
"type": "",
"value": "4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "4610:4:1",
"type": "",
"value": "0x22"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "4600:6:1"
},
"nodeType": "YulFunctionCall",
"src": "4600:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "4600:15:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "4631:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "4634:4:1",
"type": "",
"value": "0x24"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "4624:6:1"
},
"nodeType": "YulFunctionCall",
"src": "4624:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "4624:15:1"
}
]
},
"name": "panic_error_0x22",
"nodeType": "YulFunctionDefinition",
"src": "4465:180:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "4679:152:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "4696:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "4699:77:1",
"type": "",
"value": "35408467139433450592217433187231851964531694900788300625387963629091585785856"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "4689:6:1"
},
"nodeType": "YulFunctionCall",
"src": "4689:88:1"
},
"nodeType": "YulExpressionStatement",
"src": "4689:88:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "4793:1:1",
"type": "",
"value": "4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "4796:4:1",
"type": "",
"value": "0x41"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "4786:6:1"
},
"nodeType": "YulFunctionCall",
"src": "4786:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "4786:15:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "4817:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "4820:4:1",
"type": "",
"value": "0x24"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "4810:6:1"
},
"nodeType": "YulFunctionCall",
"src": "4810:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "4810:15:1"
}
]
},
"name": "panic_error_0x41",
"nodeType": "YulFunctionDefinition",
"src": "4651:180:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "4885:54:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "4895:38:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "4913:5:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "4920:2:1",
"type": "",
"value": "31"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "4909:3:1"
},
"nodeType": "YulFunctionCall",
"src": "4909:14:1"
},
{
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "4929:2:1",
"type": "",
"value": "31"
}
],
"functionName": {
"name": "not",
"nodeType": "YulIdentifier",
"src": "4925:3:1"
},
"nodeType": "YulFunctionCall",
"src": "4925:7:1"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "4905:3:1"
},
"nodeType": "YulFunctionCall",
"src": "4905:28:1"
},
"variableNames": [
{
"name": "result",
"nodeType": "YulIdentifier",
"src": "4895:6:1"
}
]
}
]
},
"name": "round_up_to_mul_of_32",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "4868:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "result",
"nodeType": "YulTypedName",
"src": "4878:6:1",
"type": ""
}
],
"src": "4837:102:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "4988:79:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "5045:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "5054:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "5057:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "5047:6:1"
},
"nodeType": "YulFunctionCall",
"src": "5047:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "5047:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "5011:5:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "5036:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "5018:17:1"
},
"nodeType": "YulFunctionCall",
"src": "5018:24:1"
}
],
"functionName": {
"name": "eq",
"nodeType": "YulIdentifier",
"src": "5008:2:1"
},
"nodeType": "YulFunctionCall",
"src": "5008:35:1"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "5001:6:1"
},
"nodeType": "YulFunctionCall",
"src": "5001:43:1"
},
"nodeType": "YulIf",
"src": "4998:2:1"
}
]
},
"name": "validator_revert_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "4981:5:1",
"type": ""
}
],
"src": "4945:122:1"
}
]
},
"contents": "{\n\n function abi_decode_available_length_t_string_memory_ptr(src, length, end) -> array {\n array := allocate_memory(array_allocation_size_t_string_memory_ptr(length))\n mstore(array, length)\n let dst := add(array, 0x20)\n if gt(add(src, length), end) { revert(0, 0) }\n copy_calldata_to_memory(src, dst, length)\n }\n\n // string\n function abi_decode_t_string_memory_ptr(offset, end) -> array {\n if iszero(slt(add(offset, 0x1f), end)) { revert(0, 0) }\n let length := calldataload(offset)\n array := abi_decode_available_length_t_string_memory_ptr(add(offset, 0x20), length, end)\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_string_memory_ptr(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n\n {\n\n let offset := calldataload(add(headStart, 0))\n if gt(offset, 0xffffffffffffffff) { revert(0, 0) }\n\n value0 := abi_decode_t_string_memory_ptr(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_string_memory_ptr_to_t_string_memory_ptr_fromStack(value, pos) -> end {\n let length := array_length_t_string_memory_ptr(value)\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, length)\n copy_memory_to_memory(add(value, 0x20), pos, length)\n end := add(pos, round_up_to_mul_of_32(length))\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_string_memory_ptr__to_t_string_memory_ptr__fromStack_reversed(headStart , value0) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack(value0, 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_memory(size) -> memPtr {\n memPtr := allocate_unbounded()\n finalize_allocation(memPtr, size)\n }\n\n function allocate_unbounded() -> memPtr {\n memPtr := mload(64)\n }\n\n function array_allocation_size_t_string_memory_ptr(length) -> size {\n // Make sure we can allocate memory without overflow\n if gt(length, 0xffffffffffffffff) { panic_error_0x41() }\n\n size := round_up_to_mul_of_32(length)\n\n // add length slot\n size := add(size, 0x20)\n\n }\n\n function array_length_t_string_memory_ptr(value) -> length {\n\n length := mload(value)\n\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_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function copy_calldata_to_memory(src, dst, length) {\n calldatacopy(dst, src, length)\n // clear end\n mstore(add(dst, length), 0)\n }\n\n function copy_memory_to_memory(src, dst, length) {\n let i := 0\n for { } lt(i, length) { i := add(i, 32) }\n {\n mstore(add(dst, i), mload(add(src, i)))\n }\n if gt(i, length)\n {\n // clear end\n mstore(add(dst, length), 0)\n }\n }\n\n function extract_byte_array_length(data) -> length {\n length := div(data, 2)\n let outOfPlaceEncoding := and(data, 1)\n if iszero(outOfPlaceEncoding) {\n length := and(length, 0x7f)\n }\n\n if eq(outOfPlaceEncoding, lt(length, 32)) {\n panic_error_0x22()\n }\n }\n\n function finalize_allocation(memPtr, size) {\n let newFreePtr := add(memPtr, round_up_to_mul_of_32(size))\n // protect against overflow\n if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }\n mstore(64, newFreePtr)\n }\n\n function panic_error_0x22() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x22)\n revert(0, 0x24)\n }\n\n function panic_error_0x41() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x41)\n revert(0, 0x24)\n }\n\n function round_up_to_mul_of_32(value) -> result {\n result := and(add(value, 31), not(31))\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": "608060405234801561001057600080fd5b50600436106100415760003560e01c80633d0c46d0146100465780636a226a491461006457806386f79edb14610080575b600080fd5b61004e6100b0565b60405161005b91906103c5565b60405180910390f35b61007e600480360381019061007991906102f1565b6100bc565b005b61009a60048036038101906100959190610332565b6100fb565b6040516100a791906103a3565b60405180910390f35b60008080549050905090565b6000819080600181540180825580915050600190039060005260206000200160009091909190915090805190602001906100f79291906101d1565b5050565b606060008281548110610137577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001805461014c9061049e565b80601f01602080910402602001604051908101604052809291908181526020018280546101789061049e565b80156101c55780601f1061019a576101008083540402835291602001916101c5565b820191906000526020600020905b8154815290600101906020018083116101a857829003601f168201915b50505050509050919050565b8280546101dd9061049e565b90600052602060002090601f0160209004810192826101ff5760008555610246565b82601f1061021857805160ff1916838001178555610246565b82800160010185558215610246579182015b8281111561024557825182559160200191906001019061022a565b5b5090506102539190610257565b5090565b5b80821115610270576000816000905550600101610258565b5090565b600061028761028284610405565b6103e0565b90508281526020810184848401111561029f57600080fd5b6102aa84828561045c565b509392505050565b600082601f8301126102c357600080fd5b81356102d3848260208601610274565b91505092915050565b6000813590506102eb81610570565b92915050565b60006020828403121561030357600080fd5b600082013567ffffffffffffffff81111561031d57600080fd5b610329848285016102b2565b91505092915050565b60006020828403121561034457600080fd5b6000610352848285016102dc565b91505092915050565b600061036682610436565b6103708185610441565b935061038081856020860161046b565b6103898161055f565b840191505092915050565b61039d81610452565b82525050565b600060208201905081810360008301526103bd818461035b565b905092915050565b60006020820190506103da6000830184610394565b92915050565b60006103ea6103fb565b90506103f682826104d0565b919050565b6000604051905090565b600067ffffffffffffffff8211156104205761041f610530565b5b6104298261055f565b9050602081019050919050565b600081519050919050565b600082825260208201905092915050565b6000819050919050565b82818337600083830152505050565b60005b8381101561048957808201518184015260208101905061046e565b83811115610498576000848401525b50505050565b600060028204905060018216806104b657607f821691505b602082108114156104ca576104c9610501565b5b50919050565b6104d98261055f565b810181811067ffffffffffffffff821117156104f8576104f7610530565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b61057981610452565b811461058457600080fd5b5056fea2646970667358221220ddc3f4d05ed1ddbdbefc60dc2930c09812c60450ee175520daa76afc8355145d64736f6c63430008010033",
"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 0x3D0C46D0 EQ PUSH2 0x46 JUMPI DUP1 PUSH4 0x6A226A49 EQ PUSH2 0x64 JUMPI DUP1 PUSH4 0x86F79EDB EQ PUSH2 0x80 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4E PUSH2 0xB0 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x5B SWAP2 SWAP1 PUSH2 0x3C5 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x7E PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x79 SWAP2 SWAP1 PUSH2 0x2F1 JUMP JUMPDEST PUSH2 0xBC JUMP JUMPDEST STOP JUMPDEST PUSH2 0x9A PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x95 SWAP2 SWAP1 PUSH2 0x332 JUMP JUMPDEST PUSH2 0xFB JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xA7 SWAP2 SWAP1 PUSH2 0x3A3 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 DUP1 DUP1 SLOAD SWAP1 POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 DUP1 PUSH1 0x1 DUP2 SLOAD ADD DUP1 DUP3 SSTORE DUP1 SWAP2 POP POP PUSH1 0x1 SWAP1 SUB SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SWAP2 SWAP1 SWAP2 SWAP1 SWAP2 POP SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0xF7 SWAP3 SWAP2 SWAP1 PUSH2 0x1D1 JUMP JUMPDEST POP POP JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP3 DUP2 SLOAD DUP2 LT PUSH2 0x137 JUMPI PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x32 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD DUP1 SLOAD PUSH2 0x14C SWAP1 PUSH2 0x49E JUMP JUMPDEST DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH2 0x178 SWAP1 PUSH2 0x49E JUMP JUMPDEST DUP1 ISZERO PUSH2 0x1C5 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x19A JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x1C5 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1A8 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH2 0x1DD SWAP1 PUSH2 0x49E JUMP JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH2 0x1FF JUMPI PUSH1 0x0 DUP6 SSTORE PUSH2 0x246 JUMP JUMPDEST DUP3 PUSH1 0x1F LT PUSH2 0x218 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x246 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x246 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x245 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x22A JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x253 SWAP2 SWAP1 PUSH2 0x257 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x270 JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH2 0x258 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x287 PUSH2 0x282 DUP5 PUSH2 0x405 JUMP JUMPDEST PUSH2 0x3E0 JUMP JUMPDEST SWAP1 POP DUP3 DUP2 MSTORE PUSH1 0x20 DUP2 ADD DUP5 DUP5 DUP5 ADD GT ISZERO PUSH2 0x29F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x2AA DUP5 DUP3 DUP6 PUSH2 0x45C JUMP JUMPDEST POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH1 0x1F DUP4 ADD SLT PUSH2 0x2C3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x2D3 DUP5 DUP3 PUSH1 0x20 DUP7 ADD PUSH2 0x274 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x2EB DUP2 PUSH2 0x570 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x303 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x31D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x329 DUP5 DUP3 DUP6 ADD PUSH2 0x2B2 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x344 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x352 DUP5 DUP3 DUP6 ADD PUSH2 0x2DC JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x366 DUP3 PUSH2 0x436 JUMP JUMPDEST PUSH2 0x370 DUP2 DUP6 PUSH2 0x441 JUMP JUMPDEST SWAP4 POP PUSH2 0x380 DUP2 DUP6 PUSH1 0x20 DUP7 ADD PUSH2 0x46B JUMP JUMPDEST PUSH2 0x389 DUP2 PUSH2 0x55F JUMP JUMPDEST DUP5 ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x39D DUP2 PUSH2 0x452 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x3BD DUP2 DUP5 PUSH2 0x35B JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x3DA PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x394 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x3EA PUSH2 0x3FB JUMP JUMPDEST SWAP1 POP PUSH2 0x3F6 DUP3 DUP3 PUSH2 0x4D0 JUMP JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x420 JUMPI PUSH2 0x41F PUSH2 0x530 JUMP JUMPDEST JUMPDEST PUSH2 0x429 DUP3 PUSH2 0x55F JUMP JUMPDEST SWAP1 POP PUSH1 0x20 DUP2 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST DUP3 DUP2 DUP4 CALLDATACOPY PUSH1 0x0 DUP4 DUP4 ADD MSTORE POP POP POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x489 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x46E JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x498 JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x2 DUP3 DIV SWAP1 POP PUSH1 0x1 DUP3 AND DUP1 PUSH2 0x4B6 JUMPI PUSH1 0x7F DUP3 AND SWAP2 POP JUMPDEST PUSH1 0x20 DUP3 LT DUP2 EQ ISZERO PUSH2 0x4CA JUMPI PUSH2 0x4C9 PUSH2 0x501 JUMP JUMPDEST JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x4D9 DUP3 PUSH2 0x55F JUMP JUMPDEST DUP2 ADD DUP2 DUP2 LT PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT OR ISZERO PUSH2 0x4F8 JUMPI PUSH2 0x4F7 PUSH2 0x530 JUMP JUMPDEST JUMPDEST DUP1 PUSH1 0x40 MSTORE POP POP POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x22 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x41 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x579 DUP2 PUSH2 0x452 JUMP JUMPDEST DUP2 EQ PUSH2 0x584 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xDD 0xC3 DELEGATECALL 0xD0 0x5E 0xD1 0xDD 0xBD 0xBE 0xFC PUSH1 0xDC 0x29 ADDRESS 0xC0 SWAP9 SLT 0xC6 DIV POP 0xEE OR SSTORE KECCAK256 0xDA 0xA7 PUSH11 0xFC8355145D64736F6C6343 STOP ADDMOD ADD STOP CALLER ",
"sourceMap": "70:371:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;341:98;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;123:90;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;223:108;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;341:98;390:7;416:9;:16;;;;409:23;;341:98;:::o;123:90::-;183:9;198:7;183:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;123:90;:::o;223:108::-;276:13;308:9;318:5;308:16;;;;;;;;;;;;;;;;;;;;;;;301:23;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;223:108;;;:::o;-1:-1:-1:-;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;:::o;7:345:1:-;;110:66;126:49;168:6;126:49;:::i;:::-;110:66;:::i;:::-;101:75;;199:6;192:5;185:21;237:4;230:5;226:16;275:3;266:6;261:3;257:16;254:25;251:2;;;292:1;289;282:12;251:2;305:41;339:6;334:3;329;305:41;:::i;:::-;91:261;;;;;;:::o;372:273::-;;477:3;470:4;462:6;458:17;454:27;444:2;;495:1;492;485:12;444:2;535:6;522:20;560:79;635:3;627:6;620:4;612:6;608:17;560:79;:::i;:::-;551:88;;434:211;;;;;:::o;651:139::-;;735:6;722:20;713:29;;751:33;778:5;751:33;:::i;:::-;703:87;;;;:::o;796:375::-;;914:2;902:9;893:7;889:23;885:32;882:2;;;930:1;927;920:12;882:2;1001:1;990:9;986:17;973:31;1031:18;1023:6;1020:30;1017:2;;;1063:1;1060;1053:12;1017:2;1091:63;1146:7;1137:6;1126:9;1122:22;1091:63;:::i;:::-;1081:73;;944:220;872:299;;;;:::o;1177:262::-;;1285:2;1273:9;1264:7;1260:23;1256:32;1253:2;;;1301:1;1298;1291:12;1253:2;1344:1;1369:53;1414:7;1405:6;1394:9;1390:22;1369:53;:::i;:::-;1359:63;;1315:117;1243:196;;;;:::o;1445:364::-;;1561:39;1594:5;1561:39;:::i;:::-;1616:71;1680:6;1675:3;1616:71;:::i;:::-;1609:78;;1696:52;1741:6;1736:3;1729:4;1722:5;1718:16;1696:52;:::i;:::-;1773:29;1795:6;1773:29;:::i;:::-;1768:3;1764:39;1757:46;;1537:272;;;;;:::o;1815:118::-;1902:24;1920:5;1902:24;:::i;:::-;1897:3;1890:37;1880:53;;:::o;1939:313::-;;2090:2;2079:9;2075:18;2067:26;;2139:9;2133:4;2129:20;2125:1;2114:9;2110:17;2103:47;2167:78;2240:4;2231:6;2167:78;:::i;:::-;2159:86;;2057:195;;;;:::o;2258:222::-;;2389:2;2378:9;2374:18;2366:26;;2402:71;2470:1;2459:9;2455:17;2446:6;2402:71;:::i;:::-;2356:124;;;;:::o;2486:129::-;;2547:20;;:::i;:::-;2537:30;;2576:33;2604:4;2596:6;2576:33;:::i;:::-;2527:88;;;:::o;2621:75::-;;2687:2;2681:9;2671:19;;2661:35;:::o;2702:308::-;;2854:18;2846:6;2843:30;2840:2;;;2876:18;;:::i;:::-;2840:2;2914:29;2936:6;2914:29;:::i;:::-;2906:37;;2998:4;2992;2988:15;2980:23;;2769:241;;;:::o;3016:99::-;;3102:5;3096:12;3086:22;;3075:40;;;:::o;3121:169::-;;3239:6;3234:3;3227:19;3279:4;3274:3;3270:14;3255:29;;3217:73;;;;:::o;3296:77::-;;3362:5;3351:16;;3341:32;;;:::o;3379:154::-;3463:6;3458:3;3453;3440:30;3525:1;3516:6;3511:3;3507:16;3500:27;3430:103;;;:::o;3539:307::-;3607:1;3617:113;3631:6;3628:1;3625:13;3617:113;;;3716:1;3711:3;3707:11;3701:18;3697:1;3692:3;3688:11;3681:39;3653:2;3650:1;3646:10;3641:15;;3617:113;;;3748:6;3745:1;3742:13;3739:2;;;3828:1;3819:6;3814:3;3810:16;3803:27;3739:2;3588:258;;;;:::o;3852:320::-;;3933:1;3927:4;3923:12;3913:22;;3980:1;3974:4;3970:12;4001:18;3991:2;;4057:4;4049:6;4045:17;4035:27;;3991:2;4119;4111:6;4108:14;4088:18;4085:38;4082:2;;;4138:18;;:::i;:::-;4082:2;3903:269;;;;:::o;4178:281::-;4261:27;4283:4;4261:27;:::i;:::-;4253:6;4249:40;4391:6;4379:10;4376:22;4355:18;4343:10;4340:34;4337:62;4334:2;;;4402:18;;:::i;:::-;4334:2;4442:10;4438:2;4431:22;4221:238;;;:::o;4465:180::-;4513:77;4510:1;4503:88;4610:4;4607:1;4600:15;4634:4;4631:1;4624:15;4651:180;4699:77;4696:1;4689:88;4796:4;4793:1;4786:15;4820:4;4817:1;4810:15;4837:102;;4929:2;4925:7;4920:2;4913:5;4909:14;4905:28;4895:38;;4885:54;;;:::o;4945:122::-;5018:24;5036:5;5018:24;:::i;:::-;5011:5;5008:35;4998:2;;5057:1;5054;5047:12;4998:2;4988:79;:::o"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "293800",
"executionCost": "331",
"totalCost": "294131"
},
"external": {
"addMessage(string)": "infinite",
"getMessage(uint256)": "infinite",
"getMessagesCount()": "1123"
}
},
"methodIdentifiers": {
"addMessage(string)": "6a226a49",
"getMessage(uint256)": "86f79edb",
"getMessagesCount()": "3d0c46d0"
}
},
"abi": [
{
"inputs": [
{
"internalType": "string",
"name": "message",
"type": "string"
}
],
"name": "addMessage",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "getMessage",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getMessagesCount",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.1+commit.df193b15"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [
{
"internalType": "string",
"name": "message",
"type": "string"
}
],
"name": "addMessage",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "getMessage",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getMessagesCount",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/messages.sol": "Messages"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"contracts/messages.sol": {
"keccak256": "0xcea264230986809f548461e9e551860a84991f2de1bd8d892c63049257cc33d5",
"license": "GPL-3.0",
"urls": [
"bzz-raw://4f8989dab039b8e58fdce02840aa7b481e603066b194a32bef6c9a5dafb39821",
"dweb:/ipfs/QmPfLWERXbgWQ2MAgJCppyC4VQGf1XQqDcoTzXbbewqhea"
]
}
},
"version": 1
}
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract Messages {
string[] _messages;
function addMessage(string memory message) public {
_messages.push(message);
}
function getMessage(uint index) public view returns (string memory) {
return _messages[index];
}
function getMessagesCount() public view returns (uint256) {
return _messages.length;
}
}
// Right click on the script name and hit "Run" to execute
(async () => {
try {
console.log('Running deployWithEthers script...')
const contractName = 'Storage' // Change this for other contract
const constructorArgs = [] // Put constructor args (if any) here for your contract
// Note that the script needs the ABI which is generated from the compilation artifact.
// Make sure contract is compiled and artifacts are generated
const artifactsPath = `browser/contracts/artifacts/${contractName}.json` // Change this for different path
const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath))
// 'web3Provider' is a remix global variable object
const signer = (new ethers.providers.Web3Provider(web3Provider)).getSigner()
let factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer);
let contract = await factory.deploy(...constructorArgs);
console.log('Contract Address: ', contract.address);
// The contract is NOT deployed yet; we must wait until it is mined
await contract.deployed()
console.log('Deployment successful.')
} catch (e) {
console.log(e.message)
}
})()
// Right click on the script name and hit "Run" to execute
(async () => {
try {
console.log('Running deployWithWeb3 script...')
const contractName = 'Storage' // Change this for other contract
const constructorArgs = [] // Put constructor args (if any) here for your contract
// Note that the script needs the ABI which is generated from the compilation artifact.
// Make sure contract is compiled and artifacts are generated
const artifactsPath = `browser/contracts/artifacts/${contractName}.json` // Change this for different path
const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath))
const accounts = await web3.eth.getAccounts()
let contract = new web3.eth.Contract(metadata.abi)
contract = contract.deploy({
data: metadata.data.bytecode.object,
arguments: constructorArgs
})
const newContractInstance = await contract.send({
from: accounts[0],
gas: 1500000,
gasPrice: '30000000000'
})
console.log('Contract deployed at address: ', newContractInstance.options.address)
} catch (e) {
console.log(e.message)
}
})()
// 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;
}
}
@taruscript
Copy link
Author

first commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment