Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x51439FAfd035fE8f5Caa97a3FA49686D84d3483e
Balance 0 ETH
Nonce 1
Code Size 12243 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

12243 bytes
0x60806040526004361061026a5760003560e01c806386a22eff11610144578063b2c57fff116100b6578063dc7703671161007a578063dc77036714610895578063dd62ed3e146108c5578063f2421d2c146108e5578063f2fde38b14610915578063f887ea4014610935578063ff787dc61461095557600080fd5b8063b2c57fff14610776578063b7b69ec514610815578063c40fedc614610835578063ca33e64c14610855578063ccd721311461087557600080fd5b80639ab005f9116101085780639ab005f9146106b6578063a457c2d7146106d6578063a4b45c00146106f6578063a8aa1b3114610716578063a901dd9214610736578063a9059cbb1461075657600080fd5b806386a22eff146105e05780638c9dcf9e146106005780638da5cb5b1461062057806395d89b411461064057806395f93d481461065557600080fd5b80633c310f5e116101dd57806355fb28e4116101a157806355fb28e4146104db578063674a29cb146104fb5780636ebcf6071461052d57806370a082311461055a5780637303df9a146105905780637e926b4b146105c057600080fd5b80633c310f5e1461044657806342966c6814610466578063461a4450146104865780634c57f8d2146104a65780635290d773146104c657600080fd5b806323b872dd1161022f57806323b872dd146103635780632af10fac146103835780632ecd7e8f146103bb5780632f54bf6e146103db578063313ce5671461040a578063395093511461042657600080fd5b8062167e931461027657806306fdde03146102d0578063095ea7b3146102f257806318160ddd146103225780631da1db5e1461034157600080fd5b3661027157005b600080fd5b34801561028257600080fd5b506019546102a69061ffff80821691620100008104821691600160201b9091041683565b6040805161ffff948516815292841660208401529216918101919091526060015b60405180910390f35b3480156102dc57600080fd5b506102e5610975565b6040516102c79190612cb4565b3480156102fe57600080fd5b5061031261030d366004612a08565b610a07565b60405190151581526020016102c7565b34801561032e57600080fd5b506002545b6040519081526020016102c7565b34801561034d57600080fd5b5061036161035c366004612c1b565b610a1f565b005b34801561036f57600080fd5b5061031261037e366004612928565b610ad5565b34801561038f57600080fd5b50600d546103a3906001600160a01b031681565b6040516001600160a01b0390911681526020016102c7565b3480156103c757600080fd5b506103616103d6366004612be8565b610afb565b3480156103e757600080fd5b506103126103f63660046128b5565b600b546001600160a01b0391821691161490565b34801561041657600080fd5b50604051600981526020016102c7565b34801561043257600080fd5b50610312610441366004612a08565b610bc2565b34801561045257600080fd5b50610361610461366004612be8565b610be4565b34801561047257600080fd5b50610361610481366004612c1b565b610cab565b34801561049257600080fd5b506103616104a1366004612b37565b610ccb565b3480156104b257600080fd5b506103616104c1366004612a34565b610da4565b3480156104d257600080fd5b50601254610333565b3480156104e757600080fd5b506103616104f6366004612997565b610e97565b34801561050757600080fd5b50610510610f2d565b6040805193845260208401929092521515908201526060016102c7565b34801561053957600080fd5b506103336105483660046128b5565b60006020819052908152604090205481565b34801561056657600080fd5b506103336105753660046128b5565b6001600160a01b031660009081526020819052604090205490565b34801561059c57600080fd5b506017546102a69061ffff80821691620100008104821691600160201b9091041683565b3480156105cc57600080fd5b506103616105db366004612afd565b610f84565b3480156105ec57600080fd5b506103616105fb366004612969565b61100d565b34801561060c57600080fd5b5061036161061b366004612afd565b611062565b34801561062c57600080fd5b50600b546103a3906001600160a01b031681565b34801561064c57600080fd5b506102e56110d3565b34801561066157600080fd5b5060155461068b9060ff808216916101008104821691620100008204811691630100000090041684565b604080519415158552921515602085015260ff918216928401929092521660608201526080016102c7565b3480156106c257600080fd5b506103616106d1366004612b7e565b6110e2565b3480156106e257600080fd5b506103126106f1366004612a08565b611160565b34801561070257600080fd5b506103616107113660046128ef565b6111e6565b34801561072257600080fd5b50600e546103a3906001600160a01b031681565b34801561074257600080fd5b50610361610751366004612afd565b61123e565b34801561076257600080fd5b50610312610771366004612a08565b611286565b34801561078257600080fd5b50601a54601b54601c54601d54601e546107c7949392919060ff80821691610100810482169162010000820481169163010000008104821691600160201b9091041689565b60408051998a5260208a019890985296880195909552606087019390935260ff9091166080860152151560a0850152151560c0840152151560e08301521515610100820152610120016102c7565b34801561082157600080fd5b50610361610830366004612be8565b611294565b34801561084157600080fd5b506103126108503660046128ef565b61135b565b34801561086157600080fd5b50600c546103a3906001600160a01b031681565b34801561088157600080fd5b50610361610890366004612c4d565b6114ba565b3480156108a157600080fd5b506016546102a69061ffff80821691620100008104821691600160201b9091041683565b3480156108d157600080fd5b506103336108e03660046128ef565b611658565b3480156108f157600080fd5b506018546102a69061ffff80821691620100008104821691600160201b9091041683565b34801561092157600080fd5b506103616109303660046128b5565b611683565b34801561094157600080fd5b506022546103a3906001600160a01b031681565b34801561096157600080fd5b50610361610970366004612bcd565b611812565b60606003805461098490612eda565b80601f01602080910402602001604051908101604052809291908181526020018280546109b090612eda565b80156109fd5780601f106109d2576101008083540402835291602001916109fd565b820191906000526020600020905b8154815290600101906020018083116109e057829003601f168201915b5050505050905090565b600033610a1581858561187d565b5060019392505050565b600b546001600160a01b03163314610a525760405162461bcd60e51b8152600401610a4990612d4f565b60405180910390fd5b6064811115610a6057600080fd5b600d5447906001600160a01b03166108fc6064610a7d8585612ea4565b610a879190612e82565b6040518115909202916000818181858888f19350505050158015610aaf573d6000803e3d6000fd5b50610aba8282612ea4565b601b8054600090610acc908490612e6a565b90915550505050565b600033610ae38582856119a1565b610aee858585611a1b565b60019150505b9392505050565b600b546001600160a01b03163314610b255760405162461bcd60e51b8152600401610a4990612d4f565b601754600160201b900461ffff16610b3d8284612e44565b61ffff161115610b4c57600080fd5b6040805160608101825261ffff808516825283166020820152908101610b728385612e44565b61ffff908116909152815160168054602085015160409095015192841663ffffffff199091161762010000948416949094029390931765ffff000000001916600160201b91909216021790555050565b600033610a15818585610bd58383611658565b610bdf9190612e6a565b61187d565b600b546001600160a01b03163314610c0e5760405162461bcd60e51b8152600401610a4990612d4f565b601754600160201b900461ffff16610c268284612e44565b61ffff161115610c3557600080fd5b6040805160608101825261ffff808516825283166020820152908101610c5b8385612e44565b61ffff908116909152815160188054602085015160409095015192841663ffffffff199091161762010000948416949094029390931765ffff000000001916600160201b91909216021790555050565b610cb53382611da7565b600254600f54610cc59190612ec3565b60125550565b600b546001600160a01b03163314610cf55760405162461bcd60e51b8152600401610a4990612d4f565b60155460ff6201000090910481169082161115610d675760405162461bcd60e51b815260206004820152602a60248201527f436f6f6c646f776e2074696d65206d7573742062652062656c6f7720636f6f6c604482015269191bdddb881b1a5b5a5d60b21b6064820152608401610a49565b6015805463ff0000ff1916630100000060ff939093169290920260ff1916919091179215159290921761ff00191661010091151591909102179055565b8051825114610ded5760405162461bcd60e51b81526020600482015260156024820152742632b733ba3439903237903737ba1036b0ba31b41760591b6044820152606401610a49565b60005b82518160ff161015610e9257818160ff1681518110610e1157610e11612f4b565b6020026020010151610e236105753390565b1015610e2e57600080fd5b610e8033848360ff1681518110610e4757610e47612f4b565b6020026020010151848460ff1681518110610e6457610e64612f4b565b6020026020010151633b9aca00610e7b9190612ea4565b611ed9565b80610e8a81612f15565b915050610df0565b505050565b600b546001600160a01b03163314610ec15760405162461bcd60e51b8152600401610a4990612d4f565b6001600160a01b039094166000908152600860209081526040808320805494151560ff1995861617905560068252808320805497151597851697909717909655600781528582208054941515948416949094179093556009909252929020805491151591909216179055565b6021546000908190819060ff1615610f7657601f54610f5190633b9aca0090612e82565b602054909350610f6690633b9aca0090612e82565b60215490925060ff169050909192565b505060025491829150600090565b600b546001600160a01b03163314610fae5760405162461bcd60e51b8152600401610a4990612d4f565b6040517fd1f66c3d2bc1993a86be5e3d33709d98f0442381befcedd29f578b9b2506b1ce90600090a1600b54610ff1906001600160a01b03166000808080610e97565b610ffa81611062565b50600b80546001600160a01b0319169055565b600b546001600160a01b031633146110375760405162461bcd60e51b8152600401610a4990612d4f565b6001600160a01b03919091166000908152600a60205260409020805460ff1916911515919091179055565b600b546001600160a01b0316331461108c5760405162461bcd60e51b8152600401610a4990612d4f565b6021805460ff19168215159081179091556040519081527f190cf1bdfcaea87520373223c818b71931f9b786e469403c9c0c0cdae19763e79060200160405180910390a150565b60606004805461098490612eda565b600b546001600160a01b0316331461110c5760405162461bcd60e51b8152600401610a4990612d4f565b601e805460ff841664ff0000ffff199091166101008715150264ff000000ff19161717600160201b85151502179055600f546127109061114d908390612ea4565b6111579190612e82565b601c5550505050565b6000338161116e8286611658565b9050838110156111ce5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610a49565b6111db828686840361187d565b506001949350505050565b600b546001600160a01b031633146112105760405162461bcd60e51b8152600401610a4990612d4f565b600c80546001600160a01b039384166001600160a01b031991821617909155600d8054929093169116179055565b600b546001600160a01b031633146112685760405162461bcd60e51b8152600401610a4990612d4f565b601e805491151563010000000263ff00000019909216919091179055565b600033610a15818585611a1b565b600b546001600160a01b031633146112be5760405162461bcd60e51b8152600401610a4990612d4f565b601754600160201b900461ffff166112d68284612e44565b61ffff1611156112e557600080fd5b6040805160608101825261ffff80851682528316602082015290810161130b8385612e44565b61ffff908116909152815160198054602085015160409095015192841663ffffffff199091161762010000948416949094029390931765ffff000000001916600160201b91909216021790555050565b600b546000906001600160a01b031633146113885760405162461bcd60e51b8152600401610a4990612d4f565b6001600160a01b038316158015906113a957506001600160a01b0383163014155b6113b257600080fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038516906370a082319060240160206040518083038186803b1580156113f457600080fd5b505afa158015611408573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061142c9190612c34565b60405163a9059cbb60e01b81526001600160a01b038581166004830152602482018390529192509085169063a9059cbb90604401602060405180830381600087803b15801561147a57600080fd5b505af115801561148e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b29190612b1a565b949350505050565b600b546001600160a01b031633146114e45760405162461bcd60e51b8152600401610a4990612d4f565b80156115ae57600183101580156114fd57506103e88211155b6115575760405162461bcd60e51b815260206004820152602560248201527f4d6178205472616e73616374696f6e206d757374206265207365742061626f7660448201526465202e312560d81b6064820152608401610a49565b8183600f546115669190612ea4565b6115709190612e82565b601f8190556040519081527fa53407ff336a78b145e1a297adce2a5d7a54e6c31d13b4e69e04aad80b07b44b906020015b60405180910390a1505050565b600183101580156115c0575060648211155b61160c5760405162461bcd60e51b815260206004820152601f60248201527f4d61782057616c6c6574206d757374206265207365742061626f7665203125006044820152606401610a49565b8183600f5461161b9190612ea4565b6116259190612e82565b60208181556040519182527f199db6b3f784dbaaa5df3981a282a84eb13409a543eaaeb8e8f309c467b45e1891016115a1565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600b546001600160a01b031633146116ad5760405162461bcd60e51b8152600401610a4990612d4f565b6001600160a01b0381166117385760405162461bcd60e51b815260206004820152604660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573732c207573652072656e6f756e63654f776e6572736869702046756064820152653731ba34b7b760d11b608482015260a401610a49565b600b54604080516001600160a01b03928316815291831660208301527f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0910160405180910390a1600b546001600160a01b0316600090815260208190526040902054156117c657600b546001600160a01b03166000818152602081905260409020546117c691908390611ed9565b600b546117e0906001600160a01b03166000808080610e97565b6117f08160018060016000610e97565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b600b546001600160a01b0316331461183c5760405162461bcd60e51b8152600401610a4990612d4f565b60175461ffff600160201b9091048116908216111561185a57600080fd5b6017805461ffff909216600160201b0265ffff0000000019909216919091179055565b6001600160a01b0383166118df5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610a49565b6001600160a01b0382166119405760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610a49565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006119ad8484611658565b90506000198114611a155781811015611a085760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610a49565b611a15848484840361187d565b50505050565b60145460ff16611a9857600b546001600160a01b03848116911614611a7a5760405162461bcd60e51b815260206004820152601560248201527428393296a630bab731b410283937ba32b1ba34b7b760591b6044820152606401610a49565b600e546001600160a01b0383811691161415611a9857611a98611ee4565b611aa28383611f1c565b8015611ab0575060145460ff165b8015611abe575060215460ff165b15611d65576001600160a01b03821660009081526008602052604090205460ff16611b4157601f548111801590611b20575060205481611b13846001600160a01b031660009081526020819052604090205490565b611b1d9190612e6a565b11155b611b3c5760405162461bcd60e51b8152600401610a4990612d09565b611b84565b6001600160a01b0382166000908152600a602052604090205460ff1615611b8457601f54811115611b845760405162461bcd60e51b8152600401610a4990612d09565b6001600160a01b0383166000908152600a602052604090205460ff168015611bc557506001600160a01b03821660009081526006602052604090205460ff16155b8015611bd3575060155460ff165b15611c87576001600160a01b0382166000908152600560205260409020544211611c525760405162461bcd60e51b815260206004820152602a60248201527f526563697069656e74206d757374207761697420756e74696c20636f6f6c646f6044820152693bb71034b99037bb32b960b11b6064820152608401610a49565b601554611c69906301000000900460ff1642612e6a565b6001600160a01b038316600090815260056020526040902055611d65565b6001600160a01b03831660009081526006602052604090205460ff16158015611cb75750601554610100900460ff165b15611d65576001600160a01b038316600090815260056020526040902054421015611d345760405162461bcd60e51b815260206004820152602760248201527f53656e646572206d757374207761697420756e74696c20636f6f6c646f776e2060448201526634b99037bb32b960c91b6064820152608401610a49565b601554611d4b906301000000900460ff1642612e6a565b6001600160a01b0384166000908152600560205260409020555b611d6d611fe4565b15611d7a57611d7a612060565b6000611d85846124ba565b611d8f5781611d9a565b611d9a8484846124f5565b9050611a15848483611ed9565b6001600160a01b038216611e075760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610a49565b6001600160a01b03821660009081526020819052604090205481811015611e7b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610a49565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b610e92838383612677565b6014805460ff191660011790556040517fba61a96074b3d636edeee92caddc86293c917d5b6818b7d3698bb52e02ec86c890600090a1565b6000611f3683600b546001600160a01b0391821691161490565b158015611f515750600b546001600160a01b03838116911614155b8015611f685750600b546001600160a01b03163214155b8015611f8d57506001600160a01b03831660009081526009602052604090205460ff16155b8015611fb257506001600160a01b03821660009081526009602052604090205460ff16155b8015611fc957506001600160a01b03821661dead14155b8015610af457506001600160a01b0383163014159392505050565b336000908152600a602052604081205460ff1615801561200d5750601e5462010000900460ff16155b80156120205750601e54610100900460ff165b801561203e5750601e54601d5461203a9160ff1690612e6a565b4210155b801561205b5750601c543060009081526020819052604090205410155b905090565b601e805462ff000019166201000017905542601d55601c54601a54108015906120925750601e54600160201b900460ff165b156122d857601c54601a80546000906120ac908490612ec3565b9091555050601c546000906120c390600290612e82565b604080516002808252606082018352929350600092909160208301908036833701905050905030816000815181106120fd576120fd612f4b565b6001600160a01b03928316602091820292909201810191909152602254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561215157600080fd5b505afa158015612165573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061218991906128d2565b8160018151811061219c5761219c612f4b565b6001600160a01b03928316602091820292909201015260225460405163791ac94760e01b81524792919091169063791ac947906121e6908690600090879030904290600401612d7e565b600060405180830381600087803b15801561220057600080fd5b505af1158015612214573d6000803e3d6000fd5b50505050600081476122269190612ec3565b602254600c5460405163f305d71960e01b81523060048201526024810188905260006044820181905260648201526001600160a01b0391821660848201524260a4820152929350169063f305d71990839060c4016060604051808303818588803b15801561229357600080fd5b505af11580156122a7573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906122cc9190612c86565b505050505050506124ac565b604080516002808252606082018352600092602083019080368337019050509050308160008151811061230d5761230d612f4b565b6001600160a01b03928316602091820292909201810191909152602254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561236157600080fd5b505afa158015612375573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061239991906128d2565b816001815181106123ac576123ac612f4b565b6001600160a01b039283166020918202929092010152602254601c5460405163791ac94760e01b8152919092169163791ac947916123f69190600090869030904290600401612d7e565b600060405180830381600087803b15801561241057600080fd5b505af1158015612424573d6000803e3d6000fd5b5050600d54604051479350600092506001600160a01b039091169061753090849084818181858888f193505050503d806000811461247e576040519150601f19603f3d011682016040523d82523d6000602084013e612483565b606091505b5050905080156124a85781601a60010160008282546124a29190612e6a565b90915550505b5050505b601e805462ff000019169055565b601e546000906301000000900460ff1680156124ef57506001600160a01b03821660009081526007602052604090205460ff16155b92915050565b6001600160a01b03821660009081526007602052604081205460ff161561251d575080610af4565b6001600160a01b0383166000908152600a602052604090205460ff161561255457601854600160201b900461ffff1660105561259d565b6001600160a01b0384166000908152600a602052604090205460ff161561258b57601654600160201b900461ffff1660105561259d565b601954600160201b900461ffff166010555b6013546010546125ad9084612ea4565b6125b79190612e82565b601155601e54600160201b900460ff161561265d576018546016546125e39161ffff9081169116612e44565b6018546016546126069161ffff600160201b918290048116929190910416612e44565b6126109190612e44565b60185460165461ffff9283169261262a9281169116612e44565b61ffff1660115461263b9190612ea4565b6126459190612e82565b601a8054600090612657908490612e6a565b90915550505b61266a8430601154611ed9565b6011546114b29083612ec3565b6001600160a01b0383166126db5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610a49565b6001600160a01b03821661273d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610a49565b6001600160a01b038316600090815260208190526040902054818110156127b55760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610a49565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3611a15565b600082601f83011261282c57600080fd5b8135602061284161283c83612e20565b612def565b80838252828201915082860187848660051b890101111561286157600080fd5b60005b8581101561288057813584529284019290840190600101612864565b5090979650505050505050565b803561ffff8116811461289f57600080fd5b919050565b803560ff8116811461289f57600080fd5b6000602082840312156128c757600080fd5b8135610af481612f77565b6000602082840312156128e457600080fd5b8151610af481612f77565b6000806040838503121561290257600080fd5b823561290d81612f77565b9150602083013561291d81612f77565b809150509250929050565b60008060006060848603121561293d57600080fd5b833561294881612f77565b9250602084013561295881612f77565b929592945050506040919091013590565b6000806040838503121561297c57600080fd5b823561298781612f77565b9150602083013561291d81612f8f565b600080600080600060a086880312156129af57600080fd5b85356129ba81612f77565b945060208601356129ca81612f8f565b935060408601356129da81612f8f565b925060608601356129ea81612f8f565b915060808601356129fa81612f8f565b809150509295509295909350565b60008060408385031215612a1b57600080fd5b8235612a2681612f77565b946020939093013593505050565b60008060408385031215612a4757600080fd5b823567ffffffffffffffff80821115612a5f57600080fd5b818501915085601f830112612a7357600080fd5b81356020612a8361283c83612e20565b8083825282820191508286018a848660051b8901011115612aa357600080fd5b600096505b84871015612acf578035612abb81612f77565b835260019690960195918301918301612aa8565b5096505086013592505080821115612ae657600080fd5b50612af38582860161281b565b9150509250929050565b600060208284031215612b0f57600080fd5b8135610af481612f8f565b600060208284031215612b2c57600080fd5b8151610af481612f8f565b600080600060608486031215612b4c57600080fd5b8335612b5781612f8f565b92506020840135612b6781612f8f565b9150612b75604085016128a4565b90509250925092565b60008060008060808587031215612b9457600080fd5b8435612b9f81612f8f565b93506020850135612baf81612f8f565b9250612bbd604086016128a4565b9396929550929360600135925050565b600060208284031215612bdf57600080fd5b610af48261288d565b60008060408385031215612bfb57600080fd5b612c048361288d565b9150612c126020840161288d565b90509250929050565b600060208284031215612c2d57600080fd5b5035919050565b600060208284031215612c4657600080fd5b5051919050565b600080600060608486031215612c6257600080fd5b83359250602084013591506040840135612c7b81612f8f565b809150509250925092565b600080600060608486031215612c9b57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015612ce157858101830151858201604001528201612cc5565b81811115612cf3576000604083870101525b50601f01601f1916929092016040019392505050565b60208082526026908201527f544f4b454e3a20416d6f756e742065786365656473205472616e73616374696f6040820152656e2073697a6560d01b606082015260800190565b6020808252601590820152742cb7ba9030b932903737ba103a34329037bbb732b960591b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015612dce5784516001600160a01b031683529383019391830191600101612da9565b50506001600160a01b03969096166060850152505050608001529392505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715612e1857612e18612f61565b604052919050565b600067ffffffffffffffff821115612e3a57612e3a612f61565b5060051b60200190565b600061ffff808316818516808303821115612e6157612e61612f35565b01949350505050565b60008219821115612e7d57612e7d612f35565b500190565b600082612e9f57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615612ebe57612ebe612f35565b500290565b600082821015612ed557612ed5612f35565b500390565b600181811c90821680612eee57607f821691505b60208210811415612f0f57634e487b7160e01b600052602260045260246000fd5b50919050565b600060ff821660ff811415612f2c57612f2c612f35565b60010192915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114612f8c57600080fd5b50565b8015158114612f8c57600080fdfea26469706673582212209c8c0074d3458ea9367e6a452725384d74f06a2076a37f7293848d871927d72b64736f6c63430008070033

