Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0xa7adcd97713C299dA320587eD9e229eBc7a19dD1
Balance 0 ETH
Nonce 2
Code Size 13758 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

13758 bytes
0x60806040526004361061021d575f3560e01c80638c0f7eba11610122578063cfc937a0116100aa578063eaa9600b1161006e578063eaa9600b1461070d578063ef62f21414610737578063f2fde38b14610761578063f9d8f2a014610789578063fc0c546a146107b35761022c565b8063cfc937a01461065d578063cfddae0814610687578063d0febe4c146106af578063d9462709146106b9578063e35a6c7a146106e35761022c565b8063b62e3c5a116100f1578063b62e3c5a1461058d578063b68ffb3a146105b7578063b6b55f25146105e1578063c194ee2d14610609578063ce7842f5146106335761022c565b80638c0f7eba146105095780638da5cb5b1461052557806398b9a2dc1461054f578063a43be57b146105775761022c565b806351229d3b116101a55780635ef8086f116101745780635ef8086f1461044f57806362064db614610477578063639efa861461049f578063715018a6146104c95780638781ffa4146104df5761022c565b806351229d3b146103a7578063521eb273146103d15780635be436d9146103fb5780635ed9ebfc146104255761022c565b8063304fa81a116101ec578063304fa81a146102c25780633894d0b3146102ec578063407fcc311461032b578063439f5ac2146103555780634cdb312d1461037f5761022c565b806304c98b2b146102305780632630c12f146102465780632e1a7d4d146102705780632f48ab7d146102985761022c565b3661022c5761022a6107dd565b005b5f80fd5b34801561023b575f80fd5b50610244610c2c565b005b348015610251575f80fd5b5061025a610c50565b60405161026791906126f2565b60405180910390f35b34801561027b575f80fd5b5061029660048036038101906102919190612742565b610c75565b005b3480156102a3575f80fd5b506102ac610e01565b6040516102b9919061278d565b60405180910390f35b3480156102cd575f80fd5b506102d6610e25565b6040516102e391906127c0565b60405180910390f35b3480156102f7575f80fd5b50610312600480360381019061030d9190612814565b610e3a565b604051610322949392919061284e565b60405180910390f35b348015610336575f80fd5b5061033f610e66565b60405161034c9190612891565b60405180910390f35b348015610360575f80fd5b50610369610e6c565b6040516103769190612891565b60405180910390f35b34801561038a575f80fd5b506103a560048036038101906103a09190612742565b610e75565b005b3480156103b2575f80fd5b506103bb610ec9565b6040516103c89190612891565b60405180910390f35b3480156103dc575f80fd5b506103e5610ecf565b6040516103f291906128b9565b60405180910390f35b348015610406575f80fd5b5061040f610ef4565b60405161041c9190612891565b60405180910390f35b348015610430575f80fd5b50610439610efd565b6040516104469190612891565b60405180910390f35b34801561045a575f80fd5b5061047560048036038101906104709190612742565b610f06565b005b348015610482575f80fd5b5061049d600480360381019061049891906128d2565b611220565b005b3480156104aa575f80fd5b506104b36116f5565b6040516104c09190612891565b60405180910390f35b3480156104d4575f80fd5b506104dd6116fe565b005b3480156104ea575f80fd5b506104f3611711565b6040516105009190612891565b60405180910390f35b610523600480360381019061051e9190612814565b61171a565b005b348015610530575f80fd5b50610539611d32565b60405161054691906128b9565b60405180910390f35b34801561055a575f80fd5b506105756004803603810190610570919061294b565b611d59565b005b348015610582575f80fd5b5061058b611da4565b005b348015610598575f80fd5b506105a1611dd0565b6040516105ae919061298e565b60405180910390f35b3480156105c2575f80fd5b506105cb611e64565b6040516105d89190612891565b60405180910390f35b3480156105ec575f80fd5b5061060760048036038101906106029190612742565b611e6d565b005b348015610614575f80fd5b5061061d611f1f565b60405161062a9190612891565b60405180910390f35b34801561063e575f80fd5b50610647611f28565b6040516106549190612891565b60405180910390f35b348015610668575f80fd5b50610671611f2e565b60405161067e91906127c0565b60405180910390f35b348015610692575f80fd5b506106ad60048036038101906106a891906129a7565b611f44565b005b6106b76107dd565b005b3480156106c4575f80fd5b506106cd611ff2565b6040516106da9190612891565b60405180910390f35b3480156106ee575f80fd5b506106f7611ffb565b6040516107049190612891565b60405180910390f35b348015610718575f80fd5b50610721612004565b60405161072e9190612891565b60405180910390f35b348015610742575f80fd5b5061074b6120a2565b6040516107589190612891565b60405180910390f35b34801561076c575f80fd5b5061078760048036038101906107829190612814565b6120ab565b005b348015610794575f80fd5b5061079d61212d565b6040516107aa9190612891565b60405180910390f35b3480156107be575f80fd5b506107c7612136565b6040516107d4919061278d565b60405180910390f35b600f5f9054906101000a900460ff1661082b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082290612a65565b60405180910390fd5b600f60019054906101000a900460ff161561087b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087290612acd565b60405180910390fd5b66038d7ea4c680003410156108c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108bc90612b5b565b60405180910390fd5b5f3490505f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e15f4736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610934573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109589190612ba3565b90505f811361099c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099390612c18565b60405180910390fd5b5f6109d86006546109ca6007546109bc868861215a90919063ffffffff16565b61215a90919063ffffffff16565b61216f90919063ffffffff16565b9050806003541015610a1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1690612c80565b60405180910390fd5b82600a5f828254610a309190612ccb565b925050819055508060025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f015f828254610a859190612ccb565b925050819055508060025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206003015f828254610adb9190612ccb565b9250508190555080600c5f828254610af39190612ccb565b925050819055508060035f828254610b0b9190612cfe565b925050819055505f60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1634604051610b5890612d5e565b5f6040518083038185875af1925050503d805f8114610b92576040519150601f19603f3d011682016040523d82523d5f602084013e610b97565b606091505b5050905080610bdb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bd290612dbc565b60405180910390fd5b610c2633837f0000000000000000000000004a14df70f4aa862dae0aefc80fd1405937f58eb073ffffffffffffffffffffffffffffffffffffffff166121849092919063ffffffff16565b50505050565b610c3461220a565b6001600f5f6101000a81548160ff021916908315150217905550565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610c7d61220a565b5f7f0000000000000000000000004a14df70f4aa862dae0aefc80fd1405937f58eb073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610cd791906128b9565b602060405180830381865afa158015610cf2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d169190612dee565b11610d56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4d90612e89565b60405180910390fd5b806003541015610d9b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9290612ef1565b60405180910390fd5b610de633827f0000000000000000000000004a14df70f4aa862dae0aefc80fd1405937f58eb073ffffffffffffffffffffffffffffffffffffffff166121849092919063ffffffff16565b8060035f828254610df79190612cfe565b9250508190555050565b7f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec781565b5f600f5f9054906101000a900460ff16905090565b6002602052805f5260405f205f91509050805f0154908060010154908060020154908060030154905084565b60065481565b5f601054905090565b610e7d61220a565b5f8111610ebf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb690612f59565b60405180910390fd5b8060048190555050565b60075481565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f600654905090565b5f600c54905090565b600f5f9054906101000a900460ff16610f54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f4b90612a65565b60405180910390fd5b600f60019054906101000a900460ff1615610fa4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9b90612acd565b60405180910390fd5b620f4240811015610fea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe190612fc1565b60405180910390fd5b5f64e8d4a5100082610ffc9190612fdf565b90505f61102860095461101a6008548561215a90919063ffffffff16565b61216f90919063ffffffff16565b905080600354101561106f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106690612c80565b60405180910390fd5b82600b5f8282546110809190612ccb565b925050819055508060025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f015f8282546110d59190612ccb565b925050819055508060025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206003015f82825461112b9190612ccb565b9250508190555080600c5f8282546111439190612ccb565b925050819055508060035f82825461115b9190612cfe565b925050819055506111d03360055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16857f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec773ffffffffffffffffffffffffffffffffffffffff16612288909392919063ffffffff16565b61121b33827f0000000000000000000000004a14df70f4aa862dae0aefc80fd1405937f58eb073ffffffffffffffffffffffffffffffffffffffff166121849092919063ffffffff16565b505050565b600f5f9054906101000a900460ff1661126e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126590612a65565b60405180910390fd5b600f60019054906101000a900460ff16156112be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112b590612acd565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361132c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113239061306a565b60405180910390fd5b620f4240821015611372576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136990612fc1565b60405180910390fd5b5f8290505f64e8d4a51000846113889190612fdf565b90505f6113b46009546113a66008548561215a90919063ffffffff16565b61216f90919063ffffffff16565b90508060035410156113fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113f290612c80565b60405180910390fd5b6114483330877f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec773ffffffffffffffffffffffffffffffffffffffff16612288909392919063ffffffff16565b5f61147160646114636004548761215a90919063ffffffff16565b61216f90919063ffffffff16565b90505f611487828661231190919063ffffffff16565b905080600b5f82825461149a9190612ccb565b925050819055508260025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f015f8282546114ef9190612ccb565b925050819055508260025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206003015f8282546115459190612ccb565b925050819055508160025f8873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206002015f82825461159b9190612ccb565b9250508190555082600c5f8282546115b39190612ccb565b9250508190555081600e5f8282546115cb9190612ccb565b925050819055508260035f8282546115e39190612cfe565b9250508190555061165660055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16827f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec773ffffffffffffffffffffffffffffffffffffffff166121849092919063ffffffff16565b6116a186837f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec773ffffffffffffffffffffffffffffffffffffffff166121849092919063ffffffff16565b6116ec33847f0000000000000000000000004a14df70f4aa862dae0aefc80fd1405937f58eb073ffffffffffffffffffffffffffffffffffffffff166121849092919063ffffffff16565b50505050505050565b5f600754905090565b61170661220a565b61170f5f612326565b565b5f600b54905090565b600f5f9054906101000a900460ff16611768576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161175f90612a65565b60405180910390fd5b600f60019054906101000a900460ff16156117b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117af90612acd565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611826576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181d9061306a565b60405180910390fd5b66038d7ea4c68000341015611870576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186790612b5b565b60405180910390fd5b5f3490505f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e15f4736040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118df573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906119039190612ba3565b90505f8113611947576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193e90612c18565b60405180910390fd5b5f611983600654611975600754611967868861215a90919063ffffffff16565b61215a90919063ffffffff16565b61216f90919063ffffffff16565b90508060035410156119ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c190612c80565b60405180910390fd5b5f6119f360646119e56004548761215a90919063ffffffff16565b61216f90919063ffffffff16565b90505f611a09828661231190919063ffffffff16565b905080600a5f828254611a1c9190612ccb565b925050819055508260025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f015f828254611a719190612ccb565b925050819055508260025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206003015f828254611ac79190612ccb565b925050819055508160025f8873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206001015f828254611b1d9190612ccb565b9250508190555081600d5f828254611b359190612ccb565b9250508190555082600c5f828254611b4d9190612ccb565b925050819055508260035f828254611b659190612cfe565b925050819055505f60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682604051611bb290612d5e565b5f6040518083038185875af1925050503d805f8114611bec576040519150601f19603f3d011682016040523d82523d5f602084013e611bf1565b606091505b5050905080611c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2c90612dbc565b60405180910390fd5b5f8773ffffffffffffffffffffffffffffffffffffffff1684604051611c5a90612d5e565b5f6040518083038185875af1925050503d805f8114611c94576040519150601f19603f3d011682016040523d82523d5f602084013e611c99565b606091505b5050905080611cdd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd490612dbc565b60405180910390fd5b611d2833867f0000000000000000000000004a14df70f4aa862dae0aefc80fd1405937f58eb073ffffffffffffffffffffffffffffffffffffffff166121849092919063ffffffff16565b5050505050505050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611d6161220a565b8060055f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611dac61220a565b6001600f60016101000a81548160ff02191690831515021790555042601081905550565b5f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e15f4736040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e3b573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611e5f9190612ba3565b905090565b5f600d54905090565b611e7561220a565b5f8111611eb7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eae906130f8565b60405180910390fd5b611f043330837f0000000000000000000000004a14df70f4aa862dae0aefc80fd1405937f58eb073ffffffffffffffffffffffffffffffffffffffff16612288909392919063ffffffff16565b8060035f828254611f159190612ccb565b9250508190555050565b5f600354905090565b60045481565b5f600f60019054906101000a900460ff16905090565b611f4c61220a565b5f8411611f8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f8590612f59565b60405180910390fd5b5f8311611fd0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc790612f59565b60405180910390fd5b8260068190555083600881905550816007819055508060098190555050505050565b5f600854905090565b5f600954905090565b5f7f0000000000000000000000004a14df70f4aa862dae0aefc80fd1405937f58eb073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161205e91906128b9565b602060405180830381865afa158015612079573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061209d9190612dee565b905090565b5f600e54905090565b6120b361220a565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612121576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161211890613186565b60405180910390fd5b61212a81612326565b50565b5f600a54905090565b7f0000000000000000000000004a14df70f4aa862dae0aefc80fd1405937f58eb081565b5f81836121679190612fdf565b905092915050565b5f818361217c91906131d1565b905092915050565b6122058363a9059cbb60e01b84846040516024016121a3929190613201565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506123e7565b505050565b6122126124ac565b73ffffffffffffffffffffffffffffffffffffffff16612230611d32565b73ffffffffffffffffffffffffffffffffffffffff1614612286576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227d90613272565b60405180910390fd5b565b61230b846323b872dd60e01b8585856040516024016122a993929190613290565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506123e7565b50505050565b5f818361231e9190612cfe565b905092915050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f612448826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166124b39092919063ffffffff16565b90505f815111156124a7578080602001905181019061246791906132ef565b6124a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161249d9061338a565b60405180910390fd5b5b505050565b5f33905090565b60606124c184845f856124ca565b90509392505050565b60608247101561250f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250690613418565b60405180910390fd5b5f808673ffffffffffffffffffffffffffffffffffffffff1685876040516125379190613498565b5f6040518083038185875af1925050503d805f8114612571576040519150601f19603f3d011682016040523d82523d5f602084013e612576565b606091505b509150915061258787838387612593565b92505050949350505050565b606083156125f4575f8351036125ec576125ac85612607565b6125eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e2906134f8565b60405180910390fd5b5b8290506125ff565b6125fe8383612629565b5b949350505050565b5f808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b5f8251111561263b5781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161266f9190613568565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f6126ba6126b56126b084612678565b612697565b612678565b9050919050565b5f6126cb826126a0565b9050919050565b5f6126dc826126c1565b9050919050565b6126ec816126d2565b82525050565b5f6020820190506127055f8301846126e3565b92915050565b5f80fd5b5f819050919050565b6127218161270f565b811461272b575f80fd5b50565b5f8135905061273c81612718565b92915050565b5f602082840312156127575761275661270b565b5b5f6127648482850161272e565b91505092915050565b5f612777826126c1565b9050919050565b6127878161276d565b82525050565b5f6020820190506127a05f83018461277e565b92915050565b5f8115159050919050565b6127ba816127a6565b82525050565b5f6020820190506127d35f8301846127b1565b92915050565b5f6127e382612678565b9050919050565b6127f3816127d9565b81146127fd575f80fd5b50565b5f8135905061280e816127ea565b92915050565b5f602082840312156128295761282861270b565b5b5f61283684828501612800565b91505092915050565b6128488161270f565b82525050565b5f6080820190506128615f83018761283f565b61286e602083018661283f565b61287b604083018561283f565b612888606083018461283f565b95945050505050565b5f6020820190506128a45f83018461283f565b92915050565b6128b3816127d9565b82525050565b5f6020820190506128cc5f8301846128aa565b92915050565b5f80604083850312156128e8576128e761270b565b5b5f6128f58582860161272e565b925050602061290685828601612800565b9150509250929050565b5f61291a82612678565b9050919050565b61292a81612910565b8114612934575f80fd5b50565b5f8135905061294581612921565b92915050565b5f602082840312156129605761295f61270b565b5b5f61296d84828501612937565b91505092915050565b5f819050919050565b61298881612976565b82525050565b5f6020820190506129a15f83018461297f565b92915050565b5f805f80608085870312156129bf576129be61270b565b5b5f6129cc8782880161272e565b94505060206129dd8782880161272e565b93505060406129ee8782880161272e565b92505060606129ff8782880161272e565b91505092959194509250565b5f82825260208201905092915050565b7f50726573616c65206e6f742073746172746564000000000000000000000000005f82015250565b5f612a4f601383612a0b565b9150612a5a82612a1b565b602082019050919050565b5f6020820190508181035f830152612a7c81612a43565b9050919050565b7f50726573616c652068617320656e6465640000000000000000000000000000005f82015250565b5f612ab7601183612a0b565b9150612ac282612a83565b602082019050919050565b5f6020820190508181035f830152612ae481612aab565b9050919050565b7f63616e7420627579206c6573732077697468207468616e20302e3030312045545f8201527f4800000000000000000000000000000000000000000000000000000000000000602082015250565b5f612b45602183612a0b565b9150612b5082612aeb565b604082019050919050565b5f6020820190508181035f830152612b7281612b39565b9050919050565b612b8281612976565b8114612b8c575f80fd5b50565b5f81519050612b9d81612b79565b92915050565b5f60208284031215612bb857612bb761270b565b5b5f612bc584828501612b8f565b91505092915050565b7f496e76616c6964204554482070726963650000000000000000000000000000005f82015250565b5f612c02601183612a0b565b9150612c0d82612bce565b602082019050919050565b5f6020820190508181035f830152612c2f81612bf6565b9050919050565b7f4e6f7420656e6f75676820746f6b656e7320617661696c69626c6500000000005f82015250565b5f612c6a601b83612a0b565b9150612c7582612c36565b602082019050919050565b5f6020820190508181035f830152612c9781612c5e565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f612cd58261270f565b9150612ce08361270f565b9250828201905080821115612cf857612cf7612c9e565b5b92915050565b5f612d088261270f565b9150612d138361270f565b9250828203905081811115612d2b57612d2a612c9e565b5b92915050565b5f81905092915050565b50565b5f612d495f83612d31565b9150612d5482612d3b565b5f82019050919050565b5f612d6882612d3e565b9150819050919050565b7f43616c6c206661696c65640000000000000000000000000000000000000000005f82015250565b5f612da6600b83612a0b565b9150612db182612d72565b602082019050919050565b5f6020820190508181035f830152612dd381612d9a565b9050919050565b5f81519050612de881612718565b92915050565b5f60208284031215612e0357612e0261270b565b5b5f612e1084828501612dda565b91505092915050565b7f546865726520617265206e6f7420656e6f75676820746f6b656e7320696e20635f8201527f6f6e747261637400000000000000000000000000000000000000000000000000602082015250565b5f612e73602783612a0b565b9150612e7e82612e19565b604082019050919050565b5f6020820190508181035f830152612ea081612e67565b9050919050565b7f6e6f7420656e6f75676820746f6b656e7320746f2077697468647261770000005f82015250565b5f612edb601d83612a0b565b9150612ee682612ea7565b602082019050919050565b5f6020820190508181035f830152612f0881612ecf565b9050919050565b7f526174652063616e6e6f742062652030000000000000000000000000000000005f82015250565b5f612f43601083612a0b565b9150612f4e82612f0f565b602082019050919050565b5f6020820190508181035f830152612f7081612f37565b9050919050565b7f63616e7420627579206c6573732077697468207468616e2031205553445400005f82015250565b5f612fab601e83612a0b565b9150612fb682612f77565b602082019050919050565b5f6020820190508181035f830152612fd881612f9f565b9050919050565b5f612fe98261270f565b9150612ff48361270f565b92508282026130028161270f565b9150828204841483151761301957613018612c9e565b5b5092915050565b7f63616e6e6f7420726566657220796f757273656c6600000000000000000000005f82015250565b5f613054601583612a0b565b915061305f82613020565b602082019050919050565b5f6020820190508181035f83015261308181613048565b9050919050565b7f4465706f7369742076616c7565206d75737420626520677265617465722074685f8201527f616e203000000000000000000000000000000000000000000000000000000000602082015250565b5f6130e2602483612a0b565b91506130ed82613088565b604082019050919050565b5f6020820190508181035f83015261310f816130d6565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f613170602683612a0b565b915061317b82613116565b604082019050919050565b5f6020820190508181035f83015261319d81613164565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f6131db8261270f565b91506131e68361270f565b9250826131f6576131f56131a4565b5b828204905092915050565b5f6040820190506132145f8301856128aa565b613221602083018461283f565b9392505050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f61325c602083612a0b565b915061326782613228565b602082019050919050565b5f6020820190508181035f83015261328981613250565b9050919050565b5f6060820190506132a35f8301866128aa565b6132b060208301856128aa565b6132bd604083018461283f565b949350505050565b6132ce816127a6565b81146132d8575f80fd5b50565b5f815190506132e9816132c5565b92915050565b5f602082840312156133045761330361270b565b5b5f613311848285016132db565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e5f8201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b5f613374602a83612a0b565b915061337f8261331a565b604082019050919050565b5f6020820190508181035f8301526133a181613368565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f5f8201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b5f613402602683612a0b565b915061340d826133a8565b604082019050919050565b5f6020820190508181035f83015261342f816133f6565b9050919050565b5f81519050919050565b5f5b8381101561345d578082015181840152602081019050613442565b5f8484015250505050565b5f61347282613436565b61347c8185612d31565b935061348c818560208601613440565b80840191505092915050565b5f6134a38284613468565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000005f82015250565b5f6134e2601d83612a0b565b91506134ed826134ae565b602082019050919050565b5f6020820190508181035f83015261350f816134d6565b9050919050565b5f81519050919050565b5f601f19601f8301169050919050565b5f61353a82613516565b6135448185612a0b565b9350613554818560208601613440565b61355d81613520565b840191505092915050565b5f6020820190508181035f8301526135808184613530565b90509291505056fea2646970667358221220f048dd8a113c8a5a67007cc57cc0c01ad541dbc30fd5a69465bb1b855818150364736f6c63430008180033

