Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0xa5a2Af22EAc6f050227d844B108c2B2A011FD329
Balance 0.205287 ETH
Nonce 4
Code Size 18054 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

18054 bytes
0x60806040526004361061039b5760003560e01c806395d89b41116101dc578063d73cf08011610102578063e98d2c4b116100a0578063f2fde38b1161006f578063f2fde38b14610bbb578063f7505bc014610bee578063f84354f114610c18578063fb1eb14b14610c4b576103a2565b8063e98d2c4b14610b1f578063eed83f1114610b49578063efeb97e114610b5e578063f2cc0c1814610b88576103a2565b8063e4111dd3116100dc578063e4111dd314610acb578063e4451f6614610ae0578063e563037e14610af5578063e8598c8714610b0a576103a2565b8063d73cf08014610a2b578063dc17493714610a66578063dd62ed3e14610a90576103a2565b8063a4f4a7651161017a578063c329581711610149578063c3295817146109a4578063c9e6da19146109b9578063cba0e996146109ce578063d51486df14610a01576103a2565b8063a4f4a76514610917578063a9059cbb1461092c578063b6c1b37e14610965578063b7cc02f91461098f576103a2565b80639d6f83e4116101b65780639d6f83e4146108885780639f9a4e7f1461089d578063a0ac5e19146108c9578063a457c2d7146108de576103a2565b806395d89b4114610830578063963547041461084557806397a9d5601461085a576103a2565b80634a1e7726116102c157806370a082311161025f5780638aadb8091161022e5780638aadb809146107dc5780638b1bdcb2146107f15780638da5cb5b1461080657806394e107841461081b576103a2565b806370a082311461076a578063715018a61461079d5780637d1db4a5146107b257806385d1e038146107c7576103a2565b8063583e05681161029b578063583e0568146106e55780635880b873146107165780635afbfd3814610740578063674b80ee14610755576103a2565b80634a1e7726146106915780634a74bb02146106bb5780634ada218b146106d0576103a2565b806323b872dd11610339578063313ce56711610308578063313ce567146105e657806339509351146106115780633b124fe71461064a5780634549b0391461065f576103a2565b806323b872dd1461052557806326f5ccaa146105685780632d838119146105925780632ec8e523146105bc576103a2565b8063171778081161037557806317177808146104aa57806318160ddd146104d1578063185d374c146104e65780631bbae6e0146104fb576103a2565b8063053ab182146103a757806306fdde03146103d3578063095ea7b31461045d576103a2565b366103a257005b600080fd5b3480156103b357600080fd5b506103d1600480360360208110156103ca57600080fd5b5035610c60565b005b3480156103df57600080fd5b506103e8610d3a565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561042257818101518382015260200161040a565b50505050905090810190601f16801561044f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561046957600080fd5b506104966004803603604081101561048057600080fd5b506001600160a01b038135169060200135610dd0565b604080519115158252519081900360200190f35b3480156104b657600080fd5b506104bf610dee565b60408051918252519081900360200190f35b3480156104dd57600080fd5b506104bf610df4565b3480156104f257600080fd5b506104bf610dfa565b34801561050757600080fd5b506103d16004803603602081101561051e57600080fd5b5035610e00565b34801561053157600080fd5b506104966004803603606081101561054857600080fd5b506001600160a01b03813581169160208101359091169060400135610ed9565b34801561057457600080fd5b506103d16004803603602081101561058b57600080fd5b5035610f60565b34801561059e57600080fd5b506104bf600480360360208110156105b557600080fd5b5035611040565b3480156105c857600080fd5b506103d1600480360360208110156105df57600080fd5b50356110a2565b3480156105f257600080fd5b506105fb611135565b6040805160ff9092168252519081900360200190f35b34801561061d57600080fd5b506104966004803603604081101561063457600080fd5b506001600160a01b03813516906020013561113e565b34801561065657600080fd5b506104bf61118c565b34801561066b57600080fd5b506104bf6004803603604081101561068257600080fd5b50803590602001351515611192565b34801561069d57600080fd5b506103d1600480360360208110156106b457600080fd5b5035611224565b3480156106c757600080fd5b5061049661134d565b3480156106dc57600080fd5b5061049661135b565b3480156106f157600080fd5b506106fa61136a565b604080516001600160a01b039092168252519081900360200190f35b34801561072257600080fd5b506103d16004803603602081101561073957600080fd5b503561138e565b34801561074c57600080fd5b506106fa611468565b34801561076157600080fd5b506103d161147e565b34801561077657600080fd5b506104bf6004803603602081101561078d57600080fd5b50356001600160a01b0316611804565b3480156107a957600080fd5b506103d1611866565b3480156107be57600080fd5b506104bf611908565b3480156107d357600080fd5b506104bf61190e565b3480156107e857600080fd5b506104bf611914565b3480156107fd57600080fd5b506106fa61191a565b34801561081257600080fd5b506106fa611929565b34801561082757600080fd5b506104bf611938565b34801561083c57600080fd5b506103e861195b565b34801561085157600080fd5b506104bf6119bc565b34801561086657600080fd5b5061086f6119c2565b6040805192835260208301919091528051918290030190f35b34801561089457600080fd5b506104bf611b25565b3480156108a957600080fd5b506103d1600480360360208110156108c057600080fd5b50351515611b2b565b3480156108d557600080fd5b506103d1611bd2565b3480156108ea57600080fd5b506104966004803603604081101561090157600080fd5b506001600160a01b038135169060200135611c66565b34801561092357600080fd5b506106fa611cce565b34801561093857600080fd5b506104966004803603604081101561094f57600080fd5b506001600160a01b038135169060200135611cdd565b34801561097157600080fd5b506103d16004803603602081101561098857600080fd5b5035611cf1565b34801561099b57600080fd5b506104bf611d84565b3480156109b057600080fd5b506104bf611d8a565b3480156109c557600080fd5b506106fa611d90565b3480156109da57600080fd5b50610496600480360360208110156109f157600080fd5b50356001600160a01b0316611d9f565b348015610a0d57600080fd5b506103d160048036036020811015610a2457600080fd5b5035611dbd565b348015610a3757600080fd5b506103d160048036036040811015610a4e57600080fd5b506001600160a01b0381358116916020013516611e97565b348015610a7257600080fd5b506103d160048036036020811015610a8957600080fd5b5035612097565b348015610a9c57600080fd5b506104bf60048036036040811015610ab357600080fd5b506001600160a01b038135811691602001351661212a565b348015610ad757600080fd5b506104bf612155565b348015610aec57600080fd5b506104bf61215b565b348015610b0157600080fd5b506106fa612161565b348015610b1657600080fd5b506104bf612170565b348015610b2b57600080fd5b506103d160048036036020811015610b4257600080fd5b5035612176565b348015610b5557600080fd5b506106fa612256565b348015610b6a57600080fd5b506103d160048036036020811015610b8157600080fd5b5035612265565b348015610b9457600080fd5b506103d160048036036020811015610bab57600080fd5b50356001600160a01b031661233b565b348015610bc757600080fd5b506103d160048036036020811015610bde57600080fd5b50356001600160a01b031661259c565b348015610bfa57600080fd5b506103d160048036036020811015610c1157600080fd5b5035612694565b348015610c2457600080fd5b506103d160048036036020811015610c3b57600080fd5b50356001600160a01b0316612767565b348015610c5757600080fd5b506104bf612912565b6000610c6a6129fc565b6001600160a01b03811660009081526004602052604090205490915060ff1615610cc55760405162461bcd60e51b81526004018080602001828103825260348152602001806141936034913960400191505060405180910390fd5b6000610cd083612a00565b505050506001600160a01b038416600090815260016020526040902054919250610cfc91905082612918565b6001600160a01b038316600090815260016020526040902055600a54610d229082612918565b600a55600b54610d329084612a60565b600b55505050565b600d8054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610dc65780601f10610d9b57610100808354040283529160200191610dc6565b820191906000526020600020905b815481529060010190602001808311610da957829003601f168201915b5050505050905090565b6000610de4610ddd6129fc565b8484612aba565b5060015b92915050565b601a5490565b60095490565b600c5481565b610e086129fc565b6000546001600160a01b03908116911614610e58576040805162461bcd60e51b815260206004820181905260248201526000805160206143c7833981519152604482015290519081900360640190fd5b6601c6bf52634000811015610e9e5760405162461bcd60e51b81526004018080602001828103825260338152602001806142eb6033913960400191505060405180910390fd5b60138190556040805182815290517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6000610ee6848484612ba6565b610f5684610ef26129fc565b610f518560405180606001604052806028815260200161439f602891396001600160a01b038a16600090815260036020526040812090610f306129fc565b6001600160a01b031681526020810191909152604001600020549190613046565b612aba565b5060019392505050565b610f686129fc565b6000546001600160a01b03908116911614610fb8576040805162461bcd60e51b815260206004820181905260248201526000805160206143c7833981519152604482015290519081900360640190fd5b60018110158015610fca5750600a8111155b6110055760405162461bcd60e51b815260040180806020018281038252602e81526020018061411a602e913960400191505060405180910390fd5b60198190556040805182815290517f5be5e13332f5fe25d72958c9d03ce5cdb01b189670222a86673715d56e43ce2a9181900360200190a150565b6000600a548211156110835760405162461bcd60e51b81526004018080602001828103825260328152602001806145066032913960400191505060405180910390fd5b600061108d611938565b905061109983826129ba565b9150505b919050565b6110aa6129fc565b6000546001600160a01b039081169116146110fa576040805162461bcd60e51b815260206004820181905260248201526000805160206143c7833981519152604482015290519081900360640190fd5b601d8190556040805182815290517feaed440fcec6c61f9f769421c03cc43636a7ae7ec94dab35cf5b906d2c67b5b89181900360200190a150565b600f5460ff1690565b6000610de461114b6129fc565b84610f51856003600061115c6129fc565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490612a60565b60115481565b60006009548311156111eb576040805162461bcd60e51b815260206004820152601f60248201527f416d6f756e74206d757374206265206c657373207468616e20737570706c7900604482015290519081900360640190fd5b8161120a5760006111fb84612a00565b50939550610de8945050505050565b600061121584612a00565b50929550610de8945050505050565b61122c6129fc565b6000546001600160a01b0390811691161461127c576040805162461bcd60e51b815260206004820181905260248201526000805160206143c7833981519152604482015290519081900360640190fd5b640ba43b7400811015801561129757506516bcc41e90008111155b6112d25760405162461bcd60e51b815260040180806020018281038252603681526020018061424e6036913960400191505060405180910390fd5b60165481116113125760405162461bcd60e51b81526004018080602001828103825260438152602001806144346043913960600191505060405180910390fd5b60148190556040805182815290517f5948780118f41f7c4577ae4619d5cbd064057bd8562d9f7b7e60324053375c009181900360200190a150565b601754610100900460ff1681565b60175462010000900460ff1681565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b6113966129fc565b6000546001600160a01b039081169116146113e6576040805162461bcd60e51b815260206004820181905260248201526000805160206143c7833981519152604482015290519081900360640190fd5b601054600a0a60050281111561142d5760405162461bcd60e51b81526004018080602001828103825260218152602001806142a76021913960400191505060405180910390fd5b60118190556040805182815290517faa4b71ac29531fdea0ef1650c76ef91e3771dac25f4a4dd2a561ff3e0b9a5de29181900360200190a150565b601754630100000090046001600160a01b031690565b6017805460ff19166001179055601b5461149e6114996129fc565b611804565b10156114db5760405162461bcd60e51b81526004018080602001828103825260268152602001806144ba6026913960400191505060405180910390fd5b601d54601c54014211611529576040805162461bcd60e51b81526020600482015260116024820152702a3ab73732b61d102a37b79029b7b7b71760791b604482015290519081900360640190fd5b42601c55601954600854604080516370a0823160e01b815230600482015290516000936115c1936064936115bb936001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561158957600080fd5b505afa15801561159d573d6000803e3d6000fd5b505050506040513d60208110156115b357600080fd5b505190612961565b906129ba565b90506115cc816130dd565b50601e60009054906101000a90046001600160a01b03166001600160a01b0316637d7c2a1c6040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561161d57600080fd5b505af1158015611631573d6000803e3d6000fd5b505050506040513d602081101561164757600080fd5b5050601e54600090611661906001600160a01b0316611804565b9050600061167f60646115bb601a548561296190919063ffffffff16565b9050600061168d8383612918565b90506000611699611938565b905060006116a78383612961565b90506116e26116b68584612961565b600160006116c26129fc565b6001600160a01b0316815260208101919091526040016000205490612a60565b600160006116ee6129fc565b6001600160a01b0390811682526020808301939093526040918201600090812094909455601e541683526001909152812055600c5461172d9084612a60565b600c5560095461173d9084612918565b600955600a5461174d9082612918565b600a556117586129fc565b601e546040805187815290516001600160a01b0393841693929092169160008051602061449a8339815191529181900360200190a3601e546040805185815290516000926001600160a01b03169160008051602061449a833981519152919081900360200190a36040805184815290517f811d4760f1a92875eb76dbd3dc2359544b2f6a000ba5b78784c0b105b3469bd09181900360200190a150506017805460ff1916905550505050565b6001600160a01b03811660009081526004602052604081205460ff161561184457506001600160a01b03811660009081526002602052604090205461109d565b6001600160a01b038216600090815260016020526040902054610de890611040565b61186e6129fc565b6000546001600160a01b039081169116146118be576040805162461bcd60e51b815260206004820181905260248201526000805160206143c7833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60135481565b601c5490565b60145481565b6008546001600160a01b031681565b6000546001600160a01b031690565b60008060006119456119c2565b909250905061195482826129ba565b9250505090565b600e8054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610dc65780601f10610d9b57610100808354040283529160200191610dc6565b60105481565b600a546009546000918291825b600554811015611af3578260016000600584815481106119eb57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611a505750816002600060058481548110611a2957fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611a6757600a5460095494509450505050611b21565b611aa76001600060058481548110611a7b57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490612918565b9250611ae96002600060058481548110611abd57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390612918565b91506001016119cf565b50600954600a54611b03916129ba565b821015611b1b57600a54600954935093505050611b21565b90925090505b9091565b60125481565b611b336129fc565b6000546001600160a01b03908116911614611b83576040805162461bcd60e51b815260206004820181905260248201526000805160206143c7833981519152604482015290519081900360640190fd5b60178054821515610100810261ff00199092169190911790915560408051918252517f53726dfcaf90650aa7eb35524f4d3220f07413c8d6cb404cc8c18bf5591bc1599181900360200190a150565b611bda6129fc565b6000546001600160a01b03908116911614611c2a576040805162461bcd60e51b815260206004820181905260248201526000805160206143c7833981519152604482015290519081900360640190fd5b6017805462ff00001916620100001790556040517f799663458a5ef2936f7fa0c99b3336c69c25890f82974f04e811e5bb359186c790600090a1565b6000610de4611c736129fc565b84610f518560405180606001604052806025815260200161462c6025913960036000611c9d6129fc565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190613046565b6006546001600160a01b031681565b6000610de4611cea6129fc565b8484612ba6565b611cf96129fc565b6000546001600160a01b03908116911614611d49576040805162461bcd60e51b815260206004820181905260248201526000805160206143c7833981519152604482015290519081900360640190fd5b601b8190556040805182815290517f61d458eb71ce9ecb43ee6e4ecd01c659c610f0b0d7c91ac27dc4d2e2d043c1699181900360200190a150565b601b5490565b60155481565b6018546001600160a01b031690565b6001600160a01b031660009081526004602052604090205460ff1690565b611dc56129fc565b6000546001600160a01b03908116911614611e15576040805162461bcd60e51b815260206004820181905260248201526000805160206143c7833981519152604482015290519081900360640190fd5b601054600a0a600502811115611e5c5760405162461bcd60e51b81526004018080602001828103825260228152602001806145386022913960400191505060405180910390fd5b60128190556040805182815290517fc9c3eda55e0c1d7fbf155eefd9be0dcbb00e86498e4a8c8efb530e71d390b9ad9181900360200190a150565b611e9f6129fc565b6000546001600160a01b03908116911614611eef576040805162461bcd60e51b815260206004820181905260248201526000805160206143c7833981519152604482015290519081900360640190fd5b6001600160a01b038216611f4a576040805162461bcd60e51b815260206004820152601d60248201527f54756e6e656c3a20506f6f6c2061646472657373206973207a65726f2e000000604482015290519081900360640190fd5b6001600160a01b038116611f8f5760405162461bcd60e51b81526004018080602001828103825260238152602001806144776023913960400191505060405180910390fd5b6001600160a01b038116301415611fd75760405162461bcd60e51b81526004018080602001828103825260288152602001806145b66028913960400191505060405180910390fd5b6017546001600160a01b03828116630100000090920416141561202b5760405162461bcd60e51b81526004018080602001828103825260328152602001806145846032913960400191505060405180910390fd5b601880546001600160a01b0319166001600160a01b0384811691909117909155601780546301000000600160b81b03191663010000009284169283021790556040517f86eba8651458cc924e4911e8a0a31258558de0474fdc43da05cea932cf130aad90600090a25050565b61209f6129fc565b6000546001600160a01b039081169116146120ef576040805162461bcd60e51b815260206004820181905260248201526000805160206143c7833981519152604482015290519081900360640190fd5b60158190556040805182815290517f4a20ec16ec9328712eee6894b6007fb2e5fc53c50ea4cd271fd9e792a996818e9181900360200190a150565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b60075481565b60195490565b601e546001600160a01b031681565b601d5490565b61217e6129fc565b6000546001600160a01b039081169116146121ce576040805162461bcd60e51b815260206004820181905260248201526000805160206143c7833981519152604482015290519081900360640190fd5b600181101580156121e05750600f8111155b61221b5760405162461bcd60e51b815260040180806020018281038252602c815260200180614373602c913960400191505060405180910390fd5b601a8190556040805182815290517fe3069d1b5c6a34789416db1d3d27b4da922676a150402a5bd9c5d12cdd9a3ea19181900360200190a150565b601f546001600160a01b031681565b61226d6129fc565b6000546001600160a01b039081169116146122bd576040805162461bcd60e51b815260206004820181905260248201526000805160206143c7833981519152604482015290519081900360640190fd5b633b9aca008110156123005760405162461bcd60e51b815260040180806020018281038252603481526020018061431e6034913960400191505060405180910390fd5b60168190556040805182815290517f74272e6f6c75e19c6f48bb75e2724eb55e3e1726f8b81d97f1db21d22ead93dc9181900360200190a150565b6123436129fc565b6000546001600160a01b03908116911614612393576040805162461bcd60e51b815260206004820181905260248201526000805160206143c7833981519152604482015290519081900360640190fd5b737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b03821614156123ef5760405162461bcd60e51b815260040180806020018281038252602a81526020018061440a602a913960400191505060405180910390fd5b6001600160a01b0381163014156124375760405162461bcd60e51b81526004018080602001828103825260298152602001806146036029913960400191505060405180910390fd5b6006546001600160a01b03828116911614156124845760405162461bcd60e51b815260040180806020018281038252602a81526020018061455a602a913960400191505060405180910390fd5b6001600160a01b03811660009081526004602052604090205460ff16156124dc5760405162461bcd60e51b81526004018080602001828103825260238152602001806142846023913960400191505060405180910390fd5b6001600160a01b03811660009081526001602052604090205415612536576001600160a01b03811660009081526001602052604090205461251c90611040565b6001600160a01b0382166000908152600260205260409020555b6001600160a01b03166000818152600460205260408120805460ff191660019081179091556005805491820181559091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319169091179055565b6125a46129fc565b6000546001600160a01b039081169116146125f4576040805162461bcd60e51b815260206004820181905260248201526000805160206143c7833981519152604482015290519081900360640190fd5b6001600160a01b0381166126395760405162461bcd60e51b81526004018080602001828103825260268152602001806141f76026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b61269c6129fc565b6000546001600160a01b039081169116146126ec576040805162461bcd60e51b815260206004820181905260248201526000805160206143c7833981519152604482015290519081900360640190fd5b600281111561272c5760405162461bcd60e51b815260040180806020018281038252602781526020018061416c6027913960400191505060405180910390fd5b60108190556040805182815290517f1a7d0c0e85c956e4756c1a912c675c28814c419a7e8fc66c1f0512ea332fc1909181900360200190a150565b61276f6129fc565b6000546001600160a01b039081169116146127bf576040805162461bcd60e51b815260206004820181905260248201526000805160206143c7833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526004602052604090205460ff166128165760405162461bcd60e51b81526004018080602001828103825260238152602001806142c86023913960400191505060405180910390fd5b60005b60055481101561290e57816001600160a01b03166005828154811061283a57fe5b6000918252602090912001546001600160a01b031614156129065760058054600019810190811061286757fe5b600091825260209091200154600580546001600160a01b03909216918390811061288d57fe5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600282526040808220829055600490925220805460ff1916905560058054806128df57fe5b600082815260209020810160001990810180546001600160a01b031916905501905561290e565b600101612819565b5050565b600b5481565b600061295a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613046565b9392505050565b60008261297057506000610de8565b8282028284828161297d57fe5b041461295a5760405162461bcd60e51b81526004018080602001828103825260218152602001806143526021913960400191505060405180910390fd5b600061295a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613248565b3390565b6000806000806000806000806000612a208a6011546012546010546132ad565b9250925092506000612a30611938565b90506000806000612a438e878787613307565b919e509c509a509598509396509194505050505091939550919395565b60008282018381101561295a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b038316612aff5760405162461bcd60e51b81526004018080602001828103825260258152602001806145de6025913960400191505060405180910390fd5b6001600160a01b038216612b445760405162461bcd60e51b81526004018080602001828103825260238152602001806143e76023913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316612beb5760405162461bcd60e51b81526004018080602001828103825260268152602001806144e06026913960400191505060405180910390fd5b6001600160a01b038216612c305760405162461bcd60e51b81526004018080602001828103825260248152602001806141486024913960400191505060405180910390fd5b60008111612c6f5760405162461bcd60e51b815260040180806020018281038252603181526020018061421d6031913960400191505060405180910390fd5b612c77611929565b6001600160a01b0316836001600160a01b031614158015612cb15750612c9b611929565b6001600160a01b0316826001600160a01b031614155b8015612cc0575060175460ff16155b15612dce57601354811115612d065760405162461bcd60e51b81526004018080602001828103825260308152602001806141c76030913960400191505060405180910390fd5b6018546001600160a01b0316612d1a6129fc565b6001600160a01b03161480612d6757507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316612d5c6129fc565b6001600160a01b0316145b8015612d7c575060175462010000900460ff16155b15612dce576040805162461bcd60e51b815260206004820152601c60248201527f54756e6e656c3a2074726164696e672069732064697361626c65642e00000000604482015290519081900360640190fd5b60175460ff16612eed576000612de330611804565b60145490915081108015908190612e0557506018546001600160a01b03163314155b8015612e185750601754610100900460ff165b15612eea577f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015612e7657600080fd5b505afa158015612e8a573d6000803e3d6000fd5b505050506040513d6020811015612ea057600080fd5b5051601754630100000090046001600160a01b0390811691161415612ecd57612ec882613357565b612eea565b601754612eea90630100000090046001600160a01b0316836134ae565b50505b6001600160a01b03831660009081526004602052604090205460ff168015612f2e57506001600160a01b03821660009081526004602052604090205460ff16155b15612f4357612f3e8383836136f4565b613041565b6001600160a01b03831660009081526004602052604090205460ff16158015612f8457506001600160a01b03821660009081526004602052604090205460ff165b15612f9457612f3e8383836138f7565b6001600160a01b03831660009081526004602052604090205460ff16158015612fd657506001600160a01b03821660009081526004602052604090205460ff16155b15612fe657612f3e838383613a24565b6001600160a01b03831660009081526004602052604090205460ff16801561302657506001600160a01b03821660009081526004602052604090205460ff165b1561303657612f3e838383613a89565b613041838383613a24565b505050565b600081848411156130d55760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561309a578181015183820152602001613082565b50505050905090810190601f1680156130c75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6008546040805163095ea7b360e01b81526001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81166004830152602482018590529151600093929092169163095ea7b39160448082019260209290919082900301818787803b15801561315657600080fd5b505af115801561316a573d6000803e3d6000fd5b505050506040513d602081101561318057600080fd5b5050601e546040805163af2979eb60e01b815230600482015260248101859052600060448201819052606482018190526001600160a01b0393841660848301524260a483015291517f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d9093169263af2979eb9260c480840193602093929083900390910190829087803b15801561321657600080fd5b505af115801561322a573d6000803e3d6000fd5b505050506040513d602081101561324057600080fd5b505192915050565b600081836132975760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561309a578181015183820152602001613082565b5060008385816132a357fe5b0495945050505050565b60008080806132c660028601600a0a6115bb8a8a612961565b905060006132de60028701600a0a6115bb8b8a612961565b905060006132f6826132f08c86612918565b90612918565b9a9299509097509095505050505050565b60008080806133168886612961565b905060006133248887612961565b905060006133328888612961565b90506000613344826132f08686612918565b939b939a50919850919650505050505050565b6017805460ff19166001179055601654600090613375908390612918565b905060006133848260026129ba565b905060006133928383612918565b90504761339e83613b1d565b60006133aa4783612918565b90506133b68382613d34565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561340f57600080fd5b505afa158015613423573d6000803e3d6000fd5b505050506040513d602081101561343957600080fd5b5051604080518681526020810184905280820186905290516001600160a01b03909216917fa5edfeb09a3d7a0edab24279a4ca1c35b82bb038f8a7eb53339c904a217fe1f69181900360600190a26134943032601654612ba6565b61349c613e1c565b50506017805460ff1916905550505050565b6017805460ff191660011790556016546000906134cc908390612918565b905060006134db8260026129ba565b905060006134e98383612918565b601f549091506135049030906001600160a01b031684612ba6565b6000856001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561355357600080fd5b505afa158015613567573d6000803e3d6000fd5b505050506040513d602081101561357d57600080fd5b5051601f546040805163a114398d60e01b81526001600160a01b038a8116600483015260248201889052915193945091169163a114398d9160448082019260009290919082900301818387803b1580156135d657600080fd5b505af11580156135ea573d6000803e3d6000fd5b50505050600061367382886001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561364157600080fd5b505afa158015613655573d6000803e3d6000fd5b505050506040513d602081101561366b57600080fd5b505190612918565b9050613680878483613f55565b604080518581526020810183905280820185905290516001600160a01b038916917fa5edfeb09a3d7a0edab24279a4ca1c35b82bb038f8a7eb53339c904a217fe1f6919081900360600190a26136d93032601654612ba6565b6136e1613e1c565b50506017805460ff191690555050505050565b60006136fe611938565b905060008060008060008061371288612a00565b9550955095509550955095506000613733888361296190919063ffffffff16565b6001600160a01b038c16600090815260026020526040902054909150613759908a612918565b6001600160a01b038c166000908152600260209081526040808320939093556001905220546137889088612918565b6001600160a01b038c1660009081526001602052604090205560175460ff1615613819576001600160a01b038a166000908152600160205260409020546137cf9088612a60565b6001600160a01b03808c166000818152600160209081526040918290209490945580518d815290519193928f169260008051602061449a83398151915292918290030190a36138ea565b6001600160a01b038a1660009081526001602052604090205461383c9087612a60565b6001600160a01b038b166000908152600160205260408082209290925530815220546138689082612a60565b3060009081526001602052604090205561388285846140f5565b60408051838152905130916001600160a01b038e169160008051602061449a8339815191529181900360200190a3896001600160a01b03168b6001600160a01b031660008051602061449a833981519152866040518082815260200191505060405180910390a35b5050505050505050505050565b6000613901611938565b905060008060008060008061391588612a00565b9550955095509550955095506000613936888361296190919063ffffffff16565b6001600160a01b038c1660009081526001602052604090205490915061395c9088612918565b6001600160a01b038c1660009081526001602052604090205560175460ff16156139d2576001600160a01b038a166000908152600260205260409020546139a3908a612a60565b6001600160a01b038b166000908152600260209081526040808320939093556001905220546137cf9088612a60565b6001600160a01b038a166000908152600260205260409020546139f59085612a60565b6001600160a01b038b1660009081526002602090815260408083209390935560019052205461383c9087612a60565b6000613a2e611938565b9050600080600080600080613a4288612a00565b9550955095509550955095506000613a63888361296190919063ffffffff16565b6001600160a01b038c166000908152600160205260409020549091506137889088612918565b6000613a93611938565b9050600080600080600080613aa788612a00565b9550955095509550955095506000613ac8888361296190919063ffffffff16565b6001600160a01b038c16600090815260026020526040902054909150613aee908a612918565b6001600160a01b038c1660009081526002602090815260408083209390935560019052205461395c9088612918565b60408051600280825260608083018452926020830190803683370190505090503081600081518110613b4b57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015613bc457600080fd5b505afa158015613bd8573d6000803e3d6000fd5b505050506040513d6020811015613bee57600080fd5b5051815182906001908110613bff57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050613c4a307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84612aba565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663791ac9478360008430426040518663ffffffff1660e01b81526004018086815260200185815260200180602001846001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015613cef578181015183820152602001613cd7565b505050509050019650505050505050600060405180830381600087803b158015613d1857600080fd5b505af1158015613d2c573d6000803e3d6000fd5b505050505050565b613d5f307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84612aba565b6040805163f305d71960e01b8152306004820181905260248201859052600060448301819052606483015260848201524260a482015290516001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d169163f305d71991849160c48082019260609290919082900301818588803b158015613deb57600080fd5b505af1158015613dff573d6000803e3d6000fd5b50505050506040513d6060811015613e1657600080fd5b50505050565b600754600654600091613e3b916132f0906001600160a01b0316611804565b9050601554811115613f52576000613e54826000611192565b6018546001600160a01b0316600090815260016020526040902054909150613e7c9082612a60565b6018546001600160a01b039081166000908152600160205260408082209390935560065490911681522054613eb19082612918565b600680546001600160a01b03908116600090815260016020908152604091829020949094556018549254815187815291519383169492169260008051602061449a833981519152929181900390910190a3601860009054906101000a90046001600160a01b03166001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b158015613d1857600080fd5b50565b613f80307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84612aba565b826001600160a01b031663095ea7b37f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015613ff757600080fd5b505af115801561400b573d6000803e3d6000fd5b505050506040513d602081101561402157600080fd5b50506040805162e8e33760e81b815230600482018190526001600160a01b038681166024840152604483018690526064830185905260006084840181905260a4840181905260c48401929092524260e484015292517f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d9093169263e8e3370092610104808201936060939283900390910190829087803b1580156140c457600080fd5b505af11580156140d8573d6000803e3d6000fd5b505050506040513d60608110156140ee57600080fd5b5050505050565b600a546141029083612918565b600a55600b546141129082612a60565b600b55505056fe54756e6e656c3a206c697175696469747952656d6f76654665652073686f756c6420626520696e2031202d20313054756e6e656c3a207472616e7366657220746f20746865207a65726f206164647265737354756e6e656c3a2066656520646563696d616c732073686f756c6420626520696e2030202d203254756e6e656c3a204578636c75646564206164647265737365732063616e6e6f742063616c6c20746869732066756e6374696f6e54756e6e656c3a205472616e7366657220616d6f756e74206578636565647320746865206d61785478416d6f756e742e4f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737354756e6e656c3a205472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f54756e6e656c3a206d696e546f6b656e4265666f7265537761702073686f756c6420626520696e2035306539202d203235303030653954756e6e656c3a204163636f756e7420697320616c7265616479206578636c7564656454756e6e656c3a207461784665652073686f756c6420626520696e2030202d203554756e6e656c3a204163636f756e7420697320616c726561647920696e636c7564656454756e6e656c3a206d61785478416d6f756e742073686f756c642062652067726561746572207468616e20353030303030653954756e6e656c3a206175746f5377617043616c6c65724665652073686f756c642062652067726561746572207468616e20316539536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7754756e6e656c3a20616c6368656d7943616c6c65724665652073686f756c6420626520696e2031202d20313545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657254756e6e656c3a20617070726f766520746f20746865207a65726f206164647265737354756e6e656c3a2057652063616e206e6f74206578636c75646520556e697377617020726f757465722e54756e6e656c3a206d696e546f6b656e4265666f7265537761702073686f756c642062652067726561746572207468616e206175746f5377617043616c6c657246656554756e6e656c3a205061697220746f6b656e2061646472657373206973207a65726f2eddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef54756e6e656c3a20596f752068617665206e6f7420656e6f7567682054756e6e656c20746f2054756e6e656c3a207472616e736665722066726f6d20746865207a65726f206164647265737354756e6e656c3a20416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7354756e6e656c3a206c6f636b4665652073686f756c6420626520696e2030202d203554756e6e656c3a2057652063616e206e6f74206578636c75646520726577656172642077616c6c65742e54756e6e656c3a205061697220746f6b656e20616464726573732069732073616d652061732063757272656e74206f6e652e54756e6e656c3a205061697220746f6b656e20616464726573732073656c6620616464726573732e54756e6e656c3a20617070726f76652066726f6d20746865207a65726f206164647265737354756e6e656c3a2057652063616e206e6f74206578636c75646520636f6e74726163742073656c662e45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220673672f99054b86fa774038eff2f3a6575191def4c4be6cc44bdf245221312f264736f6c634300060c0033

