Skip to content

Instantly share code, notes, and snippets.

@howardpen9
Created March 3, 2022 06:40
Show Gist options
  • Save howardpen9/be1ff3c96b91b84ba71e2cac698a5ff3 to your computer and use it in GitHub Desktop.
Save howardpen9/be1ff3c96b91b84ba71e2cac698a5ff3 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.5.17+commit.d19bba13.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads for the 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;
}
}
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.6.0;
contract Airlines {
address chairperson;
struct details {
uint escrowInt; //
uint statusInt;
uint hashOfDetails;
}
mapping (address => details) public balanceDetails;
mapping (address => uint) membership;
modifier onlyChairperson {
require(msg.sender == chairperson);
_;
}
modifier onlyMember {
require(membership[msg.sender]==1);
_;
}
constructor() public payable{
chairperson = msg.sender;
membership[msg.sender] = 1; // Registered, for the first account who is
balanceDetails[msg.sender].escrowInt = msg.value;
}
// error RoleWrongMessage(address RoleAddr, address ChairpersonAddr);
function register() public payable{ // member
address AirlineA = msg.sender;
membership[AirlineA] = 1;
balanceDetails[AirlineA].escrowInt = msg.value;
}
function unregister(address payable AirlineZ) onlyChairperson public {
if(chairperson != msg.sender){
revert();
// revert RoleWrongMessage({
// RoleAddr: msg.sender,
// ChairpersonAddr: chairperson
// });
}
membership[AirlineZ] = 0;
AirlineZ.transfer(balanceDetails[AirlineZ].escrowInt);
balanceDetails[AirlineZ].escrowInt = 0;
}
//
function request(address toAirline, uint hashOfDetails) onlyMember public {
}
}
{
"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": {
"linkReferences": {},
"object": "6080604052336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555034600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555061047a806100df6000396000f3fe60806040526004361061003f5760003560e01c80631aa3a008146100445780632ec2c2461461004e578063a3aa19131461009f578063c8c01a5514610112575b600080fd5b61004c61016d565b005b34801561005a57600080fd5b5061009d6004803603602081101561007157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610201565b005b3480156100ab57600080fd5b506100ee600480360360208110156100c257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103ca565b60405180848152602001838152602001828152602001935050505060405180910390f35b34801561011e57600080fd5b5061016b6004803603604081101561013557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506103f4565b005b60003390506001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555034600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461025957600080fd5b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146102b157600080fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff166108fc600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549081150290604051600060405180830381858888f1935050505015801561037e573d6000803e3d6000fd5b506000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555050565b60016020528060005260406000206000915090508060000154908060010154908060020154905083565b6001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461044057600080fd5b505056fea26469706673582212205cb2590750818620bd92aaeaf26223d3f1ebc9265a26f6156a92b0d8e13216eb64736f6c634300060c0033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLER PUSH1 0x0 DUP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 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 CALLVALUE PUSH1 0x1 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD DUP2 SWAP1 SSTORE POP PUSH2 0x47A DUP1 PUSH2 0xDF PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x3F JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x1AA3A008 EQ PUSH2 0x44 JUMPI DUP1 PUSH4 0x2EC2C246 EQ PUSH2 0x4E JUMPI DUP1 PUSH4 0xA3AA1913 EQ PUSH2 0x9F JUMPI DUP1 PUSH4 0xC8C01A55 EQ PUSH2 0x112 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4C PUSH2 0x16D JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x5A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x9D PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x71 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x201 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xAB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xEE PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH2 0xC2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x3CA JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP4 POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x11E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x16B PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x40 DUP2 LT ISZERO PUSH2 0x135 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x3F4 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 CALLER SWAP1 POP PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP CALLVALUE PUSH1 0x1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x259 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x2B1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x2 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH2 0x8FC PUSH1 0x1 PUSH1 0x0 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD SLOAD SWAP1 DUP2 ISZERO MUL SWAP1 PUSH1 0x40 MLOAD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0x37E JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP DUP1 PUSH1 0x0 ADD SLOAD SWAP1 DUP1 PUSH1 0x1 ADD SLOAD SWAP1 DUP1 PUSH1 0x2 ADD SLOAD SWAP1 POP DUP4 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD EQ PUSH2 0x440 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0x5C 0xB2 MSIZE SMOD POP DUP2 DUP7 KECCAK256 0xBD SWAP3 0xAA 0xEA CALLCODE PUSH3 0x23D3F1 0xEB 0xC9 0x26 GAS 0x26 0xF6 ISZERO PUSH11 0x92B0D8E13216EB64736F6C PUSH4 0x4300060C STOP CALLER ",
"sourceMap": "61:1452:0:-:0;;;550:10;536:11;;:24;;;;;;;;;;;;;;;;;;595:1;570:10;:22;581:10;570:22;;;;;;;;;;;;;;;:26;;;;690:9;651:14;:26;666:10;651:26;;;;;;;;;;;;;;;:36;;:48;;;;61:1452;;;;;;"
},
"deployedBytecode": {
"immutableReferences": {},
"linkReferences": {},
"object": "60806040526004361061003f5760003560e01c80631aa3a008146100445780632ec2c2461461004e578063a3aa19131461009f578063c8c01a5514610112575b600080fd5b61004c61016d565b005b34801561005a57600080fd5b5061009d6004803603602081101561007157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610201565b005b3480156100ab57600080fd5b506100ee600480360360208110156100c257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103ca565b60405180848152602001838152602001828152602001935050505060405180910390f35b34801561011e57600080fd5b5061016b6004803603604081101561013557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506103f4565b005b60003390506001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555034600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461025957600080fd5b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146102b157600080fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff166108fc600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549081150290604051600060405180830381858888f1935050505015801561037e573d6000803e3d6000fd5b506000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555050565b60016020528060005260406000206000915090508060000154908060010154908060020154905083565b6001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461044057600080fd5b505056fea26469706673582212205cb2590750818620bd92aaeaf26223d3f1ebc9265a26f6156a92b0d8e13216eb64736f6c634300060c0033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x3F JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x1AA3A008 EQ PUSH2 0x44 JUMPI DUP1 PUSH4 0x2EC2C246 EQ PUSH2 0x4E JUMPI DUP1 PUSH4 0xA3AA1913 EQ PUSH2 0x9F JUMPI DUP1 PUSH4 0xC8C01A55 EQ PUSH2 0x112 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4C PUSH2 0x16D JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x5A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x9D PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x71 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x201 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xAB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xEE PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH2 0xC2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x3CA JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP4 POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x11E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x16B PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x40 DUP2 LT ISZERO PUSH2 0x135 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x3F4 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 CALLER SWAP1 POP PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP CALLVALUE PUSH1 0x1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x259 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x2B1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x2 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH2 0x8FC PUSH1 0x1 PUSH1 0x0 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD SLOAD SWAP1 DUP2 ISZERO MUL SWAP1 PUSH1 0x40 MLOAD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0x37E JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP DUP1 PUSH1 0x0 ADD SLOAD SWAP1 DUP1 PUSH1 0x1 ADD SLOAD SWAP1 DUP1 PUSH1 0x2 ADD SLOAD SWAP1 POP DUP4 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD EQ PUSH2 0x440 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0x5C 0xB2 MSIZE SMOD POP DUP2 DUP7 KECCAK256 0xBD SWAP3 0xAA 0xEA CALLCODE PUSH3 0x23D3F1 0xEB 0xC9 0x26 GAS 0x26 0xF6 ISZERO PUSH11 0x92B0D8E13216EB64736F6C PUSH4 0x4300060C STOP CALLER ",
"sourceMap": "61:1452:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;787:180;;;:::i;:::-;;973:441;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;219:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1426:82;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;787:180;841:16;860:10;841:29;;903:1;880:10;:20;891:8;880:20;;;;;;;;;;;;;;;:24;;;;951:9;914:14;:24;929:8;914:24;;;;;;;;;;;;;;;:34;;:46;;;;787:180;:::o;973:441::-;375:11;;;;;;;;;;361:25;;:10;:25;;;353:34;;;;;;1070:10:::1;1055:25;;:11;::::0;::::1;;;;;;;;:25;;;1052:211;;1095:8;::::0;::::1;1052:211;1295:1;1272:10;:20;1283:8;1272:20;;;;;;;;;;;;;;;:24;;;;1306:8;:17;;:53;1324:14;:24;1339:8;1324:24;;;;;;;;;;;;;;;:34;;;1306:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;1406:1;1369:14;:24;1384:8;1369:24;;;;;;;;;;;;;;;:34;;:38;;;;973:441:::0;:::o;219:50::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1426:82::-;472:1;448:10;:22;459:10;448:22;;;;;;;;;;;;;;;;:25;440:34;;;;;;1426:82;;:::o"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "229200",
"executionCost": "61322",
"totalCost": "290522"
},
"external": {
"balanceDetails(address)": "2869",
"register()": "40323",
"request(address,uint256)": "1219",
"unregister(address)": "infinite"
}
},
"methodIdentifiers": {
"balanceDetails(address)": "a3aa1913",
"register()": "1aa3a008",
"request(address,uint256)": "c8c01a55",
"unregister(address)": "2ec2c246"
}
},
"abi": [
{
"inputs": [],
"stateMutability": "payable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "balanceDetails",
"outputs": [
{
"internalType": "uint256",
"name": "escrowInt",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "statusInt",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "hashOfDetails",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "register",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "toAirline",
"type": "address"
},
{
"internalType": "uint256",
"name": "hashOfDetails",
"type": "uint256"
}
],
"name": "request",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address payable",
"name": "AirlineZ",
"type": "address"
}
],
"name": "unregister",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.6.12+commit.27d51765"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [],
"stateMutability": "payable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "balanceDetails",
"outputs": [
{
"internalType": "uint256",
"name": "escrowInt",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "statusInt",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "hashOfDetails",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "register",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "toAirline",
"type": "address"
},
{
"internalType": "uint256",
"name": "hashOfDetails",
"type": "uint256"
}
],
"name": "request",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address payable",
"name": "AirlineZ",
"type": "address"
}
],
"name": "unregister",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/Airlines.sol": "Airlines"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"contracts/Airlines.sol": {
"keccak256": "0x241dffe2576719580442efd48a0a599f4084c3427a446848a9bd7e81a77b9cab",
"license": "GPL-3.0",
"urls": [
"bzz-raw://cf68d135574c4e65a66d94ef8bc9172fa5c810f53c3ff9852665fcf8710731b5",
"dweb:/ipfs/QmRSTf2KHAzzc1S1jSMZEHnc96toe1RakMRXeaXTzxZteX"
]
}
},
"version": 1
}
{
"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": {
"linkReferences": {},
"object": "60806040526000600260146101000a81548160ff0219169083600381111561002357fe5b021790555034801561003457600080fd5b506040516103163803806103168339818101604052602081101561005757600080fd5b810190808051906020019092919050505033600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506002600080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555060008090505b8181101561017357600160405180602001604052806000815250908060018154018082558091505090600182039060005260206000200160009091929091909150600082015181600001555050508080600101915050610118565b5050610192806101846000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063268f11531461003b578063c19d93fb1461006c575b600080fd5b61006a6004803603602081101561005157600080fd5b81019080803560ff169060200190929190505050610098565b005b61007461014a565b6040518082600381111561008457fe5b60ff16815260200191505060405180910390f35b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146100f257600080fd5b600260149054906101000a900460ff16600381111561010d57fe5b81600381111561011957fe5b101561012457600080fd5b80600260146101000a81548160ff0219169083600381111561014257fe5b021790555050565b600260149054906101000a900460ff168156fea265627a7a72315820f7685d76253a615b7564903f891478b70a4d2c363bf9fade84dd7203151ce85764736f6c63430005110032",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x2 PUSH1 0x14 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x23 JUMPI INVALID JUMPDEST MUL OR SWAP1 SSTORE POP CALLVALUE DUP1 ISZERO PUSH2 0x34 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH2 0x316 CODESIZE SUB DUP1 PUSH2 0x316 DUP4 CODECOPY DUP2 DUP2 ADD PUSH1 0x40 MSTORE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x57 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP CALLER PUSH1 0x2 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x2 PUSH1 0x0 DUP1 PUSH1 0x2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD DUP2 SWAP1 SSTORE POP PUSH1 0x0 DUP1 SWAP1 POP JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x173 JUMPI PUSH1 0x1 PUSH1 0x40 MLOAD DUP1 PUSH1 0x20 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 DUP2 MSTORE POP SWAP1 DUP1 PUSH1 0x1 DUP2 SLOAD ADD DUP1 DUP3 SSTORE DUP1 SWAP2 POP POP SWAP1 PUSH1 0x1 DUP3 SUB SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SWAP2 SWAP3 SWAP1 SWAP2 SWAP1 SWAP2 POP PUSH1 0x0 DUP3 ADD MLOAD DUP2 PUSH1 0x0 ADD SSTORE POP POP POP DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x118 JUMP JUMPDEST POP POP PUSH2 0x192 DUP1 PUSH2 0x184 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 0x36 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x268F1153 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0xC19D93FB EQ PUSH2 0x6C JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x6A PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x51 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH1 0xFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x98 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x74 PUSH2 0x14A JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x84 JUMPI INVALID JUMPDEST PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0xF2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x2 PUSH1 0x14 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x10D JUMPI INVALID JUMPDEST DUP2 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x119 JUMPI INVALID JUMPDEST LT ISZERO PUSH2 0x124 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x2 PUSH1 0x14 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x142 JUMPI INVALID JUMPDEST MUL OR SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x2 PUSH1 0x14 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP INVALID LOG2 PUSH6 0x627A7A723158 KECCAK256 0xF7 PUSH9 0x5D76253A615B756490 EXTCODEHASH DUP10 EQ PUSH25 0xB70A4D2C363BF9FADE84DD7203151CE85764736F6C63430005 GT STOP ORIGIN ",
"sourceMap": "33:738:0:-;;;345:10;324:31;;;;;;;;;;;;;;;;;;;;;;;;;;362:229;8:9:-1;5:2;;;30:1;27;20:12;5:2;362:229:0;;;;;;;;;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;362:229:0;;;;;;;;;;;;;;;;425:10;411:11;;:24;;;;;;;;;;;;;;;;;;474:1;445:6;:19;452:11;;;;;;;;;;;445:19;;;;;;;;;;;;;;;:26;;:30;;;;490:9;502:1;490:13;;485:100;512:12;505:4;:19;485:100;;;547:9;562:11;;;;;;;;571:1;562:11;;;547:27;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;547:27:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;526:6;;;;;;;485:100;;;;362:229;33:738;;;;;;"
},
"deployedBytecode": {
"linkReferences": {},
"object": "608060405234801561001057600080fd5b50600436106100365760003560e01c8063268f11531461003b578063c19d93fb1461006c575b600080fd5b61006a6004803603602081101561005157600080fd5b81019080803560ff169060200190929190505050610098565b005b61007461014a565b6040518082600381111561008457fe5b60ff16815260200191505060405180910390f35b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146100f257600080fd5b600260149054906101000a900460ff16600381111561010d57fe5b81600381111561011957fe5b101561012457600080fd5b80600260146101000a81548160ff0219169083600381111561014257fe5b021790555050565b600260149054906101000a900460ff168156fea265627a7a72315820f7685d76253a615b7564903f891478b70a4d2c363bf9fade84dd7203151ce85764736f6c63430005110032",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x36 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x268F1153 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0xC19D93FB EQ PUSH2 0x6C JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x6A PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x51 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH1 0xFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x98 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x74 PUSH2 0x14A JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x84 JUMPI INVALID JUMPDEST PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0xF2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x2 PUSH1 0x14 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x10D JUMPI INVALID JUMPDEST DUP2 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x119 JUMPI INVALID JUMPDEST LT ISZERO PUSH2 0x124 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x2 PUSH1 0x14 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x142 JUMPI INVALID JUMPDEST MUL OR SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x2 PUSH1 0x14 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP INVALID LOG2 PUSH6 0x627A7A723158 KECCAK256 0xF7 PUSH9 0x5D76253A615B756490 EXTCODEHASH DUP10 EQ PUSH25 0xB70A4D2C363BF9FADE84DD7203151CE85764736F6C63430005 GT STOP ORIGIN ",
"sourceMap": "33:738:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;33:738:0;;;;;;;;;;;;;;;;;;;;;;;;597:171;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;597:171:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;324:31;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;597:171;662:11;;;;;;;;;;;648:25;;:10;:25;;;644:64;;689:8;;;644:64;726:5;;;;;;;;;;;722:9;;;;;;;;:1;:9;;;;;;;;;717:25;;;734:8;;;717:25;760:1;752:5;;:9;;;;;;;;;;;;;;;;;;;;;;;;597:171;:::o;324:31::-;;;;;;;;;;;;;:::o"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "80400",
"executionCost": "infinite",
"totalCost": "infinite"
},
"external": {
"changeState(uint8)": "22983",
"state()": "1123"
}
},
"methodIdentifiers": {
"changeState(uint8)": "268f1153",
"state()": "c19d93fb"
}
},
"abi": [
{
"inputs": [
{
"internalType": "uint256",
"name": "numProposals",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"constant": false,
"inputs": [
{
"internalType": "enum Ballot.Phase",
"name": "x",
"type": "uint8"
}
],
"name": "changeState",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "state",
"outputs": [
{
"internalType": "enum Ballot.Phase",
"name": "",
"type": "uint8"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.5.17+commit.d19bba13"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [
{
"internalType": "uint256",
"name": "numProposals",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"constant": false,
"inputs": [
{
"internalType": "enum Ballot.Phase",
"name": "x",
"type": "uint8"
}
],
"name": "changeState",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "state",
"outputs": [
{
"internalType": "enum Ballot.Phase",
"name": "",
"type": "uint8"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"devdoc": {
"methods": {}
},
"userdoc": {
"methods": {}
}
},
"settings": {
"compilationTarget": {
"contracts/po.sol": "Ballot"
},
"evmVersion": "istanbul",
"libraries": {},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"contracts/po.sol": {
"keccak256": "0x7adb02d1c5a3f55da92378d59dde87645f2be34a69162d0b08f0b86cc3fc4be0",
"urls": [
"bzz-raw://ede6e67722bbfd49957687ed178bf4630cf8e0e79f86e422c46fbabf8e081a56",
"dweb:/ipfs/QmdmyzsKS8Q7386e9zh7mj1iFkVY68t1YZJYasRa2x2A9E"
]
}
},
"version": 1
}
{
"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": {
"linkReferences": {},
"object": "60806040526000600260146101000a81548160ff0219169083600381111561002357fe5b021790555034801561003457600080fd5b506040516103163803806103168339818101604052602081101561005757600080fd5b810190808051906020019092919050505033600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506002600080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555060008090505b8181101561017357600160405180602001604052806000815250908060018154018082558091505090600182039060005260206000200160009091929091909150600082015181600001555050508080600101915050610118565b5050610192806101846000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063268f11531461003b578063c19d93fb1461006c575b600080fd5b61006a6004803603602081101561005157600080fd5b81019080803560ff169060200190929190505050610098565b005b61007461014a565b6040518082600381111561008457fe5b60ff16815260200191505060405180910390f35b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146100f257600080fd5b600260149054906101000a900460ff16600381111561010d57fe5b81600381111561011957fe5b101561012457600080fd5b80600260146101000a81548160ff0219169083600381111561014257fe5b021790555050565b600260149054906101000a900460ff168156fea265627a7a723158204f9659349f5a4ff74c841959429bedb7db24397b663276170a07d31f9520950c64736f6c63430005110032",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x2 PUSH1 0x14 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x23 JUMPI INVALID JUMPDEST MUL OR SWAP1 SSTORE POP CALLVALUE DUP1 ISZERO PUSH2 0x34 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH2 0x316 CODESIZE SUB DUP1 PUSH2 0x316 DUP4 CODECOPY DUP2 DUP2 ADD PUSH1 0x40 MSTORE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x57 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP CALLER PUSH1 0x2 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x2 PUSH1 0x0 DUP1 PUSH1 0x2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD DUP2 SWAP1 SSTORE POP PUSH1 0x0 DUP1 SWAP1 POP JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x173 JUMPI PUSH1 0x1 PUSH1 0x40 MLOAD DUP1 PUSH1 0x20 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 DUP2 MSTORE POP SWAP1 DUP1 PUSH1 0x1 DUP2 SLOAD ADD DUP1 DUP3 SSTORE DUP1 SWAP2 POP POP SWAP1 PUSH1 0x1 DUP3 SUB SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SWAP2 SWAP3 SWAP1 SWAP2 SWAP1 SWAP2 POP PUSH1 0x0 DUP3 ADD MLOAD DUP2 PUSH1 0x0 ADD SSTORE POP POP POP DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x118 JUMP JUMPDEST POP POP PUSH2 0x192 DUP1 PUSH2 0x184 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 0x36 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x268F1153 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0xC19D93FB EQ PUSH2 0x6C JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x6A PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x51 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH1 0xFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x98 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x74 PUSH2 0x14A JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x84 JUMPI INVALID JUMPDEST PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0xF2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x2 PUSH1 0x14 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x10D JUMPI INVALID JUMPDEST DUP2 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x119 JUMPI INVALID JUMPDEST LT ISZERO PUSH2 0x124 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x2 PUSH1 0x14 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x142 JUMPI INVALID JUMPDEST MUL OR SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x2 PUSH1 0x14 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP INVALID LOG2 PUSH6 0x627A7A723158 KECCAK256 0x4F SWAP7 MSIZE CALLVALUE SWAP16 GAS 0x4F 0xF7 0x4C DUP5 NOT MSIZE TIMESTAMP SWAP12 0xED 0xB7 0xDB 0x24 CODECOPY PUSH28 0x663276170A07D31F9520950C64736F6C634300051100320000000000 ",
"sourceMap": "32:744:0:-;;;350:10;329:31;;;;;;;;;;;;;;;;;;;;;;;;;;367:229;8:9:-1;5:2;;;30:1;27;20:12;5:2;367:229:0;;;;;;;;;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;367:229:0;;;;;;;;;;;;;;;;430:10;416:11;;:24;;;;;;;;;;;;;;;;;;479:1;450:6;:19;457:11;;;;;;;;;;;450:19;;;;;;;;;;;;;;;:26;;:30;;;;495:9;507:1;495:13;;490:100;517:12;510:4;:19;490:100;;;552:9;567:11;;;;;;;;576:1;567:11;;;552:27;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;552:27:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;531:6;;;;;;;490:100;;;;367:229;32:744;;;;;;"
},
"deployedBytecode": {
"linkReferences": {},
"object": "608060405234801561001057600080fd5b50600436106100365760003560e01c8063268f11531461003b578063c19d93fb1461006c575b600080fd5b61006a6004803603602081101561005157600080fd5b81019080803560ff169060200190929190505050610098565b005b61007461014a565b6040518082600381111561008457fe5b60ff16815260200191505060405180910390f35b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146100f257600080fd5b600260149054906101000a900460ff16600381111561010d57fe5b81600381111561011957fe5b101561012457600080fd5b80600260146101000a81548160ff0219169083600381111561014257fe5b021790555050565b600260149054906101000a900460ff168156fea265627a7a723158204f9659349f5a4ff74c841959429bedb7db24397b663276170a07d31f9520950c64736f6c63430005110032",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x36 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x268F1153 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0xC19D93FB EQ PUSH2 0x6C JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x6A PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x51 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH1 0xFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x98 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x74 PUSH2 0x14A JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x84 JUMPI INVALID JUMPDEST PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0xF2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x2 PUSH1 0x14 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x10D JUMPI INVALID JUMPDEST DUP2 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x119 JUMPI INVALID JUMPDEST LT ISZERO PUSH2 0x124 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x2 PUSH1 0x14 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x142 JUMPI INVALID JUMPDEST MUL OR SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x2 PUSH1 0x14 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP INVALID LOG2 PUSH6 0x627A7A723158 KECCAK256 0x4F SWAP7 MSIZE CALLVALUE SWAP16 GAS 0x4F 0xF7 0x4C DUP5 NOT MSIZE TIMESTAMP SWAP12 0xED 0xB7 0xDB 0x24 CODECOPY PUSH28 0x663276170A07D31F9520950C64736F6C634300051100320000000000 ",
"sourceMap": "32:744:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;32:744:0;;;;;;;;;;;;;;;;;;;;;;;;602:171;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;602:171:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;329:31;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;602:171;667:11;;;;;;;;;;;653:25;;:10;:25;;;649:64;;694:8;;;649:64;731:5;;;;;;;;;;;727:9;;;;;;;;:1;:9;;;;;;;;;722:25;;;739:8;;;722:25;765:1;757:5;;:9;;;;;;;;;;;;;;;;;;;;;;;;602:171;:::o;329:31::-;;;;;;;;;;;;;:::o"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "80400",
"executionCost": "infinite",
"totalCost": "infinite"
},
"external": {
"changeState(uint8)": "22983",
"state()": "1123"
}
},
"methodIdentifiers": {
"changeState(uint8)": "268f1153",
"state()": "c19d93fb"
}
},
"abi": [
{
"inputs": [
{
"internalType": "uint256",
"name": "numProposals",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"constant": false,
"inputs": [
{
"internalType": "enum BallotV1.Phase",
"name": "x",
"type": "uint8"
}
],
"name": "changeState",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "state",
"outputs": [
{
"internalType": "enum BallotV1.Phase",
"name": "",
"type": "uint8"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.5.17+commit.d19bba13"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [
{
"internalType": "uint256",
"name": "numProposals",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"constant": false,
"inputs": [
{
"internalType": "enum BallotV1.Phase",
"name": "x",
"type": "uint8"
}
],
"name": "changeState",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "state",
"outputs": [
{
"internalType": "enum BallotV1.Phase",
"name": "",
"type": "uint8"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"devdoc": {
"methods": {}
},
"userdoc": {
"methods": {}
}
},
"settings": {
"compilationTarget": {
"contracts/po.sol": "BallotV1"
},
"evmVersion": "istanbul",
"libraries": {},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"contracts/po.sol": {
"keccak256": "0xf44d681c0875dad22c11dec0711863fec28894e8bd62220f5716fabaa97c9e0a",
"urls": [
"bzz-raw://5bdf9cc59ad279ece469af978d50ca2afc53f5a00dcc9b2e72cfd16ccd3f0311",
"dweb:/ipfs/QmaxeYKrBZpwBe4DgtJCXhVdbcXwdFq2SfEfArrBcd6NPe"
]
}
},
"version": 1
}
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
"ropsten:3": {
"linkReferences": {},
"autoDeployLib": true
},
"rinkeby:4": {
"linkReferences": {},
"autoDeployLib": true
},
"kovan:42": {
"linkReferences": {},
"autoDeployLib": true
},
"görli:5": {
"linkReferences": {},
"autoDeployLib": true
},
"Custom": {
"linkReferences": {},
"autoDeployLib": true
}
},
"data": {
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "608060405234801561001057600080fd5b506103e5806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80636299a6ef1461003b57806387db03b714610057575b600080fd5b61005560048036038101906100509190610309565b610073565b005b610071600480360381019061006c9190610309565b610199565b005b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16801561010e5750806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154125b61011757600080fd5b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055507f6e271428a540d20d7afb57d1cdcda7c5c65823ca8d24a57e58b3122d8c3aa9c0338260405161018e929190610386565b60405180910390a150565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16156101f257600080fd5b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff021916908315150217905550806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055507fcd33e9804a00316b8823a9e0a1d29576f3fb2fcb59a3697a6f0255a5a915357233826040516102c3929190610386565b60405180910390a150565b600080fd5b6000819050919050565b6102e6816102d3565b81146102f157600080fd5b50565b600081359050610303816102dd565b92915050565b60006020828403121561031f5761031e6102ce565b5b600061032d848285016102f4565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061036182610336565b9050919050565b61037181610356565b82525050565b610380816102d3565b82525050565b600060408201905061039b6000830185610368565b6103a86020830184610377565b939250505056fea26469706673582212208c66ffa85390e9c7e4d9eb9c71d871b8984dbd9420e1b4bb707e67f7a4310b9664736f6c634300080c0033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3E5 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 0x36 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x6299A6EF EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x87DB03B7 EQ PUSH2 0x57 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x55 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x50 SWAP2 SWAP1 PUSH2 0x309 JUMP JUMPDEST PUSH2 0x73 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x71 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x6C SWAP2 SWAP1 PUSH2 0x309 JUMP JUMPDEST PUSH2 0x199 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP1 ISZERO PUSH2 0x10E JUMPI POP 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 PUSH1 0x1 ADD SLOAD SLT JUMPDEST PUSH2 0x117 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 PUSH1 0x1 ADD DUP2 SWAP1 SSTORE POP PUSH32 0x6E271428A540D20D7AFB57D1CDCDA7C5C65823CA8D24A57E58B3122D8C3AA9C0 CALLER DUP3 PUSH1 0x40 MLOAD PUSH2 0x18E SWAP3 SWAP2 SWAP1 PUSH2 0x386 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1F2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP 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 PUSH1 0x1 ADD DUP2 SWAP1 SSTORE POP PUSH32 0xCD33E9804A00316B8823A9E0A1D29576F3FB2FCB59A3697A6F0255A5A9153572 CALLER DUP3 PUSH1 0x40 MLOAD PUSH2 0x2C3 SWAP3 SWAP2 SWAP1 PUSH2 0x386 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x2E6 DUP2 PUSH2 0x2D3 JUMP JUMPDEST DUP2 EQ PUSH2 0x2F1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x303 DUP2 PUSH2 0x2DD JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x31F JUMPI PUSH2 0x31E PUSH2 0x2CE JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x32D DUP5 DUP3 DUP6 ADD PUSH2 0x2F4 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x361 DUP3 PUSH2 0x336 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x371 DUP2 PUSH2 0x356 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x380 DUP2 PUSH2 0x2D3 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 DUP3 ADD SWAP1 POP PUSH2 0x39B PUSH1 0x0 DUP4 ADD DUP6 PUSH2 0x368 JUMP JUMPDEST PUSH2 0x3A8 PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x377 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 DUP13 PUSH7 0xFFA85390E9C7E4 0xD9 0xEB SWAP13 PUSH18 0xD871B8984DBD9420E1B4BB707E67F7A4310B SWAP7 PUSH5 0x736F6C6343 STOP ADDMOD 0xC STOP CALLER ",
"sourceMap": "63:1177:0:-:0;;;;;;;;;;;;;;;;;;;"
},
"deployedBytecode": {
"functionDebugData": {
"@add_63": {
"entryPoint": 409,
"id": 63,
"parameterSlots": 1,
"returnSlots": 0
},
"@update_100": {
"entryPoint": 115,
"id": 100,
"parameterSlots": 1,
"returnSlots": 0
},
"abi_decode_t_int256": {
"entryPoint": 756,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"abi_decode_tuple_t_int256": {
"entryPoint": 777,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"abi_encode_t_address_to_t_address_fromStack": {
"entryPoint": 872,
"id": null,
"parameterSlots": 2,
"returnSlots": 0
},
"abi_encode_t_int256_to_t_int256_fromStack": {
"entryPoint": 887,
"id": null,
"parameterSlots": 2,
"returnSlots": 0
},
"abi_encode_tuple_t_address_t_int256__to_t_address_t_int256__fromStack_reversed": {
"entryPoint": 902,
"id": null,
"parameterSlots": 3,
"returnSlots": 1
},
"allocate_unbounded": {
"entryPoint": null,
"id": null,
"parameterSlots": 0,
"returnSlots": 1
},
"cleanup_t_address": {
"entryPoint": 854,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"cleanup_t_int256": {
"entryPoint": 723,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"cleanup_t_uint160": {
"entryPoint": 822,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db": {
"entryPoint": null,
"id": null,
"parameterSlots": 0,
"returnSlots": 0
},
"revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b": {
"entryPoint": 718,
"id": null,
"parameterSlots": 0,
"returnSlots": 0
},
"validator_revert_t_int256": {
"entryPoint": 733,
"id": null,
"parameterSlots": 1,
"returnSlots": 0
}
},
"generatedSources": [
{
"ast": {
"nodeType": "YulBlock",
"src": "0:1828:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "47:35:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "57:19:1",
"value": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "73:2:1",
"type": "",
"value": "64"
}
],
"functionName": {
"name": "mload",
"nodeType": "YulIdentifier",
"src": "67:5:1"
},
"nodeType": "YulFunctionCall",
"src": "67:9:1"
},
"variableNames": [
{
"name": "memPtr",
"nodeType": "YulIdentifier",
"src": "57:6:1"
}
]
}
]
},
"name": "allocate_unbounded",
"nodeType": "YulFunctionDefinition",
"returnVariables": [
{
"name": "memPtr",
"nodeType": "YulTypedName",
"src": "40:6:1",
"type": ""
}
],
"src": "7:75:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "177:28:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "194:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "197:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "187:6:1"
},
"nodeType": "YulFunctionCall",
"src": "187:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "187:12:1"
}
]
},
"name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b",
"nodeType": "YulFunctionDefinition",
"src": "88:117:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "300:28:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "317:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "320:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "310:6:1"
},
"nodeType": "YulFunctionCall",
"src": "310:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "310:12:1"
}
]
},
"name": "revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db",
"nodeType": "YulFunctionDefinition",
"src": "211:117:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "378:32:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "388:16:1",
"value": {
"name": "value",
"nodeType": "YulIdentifier",
"src": "399:5:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "388:7:1"
}
]
}
]
},
"name": "cleanup_t_int256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "360:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "370:7:1",
"type": ""
}
],
"src": "334:76:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "458:78:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "514:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "523:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "526:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "516:6:1"
},
"nodeType": "YulFunctionCall",
"src": "516:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "516:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "481:5:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "505:5:1"
}
],
"functionName": {
"name": "cleanup_t_int256",
"nodeType": "YulIdentifier",
"src": "488:16:1"
},
"nodeType": "YulFunctionCall",
"src": "488:23:1"
}
],
"functionName": {
"name": "eq",
"nodeType": "YulIdentifier",
"src": "478:2:1"
},
"nodeType": "YulFunctionCall",
"src": "478:34:1"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "471:6:1"
},
"nodeType": "YulFunctionCall",
"src": "471:42:1"
},
"nodeType": "YulIf",
"src": "468:62:1"
}
]
},
"name": "validator_revert_t_int256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "451:5:1",
"type": ""
}
],
"src": "416:120:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "593:86:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "603:29:1",
"value": {
"arguments": [
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "625:6:1"
}
],
"functionName": {
"name": "calldataload",
"nodeType": "YulIdentifier",
"src": "612:12:1"
},
"nodeType": "YulFunctionCall",
"src": "612:20:1"
},
"variableNames": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "603:5:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "667:5:1"
}
],
"functionName": {
"name": "validator_revert_t_int256",
"nodeType": "YulIdentifier",
"src": "641:25:1"
},
"nodeType": "YulFunctionCall",
"src": "641:32:1"
},
"nodeType": "YulExpressionStatement",
"src": "641:32:1"
}
]
},
"name": "abi_decode_t_int256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "571:6:1",
"type": ""
},
{
"name": "end",
"nodeType": "YulTypedName",
"src": "579:3:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "587:5:1",
"type": ""
}
],
"src": "542:137:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "750:262:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "796:83:1",
"statements": [
{
"expression": {
"arguments": [],
"functionName": {
"name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b",
"nodeType": "YulIdentifier",
"src": "798:77:1"
},
"nodeType": "YulFunctionCall",
"src": "798:79:1"
},
"nodeType": "YulExpressionStatement",
"src": "798:79:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "771:7:1"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "780:9:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "767:3:1"
},
"nodeType": "YulFunctionCall",
"src": "767:23:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "792:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "slt",
"nodeType": "YulIdentifier",
"src": "763:3:1"
},
"nodeType": "YulFunctionCall",
"src": "763:32:1"
},
"nodeType": "YulIf",
"src": "760:119:1"
},
{
"nodeType": "YulBlock",
"src": "889:116:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "904:15:1",
"value": {
"kind": "number",
"nodeType": "YulLiteral",
"src": "918:1:1",
"type": "",
"value": "0"
},
"variables": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "908:6:1",
"type": ""
}
]
},
{
"nodeType": "YulAssignment",
"src": "933:62:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "967:9:1"
},
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "978:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "963:3:1"
},
"nodeType": "YulFunctionCall",
"src": "963:22:1"
},
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "987:7:1"
}
],
"functionName": {
"name": "abi_decode_t_int256",
"nodeType": "YulIdentifier",
"src": "943:19:1"
},
"nodeType": "YulFunctionCall",
"src": "943:52:1"
},
"variableNames": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "933:6:1"
}
]
}
]
}
]
},
"name": "abi_decode_tuple_t_int256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "720:9:1",
"type": ""
},
{
"name": "dataEnd",
"nodeType": "YulTypedName",
"src": "731:7:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "743:6:1",
"type": ""
}
],
"src": "685:327:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1063:81:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1073:65:1",
"value": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1088:5:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1095:42:1",
"type": "",
"value": "0xffffffffffffffffffffffffffffffffffffffff"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "1084:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1084:54:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "1073:7:1"
}
]
}
]
},
"name": "cleanup_t_uint160",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1045:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "1055:7:1",
"type": ""
}
],
"src": "1018:126:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1195:51:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1205:35:1",
"value": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1234:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint160",
"nodeType": "YulIdentifier",
"src": "1216:17:1"
},
"nodeType": "YulFunctionCall",
"src": "1216:24:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "1205:7:1"
}
]
}
]
},
"name": "cleanup_t_address",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1177:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "1187:7:1",
"type": ""
}
],
"src": "1150:96:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1317:53:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "1334:3:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1357:5:1"
}
],
"functionName": {
"name": "cleanup_t_address",
"nodeType": "YulIdentifier",
"src": "1339:17:1"
},
"nodeType": "YulFunctionCall",
"src": "1339:24:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1327:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1327:37:1"
},
"nodeType": "YulExpressionStatement",
"src": "1327:37:1"
}
]
},
"name": "abi_encode_t_address_to_t_address_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1305:5:1",
"type": ""
},
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "1312:3:1",
"type": ""
}
],
"src": "1252:118:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1439:52:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "1456:3:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1478:5:1"
}
],
"functionName": {
"name": "cleanup_t_int256",
"nodeType": "YulIdentifier",
"src": "1461:16:1"
},
"nodeType": "YulFunctionCall",
"src": "1461:23:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1449:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1449:36:1"
},
"nodeType": "YulExpressionStatement",
"src": "1449:36:1"
}
]
},
"name": "abi_encode_t_int256_to_t_int256_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1427:5:1",
"type": ""
},
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "1434:3:1",
"type": ""
}
],
"src": "1376:115:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1621:204:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1631:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1643:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1654:2:1",
"type": "",
"value": "64"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1639:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1639:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "1631:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "1711:6:1"
},
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1724:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1735:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1720:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1720:17:1"
}
],
"functionName": {
"name": "abi_encode_t_address_to_t_address_fromStack",
"nodeType": "YulIdentifier",
"src": "1667:43:1"
},
"nodeType": "YulFunctionCall",
"src": "1667:71:1"
},
"nodeType": "YulExpressionStatement",
"src": "1667:71:1"
},
{
"expression": {
"arguments": [
{
"name": "value1",
"nodeType": "YulIdentifier",
"src": "1790:6:1"
},
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1803:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1814:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1799:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1799:18:1"
}
],
"functionName": {
"name": "abi_encode_t_int256_to_t_int256_fromStack",
"nodeType": "YulIdentifier",
"src": "1748:41:1"
},
"nodeType": "YulFunctionCall",
"src": "1748:70:1"
},
"nodeType": "YulExpressionStatement",
"src": "1748:70:1"
}
]
},
"name": "abi_encode_tuple_t_address_t_int256__to_t_address_t_int256__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "1585:9:1",
"type": ""
},
{
"name": "value1",
"nodeType": "YulTypedName",
"src": "1597:6:1",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "1605:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "1616:4:1",
"type": ""
}
],
"src": "1497:328:1"
}
]
},
"contents": "{\n\n function allocate_unbounded() -> memPtr {\n memPtr := mload(64)\n }\n\n function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {\n revert(0, 0)\n }\n\n function revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() {\n revert(0, 0)\n }\n\n function cleanup_t_int256(value) -> cleaned {\n cleaned := value\n }\n\n function validator_revert_t_int256(value) {\n if iszero(eq(value, cleanup_t_int256(value))) { revert(0, 0) }\n }\n\n function abi_decode_t_int256(offset, end) -> value {\n value := calldataload(offset)\n validator_revert_t_int256(value)\n }\n\n function abi_decode_tuple_t_int256(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_int256(add(headStart, offset), dataEnd)\n }\n\n }\n\n function cleanup_t_uint160(value) -> cleaned {\n cleaned := and(value, 0xffffffffffffffffffffffffffffffffffffffff)\n }\n\n function cleanup_t_address(value) -> cleaned {\n cleaned := cleanup_t_uint160(value)\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_int256_to_t_int256_fromStack(value, pos) {\n mstore(pos, cleanup_t_int256(value))\n }\n\n function abi_encode_tuple_t_address_t_int256__to_t_address_t_int256__fromStack_reversed(headStart , value1, value0) -> tail {\n tail := add(headStart, 64)\n\n abi_encode_t_address_to_t_address_fromStack(value0, add(headStart, 0))\n\n abi_encode_t_int256_to_t_int256_fromStack(value1, add(headStart, 32))\n\n }\n\n}\n",
"id": 1,
"language": "Yul",
"name": "#utility.yul"
}
],
"immutableReferences": {},
"linkReferences": {},
"object": "608060405234801561001057600080fd5b50600436106100365760003560e01c80636299a6ef1461003b57806387db03b714610057575b600080fd5b61005560048036038101906100509190610309565b610073565b005b610071600480360381019061006c9190610309565b610199565b005b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16801561010e5750806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154125b61011757600080fd5b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055507f6e271428a540d20d7afb57d1cdcda7c5c65823ca8d24a57e58b3122d8c3aa9c0338260405161018e929190610386565b60405180910390a150565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16156101f257600080fd5b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff021916908315150217905550806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055507fcd33e9804a00316b8823a9e0a1d29576f3fb2fcb59a3697a6f0255a5a915357233826040516102c3929190610386565b60405180910390a150565b600080fd5b6000819050919050565b6102e6816102d3565b81146102f157600080fd5b50565b600081359050610303816102dd565b92915050565b60006020828403121561031f5761031e6102ce565b5b600061032d848285016102f4565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061036182610336565b9050919050565b61037181610356565b82525050565b610380816102d3565b82525050565b600060408201905061039b6000830185610368565b6103a86020830184610377565b939250505056fea26469706673582212208c66ffa85390e9c7e4d9eb9c71d871b8984dbd9420e1b4bb707e67f7a4310b9664736f6c634300080c0033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x36 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x6299A6EF EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x87DB03B7 EQ PUSH2 0x57 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x55 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x50 SWAP2 SWAP1 PUSH2 0x309 JUMP JUMPDEST PUSH2 0x73 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x71 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x6C SWAP2 SWAP1 PUSH2 0x309 JUMP JUMPDEST PUSH2 0x199 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP1 ISZERO PUSH2 0x10E JUMPI POP 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 PUSH1 0x1 ADD SLOAD SLT JUMPDEST PUSH2 0x117 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 PUSH1 0x1 ADD DUP2 SWAP1 SSTORE POP PUSH32 0x6E271428A540D20D7AFB57D1CDCDA7C5C65823CA8D24A57E58B3122D8C3AA9C0 CALLER DUP3 PUSH1 0x40 MLOAD PUSH2 0x18E SWAP3 SWAP2 SWAP1 PUSH2 0x386 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1F2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP 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 PUSH1 0x1 ADD DUP2 SWAP1 SSTORE POP PUSH32 0xCD33E9804A00316B8823A9E0A1D29576F3FB2FCB59A3697A6F0255A5A9153572 CALLER DUP3 PUSH1 0x40 MLOAD PUSH2 0x2C3 SWAP3 SWAP2 SWAP1 PUSH2 0x386 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x2E6 DUP2 PUSH2 0x2D3 JUMP JUMPDEST DUP2 EQ PUSH2 0x2F1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x303 DUP2 PUSH2 0x2DD JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x31F JUMPI PUSH2 0x31E PUSH2 0x2CE JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x32D DUP5 DUP3 DUP6 ADD PUSH2 0x2F4 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x361 DUP3 PUSH2 0x336 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x371 DUP2 PUSH2 0x356 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x380 DUP2 PUSH2 0x2D3 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 DUP3 ADD SWAP1 POP PUSH2 0x39B PUSH1 0x0 DUP4 ADD DUP6 PUSH2 0x368 JUMP JUMPDEST PUSH2 0x3A8 PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x377 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 DUP13 PUSH7 0xFFA85390E9C7E4 0xD9 0xEB SWAP13 PUSH18 0xD871B8984DBD9420E1B4BB707E67F7A4310B SWAP7 PUSH5 0x736F6C6343 STOP ADDMOD 0xC STOP CALLER ",
"sourceMap": "63:1177:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1006:231;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;729:235;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;1006:231;1063:7;:22;1073:10;1063:22;;;;;;;;;;;;;;;:27;;;;;;;;;;;;:67;;;;;1125:5;1094:7;:22;1104:10;1094:22;;;;;;;;;;;;;;;:28;;;:36;1063:67;1053:79;;;;;;1173:5;1142:7;:22;1152:10;1142:22;;;;;;;;;;;;;;;:28;;:36;;;;1194;1210:10;1223:5;1194:36;;;;;;;:::i;:::-;;;;;;;;1006:231;:::o;729:235::-;789:7;:22;799:10;789:22;;;;;;;;;;;;;;;:27;;;;;;;;;;;;787:29;778:40;;;;;;858:4;828:7;:22;838:10;828:22;;;;;;;;;;;;;;;:27;;;:34;;;;;;;;;;;;;;;;;;904:5;873:7;:22;883:10;873:22;;;;;;;;;;;;;;;:28;;:36;;;;925:32;937:10;950:5;925:32;;;;;;;:::i;:::-;;;;;;;;729:235;:::o;88:117:1:-;197:1;194;187:12;334:76;370:7;399:5;388:16;;334:76;;;:::o;416:120::-;488:23;505:5;488:23;:::i;:::-;481:5;478:34;468:62;;526:1;523;516:12;468:62;416:120;:::o;542:137::-;587:5;625:6;612:20;603:29;;641:32;667:5;641:32;:::i;:::-;542:137;;;;:::o;685:327::-;743:6;792:2;780:9;771:7;767:23;763:32;760:119;;;798:79;;:::i;:::-;760:119;918:1;943:52;987:7;978:6;967:9;963:22;943:52;:::i;:::-;933:62;;889:116;685:327;;;;:::o;1018:126::-;1055:7;1095:42;1088:5;1084:54;1073:65;;1018:126;;;:::o;1150:96::-;1187:7;1216:24;1234:5;1216:24;:::i;:::-;1205:35;;1150:96;;;:::o;1252:118::-;1339:24;1357:5;1339:24;:::i;:::-;1334:3;1327:37;1252:118;;:::o;1376:115::-;1461:23;1478:5;1461:23;:::i;:::-;1456:3;1449:36;1376:115;;:::o;1497:328::-;1616:4;1654:2;1643:9;1639:18;1631:26;;1667:71;1735:1;1724:9;1720:17;1711:6;1667:71;:::i;:::-;1748:70;1814:2;1803:9;1799:18;1790:6;1748:70;:::i;:::-;1497:328;;;;;:::o"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "199400",
"executionCost": "245",
"totalCost": "199645"
},
"external": {
"add(int256)": "infinite",
"update(int256)": "infinite"
}
},
"methodIdentifiers": {
"add(int256)": "87db03b7",
"update(int256)": "6299a6ef"
}
},
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "at",
"type": "address"
},
{
"indexed": false,
"internalType": "int256",
"name": "value",
"type": "int256"
}
],
"name": "new_entry",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "at",
"type": "address"
},
{
"indexed": false,
"internalType": "int256",
"name": "value",
"type": "int256"
}
],
"name": "updated_entry",
"type": "event"
},
{
"inputs": [
{
"internalType": "int256",
"name": "value",
"type": "int256"
}
],
"name": "add",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "int256",
"name": "value",
"type": "int256"
}
],
"name": "update",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.12+commit.f00d7308"
},
"language": "Solidity",
"output": {
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "at",
"type": "address"
},
{
"indexed": false,
"internalType": "int256",
"name": "value",
"type": "int256"
}
],
"name": "new_entry",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "at",
"type": "address"
},
{
"indexed": false,
"internalType": "int256",
"name": "value",
"type": "int256"
}
],
"name": "updated_entry",
"type": "event"
},
{
"inputs": [
{
"internalType": "int256",
"name": "value",
"type": "int256"
}
],
"name": "add",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "int256",
"name": "value",
"type": "int256"
}
],
"name": "update",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"events": {
"new_entry(address,int256)": {
"notice": "tracks - changes -in entriesprecondition ! entries [at] .setpostcondition entries [at] .set && entries [at] .data == value"
},
"updated_entry(address,int256)": {
"notice": "tracks - changes -in entriesprecondition entries [at] .set && entries [at] .data < valuepostcondition entries [at] .set && entries [at] .data == value"
}
},
"kind": "user",
"methods": {
"add(int256)": {
"notice": "emits new_entry"
},
"update(int256)": {
"notice": "emits updated_entry"
}
},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/ex1.sol": "Registry"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"contracts/ex1.sol": {
"keccak256": "0x35b071fa21df790e4c561ddd7d963e2db821699d3731d3ca0982b86c5000016b",
"license": "GPL-3.0",
"urls": [
"bzz-raw://dcda49393dfcd2d0fb360f90f7930894bd4c3c737a40ee71ab3f5defdf5c73df",
"dweb:/ipfs/QmV65dNxQANr9g9cAL2GTXNqs6mqwFSUdgcTHQTn9AmLz9"
]
}
},
"version": 1
}
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.12;
contract Registry {
struct Entry { bool set ; int data ; } // User - defined type
mapping ( address => Entry ) entries ; // State variable
/// @notice tracks - changes -in entries
/// @notice precondition ! entries [at] .set
/// @notice postcondition entries [at] .set && entries [at] .data == value
event new_entry ( address at , int value );
/// @notice tracks - changes -in entries
/// @notice precondition entries [at] .set && entries [at] .data < value
/// @notice postcondition entries [at] .set && entries [at] .data == value
event updated_entry ( address at , int value );
/// @notice emits new_entry
function add ( int value ) public {
require (! entries [ msg.sender ] .set );
entries [ msg.sender ] .set = true ;
entries [ msg.sender ] .data = value ;
emit new_entry ( msg.sender , value );
}
/// @notice emits updated_entry
function update ( int value ) public {
require ( entries [ msg.sender ] .set && entries [ msg.sender ] .data < value );
entries [ msg.sender ] .data = value ;
emit updated_entry ( msg.sender , value );
}
function check() public view returns (uint256) {
return entries[0];
}
}
pragma solidity >=0.4.2 <0.6.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint vote;
}
mapping(address => Voter) voters;
struct Proposal {
uint voteCount;
}
Proposal[] proposals;
address chairperson;
enum Phase {Init, Regs, Vote, Done}
Phase public state = Phase.Init;
constructor (uint numProposals) public {
chairperson = msg.sender;
voters[chairperson].weight = 2;
for (uint prop = 0; prop < numProposals; prop++){
proposals.push(Proposal(0));
}
}
function changeState(Phase x) public {
if (msg.sender != chairperson) {
revert();
}
if ( x < state ) revert();
state = x;
}
}
// 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