Verified Source Code Partial Match

Compiler: v0.8.24+commit.e11b9ed9 EVM: shanghai Optimization: No
DalmatianPresale.sol 999 lines
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;

// Sources flattened with hardhat v2.12.6 https://hardhat.org

// File @openzeppelin/contracts/utils/[email protected]

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

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

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

// File @openzeppelin/contracts/access/[email protected]

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

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

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

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

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

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

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

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

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

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

// File @openzeppelin/contracts/token/ERC20/[email protected]

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

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

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

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

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

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

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

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

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

library Address {

    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;
    }

    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");
    }

    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    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");
    }

    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);
    }

    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    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);
    }

    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    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);
    }

    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);
        }
    }

    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);
        }
    }
}

interface IERC20Permit {

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

    function nonces(address owner) external view returns (uint256);

    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

library SafeERC20 {
    using Address for address;

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

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

    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

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

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

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

    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

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

// File @openzeppelin/contracts/utils/math/[email protected]

// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)

// 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;
        }
    }
}

contract ChainlinkPriceOracle {
    AggregatorV3Interface internal priceFeed;

    constructor() {
        // BNB / USD
        priceFeed = AggregatorV3Interface(0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419);
    }

    function getLatestPrice() public view returns (int) {
        (
            ,
            int price,
            ,
            ,
        ) = priceFeed.latestRoundData();
        // for BNB / USD price is scaled up by 10 ** 8
        return price / 1e8;
    }
}

