Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x93926eE8718D318CF79da2E52a7995Ee3b39c686
Balance 0 ETH
Nonce 1
Code Size 17394 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

17394 bytes
0x608060405234801561001057600080fd5b50600436106101165760003560e01c806351f3be02116100a2578063c625562611610071578063c62556261461031d578063e0225b1d1461034d578063f2fde38b1461037d578063f9a6878214610399578063fa544161146103c957610116565b806351f3be02146102a7578063715018a6146102d75780638da5cb5b146102e1578063984d6e7a146102ff57610116565b80632b4d56f0116100e95780632b4d56f0146101c95780632d11c58a146101f95780633f3ee32a146102175780634af2e84c146102475780634c018e971461027757610116565b8063078b70891461011b5780630fb120891461014b57806310a53b9a1461017b57806322d46d6314610199575b600080fd5b61013560048036038101906101309190612bb9565b6103f9565b6040516101429190612c84565b60405180910390f35b61016560048036038101906101609190612c9f565b610833565b6040516101729190612c84565b60405180910390f35b6101836108ca565b6040516101909190612cee565b60405180910390f35b6101b360048036038101906101ae9190612d09565b6108ee565b6040516101c09190612c84565b60405180910390f35b6101e360048036038101906101de9190612d69565b610a0d565b6040516101f09190612c84565b60405180910390f35b610201610c20565b60405161020e9190612dc5565b60405180910390f35b610231600480360381019061022c9190612de0565b610c25565b60405161023e9190612ecb565b60405180910390f35b610261600480360381019061025c9190612de0565b610cf5565b60405161026e9190612cee565b60405180910390f35b610291600480360381019061028c9190612de0565b610d28565b60405161029e9190612c84565b60405180910390f35b6102c160048036038101906102bc9190612d09565b610d48565b6040516102ce9190612c84565b60405180910390f35b6102df610ea3565b005b6102e9610eb7565b6040516102f69190612cee565b60405180910390f35b610307610ee0565b6040516103149190612dc5565b60405180910390f35b61033760048036038101906103329190612eed565b610ee5565b6040516103449190612cee565b60405180910390f35b61036760048036038101906103629190612d09565b610f24565b6040516103749190612c84565b60405180910390f35b61039760048036038101906103929190612de0565b610fb5565b005b6103b360048036038101906103ae9190612f70565b611038565b6040516103c09190612c84565b60405180910390f35b6103e360048036038101906103de9190612de0565b6113b5565b6040516103f09190612cee565b60405180910390f35b600081600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361046b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161046290613074565b60405180910390fd5b600085859050116104b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104a8906130e0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057990613172565b60405180910390fd5b61058d878785611421565b60008585905090506000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060005b828110156106e45760008888838181106105f8576105f7613192565b5b905060200201602081019061060d9190612de0565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361067e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106759061320d565b60405180910390fd5b60018360010160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550816001019150506105db565b5086868260000191906106f89291906129a0565b50338160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f000000000000000000000000b974fc41b3853ebfa55d9f278bbaf89e6ed2ce3373ffffffffffffffffffffffffffffffffffffffff166384cbf6548c338d60036040518563ffffffff1660e01b815260040161079c949392919061322d565b6020604051808303816000875af11580156107bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107df9190613287565b507fdf55e2f259e7a596a5a36280c32afa17b21f69476a35f0b3d43b83f29e1470b6338a8a8a8a8a6040516108199695949392919061333f565b60405180910390a160019350505050979650505050505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b7f000000000000000000000000b974fc41b3853ebfa55d9f278bbaf89e6ed2ce3381565b600081600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610960576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161095790613074565b60405180910390fd5b610968611875565b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160000180549050116109f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ec906133e2565b60405180910390fd5b610a00868686611421565b6001925050509392505050565b6000610a17611875565b600083839050905060005b81811015610c14576000858583818110610a3f57610a3e613192565b5b9050602002016020810190610a549190612de0565b9050600073ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1b9061344e565b60405180910390fd5b600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610bb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba7906134ba565b60405180910390fd5b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555081600101915050610a22565b50600191505092915050565b600481565b6060600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001805480602002602001604051908101604052809291908181526020018280548015610ce957602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610c9f575b50505050509050919050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60036020528060005260406000206000915054906101000a900460ff1681565b600081600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610dba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db190613074565b60405180910390fd5b823373ffffffffffffffffffffffffffffffffffffffff16600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e8290613526565b60405180910390fd5b610e968686866118f3565b6001925050509392505050565b610eab611875565b610eb56000611dbb565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600381565b60048181548110610ef557600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610f96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f8d90613074565b60405180910390fd5b610f9e611875565b610fa98585856118f3565b60019150509392505050565b610fbd611875565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361102c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611023906135b8565b60405180910390fd5b61103581611dbb565b50565b600081600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611107576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fe90613624565b60405180910390fd5b6000878790501161114d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114490613690565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036111bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b390613074565b60405180910390fd5b60006111cb8888888888611e7f565b9050600088889050905060008167ffffffffffffffff8111156111f1576111f06136b0565b5b60405190808252806020026020018201604052801561121f5781602001602082028036833780820191505090505b50905060007f000000000000000000000000b974fc41b3853ebfa55d9f278bbaf89e6ed2ce3373ffffffffffffffffffffffffffffffffffffffff1663f481e8636040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611291573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b591906136f4565b905060005b838110156113465760008582815181106112d7576112d6613192565b5b6020026020010151905060006113178f8f8f868181106112fa576112f9613192565b5b905060200201602081019061130f9190612de0565b848d8861214a565b90508085848151811061132d5761132c613192565b5b60200260200101818152505082600101925050506112ba565b503373ffffffffffffffffffffffffffffffffffffffff167f6bc86be19a706517256bb07e4af60af1f455bdfbd25517a9d79d9539eef5d381888d8d8d8d88600460405161139a97969594939291906138f8565b60405180910390a26001955050505050509695505050505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008383905011611467576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161145e906139b0565b60405180910390fd5b600083839050905060005b8181101561186e57600085858381811061148f5761148e613192565b5b90506020020160208101906114a49190612de0565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611515576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150c9061320d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115da90613a1c565b60405180910390fd5b600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611670576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166790613a1c565b60405180910390fd5b60005b60048054905081101561178b5760006004828154811061169657611695613192565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b81526004016116f99190612cee565b602060405180830381865afa158015611716573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173a9190613a51565b1461177a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161177190613aca565b60405180910390fd5b8061178490613b19565b9050611673565b5083600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555081600101915050611472565b5050505050565b61187d6121a0565b73ffffffffffffffffffffffffffffffffffffffff1661189b610eb7565b73ffffffffffffffffffffffffffffffffffffffff16146118f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e890613bad565b60405180910390fd5b565b600083839050905060005b81811015611b0157600085858381811061191b5761191a613192565b5b90506020020160208101906119309190612de0565b90508373ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146119ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f69061344e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611af557600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690555b816001019150506118fe565b506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001805480602002602001604051908101604052809291908181526020018280548015611bc657602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611b7c575b5050505050905060008151905060005b81811015611c98576000838281518110611bf357611bf2613192565b5b60200260200101519050600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff021916905581600101915050611bd6565b50600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000016000611ce79190612a40565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690558373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fb020e7d2301236e7e9f0d9ea6b8a695015d3b56eebe8087c941a4bcc0dfc30d18888604051611dab929190613bcd565b60405180910390a3505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6060600084849050905060008111611ecc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ec390613c3d565b60405180910390fd5b60008787905067ffffffffffffffff811115611eeb57611eea6136b0565b5b604051908082528060200260200182016040528015611f195781602001602082028036833780820191505090505b50905060005b8281101561213b5736878783818110611f3b57611f3a613192565b5b905060600201905089899050816000013510611f8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f8390613ca9565b60405180910390fd5b60008a8a8360000135818110611fa557611fa4613192565b5b9050602002016020810190611fba9190612de0565b90506000826020016020810190611fd19190612de0565b90508773ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146120a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120979061344e565b60405180910390fd5b600083604001359050600081116120ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e390613d15565b60405180910390fd5b6120f8838330846121a8565b50808685600001358151811061211157612110613192565b5b602002602001018181516121259190613d35565b9150818152505084600101945050505050611f1f565b50809250505095945050505050565b6000806000905060008511156121935761216385612263565b905061217c87878684896121779190613d69565b612286565b60008111156121925761219187878584612286565b5b5b8091505095945050505050565b600033905090565b600084600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361221a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161221190613e0f565b60405180910390fd5b60008311156122575760008690506122558686868473ffffffffffffffffffffffffffffffffffffffff166125fd909392919063ffffffff16565b505b82915050949350505050565b60006103e86004836122759190613e2f565b61227f9190613ea0565b9050919050565b80600081116122ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122c190613f1d565b60405180910390fd5b83600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361233a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161233190613e0f565b60405180910390fd5b83600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036123aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123a190613faf565b60405180910390fd5b600086905060008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016123ea9190612cee565b602060405180830381865afa158015612407573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061242b9190613a51565b905085811015612470576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124679061401b565b60405180910390fd5b88156124a6576124a187878473ffffffffffffffffffffffffffffffffffffffff166126869092919063ffffffff16565b6125f2565b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb88886040518363ffffffff1660e01b81526004016124e192919061403b565b6020604051808303816000875af1158015612500573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125249190613287565b5060008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016125609190612cee565b602060405180830381865afa15801561257d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125a19190613a51565b90508681836125b09190613d69565b146125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e7906140d6565b60405180910390fd5b505b505050505050505050565b612680846323b872dd60e01b85858560405160240161261e939291906140f6565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061270c565b50505050565b6127078363a9059cbb60e01b84846040516024016126a592919061403b565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061270c565b505050565b600061276e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166127d39092919063ffffffff16565b90506000815111156127ce578080602001905181019061278e9190613287565b6127cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127c49061419f565b60405180910390fd5b5b505050565b60606127e284846000856127eb565b90509392505050565b606082471015612830576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161282790614231565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161285991906142c2565b60006040518083038185875af1925050503d8060008114612896576040519150601f19603f3d011682016040523d82523d6000602084013e61289b565b606091505b50915091506128ac878383876128b8565b92505050949350505050565b6060831561291a576000835103612912576128d28561292d565b612911576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161290890614325565b60405180910390fd5b5b829050612925565b6129248383612950565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000825111156129635781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612997919061439a565b60405180910390fd5b828054828255906000526020600020908101928215612a2f579160200282015b82811115612a2e57823573ffffffffffffffffffffffffffffffffffffffff168260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550916020019190600101906129c0565b5b509050612a3c9190612a61565b5090565b5080546000825590600052602060002090810190612a5e9190612a61565b50565b5b80821115612a7a576000816000905550600101612a62565b5090565b600080fd5b600080fd5b60008115159050919050565b612a9d81612a88565b8114612aa857600080fd5b50565b600081359050612aba81612a94565b92915050565b6000819050919050565b612ad381612ac0565b8114612ade57600080fd5b50565b600081359050612af081612aca565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f840112612b1b57612b1a612af6565b5b8235905067ffffffffffffffff811115612b3857612b37612afb565b5b602083019150836020820283011115612b5457612b53612b00565b5b9250929050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612b8682612b5b565b9050919050565b612b9681612b7b565b8114612ba157600080fd5b50565b600081359050612bb381612b8d565b92915050565b600080600080600080600060a0888a031215612bd857612bd7612a7e565b5b6000612be68a828b01612aab565b9750506020612bf78a828b01612ae1565b965050604088013567ffffffffffffffff811115612c1857612c17612a83565b5b612c248a828b01612b05565b9550955050606088013567ffffffffffffffff811115612c4757612c46612a83565b5b612c538a828b01612b05565b93509350506080612c668a828b01612ba4565b91505092959891949750929550565b612c7e81612a88565b82525050565b6000602082019050612c996000830184612c75565b92915050565b60008060408385031215612cb657612cb5612a7e565b5b6000612cc485828601612ba4565b9250506020612cd585828601612ba4565b9150509250929050565b612ce881612b7b565b82525050565b6000602082019050612d036000830184612cdf565b92915050565b600080600060408486031215612d2257612d21612a7e565b5b600084013567ffffffffffffffff811115612d4057612d3f612a83565b5b612d4c86828701612b05565b93509350506020612d5f86828701612ba4565b9150509250925092565b60008060208385031215612d8057612d7f612a7e565b5b600083013567ffffffffffffffff811115612d9e57612d9d612a83565b5b612daa85828601612b05565b92509250509250929050565b612dbf81612ac0565b82525050565b6000602082019050612dda6000830184612db6565b92915050565b600060208284031215612df657612df5612a7e565b5b6000612e0484828501612ba4565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b612e4281612b7b565b82525050565b6000612e548383612e39565b60208301905092915050565b6000602082019050919050565b6000612e7882612e0d565b612e828185612e18565b9350612e8d83612e29565b8060005b83811015612ebe578151612ea58882612e48565b9750612eb083612e60565b925050600181019050612e91565b5085935050505092915050565b60006020820190508181036000830152612ee58184612e6d565b905092915050565b600060208284031215612f0357612f02612a7e565b5b6000612f1184828501612ae1565b91505092915050565b60008083601f840112612f3057612f2f612af6565b5b8235905067ffffffffffffffff811115612f4d57612f4c612afb565b5b602083019150836060820283011115612f6957612f68612b00565b5b9250929050565b60008060008060008060808789031215612f8d57612f8c612a7e565b5b6000612f9b89828a01612aab565b965050602087013567ffffffffffffffff811115612fbc57612fbb612a83565b5b612fc889828a01612b05565b9550955050604087013567ffffffffffffffff811115612feb57612fea612a83565b5b612ff789828a01612f1a565b9350935050606061300a89828a01612ba4565b9150509295509295509295565b600082825260208201905092915050565b7f6164647265737320697320746865207a65726f20616464726573730000000000600082015250565b600061305e601b83613017565b915061306982613028565b602082019050919050565b6000602082019050818103600083015261308d81613051565b9050919050565b7f4e6577206f776e6572206c6973742063616e6e6f7420626520656d7074790000600082015250565b60006130ca601e83613017565b91506130d582613094565b602082019050919050565b600060208201905081810360008301526130f9816130bd565b9050919050565b7f437573746f6d657220616464726573732068617320616c72656164792062656560008201527f6e20736574000000000000000000000000000000000000000000000000000000602082015250565b600061315c602583613017565b915061316782613100565b604082019050919050565b6000602082019050818103600083015261318b8161314f565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f5a65726f20616464726573730000000000000000000000000000000000000000600082015250565b60006131f7600c83613017565b9150613202826131c1565b602082019050919050565b60006020820190508181036000830152613226816131ea565b9050919050565b60006080820190506132426000830187612c75565b61324f6020830186612cdf565b61325c6040830185612db6565b6132696060830184612db6565b95945050505050565b60008151905061328181612a94565b92915050565b60006020828403121561329d5761329c612a7e565b5b60006132ab84828501613272565b91505092915050565b6000819050919050565b60006132cd6020840184612ba4565b905092915050565b6000602082019050919050565b60006132ee8385612e18565b93506132f9826132b4565b8060005b858110156133325761330f82846132be565b6133198882612e48565b9750613324836132d5565b9250506001810190506132fd565b5085925050509392505050565b60006080820190506133546000830189612cdf565b81810360208301526133678187896132e2565b9050818103604083015261337c8185876132e2565b905061338b6060830184612cdf565b979650505050505050565b7f637573746f6d657241646472657373206973206572726f720000000000000000600082015250565b60006133cc601883613017565b91506133d782613396565b602082019050919050565b600060208201905081810360008301526133fb816133bf565b9050919050565b7f72656c6174696f6e73686970206572726f720000000000000000000000000000600082015250565b6000613438601283613017565b915061344382613402565b602082019050919050565b600060208201905081810360008301526134678161342b565b9050919050565b7f61646472657373206973206e6f7420626f756e64000000000000000000000000600082015250565b60006134a4601483613017565b91506134af8261346e565b602082019050919050565b600060208201905081810360008301526134d381613497565b9050919050565b7f4e6f742061206f776e6572206164647265737300000000000000000000000000600082015250565b6000613510601383613017565b915061351b826134da565b602082019050919050565b6000602082019050818103600083015261353f81613503565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006135a2602683613017565b91506135ad82613546565b604082019050919050565b600060208201905081810360008301526135d181613595565b9050919050565b7f4e6f7420612066696e616e6369616c2061646472657373000000000000000000600082015250565b600061360e601783613017565b9150613619826135d8565b602082019050919050565b6000602082019050818103600083015261363d81613601565b9050919050565b7f43757272656e63792061727261792063616e6e6f7420626520656d7074790000600082015250565b600061367a601e83613017565b915061368582613644565b602082019050919050565b600060208201905081810360008301526136a98161366d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000815190506136ee81612b8d565b92915050565b60006020828403121561370a57613709612a7e565b5b6000613718848285016136df565b91505092915050565b600082825260208201905092915050565b6000819050919050565b600061374b6020840184612ae1565b905092915050565b61375c81612ac0565b82525050565b60608201613773600083018361373c565b6137806000850182613753565b5061378e60208301836132be565b61379b6020850182612e39565b506137a9604083018361373c565b6137b66040850182613753565b50505050565b60006137c88383613762565b60608301905092915050565b600082905092915050565b6000606082019050919050565b60006137f88385613721565b935061380382613732565b8060005b8581101561383c5761381982846137d4565b61382388826137bc565b975061382e836137df565b925050600181019050613807565b5085925050509392505050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60006138818383613753565b60208301905092915050565b6000602082019050919050565b60006138a582613849565b6138af8185613854565b93506138ba83613865565b8060005b838110156138eb5781516138d28882613875565b97506138dd8361388d565b9250506001810190506138be565b5085935050505092915050565b600060a08201905061390d600083018a612cdf565b818103602083015261392081888a6132e2565b905081810360408301526139358186886137ec565b90508181036060830152613949818561389a565b90506139586080830184612db6565b98975050505050505050565b7f717220616464726573732063616e6e6f7420626520656d707479000000000000600082015250565b600061399a601a83613017565b91506139a582613964565b602082019050919050565b600060208201905081810360008301526139c98161398d565b9050919050565b7f4164647265737320686173206265656e20626f756e6400000000000000000000600082015250565b6000613a06601683613017565b9150613a11826139d0565b602082019050919050565b60006020820190508181036000830152613a35816139f9565b9050919050565b600081519050613a4b81612aca565b92915050565b600060208284031215613a6757613a66612a7e565b5b6000613a7584828501613a3c565b91505092915050565b7f546f6b656e2062616c616e6365206e6f74207a65726f00000000000000000000600082015250565b6000613ab4601683613017565b9150613abf82613a7e565b602082019050919050565b60006020820190508181036000830152613ae381613aa7565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000613b2482612ac0565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613b5657613b55613aea565b5b600182019050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613b97602083613017565b9150613ba282613b61565b602082019050919050565b60006020820190508181036000830152613bc681613b8a565b9050919050565b60006020820190508181036000830152613be88184866132e2565b90509392505050565b7f7472616465206973206e756c6c00000000000000000000000000000000000000600082015250565b6000613c27600d83613017565b9150613c3282613bf1565b602082019050919050565b60006020820190508181036000830152613c5681613c1a565b9050919050565b7f496e646578206f7574206f6620626f756e647300000000000000000000000000600082015250565b6000613c93601383613017565b9150613c9e82613c5d565b602082019050919050565b60006020820190508181036000830152613cc281613c86565b9050919050565b7f416d6f756e74206d75737420626520706f736974697665000000000000000000600082015250565b6000613cff601783613017565b9150613d0a82613cc9565b602082019050919050565b60006020820190508181036000830152613d2e81613cf2565b9050919050565b6000613d4082612ac0565b9150613d4b83612ac0565b9250828201905080821115613d6357613d62613aea565b5b92915050565b6000613d7482612ac0565b9150613d7f83612ac0565b9250828203905081811115613d9757613d96613aea565b5b92915050565b7f7472616e7366657220746f6b656e20697320746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613df9602283613017565b9150613e0482613d9d565b604082019050919050565b60006020820190508181036000830152613e2881613dec565b9050919050565b6000613e3a82612ac0565b9150613e4583612ac0565b9250828202613e5381612ac0565b91508282048414831517613e6a57613e69613aea565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613eab82612ac0565b9150613eb683612ac0565b925082613ec657613ec5613e71565b5b828204905092915050565b7f616d6f756e74206d7573742062652067726561746572207468616e207a65726f600082015250565b6000613f07602083613017565b9150613f1282613ed1565b602082019050919050565b60006020820190508181036000830152613f3681613efa565b9050919050565b7f7769746864726177206164647265737320697320746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613f99602483613017565b9150613fa482613f3d565b604082019050919050565b60006020820190508181036000830152613fc881613f8c565b9050919050565b7f496e73756666696369656e742062616c616e6365000000000000000000000000600082015250565b6000614005601483613017565b915061401082613fcf565b602082019050919050565b6000602082019050818103600083015261403481613ff8565b9050919050565b60006040820190506140506000830185612cdf565b61405d6020830184612db6565b9392505050565b7f42616c616e636520646964206e6f74206465637265617365206173206578706560008201527f6374656400000000000000000000000000000000000000000000000000000000602082015250565b60006140c0602483613017565b91506140cb82614064565b604082019050919050565b600060208201905081810360008301526140ef816140b3565b9050919050565b600060608201905061410b6000830186612cdf565b6141186020830185612cdf565b6141256040830184612db6565b949350505050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000614189602a83613017565b91506141948261412d565b604082019050919050565b600060208201905081810360008301526141b88161417c565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b600061421b602683613017565b9150614226826141bf565b604082019050919050565b6000602082019050818103600083015261424a8161420e565b9050919050565b600081519050919050565b600081905092915050565b60005b8381101561428557808201518184015260208101905061426a565b60008484015250505050565b600061429c82614251565b6142a6818561425c565b93506142b6818560208601614267565b80840191505092915050565b60006142ce8284614291565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b600061430f601d83613017565b915061431a826142d9565b602082019050919050565b6000602082019050818103600083015261433e81614302565b9050919050565b600081519050919050565b6000601f19601f8301169050919050565b600061436c82614345565b6143768185613017565b9350614386818560208601614267565b61438f81614350565b840191505092915050565b600060208201905081810360008301526143b48184614361565b90509291505056fea264697066735822122006b92ee76d765ff010d7b10074cb096c153f70e5e443e7bf78c6d4887d89828f64736f6c63430008110033