Verified Source Code Partial Match

Compiler: v0.6.12+commit.27d51765 EVM: istanbul Optimization: Yes (200 runs)
TUNNEL.sol 1259 lines
// SPDX-License-Identifier: MIT


//████████╗██╗░░░██╗███╗░░██╗███╗░░██╗███████╗██╗░░░░░
//╚══██╔══╝██║░░░██║████╗░██║████╗░██║██╔════╝██║░░░░░
//░░░██║░░░██║░░░██║██╔██╗██║██╔██╗██║█████╗░░██║░░░░░
//░░░██║░░░██║░░░██║██║╚████║██║╚████║██╔══╝░░██║░░░░░
//░░░██║░░░╚██████╔╝██║░╚███║██║░╚███║███████╗███████╗
//░░░╚═╝░░░░╚═════╝░╚═╝░░╚══╝╚═╝░░╚══╝╚══════╝╚══════╝
//
// Liquidity connector for DeFi     
// tunnelprotocol.io

pragma solidity ^0.6.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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}



/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @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 Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != accountHash && codehash != 0x0);
    }

    /**
     * @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");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (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 functionCall(target, data, "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");
        return _functionCallWithValue(target, data, value, errorMessage);
    }

    function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
        if (success) {
            return returndata;
        } else {
            // 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

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

/**
 * @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.
 */
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 () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        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 {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}