interface AggregatorV3Interface {
    function latestRoundData()
        external
        view
        returns (
            uint80 roundId,
            int answer,
            uint startedAt,
            uint updatedAt,
            uint80 answeredInRound
        );
}

contract DalmatianPresale is Ownable {
    using SafeERC20 for IERC20;
    using SafeMath for uint256;

    ChainlinkPriceOracle public priceOracle;

    //Struct for Buyers
    struct tokenBuyer{
        uint256 tokensBought;
        uint256 referrerBonusETH;
        uint256 referrerBonusUSDT;
        uint256 totalTokens;
    }

    //Mapping for Buyers
    mapping (address => tokenBuyer) public Customer;

    // The token being sold
    IERC20 public immutable token = IERC20(0x4A14Df70F4aa862DaE0Aefc80fD1405937F58eb0);

    //USDT token address
    IERC20 public immutable usdt = IERC20(0xdAC17F958D2ee523a2206206994597C13D831ec7);

    //tokens that can be claimed
    uint256 private claimableTokens;

    //referral bonus
    uint256 public referralBonus = 17;

    // Address where funds are collected
    address public wallet = payable(0xBaa0e104bccD593565E57941858e345f843B58d7);

    // How many token units a buyer gets per ETH & USDT
    uint256 public tokenPriceUSD = 451;
    uint256 public ethDivider = 1000000;
    uint256 private usdtRate = 221729;
    uint256 private usdtDivider = 100;

    // Amount of wei raised
    uint256 private weiRaised;
    uint256 private usdtRaised;

    //Amount of tokens sold
    uint256 private tokensSold;
    uint256 private totalBonusETH;
    uint256 private totalBonusUSDT;

    //Presale status
    bool private hasPresaleStarted;
    bool private hasPresaleEnded;
    uint256 private endTime;

    constructor() {
        priceOracle = new ChainlinkPriceOracle();
    }

    receive() external payable {
        buyTokens();
    }
    
    //START PRESALE
    function startPresale() public onlyOwner{
        hasPresaleStarted = true;
    }

    //END PRESALE
    function endPresale() public onlyOwner{
        hasPresaleEnded = true;
        endTime = block.timestamp;
    }

    // BUY TOKENS WITH ETH
    function buyTokens() public payable {
        require(hasPresaleStarted,"Presale not started");
        require(!hasPresaleEnded, "Presale has ended");
        require(msg.value >= 0.001 ether, "cant buy less with than 0.001 ETH");
        uint256 weiAmount = msg.value;
        //uint256 tokens = weiAmount * ethRate;

        // Get the ETH price from the ChainlinkPriceOracle
        int256 ethPrice = priceOracle.getLatestPrice();
        require(ethPrice > 0, "Invalid ETH price");

        uint256 tokens = weiAmount.mul(uint256(ethPrice)).mul(ethDivider).div(tokenPriceUSD);


        require(claimableTokens >= tokens, "Not enough tokens availible");

        weiRaised += weiAmount;

        Customer[msg.sender].tokensBought += tokens;
        Customer[msg.sender].totalTokens += tokens;
        tokensSold += tokens;
        claimableTokens -= tokens;

        (bool callSuccess, ) = payable(wallet).call{value: msg.value}("");
        require(callSuccess, "Call failed");

        token.safeTransfer(msg.sender, tokens);
    }

    function buyTokensReferral(address _friend) public payable {
        require(hasPresaleStarted,"Presale not started");
        require(!hasPresaleEnded, "Presale has ended");
        require(_friend != msg.sender, "cannot refer yourself");
        require(msg.value >= 0.001 ether, "cant buy less with than 0.001 ETH");
       // require(Customer[_friend].tokensBought > 0, "Referrer must have participated");
        uint256 weiAmount = msg.value;
      //  uint256 tokens = weiAmount * bnbRate;

        int256 ethPrice = priceOracle.getLatestPrice();
        require(ethPrice > 0, "Invalid ETH price");

        uint256 tokens = weiAmount.mul(uint256(ethPrice)).mul(ethDivider).div(tokenPriceUSD);

        require(claimableTokens >= tokens, "Not enough tokens availible");

        uint256 bonus = weiAmount.mul(referralBonus).div(100);

        uint256 finalWeiAmount = weiAmount.sub(bonus);

        weiRaised += finalWeiAmount;

        Customer[msg.sender].tokensBought += tokens;
        Customer[msg.sender].totalTokens += tokens;
        Customer[_friend].referrerBonusETH += bonus;
        totalBonusETH +=bonus;
        tokensSold += tokens;
        claimableTokens -= tokens;

        (bool callSuccess, ) = payable(wallet).call{value: finalWeiAmount}("");
        require(callSuccess, "Call failed");

        (bool callSuccessTwo, ) = payable(_friend).call{value: bonus}("");
        require(callSuccessTwo, "Call failed");

        token.safeTransfer(msg.sender, tokens);
    }

    //BUY TOKENS WITH USDT
    function buyTokensWithUSDT(uint256 amount) public {
        require(hasPresaleStarted,"Presale not started");
        require(!hasPresaleEnded, "Presale has ended");
        require(amount >= 1 * 10 ** 6, "cant buy less with than 1 USDT");
        uint256 weiAmount = amount * 10 ** 12;
        uint256 tokens = weiAmount.mul(usdtRate).div(usdtDivider);
        require(claimableTokens >= tokens, "Not enough tokens availible");

        usdtRaised += amount;

        Customer[msg.sender].tokensBought += tokens;
        Customer[msg.sender].totalTokens += tokens;
        tokensSold += tokens;
        claimableTokens -= tokens;

        usdt.safeTransferFrom(msg.sender, wallet, amount);

        token.safeTransfer(msg.sender, tokens);
    }

    function buyTokensWithUSDTReferral(uint256 amount, address _friend) public {
        require(hasPresaleStarted,"Presale not started");
        require(!hasPresaleEnded, "Presale has ended");
        require(_friend != msg.sender, "cannot refer yourself");
        require(amount >= 1 * 10 ** 6, "cant buy less with than 1 USDT");
       // require(Customer[_friend].tokensBought > 0, "Referrer must have participated");

        uint256 usdtPaid = amount;

        uint256 weiAmount = amount * 10 ** 12;
        uint256 tokens = weiAmount.mul(usdtRate).div(usdtDivider);
        require(claimableTokens >= tokens, "Not enough tokens availible");

        usdt.safeTransferFrom(msg.sender, address(this), amount);


        uint256 bonus = usdtPaid.mul(referralBonus).div(100);
        uint256 finalUsdt = usdtPaid.sub(bonus);

        usdtRaised += finalUsdt;

        Customer[msg.sender].tokensBought += tokens;
        Customer[msg.sender].totalTokens += tokens;
        Customer[_friend].referrerBonusUSDT += bonus;
        tokensSold += tokens;
        totalBonusUSDT +=bonus;
        claimableTokens -= tokens;

        usdt.safeTransfer(wallet, finalUsdt);
        usdt.safeTransfer(_friend, bonus);

        token.safeTransfer(msg.sender, tokens);
    }

    //DEPOSIT TOKENS FOR PRESALE
    function deposit(uint amount) external onlyOwner {
        require(amount > 0, "Deposit value must be greater than 0");
        token.safeTransferFrom(msg.sender, address(this), amount);
        claimableTokens += amount;
    }

    //WITHDRAW UNSOLD TOKENS IF NEEDED
    function withdraw(uint amount) external onlyOwner {
        require(
            token.balanceOf(address(this)) > 0,
            "There are not enough tokens in contract"
        );
        require(claimableTokens >= amount, "not enough tokens to withdraw");
        token.safeTransfer(msg.sender, amount);
        claimableTokens -= amount;
    }

    //TO CHANGE COLLECTION WALLET
    function changeWallet(address payable _wallet) external onlyOwner {
        wallet = _wallet;
    }

    //TO UPDATE RATES
    function changeRate(uint256 _usdtRate, uint256 _ethToUsd, uint256 divider, uint256 usdtDiv) public onlyOwner {
        require(_usdtRate > 0, "Rate cannot be 0");
        require(_ethToUsd > 0, "Rate cannot be 0");
        tokenPriceUSD = _ethToUsd;
        usdtRate = _usdtRate;
        ethDivider = divider;
        usdtDivider = usdtDiv;
    }

    function updateReferralPercentage(uint256 _referralValue) public onlyOwner {
        require(_referralValue > 0, "Rate cannot be 0");
        referralBonus = _referralValue;
    }

    // ALL GETTER FUNCTIONS TO RETRIEVE DATA

    function checkbalance() external view returns (uint256) {
        return token.balanceOf(address(this));
    }

   function getETHPriceInUSD() public view returns (int256) {
        return priceOracle.getLatestPrice();
    }

    function getDivider() public view returns (uint256) {
        return ethDivider;
    }

    function getUsdtDivider() public view returns (uint256) {
        return usdtDivider;
    }

    function getTokenUsdPrice() public view returns (uint256) {
        return tokenPriceUSD;
    }

    function getUsdtRate() public view returns (uint256) {
        return usdtRate;
    }

    function progressETH() public view returns (uint256) {
        return weiRaised;
    }

    function progressUSDT() public view returns (uint256) {
        return usdtRaised;
    }

    function soldTokens() public view returns (uint256) {
        return tokensSold;
    }

    function checkPresaleStatus() public view returns (bool) {
        return hasPresaleStarted;
    }

    function checkPresaleEnd() public view returns (bool) {
        return hasPresaleEnded;
    }

    function getClaimableTokens() public view returns (uint256) {
        return claimableTokens;
    }

    function getTotalBonusETH() public view returns (uint256) {
        return totalBonusETH;
    }

    function getTotalBonusUSDT() public view returns (uint256) {
        return totalBonusUSDT;
    }

    function getEndTime() public view returns (uint256) {
        return endTime;
    }

}