Verified Source Code Partial Match

Compiler: v0.8.17+commit.8df45f5f EVM: london Optimization: No
BlockATMCollect.sol 950 lines
// File: contracts/IBlockATMCustomer.sol


pragma solidity >=0.8.0 <=0.8.17;

interface IBlockATMCustomer {
    
    function getOwnerAddressFlag(address ownerAddress) external returns(bool);
}
// File: contracts/IBlockFee.sol


pragma solidity >=0.8.0 <=0.8.17;

interface IBlockFee {

    // Check if the token address is supported as a fee token
    function isSupportedFeeToken(address tokenAddress) external view returns (bool);

    // Check if the token is a stable coin
    function isStableCoin(address tokenAddress) external view returns (bool);

    function subFee(bool safe,address tokenAddress,address from,uint256 amount,uint256 id,uint256 subType) external returns (bool);

    function subFee(bool safe,address from,uint256 id,uint256 subType) external returns (bool);

    function feeReceiverAddress() external returns(address);
}
// File: contracts/BlockUtils.sol


pragma solidity >=0.8.0 <=0.8.17;

contract BlockUtils {


    modifier checkAmount(uint256 amount) {
        require(amount > 0, "amount must be greater than zero");
        _;
    }

    // "transfer token is the zero address"
    modifier checkTokenAddress(address tokenAddress){
        require(tokenAddress != address(0), "transfer token is the zero address");
        _;
    }

    modifier checkWithdrawAddress(address withdrawAddress){
        require(withdrawAddress != address(0), "withdraw address is the zero address");
        _;
    }

    modifier checkAddress(address newAddress){
        require(newAddress != address(0), "address is the zero address");
        _;
    }

}
// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.8.0/contracts/token/ERC20/IERC20.sol


// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.8.0/contracts/token/ERC20/extensions/draft-IERC20Permit.sol


// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.8.0/contracts/utils/Address.sol


// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.8.0/contracts/token/ERC20/utils/SafeERC20.sol


// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;




/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

// File: contracts/BlockCommon.sol


pragma solidity >=0.8.0 <=0.8.17;




contract BlockCommon is BlockUtils {

    using SafeERC20 for IERC20;

    function transferFrom(address tokenAddress,address from,address to,uint256 amount) internal checkTokenAddress(tokenAddress) returns(uint256) {
        if (amount > 0){
            IERC20 erc20 = IERC20(tokenAddress);
            erc20.safeTransferFrom(from, to, amount);
        }
        return amount;
    }

    function transferFrom(address tokenAddress,address from,address to) internal checkTokenAddress(tokenAddress) returns(uint256) {
        IERC20 erc20 = IERC20(tokenAddress);
        uint256 beforeAmount = erc20.balanceOf(from);
        return transferFrom(tokenAddress,from,to,beforeAmount);
    }

    function transferCommon(address tokenAddress,address to,uint256 amount) internal checkTokenAddress(tokenAddress) checkAmount(amount) returns(uint256) {
        IERC20 erc20 = IERC20(tokenAddress);
        uint256 beforeAmount = erc20.balanceOf(to);
        erc20.safeTransferFrom(msg.sender, to, amount);
        uint256 afterAmount = erc20.balanceOf(to);
        uint256 finalAmount = afterAmount - beforeAmount;
        require(finalAmount <= amount, "FinalAmount is error");
        return finalAmount;
    }

    function withdrawCommon(bool flag,address tokenAddress,address withdrawAddress,uint256 amount) internal checkAmount(amount) checkTokenAddress(tokenAddress) checkWithdrawAddress(withdrawAddress) {
        IERC20 erc20 = IERC20(tokenAddress);
        uint256 balance = erc20.balanceOf(address(this));
        require(balance >= amount, "Insufficient balance");
        if(flag){
            erc20.safeTransfer(withdrawAddress, amount);
        } else {
            erc20.transfer(withdrawAddress, amount);
            uint256 afterBalance = erc20.balanceOf(address(this));
            require(balance - afterBalance == amount, "Balance did not decrease as expected");
        }

    }

}
// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.8.0/contracts/utils/Context.sol


// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.8.0/contracts/access/Ownable.sol


// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;


/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev 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.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// File: contracts/BlockATMCollect.sol


pragma solidity >=0.8.0 <=0.8.17;






contract BlockATMCollect is Ownable,BlockCommon {

    mapping(address=>address) public relationMap;

    mapping(address=>User) private userMap;

    mapping(address=>bool) public bindingMap;

    uint256 constant public FEE_RATE = 4;
    uint256 constant public SUB_TYPE = 3;

    address immutable public feeGateway;
    address[] public supportedTokens;

    struct User{
       address[] financeList;
       mapping (address=>bool) financeMap;
       address owner;
    }

    struct Trade{
        uint256 index;
        address from;
        uint256 amount;
    }

    constructor(address newFeeGateway, address[] memory tokens) checkAddress(newFeeGateway) {
        require(tokens.length > 0, "Tokens array cannot be empty");
        for (uint256 i = 0; i < tokens.length; ++i) {
            require(tokens[i] != address(0), "Token address cannot be zero");
        }
        feeGateway = newFeeGateway;
        supportedTokens = tokens;
    }

    modifier onlyFinance(address customerAddress){
        require(userMap[customerAddress].financeMap[msg.sender],"Not a financial address");
        _;
    }

    modifier onlyUserOwner(address customerAddress){
        require(userMap[customerAddress].owner == msg.sender,"Not a owner address");
        _;
    }

    event BindingRelationship(address sender,address[] array,address[] newOwnerList,address customerAddress);

    event Collect(address indexed sender,address customerAddress,address[] array,Trade[] trade,uint256[] feeAmount,uint256 feeRate);

    event BatchUnbindRelationship(address indexed operator, address indexed customerAddress, address[] addrs);

    function bindingRelationship(bool safe,uint256 id,address[] calldata array,address[] calldata newOwnerList,address customerAddress) checkAddress(customerAddress) public returns (bool){
        require(newOwnerList.length > 0, "New owner list cannot be empty");
        require(userMap[customerAddress].owner == address(0), "Customer address has already been set");
        _bindAddresses(array, customerAddress);
        uint256 oLength = newOwnerList.length;
        User storage v = userMap[customerAddress];
        for (uint256 i = 0; i < oLength; ) {
            address addr = newOwnerList[i];
            require(addr != address(0), "Zero address");
            v.financeMap[addr] = true;
            unchecked { ++i; }
        }
        v.financeList = newOwnerList;
        v.owner = msg.sender;
        IBlockFee(feeGateway).subFee(safe,msg.sender,id,SUB_TYPE);
        emit BindingRelationship(msg.sender,array,newOwnerList,customerAddress);
        return true;
    }

    function _bindAddresses(address[] calldata array, address customerAddress) internal {
        require(array.length > 0, "qr address cannot be empty");
        uint256 length = array.length;
        for (uint256 i = 0; i < length; ) {
            address addr = array[i];
            require(addr != address(0), "Zero address");
            require(relationMap[addr] == address(0), "Address has been bound");
            require(!bindingMap[addr], "Address has been bound");
            // Check that the address has zero balance for all supported tokens
            for (uint256 j = 0; j < supportedTokens.length; ++j) {
                require(IERC20(supportedTokens[j]).balanceOf(addr) == 0, "Token balance not zero");
            }
            relationMap[addr] = customerAddress;
            bindingMap[addr] = true;
            unchecked { ++i; }
        }
    }

    function addRelationship(address[] calldata array,address customerAddress) checkAddress(customerAddress) onlyOwner() public returns (bool){
        User storage v = userMap[customerAddress];
        require(v.financeList.length > 0,"customerAddress is error");
        _bindAddresses(array, customerAddress);
        return true;
    }

    function recoverRelationship(address[] calldata array,address customerAddress) checkAddress(customerAddress) onlyOwner() public returns (bool){
        deleteRelationshipCommon(array, customerAddress);
        return true;
    }

    function recoverAddress(address[] calldata array) onlyOwner() public returns (bool){
        uint256 length = array.length;
        for (uint256 i = 0; i < length; ) {
            address addr = array[i];
            require(relationMap[addr] == address(0),"relationship error");
            require(bindingMap[addr], "address is not bound");
            bindingMap[addr] = false;
            unchecked { ++i; }
        }
        return true;
    }

    function deleteRelationship(address[] calldata array,address customerAddress) checkAddress(customerAddress) onlyUserOwner(customerAddress) public returns (bool){
        deleteRelationshipCommon(array, customerAddress);
        return true;
    }

    function deleteRelationshipCommon(address[] calldata array,address customerAddress) internal {
        uint256 length = array.length;
        for (uint256 i = 0; i < length; ) {
            address addr = array[i];
            require(relationMap[addr] == customerAddress,"relationship error");
            if (relationMap[addr] != address(0)){
                delete relationMap[addr];
            }
            unchecked { ++i; }
        }

        address[] memory fList = userMap[customerAddress].financeList;
        uint256 oLength = fList.length;
        for (uint256 i = 0; i < oLength; ) {
            address addr = fList[i];
            delete userMap[customerAddress].financeMap[addr];
            unchecked { ++i; }
        }
        delete userMap[customerAddress].financeList;
        delete userMap[customerAddress].owner;
        emit BatchUnbindRelationship(msg.sender, customerAddress, array);
    }

    function calcFee(uint256 amount) internal pure returns (uint256 feeAmount) {
        return (amount * FEE_RATE) / 1000;
    }

    function transferToken(address[] calldata currency,Trade[] calldata trade,address customerAddress) internal returns(uint256[] memory){
        uint256 length = trade.length;
        require(length > 0,"trade is null");
        uint256[] memory total = new uint256[](currency.length);
        for (uint256 i = 0; i < length; ) {
            Trade calldata t = trade[i];
            require(t.index < currency.length, "Index out of bounds");
            address token = currency[t.index];
            address from = t.from;
            require(relationMap[from] == customerAddress,"relationship error");
            uint256 sendAmount = t.amount;
            require(sendAmount > 0, "Amount must be positive");
            super.transferFrom(token,from,address(this),sendAmount);
            total[t.index] += sendAmount;
            unchecked { ++i; }
        }
        return total;
    }

    function withdrawToken(bool safe,address currency,uint256 value,address customerAddress,address feeAddress) internal returns(uint256) {
        uint256 feeAmount = 0;
        if (value > 0){
            feeAmount = calcFee(value);
            super.withdrawCommon(safe, currency, customerAddress, value - feeAmount);
            if (feeAmount > 0){
                // send fee
                super.withdrawCommon(safe, currency, feeAddress, feeAmount);
            }
        }
        return feeAmount;
    }

    function collect(bool safe,address[] calldata currency,Trade[] calldata trade,address customerAddress) onlyFinance(customerAddress) public returns (bool){
        require(currency.length > 0, "Currency array cannot be empty");
        require(customerAddress != address(0), "address is the zero address");
        uint256[] memory total = transferToken(currency,trade,customerAddress);
        uint256 fLength = currency.length;
        uint256[] memory feeArray = new uint256[](fLength);
        address feeAddress = IBlockFee(feeGateway).feeReceiverAddress();
        for (uint256 i = 0; i < fLength; ){
            uint256 value = total[i];
            uint256 feeAmount = withdrawToken(safe,currency[i],value,customerAddress,feeAddress);
            feeArray[i] = feeAmount;
            unchecked { ++i; }

        }
        emit Collect(msg.sender,customerAddress,currency,trade,feeArray,FEE_RATE);
        return true;
    }

    function getOwnerUserFlag(address customerAddress,address financeAddress) public view returns(bool){
        return userMap[customerAddress].financeMap[financeAddress];
    }

    function getOwnerUserList(address customerAddress) public view returns(address[] memory){
        return userMap[customerAddress].financeList;
    }

    function getOwner(address customerAddress) public view returns(address){
        return userMap[customerAddress].owner;
    }
}

Read Contract

FEE_RATE 0x2d11c58a → uint256
SUB_TYPE 0x984d6e7a → uint256
bindingMap 0x4c018e97 → bool
feeGateway 0x10a53b9a → address
getOwner 0xfa544161 → address
getOwnerUserFlag 0x0fb12089 → bool
getOwnerUserList 0x3f3ee32a → address[]
owner 0x8da5cb5b → address
relationMap 0x4af2e84c → address
supportedTokens 0xc6255626 → address

Write Contract 8 functions

These functions modify contract state and require a wallet transaction to execute.

addRelationship 0x22d46d63
address[] array
address customerAddress
returns: bool
bindingRelationship 0x078b7089
bool safe
uint256 id
address[] array
address[] newOwnerList
address customerAddress
returns: bool
collect 0x48a80c76
bool safe
address[] currency
tuple[] trade
address customerAddress
returns: bool
deleteRelationship 0x51f3be02
address[] array
address customerAddress
returns: bool
recoverAddress 0x2b4d56f0
address[] array
returns: bool
recoverRelationship 0xe0225b1d
address[] array
address customerAddress
returns: bool
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner

Recent Transactions

No transactions found for this address