Address Contract Verified
Address
0x724a4DBc096E8553120EC99D975CA62c1e4f9F51
Balance
0.028439 ETH
Nonce
2
Code Size
16841 bytes
Creator
0x03097BD9...9d49 at tx 0x35509998...1babe4
Indexed Transactions
0
Contract Bytecode
16841 bytes
0x6080604052600436106103bc5760003560e01c806375f0a874116101f2578063ad56c13c1161010d578063dd62ed3e116100a0578063e7841ec01161006f578063e7841ec014610e76578063e98030c714610e8b578063f27fd25414610eb5578063f2fde38b14610edf576103c3565b8063dd62ed3e14610dde578063e2f4560514610e19578063e37ba8f914610e2e578063e6c75f7114610e61576103c3565b8063c0246668116100dc578063c024666814610cfa578063c492f04614610d35578063d469801614610db4578063db2e21bc14610dc9576103c3565b8063ad56c13c14610bec578063b3b5e04314610c6a578063b62496f514610c94578063bb85c6d114610cc7576103c3565b80639a7a23d611610185578063a457c2d711610154578063a457c2d714610b32578063a6b6388814610b6b578063a8b9d24014610b80578063a9059cbb14610bb3576103c3565b80639a7a23d614610aa35780639c1b8af514610ade5780639ff0fe5414610af3578063a26579ad14610b1d576103c3565b80638da5cb5b116101c15780638da5cb5b14610a3a57806391d55f4114610a4f57806395d89b4114610a7957806398118cb414610a8e576103c3565b806375f0a874146109b357806385141a77146109c8578063871c128d146109dd57806388bdd9be14610a07576103c3565b806330bb4cff116102e2578063625e764c116102755780636b67c4df116102445780636b67c4df1461092c578063700bb1911461094157806370a082311461096b578063715018a61461099e576103c3565b8063625e764c1461088757806364b0f653146108b157806365b8dbc0146108c65780636843cd84146108f9576103c3565b8063455a4396116102b1578063455a4396146107ef57806349bd5a5e1461082a5780634e71d92d1461083f5780634fbee19314610854576103c3565b806330bb4cff1461074c578063313ce56714610761578063357bf15c1461078c57806339509351146107b6576103c3565b806318160ddd1161035a57806320e48f001161032957806320e48f00146106b557806323b872dd146106ca5780632bd5201c1461070d5780632c1f521614610737576103c3565b806318160ddd146105895780631cdd3be31461059e5780631d5431bb146105d15780631da3da70146106a0576103c3565b80630e832273116103965780630e832273146104cb578063111e0376146104fe57806313114a9d146105315780631694505e14610558576103c3565b806306fdde03146103c8578063095ea7b31461045257806309d6bf0a1461049f576103c3565b366103c357005b600080fd5b3480156103d457600080fd5b506103dd610f12565b6040805160208082528351818301528351919283929083019185019080838360005b838110156104175781810151838201526020016103ff565b50505050905090810190601f1680156104445780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561045e57600080fd5b5061048b6004803603604081101561047557600080fd5b506001600160a01b038135169060200135610fa8565b604080519115158252519081900360200190f35b3480156104ab57600080fd5b506104c9600480360360208110156104c257600080fd5b5035610fc6565b005b3480156104d757600080fd5b5061048b600480360360208110156104ee57600080fd5b50356001600160a01b0316611033565b34801561050a57600080fd5b506104c96004803603602081101561052157600080fd5b50356001600160a01b03166110b6565b34801561053d57600080fd5b50610546611181565b60408051918252519081900360200190f35b34801561056457600080fd5b5061056d611187565b604080516001600160a01b039092168252519081900360200190f35b34801561059557600080fd5b50610546611196565b3480156105aa57600080fd5b5061048b600480360360208110156105c157600080fd5b50356001600160a01b031661119c565b3480156105dd57600080fd5b506104c9600480360360408110156105f457600080fd5b81019060208101813564010000000081111561060f57600080fd5b82018360208201111561062157600080fd5b8035906020019184602083028401116401000000008311171561064357600080fd5b91939092909160208101903564010000000081111561066157600080fd5b82018360208201111561067357600080fd5b8035906020019184602083028401116401000000008311171561069557600080fd5b5090925090506111b1565b3480156106ac57600080fd5b5061054661126a565b3480156106c157600080fd5b5061056d611270565b3480156106d657600080fd5b5061048b600480360360608110156106ed57600080fd5b506001600160a01b0381358116916020810135909116906040013561127f565b34801561071957600080fd5b506104c96004803603602081101561073057600080fd5b5035611306565b34801561074357600080fd5b5061056d61136d565b34801561075857600080fd5b5061054661137c565b34801561076d57600080fd5b506107766113f2565b6040805160ff9092168252519081900360200190f35b34801561079857600080fd5b506104c9600480360360208110156107af57600080fd5b50356113fb565b3480156107c257600080fd5b5061048b600480360360408110156107d957600080fd5b506001600160a01b038135169060200135611462565b3480156107fb57600080fd5b506104c96004803603604081101561081257600080fd5b506001600160a01b03813516906020013515156114b0565b34801561083657600080fd5b5061056d61153d565b34801561084b57600080fd5b506104c961154c565b34801561086057600080fd5b5061048b6004803603602081101561087757600080fd5b50356001600160a01b03166115d1565b34801561089357600080fd5b506104c9600480360360208110156108aa57600080fd5b50356115ef565b3480156108bd57600080fd5b50610546611656565b3480156108d257600080fd5b506104c9600480360360208110156108e957600080fd5b50356001600160a01b031661169b565b34801561090557600080fd5b506105466004803603602081101561091c57600080fd5b50356001600160a01b031661192a565b34801561093857600080fd5b5061054661197b565b34801561094d57600080fd5b506104c96004803603602081101561096457600080fd5b5035611981565b34801561097757600080fd5b506105466004803603602081101561098e57600080fd5b50356001600160a01b0316611a68565b3480156109aa57600080fd5b506104c9611a83565b3480156109bf57600080fd5b5061056d611b35565b3480156109d457600080fd5b5061056d611b44565b3480156109e957600080fd5b506104c960048036036020811015610a0057600080fd5b5035611b53565b348015610a1357600080fd5b506104c960048036036020811015610a2a57600080fd5b50356001600160a01b0316611c7a565b348015610a4657600080fd5b5061056d611fdb565b348015610a5b57600080fd5b506104c960048036036020811015610a7257600080fd5b5035611fef565b348015610a8557600080fd5b506103dd61205c565b348015610a9a57600080fd5b506105466120bd565b348015610aaf57600080fd5b506104c960048036036040811015610ac657600080fd5b506001600160a01b03813516906020013515156120c3565b348015610aea57600080fd5b5061054661217c565b348015610aff57600080fd5b506104c960048036036020811015610b1657600080fd5b5035612182565b348015610b2957600080fd5b50610546612231565b348015610b3e57600080fd5b5061048b60048036036040811015610b5557600080fd5b506001600160a01b038135169060200135612276565b348015610b7757600080fd5b506105466122de565b348015610b8c57600080fd5b5061054660048036036020811015610ba357600080fd5b50356001600160a01b03166122e4565b348015610bbf57600080fd5b5061048b60048036036040811015610bd657600080fd5b506001600160a01b038135169060200135612335565b348015610bf857600080fd5b50610c1f60048036036020811015610c0f57600080fd5b50356001600160a01b0316612349565b604080516001600160a01b0390991689526020890197909752878701959095526060870193909352608086019190915260a085015260c084015260e083015251908190036101000190f35b348015610c7657600080fd5b506104c960048036036020811015610c8d57600080fd5b5035612429565b348015610ca057600080fd5b5061048b60048036036020811015610cb757600080fd5b50356001600160a01b0316612496565b348015610cd357600080fd5b506104c960048036036020811015610cea57600080fd5b50356001600160a01b03166124ab565b348015610d0657600080fd5b506104c960048036036040811015610d1d57600080fd5b506001600160a01b038135169060200135151561252f565b348015610d4157600080fd5b506104c960048036036040811015610d5857600080fd5b810190602081018135640100000000811115610d7357600080fd5b820183602082011115610d8557600080fd5b80359060200191846020830284011164010000000083111715610da757600080fd5b919350915035151561264f565b348015610dc057600080fd5b5061056d612779565b348015610dd557600080fd5b506104c9612788565b348015610dea57600080fd5b5061054660048036036040811015610e0157600080fd5b506001600160a01b038135811691602001351661282d565b348015610e2557600080fd5b50610546612858565b348015610e3a57600080fd5b506104c960048036036020811015610e5157600080fd5b50356001600160a01b031661285e565b348015610e6d57600080fd5b50610546612975565b348015610e8257600080fd5b5061054661297b565b348015610e9757600080fd5b506104c960048036036020811015610eae57600080fd5b50356129c0565b348015610ec157600080fd5b50610c1f60048036036020811015610ed857600080fd5b5035612a6f565b348015610eeb57600080fd5b506104c960048036036020811015610f0257600080fd5b50356001600160a01b0316612ad5565b60038054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610f9e5780601f10610f7357610100808354040283529160200191610f9e565b820191906000526020600020905b815481529060010190602001808311610f8157829003601f168201915b5050505050905090565b6000610fbc610fb5612c44565b8484612c48565b5060015b92915050565b610fce612c44565b6001600160a01b0316610fdf611fdb565b6001600160a01b031614611028576040805162461bcd60e51b81526020600482018190526024820152600080516020614059833981519152604482015290519081900360640190fd5b633b9aca0002600c55565b60095460408051634e7b827f60e01b81526001600160a01b03848116600483015291516000939290921691634e7b827f91602480820192602092909190829003018186803b15801561108457600080fd5b505afa158015611098573d6000803e3d6000fd5b505050506040513d60208110156110ae57600080fd5b505192915050565b6110be612c44565b6001600160a01b03166110cf611fdb565b6001600160a01b031614611118576040805162461bcd60e51b81526020600482018190526024820152600080516020614059833981519152604482015290519081900360640190fd5b6009546040805163031e79db60e41b81526001600160a01b038481166004830152915191909216916331e79db091602480830192600092919082900301818387803b15801561116657600080fd5b505af115801561117a573d6000803e3d6000fd5b5050505050565b60135481565b6006546001600160a01b031681565b60025490565b600f6020526000908152604090205460ff1681565b6111b9612c44565b6001600160a01b03166111ca611fdb565b6001600160a01b031614611213576040805162461bcd60e51b81526020600482018190526024820152600080516020614059833981519152604482015290519081900360640190fd5b82811461121f57600080fd5b60005b8381101561117a576112623386868481811061123a57fe5b905060200201356001600160a01b031685858581811061125657fe5b90506020020135612d34565b600101611222565b60105481565b6008546001600160a01b031681565b600061128c848484612d34565b6112fc84611298612c44565b6112f785604051806060016040528060288152602001614031602891396001600160a01b038a166000908152600160205260408120906112d6612c44565b6001600160a01b0316815260208101919091526040016000205491906132dc565b612c48565b5060019392505050565b61130e612c44565b6001600160a01b031661131f611fdb565b6001600160a01b031614611368576040805162461bcd60e51b81526020600482018190526024820152600080516020614059833981519152604482015290519081900360640190fd5b601055565b6009546001600160a01b031681565b600954604080516342d359d760e11b815290516000926001600160a01b0316916385a6b3ae916004808301926020929190829003018186803b1580156113c157600080fd5b505afa1580156113d5573d6000803e3d6000fd5b505050506040513d60208110156113eb57600080fd5b5051905090565b60055460ff1690565b611403612c44565b6001600160a01b0316611414611fdb565b6001600160a01b03161461145d576040805162461bcd60e51b81526020600482018190526024820152600080516020614059833981519152604482015290519081900360640190fd5b601155565b6000610fbc61146f612c44565b846112f78560016000611480612c44565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490612be3565b6114b8612c44565b6001600160a01b03166114c9611fdb565b6001600160a01b031614611512576040805162461bcd60e51b81526020600482018190526024820152600080516020614059833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152600f60205260409020805460ff1916911515919091179055565b6007546001600160a01b031681565b6009546040805163bc4c4b3760e01b815233600482015260006024820181905291516001600160a01b039093169263bc4c4b3792604480840193602093929083900390910190829087803b1580156115a357600080fd5b505af11580156115b7573d6000803e3d6000fd5b505050506040513d60208110156115cd57600080fd5b5050565b6001600160a01b031660009081526016602052604090205460ff1690565b6115f7612c44565b6001600160a01b0316611608611fdb565b6001600160a01b031614611651576040805162461bcd60e51b81526020600482018190526024820152600080516020614059833981519152604482015290519081900360640190fd5b601255565b600954604080516304ddf6ef60e11b815290516000926001600160a01b0316916309bbedde916004808301926020929190829003018186803b1580156113c157600080fd5b6116a3612c44565b6001600160a01b03166116b4611fdb565b6001600160a01b0316146116fd576040805162461bcd60e51b81526020600482018190526024820152600080516020614059833981519152604482015290519081900360640190fd5b6006546001600160a01b038281169116141561174a5760405162461bcd60e51b815260040180806020018281038252602a815260200180613f36602a913960400191505060405180910390fd5b6006546040516001600160a01b03918216918316907f8fc842bbd331dfa973645f4ed48b11683d501ebf1352708d77a5da2ab49a576e90600090a3600680546001600160a01b0319166001600160a01b0383811691909117918290556040805163c45a015560e01b815290516000939092169163c45a015591600480820192602092909190829003018186803b1580156117e357600080fd5b505afa1580156117f7573d6000803e3d6000fd5b505050506040513d602081101561180d57600080fd5b5051600654604080516315ab88c960e31b815290516001600160a01b039384169363c9c6539693309391169163ad5c464891600480820192602092909190829003018186803b15801561185f57600080fd5b505afa158015611873573d6000803e3d6000fd5b505050506040513d602081101561188957600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b1580156118db57600080fd5b505af11580156118ef573d6000803e3d6000fd5b505050506040513d602081101561190557600080fd5b5051600780546001600160a01b0319166001600160a01b039092169190911790555050565b600954604080516370a0823160e01b81526001600160a01b038481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b15801561108457600080fd5b60125481565b600954604080516001624d3b8760e01b03198152600481018490529051600092839283926001600160a01b039092169163ffb2c4799160248082019260609290919082900301818787803b1580156119d857600080fd5b505af11580156119ec573d6000803e3d6000fd5b505050506040513d6060811015611a0257600080fd5b5080516020808301516040938401518451848152928301829052828501819052606083018990529351929650945091925032916000917fc864333d6121033635ab41b29ae52f10a22cf4438c3e4f1c4c68518feb2f8a989181900360800190a350505050565b6001600160a01b031660009081526020819052604090205490565b611a8b612c44565b6001600160a01b0316611a9c611fdb565b6001600160a01b031614611ae5576040805162461bcd60e51b81526020600482018190526024820152600080516020614059833981519152604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b6014546001600160a01b031681565b600b546001600160a01b031681565b611b5b612c44565b6001600160a01b0316611b6c611fdb565b6001600160a01b031614611bb5576040805162461bcd60e51b81526020600482018190526024820152600080516020614059833981519152604482015290519081900360640190fd5b62030d408110158015611bcb57506207a1208111155b611c065760405162461bcd60e51b815260040180806020018281038252603b8152602001806140c2603b913960400191505060405180910390fd5b601554811415611c475760405162461bcd60e51b8152600401808060200182810382526033815260200180613f886033913960400191505060405180910390fd5b60155460405182907f40d7e40e79af4e8e5a9b3c57030d8ea93f13d669c06d448c4d631d4ae7d23db790600090a3601555565b611c82612c44565b6001600160a01b0316611c93611fdb565b6001600160a01b031614611cdc576040805162461bcd60e51b81526020600482018190526024820152600080516020614059833981519152604482015290519081900360640190fd5b6009546001600160a01b0382811691161415611d295760405162461bcd60e51b8152600401808060200182810382526034815260200180613de06034913960400191505060405180910390fd5b6000819050306001600160a01b0316816001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b158015611d7157600080fd5b505afa158015611d85573d6000803e3d6000fd5b505050506040513d6020811015611d9b57600080fd5b50516001600160a01b031614611de25760405162461bcd60e51b8152600401808060200182810382526049815260200180613eed6049913960600191505060405180910390fd5b806001600160a01b03166331e79db0826040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b158015611e3157600080fd5b505af1158015611e45573d6000803e3d6000fd5b50506040805163031e79db60e41b815230600482015290516001600160a01b03851693506331e79db09250602480830192600092919082900301818387803b158015611e9057600080fd5b505af1158015611ea4573d6000803e3d6000fd5b50505050806001600160a01b03166331e79db0611ebf611fdb565b6040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b158015611efe57600080fd5b505af1158015611f12573d6000803e3d6000fd5b50506006546040805163031e79db60e41b81526001600160a01b039283166004820152905191851693506331e79db0925060248082019260009290919082900301818387803b158015611f6457600080fd5b505af1158015611f78573d6000803e3d6000fd5b50506009546040516001600160a01b03918216935090851691507f90c7d74461c613da5efa97d90740869367d74ab3aa5837aa4ae9a975f954b7a890600090a3600980546001600160a01b0319166001600160a01b039290921691909117905550565b60055461010090046001600160a01b031690565b611ff7612c44565b6001600160a01b0316612008611fdb565b6001600160a01b031614612051576040805162461bcd60e51b81526020600482018190526024820152600080516020614059833981519152604482015290519081900360640190fd5b633b9aca0002600e55565b60048054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610f9e5780601f10610f7357610100808354040283529160200191610f9e565b60115481565b6120cb612c44565b6001600160a01b03166120dc611fdb565b6001600160a01b031614612125576040805162461bcd60e51b81526020600482018190526024820152600080516020614059833981519152604482015290519081900360640190fd5b6007546001600160a01b03838116911614156121725760405162461bcd60e51b8152600401808060200182810382526048815260200180613e7f6048913960600191505060405180910390fd5b6115cd8282613373565b60155481565b61218a612c44565b6001600160a01b031661219b611fdb565b6001600160a01b0316146121e4576040805162461bcd60e51b81526020600482018190526024820152600080516020614059833981519152604482015290519081900360640190fd5b60095460408051635ebf4db960e01b81526004810184905290516001600160a01b0390921691635ebf4db99160248082019260009290919082900301818387803b15801561116657600080fd5b60095460408051631bc9e27b60e21b815290516000926001600160a01b031691636f2789ec916004808301926020929190829003018186803b1580156113c157600080fd5b6000610fbc612283612c44565b846112f78560405180606001604052806025815260200161413060259139600160006122ad612c44565b6001600160a01b03908116825260208083019390935260409182016000908120918d168152925290205491906132dc565b600d5481565b600954604080516302a2e74960e61b81526001600160a01b0384811660048301529151600093929092169163a8b9d24091602480820192602092909190829003018186803b15801561108457600080fd5b6000610fbc612342612c44565b8484612d34565b600080600080600080600080600960009054906101000a90046001600160a01b03166001600160a01b031663fbcbc0f18a6040518263ffffffff1660e01b815260040180826001600160a01b031681526020019150506101006040518083038186803b1580156123b857600080fd5b505afa1580156123cc573d6000803e3d6000fd5b505050506040513d6101008110156123e357600080fd5b508051602082015160408301516060840151608085015160a086015160c087015160e090970151959e50939c50919a509850965094509092509050919395975091939597565b612431612c44565b6001600160a01b0316612442611fdb565b6001600160a01b03161461248b576040805162461bcd60e51b81526020600482018190526024820152600080516020614059833981519152604482015290519081900360640190fd5b633b9aca0002600d55565b60176020526000908152604090205460ff1681565b6124b3612c44565b6001600160a01b03166124c4611fdb565b6001600160a01b03161461250d576040805162461bcd60e51b81526020600482018190526024820152600080516020614059833981519152604482015290519081900360640190fd5b601480546001600160a01b0319166001600160a01b0392909216919091179055565b612537612c44565b6001600160a01b0316612548611fdb565b6001600160a01b031614612591576040805162461bcd60e51b81526020600482018190526024820152600080516020614059833981519152604482015290519081900360640190fd5b6001600160a01b03821660009081526016602052604090205460ff16151581151514156125ef5760405162461bcd60e51b8152600401808060200182810382526031815260200180613fdf6031913960400191505060405180910390fd5b6001600160a01b038216600081815260166020908152604091829020805460ff1916851515908117909155825190815291517f9d8f7706ea1113d1a167b526eca956215946dd36cc7df39eb16180222d8b5df79281900390910190a25050565b612657612c44565b6001600160a01b0316612668611fdb565b6001600160a01b0316146126b1576040805162461bcd60e51b81526020600482018190526024820152600080516020614059833981519152604482015290519081900360640190fd5b60005b828110156127065781601660008686858181106126cd57fe5b602090810292909201356001600160a01b0316835250810191909152604001600020805460ff19169115159190911790556001016126b4565b507f7fdaf542373fa84f4ee8d662c642f44e4c2276a217d7d29e548b6eb29a233b35838383604051808060200183151581526020018281038252858582818152602001925060200280828437600083820152604051601f909101601f1916909201829003965090945050505050a1505050565b600a546001600160a01b031681565b612790612c44565b6001600160a01b03166127a1611fdb565b6001600160a01b0316146127ea576040805162461bcd60e51b81526020600482018190526024820152600080516020614059833981519152604482015290519081900360640190fd5b6127f2611fdb565b6001600160a01b03166108fc479081150290604051600060405180830381858888f1935050505015801561282a573d6000803e3d6000fd5b50565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600c5481565b612866612c44565b6001600160a01b0316612877611fdb565b6001600160a01b0316146128c0576040805162461bcd60e51b81526020600482018190526024820152600080516020614059833981519152604482015290519081900360640190fd5b600a546001600160a01b038281169116141561290d5760405162461bcd60e51b81526004018080602001828103825260338152602001806140fd6033913960400191505060405180910390fd5b61291881600161252f565b600a546040516001600160a01b03918216918316907f6080503d1da552ae8eb4b7b8a20245d9fabed014180510e7d1a05ea08fdb0f3e90600090a3600a80546001600160a01b0319166001600160a01b0392909216919091179055565b600e5481565b6009546040805163039e107b60e61b815290516000926001600160a01b03169163e7841ec0916004808301926020929190829003018186803b1580156113c157600080fd5b6129c8612c44565b6001600160a01b03166129d9611fdb565b6001600160a01b031614612a22576040805162461bcd60e51b81526020600482018190526024820152600080516020614059833981519152604482015290519081900360640190fd5b6009546040805163e98030c760e01b81526004810184905290516001600160a01b039092169163e98030c79160248082019260009290919082900301818387803b15801561116657600080fd5b600080600080600080600080600960009054906101000a90046001600160a01b03166001600160a01b0316635183d6fd8a6040518263ffffffff1660e01b8152600401808281526020019150506101006040518083038186803b1580156123b857600080fd5b612add612c44565b6001600160a01b0316612aee611fdb565b6001600160a01b031614612b37576040805162461bcd60e51b81526020600482018190526024820152600080516020614059833981519152604482015290519081900360640190fd5b6001600160a01b038116612b7c5760405162461bcd60e51b8152600401808060200182810382526026815260200180613e376026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b600082820183811015612c3d576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b038316612c8d5760405162461bcd60e51b815260040180806020018281038252602481526020018061409e6024913960400191505060405180910390fd5b6001600160a01b038216612cd25760405162461bcd60e51b8152600401808060200182810382526022815260200180613e5d6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316612d795760405162461bcd60e51b81526004018080602001828103825260258152602001806140796025913960400191505060405180910390fd5b6001600160a01b038216612dbe5760405162461bcd60e51b8152600401808060200182810382526023815260200180613e146023913960400191505060405180910390fd5b6001600160a01b0383166000908152600f602052604090205460ff16158015612e0057506001600160a01b0382166000908152600f602052604090205460ff16155b612e47576040805162461bcd60e51b8152602060048201526013602482015272426c61636b6c6973746564206164647265737360681b604482015290519081900360640190fd5b80612e5d57612e58838360006134a1565b6132d7565b6001600160a01b03831660009081526017602052604090205460ff1615612f1157600d54811115612ebf5760405162461bcd60e51b8152600401808060200182810382526028815260200180613f606028913960400191505060405180910390fd5b6000612eca83611a68565b9050600e548282011115612f0f5760405162461bcd60e51b8152600401808060200182810382526024815260200180613fbb6024913960400191505060405180910390fd5b505b6000612f1c30611a68565b600c5490915081108015908190612f3d5750600854600160a01b900460ff16155b8015612f6257506001600160a01b03851660009081526017602052604090205460ff16155b8015612f7c5750600a546001600160a01b03868116911614155b8015612f965750600a546001600160a01b03858116911614155b15613026576008805460ff60a01b1916600160a01b179055601354601254600091612fcc91612fc69086906135fc565b90613655565b9050612fd7816136bc565b6000612ff4601354612fc6601154876135fc90919063ffffffff16565b9050612fff81613713565b600061300a30611a68565b905061301581613799565b50506008805460ff60a01b19169055505b6008546001600160a01b03861660009081526016602052604090205460ff600160a01b90920482161591168061307457506001600160a01b03851660009081526016602052604090205460ff165b1561307d575060005b80156130ee57600061309f6064612fc6601354886135fc90919063ffffffff16565b6001600160a01b03871660009081526017602052604090205490915060ff16156130d5576130d36064612fc68760016135fc565b015b6130df8582613951565b94506130ec8730836134a1565b505b6130f98686866134a1565b6009546001600160a01b031663e30443bc8761311481611a68565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561315a57600080fd5b505af192505050801561316b575060015b506009546001600160a01b031663e30443bc8661318781611a68565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156131cd57600080fd5b505af19250505080156131de575060015b50600854600160a01b900460ff166132d357601554600954604080516001624d3b8760e01b031981526004810184905290516001600160a01b039092169163ffb2c479916024808201926060929091908290030181600087803b15801561324457600080fd5b505af192505050801561327857506040513d606081101561326457600080fd5b508051602082015160409092015190919060015b613281576132d1565b604080518481526020810184905280820183905260608101869052905132916001917fc864333d6121033635ab41b29ae52f10a22cf4438c3e4f1c4c68518feb2f8a989181900360800190a35050505b505b5050505b505050565b6000818484111561336b5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613330578181015183820152602001613318565b50505050905090810190601f16801561335d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b03821660009081526017602052604090205460ff16151581151514156133d15760405162461bcd60e51b815260040180806020018281038252603f815260200180614155603f913960400191505060405180910390fd5b6001600160a01b0382166000908152601760205260409020805460ff19168215801591909117909155613465576009546040805163031e79db60e41b81526001600160a01b038581166004830152915191909216916331e79db091602480830192600092919082900301818387803b15801561344c57600080fd5b505af1158015613460573d6000803e3d6000fd5b505050505b604051811515906001600160a01b038416907fffa9187bf1f18bf477bd0ea1bcbb64e93b6a98132473929edfce215cd9b16fab90600090a35050565b6001600160a01b0383166134e65760405162461bcd60e51b81526004018080602001828103825260258152602001806140796025913960400191505060405180910390fd5b6001600160a01b03821661352b5760405162461bcd60e51b8152600401808060200182810382526023815260200180613e146023913960400191505060405180910390fd5b6135368383836132d7565b61357381604051806060016040528060268152602001613ec7602691396001600160a01b03861660009081526020819052604090205491906132dc565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546135a29082612be3565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008261360b57506000610fc0565b8282028284828161361857fe5b0414612c3d5760405162461bcd60e51b81526004018080602001828103825260218152602001806140106021913960400191505060405180910390fd5b60008082116136ab576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816136b457fe5b049392505050565b476136c6826139ae565b60006136d24783613951565b6014546040519192506001600160a01b03169082156108fc029083906000818181858888f1935050505015801561370d573d6000803e3d6000fd5b50505050565b6000613720826002613655565b9050600061372e8383613951565b90504761373a836139ae565b60006137464783613951565b90506137528382613b54565b604080518581526020810183905280820185905290517f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb5619181900360600190a15050505050565b6137a38130613c0c565b600854604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156137ee57600080fd5b505afa158015613802573d6000803e3d6000fd5b505050506040513d602081101561381857600080fd5b50516008546009546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051939450600093919092169163a9059cbb91604480830192602092919082900301818787803b15801561387857600080fd5b505af115801561388c573d6000803e3d6000fd5b505050506040513d60208110156138a257600080fd5b5051905080156132d757600954604080516329cf3c9b60e11b81526004810185905290516001600160a01b039092169163539e79369160248082019260009290919082900301818387803b1580156138f957600080fd5b505af115801561390d573d6000803e3d6000fd5b5050604080518681526020810186905281517f80195cc573b02cc48460cbca6e6e4cc85ddb91959d946e1c3025ea3d87942dc39450908190039091019150a1505050565b6000828211156139a8576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b604080516002808252606080830184529260208301908036833701905050905030816000815181106139dc57fe5b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015613a3057600080fd5b505afa158015613a44573d6000803e3d6000fd5b505050506040513d6020811015613a5a57600080fd5b5051815182906001908110613a6b57fe5b6001600160a01b039283166020918202929092010152600654613a919130911684612c48565b60065460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b83811015613b17578181015183820152602001613aff565b505050509050019650505050505050600060405180830381600087803b158015613b4057600080fd5b505af11580156132d3573d6000803e3d6000fd5b600654613b6c9030906001600160a01b031684612c48565b600654600a546040805163f305d71960e01b81523060048201526024810186905260006044820181905260648201526001600160a01b0392831660848201524260a48201529051919092169163f305d71991849160c48082019260609290919082900301818588803b158015613be157600080fd5b505af1158015613bf5573d6000803e3d6000fd5b50505050506040513d606081101561370d57600080fd5b604080516003808252608082019092526060916020820183803683370190505090503081600081518110613c3c57fe5b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015613c9057600080fd5b505afa158015613ca4573d6000803e3d6000fd5b505050506040513d6020811015613cba57600080fd5b5051815182906001908110613ccb57fe5b6001600160a01b039283166020918202929092010152600854825191169082906002908110613cf657fe5b6001600160a01b039283166020918202929092010152600654613d1c9130911685612c48565b600654604051635c11d79560e01b8152600481018581526000602483018190526001600160a01b038681166064850152426084850181905260a060448601908152875160a487015287519290961695635c11d795958a9589948b9493919260c40190602080880191028083838b5b83811015613da2578181015183820152602001613d8a565b505050509050019650505050505050600060405180830381600087803b158015613dcb57600080fd5b505af11580156132d1573d6000803e3d6000fdfe59554b4f4e3a20546865206469766964656e6420747261636b657220616c7265616479206861732074686174206164647265737345524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737359554b4f4e3a2054686520554e495357415020706169722063616e6e6f742062652072656d6f7665642066726f6d206175746f6d617465644d61726b65744d616b6572506169727345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636559554b4f4e3a20546865206e6577206469766964656e6420747261636b6572206d757374206265206f776e6564206279207468652059554b4f4e20746f6b656e20636f6e747261637459554b4f4e3a2054686520726f7574657220616c726561647920686173207468617420616464726573735472616e7366657220616d6f756e74206578636565647320746865206d61785478416d6f756e742e59554b4f4e3a2043616e6e6f742075706461746520676173466f7250726f63657373696e6720746f2073616d652076616c756545786365656473206d6178696d756d2077616c6c657420746f6b656e20616d6f756e742e59554b4f4e3a204163636f756e7420697320616c7265616479207468652076616c7565206f6620276578636c7564656427536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737359554b4f4e3a20676173466f7250726f63657373696e67206d757374206265206265747765656e203230302c30303020616e64203530302c30303059554b4f4e3a20546865206c69717569646974792077616c6c657420697320616c72656164792074686973206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f59554b4f4e3a204175746f6d61746564206d61726b6574206d616b6572207061697220697320616c72656164792073657420746f20746861742076616c7565a2646970667358221220741328fee262c80c60cf021a4ba615548a45be805a53250d7e6bcfe710dacd5a64736f6c634300060c0033
Verified Source Code Full Match
Compiler: v0.6.12+commit.27d51765
EVM: istanbul
Optimization: Yes (200 runs)
YukonToken.sol 2020 lines
// File: contracts/IERC20.sol
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.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 `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: contracts/Context.sol
pragma solidity >=0.6.0 <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 GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// File: contracts/IUniswapV2Router01.sol
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
// File: contracts/IUniswapV2Router02.sol
pragma solidity >=0.6.2;
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
// File: contracts/IUniswapV2Factory.sol
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// File: contracts/IUniswapV2Pair.sol
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// File: contracts/IterableMapping.sol
pragma solidity ^0.6.6;
library IterableMapping {
// Iterable mapping from address to uint;
struct Map {
address[] keys;
mapping(address => uint) values;
mapping(address => uint) indexOf;
mapping(address => bool) inserted;
}
function get(Map storage map, address key) public view returns (uint) {
return map.values[key];
}
function getIndexOfKey(Map storage map, address key) public view returns (int) {
if(!map.inserted[key]) {
return -1;
}
return int(map.indexOf[key]);
}
function getKeyAtIndex(Map storage map, uint index) public view returns (address) {
return map.keys[index];
}
function size(Map storage map) public view returns (uint) {
return map.keys.length;
}
function set(Map storage map, address key, uint val) public {
if (map.inserted[key]) {
map.values[key] = val;
} else {
map.inserted[key] = true;
map.values[key] = val;
map.indexOf[key] = map.keys.length;
map.keys.push(key);
}
}
function remove(Map storage map, address key) public {
if (!map.inserted[key]) {
return;
}
delete map.inserted[key];
delete map.values[key];
uint index = map.indexOf[key];
uint lastIndex = map.keys.length - 1;
address lastKey = map.keys[lastIndex];
map.indexOf[lastKey] = index;
delete map.indexOf[key];
map.keys[index] = lastKey;
map.keys.pop();
}
}
// File: contracts/Ownable.sol
pragma solidity ^0.6.0;
/**
* @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 () public {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), 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 {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: contracts/IDividendPayingTokenOptional.sol
pragma solidity ^0.6.0;
/// @title Dividend-Paying Token Optional Interface
/// @author Roger Wu (https://github.com/roger-wu)
/// @dev OPTIONAL functions for a dividend-paying token contract.
interface IDividendPayingTokenOptional {
/// @notice View the amount of dividend in wei that an address can withdraw.
/// @param _owner The address of a token holder.
/// @return The amount of dividend in wei that `_owner` can withdraw.
function withdrawableDividendOf(address _owner) external view returns(uint256);
/// @notice View the amount of dividend in wei that an address has withdrawn.
/// @param _owner The address of a token holder.
/// @return The amount of dividend in wei that `_owner` has withdrawn.
function withdrawnDividendOf(address _owner) external view returns(uint256);
/// @notice View the amount of dividend in wei that an address has earned in total.
/// @dev accumulativeDividendOf(_owner) = withdrawableDividendOf(_owner) + withdrawnDividendOf(_owner)
/// @param _owner The address of a token holder.
/// @return The amount of dividend in wei that `_owner` has earned in total.
function accumulativeDividendOf(address _owner) external view returns(uint256);
}
// File: contracts/IDividendPayingToken.sol
pragma solidity ^0.6.0;
/// @title Dividend-Paying Token Interface
/// @author Roger Wu (https://github.com/roger-wu)
/// @dev An interface for a dividend-paying token contract.
interface IDividendPayingToken {
/// @notice View the amount of dividend in wei that an address can withdraw.
/// @param _owner The address of a token holder.
/// @return The amount of dividend in wei that `_owner` can withdraw.
function dividendOf(address _owner) external view returns(uint256);
/// @notice Distributes ether to token holders as dividends.
/// @dev SHOULD distribute the paid ether to token holders as dividends.
/// SHOULD NOT directly transfer ether to token holders in this function.
/// MUST emit a `DividendsDistributed` event when the amount of distributed ether is greater than 0.
function distributeDividends() external payable;
/// @notice Withdraws the ether distributed to the sender.
/// @dev SHOULD transfer `dividendOf(msg.sender)` wei to `msg.sender`, and `dividendOf(msg.sender)` SHOULD be 0 after the transfer.
/// MUST emit a `DividendWithdrawn` event if the amount of ether transferred is greater than 0.
function withdrawDividend() external;
/// @dev This event MUST emit when ether is distributed to token holders.
/// @param from The address which sends ether to this contract.
/// @param weiAmount The amount of distributed ether in wei.
event DividendsDistributed(
address indexed from,
uint256 weiAmount
);
/// @dev This event MUST emit when an address withdraws their dividend.
/// @param to The address which withdraws ether from this contract.
/// @param weiAmount The amount of withdrawn ether in wei.
event DividendWithdrawn(
address indexed to,
uint256 weiAmount
);
}
// File: contracts/SafeMathInt.sol
pragma solidity ^0.6.6;
/**
* @title SafeMathInt
* @dev Math operations with safety checks that revert on error
* @dev SafeMath adapted for int256
* Based on code of https://github.com/RequestNetwork/requestNetwork/blob/master/packages/requestNetworkSmartContracts/contracts/base/math/SafeMathInt.sol
*/
library SafeMathInt {
function mul(int256 a, int256 b) internal pure returns (int256) {
// Prevent overflow when multiplying INT256_MIN with -1
// https://github.com/RequestNetwork/requestNetwork/issues/43
require(!(a == - 2**255 && b == -1) && !(b == - 2**255 && a == -1));
int256 c = a * b;
require((b == 0) || (c / b == a));
return c;
}
function div(int256 a, int256 b) internal pure returns (int256) {
// Prevent overflow when dividing INT256_MIN by -1
// https://github.com/RequestNetwork/requestNetwork/issues/43
require(!(a == - 2**255 && b == -1) && (b > 0));
return a / b;
}
function sub(int256 a, int256 b) internal pure returns (int256) {
require((b >= 0 && a - b <= a) || (b < 0 && a - b > a));
return a - b;
}
function add(int256 a, int256 b) internal pure returns (int256) {
int256 c = a + b;
require((b >= 0 && c >= a) || (b < 0 && c < a));
return c;
}
function toUint256Safe(int256 a) internal pure returns (uint256) {
require(a >= 0);
return uint256(a);
}
}
// File: contracts/SafeMathUint.sol
pragma solidity ^0.6.6;
/**
* @title SafeMathUint
* @dev Math operations with safety checks that revert on error
*/
library SafeMathUint {
function toInt256Safe(uint256 a) internal pure returns (int256) {
int256 b = int256(a);
require(b >= 0);
return b;
}
}
// File: contracts/SafeMath.sol
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
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) {
// 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) {
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) {
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) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
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) {
if (a == 0) return 0;
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
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) {
require(b > 0, "SafeMath: modulo by zero");
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) {
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.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
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) {
require(b > 0, errorMessage);
return a % b;
}
}
// File: contracts/ERC20.sol
pragma solidity ^0.6.0;
/**
* @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 guidelines: functions revert instead
* of 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 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name_, string memory symbol_) public {
_name = name_;
_symbol = symbol_;
_decimals = 9;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual 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 {_setupDecimals} is
* called.
*
* 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 returns (uint8) {
return _decimals;
}
/**
* @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:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, 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}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), 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}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
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) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(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) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is 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:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, 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:
*
* - `to` 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 = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(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);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(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 Sets {decimals} to a value other than the default one of 18.
*
* WARNING: This function should only be called from the constructor. Most
* applications that interact with token contracts will not expect
* {decimals} to ever change, and may work incorrectly if it does.
*/
function _setupDecimals(uint8 decimals_) internal virtual {
_decimals = decimals_;
}
/**
* @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 to 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 { }
}
// File: contracts/DividendPayingToken.sol
pragma solidity ^0.6.6;
/// @title Dividend-Paying Token
/// @author Roger Wu (https://github.com/roger-wu)
/// @dev A mintable ERC20 token that allows anyone to pay and distribute ether
/// to token holders as dividends and allows token holders to withdraw their dividends.
/// Reference: the source code of PoWH3D: https://etherscan.io/address/0xB3775fB83F7D12A36E0475aBdD1FCA35c091efBe#code
contract DividendPayingToken is ERC20, IDividendPayingToken, IDividendPayingTokenOptional {
using SafeMath for uint256;
using SafeMathUint for uint256;
using SafeMathInt for int256;
// With `magnitude`, we can properly distribute dividends even if the amount of received ether is small.
// For more discussion about choosing the value of `magnitude`,
// see https://github.com/ethereum/EIPs/issues/1726#issuecomment-472352728
uint256 constant internal magnitude = 2**128;
uint256 internal magnifiedDividendPerShare;
uint256 internal lastAmount;
address public RVPToken = address(0x17EF75AA22dD5f6C2763b8304Ab24f40eE54D48a);
// About dividendCorrection:
// If the token balance of a `_user` is never changed, the dividend of `_user` can be computed with:
// `dividendOf(_user) = dividendPerShare * balanceOf(_user)`.
// When `balanceOf(_user)` is changed (via minting/burning/transferring tokens),
// `dividendOf(_user)` should not be changed,
// but the computed value of `dividendPerShare * balanceOf(_user)` is changed.
// To keep the `dividendOf(_user)` unchanged, we add a correction term:
// `dividendOf(_user) = dividendPerShare * balanceOf(_user) + dividendCorrectionOf(_user)`,
// where `dividendCorrectionOf(_user)` is updated whenever `balanceOf(_user)` is changed:
// `dividendCorrectionOf(_user) = dividendPerShare * (old balanceOf(_user)) - (new balanceOf(_user))`.
// So now `dividendOf(_user)` returns the same value before and after `balanceOf(_user)` is changed.
mapping(address => int256) internal magnifiedDividendCorrections;
mapping(address => uint256) internal withdrawnDividends;
uint256 public totalDividendsDistributed;
constructor(string memory _name, string memory _symbol) public ERC20(_name, _symbol) {
}
/// @dev Distributes dividends whenever ether is paid to this contract.
receive() external payable {
distributeDividends();
}
/// @notice Distributes ether to token holders as dividends.
/// @dev It reverts if the total supply of tokens is 0.
/// It emits the `DividendsDistributed` event if the amount of received ether is greater than 0.
/// About undistributed ether:
/// In each distribution, there is a small amount of ether not distributed,
/// the magnified amount of which is
/// `(msg.value * magnitude) % totalSupply()`.
/// With a well-chosen `magnitude`, the amount of undistributed ether
/// (de-magnified) in a distribution can be less than 1 wei.
/// We can actually keep track of the undistributed ether in a distribution
/// and try to distribute it in the next distribution,
/// but keeping track of such data on-chain costs much more than
/// the saved ether, so we don't do that.
function distributeDividends() public override payable {
require(totalSupply() > 0);
if (msg.value > 0) {
magnifiedDividendPerShare = magnifiedDividendPerShare.add(
(msg.value).mul(magnitude) / totalSupply()
);
emit DividendsDistributed(msg.sender, msg.value);
totalDividendsDistributed = totalDividendsDistributed.add(msg.value);
}
}
function distributeRVPDividends(uint256 amount) public {
require(totalSupply() > 0);
if (amount > 0) {
magnifiedDividendPerShare = magnifiedDividendPerShare.add(
(amount).mul(magnitude) / totalSupply()
);
emit DividendsDistributed(msg.sender, amount);
totalDividendsDistributed = totalDividendsDistributed.add(amount);
}
}
/// @notice Withdraws the ether distributed to the sender.
/// @dev It emits a `DividendWithdrawn` event if the amount of withdrawn ether is greater than 0.
function withdrawDividend() public virtual override {
_withdrawDividendOfUser(msg.sender);
}
/// @notice Withdraws the ether distributed to the sender.
/// @dev It emits a `DividendWithdrawn` event if the amount of withdrawn ether is greater than 0.
function _withdrawDividendOfUser(address payable user) internal returns (uint256) {
uint256 _withdrawableDividend = withdrawableDividendOf(user);
if (_withdrawableDividend > 0) {
withdrawnDividends[user] = withdrawnDividends[user].add(_withdrawableDividend);
emit DividendWithdrawn(user, _withdrawableDividend);
bool success = IERC20(RVPToken).transfer(user, _withdrawableDividend);
if(!success) {
withdrawnDividends[user] = withdrawnDividends[user].sub(_withdrawableDividend);
return 0;
}
return _withdrawableDividend;
}
return 0;
}
/// @notice View the amount of dividend in wei that an address can withdraw.
/// @param _owner The address of a token holder.
/// @return The amount of dividend in wei that `_owner` can withdraw.
function dividendOf(address _owner) public view override returns(uint256) {
return withdrawableDividendOf(_owner);
}
/// @notice View the amount of dividend in wei that an address can withdraw.
/// @param _owner The address of a token holder.
/// @return The amount of dividend in wei that `_owner` can withdraw.
function withdrawableDividendOf(address _owner) public view override returns(uint256) {
return accumulativeDividendOf(_owner).sub(withdrawnDividends[_owner]);
}
/// @notice View the amount of dividend in wei that an address has withdrawn.
/// @param _owner The address of a token holder.
/// @return The amount of dividend in wei that `_owner` has withdrawn.
function withdrawnDividendOf(address _owner) public view override returns(uint256) {
return withdrawnDividends[_owner];
}
/// @notice View the amount of dividend in wei that an address has earned in total.
/// @dev accumulativeDividendOf(_owner) = withdrawableDividendOf(_owner) + withdrawnDividendOf(_owner)
/// = (magnifiedDividendPerShare * balanceOf(_owner) + magnifiedDividendCorrections[_owner]) / magnitude
/// @param _owner The address of a token holder.
/// @return The amount of dividend in wei that `_owner` has earned in total.
function accumulativeDividendOf(address _owner) public view override returns(uint256) {
return magnifiedDividendPerShare.mul(balanceOf(_owner)).toInt256Safe()
.add(magnifiedDividendCorrections[_owner]).toUint256Safe() / magnitude;
}
/// @dev Internal function that transfer tokens from one address to another.
/// Update magnifiedDividendCorrections to keep dividends unchanged.
/// @param from The address to transfer from.
/// @param to The address to transfer to.
/// @param value The amount to be transferred.
function _transfer(address from, address to, uint256 value) internal virtual override {
require(false);
int256 _magCorrection = magnifiedDividendPerShare.mul(value).toInt256Safe();
magnifiedDividendCorrections[from] = magnifiedDividendCorrections[from].add(_magCorrection);
magnifiedDividendCorrections[to] = magnifiedDividendCorrections[to].sub(_magCorrection);
}
/// @dev Internal function that mints tokens to an account.
/// Update magnifiedDividendCorrections to keep dividends unchanged.
/// @param account The account that will receive the created tokens.
/// @param value The amount that will be created.
function _mint(address account, uint256 value) internal override {
super._mint(account, value);
magnifiedDividendCorrections[account] = magnifiedDividendCorrections[account]
.sub( (magnifiedDividendPerShare.mul(value)).toInt256Safe() );
}
/// @dev Internal function that burns an amount of the token of a given account.
/// Update magnifiedDividendCorrections to keep dividends unchanged.
/// @param account The account whose tokens will be burnt.
/// @param value The amount that will be burnt.
function _burn(address account, uint256 value) internal override {
super._burn(account, value);
magnifiedDividendCorrections[account] = magnifiedDividendCorrections[account]
.add( (magnifiedDividendPerShare.mul(value)).toInt256Safe() );
}
function _setBalance(address account, uint256 newBalance) internal {
uint256 currentBalance = balanceOf(account);
if(newBalance > currentBalance) {
uint256 mintAmount = newBalance.sub(currentBalance);
_mint(account, mintAmount);
} else if(newBalance < currentBalance) {
uint256 burnAmount = currentBalance.sub(newBalance);
_burn(account, burnAmount);
}
}
}
// File: contracts/YukonToken.sol
pragma solidity ^0.6.6;
contract YUKON is ERC20, Ownable {
using SafeMath for uint256;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
address public RVPToken = address(0x17EF75AA22dD5f6C2763b8304Ab24f40eE54D48a);
bool private swapping;
YUKONDividendTracker public dividendTracker;
address public liquidityWallet;
address public deadWallet = 0x000000000000000000000000000000000000dEaD;
uint256 public swapTokensAtAmount = 1000000000 * (10**9);
uint256 public maxBuyTranscationAmount = 10000000000 * (10**9); // 1% of total supply
uint256 public maxWalletToken = 20000000000 * (10**9); // 2% of total supply
mapping(address => bool) public _isBlacklisted;
uint256 public RVPRewardsFee = 6;
uint256 public liquidityFee = 3;
uint256 public marketingFee = 6;
uint256 public totalFees = RVPRewardsFee.add(liquidityFee).add(marketingFee);
address payable public marketingWallet = 0xFa8FDBE40829a77b87c81dB514F7E79EFA6CB4A2;
// use by default 300,000 gas to process auto-claiming dividends
uint256 public gasForProcessing = 300000;
// exlcude from fees and max transaction amount
mapping (address => bool) private _isExcludedFromFees;
// 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 UpdateDividendTracker(address indexed newAddress, address indexed oldAddress);
event UpdateUniswapV2Router(address indexed newAddress, address indexed oldAddress);
event ExcludeFromFees(address indexed account, bool isExcluded);
event ExcludeMultipleAccountsFromFees(address[] accounts, bool isExcluded);
event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);
event LiquidityWalletUpdated(address indexed newLiquidityWallet, address indexed oldLiquidityWallet);
event GasForProcessingUpdated(uint256 indexed newValue, uint256 indexed oldValue);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiqudity
);
event SendDividends(
uint256 tokensSwapped,
uint256 amount
);
event ProcessedDividendTracker(
uint256 iterations,
uint256 claims,
uint256 lastProcessedIndex,
bool indexed automatic,
uint256 gas,
address indexed processor
);
constructor() public ERC20("YUKON", "YUKON") {
dividendTracker = new YUKONDividendTracker();
liquidityWallet = owner();
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
// Create a uniswap pair for this new to...
// [truncated — 71571 bytes total]
Read Contract
RVPRewardsFee 0x1da3da70 → uint256
RVPToken 0x20e48f00 → address
_isBlacklisted 0x1cdd3be3 → bool
allowance 0xdd62ed3e → uint256
automatedMarketMakerPairs 0xb62496f5 → bool
balanceOf 0x70a08231 → uint256
deadWallet 0x85141a77 → address
decimals 0x313ce567 → uint8
dividendTokenBalanceOf 0x6843cd84 → uint256
dividendTracker 0x2c1f5216 → address
gasForProcessing 0x9c1b8af5 → uint256
getAccountDividendsInfo 0xad56c13c → address, int256, int256, uint256, uint256, uint256, uint256, uint256
getAccountDividendsInfoAtIndex 0xf27fd254 → address, int256, int256, uint256, uint256, uint256, uint256, uint256
getClaimWait 0xa26579ad → uint256
getLastProcessedIndex 0xe7841ec0 → uint256
getNumberOfDividendTokenHolders 0x64b0f653 → uint256
getTotalDividendsDistributed 0x30bb4cff → uint256
isExcludedFromFees 0x4fbee193 → bool
isExcludedFromRewards 0x0e832273 → bool
liquidityFee 0x98118cb4 → uint256
liquidityWallet 0xd4698016 → address
marketingFee 0x6b67c4df → uint256
marketingWallet 0x75f0a874 → address
maxBuyTranscationAmount 0xa6b63888 → uint256
maxWalletToken 0xe6c75f71 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
swapTokensAtAmount 0xe2f45605 → uint256
symbol 0x95d89b41 → string
totalFees 0x13114a9d → uint256
totalSupply 0x18160ddd → uint256
uniswapV2Pair 0x49bd5a5e → address
uniswapV2Router 0x1694505e → address
withdrawableDividendOf 0xa8b9d240 → uint256
Write Contract 29 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
blacklistAddress 0x455a4396
address account
bool value
bulksendToken 0x1d5431bb
address[] _to
uint256[] _values
changeMarketingWallet 0xbb85c6d1
address newAddress
changeSwapTokensAtAmount 0x09d6bf0a
uint256 newAmount
claim 0x4e71d92d
No parameters
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
emergencyWithdraw 0xdb2e21bc
No parameters
excludeFromFees 0xc0246668
address account
bool excluded
excludeFromRewards 0x111e0376
address account
excludeMultipleAccountsFromFees 0xc492f046
address[] accounts
bool excluded
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
processDividendTracker 0x700bb191
uint256 gas
renounceOwnership 0x715018a6
No parameters
setAutomatedMarketMakerPair 0x9a7a23d6
address pair
bool value
setLiquidityFee 0x357bf15c
uint256 newLiquidityFee
setMarketingFee 0x625e764c
uint256 newMarketingFee
setMaxBuyTransaction 0xb3b5e043
uint256 maxTxn
setMaxWalletToken 0x91d55f41
uint256 maxToken
setMinTokenBalForDividends 0x9ff0fe54
uint256 newTokenBalForDividends
setRVPRewardsFee 0x2bd5201c
uint256 newRVPRewardsFee
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
updateClaimWait 0xe98030c7
uint256 claimWait
updateDividendTracker 0x88bdd9be
address newAddress
updateGasForProcessing 0x871c128d
uint256 newValue
updateLiquidityWallet 0xe37ba8f9
address newLiquidityWallet
updateUniswapV2Router 0x65b8dbc0
address newAddress
Recent Transactions
No transactions found for this address