Read Contract

Customer 0x3894d0b3 → uint256, uint256, uint256, uint256
checkPresaleEnd 0xcfc937a0 → bool
checkPresaleStatus 0x304fa81a → bool
checkbalance 0xeaa9600b → uint256
ethDivider 0x51229d3b → uint256
getClaimableTokens 0xc194ee2d → uint256
getDivider 0x639efa86 → uint256
getETHPriceInUSD 0xb62e3c5a → int256
getEndTime 0x439f5ac2 → uint256
getTokenUsdPrice 0x5be436d9 → uint256
getTotalBonusETH 0xb68ffb3a → uint256
getTotalBonusUSDT 0xef62f214 → uint256
getUsdtDivider 0xe35a6c7a → uint256
getUsdtRate 0xd9462709 → uint256
owner 0x8da5cb5b → address
priceOracle 0x2630c12f → address
progressETH 0xf9d8f2a0 → uint256
progressUSDT 0x8781ffa4 → uint256
referralBonus 0xce7842f5 → uint256
soldTokens 0x5ed9ebfc → uint256
token 0xfc0c546a → address
tokenPriceUSD 0x407fcc31 → uint256
usdt 0x2f48ab7d → address
wallet 0x521eb273 → address

Write Contract 13 functions

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

buyTokens 0xd0febe4c
No parameters
buyTokensReferral 0x8c0f7eba
address _friend
buyTokensWithUSDT 0x5ef8086f
uint256 amount
buyTokensWithUSDTReferral 0x62064db6
uint256 amount
address _friend
changeRate 0xcfddae08
uint256 _usdtRate
uint256 _ethToUsd
uint256 divider
uint256 usdtDiv
changeWallet 0x98b9a2dc
address _wallet
deposit 0xb6b55f25
uint256 amount
endPresale 0xa43be57b
No parameters
renounceOwnership 0x715018a6
No parameters
startPresale 0x04c98b2b
No parameters
transferOwnership 0xf2fde38b
address newOwner
updateReferralPercentage 0x4cdb312d
uint256 _referralValue
withdraw 0x2e1a7d4d
uint256 amount

Recent Transactions

No transactions found for this address