UNPKG

@alpsfinance/core

Version:

This is the official Alps Finance smart contract repository.

1,019 lines 339 kB
{ "contractName": "Airdrop", "abi": [ { "inputs": [ { "internalType": "address", "name": "_tokenAddress", "type": "address" }, { "internalType": "bytes32", "name": "_merkleRoot", "type": "bytes32" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "Claim", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "airdropClaimed", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "tokenAddress", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "getMerkleRoot", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "_newMerkleRoot", "type": "bytes32" } ], "name": "setMerkleRoot", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "bytes32[]", "name": "proof", "type": "bytes32[]" } ], "name": "claim", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.8.11+commit.d7f03943\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_tokenAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_merkleRoot\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Claim\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"airdropClaimed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32[]\",\"name\":\"proof\",\"type\":\"bytes32[]\"}],\"name\":\"claim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMerkleRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_newMerkleRoot\",\"type\":\"bytes32\"}],\"name\":\"setMerkleRoot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tokenAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"Claim(address,uint256)\":{\"params\":{\"amount\":\"of tokens claimed\",\"to\":\"recipient of claim\"}}},\"kind\":\"dev\",\"methods\":{\"claim(uint256,bytes32[])\":{\"params\":{\"amount\":\"of tokens owed to claimee\",\"proof\":\"merkle proof to prove address and amount are in tree\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"events\":{\"Claim(address,uint256)\":{\"notice\":\"Emitted after a successful token claim\"}},\"kind\":\"user\",\"methods\":{\"claim(uint256,bytes32[])\":{\"notice\":\"Allows claiming tokens if address is part of merkle tree\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/airdrop/Airdrop.sol\":\"Airdrop\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"keccak256\":\"0x24e0364e503a9bbde94c715d26573a76f14cd2a202d45f96f52134ab806b67b9\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://e12cbaa7378fd9b62280e4e1d164bedcb4399ce238f5f98fc0eefb7e50577981\",\"dweb:/ipfs/QmXRoFGUgfsaRkoPT5bxNMtSayKTQ8GZATLPXf69HcRA51\"]},\"@openzeppelin/contracts/security/ReentrancyGuard.sol\":{\"keccak256\":\"0x0e9621f60b2faabe65549f7ed0f24e8853a45c1b7990d47e8160e523683f3935\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://287a2f8d5814dd0f05f22b740f18ca8321acc21c9bd03a6cb2203ea626e2f3f2\",\"dweb:/ipfs/QmZRQv9iuwU817VuqkA2WweiaibKii69x9QxYBBEfbNEud\"]},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xbbc8ac883ac3c0078ce5ad3e288fbb3ffcc8a30c3a98c0fda0114d64fc44fca2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://87a7a5d2f6f63f84598af02b8c50ca2df2631cb8ba2453e8d95fcb17e4be9824\",\"dweb:/ipfs/QmR76hqtAcRqoFj33tmNjcWTLrgNsAaakYwnKZ8zoJtKei\"]},\"@openzeppelin/contracts/utils/Context.sol\":{\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6df0ddf21ce9f58271bdfaa85cde98b200ef242a05a3f85c2bc10a8294800a92\",\"dweb:/ipfs/QmRK2Y5Yc6BK7tGKkgsgn3aJEQGi5aakeSPZvS65PV8Xp3\"]},\"@openzeppelin/contracts/utils/cryptography/MerkleProof.sol\":{\"keccak256\":\"0xea64fbaccbf9d8c235cf6838240ddcebb97f9fc383660289e9dff32e4fb85f7a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://1e8a1dd0eac2fa865dc9a052bee01eec31677d7bc01b5b5aa825d820f3f1b343\",\"dweb:/ipfs/QmR8WuNeoAvJhnL7msQfQwaZEkwVnNyNDUNBL3Y616ohYa\"]},\"project:/contracts/airdrop/Airdrop.sol\":{\"keccak256\":\"0x21bb2e3710c5cac25dd8e5daf9283e83297a130bebb17c84e40cb7a0dd0ab1b0\",\"license\":\"AGPL-3.0\",\"urls\":[\"bzz-raw://3a485559d76b0fccc9196c67fb64fa736baecf6e23f72fb0542d53dae1f949b1\",\"dweb:/ipfs/QmUmwSAEAAh7GUSQRByYHegfVuRs1mZ1ieYF1DLP6DLoLj\"]},\"project:/contracts/token/interfaces/IERC20Custom.sol\":{\"keccak256\":\"0x6f50952568dc5b577661f6d1730b39cfa7628a39390103c89190afdfc565d1f4\",\"license\":\"AGPL-3.0\",\"urls\":[\"bzz-raw://480386fcd5b5e3456e80150bf5444f1b2b067746be0245f287b78fc03e81133a\",\"dweb:/ipfs/QmWBfMsjQPEKj7jav96428j8Ss4AUVtkj69nsVsPZb8E1S\"]}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b506040516108f73803806108f783398101604081905261002f916100b5565b61003833610065565b60018055600280546001600160a01b0319166001600160a01b0393909316929092179091556003556100ef565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080604083850312156100c857600080fd5b82516001600160a01b03811681146100df57600080fd5b6020939093015192949293505050565b6107f9806100fe6000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b146100d85780639d76ea58146100fd578063d1b6dd3014610110578063f2fde38b1461014357600080fd5b80632f52ebb71461008d57806349590657146100a2578063715018a6146100bd5780637cb64759146100c5575b600080fd5b6100a061009b366004610687565b610156565b005b6100aa61040f565b6040519081526020015b60405180910390f35b6100a0610441565b6100a06100d3366004610706565b610477565b6000546001600160a01b03165b6040516001600160a01b0390911681526020016100b4565b6002546100e5906001600160a01b031681565b61013361011e36600461071f565b60046020526000908152604090205460ff1681565b60405190151581526020016100b4565b6100a061015136600461071f565b610512565b600260015414156101ae5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002600155826102005760405162461bcd60e51b815260206004820152601c60248201527f41697264726f703a20416d6f756e742063616e6e6f742062652030210000000060448201526064016101a5565b3360009081526004602052604090205460ff161561026b5760405162461bcd60e51b815260206004820152602260248201527f41697264726f703a2041697264726f7020686173206265656e20636c61696d65604482015261642160f01b60648201526084016101a5565b6040516bffffffffffffffffffffffff193360601b1660208201526034810184905260009060540160405160208183030381529060405280519060200120905060006102ee8484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505060035491508590506105ad565b90508061034c5760405162461bcd60e51b815260206004820152602660248201527f41697264726f703a204164647265737320686173206e6f2041697264726f7020604482015265636c61696d2160d01b60648201526084016101a5565b33600081815260046020819052604091829020805460ff1916600117905560025491516340c10f1960e01b815290810192909252602482018790526001600160a01b03169081906340c10f1990604401600060405180830381600087803b1580156103b657600080fd5b505af11580156103ca573d6000803e3d6000fd5b50506040518881523392507f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d4915060200160405180910390a250506001805550505050565b600080546001600160a01b0316331461043a5760405162461bcd60e51b81526004016101a59061074f565b5060035490565b6000546001600160a01b0316331461046b5760405162461bcd60e51b81526004016101a59061074f565b61047560006105c3565b565b6000546001600160a01b031633146104a15760405162461bcd60e51b81526004016101a59061074f565b801515806104b157506003548114155b61050d5760405162461bcd60e51b815260206004820152602760248201527f41697264726f703a20496e76616c6964206e6577206d65726b6c6520726f6f746044820152662076616c75652160c81b60648201526084016101a5565b600355565b6000546001600160a01b0316331461053c5760405162461bcd60e51b81526004016101a59061074f565b6001600160a01b0381166105a15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101a5565b6105aa816105c3565b50565b6000826105ba8584610613565b14949350505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600081815b845181101561067f57600085828151811061063557610635610784565b6020026020010151905080831161065b576000838152602082905260409020925061066c565b600081815260208490526040902092505b50806106778161079a565b915050610618565b509392505050565b60008060006040848603121561069c57600080fd5b83359250602084013567ffffffffffffffff808211156106bb57600080fd5b818601915086601f8301126106cf57600080fd5b8135818111156106de57600080fd5b8760208260051b85010111156106f357600080fd5b6020830194508093505050509250925092565b60006020828403121561071857600080fd5b5035919050565b60006020828403121561073157600080fd5b81356001600160a01b038116811461074857600080fd5b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006000198214156107bc57634e487b7160e01b600052601160045260246000fd5b506001019056fea26469706673582212204644f2714cdeaeddb92a5f30fd442d2a1f95ce28de78e59b4ac93103652a02c964736f6c634300080b0033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b146100d85780639d76ea58146100fd578063d1b6dd3014610110578063f2fde38b1461014357600080fd5b80632f52ebb71461008d57806349590657146100a2578063715018a6146100bd5780637cb64759146100c5575b600080fd5b6100a061009b366004610687565b610156565b005b6100aa61040f565b6040519081526020015b60405180910390f35b6100a0610441565b6100a06100d3366004610706565b610477565b6000546001600160a01b03165b6040516001600160a01b0390911681526020016100b4565b6002546100e5906001600160a01b031681565b61013361011e36600461071f565b60046020526000908152604090205460ff1681565b60405190151581526020016100b4565b6100a061015136600461071f565b610512565b600260015414156101ae5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002600155826102005760405162461bcd60e51b815260206004820152601c60248201527f41697264726f703a20416d6f756e742063616e6e6f742062652030210000000060448201526064016101a5565b3360009081526004602052604090205460ff161561026b5760405162461bcd60e51b815260206004820152602260248201527f41697264726f703a2041697264726f7020686173206265656e20636c61696d65604482015261642160f01b60648201526084016101a5565b6040516bffffffffffffffffffffffff193360601b1660208201526034810184905260009060540160405160208183030381529060405280519060200120905060006102ee8484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505060035491508590506105ad565b90508061034c5760405162461bcd60e51b815260206004820152602660248201527f41697264726f703a204164647265737320686173206e6f2041697264726f7020604482015265636c61696d2160d01b60648201526084016101a5565b33600081815260046020819052604091829020805460ff1916600117905560025491516340c10f1960e01b815290810192909252602482018790526001600160a01b03169081906340c10f1990604401600060405180830381600087803b1580156103b657600080fd5b505af11580156103ca573d6000803e3d6000fd5b50506040518881523392507f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d4915060200160405180910390a250506001805550505050565b600080546001600160a01b0316331461043a5760405162461bcd60e51b81526004016101a59061074f565b5060035490565b6000546001600160a01b0316331461046b5760405162461bcd60e51b81526004016101a59061074f565b61047560006105c3565b565b6000546001600160a01b031633146104a15760405162461bcd60e51b81526004016101a59061074f565b801515806104b157506003548114155b61050d5760405162461bcd60e51b815260206004820152602760248201527f41697264726f703a20496e76616c6964206e6577206d65726b6c6520726f6f746044820152662076616c75652160c81b60648201526084016101a5565b600355565b6000546001600160a01b0316331461053c5760405162461bcd60e51b81526004016101a59061074f565b6001600160a01b0381166105a15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101a5565b6105aa816105c3565b50565b6000826105ba8584610613565b14949350505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600081815b845181101561067f57600085828151811061063557610635610784565b6020026020010151905080831161065b576000838152602082905260409020925061066c565b600081815260208490526040902092505b50806106778161079a565b915050610618565b509392505050565b60008060006040848603121561069c57600080fd5b83359250602084013567ffffffffffffffff808211156106bb57600080fd5b818601915086601f8301126106cf57600080fd5b8135818111156106de57600080fd5b8760208260051b85010111156106f357600080fd5b6020830194508093505050509250925092565b60006020828403121561071857600080fd5b5035919050565b60006020828403121561073157600080fd5b81356001600160a01b038116811461074857600080fd5b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006000198214156107bc57634e487b7160e01b600052601160045260246000fd5b506001019056fea26469706673582212204644f2714cdeaeddb92a5f30fd442d2a1f95ce28de78e59b4ac93103652a02c964736f6c634300080b0033", "immutableReferences": {}, "generatedSources": [ { "ast": { "nodeType": "YulBlock", "src": "0:367:56", "statements": [ { "nodeType": "YulBlock", "src": "6:3:56", "statements": [] }, { "body": { "nodeType": "YulBlock", "src": "112:253:56", "statements": [ { "body": { "nodeType": "YulBlock", "src": "158:16:56", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "167:1:56", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "170:1:56", "type": "", "value": "0" } ], "functionName": { "name": "revert", "nodeType": "YulIdentifier", "src": "160:6:56" }, "nodeType": "YulFunctionCall", "src": "160:12:56" }, "nodeType": "YulExpressionStatement", "src": "160:12:56" } ] }, "condition": { "arguments": [ { "arguments": [ { "name": "dataEnd", "nodeType": "YulIdentifier", "src": "133:7:56" }, { "name": "headStart", "nodeType": "YulIdentifier", "src": "142:9:56" } ], "functionName": { "name": "sub", "nodeType": "YulIdentifier", "src": "129:3:56" }, "nodeType": "YulFunctionCall", "src": "129:23:56" }, { "kind": "number", "nodeType": "YulLiteral", "src": "154:2:56", "type": "", "value": "64" } ], "functionName": { "name": "slt", "nodeType": "YulIdentifier", "src": "125:3:56" }, "nodeType": "YulFunctionCall", "src": "125:32:56" }, "nodeType": "YulIf", "src": "122:52:56" }, { "nodeType": "YulVariableDeclaration", "src": "183:29:56", "value": { "arguments": [ { "name": "headStart", "nodeType": "YulIdentifier", "src": "202:9:56" } ], "functionName": { "name": "mload", "nodeType": "YulIdentifier", "src": "196:5:56" }, "nodeType": "YulFunctionCall", "src": "196:16:56" }, "variables": [ { "name": "value", "nodeType": "YulTypedName", "src": "187:5:56", "type": "" } ] }, { "body": { "nodeType": "YulBlock", "src": "275:16:56", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "284:1:56", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "287:1:56", "type": "", "value": "0" } ], "functionName": { "name": "revert", "nodeType": "YulIdentifier", "src": "277:6:56" }, "nodeType": "YulFunctionCall", "src": "277:12:56" }, "nodeType": "YulExpressionStatement", "src": "277:12:56" } ] }, "condition": { "arguments": [ { "arguments": [ { "name": "value", "nodeType": "YulIdentifier", "src": "234:5:56" }, { "arguments": [ { "name": "value", "nodeType": "YulIdentifier", "src": "245:5:56" }, { "arguments": [ { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "260:3:56", "type": "", "value": "160" }, { "kind": "number", "nodeType": "YulLiteral", "src": "265:1:56", "type": "", "value": "1" } ], "functionName": { "name": "shl", "nodeType": "YulIdentifier", "src": "256:3:56" }, "nodeType": "YulFunctionCall", "src": "256:11:56" }, { "kind": "number", "nodeType": "YulLiteral", "src": "269:1:56", "type": "", "value": "1" } ], "functionName": { "name": "sub", "nodeType": "YulIdentifier", "src": "252:3:56" }, "nodeType": "YulFunctionCall", "src": "252:19:56" } ], "functionName": { "name": "and", "nodeType": "YulIdentifier", "src": "241:3:56" }, "nodeType": "YulFunctionCall", "src": "241:31:56" } ], "functionName": { "name": "eq", "nodeType": "YulIdentifier", "src": "231:2:56" }, "nodeType": "YulFunctionCall", "src": "231:42:56" } ], "functionName": { "name": "iszero", "nodeType": "YulIdentifier", "src": "224:6:56" }, "nodeType": "YulFunctionCall", "src": "224:50:56" }, "nodeType": "YulIf", "src": "221:70:56" }, { "nodeType": "YulAssignment", "src": "300:15:56", "value": { "name": "value", "nodeType": "YulIdentifier", "src": "310:5:56" }, "variableNames": [ { "name": "value0", "nodeType": "YulIdentifier", "src": "300:6:56" } ] }, { "nodeType": "YulAssignment", "src": "324:35:56", "value": { "arguments": [ { "arguments": [ { "name": "headStart", "nodeType": "YulIdentifier", "src": "344:9:56" }, { "kind": "number", "nodeType": "YulLiteral", "src": "355:2:56", "type": "", "value": "32" } ], "functionName": { "name": "add", "nodeType": "YulIdentifier", "src": "340:3:56" }, "nodeType": "YulFunctionCall", "src": "340:18:56" } ], "functionName": { "name": "mload", "nodeType": "YulIdentifier", "src": "334:5:56" }, "nodeType": "YulFunctionCall", "src": "334:25:56" }, "variableNames": [ { "name": "value1", "nodeType": "YulIdentifier", "src": "324:6:56" } ] } ] }, "name": "abi_decode_tuple_t_addresst_bytes32_fromMemory", "nodeType": "YulFunctionDefinition", "parameters": [ { "name": "headStart", "nodeType": "YulTypedName", "src": "70:9:56", "type": "" }, { "name": "dataEnd", "nodeType": "YulTypedName", "src": "81:7:56", "type": "" } ], "returnVariables": [ { "name": "value0", "nodeType": "YulTypedName", "src": "93:6:56", "type": "" }, { "name": "value1", "nodeType": "YulTypedName", "src": "101:6:56", "type": "" } ], "src": "14:351:56" } ] }, "contents": "{\n { }\n function abi_decode_tuple_t_addresst_bytes32_fromMemory(headStart, dataEnd) -> value0, value1\n {\n if slt(sub(dataEnd, headStart), 64) { revert(0, 0) }\n let value := mload(headStart)\n if iszero(eq(value, and(value, sub(shl(160, 1), 1)))) { revert(0, 0) }\n value0 := value\n value1 := mload(add(headStart, 32))\n }\n}", "id": 56, "language": "Yul", "name": "#utility.yul" } ], "deployedGeneratedSources": [ { "ast": { "nodeType": "YulBlock", "src": "0:5589:56", "statements": [ { "nodeType": "YulBlock", "src": "6:3:56", "statements": [] }, { "body": { "nodeType": "YulBlock", "src": "136:561:56", "statements": [ { "body": { "nodeType": "YulBlock", "src": "182:16:56", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "191:1:56", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "194:1:56", "type": "", "value": "0" } ], "functionName": { "name": "revert", "nodeType": "YulIdentifier", "src": "184:6:56" }, "nodeType": "YulFunctionCall", "src": "184:12:56" }, "nodeType": "YulExpressionStatement", "src": "184:12:56" } ] }, "condition": { "arguments": [ { "arguments": [ { "name": "dataEnd", "nodeType": "YulIdentifier", "src": "157:7:56" }, { "name": "headStart", "nodeType": "YulIdentifier", "src": "166:9:56" } ], "functionName": { "name": "sub", "nodeType": "YulIdentifier", "src": "153:3:56" }, "nodeType": "YulFunctionCall", "src": "153:23:56" }, { "kind": "number", "nodeType": "YulLiteral", "src": "178:2:56", "type": "", "value": "64" } ], "functionName": { "name": "slt", "nodeType": "YulIdentifier", "src": "149:3:56" }, "nodeType": "YulFunctionCall", "src": "149:32:56" }, "nodeType": "YulIf", "src": "146:52:56" }, { "nodeType": "YulAssignment", "src": "207:33:56", "value": { "arguments": [ { "name": "headStart", "nodeType": "YulIdentifier", "src": "230:9:56" } ], "functionName": { "name": "calldataload", "nodeType": "YulIdentifier", "src": "217:12:56" }, "nodeType": "YulFunctionCall", "src": "217:23:56" }, "variableNames": [ { "name": "value0", "nodeType": "YulIdentifier", "src": "207:6:56" } ] }, { "nodeType": "YulVariableDeclaration", "src": "249:46:56", "value": { "arguments": [ { "arguments": [ { "name": "headStart", "nodeType": "YulIdentifier", "src": "280:9:56" }, { "kind": "number", "nodeType": "YulLiteral", "src": "291:2:56", "type": "", "value": "32" } ], "functionName": { "name": "add", "nodeType": "YulIdentifier", "src": "276:3:56" }, "nodeType": "YulFunctionCall", "src": "276:18:56" } ], "functionName": { "name": "calldataload", "nodeType": "YulIdentifier", "src": "263:12:56" }, "nodeType": "YulFunctionCall", "src": "263:32:56" }, "variables": [ { "name": "offset", "nodeType": "YulTypedName", "src": "253:6:56", "type": "" } ] }, { "nodeType": "YulVariableDeclaration", "src": "304:28:56", "value": { "kind": "number", "nodeType": "YulLiteral", "src": "314:18:56", "type": "", "value": "0xffffffffffffffff" }, "variables": [ { "name": "_1", "nodeType": "YulTypedName", "src": "308:2:56", "type": "" } ] }, { "body": { "nodeType": "YulBlock", "src": "359:16:56", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "368:1:56", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "371:1:56", "type": "", "value": "0" } ], "functionName": { "name": "revert", "nodeType": "YulIdentifier", "src": "361:6:56" }, "nodeType": "YulFunctionCall", "src": "361:12:56" }, "nodeType": "YulExpressionStatement", "src": "361:12:56" } ] }, "condition": { "arguments": [ { "name": "offset", "nodeType": "YulIdentifier", "src": "347:6:56" }, { "name": "_1", "nodeType": "YulIdentifier", "src": "355:2:56" } ], "functionName": { "name": "gt", "nodeType": "YulIdentifier", "src": "344:2:56" }, "nodeType": "YulFunctionCall", "src": "344:14:56" }, "nodeType": "YulIf", "src": "341:34:56" }, { "nodeType": "YulVariableDeclaration", "src": "384:32:56", "value": { "arguments": [ { "name": "headStart", "nodeType": "YulIdentifier", "src": "398:9:56" }, { "name": "offset", "nodeType": "YulIdentifier", "src": "409:6:56" } ], "functionName": { "name": "add", "nodeType": "YulIdentifier", "src": "394:3:56" }, "nodeType": "YulFunctionCall", "src": "394:22:56" }, "variables": [ { "name": "_2", "nodeType": "YulTypedName", "src": "388:2:56", "type": "" } ] }, { "body": { "nodeType": "YulBlock", "src": "464:16:56", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "473:1:56", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "476:1:56", "type": "", "value": "0" } ], "functionName": { "name": "revert", "nodeType": "YulIdentifier", "src": "466:6:56" }, "nodeType": "YulFunctionCall", "src": "466:12:56" }, "nodeType": "YulExpressionStatement", "src": "466:12:56" } ] }, "condition": { "arguments": [ { "arguments": [ { "arguments": [ { "name": "_2", "nodeType": "YulIdentifier", "src": "443:2:56" }, { "kind": "number", "nodeType": "YulLiteral", "src": "447:4:56", "type": "", "value": "0x1f" } ], "functionName": { "name": "add", "nodeType": "YulIdentifier", "src": "439:3:56" }, "nodeType": "YulFunctionCall", "src": "439:13:56" }, { "name": "dataEnd", "nodeType": "YulIdentifier", "src": "454:7:56" } ], "functionName": { "name": "slt", "nodeType": "YulIdentifier", "src": "435:3:56" }, "nodeType": "YulFunctionCall", "src": "435:27:56" } ], "functionName": { "name": "iszero", "nodeType": "YulIdentifier", "src": "428:6:56" }, "nodeType": "YulFunctionCall", "src": "428:35:56" }, "nodeType": "YulIf", "src": "425:55:56" }, { "nodeType": "YulVariableDeclaration", "src": "489:30:56", "value": { "arguments": [ { "name": "_2", "nodeType": "YulIdentifier", "src": "516:2:56" } ], "functionName": { "name": "calldataload", "nodeType": "YulIdentifier", "src": "503:12:56" }, "nodeType": "YulFunctionCall", "src": "503:16:56" }, "variables": [ { "name": "length", "nodeType": "YulTypedName", "src": "493:6:56", "type": "" } ] }, { "body": { "nodeType": "YulBlock", "src": "546:16:56", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "555:1:56", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "558:1:56", "type": "", "value": "0" } ], "functionName": { "name": "revert", "nodeType": "YulIdentifier", "src": "548:6:56" }, "nodeType": "YulFunctionCall", "src": "548:12:56" }, "nodeType": "YulExpressionStatement", "src": "548:12:56" } ] }, "condition": { "arguments": [ { "name": "length", "nodeType": "YulIdentifier", "src": "534:6:56" }, { "name": "_1", "nodeType": "YulIdentifier", "src": "542:2:56" } ], "functionName": { "name": "gt", "nodeType": "YulIdentifier", "src": "531:2:56" }, "nodeType": "YulFunctionCall", "src": "531:14:56" }, "nodeType": "YulIf", "src": "528:34:56" }, { "body": { "nodeType": "YulBlock", "src": "620:16:56", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "629:1:56", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "632:1:56", "type": "", "value": "0" } ], "functionName": { "name": "revert", "nodeType": "YulIdentifier", "src": "622:6:56" }, "nodeType": "YulFunctionCall", "src": "622:12:56" }, "nodeType": "YulExpressionStatement", "src": "622:12:56" } ] }, "condition": { "arguments": [ { "arguments": [ { "