@ethsub/sol
Version:
ethsub contracts
489 lines • 302 kB
JSON
{
"contractName": "ERC20Handler",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "bridgeAddress",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "_bridgeAddress",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "_burnList",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "_contractWhitelist",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"name": "_resourceIDToTokenContractAddress",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "_tokenContractAddressToResourceID",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "contractAddress",
"type": "address"
}
],
"name": "setBurnable",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "resourceID",
"type": "bytes32"
},
{
"internalType": "address",
"name": "contractAddress",
"type": "address"
}
],
"name": "setResource",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "resourceID",
"type": "bytes32"
},
{
"internalType": "address",
"name": "depositer",
"type": "address"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "deposit",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "resourceID",
"type": "bytes32"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "executeProposal",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "withdraw",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.6.12+commit.27d51765\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"_bridgeAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"_burnList\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"_contractWhitelist\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"_resourceIDToTokenContractAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"_tokenContractAddressToResourceID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"resourceID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"depositer\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"deposit\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"resourceID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"executeProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"}],\"name\":\"setBurnable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"resourceID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"}],\"name\":\"setResource\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"ChainSafe Systems.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"bridgeAddress\":\"Contract address of previously deployed Bridge.\"}},\"deposit(bytes32,address,bytes)\":{\"details\":\"Depending if the corresponding {tokenAddress} for the parsed {resourceID} is marked true in {_burnList}, deposited tokens will be burned, if not, they will be locked.\",\"params\":{\"data\":\"Consists of {amount} padded to 32 bytes.\",\"depositer\":\"Address of account making the deposit in the Bridge contract.\",\"resourceID\":\"ResourceID used to find address of token to be used for deposit.\"},\"returns\":{\"_0\":\"an empty data.\"}},\"executeProposal(bytes32,bytes)\":{\"params\":{\"data\":\"Consists of {resourceID}, {amount}, {lenDestinationRecipientAddress}, and {destinationRecipientAddress} all padded to 32 bytes.\"}},\"setBurnable(address)\":{\"params\":{\"contractAddress\":\"Address of contract to be used when making or executing deposits.\"}},\"setResource(bytes32,address)\":{\"params\":{\"contractAddress\":\"Address of contract to be called when a deposit is made and a deposited is executed.\",\"resourceID\":\"ResourceID to be used when making deposits.\"}},\"withdraw(bytes)\":{\"params\":{\"data\":\"Consists of {tokenAddress}, {recipient}, and {amount} all padded to 32 bytes.\"}}},\"title\":\"Handles ERC20 deposits and deposit executions.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"deposit(bytes32,address,bytes)\":{\"notice\":\"A deposit is initiatied by making a deposit in the Bridge contract.Data passed into the function should be constructed as follows: amount uint256 bytes 0 - 32\"},\"executeProposal(bytes32,bytes)\":{\"notice\":\"Proposal execution should be initiated when a proposal is finalized in the Bridge contract. by a relayer on the deposit's destination chain.Data passed into the function should be constructed as follows: amount uint256 bytes 0 - 32 destinationRecipientAddress length uint256 bytes 32 - 64 destinationRecipientAddress bytes bytes 64 - END\"},\"setBurnable(address)\":{\"notice\":\"First verifies {contractAddress} is whitelisted, then sets {_burnList}[{contractAddress}] to true.\"},\"setResource(bytes32,address)\":{\"notice\":\"First verifies {_resourceIDToContractAddress}[{resourceID}] and {_contractAddressToResourceID}[{contractAddress}] are not already set, then sets {_resourceIDToContractAddress} with {contractAddress}, {_contractAddressToResourceID} with {resourceID}, and {_contractWhitelist} to true for {contractAddress}.\"},\"withdraw(bytes)\":{\"notice\":\"Used to manually release ERC20 tokens from ERC20Safe.Data passed into the function should be constructed as follows: tokenAddress address bytes 0 - 32 recipient address bytes 32 - 64 amount uint bytes 64 - 96\"}},\"notice\":\"This contract is intended to be used with the Bridge contract.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/handlers/ERC20Handler.sol\":\"ERC20Handler\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/AccessControl.sol\":{\"keccak256\":\"0x4fc155a2f7837603d69a13cfa481eb5e7f5e02cb77e2ec9edbac30986db37988\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://0855147e38b5e36288a8df73b8da49132f14ec7abb19041b0c98872263643aaa\",\"dweb:/ipfs/QmSrSysyFUYQq7hbJaJXG7EyZW6ezDBzEJx3SABp6eiJSS\"]},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://526dc85e1f9b9b45830e202568d267d93dde7a4fcccf4ad7798dadcd92304d3c\",\"dweb:/ipfs/QmaoXMB972J3cSDLtBq3xBo4jLwqD2uzXTwujtSPqkYVhR\"]},\"@openzeppelin/contracts/presets/ERC20PresetMinterPauser.sol\":{\"keccak256\":\"0xa7c607ed4a0b2bebb811a398838ce4b5165e490f420a06337478eb2ba8c90cfc\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://7eaf468e140d3430711cb859fbb41b097093069a75bfe4ab19e515c59f8b78ea\",\"dweb:/ipfs/QmYvdoCh8TAX7ucpMZspPpHpQZSuNe8cQTrbZyUcy3caqc\"]},\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"keccak256\":\"0xca0c2396dbeb3503b51abf4248ebf77a1461edad513c01529df51850a012bee3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://991b44ff44e0496e8554a90f4c0512c28faed45104d40430019f3c67ea67740e\",\"dweb:/ipfs/Qmc3nRapVbcctELoZS5qe17zLkFB3bETBfwzCTMF1CSuGE\"]},\"@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol\":{\"keccak256\":\"0x9c0eb3b0e11d2480d49991dc384f1e5f9c9b9967cc81944d50916a9b9c6c4984\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://99e4033d778624992e86f0b6d801a4f6d7b5c0cd5c79c1296be90a051ad5f5af\",\"dweb:/ipfs/QmShYmkUqh6pDEeoWadZ24icmCr4C2Xys1uE5boivPmbwf\"]},\"@openzeppelin/contracts/token/ERC20/ERC20Pausable.sol\":{\"keccak256\":\"0xa22af140ae7ec1f8f2f3bed5869cd0d548dfaac66343f0efc7324ff34aaf1254\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://fed479feda7354e89c095fde0927dcb581f460257bf93b7db54b2b902b4bbd48\",\"dweb:/ipfs/QmSDUhS2AQvTGXHwaxDgAXtwXKCgQh2kp1nwhwUgr2hQZK\"]},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://24427744bd3e6cb73c17010119af12a318289c0253a4d9acb8576c9fb3797b08\",\"dweb:/ipfs/QmTLDqpKRBuxGxRAmjgXt9AkXyACW3MtKzi7PYjm5iMfGC\"]},\"@openzeppelin/contracts/utils/Address.sol\":{\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://256c8c8af5eb072bc473226ab2b2187149b8fc04f5f4a4820db22527f5ce8e3c\",\"dweb:/ipfs/QmRvi5BhnL7Rxf85KrJhwM6RRhukm4tzoctRdgQEheNyiN\"]},\"@openzeppelin/contracts/utils/Context.sol\":{\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ded47ec7c96750f9bd04bbbc84f659992d4ba901cb7b532a52cd468272cf378f\",\"dweb:/ipfs/QmfBrGtQP7rZEqEg6Wz6jh2N2Kukpj1z5v3CGWmAqrzm96\"]},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://4580d57781513d98870d9738c7d39094336e0a70cdb90d68dad549c6ced466ec\",\"dweb:/ipfs/Qmf9YZzzRFuvMnav9dgmeRUpdYMMECiZX8w25sHWVbA18V\"]},\"@openzeppelin/contracts/utils/Pausable.sol\":{\"keccak256\":\"0x212fb1b1d4beaf74354dad9bc329f44ee3c5375ef1c32acff76b4ecefc10f1d8\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d21c68cb321d1c8d0fa39fd9ecb6bbe3b2f26623b0f38af280a010c916c85f23\",\"dweb:/ipfs/Qmf2P51HRC4ekDHLYfbXu5SXR33gXrWtq6oKSmfyWqVRuC\"]},\"project:/contracts/ERC20Safe.sol\":{\"keccak256\":\"0x8f93dfbdf43c6ba17ef5742ff544a7f78b97ef66817fee1532f099a9fd57d194\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://58517fef09d9e89ce7dc685bf6d90b125155add35e3c9834b6859389047e7961\",\"dweb:/ipfs/Qma6q2ZMDaNKTa6D8Ppsoe71xWieABmPEeynU6nbkXTnKX\"]},\"project:/contracts/handlers/ERC20Handler.sol\":{\"keccak256\":\"0x58ca13fcca2f2e1897b3032e2b1f0809ffdccc8ae755a4836e06dd0cba135467\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://f46d73a42eb1bc3a2ca2b3d2effbfb34992bf3094a9516d53f0334cf1d5c7de4\",\"dweb:/ipfs/QmXohwhHAzSzgsCNg75erQHxq9qfP5LyouUesZLzCQ6Rf2\"]},\"project:/contracts/handlers/HandlerHelpers.sol\":{\"keccak256\":\"0x9418d0646c373e028595a4a3abf5ac93948ea64efa031f1531c70a0500882d09\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://43e30989056cc8c5f0d2a26cb3a7e8a5d0d51dd2c832fb8d751c353226254871\",\"dweb:/ipfs/QmRpXPeLz7Qjh5qxMW4PyC8qkjrpEJCeCiqfobZyg28y6S\"]},\"project:/contracts/interfaces/IDepositExecute.sol\":{\"keccak256\":\"0x3623f906ae6f354cbf27ffd4eeccbfc2c3baa94783c5dd854b2e0f50db2a7c8d\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://26f8ddafd8655375eeb861a033fe390b3235c4f8de9a54e0524b91d2d1992674\",\"dweb:/ipfs/QmUAsxc8j4UdaDZ5HVp73kAwLpgTqqrgZG1sX86iRKZTqv\"]},\"project:/contracts/interfaces/IERCHandler.sol\":{\"keccak256\":\"0x4384276611a789db6481e1158d92c280fe5990ec0c375df30dd5e8f8a97cbb4c\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://3af488536c6d8f6b3090ca9b5fa54718941604a30f58bd66db641a6599a9f296\",\"dweb:/ipfs/QmSm988tQV4XtkCQpTbf2SbdCHp8AcjYZhQLhftPFXrUf2\"]}},\"version\":1}",
"bytecode": "0x60a060405234801561001057600080fd5b50604051610c7e380380610c7e83398101604081905261002f91610044565b60601b6001600160601b031916608052610072565b600060208284031215610055578081fd5b81516001600160a01b038116811461006b578182fd5b9392505050565b60805160601c610bea610094600039806101ff528061042b5250610bea6000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c80637f79bea8116100665780637f79bea81461011c578063b07e54bb1461012f578063b8fa37361461014f578063c8ba6c8714610162578063e248cff2146101825761009e565b806307b7ed99146100a35780630968f264146100b85780630a6d55d8146100cb578063318c136e146100f45780636a70d081146100fc575b600080fd5b6100b66100b136600461073b565b610195565b005b6100b66100c63660046108ab565b6101a9565b6100de6100d93660046107c0565b6101e2565b6040516100eb9190610983565b60405180910390f35b6100de6101fd565b61010f61010a36600461073b565b610221565b6040516100eb91906109d4565b61010f61012a36600461073b565b610236565b61014261013d366004610807565b61024b565b6040516100eb91906109e8565b6100b661015d3660046107d8565b6102fb565b61017561017036600461073b565b610311565b6040516100eb91906109df565b6100b6610190366004610861565b610323565b61019d610420565b6101a68161046a565b50565b6101b1610420565b6000806000838060200190518101906101ca919061075e565b919450925090506101dc8383836104c6565b50505050565b6000602081905290815260409020546001600160a01b031681565b7f000000000000000000000000000000000000000000000000000000000000000081565b60036020526000908152604090205460ff1681565b60026020526000908152604090205460ff1681565b6060610255610420565b6000610263838501856107c0565b600087815260208181526040808320546001600160a01b03168084526002909252909120549192509060ff166102b45760405162461bcd60e51b81526004016102ab90610af7565b60405180910390fd5b6001600160a01b03811660009081526003602052604090205460ff16156102e5576102e08187846104d2565b6102f1565b6102f181873085610530565b5050949350505050565b610303610420565b61030d8282610544565b5050565b60016020526000908152604090205481565b61032b610420565b600080606061033c84860186610946565b90935091506103516040808401908688610b3f565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052508a81526020818152604080832054828801516001600160a01b039091168085526002909352922054959650909490935060ff1691506103d490505760405162461bcd60e51b81526004016102ab90610af7565b6001600160a01b03811660009081526003602052604090205460ff161561040857610403818360601c87610591565b610416565b610416818360601c876104c6565b5050505050505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146104685760405162461bcd60e51b81526004016102ab90610a50565b565b6001600160a01b03811660009081526002602052604090205460ff166104a25760405162461bcd60e51b81526004016102ab90610a87565b6001600160a01b03166000908152600360205260409020805460ff19166001179055565b826101dc8184846105c1565b60405163079cc67960e41b815283906001600160a01b038216906379cc67909061050290869086906004016109bb565b600060405180830381600087803b15801561051c57600080fd5b505af1158015610416573d6000803e3d6000fd5b8361053d8185858561061c565b5050505050565b60008281526020818152604080832080546001600160a01b039095166001600160a01b0319909516851790559282526001808252838320949094556002905220805460ff19169091179055565b6040516340c10f1960e01b815283906001600160a01b038216906340c10f199061050290869086906004016109bb565b6106178363a9059cbb60e01b84846040516024016105e09291906109bb565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261063d565b505050565b6101dc846323b872dd60e01b8585856040516024016105e093929190610997565b60006060836001600160a01b0316836040516106599190610967565b6000604051808303816000865af19150503d8060008114610696576040519150601f19603f3d011682016040523d82523d6000602084013e61069b565b606091505b5091509150816106bd5760405162461bcd60e51b81526004016102ab90610acb565b8051156101dc57808060200190518101906106d891906107a0565b6101dc5760405162461bcd60e51b81526004016102ab90610a1b565b60008083601f840112610705578182fd5b50813567ffffffffffffffff81111561071c578182fd5b60208301915083602082850101111561073457600080fd5b9250929050565b60006020828403121561074c578081fd5b813561075781610b9f565b9392505050565b600080600060608486031215610772578182fd5b835161077d81610b9f565b602085015190935061078e81610b9f565b80925050604084015190509250925092565b6000602082840312156107b1578081fd5b81518015158114610757578182fd5b6000602082840312156107d1578081fd5b5035919050565b600080604083850312156107ea578182fd5b8235915060208301356107fc81610b9f565b809150509250929050565b6000806000806060858703121561081c578081fd5b84359350602085013561082e81610b9f565b9250604085013567ffffffffffffffff811115610849578182fd5b610855878288016106f4565b95989497509550505050565b600080600060408486031215610875578283fd5b83359250602084013567ffffffffffffffff811115610892578283fd5b61089e868287016106f4565b9497909650939450505050565b6000602082840312156108bc578081fd5b813567ffffffffffffffff808211156108d3578283fd5b818401915084601f8301126108e6578283fd5b8135818111156108f4578384fd5b604051601f8201601f191681016020018381118282101715610914578586fd5b60405281815283820160200187101561092b578485fd5b61093c826020830160208701610b67565b9695505050505050565b60008060408385031215610958578182fd5b50508035926020909101359150565b60008251610979818460208701610b73565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b6000602082528251806020840152610a07816040850160208701610b73565b601f01601f19169190910160400192915050565b6020808252818101527f45524332303a206f7065726174696f6e20646964206e6f742073756363656564604082015260600190565b6020808252601e908201527f73656e646572206d7573742062652062726964676520636f6e74726163740000604082015260600190565b60208082526024908201527f70726f766964656420636f6e7472616374206973206e6f742077686974656c696040820152631cdd195960e21b606082015260800190565b602080825260129082015271115490cc8c0e8818d85b1b0819985a5b195960721b604082015260600190565b60208082526028908201527f70726f766964656420746f6b656e41646472657373206973206e6f74207768696040820152671d195b1a5cdd195960c21b606082015260800190565b60008085851115610b4e578182fd5b83861115610b5a578182fd5b5050820193919092039150565b82818337506000910152565b60005b83811015610b8e578181015183820152602001610b76565b838111156101dc5750506000910152565b6001600160a01b03811681146101a657600080fdfea26469706673582212200b7f9f3bf4e068dd7906bce4598f87c4ddf114962e3bd7f10759f026d816c38a64736f6c634300060c0033",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80637f79bea8116100665780637f79bea81461011c578063b07e54bb1461012f578063b8fa37361461014f578063c8ba6c8714610162578063e248cff2146101825761009e565b806307b7ed99146100a35780630968f264146100b85780630a6d55d8146100cb578063318c136e146100f45780636a70d081146100fc575b600080fd5b6100b66100b136600461073b565b610195565b005b6100b66100c63660046108ab565b6101a9565b6100de6100d93660046107c0565b6101e2565b6040516100eb9190610983565b60405180910390f35b6100de6101fd565b61010f61010a36600461073b565b610221565b6040516100eb91906109d4565b61010f61012a36600461073b565b610236565b61014261013d366004610807565b61024b565b6040516100eb91906109e8565b6100b661015d3660046107d8565b6102fb565b61017561017036600461073b565b610311565b6040516100eb91906109df565b6100b6610190366004610861565b610323565b61019d610420565b6101a68161046a565b50565b6101b1610420565b6000806000838060200190518101906101ca919061075e565b919450925090506101dc8383836104c6565b50505050565b6000602081905290815260409020546001600160a01b031681565b7f000000000000000000000000000000000000000000000000000000000000000081565b60036020526000908152604090205460ff1681565b60026020526000908152604090205460ff1681565b6060610255610420565b6000610263838501856107c0565b600087815260208181526040808320546001600160a01b03168084526002909252909120549192509060ff166102b45760405162461bcd60e51b81526004016102ab90610af7565b60405180910390fd5b6001600160a01b03811660009081526003602052604090205460ff16156102e5576102e08187846104d2565b6102f1565b6102f181873085610530565b5050949350505050565b610303610420565b61030d8282610544565b5050565b60016020526000908152604090205481565b61032b610420565b600080606061033c84860186610946565b90935091506103516040808401908688610b3f565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052508a81526020818152604080832054828801516001600160a01b039091168085526002909352922054959650909490935060ff1691506103d490505760405162461bcd60e51b81526004016102ab90610af7565b6001600160a01b03811660009081526003602052604090205460ff161561040857610403818360601c87610591565b610416565b610416818360601c876104c6565b5050505050505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146104685760405162461bcd60e51b81526004016102ab90610a50565b565b6001600160a01b03811660009081526002602052604090205460ff166104a25760405162461bcd60e51b81526004016102ab90610a87565b6001600160a01b03166000908152600360205260409020805460ff19166001179055565b826101dc8184846105c1565b60405163079cc67960e41b815283906001600160a01b038216906379cc67909061050290869086906004016109bb565b600060405180830381600087803b15801561051c57600080fd5b505af1158015610416573d6000803e3d6000fd5b8361053d8185858561061c565b5050505050565b60008281526020818152604080832080546001600160a01b039095166001600160a01b0319909516851790559282526001808252838320949094556002905220805460ff19169091179055565b6040516340c10f1960e01b815283906001600160a01b038216906340c10f199061050290869086906004016109bb565b6106178363a9059cbb60e01b84846040516024016105e09291906109bb565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261063d565b505050565b6101dc846323b872dd60e01b8585856040516024016105e093929190610997565b60006060836001600160a01b0316836040516106599190610967565b6000604051808303816000865af19150503d8060008114610696576040519150601f19603f3d011682016040523d82523d6000602084013e61069b565b606091505b5091509150816106bd5760405162461bcd60e51b81526004016102ab90610acb565b8051156101dc57808060200190518101906106d891906107a0565b6101dc5760405162461bcd60e51b81526004016102ab90610a1b565b60008083601f840112610705578182fd5b50813567ffffffffffffffff81111561071c578182fd5b60208301915083602082850101111561073457600080fd5b9250929050565b60006020828403121561074c578081fd5b813561075781610b9f565b9392505050565b600080600060608486031215610772578182fd5b835161077d81610b9f565b602085015190935061078e81610b9f565b80925050604084015190509250925092565b6000602082840312156107b1578081fd5b81518015158114610757578182fd5b6000602082840312156107d1578081fd5b5035919050565b600080604083850312156107ea578182fd5b8235915060208301356107fc81610b9f565b809150509250929050565b6000806000806060858703121561081c578081fd5b84359350602085013561082e81610b9f565b9250604085013567ffffffffffffffff811115610849578182fd5b610855878288016106f4565b95989497509550505050565b600080600060408486031215610875578283fd5b83359250602084013567ffffffffffffffff811115610892578283fd5b61089e868287016106f4565b9497909650939450505050565b6000602082840312156108bc578081fd5b813567ffffffffffffffff808211156108d3578283fd5b818401915084601f8301126108e6578283fd5b8135818111156108f4578384fd5b604051601f8201601f191681016020018381118282101715610914578586fd5b60405281815283820160200187101561092b578485fd5b61093c826020830160208701610b67565b9695505050505050565b60008060408385031215610958578182fd5b50508035926020909101359150565b60008251610979818460208701610b73565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b6000602082528251806020840152610a07816040850160208701610b73565b601f01601f19169190910160400192915050565b6020808252818101527f45524332303a206f7065726174696f6e20646964206e6f742073756363656564604082015260600190565b6020808252601e908201527f73656e646572206d7573742062652062726964676520636f6e74726163740000604082015260600190565b60208082526024908201527f70726f766964656420636f6e7472616374206973206e6f742077686974656c696040820152631cdd195960e21b606082015260800190565b602080825260129082015271115490cc8c0e8818d85b1b0819985a5b195960721b604082015260600190565b60208082526028908201527f70726f766964656420746f6b656e41646472657373206973206e6f74207768696040820152671d195b1a5cdd195960c21b606082015260800190565b60008085851115610b4e578182fd5b83861115610b5a578182fd5b5050820193919092039150565b82818337506000910152565b60005b83811015610b8e578181015183820152602001610b76565b838111156101dc5750506000910152565b6001600160a01b03811681146101a657600080fdfea26469706673582212200b7f9f3bf4e068dd7906bce4598f87c4ddf114962e3bd7f10759f026d816c38a64736f6c634300060c0033",
"immutableReferences": {
"9652": [
{
"length": 32,
"start": 511
},
{
"length": 32,
"start": 1067
}
]
},
"sourceMap": "376:3965:45:-:0;;;543:102;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1045:30:48;;-1:-1:-1;;;;;;1045:30:48;;;376:3965:45;;146:263:-1;;261:2;249:9;240:7;236:23;232:32;229:2;;;-1:-1;;267:12;229:2;83:13;;-1:-1;;;;;576:54;;701:35;;691:2;;-1:-1;;740:12;691:2;319:74;223:186;-1:-1;;;223:186::o;:::-;376:3965:45;;;;;;;;;;;",
"deployedSourceMap": "376:3965:45:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2170:120:48;;;;;;:::i;:::-;;:::i;:::-;;4043:296:45;;;;;;:::i;:::-;;:::i;408:69:48:-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;318:39;;;:::i;755:42::-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;652:51::-;;;;;;:::i;:::-;;:::i;1352:612:45:-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;1774:154:48:-;;;;;;:::i;:::-;;:::i;528:69::-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;2609:943:45:-;;;;;;:::i;:::-;;:::i;2170:120:48:-;836:13;:11;:13::i;:::-;2254:29:::1;2267:15;2254:12;:29::i;:::-;2170:120:::0;:::o;4043:296:45:-;836:13:48;:11;:13::i;:::-;4119:20:45::1;4149:17:::0;4176:11:::1;4245:4;4234:42;;;;;;;;;;;;:::i;:::-;4198:78:::0;;-1:-1:-1;4198:78:45;-1:-1:-1;4198:78:45;-1:-1:-1;4287:45:45::1;4198:78:::0;;;4287:12:::1;:45::i;:::-;859:1:48;;;4043:296:45::0;:::o;408:69:48:-;;;;;;;;;;;;;-1:-1:-1;;;;;408:69:48;;:::o;318:39::-;;;:::o;755:42::-;;;;;;;;;;;;;;;:::o;652:51::-;;;;;;;;;;;;;;;:::o;1352:612:45:-;1499:12;836:13:48;:11;:13::i;:::-;1523:21:45::1;1565:24;::::0;;::::1;1576:4:::0;1565:24:::1;:::i;:::-;1600:20;1623:45:::0;;;::::1;::::0;;;;;;;;-1:-1:-1;;;;;1623:45:45::1;1686:32:::0;;;:18:::1;:32:::0;;;;;;;1554:35;;-1:-1:-1;1623:45:45;1686:32:::1;;1678:85;;;;-1:-1:-1::0;;;1678:85:45::1;;;;;;;:::i;:::-;;;;;;;;;-1:-1:-1::0;;;;;1778:23:45;::::1;;::::0;;;:9:::1;:23;::::0;;;;;::::1;;1774:184;;;1817:42;1827:12;1841:9;1852:6;1817:9;:42::i;:::-;1774:184;;;1890:57;1900:12;1914:9;1933:4;1940:6;1890:9;:57::i;:::-;859:1:48;;1352:612:45::0;;;;;;:::o;1774:154:48:-;836:13;:11;:13::i;:::-;1880:41:::1;1893:10;1905:15;1880:12;:41::i;:::-;1774:154:::0;;:::o;528:69::-;;;;;;;;;;;;;:::o;2609:943:45:-;836:13:48;:11;:13::i;:::-;2714:20:45::1;::::0;2798:41:::1;2893:30;::::0;;::::1;2904:4:::0;2893:30:::1;:::i;:::-;2850:73:::0;;-1:-1:-1;2850:73:45;-1:-1:-1;2969:44:45::1;2974:2;2977:35:::0;;::::1;::::0;2969:4;;:44:::1;:::i;:::-;2933:81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;::::0;;;-1:-1:-1;3082:45:45;;;::::1;::::0;;;;;;;;3187:38;;::::1;3181:45:::0;-1:-1:-1;;;;;3082:45:45;;::::1;3254:32:::0;;;:18:::1;:32:::0;;;;;;2933:81;;-1:-1:-1;3181:45:45;;3082;;-1:-1:-1;3254:32:45::1;;::::0;-1:-1:-1;3246:85:45::1;::::0;-1:-1:-1;3246:85:45::1;;;-1:-1:-1::0;;;3246:85:45::1;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;3346:23:45;::::1;;::::0;;;:9:::1;:23;::::0;;;;;::::1;;3342:204;;;3385:58;3395:12;3417:16;3409:25;;3436:6;3385:9;:58::i;:::-;3342:204;;;3474:61;3487:12;3509:16;3501:25;;3528:6;3474:12;:61::i;:::-;859:1:48;;;;;2609:943:45::0;;;:::o;1088:124:48:-;1142:10;-1:-1:-1;;;;;1156:14:48;1142:28;;1134:71;;;;-1:-1:-1;;;1134:71:48;;;;;;;:::i;:::-;1088:124::o;2655:200::-;-1:-1:-1;;;;;2729:35:48;;;;;;:18;:35;;;;;;;;2721:84;;;;-1:-1:-1;;;2721:84:48;;;;;;;:::i;:::-;-1:-1:-1;;;;;2815:26:48;;;;;:9;:26;;;;;:33;;-1:-1:-1;;2815:33:48;2844:4;2815:33;;;2655:200::o;1271:189:38:-;1391:12;1414:39;1391:12;1435:9;1446:6;1414:13;:39::i;2099:186::-;2249:29;;-1:-1:-1;;;2249:29:38;;2226:12;;-1:-1:-1;;;;;2249:14:38;;;;;:29;;2264:5;;2271:6;;2249:29;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;814:212;946:12;969:50;946:12;994:5;1001:9;1012:6;969:17;:50::i;:::-;814:212;;;;;:::o;2367:282:48:-;2453:33;:45;;;;;;;;;;;:63;;-1:-1:-1;;;;;2453:63:48;;;-1:-1:-1;;;;;;2453:63:48;;;;;;;2526:50;;;2453:63;2526:50;;;;;;:63;;;;2600:18;:35;;;:42;;-1:-1:-1;;2600:42:48;;;;;;2367:282::o;1681:211:38:-;1855:29;;-1:-1:-1;;;1855:29:38;;1832:12;;-1:-1:-1;;;;;1855:10:38;;;;;:29;;1866:9;;1877:6;;1855:29;;;:::i;2498:165::-;2580:76;2590:5;2620:23;;;2645:2;2649:5;2597:58;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;2597:58:38;;;;;;;;;;;;;;-1:-1:-1;;;;;2597:58:38;-1:-1:-1;;;;;;2597:58:38;;;;;;;;;;2580:9;:76::i;:::-;2498:165;;;:::o;2928:193::-;3028:86;3038:5;3068:27;;;3097:4;3103:2;3107:5;3045:68;;;;;;;;;;:::i;3282:338::-;3361:12;3375:23;3410:5;-1:-1:-1;;;;;3402:19:38;3422:4;3402:25;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3360:67;;;;3445:7;3437:38;;;;-1:-1:-1;;;3437:38:38;;;;;;;:::i;:::-;3490:17;;:21;3486:128;;3547:10;3536:30;;;;;;;;;;;;:::i;:::-;3528:75;;;;-1:-1:-1;;;3528:75:38;;;;;;;:::i;585:336:-1:-;;;699:3;692:4;684:6;680:17;676:27;666:2;;-1:-1;;707:12;666:2;-1:-1;737:20;;777:18;766:30;;763:2;;;-1:-1;;799:12;763:2;843:4;835:6;831:17;819:29;;894:3;843:4;874:17;835:6;860:32;;857:41;854:2;;;911:1;;901:12;854:2;659:262;;;;;:::o;1656:241::-;;1760:2;1748:9;1739:7;1735:23;1731:32;1728:2;;;-1:-1;;1766:12;1728:2;85:6;72:20;97:33;124:5;97:33;:::i;:::-;1818:63;1722:175;-1:-1;;;1722:175::o;1904:567::-;;;;2069:2;2057:9;2048:7;2044:23;2040:32;2037:2;;;-1:-1;;2075:12;2037:2;234:6;228:13;246:41;281:5;246:41;:::i;:::-;2246:2;2304:22;;228:13;2127:82;;-1:-1;246:41;228:13;246:41;:::i;:::-;2254:82;;;;2373:2;2427:9;2423:22;1593:13;2381:74;;2031:440;;;;;:::o;2478:257::-;;2590:2;2578:9;2569:7;2565:23;2561:32;2558:2;;;-1:-1;;2596:12;2558:2;380:6;374:13;15589:5;14396:13;14389:21;15567:5;15564:32;15554:2;;-1:-1;;15600:12;2742:241;;2846:2;2834:9;2825:7;2821:23;2817:32;2814:2;;;-1:-1;;2852:12;2814:2;-1:-1;501:20;;2808:175;-1:-1;2808:175::o;2990:366::-;;;3111:2;3099:9;3090:7;3086:23;3082:32;3079:2;;;-1:-1;;3117:12;3079:2;514:6;501:20;3169:63;;3269:2;3312:9;3308:22;72:20;97:33;124:5;97:33;:::i;:::-;3277:63;;;;3073:283;;;;;:::o;3363:615::-;;;;;3520:2;3508:9;3499:7;3495:23;3491:32;3488:2;;;-1:-1;;3526:12;3488:2;514:6;501:20;3578:63;;3678:2;3721:9;3717:22;72:20;97:33;124:5;97:33;:::i;:::-;3686:63;-1:-1;3814:2;3799:18;;3786:32;3838:18;3827:30;;3824:2;;;-1:-1;;3860:12;3824:2;3898:64;3954:7;3945:6;3934:9;3930:22;3898:64;:::i;:::-;3482:496;;;;-1:-1;3880:82;-1:-1;;;;3482:496::o;3985:490::-;;;;4125:2;4113:9;4104:7;4100:23;4096:32;4093:2;;;-1:-1;;4131:12;4093:2;514:6;501:20;4183:63;;4311:2;4300:9;4296:18;4283:32;4335:18;4327:6;4324:30;4321:2;;;-1:-1;;4357:12;4321:2;4395:64;4451:7;4442:6;4431:9;4427:22;4395:64;:::i;:::-;4087:388;;4377:82;;-1:-1;4377:82;;-1:-1;;;;4087:388::o;4482:345::-;;4595:2;4583:9;4574:7;4570:23;4566:32;4563:2;;;-1:-1;;4601:12;4563:2;4659:17;4646:31;4697:18;;4689:6;4686:30;4683:2;;;-1:-1;;4719:12;4683:2;4794:6;4783:9;4779:22;;;1031:3;1024:4;1016:6;1012:17;1008:27;998:2;;-1:-1;;1039:12;998:2;1086:6;1073:20;4697:18;12984:6;12981:30;12978:2;;;-1:-1;;13014:12;12978:2;12648;12642:9;13087;13068:17;;-1:-1;;13064:33;12674:17;;4595:2;12674:17;12734:34;;;12770:22;;;12731:62;12728:2;;;-1:-1;;12796:12;12728:2;12648;12815:22;1178:21;;;1278:16;;;4595:2;1278:16;1275:25;-1:-1;1272:2;;;-1:-1;;1303:12;1272:2;1323:41;1357:6;4595:2;1254:5;1250:16;4595:2;1220:6;1216:17;1323:41;:::i;:::-;4739:72;4557:270;-1:-1;;;;;;4557:270::o;5082:366::-;;;5203:2;5191:9;5182:7;5178:23;5174:32;5171:2;;;-1:-1;;5209:12;5171:2;-1:-1;;1445:20;;;5361:2;5400:22;;;1445:20;;-1:-1;5165:283::o;8414:271::-;;6316:5;13264:12;6427:52;6472:6;6467:3;6460:4;6453:5;6449:16;6427:52;:::i;:::-;6491:16;;;;;8548:137;-1:-1;;8548:137::o;8692:222::-;-1:-1;;;;;14563:54;;;;5526:37;;8819:2;8804:18;;8790:124::o;8921:444::-;-1:-1;;;;;14563:54;;;5526:37;;14563:54;;;;9268:2;9253:18;;5526:37;9351:2;9336:18;;5757:37;;;;9104:2;9089:18;;9075:290::o;9372:333::-;-1:-1;;;;;14563:54;;;;5526:37;;9691:2;9676:18;;5757:37;9527:2;9512:18;;9498:207::o;9712:210::-;14396:13;;14389:21;5640:34;;9833:2;9818:18;;9804:118::o;9929:222::-;5757:37;;;10056:2;10041:18;;10027:124::o;10158:306::-;;10303:2;10324:17;10317:47;5948:5;13264:12;13420:6;10303:2;10292:9;10288:18;13408:19;6041:52;6086:6;13448:14;10292:9;13448:14;10303:2;6067:5;6063:16;6041:52;:::i;:::-;13087:9;15207:14;-1:-1;;15203:28;6105:39;;;;13448:14;6105:39;;10274:190;-1:-1;;10274:190::o;10471:416::-;10671:2;10685:47;;;10656:18;;;13408:19;6780:34;13448:14;;;6760:55;6834:12;;;10642:245::o;10894:416::-;11094:2;11108:47;;;7085:2;11079:18;;;13408:19;7121:32;13448:14;;;7101:53;7173:12;;;11065:245::o;11317:416::-;11517:2;11531:47;;;7424:2;11502:18;;;13408:19;7460:34;13448:14;;;7440:55;-1:-1;;;7515:12;;;7508:28;7555:12;;;11488:245::o;11740:416::-;11940:2;11954:47;;;7806:2;11925:18;;;13408:19;-1:-1;;;13448:14;;;7822:41;7882:12;;;11911:245::o;12163:416::-;12363:2;12377:47;;;8133:2;12348:18;;;13408:19;8169:34;13448:14;;;8149:55;-1:-1;;;8224:12;;;8217:32;8268:12;;;12334:245::o;13801:318::-;;;13951:8;13939:10;13936:24;13933:2;;;-1:-1;;13963:12;13933:2;13998:6;13988:8;13985:20;13982:2;;;-1:-1;;14008:12;13982:2;-1:-1;;14040:31;;;14089:25;;;;;-1:-1;13927:192::o;14709:145::-;14790:6;14785:3;14780;14767:30;-1:-1;14846:1;14828:16;;14821:27;14760:94::o;14863:268::-;14928:1;14935:101;14949:6;14946:1;14943:13;14935:101;;;15016:11;;;15010:18;14997:11;;;14990:39;14971:2;14964:10;14935:101;;;15051:6;15048:1;15045:13;15042:2;;;-1:-1;;14928:1;15098:16;;15091:27;14912:219::o;15244:117::-;-1:-1;;;;;14563:54;;15303:35;;15293:2;;15352:1;;15342:12",
"source": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity 0.6.12;\npragma experimental ABIEncoderV2;\n\nimport \"../interfaces/IDepositExecute.sol\";\nimport \"./HandlerHelpers.sol\";\nimport \"../ERC20Safe.sol\";\n\n/**\n @title Handles ERC20 deposits and deposit executions.\n @author ChainSafe Systems.\n @notice This contract is intended to be used with the Bridge contract.\n */\ncontract ERC20Handler is IDepositExecute, HandlerHelpers, ERC20Safe {\n /**\n @param bridgeAddress Contract address of previously deployed Bridge.\n */\n constructor(\n address bridgeAddress\n ) public HandlerHelpers(bridgeAddress) {\n }\n\n /**\n @notice A deposit is initiatied by making a deposit in the Bridge contract.\n @param resourceID ResourceID used to find address of token to be used for deposit.\n @param depositer Address of account making the deposit in the Bridge contract.\n @param data Consists of {amount} padded to 32 bytes.\n @notice Data passed into the function should be constructed as follows:\n amount uint256 bytes 0 - 32\n @dev Depending if the corresponding {tokenAddress} for the parsed {resourceID} is\n marked true in {_burnList}, deposited tokens will be burned, if not, they will be locked.\n @return an empty data.\n */\n function deposit(\n bytes32 resourceID,\n address depositer,\n bytes calldata data\n ) external override onlyBridge returns (bytes memory) {\n uint256 amount;\n (amount) = abi.decode(data, (uint));\n\n address tokenAddress = _resourceIDToTokenContractAddress[resourceID];\n require(_contractWhitelist[tokenAddress], \"provided tokenAddress is not whitelisted\");\n\n if (_burnList[tokenAddress]) {\n burnERC20(tokenAddress, depositer, amount);\n } else {\n lockERC20(tokenAddress, depositer, address(this), amount);\n }\n }\n\n /**\n @notice Proposal execution should be initiated when a proposal is finalized in the Bridge contract.\n by a relayer on the deposit's destination chain.\n @param data Consists of {resourceID}, {amount}, {lenDestinationRecipientAddress},\n and {destinationRecipientAddress} all padded to 32 bytes.\n @notice Data passed into the function should be constructed as follows:\n amount uint256 bytes 0 - 32\n destinationRecipientAddress length uint256 bytes 32 - 64\n destinationRecipientAddress bytes bytes 64 - END\n */\n function executeProposal(bytes32 resourceID, bytes calldata data) external override onlyBridge {\n uint256 amount;\n uint256 lenDestinationRecipientAddress;\n bytes memory destinationRecipientAddress;\n\n (amount, lenDestinationRecipientAddress) = abi.decode(data, (uint, uint));\n destinationRecipientAddress = bytes(data[64:64 + lenDestinationRecipientAddress]);\n\n bytes20 recipientAddress;\n address tokenAddress = _resourceIDToTokenContractAddress[resourceID];\n\n assembly {\n recipientAddress := mload(add(destinationRecipientAddress, 0x20))\n }\n\n require(_contractWhitelist[tokenAddress], \"provided tokenAddress is not whitelisted\");\n\n if (_burnList[tokenAddress]) {\n mintERC20(tokenAddress, address(recipientAddress), amount);\n } else {\n releaseERC20(tokenAddress, address(recipientAddress), amount);\n }\n }\n\n /**\n @notice Used to manually release ERC20 tokens from ERC20Safe.\n @param data Consists of {tokenAddress}, {recipient}, and {amount} all padded to 32 bytes.\n @notice Data passed into the function should be constructed as follows:\n tokenAddress address bytes 0 - 32\n recipient address bytes 32 - 64\n amount uint bytes 64 - 96\n */\n function withdraw(bytes memory data) external override onlyBridge {\n address tokenAddress;\n address recipient;\n uint amount;\n\n (tokenAddress, recipient, amount) = abi.decode(data, (address, address, uint));\n\n releaseERC20(tokenAddress, recipient, amount);\n }\n}\n",
"sourcePath": "/home/sigo/w/deer/ethsub/packages/sol/contracts/handlers/ERC20Handler.sol",
"ast": {
"absolutePath": "project:/contracts/handlers/ERC20Handler.sol",
"exportedSymbols": {
"ERC20Handler": [
8996
]
},
"id": 8997,
"license": "LGPL-3.0-only",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 8779,
"literals": [
"solidity",
"0.6",
".12"
],
"nodeType": "PragmaDirective",
"src": "42:23:45"
},
{
"id": 8780,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "66:33:45"
},
{
"absolutePath": "project:/contracts/interfaces/IDepositExecute.sol",
"file": "../interfaces/IDepositExecute.sol",
"id": 8781,
"nodeType": "ImportDirective",
"scope": 8997,
"sourceUnit": 9817,
"src": "101:43:45",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "project:/contracts/handlers/HandlerHelpers.sol",
"file": "./HandlerHelpers.sol",
"id": 8782,
"nodeType": "ImportDirective",
"scope": 8997,
"sourceUnit": 9783,
"src": "145:30:45",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "project:/contracts/ERC20Safe.sol",
"file": "../ERC20Safe.sol",
"id": 8783,
"nodeType": "ImportDirective",
"scope": 8997,
"sourceUnit": 7752,
"src": "176:26:45",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 8785,
"name": "IDepositExecute",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 9816,
"src": "401:15:45",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IDepositExecute_$9816",
"typeString": "contract IDepositExecute"
}
},
"id": 8786,
"nodeType": "InheritanceSpecifier",
"src": "401:15:45"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 8787,
"name": "HandlerHelpers",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 9782,
"src": "418:14:45",
"typeDescriptions": {
"typeIdentifier": "t_contract$_HandlerHelpers_$9782",
"typeString": "contract HandlerHelpers"
}
},
"id": 8788,
"nodeType": "InheritanceSpecifier",
"src": "418:14:45"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 8789,
"name": "ERC20Safe",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 7751,
"src": "434:9:45",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20Safe_$7751",
"typeString": "contract ERC20Safe"
}
},
"id": 8790,
"nodeType": "InheritanceSpecifier",
"src": "434:9:45"
}
],
"contractDependencies": [
7751,
9782,
9816,
9840
],
"contractKind": "contract",
"documentation": {
"id": 8784,
"nodeType": "StructuredDocumentation",
"src": "204:171:45",
"text": "@title Handles ERC20 deposits and deposit executions.\n@author ChainSafe Systems.\n@notice This contract is intended to be used with the Bridge contract."
},
"fullyImplemented": true,
"id": 8996,
"linearizedBaseContracts": [
8996,
7751,
9782,
9840,
9816
],
"name": "ERC20Handler",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 8799,
"nodeType": "Block",
"src": "638:7:45",
"statements": []
},
"documentation": {
"id": 8791,
"nodeType": "StructuredDocumentation",
"src": "450:88:45",
"text": "@param bridgeAddress Contract address of previously deployed Bridge."
},
"id": 8800,
"implemented": true,
"kind": "constructor",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 8796,
"name": "bridgeAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8793,
"src": "623:13:45",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 8797,
"modifierName": {
"argumentTypes": null,
"id": 8795,
"name": "HandlerHelpers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9782,
"src": "608:14:45",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_HandlerHelpers_$9782_$",
"typeString": "type(contract HandlerHelpers)"
}
},
"nodeType": "ModifierInvocation",
"src": "608:29:45"
}
],
"name": "",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8794,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8793,
"mutability": "mutable",
"name": "bridgeAddress",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8800,
"src": "564:30:45",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 8792,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "564:7:45",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "554:46:45"
},
"returnParameters": {
"id": 8798,
"nodeType": "ParameterList",
"parameters": [],
"src": "638:0:45"
},
"scope": 8996,
"src": "543:102:45",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
9807
],
"body": {
"id": 8864,
"nodeType": "Block",
"src": "1513:451:45",
"statements": [
{
"assignments": [
8816
],
"declarations": [
{
"constant": false,
"id": 8816,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8864,
"src": "1523:21:45",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_u