interface IUniswapV2Factory {
    function createPair(address tokenA, address tokenB) external returns (address pair);
}

interface IUniswapV2Pair {
    function sync() external;
}

interface IUniswapV2Router01 {
    function factory() external pure returns (address);
    function WETH() external pure returns (address);
    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);
    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}

interface IUniswapV2Router02 is IUniswapV2Router01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
      address token,
      uint liquidity,
      uint amountTokenMin,
      uint amountETHMin,
      address to,
      uint deadline
    ) external returns (uint amountETH);
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;
}

pragma solidity ^0.6.12;

contract RewardWallet {
    constructor() public {
    }
}

contract Balancer {
    using SafeMath for uint256;
    IUniswapV2Router02 public immutable _uniswapV2Router;
    TUNNEL private _tokenContract;
    
    constructor(TUNNEL tokenContract, IUniswapV2Router02 uniswapV2Router) public {
        _tokenContract =tokenContract;
        _uniswapV2Router = uniswapV2Router;
    }
    
    receive() external payable {}
    
    function rebalance() external returns (uint256) { 
        swapEthForTokens(address(this).balance);
    }

    function swapEthForTokens(uint256 EthAmount) private {
        address[] memory uniswapPairPath = new address[](2);
        uniswapPairPath[0] = _uniswapV2Router.WETH();
        uniswapPairPath[1] = address(_tokenContract);

        _uniswapV2Router
            .swapExactETHForTokensSupportingFeeOnTransferTokens{value: EthAmount}(
                0,
                uniswapPairPath,
                address(this),
                block.timestamp
            );
    }
}

contract Swaper {
    using SafeMath for uint256;
    IUniswapV2Router02 public immutable _uniswapV2Router;
    TUNNEL private _tokenContract;
    
    constructor(TUNNEL tokenContract, IUniswapV2Router02 uniswapV2Router) public {
        _tokenContract = tokenContract;
        _uniswapV2Router = uniswapV2Router;
    }
    
    function swapTokens(address pairTokenAddress, uint256 tokenAmount) external {
        uint256 initialPairTokenBalance = IERC20(pairTokenAddress).balanceOf(address(this));
        swapTokensForTokens(pairTokenAddress, tokenAmount);
        uint256 newPairTokenBalance = IERC20(pairTokenAddress).balanceOf(address(this)).sub(initialPairTokenBalance);
        IERC20(pairTokenAddress).transfer(address(_tokenContract), newPairTokenBalance);
    }
    
    function swapTokensForTokens(address pairTokenAddress, uint256 tokenAmount) private {
        address[] memory path = new address[](2);
        path[0] = address(_tokenContract);
        path[1] = pairTokenAddress;

        _tokenContract.approve(address(_uniswapV2Router), tokenAmount);

        // make the swap
        _uniswapV2Router.swapExactTokensForTokensSupportingFeeOnTransferTokens(
            tokenAmount,
            0, // accept any amount of pair token
            path,
            address(this),
            block.timestamp
        );
    }
}

