Address Contract Verified
Address
0xA0583517464cF1cdA1e681E7d57B9b6d552BB752
Balance
0 ETH
Nonce
1
Code Size
18783 bytes
Creator
0x326Fe1be...202c at tx 0xdc580220...44c424
Indexed Transactions
0
Contract Bytecode
18783 bytes
0x6080604052600436106102e85760003560e01c806381efb72d11610190578063aa4bde28116100dc578063c024666811610095578063dd62ed3e1161006f578063dd62ed3e14610b39578063e2f4560514610b76578063f2fde38b14610ba1578063fce589d814610bca576102ef565b8063c024666814610aa8578063d257b34f14610ad1578063d85ba06314610b0e576102ef565b8063aa4bde2814610998578063ad05a7b5146109c3578063adee28ff146109ee578063b62496f514610a17578063bbc0c74214610a54578063bc205ad314610a7f576102ef565b806396ea32da116101495780639a7a23d6116101235780639a7a23d6146108ca5780639ee708ff146108f3578063a457c2d71461091e578063a9059cbb1461095b576102ef565b806396ea32da1461083757806398118cb41461086257806399524bbe1461088d576102ef565b806381efb72d146107395780638da5cb5b146107645780638ea5220f1461078f578063924de9b7146107ba5780639394c2ed146107e357806395d89b411461080c576102ef565b80634a62bb651161024f5780636ddd17131161020857806372007f10116101e257806372007f1014610691578063751039fc146106ba578063782c4e99146106e55780637ca8448a14610710576102ef565b80636ddd17131461061257806370a082311461063d578063715018a61461067a576102ef565b80634a62bb65146105025780634fbee1931461052d57806364f99f821461056a5780636827e764146105935780636a486a8e146105be5780636db79437146105e9576102ef565b806323b872dd116102a157806323b872dd146103f257806327dce8471461042f578063313ce5671461045a57806338377d0a1461048557806339509351146104ae578063395d3384146104eb576102ef565b806303fd2a45146102f457806306fdde031461031f578063095ea7b31461034a5780630e3db9f21461038757806318160ddd1461039e5780631816467f146103c9576102ef565b366102ef57005b600080fd5b34801561030057600080fd5b50610309610bf5565b6040516103169190613440565b60405180910390f35b34801561032b57600080fd5b50610334610bfb565b60405161034191906134eb565b60405180910390f35b34801561035657600080fd5b50610371600480360381019061036c9190613574565b610c8d565b60405161037e91906135cf565b60405180910390f35b34801561039357600080fd5b5061039c610cb0565b005b3480156103aa57600080fd5b506103b3610cf0565b6040516103c091906135f9565b60405180910390f35b3480156103d557600080fd5b506103f060048036038101906103eb9190613614565b610cfa565b005b3480156103fe57600080fd5b5061041960048036038101906104149190613641565b610d46565b60405161042691906135cf565b60405180910390f35b34801561043b57600080fd5b50610444610d75565b60405161045191906136f3565b60405180910390f35b34801561046657600080fd5b5061046f610d99565b60405161047c919061372a565b60405180910390f35b34801561049157600080fd5b506104ac60048036038101906104a79190613745565b610da2565b005b3480156104ba57600080fd5b506104d560048036038101906104d09190613574565b610e3d565b6040516104e291906135cf565b60405180910390f35b3480156104f757600080fd5b50610500610e74565b005b34801561050e57600080fd5b50610517610e90565b60405161052491906135cf565b60405180910390f35b34801561053957600080fd5b50610554600480360381019061054f9190613614565b610ea3565b60405161056191906135cf565b60405180910390f35b34801561057657600080fd5b50610591600480360381019061058c919061379e565b610ef9565b005b34801561059f57600080fd5b506105a8610f5c565b6040516105b591906135f9565b60405180910390f35b3480156105ca57600080fd5b506105d3610f62565b6040516105e091906135f9565b60405180910390f35b3480156105f557600080fd5b50610610600480360381019061060b91906137de565b610f68565b005b34801561061e57600080fd5b50610627611021565b60405161063491906135cf565b60405180910390f35b34801561064957600080fd5b50610664600480360381019061065f9190613614565b611034565b60405161067191906135f9565b60405180910390f35b34801561068657600080fd5b5061068f61107c565b005b34801561069d57600080fd5b506106b860048036038101906106b39190613745565b611090565b005b3480156106c657600080fd5b506106cf61112b565b6040516106dc91906135cf565b60405180910390f35b3480156106f157600080fd5b506106fa611157565b6040516107079190613440565b60405180910390f35b34801561071c57600080fd5b5061073760048036038101906107329190613614565b61117d565b005b34801561074557600080fd5b5061074e6111ff565b60405161075b9190613440565b60405180910390f35b34801561077057600080fd5b50610779611223565b6040516107869190613440565b60405180910390f35b34801561079b57600080fd5b506107a461124d565b6040516107b19190613440565b60405180910390f35b3480156107c657600080fd5b506107e160048036038101906107dc919061381e565b611273565b005b3480156107ef57600080fd5b5061080a6004803603810190610805919061384b565b611298565b005b34801561081857600080fd5b5061082161137d565b60405161082e91906134eb565b60405180910390f35b34801561084357600080fd5b5061084c61140f565b60405161085991906135f9565b60405180910390f35b34801561086e57600080fd5b50610877611415565b60405161088491906135f9565b60405180910390f35b34801561089957600080fd5b506108b460048036038101906108af9190613614565b61141b565b6040516108c191906135cf565b60405180910390f35b3480156108d657600080fd5b506108f160048036038101906108ec919061379e565b61143b565b005b3480156108ff57600080fd5b506109086114df565b60405161091591906135f9565b60405180910390f35b34801561092a57600080fd5b5061094560048036038101906109409190613574565b6114e5565b60405161095291906135cf565b60405180910390f35b34801561096757600080fd5b50610982600480360381019061097d9190613574565b61155c565b60405161098f91906135cf565b60405180910390f35b3480156109a457600080fd5b506109ad61157f565b6040516109ba91906135f9565b60405180910390f35b3480156109cf57600080fd5b506109d8611585565b6040516109e591906135f9565b60405180910390f35b3480156109fa57600080fd5b50610a156004803603810190610a109190613614565b61158b565b005b348015610a2357600080fd5b50610a3e6004803603810190610a399190613614565b611653565b604051610a4b91906135cf565b60405180910390f35b348015610a6057600080fd5b50610a69611673565b604051610a7691906135cf565b60405180910390f35b348015610a8b57600080fd5b50610aa66004803603810190610aa191906138c6565b611686565b005b348015610ab457600080fd5b50610acf6004803603810190610aca919061379e565b6117ff565b005b348015610add57600080fd5b50610af86004803603810190610af39190613745565b6118b0565b604051610b0591906135cf565b60405180910390f35b348015610b1a57600080fd5b50610b23611991565b604051610b3091906135f9565b60405180910390f35b348015610b4557600080fd5b50610b606004803603810190610b5b91906138c6565b611997565b604051610b6d91906135f9565b60405180910390f35b348015610b8257600080fd5b50610b8b611a1e565b604051610b9891906135f9565b60405180910390f35b348015610bad57600080fd5b50610bc86004803603810190610bc39190613614565b611a24565b005b348015610bd657600080fd5b50610bdf611aa7565b604051610bec91906135f9565b60405180910390f35b61dead81565b606060038054610c0a90613935565b80601f0160208091040260200160405190810160405280929190818152602001828054610c3690613935565b8015610c835780601f10610c5857610100808354040283529160200191610c83565b820191906000526020600020905b815481529060010190602001808311610c6657829003601f168201915b5050505050905090565b600080610c98611aad565b9050610ca5818585611ab5565b600191505092915050565b610cb8611c7e565b6001600b60016101000a81548160ff0219169083151502179055506001600b60026101000a81548160ff021916908315150217905550565b6000600254905090565b610d02611c7e565b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080610d51611aad565b9050610d5e858285611cfc565b610d69858585611d88565b60019150509392505050565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b60006012905090565b610daa611c7e565b670de0b6b3a76400006103e86001610dc0610cf0565b610dca9190613995565b610dd49190613a06565b610dde9190613a06565b811015610e20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1790613aa9565b60405180910390fd5b670de0b6b3a764000081610e349190613995565b60088190555050565b600080610e48611aad565b9050610e69818585610e5a8589611997565b610e649190613ac9565b611ab5565b600191505092915050565b610e7c611c7e565b610e8e610e8830611034565b47612810565b565b600b60009054906101000a900460ff1681565b6000601360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b610f01611c7e565b80601460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60105481565b600d5481565b610f70611c7e565b6101f48211158015610f8457506101f48111155b610fc3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fba90613b49565b60405180910390fd5b81600c8190555080600d81905550601e600c541015610ff757601e600c6000828254610fef9190613ac9565b925050819055505b601e600d54101561101d57601e600d60008282546110159190613ac9565b925050819055505b5050565b600b60029054906101000a900460ff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611084611c7e565b61108e60006128f1565b565b611098611c7e565b670de0b6b3a76400006103e8600a6110ae610cf0565b6110b89190613995565b6110c29190613a06565b6110cc9190613a06565b81101561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613bdb565b60405180910390fd5b670de0b6b3a7640000816111229190613995565b600a8190555050565b6000611135611c7e565b6000600b60006101000a81548160ff0219169083151502179055506001905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611185611c7e565b60008173ffffffffffffffffffffffffffffffffffffffff16476040516111ab90613c2c565b60006040518083038185875af1925050503d80600081146111e8576040519150601f19603f3d011682016040523d82523d6000602084013e6111ed565b606091505b50509050806111fb57600080fd5b5050565b7f000000000000000000000000941e59523f9ee929c923a2d21433d97c6e9d8dc281565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61127b611c7e565b80600b60026101000a81548160ff02191690831515021790555050565b6112a0611c7e565b600082111561131957600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611318576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130f90613c8d565b60405180910390fd5b5b84600e8190555083600f81905550826010819055508160118190555080600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050505050565b60606004805461138c90613935565b80601f01602080910402602001604051908101604052809291908181526020018280546113b890613935565b80156114055780601f106113da57610100808354040283529160200191611405565b820191906000526020600020905b8154815290600101906020018083116113e857829003601f168201915b5050505050905090565b60085481565b600f5481565b60146020528060005260406000206000915054906101000a900460ff1681565b611443611c7e565b7f000000000000000000000000941e59523f9ee929c923a2d21433d97c6e9d8dc273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036114d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c890613d1f565b60405180910390fd5b6114db82826129b7565b5050565b60125481565b6000806114f0611aad565b905060006114fe8286611997565b905083811015611543576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153a90613db1565b60405180910390fd5b6115508286868403611ab5565b60019250505092915050565b600080611567611aad565b9050611574818585611d88565b600191505092915050565b600a5481565b60115481565b611593611c7e565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fc9f2d63eee8632b33d7a7db5252eb29036e81ee4fbe29260febe0c49ffb8a7bb60405160405180910390a380600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60156020528060005260406000206000915054906101000a900460ff1681565b600b60019054906101000a900460ff1681565b61168e611c7e565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036116fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f490613e1d565b60405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016117389190613440565b602060405180830381865afa158015611755573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117799190613e52565b90508273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b81526004016117b6929190613e7f565b6020604051808303816000875af11580156117d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f99190613ebd565b50505050565b611807611c7e565b80601360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f9d8f7706ea1113d1a167b526eca956215946dd36cc7df39eb16180222d8b5df7826040516118a491906135cf565b60405180910390a25050565b60006118ba611c7e565b620186a060016118c8610cf0565b6118d29190613995565b6118dc9190613a06565b82101561191e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191590613f5c565b60405180910390fd5b6103e8600561192b610cf0565b6119359190613995565b61193f9190613a06565b821115611981576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197890613fee565b60405180910390fd5b8160098190555060019050919050565b600c5481565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60095481565b611a2c611c7e565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611a9b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9290614080565b60405180910390fd5b611aa4816128f1565b50565b600e5481565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611b24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b1b90614112565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611b93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b8a906141a4565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611c7191906135f9565b60405180910390a3505050565b611c86611aad565b73ffffffffffffffffffffffffffffffffffffffff16611ca4611223565b73ffffffffffffffffffffffffffffffffffffffff1614611cfa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cf190614210565b60405180910390fd5b565b6000611d088484611997565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114611d825781811015611d74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6b9061427c565b60405180910390fd5b611d818484848403611ab5565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611df7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dee9061430e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611e66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e5d906143a0565b60405180910390fd5b60008103611e7f57611e7a83836000612a58565b61280b565b600b60009054906101000a900460ff161561237a57611e9c611223565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611f0a5750611eda611223565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611f435750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611f7d575061dead73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611f965750600560149054906101000a900460ff16155b1561237957600b60019054906101000a900460ff1661209057601360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806120505750601360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61208f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120869061440c565b60405180910390fd5b5b601560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156121335750601460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156121da5760085481111561217d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121749061449e565b60405180910390fd5b600a5461218983611034565b826121949190613ac9565b11156121d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121cc9061450a565b60405180910390fd5b612378565b601560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561227d5750601460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156122cc576008548111156122c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122be9061459c565b60405180910390fd5b612377565b601460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661237657600a5461232983611034565b826123349190613ac9565b1115612375576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161236c9061450a565b60405180910390fd5b5b5b5b5b5b600061238530611034565b9050600060095482101590508080156123aa5750600b60029054906101000a900460ff165b80156123c35750600560149054906101000a900460ff16155b80156124195750601560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561246f5750601360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156124c55750601360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612509576001600560146101000a81548160ff0219169083151502179055506124ed612cce565b6000600560146101000a81548160ff0219169083151502179055505b6000600560149054906101000a900460ff161580156125c55750601560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806125c45750601560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b5b9050601360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806126685750601360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561267257600090505b600081156127fb576126a2612710612694601e8861316090919063ffffffff16565b61317690919063ffffffff16565b601260008282546126b39190613ac9565b92505081905550601560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561271557506000600d54115b1561274a57612743612710612735600d548861316090919063ffffffff16565b61317690919063ffffffff16565b90506127d7565b601560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156127a557506000600c54115b156127d6576127d36127106127c5600c548861316090919063ffffffff16565b61317690919063ffffffff16565b90505b5b60008111156127ec576127eb873083612a58565b5b80856127f891906145bc565b94505b612806878787612a58565b505050505b505050565b61283b307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84611ab5565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663f305d719823085600080612885611223565b426040518863ffffffff1660e01b81526004016128a79695949392919061462b565b60606040518083038185885af11580156128c5573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906128ea919061468c565b5050505050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b80601560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508015158273ffffffffffffffffffffffffffffffffffffffff167fffa9187bf1f18bf477bd0ea1bcbb64e93b6a98132473929edfce215cd9b16fab60405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603612ac7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612abe9061430e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612b36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b2d906143a0565b60405180910390fd5b612b4183838361318c565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015612bc7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bbe90614751565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612cb591906135f9565b60405180910390a3612cc8848484613191565b50505050565b6000612cd930611034565b90506014600954612cea9190613995565b811115612d03576014600954612d009190613995565b90505b60008103612d11575061315e565b806012541115612d2357806012819055505b6000612d3a6012548361319690919063ffffffff16565b90506000601154601054600f54600e54612d549190613ac9565b612d5e9190613ac9565b612d689190613ac9565b9050600080600080600086118015612d805750600085115b15612e3d57612dac85612d9e600e548961316090919063ffffffff16565b61317690919063ffffffff16565b9350612de86002612dda87612dcc600f548b61316090919063ffffffff16565b61317690919063ffffffff16565b61317690919063ffffffff16565b9250612e1185612e036010548961316090919063ffffffff16565b61317690919063ffffffff16565b9150612e3a85612e2c6011548961316090919063ffffffff16565b61317690919063ffffffff16565b90505b6000612e7884612e6a87612e5c8b6012546131ac90919063ffffffff16565b61319690919063ffffffff16565b61319690919063ffffffff16565b90506000851115612e9157612e903061dead87612a58565b5b60008103612ea657505050505050505061315e565b612eaf816131c2565b60004790506000612edd83612ecf6012548561316090919063ffffffff16565b61317690919063ffffffff16565b90506000612f0684612ef8888661316090919063ffffffff16565b61317690919063ffffffff16565b90506000612f2f85612f21888761316090919063ffffffff16565b61317690919063ffffffff16565b90506000612f6a82612f5c85612f4e888a61319690919063ffffffff16565b61319690919063ffffffff16565b61319690919063ffffffff16565b90506000601281905550600080851115612fff577391fead7f2b2172e75ffcf4cadff5049c9270ee4173ffffffffffffffffffffffffffffffffffffffff1685604051612fb690613c2c565b60006040518083038185875af1925050503d8060008114612ff3576040519150601f19603f3d011682016040523d82523d6000602084013e612ff8565b606091505b5050809150505b600084111561309757600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460405161304e90613c2c565b60006040518083038185875af1925050503d806000811461308b576040519150601f19603f3d011682016040523d82523d6000602084013e613090565b606091505b5050809150505b600083111561312f57600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16836040516130e690613c2c565b60006040518083038185875af1925050503d8060008114613123576040519150601f19603f3d011682016040523d82523d6000602084013e613128565b606091505b5050809150505b60008a11801561313f5750600082115b1561314f5761314e8a83612810565b5b50505050505050505050505050505b565b6000818361316e9190613995565b905092915050565b600081836131849190613a06565b905092915050565b505050565b505050565b600081836131a491906145bc565b905092915050565b600081836131ba9190613ac9565b905092915050565b6000600267ffffffffffffffff8111156131df576131de614771565b5b60405190808252806020026020018201604052801561320d5781602001602082028036833780820191505090505b5090503081600081518110613225576132246147a0565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156132ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132ee91906147e4565b81600181518110613302576133016147a0565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050613367307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84611ab5565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016133c99594939291906148cf565b600060405180830381600087803b1580156133e357600080fd5b505af11580156133f7573d6000803e3d6000fd5b505050505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061342a826133ff565b9050919050565b61343a8161341f565b82525050565b60006020820190506134556000830184613431565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561349557808201518184015260208101905061347a565b60008484015250505050565b6000601f19601f8301169050919050565b60006134bd8261345b565b6134c78185613466565b93506134d7818560208601613477565b6134e0816134a1565b840191505092915050565b6000602082019050818103600083015261350581846134b2565b905092915050565b600080fd5b61351b8161341f565b811461352657600080fd5b50565b60008135905061353881613512565b92915050565b6000819050919050565b6135518161353e565b811461355c57600080fd5b50565b60008135905061356e81613548565b92915050565b6000806040838503121561358b5761358a61350d565b5b600061359985828601613529565b92505060206135aa8582860161355f565b9150509250929050565b60008115159050919050565b6135c9816135b4565b82525050565b60006020820190506135e460008301846135c0565b92915050565b6135f38161353e565b82525050565b600060208201905061360e60008301846135ea565b92915050565b60006020828403121561362a5761362961350d565b5b600061363884828501613529565b91505092915050565b60008060006060848603121561365a5761365961350d565b5b600061366886828701613529565b935050602061367986828701613529565b925050604061368a8682870161355f565b9150509250925092565b6000819050919050565b60006136b96136b46136af846133ff565b613694565b6133ff565b9050919050565b60006136cb8261369e565b9050919050565b60006136dd826136c0565b9050919050565b6136ed816136d2565b82525050565b600060208201905061370860008301846136e4565b92915050565b600060ff82169050919050565b6137248161370e565b82525050565b600060208201905061373f600083018461371b565b92915050565b60006020828403121561375b5761375a61350d565b5b60006137698482850161355f565b91505092915050565b61377b816135b4565b811461378657600080fd5b50565b60008135905061379881613772565b92915050565b600080604083850312156137b5576137b461350d565b5b60006137c385828601613529565b92505060206137d485828601613789565b9150509250929050565b600080604083850312156137f5576137f461350d565b5b60006138038582860161355f565b92505060206138148582860161355f565b9150509250929050565b6000602082840312156138345761383361350d565b5b600061384284828501613789565b91505092915050565b600080600080600060a086880312156138675761386661350d565b5b60006138758882890161355f565b95505060206138868882890161355f565b94505060406138978882890161355f565b93505060606138a88882890161355f565b92505060806138b988828901613529565b9150509295509295909350565b600080604083850312156138dd576138dc61350d565b5b60006138eb85828601613529565b92505060206138fc85828601613529565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061394d57607f821691505b6020821081036139605761395f613906565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006139a08261353e565b91506139ab8361353e565b92508282026139b98161353e565b915082820484148315176139d0576139cf613966565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613a118261353e565b9150613a1c8361353e565b925082613a2c57613a2b6139d7565b5b828204905092915050565b7f43616e6e6f7420736574206d617854726164696e67416d6f756e74206c6f776560008201527f72207468616e20302e3125000000000000000000000000000000000000000000602082015250565b6000613a93602b83613466565b9150613a9e82613a37565b604082019050919050565b60006020820190508181036000830152613ac281613a86565b9050919050565b6000613ad48261353e565b9150613adf8361353e565b9250828201905080821115613af757613af6613966565b5b92915050565b7f4275792f73656c6c2066656573206d757374206265203c3d2035250000000000600082015250565b6000613b33601b83613466565b9150613b3e82613afd565b602082019050919050565b60006020820190508181036000830152613b6281613b26565b9050919050565b7f43616e6e6f7420736574206d617857616c6c6574416d6f756e74206c6f77657260008201527f207468616e20312e302500000000000000000000000000000000000000000000602082015250565b6000613bc5602a83613466565b9150613bd082613b69565b604082019050919050565b60006020820190508181036000830152613bf481613bb8565b9050919050565b600081905092915050565b50565b6000613c16600083613bfb565b9150613c2182613c06565b600082019050919050565b6000613c3782613c09565b9150819050919050565b7f52657673686172652057616c6c65742069732072657175697265642100000000600082015250565b6000613c77601c83613466565b9150613c8282613c41565b602082019050919050565b60006020820190508181036000830152613ca681613c6a565b9050919050565b7f54686520706169722063616e6e6f742062652072656d6f7665642066726f6d2060008201527f6175746f6d617465644d61726b65744d616b6572506169727300000000000000602082015250565b6000613d09603983613466565b9150613d1482613cad565b604082019050919050565b60006020820190508181036000830152613d3881613cfc565b9050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000613d9b602583613466565b9150613da682613d3f565b604082019050919050565b60006020820190508181036000830152613dca81613d8e565b9050919050565b7f5f746f6b656e20616464726573732063616e6e6f742062652030000000000000600082015250565b6000613e07601a83613466565b9150613e1282613dd1565b602082019050919050565b60006020820190508181036000830152613e3681613dfa565b9050919050565b600081519050613e4c81613548565b92915050565b600060208284031215613e6857613e6761350d565b5b6000613e7684828501613e3d565b91505092915050565b6000604082019050613e946000830185613431565b613ea160208301846135ea565b9392505050565b600081519050613eb781613772565b92915050565b600060208284031215613ed357613ed261350d565b5b6000613ee184828501613ea8565b91505092915050565b7f5377617020616d6f756e742063616e6e6f74206265206c6f776572207468616e60008201527f20302e3030312520746f74616c20737570706c792e0000000000000000000000602082015250565b6000613f46603583613466565b9150613f5182613eea565b604082019050919050565b60006020820190508181036000830152613f7581613f39565b9050919050565b7f5377617020616d6f756e742063616e6e6f74206265206869676865722074686160008201527f6e20302e352520746f74616c20737570706c792e000000000000000000000000602082015250565b6000613fd8603483613466565b9150613fe382613f7c565b604082019050919050565b6000602082019050818103600083015261400781613fcb565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061406a602683613466565b91506140758261400e565b604082019050919050565b600060208201905081810360008301526140998161405d565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006140fc602483613466565b9150614107826140a0565b604082019050919050565b6000602082019050818103600083015261412b816140ef565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061418e602283613466565b915061419982614132565b604082019050919050565b600060208201905081810360008301526141bd81614181565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006141fa602083613466565b9150614205826141c4565b602082019050919050565b60006020820190508181036000830152614229816141ed565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000614266601d83613466565b915061427182614230565b602082019050919050565b6000602082019050818103600083015261429581614259565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006142f8602583613466565b91506143038261429c565b604082019050919050565b60006020820190508181036000830152614327816142eb565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061438a602383613466565b91506143958261432e565b604082019050919050565b600060208201905081810360008301526143b98161437d565b9050919050565b7f54726164696e67206973206e6f74206163746976652e00000000000000000000600082015250565b60006143f6601683613466565b9150614401826143c0565b602082019050919050565b60006020820190508181036000830152614425816143e9565b9050919050565b7f427579207472616e7366657220616d6f756e742065786365656473207468652060008201527f6d617854726164696e67416d6f756e742e000000000000000000000000000000602082015250565b6000614488603183613466565b91506144938261442c565b604082019050919050565b600060208201905081810360008301526144b78161447b565b9050919050565b7f4d61782077616c6c657420657863656564656400000000000000000000000000600082015250565b60006144f4601383613466565b91506144ff826144be565b602082019050919050565b60006020820190508181036000830152614523816144e7565b9050919050565b7f53656c6c207472616e7366657220616d6f756e7420657863656564732074686560008201527f206d617854726164696e67416d6f756e742e0000000000000000000000000000602082015250565b6000614586603283613466565b91506145918261452a565b604082019050919050565b600060208201905081810360008301526145b581614579565b9050919050565b60006145c78261353e565b91506145d28361353e565b92508282039050818111156145ea576145e9613966565b5b92915050565b6000819050919050565b600061461561461061460b846145f0565b613694565b61353e565b9050919050565b614625816145fa565b82525050565b600060c0820190506146406000830189613431565b61464d60208301886135ea565b61465a604083018761461c565b614667606083018661461c565b6146746080830185613431565b61468160a08301846135ea565b979650505050505050565b6000806000606084860312156146a5576146a461350d565b5b60006146b386828701613e3d565b93505060206146c486828701613e3d565b92505060406146d586828701613e3d565b9150509250925092565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b600061473b602683613466565b9150614746826146df565b604082019050919050565b6000602082019050818103600083015261476a8161472e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000815190506147de81613512565b92915050565b6000602082840312156147fa576147f961350d565b5b6000614808848285016147cf565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6148468161341f565b82525050565b6000614858838361483d565b60208301905092915050565b6000602082019050919050565b600061487c82614811565b614886818561481c565b93506148918361482d565b8060005b838110156148c25781516148a9888261484c565b97506148b483614864565b925050600181019050614895565b5085935050505092915050565b600060a0820190506148e460008301886135ea565b6148f1602083018761461c565b81810360408301526149038186614871565b90506149126060830185613431565b61491f60808301846135ea565b969550505050505056fea2646970667358221220c9cd49f17dc71dd484b0a76408ed22da28ede461341dfac75ff7a652e20e8ac464736f6c63430008110033
Verified Source Code Full Match
Compiler: v0.8.17+commit.8df45f5f
EVM: london
Optimization: No
TokenUniswap2.sol 550 lines
// SPDX-License-Identifier: GenesisBot.xyz
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
interface SwapV2Router {
function factory() external view returns (address);
function WETH() external view returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
function swapExactTokensForETH(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
interface SwapV2Factory {
// function turnstile() external view returns (ITurnstile);
function createPair(
address tokenA,
address tokenB
) external returns (address);
}
contract TokenUniswap2 is ERC20, Ownable {
using SafeMath for uint256;
struct InitParams {
string name;
string symbol;
uint256 totalSupply;
uint256 maxTradingAmount;
uint256 maxWalletAmount;
uint256 swapTokensAtAmount;
uint256 buyTotalFees;
uint256 sellTotalFees;
uint256 burnFee;
uint256 liquidityFee;
uint256 devFee;
uint256 revshareFee;
address revshareWallet;
}
SwapV2Router public immutable swapV2Router;
//ITurnstile public immutable turnstile;
address public immutable swapV2Pair;
address public constant DEAD = address(0xdead);
bool private swapping;
address public revShareWallet;
address public devWallet;
uint256 public maxTradingAmount;
uint256 public swapTokensAtAmount;
uint256 public maxWalletAmount;
bool public limitsInEffect = true;
bool public tradingActive = false;
bool public swapEnabled = false;
uint256 constant PERCENTAGE_BASE = 10000; //
uint256 constant GEN_FEE = 30; // fee for GEN Bot: 0.3%
address constant GEN_WALLET = 0x91FEad7F2B2172e75FfCf4cAdFF5049c9270EE41;
uint256 public buyTotalFees; // buy fee
uint256 public sellTotalFees; // sell fee
// Tax distribution
uint256 public burnFee;
uint256 public liquidityFee;
uint256 public devFee;
uint256 public revshareFee;
uint256 public tokensForGen;
/******************/
// exclude from fees and max transaction amount
mapping(address => bool) private _isExcludedFromFees;
mapping(address => bool) public _isExcludedMaxTradingAmount;
// store addresses that a automatic market maker pairs. Any transfer *to* these addresses
// could be subject to a maximum transfer amount
mapping(address => bool) public automatedMarketMakerPairs;
event ExcludeFromFees(address indexed account, bool isExcluded);
event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);
event revShareWalletUpdated(
address indexed newWallet,
address indexed oldWallet
);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiquidity
);
constructor(
address routerAddress,
InitParams memory params
) ERC20(params.name, params.symbol) {
// amm swap init
SwapV2Router router = SwapV2Router(routerAddress);
SwapV2Factory factory = SwapV2Factory(router.factory());
swapV2Router = router;
// create pair This:ETH
swapV2Pair = factory.createPair(address(this), router.WETH());
excludeFromMaxTrading(address(swapV2Pair), true);
_setAutomatedMarketMakerPair(address(swapV2Pair), true);
// Token parameters
uint256 totalSupply = params.totalSupply * 1e18;
swapTokensAtAmount =
(totalSupply * params.swapTokensAtAmount) /
PERCENTAGE_BASE; // 0.05%
maxTradingAmount =
(totalSupply * params.maxTradingAmount) /
PERCENTAGE_BASE; // 0.1%
maxWalletAmount =
(totalSupply * params.maxWalletAmount) /
PERCENTAGE_BASE; // 1%
// Fee distribute: burn: 1, dev: 4
updateTaxSplit(
params.burnFee,
params.liquidityFee,
params.devFee,
params.revshareFee,
params.revshareWallet
);
// 5% fee for buy/sell
updateFees(params.buyTotalFees, params.sellTotalFees);
devWallet = msg.sender;
// exclude from paying fees or having max transaction amount
excludeFromFees(owner(), true);
excludeFromFees(address(this), true);
excludeFromFees(address(0xdead), true);
excludeFromMaxTrading(owner(), true);
excludeFromMaxTrading(address(this), true);
excludeFromMaxTrading(address(0xdead), true);
/*
_mint is an internal function in ERC20.sol that is only called here,
and CANNOT be called ever again
*/
_mint(msg.sender, totalSupply);
}
receive() external payable {}
// once enabled, can never be turned off
function startNow() external onlyOwner {
tradingActive = true;
swapEnabled = true;
}
// remove limits after token is stable
function removeLimits() external onlyOwner returns (bool) {
limitsInEffect = false;
return true;
}
// change the minimum amount of tokens to sell from fees
function updateSwapTokensAtAmount(
uint256 newAmount
) external onlyOwner returns (bool) {
require(
newAmount >= (totalSupply() * 1) / 100000,
"Swap amount cannot be lower than 0.001% total supply."
);
require(
newAmount <= (totalSupply() * 5) / 1000,
"Swap amount cannot be higher than 0.5% total supply."
);
swapTokensAtAmount = newAmount;
return true;
}
function updateMaxTradingAmount(uint256 newNum) external onlyOwner {
require(
newNum >= ((totalSupply() * 1) / 1000) / 1e18,
"Cannot set maxTradingAmount lower than 0.1%"
);
maxTradingAmount = newNum * (10 ** 18);
}
function updateMaxWalletAmountAmount(uint256 newNum) external onlyOwner {
require(
newNum >= ((totalSupply() * 10) / 1000) / 1e18,
"Cannot set maxWalletAmount lower than 1.0%"
);
maxWalletAmount = newNum * (10 ** 18);
}
function excludeFromMaxTrading(address updAds, bool isEx) public onlyOwner {
_isExcludedMaxTradingAmount[updAds] = isEx;
}
// only use to disable contract sales if absolutely necessary (emergency use only)
function updateSwapEnabled(bool enabled) external onlyOwner {
swapEnabled = enabled;
}
function updateFees(
uint256 buyTotalFees_,
uint256 sellTotalFees_
) public onlyOwner {
require(
buyTotalFees_ <= 500 && sellTotalFees_ <= 500,
"Buy/sell fees must be <= 5%"
);
buyTotalFees = buyTotalFees_;
sellTotalFees = sellTotalFees_;
if (buyTotalFees < GEN_FEE) buyTotalFees += GEN_FEE;
if (sellTotalFees < GEN_FEE) sellTotalFees += GEN_FEE;
}
// contract setting
function updateTaxSplit(
uint256 burnFee_,
uint256 liquidityFee_,
uint256 devFee_,
uint256 revshareFee_,
address revShareWallet_
) public onlyOwner {
// tax distribution
if (revshareFee_ > 0)
require(
revShareWallet_ != address(0),
"Revshare Wallet is required!"
);
burnFee = burnFee_;
liquidityFee = liquidityFee_;
devFee = devFee_;
revshareFee = revshareFee_;
// update revshare wallet
revShareWallet = revShareWallet_;
}
function excludeFromFees(address account, bool excluded) public onlyOwner {
_isExcludedFromFees[account] = excluded;
emit ExcludeFromFees(account, excluded);
}
function setAutomatedMarketMakerPair(
address pair,
bool value
) public onlyOwner {
require(
pair != swapV2Pair,
"The pair cannot be removed from automatedMarketMakerPairs"
);
_setAutomatedMarketMakerPair(pair, value);
}
function _setAutomatedMarketMakerPair(address pair, bool value) private {
automatedMarketMakerPairs[pair] = value;
emit SetAutomatedMarketMakerPair(pair, value);
}
function updateRevShareWallet(
address newRevShareWallet
) external onlyOwner {
emit revShareWalletUpdated(newRevShareWallet, revShareWallet);
revShareWallet = newRevShareWallet;
}
function updateDevWallet(address newWallet) external onlyOwner {
devWallet = newWallet;
}
function isExcludedFromFees(address account) public view returns (bool) {
return _isExcludedFromFees[account];
}
function _transfer(
address from,
address to,
uint256 amount
) internal override {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
if (amount == 0) {
super._transfer(from, to, 0);
return;
}
if (limitsInEffect) {
if (
from != owner() &&
to != owner() &&
to != address(0) &&
to != address(0xdead) &&
!swapping
) {
if (!tradingActive) {
require(
_isExcludedFromFees[from] || _isExcludedFromFees[to],
"Trading is not active."
);
}
if (
automatedMarketMakerPairs[from] &&
!_isExcludedMaxTradingAmount[to]
) {
//when buy
require(
amount <= maxTradingAmount,
"Buy transfer amount exceeds the maxTradingAmount."
);
require(
amount + balanceOf(to) <= maxWalletAmount,
"Max wallet exceeded"
);
} else if (
automatedMarketMakerPairs[to] &&
!_isExcludedMaxTradingAmount[from]
) {
//when sell
require(
amount <= maxTradingAmount,
"Sell transfer amount exceeds the maxTradingAmount."
);
} else if (!_isExcludedMaxTradingAmount[to]) {
//when transfer
require(
amount + balanceOf(to) <= maxWalletAmount,
"Max wallet exceeded"
);
}
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= swapTokensAtAmount;
if (
canSwap &&
swapEnabled &&
!swapping &&
!automatedMarketMakerPairs[from] &&
!_isExcludedFromFees[from] &&
!_isExcludedFromFees[to]
) {
swapping = true;
swapBack();
swapping = false;
}
// only take free for trading
bool takeFee = !swapping &&
(automatedMarketMakerPairs[to] || automatedMarketMakerPairs[from]);
// if any account belongs to _isExcludedFromFee account then remove the fee
if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {
takeFee = false;
}
uint256 fees = 0;
// only take fees on buys/sells, do not take on wallet transfers
if (takeFee) {
tokensForGen += amount.mul(GEN_FEE).div(PERCENTAGE_BASE);
// on sell
if (automatedMarketMakerPairs[to] && sellTotalFees > 0) {
fees = amount.mul(sellTotalFees).div(PERCENTAGE_BASE);
}
// on buy
else if (automatedMarketMakerPairs[from] && buyTotalFees > 0) {
fees = amount.mul(buyTotalFees).div(PERCENTAGE_BASE);
}
if (fees > 0) {
super._transfer(from, address(this), fees);
}
amount -= fees;
}
super._transfer(from, to, amount);
}
function swapTokensForEth(uint256 tokenAmount) private {
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = swapV2Router.WETH();
_approve(address(this), address(swapV2Router), tokenAmount);
// make the swap
swapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
// approve token transfer to cover all possible scenarios
_approve(address(this), address(swapV2Router), tokenAmount);
// add the liquidity
swapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
owner(),
block.timestamp
);
}
function _addLiquidity() external onlyOwner {
addLiquidity(balanceOf(address(this)), address(this).balance);
}
function swapBack() private {
uint256 contractBalance = balanceOf(address(this));
if (contractBalance > swapTokensAtAmount * 20) {
contractBalance = swapTokensAtAmount * 20;
}
if (contractBalance == 0) return;
if (tokensForGen > contractBalance) tokensForGen = contractBalance;
uint256 tokenForFees = contractBalance.sub(tokensForGen);
uint256 totalFees = burnFee + liquidityFee + devFee + revshareFee;
uint256 tokensToBurn;
uint256 tokenForLiquidity;
uint256 tokenForDev;
uint256 tokenForRevshare;
if (tokenForFees > 0 && totalFees > 0) {
tokensToBurn = tokenForFees.mul(burnFee).div(totalFees);
// keep 1/2 of liquidity
tokenForLiquidity = tokenForFees
.mul(liquidityFee)
.div(totalFees)
.div(2);
tokenForDev = tokenForFees.mul(devFee).div(totalFees);
tokenForRevshare = tokenForFees.mul(revshareFee).div(totalFees);
}
uint256 totalTokensToSwap = tokensForGen
.add(tokenForFees)
.sub(tokensToBurn)
.sub(tokenForLiquidity);
if (tokensToBurn > 0) {
// transfer to dead
super._transfer(address(this), DEAD, tokensToBurn);
}
if (totalTokensToSwap == 0) return;
swapTokensForEth(totalTokensToSwap);
uint256 ethBalance = address(this).balance;
uint256 ethForGen = ethBalance.mul(tokensForGen).div(totalTokensToSwap);
uint256 ethForDev = ethBalance.mul(tokenForDev).div(totalTokensToSwap);
uint256 ethForRevshare = ethBalance.mul(tokenForRevshare).div(
totalTokensToSwap
);
uint256 ethForLiquidity = ethBalance.sub(ethForGen).sub(ethForDev).sub(
ethForRevshare
);
// reset token for GEN
tokensForGen = 0;
// send eth to benificiers
bool success;
if (ethForGen > 0) {
(success, ) = address(GEN_WALLET).call{value: ethForGen}("");
}
if (ethForDev > 0) {
(success, ) = address(devWallet).call{value: ethForDev}("");
}
if (ethForRevshare > 0) {
(success, ) = address(revShareWallet).call{value: ethForRevshare}(
""
);
}
if (tokenForLiquidity > 0 && ethForLiquidity > 0) {
addLiquidity(tokenForLiquidity, ethForLiquidity);
}
}
function withdrawStuckToken(
address _token,
address _to
) external onlyOwner {
require(_token != address(0), "_token address cannot be 0");
uint256 _contractBalance = IERC20(_token).balanceOf(address(this));
IERC20(_token).transfer(_to, _contractBalance);
}
function withdrawStuckEth(address toAddr) external onlyOwner {
(bool success, ) = toAddr.call{value: address(this).balance}("");
require(success);
}
/************************************************************************/
}
Address.sol 244 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [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://consensys.net/diligence/blog/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.8.0/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);
}
}
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
Ownable.sol 83 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.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. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling 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);
}
}
ERC20.sol 365 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";
/**
* @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].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* 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, IERC20Metadata {
mapping(address => uint256) private _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}.
*
* 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 default value returned by this function, unless
* it's 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 {}
}
IERC20.sol 78 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
SafeMath.sol 215 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// 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;
}
}
}
IERC20Metadata.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
Read Contract
DEAD 0x03fd2a45 → address
_isExcludedMaxTradingAmount 0x99524bbe → bool
allowance 0xdd62ed3e → uint256
automatedMarketMakerPairs 0xb62496f5 → bool
balanceOf 0x70a08231 → uint256
burnFee 0xfce589d8 → uint256
buyTotalFees 0xd85ba063 → uint256
decimals 0x313ce567 → uint8
devFee 0x6827e764 → uint256
devWallet 0x8ea5220f → address
isExcludedFromFees 0x4fbee193 → bool
limitsInEffect 0x4a62bb65 → bool
liquidityFee 0x98118cb4 → uint256
maxTradingAmount 0x96ea32da → uint256
maxWalletAmount 0xaa4bde28 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
revShareWallet 0x782c4e99 → address
revshareFee 0xad05a7b5 → uint256
sellTotalFees 0x6a486a8e → uint256
swapEnabled 0x6ddd1713 → bool
swapTokensAtAmount 0xe2f45605 → uint256
swapV2Pair 0x81efb72d → address
swapV2Router 0x27dce847 → address
symbol 0x95d89b41 → string
tokensForGen 0x9ee708ff → uint256
totalSupply 0x18160ddd → uint256
tradingActive 0xbbc0c742 → bool
Write Contract 23 functions
These functions modify contract state and require a wallet transaction to execute.
_addLiquidity 0x395d3384
No parameters
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
excludeFromFees 0xc0246668
address account
bool excluded
excludeFromMaxTrading 0x64f99f82
address updAds
bool isEx
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
removeLimits 0x751039fc
No parameters
returns: bool
renounceOwnership 0x715018a6
No parameters
setAutomatedMarketMakerPair 0x9a7a23d6
address pair
bool value
startNow 0x0e3db9f2
No parameters
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
updateDevWallet 0x1816467f
address newWallet
updateFees 0x6db79437
uint256 buyTotalFees_
uint256 sellTotalFees_
updateMaxTradingAmount 0x38377d0a
uint256 newNum
updateMaxWalletAmountAmount 0x72007f10
uint256 newNum
updateRevShareWallet 0xadee28ff
address newRevShareWallet
updateSwapEnabled 0x924de9b7
bool enabled
updateSwapTokensAtAmount 0xd257b34f
uint256 newAmount
returns: bool
updateTaxSplit 0x9394c2ed
uint256 burnFee_
uint256 liquidityFee_
uint256 devFee_
uint256 revshareFee_
address revShareWallet_
withdrawStuckEth 0x7ca8448a
address toAddr
withdrawStuckToken 0xbc205ad3
address _token
address _to
Recent Transactions
No transactions found for this address