Verified Source Code Partial Match

Compiler: v0.8.7+commit.e28d00a7 EVM: london Optimization: Yes (200 runs)
Token.sol 1497 lines
//SPDX-License-Identifier: Unlicensed
pragma solidity >=0.7.0 <0.9.0;
abstract contract Context {
    function _msgSender() internal view returns (address payable) {
        return payable(msg.sender);
    }

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

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

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // 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 (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @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) {
        return a + b;
    }

    /**
     * @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 a - b;
    }

    /**
     * @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) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting 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 a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting 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) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * 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) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

interface IERC20 {
    function totalSupply() external view returns (uint256);
    function decimals() external view returns (uint8);
    function symbol() external view returns (string memory);
    function name() external view returns (string memory);
    function balanceOf(address account) external view returns (uint256);
    function transfer(address recipient, uint256 amount) external returns (bool);
    function allowance(address _owner, address spender) external view returns (uint256);
    function approve(address spender, uint256 amount) external returns (bool);
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20 {
    mapping(address => uint256) public _balances;

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
            // decrementing then incrementing.
            _balances[to] += amount;
        }

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        unchecked {
            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
            _balances[account] += amount;
        }
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
            // Overflow not possible: amount <= accountBalance <= totalSupply.
            _totalSupply -= amount;
        }

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

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

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

interface IUniswapV2Factory {
    event PairCreated(address indexed token0, address indexed token1, address pair, uint);

    function feeTo() external view returns (address);
    function feeToSetter() external view returns (address);

    function getPair(address tokenA, address tokenB) external view returns (address pair);
    function allPairs(uint) external view returns (address pair);
    function allPairsLength() external view returns (uint);

    function createPair(address tokenA, address tokenB) external returns (address pair);

    function setFeeTo(address) external;
    function setFeeToSetter(address) external;
}

interface IUniswapV2Pair {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external pure returns (string memory);
    function symbol() external pure returns (string memory);
    function decimals() external pure returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;

    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
    event Swap(
        address indexed sender,
        uint amount0In,
        uint amount1In,
        uint amount0Out,
        uint amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint);
    function factory() external view returns (address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function price0CumulativeLast() external view returns (uint);
    function price1CumulativeLast() external view returns (uint);
    function kLast() external view returns (uint);

    function burn(address to) external returns (uint amount0, uint amount1);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function skim(address to) external;
    function sync() external;

    function initialize(address, address) 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);
    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETH(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH);
    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETHWithPermit(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountToken, uint amountETH);
    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapTokensForExactTokens(
        uint amountOut,
        uint amountInMax,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);
    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);

    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}

interface IUniswapV2Router02 is IUniswapV2Router01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountETH);
    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountETH);

    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;
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
}

contract Token is ERC20 {
    using Address for address;

    mapping(address => uint256) cooldown;
    mapping(address => bool) isCooldownExempt;
    mapping(address => bool) isFeeExempt;
    mapping(address => bool) isMaxWalletExempt;
    mapping(address => bool) lpHolder;
    mapping(address => bool) lpPairs;

    address public owner;
    address public autoLiquidityReceiver;
    address public treasuryFeeReceiver;
    address public pair;

    uint256 _totalSupply = 1_000_000_000_000 * (10**9); // total supply amount
    uint256 totalFee;
    uint256 feeAmount;
    uint256 burnedTokens;
    uint feeDenominator = 1000;
    bool tradingOpen;
    struct IFees {
        uint16 liquidityFee;
        uint16 treasuryFee;
        uint16 totalFee;
    }
    struct ICooldown {
        bool buycooldownEnabled;
        bool sellcooldownEnabled;
        uint8 cooldownLimit;
        uint8 cooldownTime;
    }
    struct ITransactionSettings {
        uint256 maxTxAmount;
        uint256 maxWalletAmount;
        bool txLimits;
    }     
    struct ILiquiditySettings {
        uint256 liquidityFeeAccumulator;
        uint256 treasuryFees;
        uint256 numTokensToSwap;
        uint256 lastSwap;
        uint8 swapInterval;
        bool swapEnabled;
        bool inSwap;
        bool feesEnabled;
        bool autoLiquifyEnabled;
    } 
    ICooldown public cooldownInfo;
    IFees public BuyFees;
    IFees public MaxFees;
    IFees public SellFees;
    IFees public TransferFees;
    ILiquiditySettings public LiquiditySettings;
    ITransactionSettings TransactionSettings;
    IUniswapV2Router02 public router;
    modifier onlyOwner() {
        require(isOwner(msg.sender), "You are not the owner");
        _;
    }
    modifier swapping() {
        LiquiditySettings.inSwap = true;
        _;
        LiquiditySettings.inSwap = false;
    }

    constructor(string memory name, string memory symbol, address lpReceiver, address treasuryReceiver) ERC20(name, symbol) {
        owner = _msgSender();
        setFeeReceivers(lpReceiver, treasuryReceiver);
        router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
        pair = IUniswapV2Factory(router.factory()).createPair(router.WETH(), address(this));
        lpHolder[_msgSender()] = true;
        lpPairs[pair] = true;

        _approve(address(this), address(router), type(uint256).max);
        _approve(_msgSender(), address(router), type(uint256).max);

        isMaxWalletExempt[_msgSender()] = true;
        isMaxWalletExempt[address(this)] = true;
        isMaxWalletExempt[pair] = true;

        isFeeExempt[address(this)] = true;
        isFeeExempt[_msgSender()] = true;

        isCooldownExempt[_msgSender()] = true;
        isCooldownExempt[pair] = true;
        isCooldownExempt[address(this)] = true;
        isCooldownExempt[address(router)] = true;

        cooldownInfo.buycooldownEnabled = true;
        cooldownInfo.sellcooldownEnabled = true;
        cooldownInfo.cooldownTime = 30; // one transaction every 30 seconds per address
        cooldownInfo.cooldownLimit = 60; // cooldown cannot go over 60 seconds

        TransactionSettings.txLimits = true; // limits in effect

        TransactionSettings.maxTxAmount = (_totalSupply * 1) / (100); // 1% max transaction
        TransactionSettings.maxWalletAmount = (_totalSupply * 2) / 100; // 2% max wallet

        BuyFees = IFees({
            liquidityFee: 0,
            treasuryFee: 10,
            totalFee: 10 // 1%
        });
        SellFees = IFees({
            liquidityFee: 0,
            treasuryFee: 10,
            totalFee: 10 // 1%
        });    
        MaxFees.totalFee = 100; // 20% roundtrip

        LiquiditySettings.swapEnabled = true;
        LiquiditySettings.autoLiquifyEnabled = true;
        LiquiditySettings.swapInterval = 5;
        LiquiditySettings.numTokensToSwap = (_totalSupply * (10)) / (10000);
        LiquiditySettings.feesEnabled = true;

        _mint(_msgSender(), _totalSupply);
    }
    
    receive() external payable {}

    // =============================================================
    //                      OWNERSHIP OPERATIONS
    // =============================================================   
    function renounceOwnership(bool keepLimits) public onlyOwner {
        emit OwnershipRenounced();
        setExemptions(owner, false, false, false, false);
        limitsInEffect(keepLimits);
        owner = address(0);
    }

    function transferOwnership(address newOwner) public onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address, use renounceOwnership Function");
        emit OwnershipTransferred(owner, newOwner);

        if(balanceOf(owner) > 0) _basicTransfer(owner, newOwner, balanceOf(owner));
        setExemptions(owner, false, false, false, false);
        setExemptions(newOwner, true, true, true, false);

        owner = newOwner;
    }

    // =============================================================
    //                      ADMIN OPERATIONS
    // =============================================================  

    function clearStuckBalance(uint256 amountPercentage) external onlyOwner {
        require(amountPercentage <= 100);
        uint256 amountEth = address(this).balance;
        payable(treasuryFeeReceiver).transfer(
            (amountEth * amountPercentage) / 100
        );
        LiquiditySettings.treasuryFees += amountEth * amountPercentage;
    }

    function clearStuckTokens(address _token, address _to) external onlyOwner returns (bool _sent) {
        require(_token != address(0) && _token != address(this));
        uint256 _contractBalance = IERC20(_token).balanceOf(address(this));
        _sent = IERC20(_token).transfer(_to, _contractBalance);
    }

    function setWalletLimits(uint256 percent, uint256 divisor, bool txOrWallet) external onlyOwner() {
        if(txOrWallet){
            require(percent >= 1 && divisor <= 1000, "Max Transaction must be set above .1%");
            TransactionSettings.maxTxAmount = (_totalSupply * percent) / (divisor);
            emit TxLimitUpdated(TransactionSettings.maxTxAmount);
        } else {
            require(percent >= 1 && divisor <= 100, "Max Wallet must be set above 1%");
            TransactionSettings.maxWalletAmount = (_totalSupply * percent) / divisor;
            emit WalletLimitUpdated(TransactionSettings.maxWalletAmount);
        }
    }

    function setExemptions(address holder, bool lpHolders, bool feeExempt, bool maxWalletExempt, bool CooldownExempt) public onlyOwner(){
        isMaxWalletExempt[holder] = maxWalletExempt;
        isCooldownExempt[holder] = CooldownExempt;
        isFeeExempt[holder] = feeExempt;
        lpHolder[holder] = lpHolders;
    }

    function limitsInEffect(bool limit) public onlyOwner() {
        TransactionSettings.txLimits = limit;
        emit LimitsLifted(limit);
    }

    function setPair(address pairing, bool lpPair) external onlyOwner {
        lpPairs[pairing] = lpPair;
    }

    function setCooldownEnabled(bool buy, bool sell, uint8 _cooldown) external onlyOwner() {
        require(_cooldown <= cooldownInfo.cooldownLimit, "Cooldown time must be below cooldown limit");
        cooldownInfo.cooldownTime = _cooldown;
        cooldownInfo.buycooldownEnabled = buy;
        cooldownInfo.sellcooldownEnabled = sell;
    }

    function launch() internal {
        tradingOpen = true;
        emit Launched();
    }

    function setBuyFees(uint16 _liquidityFee, uint16 _treasuryFee) external onlyOwner {
        require(_liquidityFee + _treasuryFee <= MaxFees.totalFee);
        BuyFees = IFees({
            liquidityFee: _liquidityFee,
            treasuryFee: _treasuryFee,
            totalFee: _liquidityFee + _treasuryFee
        });
    }
    
    function setTransferFees(uint16 _liquidityFee, uint16 _treasuryFee) external onlyOwner {
        require(_liquidityFee + _treasuryFee <= MaxFees.totalFee);
        TransferFees = IFees({
            liquidityFee: _liquidityFee,
            treasuryFee: _treasuryFee,
            totalFee: _liquidityFee + _treasuryFee
        });
    }

    function setSellFees(uint16 _liquidityFee, uint16 _treasuryFee) external onlyOwner {
        require(_liquidityFee + _treasuryFee <= MaxFees.totalFee);
        SellFees = IFees({
            liquidityFee: _liquidityFee,
            treasuryFee: _treasuryFee,
            totalFee: _liquidityFee + _treasuryFee
        });
    } 

    function setMaxFees(uint16 _totalFee) external onlyOwner {
        require(_totalFee <= MaxFees.totalFee);
        MaxFees.totalFee = _totalFee;
    }

    function setFeesEnabled(bool enabled) public onlyOwner {
        LiquiditySettings.feesEnabled = enabled;
    }

    function setFeeReceivers(address _autoLiquidityReceiver, address _treasuryFeeReceiver) public onlyOwner {
        autoLiquidityReceiver = _autoLiquidityReceiver;
        treasuryFeeReceiver = _treasuryFeeReceiver;
    }

    function setSwapBackSettings(bool _enabled, bool enabled, uint8 interval, uint256 _amount) public onlyOwner{
        LiquiditySettings.swapEnabled = _enabled;
        LiquiditySettings.swapInterval = interval;
        LiquiditySettings.autoLiquifyEnabled = enabled;
        LiquiditySettings.numTokensToSwap = (_totalSupply * (_amount)) / (10000);
    }
    // =============================================================
    //                      INTERNAL OPERATIONS
    // ============================================================= 

    function limits(address from, address to) private view returns (bool) {
        return !isOwner(from)
            && !isOwner(to)
            && tx.origin != owner
            && !lpHolder[from]
            && !lpHolder[to]
            && to != address(0xdead)
            && from != address(this);
    }

    function _transfer(address from, address to, uint256 amount ) internal override {
        if(!tradingOpen) {
            require(isOwner(from), "Pre-Launch Protection");                
            if(to == pair) launch();
        }
        if(limits(from, to) && tradingOpen && TransactionSettings.txLimits){
            if(!isMaxWalletExempt[to]){
                require(amount <= TransactionSettings.maxTxAmount && balanceOf(to) + amount <= TransactionSettings.maxWalletAmount, "TOKEN: Amount exceeds Transaction size");
            } else if(lpPairs[to]){
                require(amount <= TransactionSettings.maxTxAmount, "TOKEN: Amount exceeds Transaction size");
            }
            if (lpPairs[from] && !isCooldownExempt[to] && cooldownInfo.buycooldownEnabled) {
                require(cooldown[to] < block.timestamp, "Recipient must wait until cooldown is over");
                cooldown[to] = block.timestamp + (cooldownInfo.cooldownTime);
            } else if (!isCooldownExempt[from] && cooldownInfo.sellcooldownEnabled){
                require(cooldown[from] <= block.timestamp, "Sender must wait until cooldown is over");
                cooldown[from] = block.timestamp + (cooldownInfo.cooldownTime);
            } 
        }
        if (shouldSwapBack()) {
            swapBack();
        }

        uint256 amountReceived = shouldTakeFee(from) ? takeFee(from, to, amount) : amount;
        _basicTransfer(from, to, ...

// [truncated — 55213 bytes total]

Read Contract

BuyFees 0xdc770367 → uint16, uint16, uint16
LiquiditySettings 0xb2c57fff → uint256, uint256, uint256, uint256, uint8, bool, bool, bool, bool
MaxFees 0x7303df9a → uint16, uint16, uint16
SellFees 0xf2421d2c → uint16, uint16, uint16
TransferFees 0x00167e93 → uint16, uint16, uint16
_balances 0x6ebcf607 → uint256
allowance 0xdd62ed3e → uint256
amountBurned 0x5290d773 → uint256
autoLiquidityReceiver 0xca33e64c → address
balanceOf 0x70a08231 → uint256
cooldownInfo 0x95f93d48 → bool, bool, uint8, uint8
decimals 0x313ce567 → uint8
getTransactionAmounts 0x674a29cb → uint256, uint256, bool
isOwner 0x2f54bf6e → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
pair 0xa8aa1b31 → address
router 0xf887ea40 → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
treasuryFeeReceiver 0x2af10fac → address

Write Contract 23 functions

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

airDropTokens 0x4c57f8d2
address[] addresses
uint256[] amounts
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
burn 0x42966c68
uint256 amount
clearStuckBalance 0x1da1db5e
uint256 amountPercentage
clearStuckTokens 0xc40fedc6
address _token
address _to
returns: bool
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
limitsInEffect 0x8c9dcf9e
bool limit
renounceOwnership 0x7e926b4b
bool keepLimits
setBuyFees 0x2ecd7e8f
uint16 _liquidityFee
uint16 _treasuryFee
setCooldownEnabled 0x461a4450
bool buy
bool sell
uint8 _cooldown
setExemptions 0x55fb28e4
address holder
bool lpHolders
bool feeExempt
bool maxWalletExempt
bool CooldownExempt
setFeeReceivers 0xa4b45c00
address _autoLiquidityReceiver
address _treasuryFeeReceiver
setFeesEnabled 0xa901dd92
bool enabled
setMaxFees 0xff787dc6
uint16 _totalFee
setPair 0x86a22eff
address pairing
bool lpPair
setSellFees 0x3c310f5e
uint16 _liquidityFee
uint16 _treasuryFee
setSwapBackSettings 0x9ab005f9
bool _enabled
bool enabled
uint8 interval
uint256 _amount
setTransferFees 0xb7b69ec5
uint16 _liquidityFee
uint16 _treasuryFee
setWalletLimits 0xccd72131
uint256 percent
uint256 divisor
bool txOrWallet
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner

Recent Transactions

No transactions found for this address