Skip to content

Instantly share code, notes, and snippets.

@BigSamu
Created July 14, 2021 12:59
Show Gist options
  • Save BigSamu/cf3d10438b80d37855743074e888a6b5 to your computer and use it in GitHub Desktop.
Save BigSamu/cf3d10438b80d37855743074e888a6b5 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.4.26+commit.4563c3fc.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
The 'scripts' folder contains example async/await scripts for deploying the 'Storage' contract.
For the deployment of any other contract, 'contractName' and 'constructorArgs' should be updated (along with other code if required).
Scripts have full access to the web3.js and ethers.js libraries.
To run a script, right click on file name in the file explorer and click 'Run'. Remember, Solidity file must already be compiled.
Output from script will appear in remix terminal.
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
*/
contract Storage {
uint256 number;
/**
* @dev Store value in variable
* @param num value to store
*/
function store(uint256 num) public {
number = num;
}
/**
* @dev Return value
* @return value of 'number'
*/
function retrieve() public view returns (uint256){
return number;
}
}
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Owner
* @dev Set & change owner
*/
contract Owner {
address private owner;
// event for EVM logging
event OwnerSet(address indexed oldOwner, address indexed newOwner);
// modifier to check if caller is owner
modifier isOwner() {
// If the first argument of 'require' evaluates to 'false', execution terminates and all
// changes to the state and to Ether balances are reverted.
// This used to consume all gas in old EVM versions, but not anymore.
// It is often a good idea to use 'require' to check if functions are called correctly.
// As a second argument, you can also provide an explanation about what went wrong.
require(msg.sender == owner, "Caller is not owner");
_;
}
/**
* @dev Set contract deployer as owner
*/
constructor() {
owner = msg.sender; // 'msg.sender' is sender of current call, contract deployer for a constructor
emit OwnerSet(address(0), owner);
}
/**
* @dev Change owner
* @param newOwner address of new owner
*/
function changeOwner(address newOwner) public isOwner {
emit OwnerSet(owner, newOwner);
owner = newOwner;
}
/**
* @dev Return owner address
* @return address of owner
*/
function getOwner() external view returns (address) {
return owner;
}
}
pragma solidity >=0.4.22 <0.9.0;
contract HelloWorldContract {
string greeting;
constructor() public {
greeting = 'Hello World';
}
function greet() public view returns (string memory) {
return greeting;
}
}
pragma solidity >=0.4.22 <0.9.0;
contract Bank {
struct Account {
address addr;
uint amount;
}
Account public acc_1 = Account({
addr:0x5B38Da6a701c568545dCfcB03FcB875f56beddC4,
amount: 50
});
Account public acc_2 = Account({
addr:0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2,
amount: 50
});
function addAmount (uint _addMoney) public {
acc_1.amount += _addMoney;
}
function withdraw (uint _substractMoney) public {
acc_1.amount -= _substractMoney;
}
function transfer (uint _transferMoney) public {
require(acc_1.amount >= _transferMoney); // check enough credit for transfering
require(acc_2.amount + _transferMoney >= acc_2.amount); // check for overflow when transfering
acc_1.amount -= _transferMoney;
acc_2.amount += _transferMoney;
}
}
pragma solidity ^0.4.24;
contract Bank {
mapping(address => uint) public accounts;
function depositWithRequire() public payable{
require(accounts[msg.sender] + msg.value >= accounts[msg.sender], "Overflow error"); // check for overflo when transfering
accounts[msg.sender] += msg.value;
}
function withdrawWithRequire(uint money) public {
require(accounts[msg.sender] >= money); // check enough credit for transfering
accounts[msg.sender] -= money;
}
function depositWithRevert() public payable{
if(accounts[msg.sender] + msg.value >= accounts[msg.sender]){ // check for overflo when transfering
revert("Overflow error");
}
accounts[msg.sender] += msg.value;
}
function withdrawWithRevert(uint money) public {
if(accounts[msg.sender] >= money){ // check enough credit for transfering
revert();
}
accounts[msg.sender] -= money;
}
}
contract Math {
function add(uint256 a, uint256 b) internal pure returns(uint){
uint c = a+b;
assert(c>=a);
return c;
}
function multiply(uint256 a, uint256 b) internal pure returns(uint){
if (a==0){
return 0;
}
uint c = a*b;
assert(c/a == b);
return c;
}
}
{
"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": "608060405234801561001057600080fd5b50610538806100206000396000f30060806040526004361061006c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062f4301e146100715780634f384e7a1461007b5780635a2c25d7146100a85780635e5c06e2146100b2578063d570b1c914610109575b600080fd5b610079610136565b005b34801561008757600080fd5b506100a66004803603810190808035906020019092919050505061027a565b005b6100b0610316565b005b3480156100be57600080fd5b506100f3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610459565b6040518082815260200191505060405180910390f35b34801561011557600080fd5b5061013460048036038101908080359060200190929190505050610471565b005b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054346000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015151561022c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f4f766572666c6f77206572726f7200000000000000000000000000000000000081525060200191505060405180910390fd5b346000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550565b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156102c757600080fd5b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555050565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054346000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540110151561040b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f4f766572666c6f77206572726f7200000000000000000000000000000000000081525060200191505060405180910390fd5b346000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550565b60006020528060005260406000206000915090505481565b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015156104bd57600080fd5b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550505600a165627a7a72305820de1b7cf96445f357995bcffd2a7596110faf54592b255e7ff672d3f02a3ef7800029",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x538 DUP1 PUSH2 0x20 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x6C JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH3 0xF4301E EQ PUSH2 0x71 JUMPI DUP1 PUSH4 0x4F384E7A EQ PUSH2 0x7B JUMPI DUP1 PUSH4 0x5A2C25D7 EQ PUSH2 0xA8 JUMPI DUP1 PUSH4 0x5E5C06E2 EQ PUSH2 0xB2 JUMPI DUP1 PUSH4 0xD570B1C9 EQ PUSH2 0x109 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x79 PUSH2 0x136 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x87 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xA6 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x27A JUMP JUMPDEST STOP JUMPDEST PUSH2 0xB0 PUSH2 0x316 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xBE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xF3 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x459 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x115 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x134 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x471 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 SLOAD CALLVALUE 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 ADD LT ISZERO ISZERO ISZERO PUSH2 0x22C JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0xE DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH32 0x4F766572666C6F77206572726F72000000000000000000000000000000000000 DUP2 MSTORE POP PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST CALLVALUE 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 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP JUMP 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 SLOAD LT ISZERO ISZERO ISZERO PUSH2 0x2C7 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 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP 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 SLOAD CALLVALUE 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 ADD LT ISZERO ISZERO PUSH2 0x40B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0xE DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH32 0x4F766572666C6F77206572726F72000000000000000000000000000000000000 DUP2 MSTORE POP PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST CALLVALUE 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 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP JUMP 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 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 SLOAD LT ISZERO ISZERO PUSH2 0x4BD 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 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP POP JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0xde SHL PUSH29 0xF96445F357995BCFFD2A7596110FAF54592B255E7FF672D3F02A3EF780 STOP 0x29 ",
"sourceMap": "26:989:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;26:989:0;;;;;;;"
},
"deployedBytecode": {
"linkReferences": {},
"object": "60806040526004361061006c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062f4301e146100715780634f384e7a1461007b5780635a2c25d7146100a85780635e5c06e2146100b2578063d570b1c914610109575b600080fd5b610079610136565b005b34801561008757600080fd5b506100a66004803603810190808035906020019092919050505061027a565b005b6100b0610316565b005b3480156100be57600080fd5b506100f3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610459565b6040518082815260200191505060405180910390f35b34801561011557600080fd5b5061013460048036038101908080359060200190929190505050610471565b005b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054346000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015151561022c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f4f766572666c6f77206572726f7200000000000000000000000000000000000081525060200191505060405180910390fd5b346000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550565b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156102c757600080fd5b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555050565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054346000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540110151561040b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f4f766572666c6f77206572726f7200000000000000000000000000000000000081525060200191505060405180910390fd5b346000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550565b60006020528060005260406000206000915090505481565b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015156104bd57600080fd5b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550505600a165627a7a72305820de1b7cf96445f357995bcffd2a7596110faf54592b255e7ff672d3f02a3ef7800029",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x6C JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH3 0xF4301E EQ PUSH2 0x71 JUMPI DUP1 PUSH4 0x4F384E7A EQ PUSH2 0x7B JUMPI DUP1 PUSH4 0x5A2C25D7 EQ PUSH2 0xA8 JUMPI DUP1 PUSH4 0x5E5C06E2 EQ PUSH2 0xB2 JUMPI DUP1 PUSH4 0xD570B1C9 EQ PUSH2 0x109 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x79 PUSH2 0x136 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x87 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xA6 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x27A JUMP JUMPDEST STOP JUMPDEST PUSH2 0xB0 PUSH2 0x316 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xBE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xF3 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x459 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x115 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x134 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x471 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 SLOAD CALLVALUE 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 ADD LT ISZERO ISZERO ISZERO PUSH2 0x22C JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0xE DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH32 0x4F766572666C6F77206572726F72000000000000000000000000000000000000 DUP2 MSTORE POP PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST CALLVALUE 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 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP JUMP 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 SLOAD LT ISZERO ISZERO ISZERO PUSH2 0x2C7 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 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP 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 SLOAD CALLVALUE 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 ADD LT ISZERO ISZERO PUSH2 0x40B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0xE DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH32 0x4F766572666C6F77206572726F72000000000000000000000000000000000000 DUP2 MSTORE POP PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST CALLVALUE 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 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP JUMP 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 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 SLOAD LT ISZERO ISZERO PUSH2 0x4BD 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 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP POP JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0xde SHL PUSH29 0xF96445F357995BCFFD2A7596110FAF54592B255E7FF672D3F02A3EF780 STOP 0x29 ",
"sourceMap": "26:989:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;107:225;;;;;;342:181;;8:9:-1;5:2;;;30:1;27;20:12;5:2;342:181:0;;;;;;;;;;;;;;;;;;;;;;;;;;537:249;;;;;;51:40;;8:9:-1;5:2;;;30:1;27;20:12;5:2;51:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;796:216;;8:9:-1;5:2;;;30:1;27;20:12;5:2;796:216:0;;;;;;;;;;;;;;;;;;;;;;;;;;107:225;205:8;:20;214:10;205:20;;;;;;;;;;;;;;;;192:9;169:8;:20;178:10;169:20;;;;;;;;;;;;;;;;:32;:56;;161:83;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;316:9;292:8;:20;301:10;292:20;;;;;;;;;;;;;;;;:33;;;;;;;;;;;107:225::o;342:181::-;432:5;408:8;:20;417:10;408:20;;;;;;;;;;;;;;;;:29;;400:38;;;;;;;;511:5;487:8;:20;496:10;487:20;;;;;;;;;;;;;;;;:29;;;;;;;;;;;342:181;:::o;537:249::-;629:8;:20;638:10;629:20;;;;;;;;;;;;;;;;616:9;593:8;:20;602:10;593:20;;;;;;;;;;;;;;;;:32;:56;;590:146;;;700:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;590:146;770:9;746:8;:20;755:10;746:20;;;;;;;;;;;;;;;;:33;;;;;;;;;;;537:249::o;51:40::-;;;;;;;;;;;;;;;;;:::o;796:216::-;880:5;856:8;:20;865:10;856:20;;;;;;;;;;;;;;;;:29;;853:105;;;939:8;;;853:105;991:5;967:8;:20;976:10;967:20;;;;;;;;;;;;;;;;:29;;;;;;;;;;;796:216;:::o"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "267200",
"executionCost": "306",
"totalCost": "267506"
},
"external": {
"accounts(address)": "598",
"depositWithRequire()": "21045",
"depositWithRevert()": "21086",
"withdrawWithRequire(uint256)": "20856",
"withdrawWithRevert(uint256)": "20919"
}
},
"methodIdentifiers": {
"accounts(address)": "5e5c06e2",
"depositWithRequire()": "00f4301e",
"depositWithRevert()": "5a2c25d7",
"withdrawWithRequire(uint256)": "4f384e7a",
"withdrawWithRevert(uint256)": "d570b1c9"
}
},
"abi": [
{
"constant": false,
"inputs": [],
"name": "depositWithRequire",
"outputs": [],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "money",
"type": "uint256"
}
],
"name": "withdrawWithRequire",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "depositWithRevert",
"outputs": [],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "accounts",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "money",
"type": "uint256"
}
],
"name": "withdrawWithRevert",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.4.26+commit.4563c3fc"
},
"language": "Solidity",
"output": {
"abi": [
{
"constant": false,
"inputs": [],
"name": "depositWithRequire",
"outputs": [],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "money",
"type": "uint256"
}
],
"name": "withdrawWithRequire",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "depositWithRevert",
"outputs": [],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "accounts",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "money",
"type": "uint256"
}
],
"name": "withdrawWithRevert",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"methods": {}
},
"userdoc": {
"methods": {}
}
},
"settings": {
"compilationTarget": {
"contracts/5_ErrorHandlingAndExceptions.sol": "Bank"
},
"evmVersion": "byzantium",
"libraries": {},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"contracts/5_ErrorHandlingAndExceptions.sol": {
"keccak256": "0xb2584a418521d4d18eccd1958816dba197e7b60966b3e83ef4fefdda991eec2a",
"urls": [
"bzzr://e19afd7ab7c91839c88aa925191bcbf3d8654dbc271e1b29fbe979f8c5e1a7c7"
]
}
},
"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": "608060405234801561001057600080fd5b506040805190810160405280600b81526020017f48656c6c6f20576f726c640000000000000000000000000000000000000000008152506000908051906020019061005c929190610062565b50610107565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100a357805160ff19168380011785556100d1565b828001600101855582156100d1579182015b828111156100d05782518255916020019190600101906100b5565b5b5090506100de91906100e2565b5090565b61010491905b808211156101005760008160009055506001016100e8565b5090565b90565b6101a4806101166000396000f300608060405260043610610041576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063cfae321714610046575b600080fd5b34801561005257600080fd5b5061005b6100d6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561009b578082015181840152602081019050610080565b50505050905090810190601f1680156100c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b606060008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561016e5780601f106101435761010080835404028352916020019161016e565b820191906000526020600020905b81548152906001019060200180831161015157829003601f168201915b50505050509050905600a165627a7a723058209d17370f752e9cbec127972eabc260e5655b40cb03e5f99641a342a1615ac86f0029",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 DUP1 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0xB DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x48656C6C6F20576F726C64000000000000000000000000000000000000000000 DUP2 MSTORE POP PUSH1 0x0 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x5C SWAP3 SWAP2 SWAP1 PUSH2 0x62 JUMP JUMPDEST POP PUSH2 0x107 JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0xA3 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0xD1 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0xD1 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0xD0 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0xB5 JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0xDE SWAP2 SWAP1 PUSH2 0xE2 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH2 0x104 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x100 JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH2 0xE8 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH2 0x1A4 DUP1 PUSH2 0x116 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x41 JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0xCFAE3217 EQ PUSH2 0x46 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x52 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x5B PUSH2 0xD6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x9B JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x80 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xC8 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x16E JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x143 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x16E JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x151 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 SWAP14 OR CALLDATACOPY 0xf PUSH22 0x2E9CBEC127972EABC260E5655B40CB03E5F99641A342 LOG1 PUSH2 0x5AC8 PUSH16 0x290000000000000000000000000000 ",
"sourceMap": "34:197:0:-;;;85:56;8:9:-1;5:2;;;30:1;27;20:12;5:2;85:56:0;112:24;;;;;;;;;;;;;;;;;;:8;:24;;;;;;;;;;;;:::i;:::-;;34:197;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;"
},
"deployedBytecode": {
"linkReferences": {},
"object": "608060405260043610610041576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063cfae321714610046575b600080fd5b34801561005257600080fd5b5061005b6100d6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561009b578082015181840152602081019050610080565b50505050905090810190601f1680156100c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b606060008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561016e5780601f106101435761010080835404028352916020019161016e565b820191906000526020600020905b81548152906001019060200180831161015157829003601f168201915b50505050509050905600a165627a7a723058209d17370f752e9cbec127972eabc260e5655b40cb03e5f99641a342a1615ac86f0029",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x41 JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0xCFAE3217 EQ PUSH2 0x46 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x52 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x5B PUSH2 0xD6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x9B JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x80 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xC8 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x16E JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x143 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x16E JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x151 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 SWAP14 OR CALLDATACOPY 0xf PUSH22 0x2E9CBEC127972EABC260E5655B40CB03E5F99641A342 LOG1 PUSH2 0x5AC8 PUSH16 0x290000000000000000000000000000 ",
"sourceMap": "34:197:0:-;;;;;;;;;;;;;;;;;;;;;;;;146:83;;8:9:-1;5:2;;;30:1;27;20:12;5:2;146:83:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;146:83:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;184:6;214:8;207:15;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;146:83;:::o"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "84000",
"executionCost": "infinite",
"totalCost": "infinite"
},
"external": {
"greet()": "infinite"
}
},
"methodIdentifiers": {
"greet()": "cfae3217"
}
},
"abi": [
{
"constant": true,
"inputs": [],
"name": "greet",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
}
]
}
{
"compiler": {
"version": "0.4.22+commit.4cb486ee"
},
"language": "Solidity",
"output": {
"abi": [
{
"constant": true,
"inputs": [],
"name": "greet",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
}
],
"devdoc": {
"methods": {}
},
"userdoc": {
"methods": {}
}
},
"settings": {
"compilationTarget": {
"contracts/3_Ballot.sol": "HelloWorldContract"
},
"evmVersion": "byzantium",
"libraries": {},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"contracts/3_Ballot.sol": {
"keccak256": "0xbba66c6c08b59e53b78761671d7f615e029d707ddcb3d16f4fc56271f0b96405",
"urls": [
"bzzr://3286a9d31fa5994bd61726176097a3fb08232a2cb8c79f7ef40b5a93064db16d"
]
}
},
"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": "6080604052348015600f57600080fd5b50603580601d6000396000f3006080604052600080fd00a165627a7a72305820f1162de106fbf1d71ebb3c3ede11c469dfd93164a80e6ee9f0a116fcfac4b3130029",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x35 DUP1 PUSH1 0x1D PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 CALL AND 0x2d 0xe1 MOD CREATE2 CALL 0xd7 0x1e 0xbb EXTCODECOPY RETURNDATACOPY 0xde GT 0xc4 PUSH10 0xDFD93164A80E6EE9F0A1 AND 0xfc STATICCALL 0xc4 0xb3 SGT STOP 0x29 ",
"sourceMap": "1021:349:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1021:349:0;;;;;;;"
},
"deployedBytecode": {
"linkReferences": {},
"object": "6080604052600080fd00a165627a7a72305820f1162de106fbf1d71ebb3c3ede11c469dfd93164a80e6ee9f0a116fcfac4b3130029",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 CALL AND 0x2d 0xe1 MOD CREATE2 CALL 0xd7 0x1e 0xbb EXTCODECOPY RETURNDATACOPY 0xde GT 0xc4 PUSH10 0xDFD93164A80E6EE9F0A1 AND 0xfc STATICCALL 0xc4 0xb3 SGT STOP 0x29 ",
"sourceMap": "1021:349:0:-;;;;;"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "10600",
"executionCost": "66",
"totalCost": "10666"
},
"internal": {
"add(uint256,uint256)": "infinite",
"multiply(uint256,uint256)": "infinite"
}
},
"methodIdentifiers": {}
},
"abi": []
}
{
"compiler": {
"version": "0.4.26+commit.4563c3fc"
},
"language": "Solidity",
"output": {
"abi": [],
"devdoc": {
"methods": {}
},
"userdoc": {
"methods": {}
}
},
"settings": {
"compilationTarget": {
"contracts/5_ErrorHandlingAndExceptions.sol": "Math"
},
"evmVersion": "byzantium",
"libraries": {},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"contracts/5_ErrorHandlingAndExceptions.sol": {
"keccak256": "0xb2584a418521d4d18eccd1958816dba197e7b60966b3e83ef4fefdda991eec2a",
"urls": [
"bzzr://e19afd7ab7c91839c88aa925191bcbf3d8654dbc271e1b29fbe979f8c5e1a7c7"
]
}
},
"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": {
"generatedSources": [],
"linkReferences": {},
"object": "60806040526040518060400160405280735b38da6a701c568545dcfcb03fcb875f56beddc473ffffffffffffffffffffffffffffffffffffffff16815260200160328152506000808201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015550503480156100a457600080fd5b5061025a806100b46000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80630912f2321461003b5780637da1365e14610057575b600080fd5b610055600480360381019061005091906100dc565b610076565b005b61005f610095565b60405161006d929190610123565b60405180910390f35b806000600101600082825461008b919061014c565b9250508190555050565b60008060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154905082565b6000813590506100d68161020d565b92915050565b6000602082840312156100ee57600080fd5b60006100fc848285016100c7565b91505092915050565b61010e816101a2565b82525050565b61011d816101d4565b82525050565b60006040820190506101386000830185610105565b6101456020830184610114565b9392505050565b6000610157826101d4565b9150610162836101d4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610197576101966101de565b5b828201905092915050565b60006101ad826101b4565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b610216816101d4565b811461022157600080fd5b5056fea26469706673582212209e22121cbe6ed7c2dc030bbc489e7d0b9517769312cebbef1ea6016e7543415c64736f6c63430008040033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH20 0x5B38DA6A701C568545DCFCB03FCB875F56BEDDC4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x32 DUP2 MSTORE POP PUSH1 0x0 DUP1 DUP3 ADD MLOAD DUP2 PUSH1 0x0 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x20 DUP3 ADD MLOAD DUP2 PUSH1 0x1 ADD SSTORE POP POP CALLVALUE DUP1 ISZERO PUSH2 0xA4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x25A DUP1 PUSH2 0xB4 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 0x912F232 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x7DA1365E 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 0xDC JUMP JUMPDEST PUSH2 0x76 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x5F PUSH2 0x95 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x6D SWAP3 SWAP2 SWAP1 PUSH2 0x123 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST DUP1 PUSH1 0x0 PUSH1 0x1 ADD PUSH1 0x0 DUP3 DUP3 SLOAD PUSH2 0x8B SWAP2 SWAP1 PUSH2 0x14C JUMP JUMPDEST SWAP3 POP POP DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP1 PUSH1 0x1 ADD SLOAD SWAP1 POP DUP3 JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xD6 DUP2 PUSH2 0x20D JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xEE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0xFC DUP5 DUP3 DUP6 ADD PUSH2 0xC7 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x10E DUP2 PUSH2 0x1A2 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x11D DUP2 PUSH2 0x1D4 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 DUP3 ADD SWAP1 POP PUSH2 0x138 PUSH1 0x0 DUP4 ADD DUP6 PUSH2 0x105 JUMP JUMPDEST PUSH2 0x145 PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x114 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x157 DUP3 PUSH2 0x1D4 JUMP JUMPDEST SWAP2 POP PUSH2 0x162 DUP4 PUSH2 0x1D4 JUMP JUMPDEST SWAP3 POP DUP3 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SUB DUP3 GT ISZERO PUSH2 0x197 JUMPI PUSH2 0x196 PUSH2 0x1DE JUMP JUMPDEST JUMPDEST DUP3 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1AD DUP3 PUSH2 0x1B4 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH2 0x216 DUP2 PUSH2 0x1D4 JUMP JUMPDEST DUP2 EQ PUSH2 0x221 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 SWAP15 0x22 SLT SHR 0xBE PUSH15 0xD7C2DC030BBC489E7D0B9517769312 0xCE 0xBB 0xEF 0x1E 0xA6 ADD PUSH15 0x7543415C64736F6C63430008040033 ",
"sourceMap": "34:306:0:-:0;;;152:92;;;;;;;;175:42;152:92;;;;;;235:2;152:92;;;131:113;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;34:306;;;;;;;;;;;;;;;;"
},
"deployedBytecode": {
"generatedSources": [
{
"ast": {
"nodeType": "YulBlock",
"src": "0:1945:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "59:87:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "69:29:1",
"value": {
"arguments": [
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "91:6:1"
}
],
"functionName": {
"name": "calldataload",
"nodeType": "YulIdentifier",
"src": "78:12:1"
},
"nodeType": "YulFunctionCall",
"src": "78:20:1"
},
"variableNames": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "69:5:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "134:5:1"
}
],
"functionName": {
"name": "validator_revert_t_uint256",
"nodeType": "YulIdentifier",
"src": "107:26:1"
},
"nodeType": "YulFunctionCall",
"src": "107:33:1"
},
"nodeType": "YulExpressionStatement",
"src": "107:33:1"
}
]
},
"name": "abi_decode_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "37:6:1",
"type": ""
},
{
"name": "end",
"nodeType": "YulTypedName",
"src": "45:3:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "53:5:1",
"type": ""
}
],
"src": "7:139:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "218:196:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "264:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "273:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "276:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "266:6:1"
},
"nodeType": "YulFunctionCall",
"src": "266:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "266:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "239:7:1"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "248:9:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "235:3:1"
},
"nodeType": "YulFunctionCall",
"src": "235:23:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "260:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "slt",
"nodeType": "YulIdentifier",
"src": "231:3:1"
},
"nodeType": "YulFunctionCall",
"src": "231:32:1"
},
"nodeType": "YulIf",
"src": "228:2:1"
},
{
"nodeType": "YulBlock",
"src": "290:117:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "305:15:1",
"value": {
"kind": "number",
"nodeType": "YulLiteral",
"src": "319:1:1",
"type": "",
"value": "0"
},
"variables": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "309:6:1",
"type": ""
}
]
},
{
"nodeType": "YulAssignment",
"src": "334:63:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "369:9:1"
},
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "380:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "365:3:1"
},
"nodeType": "YulFunctionCall",
"src": "365:22:1"
},
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "389:7:1"
}
],
"functionName": {
"name": "abi_decode_t_uint256",
"nodeType": "YulIdentifier",
"src": "344:20:1"
},
"nodeType": "YulFunctionCall",
"src": "344:53:1"
},
"variableNames": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "334:6:1"
}
]
}
]
}
]
},
"name": "abi_decode_tuple_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "188:9:1",
"type": ""
},
{
"name": "dataEnd",
"nodeType": "YulTypedName",
"src": "199:7:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "211:6:1",
"type": ""
}
],
"src": "152:262:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "485:53:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "502:3:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "525:5:1"
}
],
"functionName": {
"name": "cleanup_t_address",
"nodeType": "YulIdentifier",
"src": "507:17:1"
},
"nodeType": "YulFunctionCall",
"src": "507:24:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "495:6:1"
},
"nodeType": "YulFunctionCall",
"src": "495:37:1"
},
"nodeType": "YulExpressionStatement",
"src": "495:37:1"
}
]
},
"name": "abi_encode_t_address_to_t_address_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "473:5:1",
"type": ""
},
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "480:3:1",
"type": ""
}
],
"src": "420:118:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "609:53:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "626:3:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "649:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "631:17:1"
},
"nodeType": "YulFunctionCall",
"src": "631:24:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "619:6:1"
},
"nodeType": "YulFunctionCall",
"src": "619:37:1"
},
"nodeType": "YulExpressionStatement",
"src": "619:37:1"
}
]
},
"name": "abi_encode_t_uint256_to_t_uint256_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "597:5:1",
"type": ""
},
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "604:3:1",
"type": ""
}
],
"src": "544:118:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "794:206:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "804:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "816:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "827:2:1",
"type": "",
"value": "64"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "812:3:1"
},
"nodeType": "YulFunctionCall",
"src": "812:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "804:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "884:6:1"
},
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "897:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "908:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "893:3:1"
},
"nodeType": "YulFunctionCall",
"src": "893:17:1"
}
],
"functionName": {
"name": "abi_encode_t_address_to_t_address_fromStack",
"nodeType": "YulIdentifier",
"src": "840:43:1"
},
"nodeType": "YulFunctionCall",
"src": "840:71:1"
},
"nodeType": "YulExpressionStatement",
"src": "840:71:1"
},
{
"expression": {
"arguments": [
{
"name": "value1",
"nodeType": "YulIdentifier",
"src": "965:6:1"
},
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "978:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "989:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "974:3:1"
},
"nodeType": "YulFunctionCall",
"src": "974:18:1"
}
],
"functionName": {
"name": "abi_encode_t_uint256_to_t_uint256_fromStack",
"nodeType": "YulIdentifier",
"src": "921:43:1"
},
"nodeType": "YulFunctionCall",
"src": "921:72:1"
},
"nodeType": "YulExpressionStatement",
"src": "921:72:1"
}
]
},
"name": "abi_encode_tuple_t_address_t_uint256__to_t_address_t_uint256__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "758:9:1",
"type": ""
},
{
"name": "value1",
"nodeType": "YulTypedName",
"src": "770:6:1",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "778:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "789:4:1",
"type": ""
}
],
"src": "668:332:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1050:261:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1060:25:1",
"value": {
"arguments": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "1083:1:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "1065:17:1"
},
"nodeType": "YulFunctionCall",
"src": "1065:20:1"
},
"variableNames": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "1060:1:1"
}
]
},
{
"nodeType": "YulAssignment",
"src": "1094:25:1",
"value": {
"arguments": [
{
"name": "y",
"nodeType": "YulIdentifier",
"src": "1117:1:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "1099:17:1"
},
"nodeType": "YulFunctionCall",
"src": "1099:20:1"
},
"variableNames": [
{
"name": "y",
"nodeType": "YulIdentifier",
"src": "1094:1:1"
}
]
},
{
"body": {
"nodeType": "YulBlock",
"src": "1257:22:1",
"statements": [
{
"expression": {
"arguments": [],
"functionName": {
"name": "panic_error_0x11",
"nodeType": "YulIdentifier",
"src": "1259:16:1"
},
"nodeType": "YulFunctionCall",
"src": "1259:18:1"
},
"nodeType": "YulExpressionStatement",
"src": "1259:18:1"
}
]
},
"condition": {
"arguments": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "1178:1:1"
},
{
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1185:66:1",
"type": "",
"value": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
},
{
"name": "y",
"nodeType": "YulIdentifier",
"src": "1253:1:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "1181:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1181:74:1"
}
],
"functionName": {
"name": "gt",
"nodeType": "YulIdentifier",
"src": "1175:2:1"
},
"nodeType": "YulFunctionCall",
"src": "1175:81:1"
},
"nodeType": "YulIf",
"src": "1172:2:1"
},
{
"nodeType": "YulAssignment",
"src": "1289:16:1",
"value": {
"arguments": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "1300:1:1"
},
{
"name": "y",
"nodeType": "YulIdentifier",
"src": "1303:1:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1296:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1296:9:1"
},
"variableNames": [
{
"name": "sum",
"nodeType": "YulIdentifier",
"src": "1289:3:1"
}
]
}
]
},
"name": "checked_add_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "x",
"nodeType": "YulTypedName",
"src": "1037:1:1",
"type": ""
},
{
"name": "y",
"nodeType": "YulTypedName",
"src": "1040:1:1",
"type": ""
}
],
"returnVariables": [
{
"name": "sum",
"nodeType": "YulTypedName",
"src": "1046:3:1",
"type": ""
}
],
"src": "1006:305:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1362:51:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1372:35:1",
"value": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1401:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint160",
"nodeType": "YulIdentifier",
"src": "1383:17:1"
},
"nodeType": "YulFunctionCall",
"src": "1383:24:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "1372:7:1"
}
]
}
]
},
"name": "cleanup_t_address",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1344:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "1354:7:1",
"type": ""
}
],
"src": "1317:96:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1464:81:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1474:65:1",
"value": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1489:5:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1496:42:1",
"type": "",
"value": "0xffffffffffffffffffffffffffffffffffffffff"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "1485:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1485:54:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "1474:7:1"
}
]
}
]
},
"name": "cleanup_t_uint160",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1446:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "1456:7:1",
"type": ""
}
],
"src": "1419:126:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1596:32:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1606:16:1",
"value": {
"name": "value",
"nodeType": "YulIdentifier",
"src": "1617:5:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "1606:7:1"
}
]
}
]
},
"name": "cleanup_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1578:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "1588:7:1",
"type": ""
}
],
"src": "1551:77:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1662:152:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1679:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1682:77:1",
"type": "",
"value": "35408467139433450592217433187231851964531694900788300625387963629091585785856"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1672:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1672:88:1"
},
"nodeType": "YulExpressionStatement",
"src": "1672:88:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1776:1:1",
"type": "",
"value": "4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1779:4:1",
"type": "",
"value": "0x11"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1769:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1769:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "1769:15:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1800:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1803:4:1",
"type": "",
"value": "0x24"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "1793:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1793:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "1793:15:1"
}
]
},
"name": "panic_error_0x11",
"nodeType": "YulFunctionDefinition",
"src": "1634:180:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1863:79:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "1920:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1929:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1932:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "1922:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1922:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "1922:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1886:5:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1911:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "1893:17:1"
},
"nodeType": "YulFunctionCall",
"src": "1893:24:1"
}
],
"functionName": {
"name": "eq",
"nodeType": "YulIdentifier",
"src": "1883:2:1"
},
"nodeType": "YulFunctionCall",
"src": "1883:35:1"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "1876:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1876:43:1"
},
"nodeType": "YulIf",
"src": "1873:2:1"
}
]
},
"name": "validator_revert_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1856:5:1",
"type": ""
}
],
"src": "1820:122:1"
}
]
},
"contents": "{\n\n function abi_decode_t_uint256(offset, end) -> value {\n value := calldataload(offset)\n validator_revert_t_uint256(value)\n }\n\n function abi_decode_tuple_t_uint256(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_uint256(add(headStart, offset), dataEnd)\n }\n\n }\n\n function abi_encode_t_address_to_t_address_fromStack(value, pos) {\n mstore(pos, cleanup_t_address(value))\n }\n\n function abi_encode_t_uint256_to_t_uint256_fromStack(value, pos) {\n mstore(pos, cleanup_t_uint256(value))\n }\n\n function abi_encode_tuple_t_address_t_uint256__to_t_address_t_uint256__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_uint256_to_t_uint256_fromStack(value1, add(headStart, 32))\n\n }\n\n function checked_add_t_uint256(x, y) -> sum {\n x := cleanup_t_uint256(x)\n y := cleanup_t_uint256(y)\n\n // overflow, if x > (maxValue - y)\n if gt(x, sub(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, y)) { panic_error_0x11() }\n\n sum := add(x, y)\n }\n\n function cleanup_t_address(value) -> cleaned {\n cleaned := cleanup_t_uint160(value)\n }\n\n function cleanup_t_uint160(value) -> cleaned {\n cleaned := and(value, 0xffffffffffffffffffffffffffffffffffffffff)\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function panic_error_0x11() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n\n function validator_revert_t_uint256(value) {\n if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }\n }\n\n}\n",
"id": 1,
"language": "Yul",
"name": "#utility.yul"
}
],
"immutableReferences": {},
"linkReferences": {},
"object": "608060405234801561001057600080fd5b50600436106100365760003560e01c80630912f2321461003b5780637da1365e14610057575b600080fd5b610055600480360381019061005091906100dc565b610076565b005b61005f610095565b60405161006d929190610123565b60405180910390f35b806000600101600082825461008b919061014c565b9250508190555050565b60008060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154905082565b6000813590506100d68161020d565b92915050565b6000602082840312156100ee57600080fd5b60006100fc848285016100c7565b91505092915050565b61010e816101a2565b82525050565b61011d816101d4565b82525050565b60006040820190506101386000830185610105565b6101456020830184610114565b9392505050565b6000610157826101d4565b9150610162836101d4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610197576101966101de565b5b828201905092915050565b60006101ad826101b4565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b610216816101d4565b811461022157600080fd5b5056fea26469706673582212209e22121cbe6ed7c2dc030bbc489e7d0b9517769312cebbef1ea6016e7543415c64736f6c63430008040033",
"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 0x912F232 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x7DA1365E 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 0xDC JUMP JUMPDEST PUSH2 0x76 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x5F PUSH2 0x95 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x6D SWAP3 SWAP2 SWAP1 PUSH2 0x123 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST DUP1 PUSH1 0x0 PUSH1 0x1 ADD PUSH1 0x0 DUP3 DUP3 SLOAD PUSH2 0x8B SWAP2 SWAP1 PUSH2 0x14C JUMP JUMPDEST SWAP3 POP POP DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP1 PUSH1 0x1 ADD SLOAD SWAP1 POP DUP3 JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xD6 DUP2 PUSH2 0x20D JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xEE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0xFC DUP5 DUP3 DUP6 ADD PUSH2 0xC7 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x10E DUP2 PUSH2 0x1A2 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x11D DUP2 PUSH2 0x1D4 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 DUP3 ADD SWAP1 POP PUSH2 0x138 PUSH1 0x0 DUP4 ADD DUP6 PUSH2 0x105 JUMP JUMPDEST PUSH2 0x145 PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x114 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x157 DUP3 PUSH2 0x1D4 JUMP JUMPDEST SWAP2 POP PUSH2 0x162 DUP4 PUSH2 0x1D4 JUMP JUMPDEST SWAP3 POP DUP3 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SUB DUP3 GT ISZERO PUSH2 0x197 JUMPI PUSH2 0x196 PUSH2 0x1DE JUMP JUMPDEST JUMPDEST DUP3 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1AD DUP3 PUSH2 0x1B4 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH2 0x216 DUP2 PUSH2 0x1D4 JUMP JUMPDEST DUP2 EQ PUSH2 0x221 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 SWAP15 0x22 SLT SHR 0xBE PUSH15 0xD7C2DC030BBC489E7D0B9517769312 0xCE 0xBB 0xEF 0x1E 0xA6 ADD PUSH15 0x7543415C64736F6C63430008040033 ",
"sourceMap": "34:306:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;255:83;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;131:113;;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;255:83;322:9;308:3;:10;;;:23;;;;;;;:::i;:::-;;;;;;;;255:83;:::o;131:113::-;;;;;;;;;;;;;;;;;;;;;;;:::o;7:139:1:-;53:5;91:6;78:20;69:29;;107:33;134:5;107:33;:::i;:::-;59:87;;;;:::o;152:262::-;211:6;260:2;248:9;239:7;235:23;231:32;228:2;;;276:1;273;266:12;228:2;319:1;344:53;389:7;380:6;369:9;365:22;344:53;:::i;:::-;334:63;;290:117;218:196;;;;:::o;420:118::-;507:24;525:5;507:24;:::i;:::-;502:3;495:37;485:53;;:::o;544:118::-;631:24;649:5;631:24;:::i;:::-;626:3;619:37;609:53;;:::o;668:332::-;789:4;827:2;816:9;812:18;804:26;;840:71;908:1;897:9;893:17;884:6;840:71;:::i;:::-;921:72;989:2;978:9;974:18;965:6;921:72;:::i;:::-;794:206;;;;;:::o;1006:305::-;1046:3;1065:20;1083:1;1065:20;:::i;:::-;1060:25;;1099:20;1117:1;1099:20;:::i;:::-;1094:25;;1253:1;1185:66;1181:74;1178:1;1175:81;1172:2;;;1259:18;;:::i;:::-;1172:2;1303:1;1300;1296:9;1289:16;;1050:261;;;;:::o;1317:96::-;1354:7;1383:24;1401:5;1383:24;:::i;:::-;1372:35;;1362:51;;;:::o;1419:126::-;1456:7;1496:42;1489:5;1485:54;1474:65;;1464:81;;;:::o;1551:77::-;1588:7;1617:5;1606:16;;1596:32;;;:::o;1634:180::-;1682:77;1679:1;1672:88;1779:4;1776:1;1769:15;1803:4;1800:1;1793:15;1820:122;1893:24;1911:5;1893:24;:::i;:::-;1886:5;1883:35;1873:2;;1932:1;1929;1922:12;1873:2;1863:79;:::o"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "120400",
"executionCost": "41131",
"totalCost": "161531"
},
"external": {
"acc()": "2140",
"addAmount(uint256)": "infinite"
}
},
"methodIdentifiers": {
"acc()": "7da1365e",
"addAmount(uint256)": "0912f232"
}
},
"abi": [
{
"inputs": [],
"name": "acc",
"outputs": [
{
"internalType": "address",
"name": "addr",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_addMoney",
"type": "uint256"
}
],
"name": "addAmount",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.4+commit.c7e474f2"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [],
"name": "acc",
"outputs": [
{
"internalType": "address",
"name": "addr",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_addMoney",
"type": "uint256"
}
],
"name": "addAmount",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/4_Structs.sol": "Struct"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"contracts/4_Structs.sol": {
"keccak256": "0x139dee078ae9bb8bf49444a2a13f591832676d9b496d1c5e1db61e99051cc18c",
"urls": [
"bzz-raw://a60a898efbdf97b2bafc273ae43f6a1ad7740d5dec1cf860d8f0a46a9d02b2db",
"dweb:/ipfs/QmdbmkhAfFXMuzc6kssXpYv681tw7A3EhPaHsXAvv84U37"
]
}
},
"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": {
"generatedSources": [],
"linkReferences": {},
"object": "60806040526040518060400160405280735b38da6a701c568545dcfcb03fcb875f56beddc473ffffffffffffffffffffffffffffffffffffffff16815260200160328152506000808201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015550503480156100a457600080fd5b5061025a806100b46000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80630912f2321461003b5780637da1365e14610057575b600080fd5b610055600480360381019061005091906100dc565b610076565b005b61005f610095565b60405161006d929190610123565b60405180910390f35b806000600101600082825461008b919061014c565b9250508190555050565b60008060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154905082565b6000813590506100d68161020d565b92915050565b6000602082840312156100ee57600080fd5b60006100fc848285016100c7565b91505092915050565b61010e816101a2565b82525050565b61011d816101d4565b82525050565b60006040820190506101386000830185610105565b6101456020830184610114565b9392505050565b6000610157826101d4565b9150610162836101d4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610197576101966101de565b5b828201905092915050565b60006101ad826101b4565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b610216816101d4565b811461022157600080fd5b5056fea2646970667358221220c2d80d0e62afdcb2fcdbb32e6317f6e8477f339b1beb6bf830ed605f3c8fecf864736f6c63430008040033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH20 0x5B38DA6A701C568545DCFCB03FCB875F56BEDDC4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x32 DUP2 MSTORE POP PUSH1 0x0 DUP1 DUP3 ADD MLOAD DUP2 PUSH1 0x0 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x20 DUP3 ADD MLOAD DUP2 PUSH1 0x1 ADD SSTORE POP POP CALLVALUE DUP1 ISZERO PUSH2 0xA4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x25A DUP1 PUSH2 0xB4 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 0x912F232 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x7DA1365E 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 0xDC JUMP JUMPDEST PUSH2 0x76 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x5F PUSH2 0x95 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x6D SWAP3 SWAP2 SWAP1 PUSH2 0x123 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST DUP1 PUSH1 0x0 PUSH1 0x1 ADD PUSH1 0x0 DUP3 DUP3 SLOAD PUSH2 0x8B SWAP2 SWAP1 PUSH2 0x14C JUMP JUMPDEST SWAP3 POP POP DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP1 PUSH1 0x1 ADD SLOAD SWAP1 POP DUP3 JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xD6 DUP2 PUSH2 0x20D JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xEE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0xFC DUP5 DUP3 DUP6 ADD PUSH2 0xC7 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x10E DUP2 PUSH2 0x1A2 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x11D DUP2 PUSH2 0x1D4 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 DUP3 ADD SWAP1 POP PUSH2 0x138 PUSH1 0x0 DUP4 ADD DUP6 PUSH2 0x105 JUMP JUMPDEST PUSH2 0x145 PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x114 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x157 DUP3 PUSH2 0x1D4 JUMP JUMPDEST SWAP2 POP PUSH2 0x162 DUP4 PUSH2 0x1D4 JUMP JUMPDEST SWAP3 POP DUP3 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SUB DUP3 GT ISZERO PUSH2 0x197 JUMPI PUSH2 0x196 PUSH2 0x1DE JUMP JUMPDEST JUMPDEST DUP3 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1AD DUP3 PUSH2 0x1B4 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH2 0x216 DUP2 PUSH2 0x1D4 JUMP JUMPDEST DUP2 EQ PUSH2 0x221 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xC2 0xD8 0xD 0xE PUSH3 0xAFDCB2 0xFC 0xDB 0xB3 0x2E PUSH4 0x17F6E847 PUSH32 0x339B1BEB6BF830ED605F3C8FECF864736F6C6343000804003300000000000000 ",
"sourceMap": "34:307:0:-:0;;;153:92;;;;;;;;176:42;153:92;;;;;;236:2;153:92;;;132:113;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;34:307;;;;;;;;;;;;;;;;"
},
"deployedBytecode": {
"generatedSources": [
{
"ast": {
"nodeType": "YulBlock",
"src": "0:1945:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "59:87:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "69:29:1",
"value": {
"arguments": [
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "91:6:1"
}
],
"functionName": {
"name": "calldataload",
"nodeType": "YulIdentifier",
"src": "78:12:1"
},
"nodeType": "YulFunctionCall",
"src": "78:20:1"
},
"variableNames": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "69:5:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "134:5:1"
}
],
"functionName": {
"name": "validator_revert_t_uint256",
"nodeType": "YulIdentifier",
"src": "107:26:1"
},
"nodeType": "YulFunctionCall",
"src": "107:33:1"
},
"nodeType": "YulExpressionStatement",
"src": "107:33:1"
}
]
},
"name": "abi_decode_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "37:6:1",
"type": ""
},
{
"name": "end",
"nodeType": "YulTypedName",
"src": "45:3:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "53:5:1",
"type": ""
}
],
"src": "7:139:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "218:196:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "264:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "273:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "276:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "266:6:1"
},
"nodeType": "YulFunctionCall",
"src": "266:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "266:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "239:7:1"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "248:9:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "235:3:1"
},
"nodeType": "YulFunctionCall",
"src": "235:23:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "260:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "slt",
"nodeType": "YulIdentifier",
"src": "231:3:1"
},
"nodeType": "YulFunctionCall",
"src": "231:32:1"
},
"nodeType": "YulIf",
"src": "228:2:1"
},
{
"nodeType": "YulBlock",
"src": "290:117:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "305:15:1",
"value": {
"kind": "number",
"nodeType": "YulLiteral",
"src": "319:1:1",
"type": "",
"value": "0"
},
"variables": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "309:6:1",
"type": ""
}
]
},
{
"nodeType": "YulAssignment",
"src": "334:63:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "369:9:1"
},
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "380:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "365:3:1"
},
"nodeType": "YulFunctionCall",
"src": "365:22:1"
},
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "389:7:1"
}
],
"functionName": {
"name": "abi_decode_t_uint256",
"nodeType": "YulIdentifier",
"src": "344:20:1"
},
"nodeType": "YulFunctionCall",
"src": "344:53:1"
},
"variableNames": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "334:6:1"
}
]
}
]
}
]
},
"name": "abi_decode_tuple_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "188:9:1",
"type": ""
},
{
"name": "dataEnd",
"nodeType": "YulTypedName",
"src": "199:7:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "211:6:1",
"type": ""
}
],
"src": "152:262:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "485:53:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "502:3:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "525:5:1"
}
],
"functionName": {
"name": "cleanup_t_address",
"nodeType": "YulIdentifier",
"src": "507:17:1"
},
"nodeType": "YulFunctionCall",
"src": "507:24:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "495:6:1"
},
"nodeType": "YulFunctionCall",
"src": "495:37:1"
},
"nodeType": "YulExpressionStatement",
"src": "495:37:1"
}
]
},
"name": "abi_encode_t_address_to_t_address_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "473:5:1",
"type": ""
},
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "480:3:1",
"type": ""
}
],
"src": "420:118:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "609:53:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "626:3:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "649:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "631:17:1"
},
"nodeType": "YulFunctionCall",
"src": "631:24:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "619:6:1"
},
"nodeType": "YulFunctionCall",
"src": "619:37:1"
},
"nodeType": "YulExpressionStatement",
"src": "619:37:1"
}
]
},
"name": "abi_encode_t_uint256_to_t_uint256_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "597:5:1",
"type": ""
},
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "604:3:1",
"type": ""
}
],
"src": "544:118:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "794:206:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "804:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "816:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "827:2:1",
"type": "",
"value": "64"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "812:3:1"
},
"nodeType": "YulFunctionCall",
"src": "812:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "804:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "884:6:1"
},
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "897:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "908:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "893:3:1"
},
"nodeType": "YulFunctionCall",
"src": "893:17:1"
}
],
"functionName": {
"name": "abi_encode_t_address_to_t_address_fromStack",
"nodeType": "YulIdentifier",
"src": "840:43:1"
},
"nodeType": "YulFunctionCall",
"src": "840:71:1"
},
"nodeType": "YulExpressionStatement",
"src": "840:71:1"
},
{
"expression": {
"arguments": [
{
"name": "value1",
"nodeType": "YulIdentifier",
"src": "965:6:1"
},
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "978:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "989:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "974:3:1"
},
"nodeType": "YulFunctionCall",
"src": "974:18:1"
}
],
"functionName": {
"name": "abi_encode_t_uint256_to_t_uint256_fromStack",
"nodeType": "YulIdentifier",
"src": "921:43:1"
},
"nodeType": "YulFunctionCall",
"src": "921:72:1"
},
"nodeType": "YulExpressionStatement",
"src": "921:72:1"
}
]
},
"name": "abi_encode_tuple_t_address_t_uint256__to_t_address_t_uint256__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "758:9:1",
"type": ""
},
{
"name": "value1",
"nodeType": "YulTypedName",
"src": "770:6:1",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "778:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "789:4:1",
"type": ""
}
],
"src": "668:332:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1050:261:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1060:25:1",
"value": {
"arguments": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "1083:1:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "1065:17:1"
},
"nodeType": "YulFunctionCall",
"src": "1065:20:1"
},
"variableNames": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "1060:1:1"
}
]
},
{
"nodeType": "YulAssignment",
"src": "1094:25:1",
"value": {
"arguments": [
{
"name": "y",
"nodeType": "YulIdentifier",
"src": "1117:1:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "1099:17:1"
},
"nodeType": "YulFunctionCall",
"src": "1099:20:1"
},
"variableNames": [
{
"name": "y",
"nodeType": "YulIdentifier",
"src": "1094:1:1"
}
]
},
{
"body": {
"nodeType": "YulBlock",
"src": "1257:22:1",
"statements": [
{
"expression": {
"arguments": [],
"functionName": {
"name": "panic_error_0x11",
"nodeType": "YulIdentifier",
"src": "1259:16:1"
},
"nodeType": "YulFunctionCall",
"src": "1259:18:1"
},
"nodeType": "YulExpressionStatement",
"src": "1259:18:1"
}
]
},
"condition": {
"arguments": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "1178:1:1"
},
{
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1185:66:1",
"type": "",
"value": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
},
{
"name": "y",
"nodeType": "YulIdentifier",
"src": "1253:1:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "1181:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1181:74:1"
}
],
"functionName": {
"name": "gt",
"nodeType": "YulIdentifier",
"src": "1175:2:1"
},
"nodeType": "YulFunctionCall",
"src": "1175:81:1"
},
"nodeType": "YulIf",
"src": "1172:2:1"
},
{
"nodeType": "YulAssignment",
"src": "1289:16:1",
"value": {
"arguments": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "1300:1:1"
},
{
"name": "y",
"nodeType": "YulIdentifier",
"src": "1303:1:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1296:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1296:9:1"
},
"variableNames": [
{
"name": "sum",
"nodeType": "YulIdentifier",
"src": "1289:3:1"
}
]
}
]
},
"name": "checked_add_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "x",
"nodeType": "YulTypedName",
"src": "1037:1:1",
"type": ""
},
{
"name": "y",
"nodeType": "YulTypedName",
"src": "1040:1:1",
"type": ""
}
],
"returnVariables": [
{
"name": "sum",
"nodeType": "YulTypedName",
"src": "1046:3:1",
"type": ""
}
],
"src": "1006:305:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1362:51:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1372:35:1",
"value": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1401:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint160",
"nodeType": "YulIdentifier",
"src": "1383:17:1"
},
"nodeType": "YulFunctionCall",
"src": "1383:24:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "1372:7:1"
}
]
}
]
},
"name": "cleanup_t_address",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1344:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "1354:7:1",
"type": ""
}
],
"src": "1317:96:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1464:81:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1474:65:1",
"value": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1489:5:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1496:42:1",
"type": "",
"value": "0xffffffffffffffffffffffffffffffffffffffff"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "1485:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1485:54:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "1474:7:1"
}
]
}
]
},
"name": "cleanup_t_uint160",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1446:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "1456:7:1",
"type": ""
}
],
"src": "1419:126:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1596:32:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1606:16:1",
"value": {
"name": "value",
"nodeType": "YulIdentifier",
"src": "1617:5:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "1606:7:1"
}
]
}
]
},
"name": "cleanup_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1578:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "1588:7:1",
"type": ""
}
],
"src": "1551:77:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1662:152:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1679:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1682:77:1",
"type": "",
"value": "35408467139433450592217433187231851964531694900788300625387963629091585785856"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1672:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1672:88:1"
},
"nodeType": "YulExpressionStatement",
"src": "1672:88:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1776:1:1",
"type": "",
"value": "4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1779:4:1",
"type": "",
"value": "0x11"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1769:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1769:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "1769:15:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1800:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1803:4:1",
"type": "",
"value": "0x24"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "1793:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1793:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "1793:15:1"
}
]
},
"name": "panic_error_0x11",
"nodeType": "YulFunctionDefinition",
"src": "1634:180:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1863:79:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "1920:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1929:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1932:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "1922:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1922:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "1922:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1886:5:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1911:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "1893:17:1"
},
"nodeType": "YulFunctionCall",
"src": "1893:24:1"
}
],
"functionName": {
"name": "eq",
"nodeType": "YulIdentifier",
"src": "1883:2:1"
},
"nodeType": "YulFunctionCall",
"src": "1883:35:1"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "1876:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1876:43:1"
},
"nodeType": "YulIf",
"src": "1873:2:1"
}
]
},
"name": "validator_revert_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1856:5:1",
"type": ""
}
],
"src": "1820:122:1"
}
]
},
"contents": "{\n\n function abi_decode_t_uint256(offset, end) -> value {\n value := calldataload(offset)\n validator_revert_t_uint256(value)\n }\n\n function abi_decode_tuple_t_uint256(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_uint256(add(headStart, offset), dataEnd)\n }\n\n }\n\n function abi_encode_t_address_to_t_address_fromStack(value, pos) {\n mstore(pos, cleanup_t_address(value))\n }\n\n function abi_encode_t_uint256_to_t_uint256_fromStack(value, pos) {\n mstore(pos, cleanup_t_uint256(value))\n }\n\n function abi_encode_tuple_t_address_t_uint256__to_t_address_t_uint256__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_uint256_to_t_uint256_fromStack(value1, add(headStart, 32))\n\n }\n\n function checked_add_t_uint256(x, y) -> sum {\n x := cleanup_t_uint256(x)\n y := cleanup_t_uint256(y)\n\n // overflow, if x > (maxValue - y)\n if gt(x, sub(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, y)) { panic_error_0x11() }\n\n sum := add(x, y)\n }\n\n function cleanup_t_address(value) -> cleaned {\n cleaned := cleanup_t_uint160(value)\n }\n\n function cleanup_t_uint160(value) -> cleaned {\n cleaned := and(value, 0xffffffffffffffffffffffffffffffffffffffff)\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function panic_error_0x11() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n\n function validator_revert_t_uint256(value) {\n if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }\n }\n\n}\n",
"id": 1,
"language": "Yul",
"name": "#utility.yul"
}
],
"immutableReferences": {},
"linkReferences": {},
"object": "608060405234801561001057600080fd5b50600436106100365760003560e01c80630912f2321461003b5780637da1365e14610057575b600080fd5b610055600480360381019061005091906100dc565b610076565b005b61005f610095565b60405161006d929190610123565b60405180910390f35b806000600101600082825461008b919061014c565b9250508190555050565b60008060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154905082565b6000813590506100d68161020d565b92915050565b6000602082840312156100ee57600080fd5b60006100fc848285016100c7565b91505092915050565b61010e816101a2565b82525050565b61011d816101d4565b82525050565b60006040820190506101386000830185610105565b6101456020830184610114565b9392505050565b6000610157826101d4565b9150610162836101d4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610197576101966101de565b5b828201905092915050565b60006101ad826101b4565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b610216816101d4565b811461022157600080fd5b5056fea2646970667358221220c2d80d0e62afdcb2fcdbb32e6317f6e8477f339b1beb6bf830ed605f3c8fecf864736f6c63430008040033",
"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 0x912F232 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x7DA1365E 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 0xDC JUMP JUMPDEST PUSH2 0x76 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x5F PUSH2 0x95 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x6D SWAP3 SWAP2 SWAP1 PUSH2 0x123 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST DUP1 PUSH1 0x0 PUSH1 0x1 ADD PUSH1 0x0 DUP3 DUP3 SLOAD PUSH2 0x8B SWAP2 SWAP1 PUSH2 0x14C JUMP JUMPDEST SWAP3 POP POP DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP1 PUSH1 0x1 ADD SLOAD SWAP1 POP DUP3 JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xD6 DUP2 PUSH2 0x20D JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xEE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0xFC DUP5 DUP3 DUP6 ADD PUSH2 0xC7 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x10E DUP2 PUSH2 0x1A2 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x11D DUP2 PUSH2 0x1D4 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 DUP3 ADD SWAP1 POP PUSH2 0x138 PUSH1 0x0 DUP4 ADD DUP6 PUSH2 0x105 JUMP JUMPDEST PUSH2 0x145 PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x114 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x157 DUP3 PUSH2 0x1D4 JUMP JUMPDEST SWAP2 POP PUSH2 0x162 DUP4 PUSH2 0x1D4 JUMP JUMPDEST SWAP3 POP DUP3 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SUB DUP3 GT ISZERO PUSH2 0x197 JUMPI PUSH2 0x196 PUSH2 0x1DE JUMP JUMPDEST JUMPDEST DUP3 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1AD DUP3 PUSH2 0x1B4 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH2 0x216 DUP2 PUSH2 0x1D4 JUMP JUMPDEST DUP2 EQ PUSH2 0x221 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xC2 0xD8 0xD 0xE PUSH3 0xAFDCB2 0xFC 0xDB 0xB3 0x2E PUSH4 0x17F6E847 PUSH32 0x339B1BEB6BF830ED605F3C8FECF864736F6C6343000804003300000000000000 ",
"sourceMap": "34:307:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;256:83;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;132:113;;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;256:83;323:9;309:3;:10;;;:23;;;;;;;:::i;:::-;;;;;;;;256:83;:::o;132:113::-;;;;;;;;;;;;;;;;;;;;;;;:::o;7:139:1:-;53:5;91:6;78:20;69:29;;107:33;134:5;107:33;:::i;:::-;59:87;;;;:::o;152:262::-;211:6;260:2;248:9;239:7;235:23;231:32;228:2;;;276:1;273;266:12;228:2;319:1;344:53;389:7;380:6;369:9;365:22;344:53;:::i;:::-;334:63;;290:117;218:196;;;;:::o;420:118::-;507:24;525:5;507:24;:::i;:::-;502:3;495:37;485:53;;:::o;544:118::-;631:24;649:5;631:24;:::i;:::-;626:3;619:37;609:53;;:::o;668:332::-;789:4;827:2;816:9;812:18;804:26;;840:71;908:1;897:9;893:17;884:6;840:71;:::i;:::-;921:72;989:2;978:9;974:18;965:6;921:72;:::i;:::-;794:206;;;;;:::o;1006:305::-;1046:3;1065:20;1083:1;1065:20;:::i;:::-;1060:25;;1099:20;1117:1;1099:20;:::i;:::-;1094:25;;1253:1;1185:66;1181:74;1178:1;1175:81;1172:2;;;1259:18;;:::i;:::-;1172:2;1303:1;1300;1296:9;1289:16;;1050:261;;;;:::o;1317:96::-;1354:7;1383:24;1401:5;1383:24;:::i;:::-;1372:35;;1362:51;;;:::o;1419:126::-;1456:7;1496:42;1489:5;1485:54;1474:65;;1464:81;;;:::o;1551:77::-;1588:7;1617:5;1606:16;;1596:32;;;:::o;1634:180::-;1682:77;1679:1;1672:88;1779:4;1776:1;1769:15;1803:4;1800:1;1793:15;1820:122;1893:24;1911:5;1893:24;:::i;:::-;1886:5;1883:35;1873:2;;1932:1;1929;1922:12;1873:2;1863:79;:::o"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "120400",
"executionCost": "41131",
"totalCost": "161531"
},
"external": {
"acc()": "2140",
"addAmount(uint256)": "infinite"
}
},
"methodIdentifiers": {
"acc()": "7da1365e",
"addAmount(uint256)": "0912f232"
}
},
"abi": [
{
"inputs": [],
"name": "acc",
"outputs": [
{
"internalType": "address",
"name": "addr",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_addMoney",
"type": "uint256"
}
],
"name": "addAmount",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.4+commit.c7e474f2"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [],
"name": "acc",
"outputs": [
{
"internalType": "address",
"name": "addr",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_addMoney",
"type": "uint256"
}
],
"name": "addAmount",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/4_Structs.sol": "Structs"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"contracts/4_Structs.sol": {
"keccak256": "0x886449263dca168c15df85803915561f3cf477f6d4cb5b43230882ed05a59d4c",
"urls": [
"bzz-raw://cf039e1a8a54d49ca5bf5ab83580e1444b134541c16917458afaf8fc778288a2",
"dweb:/ipfs/QmbPJmZKLv82gFm99917hUSRQUABYrMovMtnR5QeMkq4zH"
]
}
},
"version": 1
}
// this line is added to create a gist. Empty file is not allowed.
// 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