Address Contract Partially Verified
Address
0x826e5Ec70DbC5607fF9218011FBb97F9a8D97953
Balance
0 ETH
Nonce
1
Code Size
16883 bytes
Creator
0x0eab6ad1...B235 at tx 0xc9bebe07...6c20e5
Indexed Transactions
0
Contract Bytecode
16883 bytes
0x6080604052600436106101fd5760003560e01c8063715018a61161010d5780639e281a98116100a0578063df8408fe1161006f578063df8408fe1461078b578063ec28438a146107b4578063ec81b483146107dd578063f2fde38b14610808578063f9dc97201461083157610204565b80639e281a98146106ab578063a457c2d7146106d4578063a9059cbb14610711578063dd62ed3e1461074e57610204565b80638c0b5e22116100dc5780638c0b5e22146105ff5780638da5cb5b1461062a57806390f712cc1461065557806395d89b411461068057610204565b8063715018a61461055657806375f0a8741461056d57806379cc6790146105985780637be6277b146105c157610204565b806340c10f19116101905780635d098b381161015f5780635d098b381461045f578063625e764c146104885780636b67c4df146104b15780636bb72a54146104dc57806370a082311461051957610204565b806340c10f19146103a757806342966c68146103d05780634bef8da5146103f95780635342acb41461042257610204565b806323b872dd116101cc57806323b872dd146102c5578063313ce56714610302578063395093511461032d5780633dc120f41461036a57610204565b806306fdde0314610209578063095ea7b314610234578063127f4b2e1461027157806318160ddd1461029a57610204565b3661020457005b600080fd5b34801561021557600080fd5b5061021e61085a565b60405161022b9190613189565b60405180910390f35b34801561024057600080fd5b5061025b60048036038101906102569190613244565b6108ec565b604051610268919061329f565b60405180910390f35b34801561027d57600080fd5b50610298600480360381019061029391906132ba565b61090f565b005b3480156102a657600080fd5b506102af6109d5565b6040516102bc91906132f6565b60405180910390f35b3480156102d157600080fd5b506102ec60048036038101906102e79190613311565b6109df565b6040516102f9919061329f565b60405180910390f35b34801561030e57600080fd5b50610317610a0e565b6040516103249190613380565b60405180910390f35b34801561033957600080fd5b50610354600480360381019061034f9190613244565b610a17565b604051610361919061329f565b60405180910390f35b34801561037657600080fd5b50610391600480360381019061038c91906133c0565b610ac1565b60405161039e91906132f6565b60405180910390f35b3480156103b357600080fd5b506103ce60048036038101906103c99190613244565b610ae6565b005b3480156103dc57600080fd5b506103f760048036038101906103f291906132ba565b610be5565b005b34801561040557600080fd5b50610420600480360381019061041b9190613400565b610bf9565b005b34801561042e57600080fd5b5061044960048036038101906104449190613453565b610d4a565b604051610456919061329f565b60405180910390f35b34801561046b57600080fd5b5061048660048036038101906104819190613453565b610d6a565b005b34801561049457600080fd5b506104af60048036038101906104aa91906132ba565b610e2a565b005b3480156104bd57600080fd5b506104c6610eb0565b6040516104d391906132f6565b60405180910390f35b3480156104e857600080fd5b5061050360048036038101906104fe9190613453565b610eb6565b60405161051091906134f7565b60405180910390f35b34801561052557600080fd5b50610540600480360381019061053b9190613453565b611326565b60405161054d91906132f6565b60405180910390f35b34801561056257600080fd5b5061056b61136f565b005b34801561057957600080fd5b506105826113f7565b60405161058f9190613521565b60405180910390f35b3480156105a457600080fd5b506105bf60048036038101906105ba9190613244565b61141d565b005b3480156105cd57600080fd5b506105e860048036038101906105e3919061353c565b61145e565b6040516105f6929190613569565b60405180910390f35b34801561060b57600080fd5b50610614611482565b60405161062191906132f6565b60405180910390f35b34801561063657600080fd5b5061063f611488565b60405161064c9190613521565b60405180910390f35b34801561066157600080fd5b5061066a6114b1565b60405161067791906132f6565b60405180910390f35b34801561068c57600080fd5b506106956114b7565b6040516106a29190613189565b60405180910390f35b3480156106b757600080fd5b506106d260048036038101906106cd9190613244565b611549565b005b3480156106e057600080fd5b506106fb60048036038101906106f69190613244565b611648565b604051610708919061329f565b60405180910390f35b34801561071d57600080fd5b5061073860048036038101906107339190613244565b611732565b604051610745919061329f565b60405180910390f35b34801561075a57600080fd5b5061077560048036038101906107709190613592565b611755565b60405161078291906132f6565b60405180910390f35b34801561079757600080fd5b506107b260048036038101906107ad91906135fe565b6117dc565b005b3480156107c057600080fd5b506107db60048036038101906107d691906132ba565b6118b3565b005b3480156107e957600080fd5b506107f2611939565b6040516107ff91906132f6565b60405180910390f35b34801561081457600080fd5b5061082f600480360381019061082a9190613453565b61195d565b005b34801561083d57600080fd5b50610858600480360381019061085391906132ba565b611a55565b005b6060600480546108699061366d565b80601f01602080910402602001604051908101604052809291908181526020018280546108959061366d565b80156108e25780601f106108b7576101008083540402835291602001916108e2565b820191906000526020600020905b8154815290600101906020018083116108c557829003601f168201915b5050505050905090565b6000806108f7611ae0565b9050610904818585611ae8565b600191505092915050565b610917611ae0565b73ffffffffffffffffffffffffffffffffffffffff16610935611488565b73ffffffffffffffffffffffffffffffffffffffff161461098b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610982906136eb565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156109d1573d6000803e3d6000fd5b5050565b6000600354905090565b6000806109ea611ae0565b90506109f7858285611cb3565b610a02858585611d3f565b60019150509392505050565b60006012905090565b600080610a22611ae0565b9050610ab6818585600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ab1919061373a565b611ae8565b600191505092915050565b600c602052816000526040600020602052806000526040600020600091509150505481565b610aee611ae0565b73ffffffffffffffffffffffffffffffffffffffff16610b0c611488565b73ffffffffffffffffffffffffffffffffffffffff1614610b62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b59906136eb565b60405180910390fd5b7f000000000000000000000000000000000000000000adb53acfa41aee1200000081610b8c6109d5565b610b96919061373a565b1115610bd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bce90613802565b60405180910390fd5b610be18282611fcb565b5050565b610bf6610bf0611ae0565b8261212c565b50565b610c01611ae0565b73ffffffffffffffffffffffffffffffffffffffff16610c1f611488565b73ffffffffffffffffffffffffffffffffffffffff1614610c75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6c906136eb565b60405180910390fd5b60006005811115610c8957610c88613480565b5b60ff16836005811115610c9f57610c9e613480565b5b60ff1611610ce2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd990613894565b60405180910390fd5b604051806040016040528082815260200183815250600b6000856005811115610d0e57610d0d613480565b5b6005811115610d2057610d1f613480565b5b81526020019081526020016000206000820151816000015560208201518160010155905050505050565b600a6020528060005260406000206000915054906101000a900460ff1681565b610d72611ae0565b73ffffffffffffffffffffffffffffffffffffffff16610d90611488565b73ffffffffffffffffffffffffffffffffffffffff1614610de6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ddd906136eb565b60405180910390fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610e32611ae0565b73ffffffffffffffffffffffffffffffffffffffff16610e50611488565b73ffffffffffffffffffffffffffffffffffffffff1614610ea6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9d906136eb565b60405180910390fd5b8060078190555050565b60075481565b600080600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000816000600580811115610f1257610f11613480565b5b6005811115610f2457610f23613480565b5b81526020019081526020016000205414158015610fbc5750600b6000600580811115610f5357610f52613480565b5b6005811115610f6557610f64613480565b5b815260200190815260200160002060000154816000600580811115610f8d57610f8c613480565b5b6005811115610f9f57610f9e613480565b5b81526020019081526020016000205442610fb991906138b4565b10155b15610fcb576005915050611321565b600081600060046005811115610fe457610fe3613480565b5b6005811115610ff657610ff5613480565b5b815260200190815260200160002054141580156110905750600b60006004600581111561102657611025613480565b5b600581111561103857611037613480565b5b8152602001908152602001600020600001548160006004600581111561106157611060613480565b5b600581111561107357611072613480565b5b8152602001908152602001600020544261108d91906138b4565b10155b1561109f576004915050611321565b6000816000600360058111156110b8576110b7613480565b5b60058111156110ca576110c9613480565b5b815260200190815260200160002054141580156111645750600b6000600360058111156110fa576110f9613480565b5b600581111561110c5761110b613480565b5b8152602001908152602001600020600001548160006003600581111561113557611134613480565b5b600581111561114757611146613480565b5b8152602001908152602001600020544261116191906138b4565b10155b15611173576003915050611321565b60008160006002600581111561118c5761118b613480565b5b600581111561119e5761119d613480565b5b815260200190815260200160002054141580156112385750600b6000600260058111156111ce576111cd613480565b5b60058111156111e0576111df613480565b5b8152602001908152602001600020600001548160006002600581111561120957611208613480565b5b600581111561121b5761121a613480565b5b8152602001908152602001600020544261123591906138b4565b10155b15611247576002915050611321565b6000816000600160058111156112605761125f613480565b5b600581111561127257611271613480565b5b8152602001908152602001600020541415801561130c5750600b6000600160058111156112a2576112a1613480565b5b60058111156112b4576112b3613480565b5b815260200190815260200160002060000154816000600160058111156112dd576112dc613480565b5b60058111156112ef576112ee613480565b5b8152602001908152602001600020544261130991906138b4565b10155b1561131b576001915050611321565b60009150505b919050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611377611ae0565b73ffffffffffffffffffffffffffffffffffffffff16611395611488565b73ffffffffffffffffffffffffffffffffffffffff16146113eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e2906136eb565b60405180910390fd5b6113f56000612305565b565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006114308361142b611ae0565b611755565b905061144f8361143e611ae0565b848461144a91906138b4565b611ae8565b611459838361212c565b505050565b600b6020528060005260406000206000915090508060000154908060010154905082565b60095481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60085481565b6060600580546114c69061366d565b80601f01602080910402602001604051908101604052809291908181526020018280546114f29061366d565b801561153f5780601f106115145761010080835404028352916020019161153f565b820191906000526020600020905b81548152906001019060200180831161152257829003601f168201915b5050505050905090565b611551611ae0565b73ffffffffffffffffffffffffffffffffffffffff1661156f611488565b73ffffffffffffffffffffffffffffffffffffffff16146115c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115bc906136eb565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b81526004016116009291906138e8565b6020604051808303816000875af115801561161f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116439190613926565b505050565b600080611653611ae0565b90506000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905083811015611719576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611710906139c5565b60405180910390fd5b6117268286868403611ae8565b60019250505092915050565b60008061173d611ae0565b905061174a818585611d3f565b600191505092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6117e4611ae0565b73ffffffffffffffffffffffffffffffffffffffff16611802611488565b73ffffffffffffffffffffffffffffffffffffffff1614611858576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161184f906136eb565b60405180910390fd5b80600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6118bb611ae0565b73ffffffffffffffffffffffffffffffffffffffff166118d9611488565b73ffffffffffffffffffffffffffffffffffffffff161461192f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611926906136eb565b60405180910390fd5b8060098190555050565b7f000000000000000000000000000000000000000000adb53acfa41aee1200000081565b611965611ae0565b73ffffffffffffffffffffffffffffffffffffffff16611983611488565b73ffffffffffffffffffffffffffffffffffffffff16146119d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d0906136eb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611a49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4090613a57565b60405180910390fd5b611a5281612305565b50565b611a5d611ae0565b73ffffffffffffffffffffffffffffffffffffffff16611a7b611488565b73ffffffffffffffffffffffffffffffffffffffff1614611ad1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ac8906136eb565b60405180910390fd5b8060088190555050565b505050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4f90613ae9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611bc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bbf90613b7b565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611ca691906132f6565b60405180910390a3505050565b6000611cbf8484611755565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114611d395781811015611d2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2290613be7565b60405180910390fd5b611d388484848403611ae8565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611daf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da690613c79565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611e1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e1690613d0b565b60405180910390fd5b6000611e29611488565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611e9357508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611ede57600954821115611edd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ed490613d9d565b60405180910390fd5b5b6000600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f845750600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b90508015611fb957600080611f9987866123c9565b91509150808286611faa91906138b4565b611fb491906138b4565b945050505b611fc485858561258a565b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561203b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203290613e09565b60405180910390fd5b6120476000838361280e565b8060036000828254612059919061373a565b9250508190555080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546120af919061373a565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161211491906132f6565b60405180910390a361212860008383612813565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561219c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219390613e9b565b60405180910390fd5b6121a88260008361280e565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561222f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161222690613f2d565b60405180910390fd5b818103600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816003600082825461228791906138b4565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516122ec91906132f6565b60405180910390a361230083600084612813565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000806064600854846123dc9190613f4d565b6123e69190613fd6565b91506064600754846123f89190613f4d565b6124029190613fd6565b90508082600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245091906138b4565b61245a91906138b4565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816003546124ab91906138b4565b6003819055508060016000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461251e919061373a565b60016000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055509250929050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156125fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125f190614079565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561266a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126619061410b565b60405180910390fd5b61267583838361280e565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156126fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126f39061419d565b60405180910390fd5b818103600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612791919061373a565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516127f591906132f6565b60405180910390a3612808848484612813565b50505050565b505050565b61281e838383611adb565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461285c5761285b8361289f565b5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461289a5761289982612cca565b5b505050565b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060006128ed83611326565b905060008260006001600581111561290857612907613480565b5b600581111561291a57612919613480565b5b815260200190815260200160002054141580156129715750600b60006001600581111561294a57612949613480565b5b600581111561295c5761295b613480565b5b81526020019081526020016000206001015481105b156129b45760008260006001600581111561298f5761298e613480565b5b60058111156129a1576129a0613480565b5b8152602001908152602001600020819055505b6000826000600260058111156129cd576129cc613480565b5b60058111156129df576129de613480565b5b81526020019081526020016000205414158015612a365750600b600060026005811115612a0f57612a0e613480565b5b6005811115612a2157612a20613480565b5b81526020019081526020016000206001015481105b15612a7957600082600060026005811115612a5457612a53613480565b5b6005811115612a6657612a65613480565b5b8152602001908152602001600020819055505b600082600060036005811115612a9257612a91613480565b5b6005811115612aa457612aa3613480565b5b81526020019081526020016000205414158015612afb5750600b600060036005811115612ad457612ad3613480565b5b6005811115612ae657612ae5613480565b5b81526020019081526020016000206001015481105b15612b3e57600082600060036005811115612b1957612b18613480565b5b6005811115612b2b57612b2a613480565b5b8152602001908152602001600020819055505b600082600060046005811115612b5757612b56613480565b5b6005811115612b6957612b68613480565b5b81526020019081526020016000205414158015612bc05750600b600060046005811115612b9957612b98613480565b5b6005811115612bab57612baa613480565b5b81526020019081526020016000206001015481105b15612c0357600082600060046005811115612bde57612bdd613480565b5b6005811115612bf057612bef613480565b5b8152602001908152602001600020819055505b6000826000600580811115612c1b57612c1a613480565b5b6005811115612c2d57612c2c613480565b5b81526020019081526020016000205414158015612c835750600b6000600580811115612c5c57612c5b613480565b5b6005811115612c6e57612c6d613480565b5b81526020019081526020016000206001015481105b15612cc5576000826000600580811115612ca057612c9f613480565b5b6005811115612cb257612cb1613480565b5b8152602001908152602001600020819055505b505050565b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000612d1883611326565b9050600082600060016005811115612d3357612d32613480565b5b6005811115612d4557612d44613480565b5b815260200190815260200160002054148015612d9c5750600b600060016005811115612d7457612d73613480565b5b6005811115612d8657612d85613480565b5b8152602001908152602001600020600101548110155b15612dde574282600060016005811115612db957612db8613480565b5b6005811115612dcb57612dca613480565b5b8152602001908152602001600020819055505b600082600060026005811115612df757612df6613480565b5b6005811115612e0957612e08613480565b5b815260200190815260200160002054148015612e605750600b600060026005811115612e3857612e37613480565b5b6005811115612e4a57612e49613480565b5b8152602001908152602001600020600101548110155b15612ea2574282600060026005811115612e7d57612e7c613480565b5b6005811115612e8f57612e8e613480565b5b8152602001908152602001600020819055505b600082600060036005811115612ebb57612eba613480565b5b6005811115612ecd57612ecc613480565b5b815260200190815260200160002054148015612f245750600b600060036005811115612efc57612efb613480565b5b6005811115612f0e57612f0d613480565b5b8152602001908152602001600020600101548110155b15612f66574282600060036005811115612f4157612f40613480565b5b6005811115612f5357612f52613480565b5b8152602001908152602001600020819055505b600082600060046005811115612f7f57612f7e613480565b5b6005811115612f9157612f90613480565b5b815260200190815260200160002054148015612fe85750600b600060046005811115612fc057612fbf613480565b5b6005811115612fd257612fd1613480565b5b8152602001908152602001600020600101548110155b1561302a57428260006004600581111561300557613004613480565b5b600581111561301757613016613480565b5b8152602001908152602001600020819055505b600082600060058081111561304257613041613480565b5b600581111561305457613053613480565b5b8152602001908152602001600020541480156130aa5750600b600060058081111561308257613081613480565b5b600581111561309457613093613480565b5b8152602001908152602001600020600101548110155b156130eb57428260006005808111156130c6576130c5613480565b5b60058111156130d8576130d7613480565b5b8152602001908152602001600020819055505b505050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561312a57808201518184015260208101905061310f565b83811115613139576000848401525b50505050565b6000601f19601f8301169050919050565b600061315b826130f0565b61316581856130fb565b935061317581856020860161310c565b61317e8161313f565b840191505092915050565b600060208201905081810360008301526131a38184613150565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006131db826131b0565b9050919050565b6131eb816131d0565b81146131f657600080fd5b50565b600081359050613208816131e2565b92915050565b6000819050919050565b6132218161320e565b811461322c57600080fd5b50565b60008135905061323e81613218565b92915050565b6000806040838503121561325b5761325a6131ab565b5b6000613269858286016131f9565b925050602061327a8582860161322f565b9150509250929050565b60008115159050919050565b61329981613284565b82525050565b60006020820190506132b46000830184613290565b92915050565b6000602082840312156132d0576132cf6131ab565b5b60006132de8482850161322f565b91505092915050565b6132f08161320e565b82525050565b600060208201905061330b60008301846132e7565b92915050565b60008060006060848603121561332a576133296131ab565b5b6000613338868287016131f9565b9350506020613349868287016131f9565b925050604061335a8682870161322f565b9150509250925092565b600060ff82169050919050565b61337a81613364565b82525050565b60006020820190506133956000830184613371565b92915050565b600681106133a857600080fd5b50565b6000813590506133ba8161339b565b92915050565b600080604083850312156133d7576133d66131ab565b5b60006133e5858286016131f9565b92505060206133f6858286016133ab565b9150509250929050565b600080600060608486031215613419576134186131ab565b5b6000613427868287016133ab565b93505060206134388682870161322f565b92505060406134498682870161322f565b9150509250925092565b600060208284031215613469576134686131ab565b5b6000613477848285016131f9565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600681106134c0576134bf613480565b5b50565b60008190506134d1826134af565b919050565b60006134e1826134c3565b9050919050565b6134f1816134d6565b82525050565b600060208201905061350c60008301846134e8565b92915050565b61351b816131d0565b82525050565b60006020820190506135366000830184613512565b92915050565b600060208284031215613552576135516131ab565b5b6000613560848285016133ab565b91505092915050565b600060408201905061357e60008301856132e7565b61358b60208301846132e7565b9392505050565b600080604083850312156135a9576135a86131ab565b5b60006135b7858286016131f9565b92505060206135c8858286016131f9565b9150509250929050565b6135db81613284565b81146135e657600080fd5b50565b6000813590506135f8816135d2565b92915050565b60008060408385031215613615576136146131ab565b5b6000613623858286016131f9565b9250506020613634858286016135e9565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061368557607f821691505b602082108114156136995761369861363e565b5b50919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006136d56020836130fb565b91506136e08261369f565b602082019050919050565b60006020820190508181036000830152613704816136c8565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006137458261320e565b91506137508361320e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156137855761378461370b565b5b828201905092915050565b7f54726176656c436172653a3a6d696e743a206d696e74696e672065786365656460008201527f7320434150000000000000000000000000000000000000000000000000000000602082015250565b60006137ec6025836130fb565b91506137f782613790565b604082019050919050565b6000602082019050818103600083015261381b816137df565b9050919050565b7f54726176656c436172653a3a6368616e6765526577617264526571756972656d60008201527f656e74733a20696e76616c696420726577617264207479706500000000000000602082015250565b600061387e6039836130fb565b915061388982613822565b604082019050919050565b600060208201905081810360008301526138ad81613871565b9050919050565b60006138bf8261320e565b91506138ca8361320e565b9250828210156138dd576138dc61370b565b5b828203905092915050565b60006040820190506138fd6000830185613512565b61390a60208301846132e7565b9392505050565b600081519050613920816135d2565b92915050565b60006020828403121561393c5761393b6131ab565b5b600061394a84828501613911565b91505092915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b60006139af6025836130fb565b91506139ba82613953565b604082019050919050565b600060208201905081810360008301526139de816139a2565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000613a416026836130fb565b9150613a4c826139e5565b604082019050919050565b60006020820190508181036000830152613a7081613a34565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613ad36024836130fb565b9150613ade82613a77565b604082019050919050565b60006020820190508181036000830152613b0281613ac6565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613b656022836130fb565b9150613b7082613b09565b604082019050919050565b60006020820190508181036000830152613b9481613b58565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000613bd1601d836130fb565b9150613bdc82613b9b565b602082019050919050565b60006020820190508181036000830152613c0081613bc4565b9050919050565b7f45524332303a3a5f7472616e736665723a207472616e736665722066726f6d2060008201527f746865207a65726f206164647265737300000000000000000000000000000000602082015250565b6000613c636030836130fb565b9150613c6e82613c07565b604082019050919050565b60006020820190508181036000830152613c9281613c56565b9050919050565b7f45524332303a3a5f7472616e736665723a207472616e7366657220746f20746860008201527f65207a65726f2061646472657373000000000000000000000000000000000000602082015250565b6000613cf5602e836130fb565b9150613d0082613c99565b604082019050919050565b60006020820190508181036000830152613d2481613ce8565b9050919050565b7f45524332303a3a5f7472616e736665723a20616d6f756e74206578636565647360008201527f206d61785478416d6f756e740000000000000000000000000000000000000000602082015250565b6000613d87602c836130fb565b9150613d9282613d2b565b604082019050919050565b60006020820190508181036000830152613db681613d7a565b9050919050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b6000613df3601f836130fb565b9150613dfe82613dbd565b602082019050919050565b60006020820190508181036000830152613e2281613de6565b9050919050565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000613e856021836130fb565b9150613e9082613e29565b604082019050919050565b60006020820190508181036000830152613eb481613e78565b9050919050565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b6000613f176022836130fb565b9150613f2282613ebb565b604082019050919050565b60006020820190508181036000830152613f4681613f0a565b9050919050565b6000613f588261320e565b9150613f638361320e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613f9c57613f9b61370b565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613fe18261320e565b9150613fec8361320e565b925082613ffc57613ffb613fa7565b5b828204905092915050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006140636025836130fb565b915061406e82614007565b604082019050919050565b6000602082019050818103600083015261409281614056565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006140f56023836130fb565b915061410082614099565b604082019050919050565b60006020820190508181036000830152614124816140e8565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b60006141876026836130fb565b91506141928261412b565b604082019050919050565b600060208201905081810360008301526141b68161417a565b905091905056fea2646970667358221220ebfe49e11be1aac2ef1f90a574aff98b5ed756543eab376e565d6281f68b533c64736f6c634300080b0033
Verified Source Code Partial Match
Compiler: v0.8.11+commit.d7f03943
EVM: london
Optimization: No
TravelCare.sol 376 lines
// SPDX-License-Identifier: Unlicensed
pragma solidity 0.8.11;
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
contract TravelCare is
Ownable,
ERC20
{
uint256 public immutable CAP;
address public marketingWallet;
uint256 public marketingFee;
uint256 public burningFee;
uint256 public maxTxAmount;
mapping(address => bool) public isExcludedFromFee;
enum RewardType {
None,
Pink_Flamingo,
Indigo_Bunting,
Purple_Martin,
Golden_Eagle,
Arctic_Tern
}
struct RewardTypeInfo {
uint256 minDuration;
uint256 minBalance;
}
mapping(RewardType => RewardTypeInfo) public categories;
mapping(address => mapping(RewardType => uint256)) public userToRewardTypeTimestamp;
constructor(
address _marketingWallet,
uint256 _marketingFee,
uint256 _burningFee,
uint256 _maxTxAmount
) ERC20("TravelCare", "TRAVEL") {
marketingWallet = _marketingWallet;
marketingFee = _marketingFee;
burningFee = _burningFee;
maxTxAmount = _maxTxAmount;
isExcludedFromFee[address(this)] = true;
isExcludedFromFee[msg.sender] = true;
CAP = 210_000_000 * (10 ** decimals());
categories[RewardType.Pink_Flamingo] =
RewardTypeInfo(0, 1000 * (10 ** decimals()));
categories[RewardType.Indigo_Bunting] =
RewardTypeInfo(30 days, 11_000 * (10 ** decimals()));
categories[RewardType.Purple_Martin] =
RewardTypeInfo(60 days, 63_000 * (10 ** decimals()));
categories[RewardType.Golden_Eagle] =
RewardTypeInfo(120 days, 210_000 * (10 ** decimals()));
categories[RewardType.Arctic_Tern] =
RewardTypeInfo(180 days, 840_000 * (10 ** decimals()));
_mint(
msg.sender,
CAP
);
}
function getUserRewardStatus(address account)
public
view
returns (RewardType)
{
mapping(RewardType => uint256) storage userRewardsToTimestamp = userToRewardTypeTimestamp[account];
if (
userRewardsToTimestamp[RewardType.Arctic_Tern] != 0 &&
(
block.timestamp - userRewardsToTimestamp[RewardType.Arctic_Tern]
>= categories[RewardType.Arctic_Tern].minDuration
)
)
return RewardType.Arctic_Tern;
if (
userRewardsToTimestamp[RewardType.Golden_Eagle] != 0 &&
(
block.timestamp - userRewardsToTimestamp[RewardType.Golden_Eagle]
>= categories[RewardType.Golden_Eagle].minDuration
)
)
return RewardType.Golden_Eagle;
if (
userRewardsToTimestamp[RewardType.Purple_Martin] != 0 &&
(
block.timestamp - userRewardsToTimestamp[RewardType.Purple_Martin]
>= categories[RewardType.Purple_Martin].minDuration
)
)
return RewardType.Purple_Martin;
if (
userRewardsToTimestamp[RewardType.Indigo_Bunting] != 0 &&
(
block.timestamp - userRewardsToTimestamp[RewardType.Indigo_Bunting]
>= categories[RewardType.Indigo_Bunting].minDuration
)
)
return RewardType.Indigo_Bunting;
if (
userRewardsToTimestamp[RewardType.Pink_Flamingo] != 0 &&
(
block.timestamp - userRewardsToTimestamp[RewardType.Pink_Flamingo]
>= categories[RewardType.Pink_Flamingo].minDuration
)
)
return RewardType.Pink_Flamingo;
return RewardType.None;
}
receive() external payable {}
function changeRewardRequirements(
RewardType _rewardType,
uint256 _newAmount,
uint256 _newDuration
) external onlyOwner {
require(
uint8(_rewardType) > uint8(RewardType.None),
"TravelCare::changeRewardRequirements: invalid reward type"
);
categories[_rewardType] = RewardTypeInfo(_newDuration, _newAmount);
}
function mint(address _to, uint256 _amount)
external
onlyOwner
{
require(
totalSupply() + _amount <= CAP,
"TravelCare::mint: minting exceeds CAP"
);
_mint(
_to,
_amount
);
}
function burn(uint256 _amount) external {
_burn(_msgSender(), _amount);
}
function burnFrom(address _from, uint256 _amount) external {
uint256 currentAllowance = allowance(_from, _msgSender());
_approve(
_from,
_msgSender(),
currentAllowance - _amount
);
_burn(_from, _amount);
}
function excludeFromFee(address _account, bool exclude)
external
onlyOwner
{
isExcludedFromFee[_account] = exclude;
}
function setMarketingFee(uint256 _marketingFee)
external
onlyOwner
{
marketingFee = _marketingFee;
}
function setBurningFee(uint256 _burningFee)
external
onlyOwner
{
burningFee = _burningFee;
}
function setMaxTxAmount(uint256 _maxTxAmount)
external
onlyOwner
{
maxTxAmount = _maxTxAmount;
}
function withdrawBNB(uint256 _amount)
external
onlyOwner
{
payable(msg.sender).transfer(_amount);
}
function withdrawToken(address _token, uint256 _amount)
external
onlyOwner
{
IERC20(_token).transfer(msg.sender, _amount);
}
function setMarketingWallet(address _marketingWallet)
external
onlyOwner
{
marketingWallet = _marketingWallet;
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal override {
require(
sender != address(0),
"ERC20::_transfer: transfer from the zero address"
);
require(
recipient != address(0),
"ERC20::_transfer: transfer to the zero address"
);
address _owner = owner();
if (sender != _owner && recipient != _owner)
require(
amount <= maxTxAmount,
"ERC20::_transfer: amount exceeds maxTxAmount"
);
bool takeFee = !isExcludedFromFee[sender] && !isExcludedFromFee[recipient];
if (takeFee) {
(
uint256 burnFeeCollected,
uint256 marketingFeeCollected
) = processFee(sender, amount);
amount = amount
- burnFeeCollected
- marketingFeeCollected;
}
ERC20._transfer(
sender,
recipient,
amount
);
}
function processFee(address _account, uint256 _tokenAmount)
private
returns(
uint256 burnFeeCollected,
uint256 marketingFeeCollected
)
{
burnFeeCollected = _tokenAmount * burningFee / 100;
marketingFeeCollected = _tokenAmount * marketingFee / 100;
_balances[_account] = _balances[_account]
- burnFeeCollected
- marketingFeeCollected;
_totalSupply = _totalSupply - burnFeeCollected;
_balances[marketingWallet] = _balances[marketingWallet] + marketingFeeCollected;
return (
burnFeeCollected,
marketingFeeCollected
);
}
function addEligibleRewards(address account) private {
mapping(RewardType => uint256) storage userRewardsToTimestamp = userToRewardTypeTimestamp[account];
uint256 balance = balanceOf(account);
if (
userRewardsToTimestamp[RewardType.Pink_Flamingo] == 0 &&
balance >= categories[RewardType.Pink_Flamingo].minBalance
)
userRewardsToTimestamp[RewardType.Pink_Flamingo] = block.timestamp;
if (
userRewardsToTimestamp[RewardType.Indigo_Bunting] == 0 &&
balance >= categories[RewardType.Indigo_Bunting].minBalance
)
userRewardsToTimestamp[RewardType.Indigo_Bunting] = block.timestamp;
if (
userRewardsToTimestamp[RewardType.Purple_Martin] == 0 &&
balance >= categories[RewardType.Purple_Martin].minBalance
)
userRewardsToTimestamp[RewardType.Purple_Martin] = block.timestamp;
if (
userRewardsToTimestamp[RewardType.Golden_Eagle] == 0 &&
balance >= categories[RewardType.Golden_Eagle].minBalance
)
userRewardsToTimestamp[RewardType.Golden_Eagle] = block.timestamp;
if (
userRewardsToTimestamp[RewardType.Arctic_Tern] == 0 &&
balance >= categories[RewardType.Arctic_Tern].minBalance
)
userRewardsToTimestamp[RewardType.Arctic_Tern] = block.timestamp;
}
function removeOutstandingRewards(address account) private {
mapping(RewardType => uint256) storage userRewardsToTimestamp = userToRewardTypeTimestamp[account];
uint256 balance = balanceOf(account);
if (
userRewardsToTimestamp[RewardType.Pink_Flamingo] != 0 &&
balance < categories[RewardType.Pink_Flamingo].minBalance
)
userRewardsToTimestamp[RewardType.Pink_Flamingo] = 0;
if (
userRewardsToTimestamp[RewardType.Indigo_Bunting] != 0 &&
balance < categories[RewardType.Indigo_Bunting].minBalance
)
userRewardsToTimestamp[RewardType.Indigo_Bunting] = 0;
if (
userRewardsToTimestamp[RewardType.Purple_Martin] != 0 &&
balance < categories[RewardType.Purple_Martin].minBalance
)
userRewardsToTimestamp[RewardType.Purple_Martin] = 0;
if (
userRewardsToTimestamp[RewardType.Golden_Eagle] != 0 &&
balance < categories[RewardType.Golden_Eagle].minBalance
)
userRewardsToTimestamp[RewardType.Golden_Eagle] = 0;
if (
userRewardsToTimestamp[RewardType.Arctic_Tern] != 0 &&
balance < categories[RewardType.Arctic_Tern].minBalance
)
userRewardsToTimestamp[RewardType.Arctic_Tern] = 0;
}
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal override {
super._afterTokenTransfer(
from,
to,
amount
);
if (from != address(0))
removeOutstandingRewards(from);
if (to != address(0))
addEligibleRewards(to);
}
}
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 76 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_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 383 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) internal _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 internal _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(
address from,
address to,
uint256 amount
) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, _allowances[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 = _allowances[owner][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* 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;
}
_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;
_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;
}
_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 Spend `amount` form the allowance of `owner` toward `spender`.
*
* 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 82 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `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);
/**
* @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);
}
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
CAP 0xec81b483 → uint256
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
burningFee 0x90f712cc → uint256
categories 0x7be6277b → uint256, uint256
decimals 0x313ce567 → uint8
getUserRewardStatus 0x6bb72a54 → uint8
isExcludedFromFee 0x5342acb4 → bool
marketingFee 0x6b67c4df → uint256
marketingWallet 0x75f0a874 → address
maxTxAmount 0x8c0b5e22 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
userToRewardTypeTimestamp 0x3dc120f4 → uint256
Write Contract 18 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
burn 0x42966c68
uint256 _amount
burnFrom 0x79cc6790
address _from
uint256 _amount
changeRewardRequirements 0x4bef8da5
uint8 _rewardType
uint256 _newAmount
uint256 _newDuration
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
excludeFromFee 0xdf8408fe
address _account
bool exclude
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
mint 0x40c10f19
address _to
uint256 _amount
renounceOwnership 0x715018a6
No parameters
setBurningFee 0xf9dc9720
uint256 _burningFee
setMarketingFee 0x625e764c
uint256 _marketingFee
setMarketingWallet 0x5d098b38
address _marketingWallet
setMaxTxAmount 0xec28438a
uint256 _maxTxAmount
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
withdrawBNB 0x127f4b2e
uint256 _amount
withdrawToken 0x9e281a98
address _token
uint256 _amount
Recent Transactions
No transactions found for this address