Skip to content

Instantly share code, notes, and snippets.

@ArpitxGit
Last active May 29, 2021 10:08
Show Gist options
  • Save ArpitxGit/a93e35c9929cb1ff68bb2d58079e4009 to your computer and use it in GitHub Desktop.
Save ArpitxGit/a93e35c9929cb1ff68bb2d58079e4009 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;
contract Game {
bytes32 constant ROCK = "ROCK";
bytes32 constant PAPER = "PAPER";
bytes32 constant SCISSORS = "SCISSORS";
mapping(address => bytes32) public choices;
function play(bytes32 choice) external {
//We cannot check whether choice is valid or not
require(choices[msg.sender] == bytes32(0)); // make sure player hasnt played before
choices[msg.sender] = choice;
}
function evaluate(
address alice,
bytes32 aliceChoice,
bytes32 aliceRandomness, //Randomness added which prevents the other user from correctly guessing the move of the other player
address bob,
bytes32 bobChoice,
bytes32 bobRandomness // Randomness added which prevents the other user from correctly guessing the move of the other player
) external view returns (address) {
// making sure the commitment of the choices hold - Player now reveals what their choice was and randomness can be made public at this point
require(
keccak256(abi.encodePacked(aliceChoice, aliceRandomness)) ==
choices[alice]
);
// checking that bob isn't trying to change their move and their choice was correct
require(
keccak256(abi.encodePacked(bobChoice, bobRandomness)) ==
choices[bob]
);
// same as before, its a draw if both users picked the same choice and same randomness, this is possible if their randomness was empty!
if (aliceChoice == bobChoice) {
return address(0);
}
if (aliceChoice == ROCK && bobChoice == PAPER) {
return bob;
} else if (bobChoice == ROCK && aliceChoice == PAPER) {
return alice;
} else if (aliceChoice == SCISSORS && bobChoice == PAPER) {
return alice;
} else if (bobChoice == SCISSORS && aliceChoice == PAPER) {
return bob;
} else if (aliceChoice == ROCK && bobChoice == SCISSORS) {
return alice;
} else if (bobChoice == ROCK && aliceChoice == SCISSORS) {
return bob;
}
return address (0);
}
}
// 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": "608060405234801561001057600080fd5b506106db806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063410346b31461004657806380408e9d14610076578063c7a1865b146100a6575b600080fd5b610060600480360381019061005b91906104bf565b6100c2565b60405161006d9190610616565b60405180910390f35b610090600480360381019061008b91906104e8565b6100da565b60405161009d91906105fb565b60405180910390f35b6100c060048036038101906100bb9190610571565b610402565b005b60006020528060005260406000206000915090505481565b60008060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054868660405160200161012e9291906105cf565b604051602081830303815290604052805190602001201461014e57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483836040516020016101a09291906105cf565b60405160208183030381529060405280519060200120146101c057600080fd5b828614156101d157600090506103f8565b7f524f434b000000000000000000000000000000000000000000000000000000008614801561021f57507f504150455200000000000000000000000000000000000000000000000000000083145b1561022c578390506103f8565b7f524f434b000000000000000000000000000000000000000000000000000000008314801561027a57507f504150455200000000000000000000000000000000000000000000000000000086145b15610287578690506103f8565b7f53434953534f5253000000000000000000000000000000000000000000000000861480156102d557507f504150455200000000000000000000000000000000000000000000000000000083145b156102e2578690506103f8565b7f53434953534f52530000000000000000000000000000000000000000000000008314801561033057507f504150455200000000000000000000000000000000000000000000000000000086145b1561033d578390506103f8565b7f524f434b000000000000000000000000000000000000000000000000000000008614801561038b57507f53434953534f525300000000000000000000000000000000000000000000000083145b15610398578690506103f8565b7f524f434b00000000000000000000000000000000000000000000000000000000831480156103e657507f53434953534f525300000000000000000000000000000000000000000000000086145b156103f3578390506103f8565b600090505b9695505050505050565b6000801b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461044f57600080fd5b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b6000813590506104a481610677565b92915050565b6000813590506104b98161068e565b92915050565b6000602082840312156104d157600080fd5b60006104df84828501610495565b91505092915050565b60008060008060008060c0878903121561050157600080fd5b600061050f89828a01610495565b965050602061052089828a016104aa565b955050604061053189828a016104aa565b945050606061054289828a01610495565b935050608061055389828a016104aa565b92505060a061056489828a016104aa565b9150509295509295509295565b60006020828403121561058357600080fd5b6000610591848285016104aa565b91505092915050565b6105a381610631565b82525050565b6105b281610643565b82525050565b6105c96105c482610643565b61066d565b82525050565b60006105db82856105b8565b6020820191506105eb82846105b8565b6020820191508190509392505050565b6000602082019050610610600083018461059a565b92915050565b600060208201905061062b60008301846105a9565b92915050565b600061063c8261064d565b9050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61068081610631565b811461068b57600080fd5b50565b61069781610643565b81146106a257600080fd5b5056fea2646970667358221220eeed150e41af528d93fc3af135b585b418606ac3c38aec4920aa7829b0867cf064736f6c63430008010033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x6DB 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 0x410346B3 EQ PUSH2 0x46 JUMPI DUP1 PUSH4 0x80408E9D EQ PUSH2 0x76 JUMPI DUP1 PUSH4 0xC7A1865B EQ PUSH2 0xA6 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x60 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x5B SWAP2 SWAP1 PUSH2 0x4BF JUMP JUMPDEST PUSH2 0xC2 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x6D SWAP2 SWAP1 PUSH2 0x616 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x90 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x8B SWAP2 SWAP1 PUSH2 0x4E8 JUMP JUMPDEST PUSH2 0xDA JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x9D SWAP2 SWAP1 PUSH2 0x5FB JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0xC0 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0xBB SWAP2 SWAP1 PUSH2 0x571 JUMP JUMPDEST PUSH2 0x402 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP9 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP7 DUP7 PUSH1 0x40 MLOAD PUSH1 0x20 ADD PUSH2 0x12E SWAP3 SWAP2 SWAP1 PUSH2 0x5CF JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 EQ PUSH2 0x14E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP4 DUP4 PUSH1 0x40 MLOAD PUSH1 0x20 ADD PUSH2 0x1A0 SWAP3 SWAP2 SWAP1 PUSH2 0x5CF JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 EQ PUSH2 0x1C0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 DUP7 EQ ISZERO PUSH2 0x1D1 JUMPI PUSH1 0x0 SWAP1 POP PUSH2 0x3F8 JUMP JUMPDEST PUSH32 0x524F434B00000000000000000000000000000000000000000000000000000000 DUP7 EQ DUP1 ISZERO PUSH2 0x21F JUMPI POP PUSH32 0x5041504552000000000000000000000000000000000000000000000000000000 DUP4 EQ JUMPDEST ISZERO PUSH2 0x22C JUMPI DUP4 SWAP1 POP PUSH2 0x3F8 JUMP JUMPDEST PUSH32 0x524F434B00000000000000000000000000000000000000000000000000000000 DUP4 EQ DUP1 ISZERO PUSH2 0x27A JUMPI POP PUSH32 0x5041504552000000000000000000000000000000000000000000000000000000 DUP7 EQ JUMPDEST ISZERO PUSH2 0x287 JUMPI DUP7 SWAP1 POP PUSH2 0x3F8 JUMP JUMPDEST PUSH32 0x53434953534F5253000000000000000000000000000000000000000000000000 DUP7 EQ DUP1 ISZERO PUSH2 0x2D5 JUMPI POP PUSH32 0x5041504552000000000000000000000000000000000000000000000000000000 DUP4 EQ JUMPDEST ISZERO PUSH2 0x2E2 JUMPI DUP7 SWAP1 POP PUSH2 0x3F8 JUMP JUMPDEST PUSH32 0x53434953534F5253000000000000000000000000000000000000000000000000 DUP4 EQ DUP1 ISZERO PUSH2 0x330 JUMPI POP PUSH32 0x5041504552000000000000000000000000000000000000000000000000000000 DUP7 EQ JUMPDEST ISZERO PUSH2 0x33D JUMPI DUP4 SWAP1 POP PUSH2 0x3F8 JUMP JUMPDEST PUSH32 0x524F434B00000000000000000000000000000000000000000000000000000000 DUP7 EQ DUP1 ISZERO PUSH2 0x38B JUMPI POP PUSH32 0x53434953534F5253000000000000000000000000000000000000000000000000 DUP4 EQ JUMPDEST ISZERO PUSH2 0x398 JUMPI DUP7 SWAP1 POP PUSH2 0x3F8 JUMP JUMPDEST PUSH32 0x524F434B00000000000000000000000000000000000000000000000000000000 DUP4 EQ DUP1 ISZERO PUSH2 0x3E6 JUMPI POP PUSH32 0x53434953534F5253000000000000000000000000000000000000000000000000 DUP7 EQ JUMPDEST ISZERO PUSH2 0x3F3 JUMPI DUP4 SWAP1 POP PUSH2 0x3F8 JUMP JUMPDEST PUSH1 0x0 SWAP1 POP JUMPDEST SWAP7 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SHL PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD EQ PUSH2 0x44F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x4A4 DUP2 PUSH2 0x677 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x4B9 DUP2 PUSH2 0x68E JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4D1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x4DF DUP5 DUP3 DUP6 ADD PUSH2 0x495 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0xC0 DUP8 DUP10 SUB SLT ISZERO PUSH2 0x501 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x50F DUP10 DUP3 DUP11 ADD PUSH2 0x495 JUMP JUMPDEST SWAP7 POP POP PUSH1 0x20 PUSH2 0x520 DUP10 DUP3 DUP11 ADD PUSH2 0x4AA JUMP JUMPDEST SWAP6 POP POP PUSH1 0x40 PUSH2 0x531 DUP10 DUP3 DUP11 ADD PUSH2 0x4AA JUMP JUMPDEST SWAP5 POP POP PUSH1 0x60 PUSH2 0x542 DUP10 DUP3 DUP11 ADD PUSH2 0x495 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x80 PUSH2 0x553 DUP10 DUP3 DUP11 ADD PUSH2 0x4AA JUMP JUMPDEST SWAP3 POP POP PUSH1 0xA0 PUSH2 0x564 DUP10 DUP3 DUP11 ADD PUSH2 0x4AA JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP6 POP SWAP3 SWAP6 POP SWAP3 SWAP6 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x583 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x591 DUP5 DUP3 DUP6 ADD PUSH2 0x4AA JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x5A3 DUP2 PUSH2 0x631 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x5B2 DUP2 PUSH2 0x643 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x5C9 PUSH2 0x5C4 DUP3 PUSH2 0x643 JUMP JUMPDEST PUSH2 0x66D JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x5DB DUP3 DUP6 PUSH2 0x5B8 JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH2 0x5EB DUP3 DUP5 PUSH2 0x5B8 JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP2 POP DUP2 SWAP1 POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x610 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x59A JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x62B PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x5A9 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x63C DUP3 PUSH2 0x64D JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 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 PUSH2 0x680 DUP2 PUSH2 0x631 JUMP JUMPDEST DUP2 EQ PUSH2 0x68B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH2 0x697 DUP2 PUSH2 0x643 JUMP JUMPDEST DUP2 EQ PUSH2 0x6A2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xEE 0xED ISZERO 0xE COINBASE 0xAF MSTORE DUP14 SWAP4 0xFC GASPRICE CALL CALLDATALOAD 0xB5 DUP6 0xB4 XOR PUSH1 0x6A 0xC3 0xC3 DUP11 0xEC 0x49 KECCAK256 0xAA PUSH25 0x29B0867CF064736F6C63430008010033000000000000000000 ",
"sourceMap": "71:2181:0:-:0;;;;;;;;;;;;;;;;;;;"
},
"deployedBytecode": {
"generatedSources": [
{
"ast": {
"nodeType": "YulBlock",
"src": "0:3754: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_bytes32",
"nodeType": "YulIdentifier",
"src": "252:26:1"
},
"nodeType": "YulFunctionCall",
"src": "252:33:1"
},
"nodeType": "YulExpressionStatement",
"src": "252:33:1"
}
]
},
"name": "abi_decode_t_bytes32",
"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": "716:839:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "763:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "772:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "775:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "765:6:1"
},
"nodeType": "YulFunctionCall",
"src": "765:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "765:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "737:7:1"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "746:9:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "733:3:1"
},
"nodeType": "YulFunctionCall",
"src": "733:23:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "758:3:1",
"type": "",
"value": "192"
}
],
"functionName": {
"name": "slt",
"nodeType": "YulIdentifier",
"src": "729:3:1"
},
"nodeType": "YulFunctionCall",
"src": "729:33:1"
},
"nodeType": "YulIf",
"src": "726:2:1"
},
{
"nodeType": "YulBlock",
"src": "789:117:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "804:15:1",
"value": {
"kind": "number",
"nodeType": "YulLiteral",
"src": "818:1:1",
"type": "",
"value": "0"
},
"variables": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "808:6:1",
"type": ""
}
]
},
{
"nodeType": "YulAssignment",
"src": "833:63:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "868:9:1"
},
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "879:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "864:3:1"
},
"nodeType": "YulFunctionCall",
"src": "864:22:1"
},
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "888:7:1"
}
],
"functionName": {
"name": "abi_decode_t_address",
"nodeType": "YulIdentifier",
"src": "843:20:1"
},
"nodeType": "YulFunctionCall",
"src": "843:53:1"
},
"variableNames": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "833:6:1"
}
]
}
]
},
{
"nodeType": "YulBlock",
"src": "916:118:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "931:16:1",
"value": {
"kind": "number",
"nodeType": "YulLiteral",
"src": "945:2:1",
"type": "",
"value": "32"
},
"variables": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "935:6:1",
"type": ""
}
]
},
{
"nodeType": "YulAssignment",
"src": "961:63:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "996:9:1"
},
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "1007:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "992:3:1"
},
"nodeType": "YulFunctionCall",
"src": "992:22:1"
},
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "1016:7:1"
}
],
"functionName": {
"name": "abi_decode_t_bytes32",
"nodeType": "YulIdentifier",
"src": "971:20:1"
},
"nodeType": "YulFunctionCall",
"src": "971:53:1"
},
"variableNames": [
{
"name": "value1",
"nodeType": "YulIdentifier",
"src": "961:6:1"
}
]
}
]
},
{
"nodeType": "YulBlock",
"src": "1044:118:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "1059:16:1",
"value": {
"kind": "number",
"nodeType": "YulLiteral",
"src": "1073:2:1",
"type": "",
"value": "64"
},
"variables": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "1063:6:1",
"type": ""
}
]
},
{
"nodeType": "YulAssignment",
"src": "1089:63:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1124:9:1"
},
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "1135:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1120:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1120:22:1"
},
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "1144:7:1"
}
],
"functionName": {
"name": "abi_decode_t_bytes32",
"nodeType": "YulIdentifier",
"src": "1099:20:1"
},
"nodeType": "YulFunctionCall",
"src": "1099:53:1"
},
"variableNames": [
{
"name": "value2",
"nodeType": "YulIdentifier",
"src": "1089:6:1"
}
]
}
]
},
{
"nodeType": "YulBlock",
"src": "1172:118:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "1187:16:1",
"value": {
"kind": "number",
"nodeType": "YulLiteral",
"src": "1201:2:1",
"type": "",
"value": "96"
},
"variables": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "1191:6:1",
"type": ""
}
]
},
{
"nodeType": "YulAssignment",
"src": "1217:63:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1252:9:1"
},
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "1263:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1248:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1248:22:1"
},
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "1272:7:1"
}
],
"functionName": {
"name": "abi_decode_t_address",
"nodeType": "YulIdentifier",
"src": "1227:20:1"
},
"nodeType": "YulFunctionCall",
"src": "1227:53:1"
},
"variableNames": [
{
"name": "value3",
"nodeType": "YulIdentifier",
"src": "1217:6:1"
}
]
}
]
},
{
"nodeType": "YulBlock",
"src": "1300:119:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "1315:17:1",
"value": {
"kind": "number",
"nodeType": "YulLiteral",
"src": "1329:3:1",
"type": "",
"value": "128"
},
"variables": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "1319:6:1",
"type": ""
}
]
},
{
"nodeType": "YulAssignment",
"src": "1346:63:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1381:9:1"
},
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "1392:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1377:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1377:22:1"
},
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "1401:7:1"
}
],
"functionName": {
"name": "abi_decode_t_bytes32",
"nodeType": "YulIdentifier",
"src": "1356:20:1"
},
"nodeType": "YulFunctionCall",
"src": "1356:53:1"
},
"variableNames": [
{
"name": "value4",
"nodeType": "YulIdentifier",
"src": "1346:6:1"
}
]
}
]
},
{
"nodeType": "YulBlock",
"src": "1429:119:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "1444:17:1",
"value": {
"kind": "number",
"nodeType": "YulLiteral",
"src": "1458:3:1",
"type": "",
"value": "160"
},
"variables": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "1448:6:1",
"type": ""
}
]
},
{
"nodeType": "YulAssignment",
"src": "1475:63:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1510:9:1"
},
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "1521:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1506:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1506:22:1"
},
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "1530:7:1"
}
],
"functionName": {
"name": "abi_decode_t_bytes32",
"nodeType": "YulIdentifier",
"src": "1485:20:1"
},
"nodeType": "YulFunctionCall",
"src": "1485:53:1"
},
"variableNames": [
{
"name": "value5",
"nodeType": "YulIdentifier",
"src": "1475:6:1"
}
]
}
]
}
]
},
"name": "abi_decode_tuple_t_addresst_bytes32t_bytes32t_addresst_bytes32t_bytes32",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "646:9:1",
"type": ""
},
{
"name": "dataEnd",
"nodeType": "YulTypedName",
"src": "657:7:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "669:6:1",
"type": ""
},
{
"name": "value1",
"nodeType": "YulTypedName",
"src": "677:6:1",
"type": ""
},
{
"name": "value2",
"nodeType": "YulTypedName",
"src": "685:6:1",
"type": ""
},
{
"name": "value3",
"nodeType": "YulTypedName",
"src": "693:6:1",
"type": ""
},
{
"name": "value4",
"nodeType": "YulTypedName",
"src": "701:6:1",
"type": ""
},
{
"name": "value5",
"nodeType": "YulTypedName",
"src": "709:6:1",
"type": ""
}
],
"src": "565:990:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1627:196:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "1673:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1682:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1685:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "1675:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1675:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "1675:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "1648:7:1"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1657:9:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "1644:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1644:23:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1669:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "slt",
"nodeType": "YulIdentifier",
"src": "1640:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1640:32:1"
},
"nodeType": "YulIf",
"src": "1637:2:1"
},
{
"nodeType": "YulBlock",
"src": "1699:117:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "1714:15:1",
"value": {
"kind": "number",
"nodeType": "YulLiteral",
"src": "1728:1:1",
"type": "",
"value": "0"
},
"variables": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "1718:6:1",
"type": ""
}
]
},
{
"nodeType": "YulAssignment",
"src": "1743:63:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1778:9:1"
},
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "1789:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1774:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1774:22:1"
},
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "1798:7:1"
}
],
"functionName": {
"name": "abi_decode_t_bytes32",
"nodeType": "YulIdentifier",
"src": "1753:20:1"
},
"nodeType": "YulFunctionCall",
"src": "1753:53:1"
},
"variableNames": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "1743:6:1"
}
]
}
]
}
]
},
"name": "abi_decode_tuple_t_bytes32",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "1597:9:1",
"type": ""
},
{
"name": "dataEnd",
"nodeType": "YulTypedName",
"src": "1608:7:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "1620:6:1",
"type": ""
}
],
"src": "1561:262:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1894:53:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "1911:3:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1934:5:1"
}
],
"functionName": {
"name": "cleanup_t_address",
"nodeType": "YulIdentifier",
"src": "1916:17:1"
},
"nodeType": "YulFunctionCall",
"src": "1916:24:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1904:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1904:37:1"
},
"nodeType": "YulExpressionStatement",
"src": "1904:37:1"
}
]
},
"name": "abi_encode_t_address_to_t_address_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1882:5:1",
"type": ""
},
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "1889:3:1",
"type": ""
}
],
"src": "1829:118:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2018:53:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "2035:3:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "2058:5:1"
}
],
"functionName": {
"name": "cleanup_t_bytes32",
"nodeType": "YulIdentifier",
"src": "2040:17:1"
},
"nodeType": "YulFunctionCall",
"src": "2040:24:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "2028:6:1"
},
"nodeType": "YulFunctionCall",
"src": "2028:37:1"
},
"nodeType": "YulExpressionStatement",
"src": "2028:37:1"
}
]
},
"name": "abi_encode_t_bytes32_to_t_bytes32_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "2006:5:1",
"type": ""
},
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "2013:3:1",
"type": ""
}
],
"src": "1953:118:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2160:74:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "2177:3:1"
},
{
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "2220:5:1"
}
],
"functionName": {
"name": "cleanup_t_bytes32",
"nodeType": "YulIdentifier",
"src": "2202:17:1"
},
"nodeType": "YulFunctionCall",
"src": "2202:24:1"
}
],
"functionName": {
"name": "leftAlign_t_bytes32",
"nodeType": "YulIdentifier",
"src": "2182:19:1"
},
"nodeType": "YulFunctionCall",
"src": "2182:45:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "2170:6:1"
},
"nodeType": "YulFunctionCall",
"src": "2170:58:1"
},
"nodeType": "YulExpressionStatement",
"src": "2170:58:1"
}
]
},
"name": "abi_encode_t_bytes32_to_t_bytes32_nonPadded_inplace_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "2148:5:1",
"type": ""
},
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "2155:3:1",
"type": ""
}
],
"src": "2077:157:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2384:253:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "2457:6:1"
},
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "2466:3:1"
}
],
"functionName": {
"name": "abi_encode_t_bytes32_to_t_bytes32_nonPadded_inplace_fromStack",
"nodeType": "YulIdentifier",
"src": "2395:61:1"
},
"nodeType": "YulFunctionCall",
"src": "2395:75:1"
},
"nodeType": "YulExpressionStatement",
"src": "2395:75:1"
},
{
"nodeType": "YulAssignment",
"src": "2479:19:1",
"value": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "2490:3:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2495:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "2486:3:1"
},
"nodeType": "YulFunctionCall",
"src": "2486:12:1"
},
"variableNames": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "2479:3:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value1",
"nodeType": "YulIdentifier",
"src": "2570:6:1"
},
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "2579:3:1"
}
],
"functionName": {
"name": "abi_encode_t_bytes32_to_t_bytes32_nonPadded_inplace_fromStack",
"nodeType": "YulIdentifier",
"src": "2508:61:1"
},
"nodeType": "YulFunctionCall",
"src": "2508:75:1"
},
"nodeType": "YulExpressionStatement",
"src": "2508:75:1"
},
{
"nodeType": "YulAssignment",
"src": "2592:19:1",
"value": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "2603:3:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2608:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "2599:3:1"
},
"nodeType": "YulFunctionCall",
"src": "2599:12:1"
},
"variableNames": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "2592:3:1"
}
]
},
{
"nodeType": "YulAssignment",
"src": "2621:10:1",
"value": {
"name": "pos",
"nodeType": "YulIdentifier",
"src": "2628:3:1"
},
"variableNames": [
{
"name": "end",
"nodeType": "YulIdentifier",
"src": "2621:3:1"
}
]
}
]
},
"name": "abi_encode_tuple_packed_t_bytes32_t_bytes32__to_t_bytes32_t_bytes32__nonPadded_inplace_fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "2355:3:1",
"type": ""
},
{
"name": "value1",
"nodeType": "YulTypedName",
"src": "2361:6:1",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "2369:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "end",
"nodeType": "YulTypedName",
"src": "2380:3:1",
"type": ""
}
],
"src": "2240:397:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2741:124:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "2751:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "2763:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2774:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "2759:3:1"
},
"nodeType": "YulFunctionCall",
"src": "2759:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "2751:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "2831:6:1"
},
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "2844:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2855:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "2840:3:1"
},
"nodeType": "YulFunctionCall",
"src": "2840:17:1"
}
],
"functionName": {
"name": "abi_encode_t_address_to_t_address_fromStack",
"nodeType": "YulIdentifier",
"src": "2787:43:1"
},
"nodeType": "YulFunctionCall",
"src": "2787:71:1"
},
"nodeType": "YulExpressionStatement",
"src": "2787:71:1"
}
]
},
"name": "abi_encode_tuple_t_address__to_t_address__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "2713:9:1",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "2725:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "2736:4:1",
"type": ""
}
],
"src": "2643:222:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2969:124:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "2979:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "2991:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3002:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "2987:3:1"
},
"nodeType": "YulFunctionCall",
"src": "2987:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "2979:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "3059:6:1"
},
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "3072:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3083:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "3068:3:1"
},
"nodeType": "YulFunctionCall",
"src": "3068:17:1"
}
],
"functionName": {
"name": "abi_encode_t_bytes32_to_t_bytes32_fromStack",
"nodeType": "YulIdentifier",
"src": "3015:43:1"
},
"nodeType": "YulFunctionCall",
"src": "3015:71:1"
},
"nodeType": "YulExpressionStatement",
"src": "3015:71:1"
}
]
},
"name": "abi_encode_tuple_t_bytes32__to_t_bytes32__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "2941:9:1",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "2953:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "2964:4:1",
"type": ""
}
],
"src": "2871:222:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "3144:51:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "3154:35:1",
"value": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "3183:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint160",
"nodeType": "YulIdentifier",
"src": "3165:17:1"
},
"nodeType": "YulFunctionCall",
"src": "3165:24:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "3154:7:1"
}
]
}
]
},
"name": "cleanup_t_address",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "3126:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "3136:7:1",
"type": ""
}
],
"src": "3099:96:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "3246:32:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "3256:16:1",
"value": {
"name": "value",
"nodeType": "YulIdentifier",
"src": "3267:5:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "3256:7:1"
}
]
}
]
},
"name": "cleanup_t_bytes32",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "3228:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "3238:7:1",
"type": ""
}
],
"src": "3201:77:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "3329:81:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "3339:65:1",
"value": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "3354:5:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3361:42:1",
"type": "",
"value": "0xffffffffffffffffffffffffffffffffffffffff"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "3350:3:1"
},
"nodeType": "YulFunctionCall",
"src": "3350:54:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "3339:7:1"
}
]
}
]
},
"name": "cleanup_t_uint160",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "3311:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "3321:7:1",
"type": ""
}
],
"src": "3284:126:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "3463:32:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "3473:16:1",
"value": {
"name": "value",
"nodeType": "YulIdentifier",
"src": "3484:5:1"
},
"variableNames": [
{
"name": "aligned",
"nodeType": "YulIdentifier",
"src": "3473:7:1"
}
]
}
]
},
"name": "leftAlign_t_bytes32",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "3445:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "aligned",
"nodeType": "YulTypedName",
"src": "3455:7:1",
"type": ""
}
],
"src": "3416:79:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "3544:79:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "3601:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3610:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3613:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "3603:6:1"
},
"nodeType": "YulFunctionCall",
"src": "3603:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "3603:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "3567:5:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "3592:5:1"
}
],
"functionName": {
"name": "cleanup_t_address",
"nodeType": "YulIdentifier",
"src": "3574:17:1"
},
"nodeType": "YulFunctionCall",
"src": "3574:24:1"
}
],
"functionName": {
"name": "eq",
"nodeType": "YulIdentifier",
"src": "3564:2:1"
},
"nodeType": "YulFunctionCall",
"src": "3564:35:1"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "3557:6:1"
},
"nodeType": "YulFunctionCall",
"src": "3557:43:1"
},
"nodeType": "YulIf",
"src": "3554:2:1"
}
]
},
"name": "validator_revert_t_address",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "3537:5:1",
"type": ""
}
],
"src": "3501:122:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "3672:79:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "3729:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3738:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3741:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "3731:6:1"
},
"nodeType": "YulFunctionCall",
"src": "3731:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "3731:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "3695:5:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "3720:5:1"
}
],
"functionName": {
"name": "cleanup_t_bytes32",
"nodeType": "YulIdentifier",
"src": "3702:17:1"
},
"nodeType": "YulFunctionCall",
"src": "3702:24:1"
}
],
"functionName": {
"name": "eq",
"nodeType": "YulIdentifier",
"src": "3692:2:1"
},
"nodeType": "YulFunctionCall",
"src": "3692:35:1"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "3685:6:1"
},
"nodeType": "YulFunctionCall",
"src": "3685:43:1"
},
"nodeType": "YulIf",
"src": "3682:2:1"
}
]
},
"name": "validator_revert_t_bytes32",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "3665:5:1",
"type": ""
}
],
"src": "3629: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_bytes32(offset, end) -> value {\n value := calldataload(offset)\n validator_revert_t_bytes32(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_addresst_bytes32t_bytes32t_addresst_bytes32t_bytes32(headStart, dataEnd) -> value0, value1, value2, value3, value4, value5 {\n if slt(sub(dataEnd, headStart), 192) { 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 let offset := 32\n\n value1 := abi_decode_t_bytes32(add(headStart, offset), dataEnd)\n }\n\n {\n\n let offset := 64\n\n value2 := abi_decode_t_bytes32(add(headStart, offset), dataEnd)\n }\n\n {\n\n let offset := 96\n\n value3 := abi_decode_t_address(add(headStart, offset), dataEnd)\n }\n\n {\n\n let offset := 128\n\n value4 := abi_decode_t_bytes32(add(headStart, offset), dataEnd)\n }\n\n {\n\n let offset := 160\n\n value5 := abi_decode_t_bytes32(add(headStart, offset), dataEnd)\n }\n\n }\n\n function abi_decode_tuple_t_bytes32(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_bytes32(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_bytes32_to_t_bytes32_fromStack(value, pos) {\n mstore(pos, cleanup_t_bytes32(value))\n }\n\n function abi_encode_t_bytes32_to_t_bytes32_nonPadded_inplace_fromStack(value, pos) {\n mstore(pos, leftAlign_t_bytes32(cleanup_t_bytes32(value)))\n }\n\n function abi_encode_tuple_packed_t_bytes32_t_bytes32__to_t_bytes32_t_bytes32__nonPadded_inplace_fromStack_reversed(pos , value1, value0) -> end {\n\n abi_encode_t_bytes32_to_t_bytes32_nonPadded_inplace_fromStack(value0, pos)\n pos := add(pos, 32)\n\n abi_encode_t_bytes32_to_t_bytes32_nonPadded_inplace_fromStack(value1, pos)\n pos := add(pos, 32)\n\n end := pos\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_bytes32__to_t_bytes32__fromStack_reversed(headStart , value0) -> tail {\n tail := add(headStart, 32)\n\n abi_encode_t_bytes32_to_t_bytes32_fromStack(value0, add(headStart, 0))\n\n }\n\n function cleanup_t_address(value) -> cleaned {\n cleaned := cleanup_t_uint160(value)\n }\n\n function cleanup_t_bytes32(value) -> cleaned {\n cleaned := value\n }\n\n function cleanup_t_uint160(value) -> cleaned {\n cleaned := and(value, 0xffffffffffffffffffffffffffffffffffffffff)\n }\n\n function leftAlign_t_bytes32(value) -> aligned {\n aligned := value\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_bytes32(value) {\n if iszero(eq(value, cleanup_t_bytes32(value))) { revert(0, 0) }\n }\n\n}\n",
"id": 1,
"language": "Yul",
"name": "#utility.yul"
}
],
"immutableReferences": {},
"linkReferences": {},
"object": "608060405234801561001057600080fd5b50600436106100415760003560e01c8063410346b31461004657806380408e9d14610076578063c7a1865b146100a6575b600080fd5b610060600480360381019061005b91906104bf565b6100c2565b60405161006d9190610616565b60405180910390f35b610090600480360381019061008b91906104e8565b6100da565b60405161009d91906105fb565b60405180910390f35b6100c060048036038101906100bb9190610571565b610402565b005b60006020528060005260406000206000915090505481565b60008060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054868660405160200161012e9291906105cf565b604051602081830303815290604052805190602001201461014e57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483836040516020016101a09291906105cf565b60405160208183030381529060405280519060200120146101c057600080fd5b828614156101d157600090506103f8565b7f524f434b000000000000000000000000000000000000000000000000000000008614801561021f57507f504150455200000000000000000000000000000000000000000000000000000083145b1561022c578390506103f8565b7f524f434b000000000000000000000000000000000000000000000000000000008314801561027a57507f504150455200000000000000000000000000000000000000000000000000000086145b15610287578690506103f8565b7f53434953534f5253000000000000000000000000000000000000000000000000861480156102d557507f504150455200000000000000000000000000000000000000000000000000000083145b156102e2578690506103f8565b7f53434953534f52530000000000000000000000000000000000000000000000008314801561033057507f504150455200000000000000000000000000000000000000000000000000000086145b1561033d578390506103f8565b7f524f434b000000000000000000000000000000000000000000000000000000008614801561038b57507f53434953534f525300000000000000000000000000000000000000000000000083145b15610398578690506103f8565b7f524f434b00000000000000000000000000000000000000000000000000000000831480156103e657507f53434953534f525300000000000000000000000000000000000000000000000086145b156103f3578390506103f8565b600090505b9695505050505050565b6000801b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461044f57600080fd5b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b6000813590506104a481610677565b92915050565b6000813590506104b98161068e565b92915050565b6000602082840312156104d157600080fd5b60006104df84828501610495565b91505092915050565b60008060008060008060c0878903121561050157600080fd5b600061050f89828a01610495565b965050602061052089828a016104aa565b955050604061053189828a016104aa565b945050606061054289828a01610495565b935050608061055389828a016104aa565b92505060a061056489828a016104aa565b9150509295509295509295565b60006020828403121561058357600080fd5b6000610591848285016104aa565b91505092915050565b6105a381610631565b82525050565b6105b281610643565b82525050565b6105c96105c482610643565b61066d565b82525050565b60006105db82856105b8565b6020820191506105eb82846105b8565b6020820191508190509392505050565b6000602082019050610610600083018461059a565b92915050565b600060208201905061062b60008301846105a9565b92915050565b600061063c8261064d565b9050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61068081610631565b811461068b57600080fd5b50565b61069781610643565b81146106a257600080fd5b5056fea2646970667358221220eeed150e41af528d93fc3af135b585b418606ac3c38aec4920aa7829b0867cf064736f6c63430008010033",
"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 0x410346B3 EQ PUSH2 0x46 JUMPI DUP1 PUSH4 0x80408E9D EQ PUSH2 0x76 JUMPI DUP1 PUSH4 0xC7A1865B EQ PUSH2 0xA6 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x60 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x5B SWAP2 SWAP1 PUSH2 0x4BF JUMP JUMPDEST PUSH2 0xC2 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x6D SWAP2 SWAP1 PUSH2 0x616 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x90 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x8B SWAP2 SWAP1 PUSH2 0x4E8 JUMP JUMPDEST PUSH2 0xDA JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x9D SWAP2 SWAP1 PUSH2 0x5FB JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0xC0 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0xBB SWAP2 SWAP1 PUSH2 0x571 JUMP JUMPDEST PUSH2 0x402 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP9 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP7 DUP7 PUSH1 0x40 MLOAD PUSH1 0x20 ADD PUSH2 0x12E SWAP3 SWAP2 SWAP1 PUSH2 0x5CF JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 EQ PUSH2 0x14E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP4 DUP4 PUSH1 0x40 MLOAD PUSH1 0x20 ADD PUSH2 0x1A0 SWAP3 SWAP2 SWAP1 PUSH2 0x5CF JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 EQ PUSH2 0x1C0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 DUP7 EQ ISZERO PUSH2 0x1D1 JUMPI PUSH1 0x0 SWAP1 POP PUSH2 0x3F8 JUMP JUMPDEST PUSH32 0x524F434B00000000000000000000000000000000000000000000000000000000 DUP7 EQ DUP1 ISZERO PUSH2 0x21F JUMPI POP PUSH32 0x5041504552000000000000000000000000000000000000000000000000000000 DUP4 EQ JUMPDEST ISZERO PUSH2 0x22C JUMPI DUP4 SWAP1 POP PUSH2 0x3F8 JUMP JUMPDEST PUSH32 0x524F434B00000000000000000000000000000000000000000000000000000000 DUP4 EQ DUP1 ISZERO PUSH2 0x27A JUMPI POP PUSH32 0x5041504552000000000000000000000000000000000000000000000000000000 DUP7 EQ JUMPDEST ISZERO PUSH2 0x287 JUMPI DUP7 SWAP1 POP PUSH2 0x3F8 JUMP JUMPDEST PUSH32 0x53434953534F5253000000000000000000000000000000000000000000000000 DUP7 EQ DUP1 ISZERO PUSH2 0x2D5 JUMPI POP PUSH32 0x5041504552000000000000000000000000000000000000000000000000000000 DUP4 EQ JUMPDEST ISZERO PUSH2 0x2E2 JUMPI DUP7 SWAP1 POP PUSH2 0x3F8 JUMP JUMPDEST PUSH32 0x53434953534F5253000000000000000000000000000000000000000000000000 DUP4 EQ DUP1 ISZERO PUSH2 0x330 JUMPI POP PUSH32 0x5041504552000000000000000000000000000000000000000000000000000000 DUP7 EQ JUMPDEST ISZERO PUSH2 0x33D JUMPI DUP4 SWAP1 POP PUSH2 0x3F8 JUMP JUMPDEST PUSH32 0x524F434B00000000000000000000000000000000000000000000000000000000 DUP7 EQ DUP1 ISZERO PUSH2 0x38B JUMPI POP PUSH32 0x53434953534F5253000000000000000000000000000000000000000000000000 DUP4 EQ JUMPDEST ISZERO PUSH2 0x398 JUMPI DUP7 SWAP1 POP PUSH2 0x3F8 JUMP JUMPDEST PUSH32 0x524F434B00000000000000000000000000000000000000000000000000000000 DUP4 EQ DUP1 ISZERO PUSH2 0x3E6 JUMPI POP PUSH32 0x53434953534F5253000000000000000000000000000000000000000000000000 DUP7 EQ JUMPDEST ISZERO PUSH2 0x3F3 JUMPI DUP4 SWAP1 POP PUSH2 0x3F8 JUMP JUMPDEST PUSH1 0x0 SWAP1 POP JUMPDEST SWAP7 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SHL PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD EQ PUSH2 0x44F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x4A4 DUP2 PUSH2 0x677 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x4B9 DUP2 PUSH2 0x68E JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4D1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x4DF DUP5 DUP3 DUP6 ADD PUSH2 0x495 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0xC0 DUP8 DUP10 SUB SLT ISZERO PUSH2 0x501 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x50F DUP10 DUP3 DUP11 ADD PUSH2 0x495 JUMP JUMPDEST SWAP7 POP POP PUSH1 0x20 PUSH2 0x520 DUP10 DUP3 DUP11 ADD PUSH2 0x4AA JUMP JUMPDEST SWAP6 POP POP PUSH1 0x40 PUSH2 0x531 DUP10 DUP3 DUP11 ADD PUSH2 0x4AA JUMP JUMPDEST SWAP5 POP POP PUSH1 0x60 PUSH2 0x542 DUP10 DUP3 DUP11 ADD PUSH2 0x495 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x80 PUSH2 0x553 DUP10 DUP3 DUP11 ADD PUSH2 0x4AA JUMP JUMPDEST SWAP3 POP POP PUSH1 0xA0 PUSH2 0x564 DUP10 DUP3 DUP11 ADD PUSH2 0x4AA JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP6 POP SWAP3 SWAP6 POP SWAP3 SWAP6 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x583 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x591 DUP5 DUP3 DUP6 ADD PUSH2 0x4AA JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x5A3 DUP2 PUSH2 0x631 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x5B2 DUP2 PUSH2 0x643 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x5C9 PUSH2 0x5C4 DUP3 PUSH2 0x643 JUMP JUMPDEST PUSH2 0x66D JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x5DB DUP3 DUP6 PUSH2 0x5B8 JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH2 0x5EB DUP3 DUP5 PUSH2 0x5B8 JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP2 POP DUP2 SWAP1 POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x610 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x59A JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x62B PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x5A9 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x63C DUP3 PUSH2 0x64D JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 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 PUSH2 0x680 DUP2 PUSH2 0x631 JUMP JUMPDEST DUP2 EQ PUSH2 0x68B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH2 0x697 DUP2 PUSH2 0x643 JUMP JUMPDEST DUP2 EQ PUSH2 0x6A2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xEE 0xED ISZERO 0xE COINBASE 0xAF MSTORE DUP14 SWAP4 0xFC GASPRICE CALL CALLDATALOAD 0xB5 DUP6 0xB4 XOR PUSH1 0x6A 0xC3 0xC3 DUP11 0xEC 0x49 KECCAK256 0xAA PUSH25 0x29B0867CF064736F6C63430008010033000000000000000000 ",
"sourceMap": "71:2181:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;210:42;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;512:1738;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;259:247;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;210:42;;;;;;;;;;;;;;;;;:::o;512:1738::-;928:7;1194;:14;1202:5;1194:14;;;;;;;;;;;;;;;;1144:11;1157:15;1127:46;;;;;;;;;:::i;:::-;;;;;;;;;;;;;1117:57;;;;;;:91;1096:122;;;;;;1415:7;:12;1423:3;1415:12;;;;;;;;;;;;;;;;1369:9;1380:13;1352:42;;;;;;;;;:::i;:::-;;;;;;;;;;;;;1342:53;;;;;;:85;1321:116;;;;;;1611:9;1596:11;:24;1592:72;;;1651:1;1636:17;;;;1592:72;1693:4;1678:11;:19;:41;;;;;1714:5;1701:9;:18;1678:41;1674:542;;;1742:3;1735:10;;;;1674:542;1779:4;1766:9;:17;:41;;;;;1802:5;1787:11;:20;1766:41;1762:454;;;1830:5;1823:12;;;;1762:454;1871:8;1856:11;:23;:45;;;;;1896:5;1883:9;:18;1856:45;1852:364;;;1924:5;1917:12;;;;1852:364;1963:8;1950:9;:21;:45;;;;;1990:5;1975:11;:20;1950:45;1946:270;;;2018:3;2011:10;;;;1946:270;2057:4;2042:11;:19;:44;;;;;2078:8;2065:9;:21;2042:44;2038:178;;;2109:5;2102:12;;;;2038:178;2148:4;2135:9;:17;:44;;;;;2171:8;2156:11;:23;2135:44;2131:85;;;2202:3;2195:10;;;;2131:85;2241:1;2225:18;;512:1738;;;;;;;;;:::o;259:247::-;418:1;410:10;;387:7;:19;395:10;387:19;;;;;;;;;;;;;;;;:33;379:42;;;;;;493:6;471:7;:19;479:10;471:19;;;;;;;;;;;;;;;:28;;;;259:247;:::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:990::-;;;;;;;758:3;746:9;737:7;733:23;729:33;726:2;;;775:1;772;765:12;726:2;818:1;843:53;888:7;879:6;868:9;864:22;843:53;:::i;:::-;833:63;;789:117;945:2;971:53;1016:7;1007:6;996:9;992:22;971:53;:::i;:::-;961:63;;916:118;1073:2;1099:53;1144:7;1135:6;1124:9;1120:22;1099:53;:::i;:::-;1089:63;;1044:118;1201:2;1227:53;1272:7;1263:6;1252:9;1248:22;1227:53;:::i;:::-;1217:63;;1172:118;1329:3;1356:53;1401:7;1392:6;1381:9;1377:22;1356:53;:::i;:::-;1346:63;;1300:119;1458:3;1485:53;1530:7;1521:6;1510:9;1506:22;1485:53;:::i;:::-;1475:63;;1429:119;716:839;;;;;;;;:::o;1561:262::-;;1669:2;1657:9;1648:7;1644:23;1640:32;1637:2;;;1685:1;1682;1675:12;1637:2;1728:1;1753:53;1798:7;1789:6;1778:9;1774:22;1753:53;:::i;:::-;1743:63;;1699:117;1627:196;;;;:::o;1829:118::-;1916:24;1934:5;1916:24;:::i;:::-;1911:3;1904:37;1894:53;;:::o;1953:118::-;2040:24;2058:5;2040:24;:::i;:::-;2035:3;2028:37;2018:53;;:::o;2077:157::-;2182:45;2202:24;2220:5;2202:24;:::i;:::-;2182:45;:::i;:::-;2177:3;2170:58;2160:74;;:::o;2240:397::-;;2395:75;2466:3;2457:6;2395:75;:::i;:::-;2495:2;2490:3;2486:12;2479:19;;2508:75;2579:3;2570:6;2508:75;:::i;:::-;2608:2;2603:3;2599:12;2592:19;;2628:3;2621:10;;2384:253;;;;;:::o;2643:222::-;;2774:2;2763:9;2759:18;2751:26;;2787:71;2855:1;2844:9;2840:17;2831:6;2787:71;:::i;:::-;2741:124;;;;:::o;2871:222::-;;3002:2;2991:9;2987:18;2979:26;;3015:71;3083:1;3072:9;3068:17;3059:6;3015:71;:::i;:::-;2969:124;;;;:::o;3099:96::-;;3165:24;3183:5;3165:24;:::i;:::-;3154:35;;3144:51;;;:::o;3201:77::-;;3267:5;3256:16;;3246:32;;;:::o;3284:126::-;;3361:42;3354:5;3350:54;3339:65;;3329:81;;;:::o;3416:79::-;;3484:5;3473:16;;3463:32;;;:::o;3501:122::-;3574:24;3592:5;3574:24;:::i;:::-;3567:5;3564:35;3554:2;;3613:1;3610;3603:12;3554:2;3544:79;:::o;3629:122::-;3702:24;3720:5;3702:24;:::i;:::-;3695:5;3692:35;3682:2;;3741:1;3738;3731:12;3682:2;3672:79;:::o"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "351000",
"executionCost": "386",
"totalCost": "351386"
},
"external": {
"choices(address)": "1492",
"evaluate(address,bytes32,bytes32,address,bytes32,bytes32)": "infinite",
"play(bytes32)": "21449"
}
},
"methodIdentifiers": {
"choices(address)": "410346b3",
"evaluate(address,bytes32,bytes32,address,bytes32,bytes32)": "80408e9d",
"play(bytes32)": "c7a1865b"
}
},
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "choices",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "alice",
"type": "address"
},
{
"internalType": "bytes32",
"name": "aliceChoice",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "aliceRandomness",
"type": "bytes32"
},
{
"internalType": "address",
"name": "bob",
"type": "address"
},
{
"internalType": "bytes32",
"name": "bobChoice",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "bobRandomness",
"type": "bytes32"
}
],
"name": "evaluate",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "choice",
"type": "bytes32"
}
],
"name": "play",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.1+commit.df193b15"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "choices",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "alice",
"type": "address"
},
{
"internalType": "bytes32",
"name": "aliceChoice",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "aliceRandomness",
"type": "bytes32"
},
{
"internalType": "address",
"name": "bob",
"type": "address"
},
{
"internalType": "bytes32",
"name": "bobChoice",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "bobRandomness",
"type": "bytes32"
}
],
"name": "evaluate",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "choice",
"type": "bytes32"
}
],
"name": "play",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/1_Storage.sol": "Game"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"contracts/1_Storage.sol": {
"keccak256": "0x0eba6802d0858e4ea0fd1be92439145212b34df4fb5d56b545d1370f4bcfb177",
"license": "GPL-3.0",
"urls": [
"bzz-raw://23e217a16a3ffe7871a675ebfaba8862532ed30888c9c08bad26d4b0e02e55ba",
"dweb:/ipfs/QmcYuaF29K39Wx7d7WZepJHrYsxBVHx4RAssukZqG9DVoV"
]
}
},
"version": 1
}
// 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;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment