Forkchoice Ethereum Mainnet

Address Contract Partially Verified

Address 0x2b35082fa080bF80b8FB33927C07e269c9FE2176
Balance 0 ETH
Nonce 1
Code Size 11602 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

11602 bytes
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80635c60f226116100665780635c60f2261461018157806366e24356146101b1578063715018a6146101e15780638da5cb5b146101eb578063f2fde38b146102095761009e565b806310a53b9a146100a35780632bcc23f8146100c157806333deb5d8146100f1578063421b2d8b1461012157806352560b5714610151575b600080fd5b6100ab610225565b6040516100b89190611915565b60405180910390f35b6100db60048036038101906100d69190611966565b61024b565b6040516100e891906119ae565b60405180910390f35b61010b60048036038101906101069190611b34565b61026b565b60405161011891906119ae565b60405180910390f35b61013b60048036038101906101369190611966565b610290565b60405161014891906119ae565b60405180910390f35b61016b60048036038101906101669190611c12565b610387565b60405161017891906119ae565b60405180910390f35b61019b60048036038101906101969190611966565b61046a565b6040516101a891906119ae565b60405180910390f35b6101cb60048036038101906101c69190611c12565b610558565b6040516101d891906119ae565b60405180910390f35b6101e961060a565b005b6101f361061e565b6040516102009190611915565b60405180910390f35b610223600480360381019061021e9190611966565b610647565b005b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60016020528060005260406000206000915054906101000a900460ff1681565b6000610280893360008b8b8b8b8b8b8b6106ca565b6001905098975050505050505050565b600061029a6109a1565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610327576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161031e90611d4d565b60405180910390fd5b60018060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000878073ffffffffffffffffffffffffffffffffffffffff16636109069a336040518263ffffffff1660e01b81526004016103c39190611915565b6020604051808303816000875af11580156103e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104069190611d99565b610445576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161043c90611e12565b60405180910390fd5b6104598a8a60018b8b8b8b8b8b60006106ca565b600191505098975050505050505050565b60006104746109a1565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610500576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104f790611e7e565b60405180910390fd5b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff021916905560019050919050565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166105e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105dd90611eea565b60405180910390fd5b6105fa898960038a8a8a8a8a8a60006106ca565b6001905098975050505050505050565b6106126109a1565b61061c6000610a1f565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61064f6109a1565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036106be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b590611f7c565b60405180910390fd5b6106c781610a1f565b50565b828290508585905014610712576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070990611fe8565b60405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166355a0c9718c60200160208101906107659190611966565b6040518263ffffffff1660e01b81526004016107819190611915565b602060405180830381865afa15801561079e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c29190611d99565b90506000806108028888856107e9578f60400160208101906107e49190611966565b6107fd565b8f60200160208101906107fc9190611966565b5b610ae3565b91509150821561081d576108188d8d8d84610b00565b610917565b6108298d8d8d84610cbb565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633c0ff5cf8e604001602081019061087a9190611966565b6040518263ffffffff1660e01b81526004016108969190611915565b602060405180830381865afa1580156108b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d79190611d99565b610916576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161090d90612054565b60405180910390fd5b5b6109258d8989898987610fab565b6109308d828561103a565b8b73ffffffffffffffffffffffffffffffffffffffff167fe3d2f5d4315569b784cb75d65c335cd9d2f9cefcd183a0fe0ea2f24769b4360f8e8d848e8e8e8e8e8e338f60405161098a9b9a99989796959493929190612436565b60405180910390a250505050505050505050505050565b6109a961112e565b73ffffffffffffffffffffffffffffffffffffffff166109c761061e565b73ffffffffffffffffffffffffffffffffffffffff1614610a1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a149061251f565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080848490509150610af68284611136565b9050935093915050565b60008203610b3b57610b35846020016020810190610b1e9190611966565b8430848860600135610b30919061256e565b6111cb565b50610cb5565b6001821480610b4a5750600382145b15610cb45760008460800135828660600135610b66919061256e565b610b70919061256e565b9050846000016020810190610b8591906125a2565b15610c20578373ffffffffffffffffffffffffffffffffffffffff16630b8c418a866020016020810190610bb99190611966565b836040518363ffffffff1660e01b8152600401610bd79291906125cf565b6020604051808303816000875af1158015610bf6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1a9190611d99565b50610cb2565b8373ffffffffffffffffffffffffffffffffffffffff166335689dbf866020016020810190610c4f9190611966565b836040518363ffffffff1660e01b8152600401610c6d9291906125cf565b6020604051808303816000875af1158015610c8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb09190611d99565b505b505b5b50505050565b60008203610d0a57610ce5846020016020810190610cd99190611966565b843087606001356111cb565b50610d04846040016020810190610cfc9190611966565b8430846111cb565b50610fa5565b6001821480610d195750600382145b15610fa45760008390506000856080013583610d35919061256e565b9050856000016020810190610d4a91906125a2565b15610e7a578173ffffffffffffffffffffffffffffffffffffffff16630b8c418a876020016020810190610d7e9190611966565b88606001356040518363ffffffff1660e01b8152600401610da09291906125cf565b6020604051808303816000875af1158015610dbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de39190611d99565b508173ffffffffffffffffffffffffffffffffffffffff16630b8c418a876040016020810190610e139190611966565b836040518363ffffffff1660e01b8152600401610e319291906125cf565b6020604051808303816000875af1158015610e50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e749190611d99565b50610fa1565b8173ffffffffffffffffffffffffffffffffffffffff166335689dbf876020016020810190610ea99190611966565b88606001356040518363ffffffff1660e01b8152600401610ecb9291906125cf565b6020604051808303816000875af1158015610eea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0e9190611d99565b508173ffffffffffffffffffffffffffffffffffffffff166335689dbf876040016020810190610f3e9190611966565b836040518363ffffffff1660e01b8152600401610f5c9291906125cf565b6020604051808303816000875af1158015610f7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9f9190611d99565b505b50505b5b50505050565b60005b8181101561103157611026876000016020810190610fcc91906125a2565b886020016020810190610fdf9190611966565b888885818110610ff257610ff16125f8565b5b90506020020160208101906110079190611966565b87878681811061101a576110196125f8565b5b90506020020135611286565b806001019050610fae565b50505050505050565b61112983600001602081019061105091906125a2565b8261106d578460400160208101906110689190611966565b611081565b8460200160208101906110809190611966565b5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f481e8636040518163ffffffff1660e01b81526004016020604051808303816000875af11580156110f0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611114919061263c565b866080013586611124919061256e565b611286565b505050565b600033905090565b6000808273ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611184573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a8919061267e565b905080600a6111b791906127de565b846111c29190612829565b91505092915050565b600084600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361123d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611234906128dd565b60405180910390fd5b600083111561127a5760008690506112788686868473ffffffffffffffffffffffffffffffffffffffff16611531909392919063ffffffff16565b505b82915050949350505050565b80600081116112ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c190612949565b60405180910390fd5b83600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361133a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611331906128dd565b60405180910390fd5b83600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036113aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a1906129db565b60405180910390fd5b600086905060008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016113ea9190611915565b602060405180830381865afa158015611407573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061142b919061267e565b905085811015611470576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146790612a47565b60405180910390fd5b88156114a6576114a187878473ffffffffffffffffffffffffffffffffffffffff166115ba9092919063ffffffff16565b611526565b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb88886040518363ffffffff1660e01b81526004016114e19291906125cf565b6020604051808303816000875af1158015611500573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115249190611d99565b505b505050505050505050565b6115b4846323b872dd60e01b85858560405160240161155293929190612a67565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611640565b50505050565b61163b8363a9059cbb60e01b84846040516024016115d99291906125cf565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611640565b505050565b60006116a2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166117079092919063ffffffff16565b905060008151111561170257808060200190518101906116c29190611d99565b611701576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f890612b10565b60405180910390fd5b5b505050565b6060611716848460008561171f565b90509392505050565b606082471015611764576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161175b90612ba2565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161178d9190612c33565b60006040518083038185875af1925050503d80600081146117ca576040519150601f19603f3d011682016040523d82523d6000602084013e6117cf565b606091505b50915091506117e0878383876117ec565b92505050949350505050565b6060831561184e5760008351036118465761180685611861565b611845576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183c90612c96565b60405180910390fd5b5b829050611859565b6118588383611884565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000825111156118975781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118cb9190612cfa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006118ff826118d4565b9050919050565b61190f816118f4565b82525050565b600060208201905061192a6000830184611906565b92915050565b600080fd5b600080fd5b611943816118f4565b811461194e57600080fd5b50565b6000813590506119608161193a565b92915050565b60006020828403121561197c5761197b611930565b5b600061198a84828501611951565b91505092915050565b60008115159050919050565b6119a881611993565b82525050565b60006020820190506119c3600083018461199f565b92915050565b600080fd5b600060a082840312156119e4576119e36119c9565b5b81905092915050565b600080fd5b600080fd5b600080fd5b60008083601f840112611a1257611a116119ed565b5b8235905067ffffffffffffffff811115611a2f57611a2e6119f2565b5b602083019150836020820283011115611a4b57611a4a6119f7565b5b9250929050565b60008083601f840112611a6857611a676119ed565b5b8235905067ffffffffffffffff811115611a8557611a846119f2565b5b602083019150836020820283011115611aa157611aa06119f7565b5b9250929050565b60008083601f840112611abe57611abd6119ed565b5b8235905067ffffffffffffffff811115611adb57611ada6119f2565b5b602083019150836020820283011115611af757611af66119f7565b5b9250929050565b6000819050919050565b611b1181611afe565b8114611b1c57600080fd5b50565b600081359050611b2e81611b08565b92915050565b600080600080600080600080610120898b031215611b5557611b54611930565b5b6000611b638b828c016119ce565b98505060a089013567ffffffffffffffff811115611b8457611b83611935565b5b611b908b828c016119fc565b975097505060c089013567ffffffffffffffff811115611bb357611bb2611935565b5b611bbf8b828c01611a52565b955095505060e089013567ffffffffffffffff811115611be257611be1611935565b5b611bee8b828c01611aa8565b9350935050610100611c028b828c01611b1f565b9150509295985092959890939650565b600080600080600080600080610120898b031215611c3357611c32611930565b5b6000611c418b828c016119ce565b98505060a0611c528b828c01611951565b97505060c089013567ffffffffffffffff811115611c7357611c72611935565b5b611c7f8b828c016119fc565b965096505060e089013567ffffffffffffffff811115611ca257611ca1611935565b5b611cae8b828c01611a52565b945094505061010089013567ffffffffffffffff811115611cd257611cd1611935565b5b611cde8b828c01611aa8565b92509250509295985092959890939650565b600082825260208201905092915050565b7f4164647265737320616c72656164792065786973747300000000000000000000600082015250565b6000611d37601683611cf0565b9150611d4282611d01565b602082019050919050565b60006020820190508181036000830152611d6681611d2a565b9050919050565b611d7681611993565b8114611d8157600080fd5b50565b600081519050611d9381611d6d565b92915050565b600060208284031215611daf57611dae611930565b5b6000611dbd84828501611d84565b91505092915050565b7f4e6f7420612066696e616e6369616c2061646472657373000000000000000000600082015250565b6000611dfc601783611cf0565b9150611e0782611dc6565b602082019050919050565b60006020820190508181036000830152611e2b81611def565b9050919050565b7f4164647265737320686173206265656e2064656c657465640000000000000000600082015250565b6000611e68601883611cf0565b9150611e7382611e32565b602082019050919050565b60006020820190508181036000830152611e9781611e5b565b9050919050565b7f4e6f742061205573657220616464726573730000000000000000000000000000600082015250565b6000611ed4601283611cf0565b9150611edf82611e9e565b602082019050919050565b60006020820190508181036000830152611f0381611ec7565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000611f66602683611cf0565b9150611f7182611f0a565b604082019050919050565b60006020820190508181036000830152611f9581611f59565b9050919050565b7f4172726179206c656e677468206d69736d617463680000000000000000000000600082015250565b6000611fd2601583611cf0565b9150611fdd82611f9c565b602082019050919050565b6000602082019050818103600083015261200181611fc5565b9050919050565b7f666565546f6b656e41646472657373206973206e6f7420537570706f72740000600082015250565b600061203e601e83611cf0565b915061204982612008565b602082019050919050565b6000602082019050818103600083015261206d81612031565b9050919050565b60008135905061208381611d6d565b92915050565b60006120986020840184612074565b905092915050565b6120a981611993565b82525050565b60006120be6020840184611951565b905092915050565b6120cf816118f4565b82525050565b60006120e46020840184611b1f565b905092915050565b6120f581611afe565b82525050565b60a0820161210c6000830183612089565b61211960008501826120a0565b5061212760208301836120af565b61213460208501826120c6565b5061214260408301836120af565b61214f60408501826120c6565b5061215d60608301836120d5565b61216a60608501826120ec565b5061217860808301836120d5565b61218560808501826120ec565b50505050565b61219481611afe565b82525050565b600082825260208201905092915050565b6000819050919050565b600082825260208201905092915050565b82818337600083830152505050565b6000601f19601f8301169050919050565b60006121f283856121b5565b93506121ff8385846121c6565b612208836121d5565b840190509392505050565b60006122208484846121e6565b90509392505050565b600080fd5b600080fd5b600080fd5b6000808335600160200384360303811261225557612254612233565b5b83810192508235915060208301925067ffffffffffffffff82111561227d5761227c612229565b5b6001820236038313156122935761229261222e565b5b509250929050565b6000602082019050919050565b60006122b4838561219a565b9350836020840285016122c6846121ab565b8060005b8781101561230c5784840389526122e18284612238565b6122ec868284612213565b95506122f78461229b565b935060208b019a5050506001810190506122ca565b50829750879450505050509392505050565b600082825260208201905092915050565b6000819050919050565b600061234583836120c6565b60208301905092915050565b6000602082019050919050565b600061236a838561231e565b93506123758261232f565b8060005b858110156123ae5761238b82846120af565b6123958882612339565b97506123a083612351565b925050600181019050612379565b5085925050509392505050565b600082825260208201905092915050565b600080fd5b82818337505050565b60006123e683856123bb565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115612419576124186123cc565b5b60208302925061242a8385846123d1565b82840190509392505050565b60006101808201905061244c600083018e6120fb565b61245960a083018d61218b565b61246660c083018c61218b565b81810360e0830152612479818a8c6122a8565b905081810361010083015261248f81888a61235e565b90508181036101208301526124a58186886123da565b90506124b5610140830185611906565b6124c361016083018461218b565b9c9b505050505050505050505050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612509602083611cf0565b9150612514826124d3565b602082019050919050565b60006020820190508181036000830152612538816124fc565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061257982611afe565b915061258483611afe565b925082820190508082111561259c5761259b61253f565b5b92915050565b6000602082840312156125b8576125b7611930565b5b60006125c684828501612074565b91505092915050565b60006040820190506125e46000830185611906565b6125f1602083018461218b565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000815190506126368161193a565b92915050565b60006020828403121561265257612651611930565b5b600061266084828501612627565b91505092915050565b60008151905061267881611b08565b92915050565b60006020828403121561269457612693611930565b5b60006126a284828501612669565b91505092915050565b60008160011c9050919050565b6000808291508390505b6001851115612702578086048111156126de576126dd61253f565b5b60018516156126ed5780820291505b80810290506126fb856126ab565b94506126c2565b94509492505050565b60008261271b57600190506127d7565b8161272957600090506127d7565b816001811461273f576002811461274957612778565b60019150506127d7565b60ff84111561275b5761275a61253f565b5b8360020a9150848211156127725761277161253f565b5b506127d7565b5060208310610133831016604e8410600b84101617156127ad5782820a9050838111156127a8576127a761253f565b5b6127d7565b6127ba84848460016126b8565b925090508184048111156127d1576127d061253f565b5b81810290505b9392505050565b60006127e982611afe565b91506127f483611afe565b92506128217fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848461270b565b905092915050565b600061283482611afe565b915061283f83611afe565b925082820261284d81611afe565b915082820484148315176128645761286361253f565b5b5092915050565b7f7472616e7366657220746f6b656e20697320746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006128c7602283611cf0565b91506128d28261286b565b604082019050919050565b600060208201905081810360008301526128f6816128ba565b9050919050565b7f616d6f756e74206d7573742062652067726561746572207468616e207a65726f600082015250565b6000612933602083611cf0565b915061293e826128fd565b602082019050919050565b6000602082019050818103600083015261296281612926565b9050919050565b7f7769746864726177206164647265737320697320746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006129c5602483611cf0565b91506129d082612969565b604082019050919050565b600060208201905081810360008301526129f4816129b8565b9050919050565b7f496e73756666696369656e742062616c616e6365000000000000000000000000600082015250565b6000612a31601483611cf0565b9150612a3c826129fb565b602082019050919050565b60006020820190508181036000830152612a6081612a24565b9050919050565b6000606082019050612a7c6000830186611906565b612a896020830185611906565b612a96604083018461218b565b949350505050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000612afa602a83611cf0565b9150612b0582612a9e565b604082019050919050565b60006020820190508181036000830152612b2981612aed565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000612b8c602683611cf0565b9150612b9782612b30565b604082019050919050565b60006020820190508181036000830152612bbb81612b7f565b9050919050565b600081519050919050565b600081905092915050565b60005b83811015612bf6578082015181840152602081019050612bdb565b60008484015250505050565b6000612c0d82612bc2565b612c178185612bcd565b9350612c27818560208601612bd8565b80840191505092915050565b6000612c3f8284612c02565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000612c80601d83611cf0565b9150612c8b82612c4a565b602082019050919050565b60006020820190508181036000830152612caf81612c73565b9050919050565b600081519050919050565b6000612ccc82612cb6565b612cd68185611cf0565b9350612ce6818560208601612bd8565b612cef816121d5565b840191505092915050565b60006020820190508181036000830152612d148184612cc1565b90509291505056fea2646970667358221220e71e7b0a2f74d389d16c2796eb26b490f07ffebd99e81d90f4a6bf3f1b98466b64736f6c63430008110033