contract TUNNEL is Context, IERC20, Ownable {
    using SafeMath for uint256;
    using Address for address;

    IUniswapV2Router02 public immutable _uniswapV2Router;

    mapping (address => uint256) private _rOwned;
    mapping (address => uint256) private _tOwned;
    mapping (address => mapping (address => uint256)) private _allowances;

    mapping (address => bool) private _isExcluded;
    address[] private _excluded;
    address public _rewardWallet;
    uint256 public _initialRewardLockAmount;
    address public _uniswapETHPool;
    
    uint256 private constant MAX = ~uint256(0);
    uint256 private _tTotal = 10000000e9;
    uint256 private _rTotal = (MAX - (MAX % _tTotal));
    uint256 public _tFeeTotal;
    uint256 public _tBurnTotal;

    string private _name = 'Tunnel';
    string private _symbol = 'TNI';
    uint8 private _decimals = 9;
    
    uint256 public _feeDecimals = 1;
    uint256 public _taxFee = 0;
    uint256 public _lockFee = 0;
    uint256 public _maxTxAmount = 2000000e9;
    uint256 public _minTokensBeforeSwap = 10000e9;
    uint256 public _minInterestForReward = 10e9;
    uint256 private _autoSwapCallerFee = 200e9;
    
    bool private inSwapAndLiquify;
    bool public swapAndLiquifyEnabled;
    bool public tradingEnabled;
    
    address private currentPairTokenAddress;
    address private currentPoolAddress;
    
    uint256 private _liquidityRemoveFee = 2;
    uint256 private _alchemyCallerFee = 5;
    uint256 private _minTokenForAlchemy = 1000e9;
    uint256 private _lastAlchemy;
    uint256 private _alchemyInterval = 1 hours;
    

    event FeeDecimalsUpdated(uint256 taxFeeDecimals);
    event TaxFeeUpdated(uint256 taxFee);
    event LockFeeUpdated(uint256 lockFee);
    event MaxTxAmountUpdated(uint256 maxTxAmount);
    event WhitelistUpdated(address indexed pairTokenAddress);
    event TradingEnabled();
    event SwapAndLiquifyEnabledUpdated(bool enabled);
    event SwapAndLiquify(
        address indexed pairTokenAddress,
        uint256 tokensSwapped,
        uint256 pairTokenReceived,
        uint256 tokensIntoLiqudity
    );
    event Rebalance(uint256 tokenBurnt);
    event MinTokensBeforeSwapUpdated(uint256 minTokensBeforeSwap);
    event AutoSwapCallerFeeUpdated(uint256 autoSwapCallerFee);
    event MinInterestForRewardUpdated(uint256 minInterestForReward);
    event LiquidityRemoveFeeUpdated(uint256 liquidityRemoveFee);
    event AlchemyCallerFeeUpdated(uint256 rebalnaceCallerFee);
    event MinTokenForAlchemyUpdated(uint256 minRebalanceAmount);
    event AlchemyIntervalUpdated(uint256 rebalanceInterval);

    modifier lockTheSwap {
        inSwapAndLiquify = true;
        _;
        inSwapAndLiquify = false;
    }
    
    Balancer public balancer;
    Swaper public swaper;

    constructor (IUniswapV2Router02 uniswapV2Router, uint256 initialRewardLockAmount) public {
        _lastAlchemy = now;
        
        _uniswapV2Router = uniswapV2Router;
        _rewardWallet = address(new RewardWallet());
        _initialRewardLockAmount = initialRewardLockAmount;
        
        balancer = new Balancer(this, uniswapV2Router);
        swaper = new Swaper(this, uniswapV2Router);
        
        currentPoolAddress = IUniswapV2Factory(uniswapV2Router.factory())
            .createPair(address(this), uniswapV2Router.WETH());
        currentPairTokenAddress = uniswapV2Router.WETH();
        _uniswapETHPool = currentPoolAddress;
        
        updateSwapAndLiquifyEnabled(false);
        
        _rOwned[_msgSender()] = reflectionFromToken(_tTotal.sub(_initialRewardLockAmount), false);
        _rOwned[_rewardWallet] = reflectionFromToken(_initialRewardLockAmount, false);
        
        emit Transfer(address(0), _msgSender(), _tTotal.sub(_initialRewardLockAmount));
        emit Transfer(address(0), _rewardWallet, _initialRewardLockAmount);
    }

    function name() public view returns (string memory) {
        return _name;
    }

    function symbol() public view returns (string memory) {
        return _symbol;
    }

    function decimals() public view returns (uint8) {
        return _decimals;
    }

    function totalSupply() public view override returns (uint256) {
        return _tTotal;
    }

    function balanceOf(address account) public view override returns (uint256) {
        if (_isExcluded[account]) return _tOwned[account];
        return tokenFromReflection(_rOwned[account]);
    }

    function transfer(address recipient, uint256 amount) public override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    function allowance(address owner, address spender) public view override returns (uint256) {
        return _allowances[owner][spender];
    }

    function approve(address spender, uint256 amount) public override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        return true;
    }

    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
        return true;
    }

    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
        return true;
    }

    function isExcluded(address account) public view returns (bool) {
        return _isExcluded[account];
    }

    
    function reflect(uint256 tAmount) public {
        address sender = _msgSender();
        require(!_isExcluded[sender], "Tunnel: Excluded addresses cannot call this function");
        (uint256 rAmount,,,,,) = _getValues(tAmount);
        _rOwned[sender] = _rOwned[sender].sub(rAmount);
        _rTotal = _rTotal.sub(rAmount);
        _tFeeTotal = _tFeeTotal.add(tAmount);
    }

    function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) {
        require(tAmount <= _tTotal, "Amount must be less than supply");
        if (!deductTransferFee) {
            (uint256 rAmount,,,,,) = _getValues(tAmount);
            return rAmount;
        } else {
            (,uint256 rTransferAmount,,,,) = _getValues(tAmount);
            return rTransferAmount;
        }
    }

    function tokenFromReflection(uint256 rAmount) public view returns(uint256) {
        require(rAmount <= _rTotal, "Tunnel: Amount must be less than total reflections");
        uint256 currentRate =  _getRate();
        return rAmount.div(currentRate);
    }

    function excludeAccount(address account) external onlyOwner() {
        require(account != 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, 'Tunnel: We can not exclude Uniswap router.');
        require(account != address(this), 'Tunnel: We can not exclude contract self.');
        require(account != _rewardWallet, 'Tunnel: We can not exclude reweard wallet.');
        require(!_isExcluded[account], "Tunnel: Account is already excluded");
        
        if(_rOwned[account] > 0) {
            _tOwned[account] = tokenFromReflection(_rOwned[account]);
        }
        _isExcluded[account] = true;
        _excluded.push(account);
    }

    function includeAccount(address account) external onlyOwner() {
        require(_isExcluded[account], "Tunnel: Account is already included");
        for (uint256 i = 0; i < _excluded.length; i++) {
            if (_excluded[i] == account) {
                _excluded[i] = _excluded[_excluded.length - 1];
                _tOwned[account] = 0;
                _isExcluded[account] = false;
                _excluded.pop();
                break;
            }
        }
    }

    function _approve(address owner, address spender, uint256 amount) private {
        require(owner != address(0), "Tunnel: approve from the zero address");
        require(spender != address(0), "Tunnel: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    function _transfer(address sender, address recipient, uint256 amount) private {
        require(sender != address(0), "Tunnel: transfer from the zero address");
        require(recipient != address(0), "Tunnel: transfer to the zero address");
        require(amount > 0, "Tunnel: Transfer amount must be greater than zero");
        
        if(sender != owner() && recipient != owner() && !inSwapAndLiquify) {
            require(amount <= _maxTxAmount, "Tunnel: Transfer amount exceeds the maxTxAmount.");
            if((_msgSender() == currentPoolAddress || _msgSender() == address(_uniswapV2Router)) && !tradingEnabled)
                require(false, "Tunnel: trading is disabled.");
        }
        
        if(!inSwapAndLiquify) {
            uint256 lockedBalanceForPool = balanceOf(address(this));
            bool overMinTokenBalance = lockedBalanceForPool >= _minTokensBeforeSwap;
            if (
                overMinTokenBalance &&
                msg.sender != currentPoolAddress &&
                swapAndLiquifyEnabled
            ) {
                if(currentPairTokenAddress == _uniswapV2Router.WETH())
                    swapAndLiquifyForEth(lockedBalanceForPool);
                else
                    swapAndLiquifyForTokens(currentPairTokenAddress, lockedBalanceForPool);
            }
        }
        
        if (_isExcluded[sender] && !_isExcluded[recipient]) {
            _transferFromExcluded(sender, recipient, amount);
        } else if (!_isExcluded[sender] && _isExcluded[recipient]) {
            _transferToExcluded(sender, recipient, amount);
        } else if (!_isExcluded[sender] && !_isExcluded[recipient]) {
            _transferStandard(sender, recipient, amount);
        } else if (_isExcluded[sender] && _isExcluded[recipient]) {
            _transferBothExcluded(sender, recipient, amount);
        } else {
            _transferStandard(sender, recipient, amount);
        }
    }
    
    receive() external payable {}
    
    function swapAndLiquifyForEth(uint256 lockedBalanceForPool) private lockTheSwap {
        // split the contract balance except swapCallerFee into halves
        uint256 lockedForSwap = lockedBalanceForPool.sub(_autoSwapCallerFee);
        uint256 half = lockedForSwap.div(2);
        uint256 otherHalf = lockedForSwap.sub(half);

        // capture the contract's current ETH balance.
        // this is so that we can capture exactly the amount of ETH that the
        // swap creates, and not make the liquidity event include any ETH that
        // has been manually sent to the contract
        uint256 initialBalance = address(this).balance;

        // swap tokens for ETH
        swapTokensForEth(half);
        
        // how much ETH did we just swap into?
        uint256 newBalance = address(this).balance.sub(initialBalance);

        // add liquidity to uniswap
        addLiquidityForEth(otherHalf, newBalance);
        
        emit SwapAndLiquify(_uniswapV2Router.WETH(), half, newBalance, otherHalf);
        
        _transfer(address(this), tx.origin, _autoSwapCallerFee);
        
        _sendRewardInterestToPool();
    }
    
    function swapTokensForEth(uint256 tokenAmount) private {
        // generate the uniswap pair path of token -> weth
        address[] memory path = new address[](2);
        path[0] = address(this);
        path[1] = _uniswapV2Router.WETH();

        _approve(address(this), address(_uniswapV2Router), tokenAmount);

        // make the swap
        _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
            tokenAmount,
            0, // accept any amount of ETH
            path,
            address(this),
            block.timestamp
        );
    }

    function addLiquidityForEth(uint256 tokenAmount, uint256 ethAmount) private {
        // approve token transfer to cover all possible scenarios
        _approve(address(this), address(_uniswapV2Router), tokenAmount);

        // add the liquidity
        _uniswapV2Router.addLiquidityETH{value: ethAmount}(
            address(this),
            tokenAmount,
            0, // slippage is unavoidable
            0, // slippage is unavoidable
            address(this),
            block.timestamp
        );
    }
    
    function swapAndLiquifyForTokens(address pairTokenAddress, uint256 lockedBalanceForPool) private lockTheSwap {
        // split the contract balance except swapCallerFee into halves
        uint256 lockedForSwap = lockedBalanceForPool.sub(_autoSwapCallerFee);
        uint256 half = lockedForSwap.div(2);
        uint256 otherHalf = lockedForSwap.sub(half);
        
        _transfer(address(this), address(swaper), half);
        
        uint256 initialPairTokenBalance = IERC20(pairTokenAddress).balanceOf(address(this));
        
        // swap tokens for pairToken
        swaper.swapTokens(pairTokenAddress, half);
        
        uint256 newPairTokenBalance = IERC20(pairTokenAddress).balanceOf(address(this)).sub(initialPairTokenBalance);

        // add liquidity to uniswap
        addLiquidityForTokens(pairTokenAddress, otherHalf, newPairTokenBalance);
        
        emit SwapAndLiquify(pairTokenAddress, half, newPairTokenBalance, otherHalf);
        
        _transfer(address(this), tx.origin, _autoSwapCallerFee);
        
        _sendRewardInterestToPool();
    }

    function addLiquidityForTokens(address pairTokenAddress, uint256 tokenAmount, uint256 pairTokenAmount) private {
        // approve token transfer to cover all possible scenarios
        _approve(address(this), address(_uniswapV2Router), tokenAmount);
        IERC20(pairTokenAddress).approve(address(_uniswapV2Router), pairTokenAmount);

        // add the liquidity
        _uniswapV2Router.addLiquidity(
            address(this),
            pairTokenAddress,
            tokenAmount,
            pairTokenAmount,
            0, // slippage is unavoidable
            0, // slippage is unavoidable
            address(this),
            block.timestamp
        );
    }

    function alchemy() public lockTheSwap {
        require(balanceOf(_msgSender()) >= _minTokenForAlchemy, "Tunnel: You have not enough Tunnel to ");
        require(now > _lastAlchemy + _alchemyInterval, 'Tunnel: Too Soon.');
        
        _lastAlchemy = now;

        uint256 amountToRemove = IERC20(_uniswapETHPool).balanceOf(address(this)).mul(_liquidityRemoveFee).div(100);

        removeLiquidityETH(amountToRemove);
        balancer.rebalance();

        uint256 tNewTokenBalance = balanceOf(address(balancer));
        uint256 tRewardForCaller = tNewTokenBalance.mul(_alchemyCallerFee).div(100);
        uint256 tBurn = tNewTokenBalance.sub(tRewardForCaller);
        
        uint256 currentRate =  _getRate();
        uint256 rBurn =  tBurn.mul(currentRate);
        
        _rOwned[_msgSender()] = _rOwned[_msgSender()].add(tRewardForCaller.mul(currentRate));
        _rOwned[address(balancer)] = 0;
        
        _tBurnTotal = _tBurnTotal.add(tBurn);
        _tTotal = _tTotal.sub(tBurn);
        _rTotal = _rTotal.sub(rBurn);

        emit Transfer(address(balancer), _msgSender(), tRewardForCaller);
        emit Transfer(address(balancer), address(0), tBurn);
        emit Rebalance(tBurn);
    }
    
    function removeLiquidityETH(uint256 lpAmount) private returns(uint ETHAmount) {
        IERC20(_uniswapETHPool).approve(address(_uniswapV2Router), lpAmount);
        (ETHAmount) = _uniswapV2Router
            .removeLiquidityETHSupportingFeeOnTransferTokens(
                address(this),
                lpAmount,
                0,
                0,
                address(balancer),
                block.timestamp
            );
    }

    function _sendRewardInterestToPool() private {
        uint256 tRewardInterest = balanceOf(_rewardWallet).sub(_initialRewardLockAmount);
        if(tRewardInterest > _minInterestForReward) {
            uint256 rRewardInterest = reflectionFromToken(tRewardInterest, false);
            _rOwned[currentPoolAddress] = _rOwned[currentPoolAddress].add(rRewardInterest);
            _rOwned[_rewardWallet] = _rOwned[_rewardWallet].sub(rRewardInterest);
            emit Transfer(_rewardWallet, currentPoolAddress, tRewardInterest);
            IUniswapV2Pair(currentPoolAddress).sync();
        }
    }

    function _transferStandard(address sender, address recipient, uint256 tAmount) private {
        uint256 currentRate =  _getRate();
        (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLock) = _getValues(tAmount);
        uint256 rLock =  tLock.mul(currentRate);
        _rOwned[sender] = _rOwned[sender].sub(rAmount);
        if(inSwapAndLiquify) {
            _rOwned[recipient] = _rOwned[recipient].add(rAmount);
            emit Transfer(sender, recipient, tAmount);
        } else {
            _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
            _rOwned[address(this)] = _rOwned[address(this)].add(rLock);
            _reflectFee(rFee, tFee);
            emit Transfer(sender, address(this), tLock);
            emit Transfer(sender, recipient, tTransferAmount);
        }
    }

    function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
        uint256 currentRate =  _getRate();
        (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLock) = _getValues(tAmount);
        uint256 rLock =  tLock.mul(currentRate);
        _rOwned[sender] = _rOwned[sender].sub(rAmount);
        if(inSwapAndLiquify) {
            _tOwned[recipient] = _tOwned[recipient].add(tAmount);
            _rOwned[recipient] = _rOwned[recipient].add(rAmount);
            emit Transfer(sender, recipient, tAmount);
        } else {
            _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
            _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
            _rOwned[address(this)] = _rOwned[address(this)].add(rLock);
            _reflectFee(rFee, tFee);
            emit Transfer(sender, address(this), tLock);
            emit Transfer(sender, recipient, tTransferAmount);
        }
    }

    function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
        uint256 currentRate =  _getRate();
        (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLock) = _getValues(tAmount);
        uint256 rLock =  tLock.mul(currentRate);
        _tOwned[sender] = _tOwned[sender].sub(tAmount);
        _rOwned[sender] = _rOwned[sender].sub(rAmount);
        if(inSwapAndLiquify) {
            _rOwned[recipient] = _rOwned[recipient].add(rAmount);
            emit Transfer(sender, recipient, tAmount);
        } else {
            _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);   
            _rOwned[address(this)] = _rOwned[address(this)].add(rLock);
            _reflectFee(rFee, tFee);
            emit Transfer(sender, address(this), tLock);
            emit Transfer(sender, recipient, tTransferAmount);
        }
    }

    function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
        uint256 currentRate =  _getRate();
        (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLock) = _getValues(tAmount);
        uint256 rLock =  tLock.mul(currentRate);
        _tOwned[sender] = _tOwned[sender].sub(tAmount);
        _rOwned[sender] = _rOwned[sender].sub(rAmount);
        if(inSwapAndLiquify) {
            _tOwned[recipient] = _tOwned[recipient].add(tAmount);
            _rOwned[recipient] = _rOwned[recipient].add(rAmount);
            emit Transfer(sender, recipient, tAmount);
        }
        else {
            _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
            _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);   
            _rOwned[address(this)] = _rOwned[address(this)].add(rLock);
            _reflectFee(rFee, tFee);
            emit Transfer(sender, address(this), tLock);
            emit Transfer(sender, recipient, tTransferAmount);
        }
    }

    function _reflectFee(uint256 rFee, uint256 tFee) private {
        _rTotal = _rTotal.sub(rFee);
        _tFeeTotal = _tFeeTotal.add(tFee);
    }

    function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
        (uint256 tTransferAmount, uint256 tFee, uint256 tLock) = _getTValues(tAmount, _taxFee, _lockFee, _feeDecimals);
        uint256 currentRate =  _getRate();
        (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tLock, currentRate);
        return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tLock);
    }

    function _getTValues(uint256 tAmount, uint256 taxFee, uint256 lockFee, uint256 feeDecimals) private pure returns (uint256, uint256, uint256) {
        uint256 tFee = tAmount.mul(taxFee).div(10**(feeDecimals + 2));
        uint256 tLockFee = tAmount.mul(lockFee).div(10**(feeDecimals + 2));
        uint256 tTransferAmount = tAmount.sub(tFee).sub(tLockFee);
        return (tTransferAmount, tFee, tLockFee);
    }

    function _getRValues(uint256 tAmount, uint256 tFee, uint256 tLock, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
        uint256 rAmount = tAmount.mul(currentRate);
        uint256 rFee = tFee.mul(currentRate);
        uint256 rLock = tLock.mul(currentRate);
        uint256 rTransferAmount = rAmount.sub(rFee).sub(rLock);
        return (rAmount, rTransferAmount, rFee);
    }

    function _getRate() public view returns(uint256) {
        (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
        return rSupply.div(tSupply);
    }

    function _getCurrentSupply() public view returns(uint256, uint256) {
        uint256 rSupply = _rTotal;
        uint256 tSupply = _tTotal;      
        for (uint256 i = 0; i < _excluded.length; i++) {
            if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
            rSupply = rSupply.sub(_rOwned[_excluded[i]]);
            tSupply = tSupply.sub(_tOwned[_excluded[i]]);
        }
        if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
        return (rSupply, tSupply);
    }
    
    function getCurrentPoolAddress() public view returns(address) {
        return currentPoolAddress;
    }
    
    function getCurrentPairTokenAddress() public view returns(address) {
        return currentPairTokenAddress;
    }

    function getLiquidityRemoveFee() public view returns(uint256) {
        return _liquidityRemoveFee;
    }
    
    function getAlchemyCallerFee() public view returns(uint256) {
        return _alchemyCallerFee;
    }
    
    function getMinTokenForAlchemy() public view returns(uint256) {
        return _minTokenForAlchemy;
    }
    
    function getLastAlchemy() public view returns(uint256) {
        return _lastAlchemy;
    }
    
    function getAlchemyInterval() public view returns(uint256) {
        return _alchemyInterval;
    }
    
    function _setFeeDecimals(uint256 feeDecimals) external onlyOwner() {
        require(feeDecimals >= 0 && feeDecimals <= 2, 'Tunnel: fee decimals should be in 0 - 2');
        _feeDecimals = feeDecimals;
        emit FeeDecimalsUpdated(feeDecimals);
    }
    
    function _setTaxFee(uint256 taxFee) external onlyOwner() {
        require(taxFee >= 0  && taxFee <= 5 * 10 ** _feeDecimals, 'Tunnel: taxFee should be in 0 - 5');
        _taxFee = taxFee;
        emit TaxFeeUpdated(taxFee);
    }
    
    function _setLockFee(uint256 lockFee) external onlyOwner() {
        require(lockFee >= 0 && lockFee <= 5 * 10 ** _feeDecimals, 'Tunnel: lockFee should be in 0 - 5');
        _lockFee = lockFee;
        emit LockFeeUpdated(lockFee);
    }
    
    function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
        require(maxTxAmount >= 500000e9 , 'Tunnel: maxTxAmount should be greater than 500000e9');
        _maxTxAmount = maxTxAmount;
        emit MaxTxAmountUpdated(maxTxAmount);
    }
    
    function _setMinTokensBeforeSwap(uint256 minTokensBeforeSwap) external onlyOwner() {
        require(minTokensBeforeSwap >= 50e9 && minTokensBeforeSwap <= 25000e9 , 'Tunnel: minTokenBeforeSwap should be in 50e9 - 25000e9');
        require(minTokensBeforeSwap > _autoSwapCallerFee , 'Tunnel: minTokenBeforeSwap should be greater than autoSwapCallerFee');
        _minTokensBeforeSwap = minTokensBeforeSwap;
        emit MinTokensBeforeSwapUpdated(minTokensBeforeSwap);
    }
    
    function _setAutoSwapCallerFee(uint256 autoSwapCallerFee) external onlyOwner() {
        require(autoSwapCallerFee >= 1e9, 'Tunnel: autoSwapCallerFee should be greater than 1e9');
        _autoSwapCallerFee = autoSwapCallerFee;
        emit AutoSwapCallerFeeUpdated(autoSwapCallerFee);
    }
    
    function _setMinInterestForReward(uint256 minInterestForReward) external onlyOwner() {
        _minInterestForReward = minInterestForReward;
        emit MinInterestForRewardUpdated(minInterestForReward);
    }
    
    function _setLiquidityRemoveFee(uint256 liquidityRemoveFee) external onlyOwner() {
        require(liquidityRemoveFee >= 1 && liquidityRemoveFee <= 10 , 'Tunnel: liquidityRemoveFee should be in 1 - 10');
        _liquidityRemoveFee = liquidityRemoveFee;
        emit LiquidityRemoveFeeUpdated(liquidityRemoveFee);
    }
    
    function _setAlchemyCallerFee(uint256 alchemyCallerFee) external onlyOwner() {
        require(alchemyCallerFee >= 1 && alchemyCallerFee <= 15 , 'Tunnel: alchemyCallerFee should be in 1 - 15');
        _alchemyCallerFee = alchemyCallerFee;
        emit AlchemyCallerFeeUpdated(alchemyCallerFee);
    }
    
    function _setMinTokenForAlchemy(uint256 minTokenForAlchemy) external onlyOwner() {
        _minTokenForAlchemy = minTokenForAlchemy;
        emit MinTokenForAlchemyUpdated(minTokenForAlchemy);
    }
    
    function _setAlchemyInterval(uint256 alchemyInterval) external onlyOwner() {
        _alchemyInterval = alchemyInterval;
        emit AlchemyIntervalUpdated(alchemyInterval);
    }
    
    function updateSwapAndLiquifyEnabled(bool _enabled) public onlyOwner {
        swapAndLi...

// [truncated — 50869 bytes total]

Read Contract

_feeDecimals 0x96354704 → uint256
_getCurrentSupply 0x97a9d560 → uint256, uint256
_getRate 0x94e10784 → uint256
_initialRewardLockAmount 0xe4111dd3 → uint256
_lockFee 0x9d6f83e4 → uint256
_maxTxAmount 0x7d1db4a5 → uint256
_minInterestForReward 0xc3295817 → uint256
_minTokensBeforeSwap 0x8aadb809 → uint256
_rewardWallet 0xa4f4a765 → address
_tBurnTotal 0x185d374c → uint256
_tFeeTotal 0xfb1eb14b → uint256
_taxFee 0x3b124fe7 → uint256
_uniswapETHPool 0x8b1bdcb2 → address
_uniswapV2Router 0x583e0568 → address
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
balancer 0xe563037e → address
decimals 0x313ce567 → uint8
getAlchemyCallerFee 0x17177808 → uint256
getAlchemyInterval 0xe8598c87 → uint256
getCurrentPairTokenAddress 0x5afbfd38 → address
getCurrentPoolAddress 0xc9e6da19 → address
getLastAlchemy 0x85d1e038 → uint256
getLiquidityRemoveFee 0xe4451f66 → uint256
getMinTokenForAlchemy 0xb7cc02f9 → uint256
isExcluded 0xcba0e996 → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
reflectionFromToken 0x4549b039 → uint256
swapAndLiquifyEnabled 0x4a74bb02 → bool
swaper 0xeed83f11 → address
symbol 0x95d89b41 → string
tokenFromReflection 0x2d838119 → uint256
totalSupply 0x18160ddd → uint256
tradingEnabled 0x4ada218b → bool

Write Contract 25 functions

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

_enableTrading 0xa0ac5e19
No parameters
_setAlchemyCallerFee 0xe98d2c4b
uint256 alchemyCallerFee
_setAlchemyInterval 0x2ec8e523
uint256 alchemyInterval
_setAutoSwapCallerFee 0xefeb97e1
uint256 autoSwapCallerFee
_setFeeDecimals 0xf7505bc0
uint256 feeDecimals
_setLiquidityRemoveFee 0x26f5ccaa
uint256 liquidityRemoveFee
_setLockFee 0xd51486df
uint256 lockFee
_setMaxTxAmount 0x1bbae6e0
uint256 maxTxAmount
_setMinInterestForReward 0xdc174937
uint256 minInterestForReward
_setMinTokenForAlchemy 0xb6c1b37e
uint256 minTokenForAlchemy
_setMinTokensBeforeSwap 0x4a1e7726
uint256 minTokensBeforeSwap
_setTaxFee 0x5880b873
uint256 taxFee
_updateWhitelist 0xd73cf080
address poolAddress
address pairTokenAddress
alchemy 0x674b80ee
No parameters
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
excludeAccount 0xf2cc0c18
address account
includeAccount 0xf84354f1
address account
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
reflect 0x053ab182
uint256 tAmount
renounceOwnership 0x715018a6
No parameters
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
updateSwapAndLiquifyEnabled 0x9f9a4e7f
bool _enabled

Recent Transactions

No transactions found for this address