Verified Source Code Partial Match

Compiler: v0.8.17+commit.8df45f5f EVM: london Optimization: No
BlockATMProxyPayout.sol 884 lines
// 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);
        }

    }

}
// 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/IBlockATMPayout.sol


pragma solidity >=0.8.0 <=0.8.17;

interface IBlockATMPayout {

    function transferToProxy(address tokenAddress,uint256 amount) external  returns(bool);

    function safeTransferToProxy(address tokenAddress,uint256 amount) external  returns(bool);

    function getOwnerAddressFlag(address ownerAddress) external returns(bool);    
}
// 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/BlockATMProxyPayout.sol


pragma solidity >=0.8.0 <=0.8.17;





interface ICustomizeERC20 is IERC20 {

    function decimals() external view returns (uint256);
}


contract BlockATMProxyPayout is Ownable,BlockCommon {

    mapping (address=>bool) public userMap;

    address public feeGateway;

    constructor(address newFeeGateway){
        feeGateway = newFeeGateway;
    }

    struct Payout{
        bool safe;
        address tokenAddress;
        address feeTokenAddress;
        uint256 total;
        uint256 gasAmount;
    }

    event PayoutToken(address indexed from,Payout payout,uint256 payType,uint256 feeAmount,string[] orderNo,address[]  array,uint256[] amount,address sendAddress,uint256 id);

    modifier onlyFinancials(address payoutAddress){
        require(IBlockATMPayout(payoutAddress).getOwnerAddressFlag(msg.sender),"Not a financial address");
        _;
    }

    modifier onlyUser(){
        require(userMap[msg.sender],"Not a User address");
        _;
    }

    function addUser(address userAddress) public onlyOwner() returns (bool){
        require(!userMap[userAddress],"Address already exists");
        userMap[userAddress] = true;
        return true;
    }

    function deleteUser(address userAddress) public onlyOwner() returns (bool){
        require(userMap[userAddress],"Address has been deleted");
        delete userMap[userAddress];
        return true;
    }


    function calcFee(uint256 length,ICustomizeERC20 erc20) internal view returns (uint256 feeAmount) {
        uint256 decimals = erc20.decimals();
        return length * (10**(decimals));
    }

    function getSendAmount(address[] calldata array,address tokenAddress) internal view returns (uint256 length,uint256 feeAmount){
        length = array.length;
        feeAmount = calcFee(length, ICustomizeERC20(tokenAddress));
        return (length,feeAmount);
    }

    function payoutByWallet(Payout calldata payout,string[] calldata orderNo,address[] calldata array,uint256[] calldata amount,uint256 id) public returns (bool){
        payoutToken(payout,msg.sender, 0, orderNo, array, amount,id);
        return true;
    }


    function payoutByContract(Payout calldata payout,address payoutAddress,string[] calldata orderNo,address[] calldata array,uint256[] calldata amount) public onlyFinancials(payoutAddress) returns (bool){
        payoutToken(payout, payoutAddress, 1,orderNo, array, amount,0);
        return true;
    }

    function payoutByProxy(Payout calldata payout,address payoutAddress,string[] calldata orderNo,address[] calldata array,uint256[] calldata amount) public onlyUser() returns (bool){
        payoutToken(payout, payoutAddress, 3, orderNo, array, amount,0);
        return true;
    }

    function _transferStableTokens(Payout calldata payout,address from,uint256 payType, uint256 feeAmount) private {
        if (payType == 0) {
            super.transferFrom(payout.tokenAddress, from, address(this), payout.total + feeAmount);
        } else if (payType == 1 || payType == 3) {
            uint256 all = payout.total + feeAmount + payout.gasAmount;
            if (payout.safe) {
                IBlockATMPayout(from).safeTransferToProxy(payout.tokenAddress, all);
            } else {
                IBlockATMPayout(from).transferToProxy(payout.tokenAddress, all);
            }
        }
    }

    function _transferTokens(Payout calldata payout,address from,uint256 payType, uint256 feeAmount) private {
        if (payType == 0) {
            super.transferFrom(payout.tokenAddress, from, address(this), payout.total);
            super.transferFrom(payout.feeTokenAddress, from, address(this), feeAmount);
        } else if (payType == 1 || payType == 3) {
            IBlockATMPayout blockATMPayout = IBlockATMPayout(from);
            uint256 allFee = feeAmount + payout.gasAmount;
            if (payout.safe) {
                blockATMPayout.safeTransferToProxy(payout.tokenAddress, payout.total);
                blockATMPayout.safeTransferToProxy(payout.feeTokenAddress, allFee);
            } else {
                blockATMPayout.transferToProxy(payout.tokenAddress, payout.total);
                blockATMPayout.transferToProxy(payout.feeTokenAddress, allFee);
            }
        }
    }

    function _processBatchPayments(Payout calldata payout, address[] calldata receivers, uint256[] calldata amounts, uint256 length) private {
        for (uint256 i = 0; i < length; ) {
            super.withdrawCommon(payout.safe, payout.tokenAddress, receivers[i], amounts[i]);
            unchecked { ++i; }
        }
    }

    function _sendPayoutFee(Payout calldata payout,uint256 feeAmount,bool stable) private {
        
        super.withdrawCommon(payout.safe, stable?payout.tokenAddress:payout.feeTokenAddress, IBlockFee(feeGateway).feeReceiverAddress(), feeAmount + payout.gasAmount);
    }

    function payoutToken(Payout calldata payout,address from,uint256 payType,string[] calldata orderNo, address[] calldata array, uint256[] calldata amount, uint256 id) internal {
        require(array.length == amount.length, "Array length mismatch");

        bool stable = IBlockFee(feeGateway).isStableCoin(payout.tokenAddress);
        (uint256 length, uint256 feeAmount) = getSendAmount(array, stable?payout.tokenAddress:payout.feeTokenAddress);
        
        if (stable){
            _transferStableTokens(payout, from, payType, feeAmount);
        } else {
            _transferTokens(payout, from, payType, feeAmount);
            require(IBlockFee(feeGateway).isSupportedFeeToken(payout.feeTokenAddress),"feeTokenAddress is not Support");
        }
        
        _processBatchPayments(payout, array, amount, length);
        
        _sendPayoutFee(payout,feeAmount,stable);
        
        emit PayoutToken(from, payout, payType, feeAmount, orderNo, array, amount, msg.sender, id);
    }

}

Read Contract

feeGateway 0x10a53b9a → address
owner 0x8da5cb5b → address
userMap 0x2bcc23f8 → bool

Write Contract 7 functions

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

addUser 0x421b2d8b
address userAddress
returns: bool
deleteUser 0x5c60f226
address userAddress
returns: bool
payoutByContract 0x3edad0ae
tuple payout
address payoutAddress
string[] orderNo
address[] array
uint256[] amount
returns: bool
payoutByProxy 0x3bf7e714
tuple payout
address payoutAddress
string[] orderNo
address[] array
uint256[] amount
returns: bool
payoutByWallet 0xf3017022
tuple payout
string[] orderNo
address[] array
uint256[] amount
uint256 id
returns: bool
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner

Recent Transactions

No transactions found for this address