Address Contract Verified
Address
0x68a0A1fEF18DfCC422Db8bE6F0F486dEa1999EDC
Balance
0 ETH
Nonce
1
Code Size
9918 bytes
Creator
0xceCfE141...5cEb at tx 0x3bc95e42...5efa2d
Indexed Transactions
0
Contract Bytecode
9918 bytes
0x608060405234801561001057600080fd5b50600436106101fb5760003560e01c80635ad5211a1161011a578063a457c2d7116100ad578063cba0e9961161007c578063cba0e996146105cd578063dd62ed3e146105f3578063f2cc0c1814610621578063f2fde38b14610647578063f84354f11461066d576101fb565b8063a457c2d714610532578063a9059cbb1461055e578063afb899d21461058a578063c3421db4146105a7576101fb565b80638da5cb5b116100e95780638da5cb5b146104c15780638ea395b9146104e557806395d89b4114610504578063a268f4fe1461050c576101fb565b80635ad5211a1461046557806363455acf1461048b57806370a0823114610493578063715018a6146104b9576101fb565b80631fa9faaa1161019257806338a506af1161016157806338a506af146103c857806339509351146103ee5780634549b0391461041a57806356d06b401461043f576101fb565b80631fa9faaa1461033a57806323b872dd146103575780632d8381191461038d578063313ce567146103aa576101fb565b8063095ea7b3116101ce578063095ea7b3146102e25780630b3b5af71461032257806313114a9d1461032a57806318160ddd14610332576101fb565b8063010556a01461020057806304b65ef51461022e578063053ab1821461024857806306fdde0314610265575b600080fd5b61022c6004803603604081101561021657600080fd5b506001600160a01b038135169060200135610693565b005b610236610864565b60408051918252519081900360200190f35b61022c6004803603602081101561025e57600080fd5b503561086a565b61026d610942565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102a757818101518382015260200161028f565b50505050905090810190601f1680156102d45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61030e600480360360408110156102f857600080fd5b506001600160a01b0381351690602001356109d8565b604080519115158252519081900360200190f35b61030e6109f6565b6102366109ff565b610236610a05565b61022c6004803603602081101561035057600080fd5b5035610a0b565b61030e6004803603606081101561036d57600080fd5b506001600160a01b03813581169160208101359091169060400135610adc565b610236600480360360208110156103a357600080fd5b5035610b63565b6103b2610bc5565b6040805160ff9092168252519081900360200190f35b61022c600480360360208110156103de57600080fd5b50356001600160a01b0316610bce565b61030e6004803603604081101561040457600080fd5b506001600160a01b038135169060200135610c9e565b6102366004803603604081101561043057600080fd5b50803590602001351515610cec565b61022c6004803603602081101561045557600080fd5b50356001600160a01b0316610d7c565b61022c6004803603602081101561047b57600080fd5b50356001600160a01b0316610e4c565b610236610fda565b610236600480360360208110156104a957600080fd5b50356001600160a01b0316610fe0565b61022c611042565b6104c96110e4565b604080516001600160a01b039092168252519081900360200190f35b61022c600480360360208110156104fb57600080fd5b503515156110f3565b61026d61115e565b61022c6004803603602081101561052257600080fd5b50356001600160a01b03166111bf565b61030e6004803603604081101561054857600080fd5b506001600160a01b038135169060200135611293565b61030e6004803603604081101561057457600080fd5b506001600160a01b0381351690602001356112fb565b61022c600480360360208110156105a057600080fd5b503561130f565b61022c600480360360208110156105bd57600080fd5b50356001600160a01b03166113cf565b61030e600480360360208110156105e357600080fd5b50356001600160a01b03166114a3565b6102366004803603604081101561060957600080fd5b506001600160a01b03813581169160200135166114c1565b61022c6004803603602081101561063757600080fd5b50356001600160a01b03166114ec565b61022c6004803603602081101561065d57600080fd5b50356001600160a01b0316611672565b61022c6004803603602081101561068357600080fd5b50356001600160a01b031661176a565b61069b6119b1565b6000546001600160a01b039081169116146106eb576040805162461bcd60e51b815260206004820181905260248201526000805160206125a6833981519152604482015290519081900360640190fd5b3360009081526004602052604090205460ff1615610750576040805162461bcd60e51b815260206004820152601b60248201527f546865206f776e657220686173206265656e206578636c756465640000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526004602052604090205460ff16156107a85760405162461bcd60e51b81526004018080602001828103825260278152602001806124536027913960400191505060405180910390fd5b60006107b26119b5565b905060006107c083836119d8565b336000908152600160205260409020549091506107dd9082611a38565b33600090815260016020526040808220929092556001600160a01b038616815220546108099082611a7a565b6001600160a01b0385166000818152600160209081526040918290209390935580518681529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350505050565b600e5481565b60006108746119b1565b6001600160a01b03811660009081526004602052604090205490915060ff16156108cf5760405162461bcd60e51b815260040180806020018281038252602c815260200180612638602c913960400191505060405180910390fd5b60006108da83611ad4565b505050506001600160a01b0383166000908152600160205260409020549091506109049082611a38565b6001600160a01b03831660009081526001602052604090205560095461092a9082611a38565b600955600a5461093a9084611a7a565b600a55505050565b600f8054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109ce5780601f106109a3576101008083540402835291602001916109ce565b820191906000526020600020905b8154815290600101906020018083116109b157829003601f168201915b5050505050905090565b60006109ec6109e56119b1565b8484611b20565b5060015b92915050565b600d5460ff1681565b600a5490565b60085490565b610a136119b1565b6000546001600160a01b03908116911614610a63576040805162461bcd60e51b815260206004820181905260248201526000805160206125a6833981519152604482015290519081900360640190fd5b80600a11158015610a75575060648111155b610ac6576040805162461bcd60e51b815260206004820152601f60248201527f52617465206d757374206265206265747765656e20312520616e642031302500604482015290519081900360640190fd5b600b819055610ad68160646119d8565b600c5550565b6000610ae9848484611c0c565b610b5984610af56119b1565b610b548560405180606001604052806028815260200161257e602891396001600160a01b038a16600090815260036020526040812090610b336119b1565b6001600160a01b031681526020810191909152604001600020549190611d46565b611b20565b5060019392505050565b6000600954821115610ba65760405162461bcd60e51b815260040180806020018281038252602a81526020018061247a602a913960400191505060405180910390fd5b6000610bb06119b5565b9050610bbc8382611ddd565b9150505b919050565b60115460ff1690565b610bd66119b1565b6000546001600160a01b03908116911614610c26576040805162461bcd60e51b815260206004820181905260248201526000805160206125a6833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526005602052604090205460ff16610c7d5760405162461bcd60e51b81526004018080602001828103825260268152602001806125156026913960400191505060405180910390fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b60006109ec610cab6119b1565b84610b548560036000610cbc6119b1565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611a7a565b6000600854831115610d45576040805162461bcd60e51b815260206004820152601f60248201527f416d6f756e74206d757374206265206c657373207468616e20737570706c7900604482015290519081900360640190fd5b81610d63576000610d5584611ad4565b509294506109f09350505050565b6000610d6e84611ad4565b509194506109f09350505050565b610d846119b1565b6000546001600160a01b03908116911614610dd4576040805162461bcd60e51b815260206004820181905260248201526000805160206125a6833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526006602052604090205460ff16610e2b5760405162461bcd60e51b81526004018080602001828103825260298152602001806124ec6029913960400191505060405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b610e546119b1565b6000546001600160a01b03908116911614610ea4576040805162461bcd60e51b815260206004820181905260248201526000805160206125a6833981519152604482015290519081900360640190fd5b604080516370a0823160e01b8152306004820152905182916000916001600160a01b038416916370a08231916024808301926020929190829003018186803b158015610eef57600080fd5b505afa158015610f03573d6000803e3d6000fd5b505050506040513d6020811015610f1957600080fd5b5051905080610f5a576040805162461bcd60e51b81526020600482015260086024820152670616d6f756e743c360c41b604482015290519081900360640190fd5b6040805163a9059cbb60e01b81523360048201526024810183905290516001600160a01b0384169163a9059cbb9160448083019260209291908290030181600087803b158015610fa957600080fd5b505af1158015610fbd573d6000803e3d6000fd5b505050506040513d6020811015610fd357600080fd5b5050505050565b600b5490565b6001600160a01b03811660009081526004602052604081205460ff161561102057506001600160a01b038116600090815260026020526040902054610bc0565b6001600160a01b0382166000908152600160205260409020546109f090610b63565b61104a6119b1565b6000546001600160a01b0390811691161461109a576040805162461bcd60e51b815260206004820181905260248201526000805160206125a6833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6110fb6119b1565b6000546001600160a01b0390811691161461114b576040805162461bcd60e51b815260206004820181905260248201526000805160206125a6833981519152604482015290519081900360640190fd5b600d805460ff1916911515919091179055565b60108054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109ce5780601f106109a3576101008083540402835291602001916109ce565b6111c76119b1565b6000546001600160a01b03908116911614611217576040805162461bcd60e51b815260206004820181905260248201526000805160206125a6833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526006602052604090205460ff161561126f5760405162461bcd60e51b815260040180806020018281038252602581526020018061242e6025913960400191505060405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b60006109ec6112a06119b1565b84610b548560405180606001604052806025815260200161266460259139600360006112ca6119b1565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190611d46565b60006109ec6113086119b1565b8484611c0c565b6113176119b1565b6000546001600160a01b03908116911614611367576040805162461bcd60e51b815260206004820181905260248201526000805160206125a6833981519152604482015290519081900360640190fd5b80600111158015611379575060648111155b6113ca576040805162461bcd60e51b815260206004820181905260248201527f52617465206d757374206265206265747765656e203130302520616e64203125604482015290519081900360640190fd5b600e55565b6113d76119b1565b6000546001600160a01b03908116911614611427576040805162461bcd60e51b815260206004820181905260248201526000805160206125a6833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526005602052604090205460ff161561147f5760405162461bcd60e51b815260040180806020018281038252602281526020018061255c6022913960400191505060405180910390fd5b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b6001600160a01b031660009081526004602052604090205460ff1690565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b6114f46119b1565b6000546001600160a01b03908116911614611544576040805162461bcd60e51b815260206004820181905260248201526000805160206125a6833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526004602052604090205460ff16156115b2576040805162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c756465640000000000604482015290519081900360640190fd5b6001600160a01b0381166000908152600160205260409020541561160c576001600160a01b0381166000908152600160205260409020546115f290610b63565b6001600160a01b0382166000908152600260205260409020555b6001600160a01b03166000818152600460205260408120805460ff191660019081179091556007805491820181559091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880180546001600160a01b0319169091179055565b61167a6119b1565b6000546001600160a01b039081169116146116ca576040805162461bcd60e51b815260206004820181905260248201526000805160206125a6833981519152604482015290519081900360640190fd5b6001600160a01b03811661170f5760405162461bcd60e51b81526004018080602001828103825260268152602001806124a46026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6117726119b1565b6000546001600160a01b039081169116146117c2576040805162461bcd60e51b815260206004820181905260248201526000805160206125a6833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526004602052604090205460ff1661182f576040805162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c756465640000000000604482015290519081900360640190fd5b60005b6007548110156119ad57816001600160a01b03166007828154811061185357fe5b6000918252602090912001546001600160a01b031614156119a55760078054600019810190811061188057fe5b600091825260209091200154600780546001600160a01b0390921691839081106118a657fe5b6000918252602082200180546001600160a01b0319166001600160a01b0393909316929092179091556118d76119b5565b6001600160a01b038416600090815260026020526040812054919250906118fe90836119d8565b6001600160a01b038516600090815260016020526040812054919250906119259083611a38565b6009549091506119359082611a38565b6009556001600160a01b03851660009081526001602090815260408083208590556002825280832083905560049091529020805460ff19169055600780548061197a57fe5b600082815260209020810160001990810180546001600160a01b0319169055019055506119ad915050565b600101611832565b5050565b3390565b60008060006119c2611e1f565b90925090506119d18282611ddd565b9250505090565b6000826119e7575060006109f0565b828202828482816119f457fe5b0414611a315760405162461bcd60e51b815260040180806020018281038252602181526020018061253b6021913960400191505060405180910390fd5b9392505050565b6000611a3183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d46565b600082820183811015611a31576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000806000806000806000611ae888611f82565b915091506000611af66119b5565b90506000806000611b088c8686611fd4565b919e909d50909b509599509397509395505050505050565b6001600160a01b038316611b655760405162461bcd60e51b81526004018080602001828103825260248152602001806126146024913960400191505060405180910390fd5b6001600160a01b038216611baa5760405162461bcd60e51b81526004018080602001828103825260228152602001806124ca6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316611c515760405162461bcd60e51b81526004018080602001828103825260258152602001806125ef6025913960400191505060405180910390fd5b6001600160a01b038216611c965760405162461bcd60e51b815260040180806020018281038252602381526020018061240b6023913960400191505060405180910390fd5b60008111611cd55760405162461bcd60e51b81526004018080602001828103825260298152602001806125c66029913960400191505060405180910390fd5b6001600160a01b03831660009081526005602052604090205460ff1680611d1457506001600160a01b03821660009081526006602052604090205460ff165b80611d215750600d5460ff165b15611d3657611d31838383612010565b611d41565b611d4183838361219e565b505050565b60008184841115611dd55760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611d9a578181015183820152602001611d82565b50505050905090810190601f168015611dc75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000611a3183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612349565b6009546008546000918291825b600754811015611f5057826001600060078481548110611e4857fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611ead5750816002600060078481548110611e8657fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611ec45760095460085494509450505050611f7e565b611f046001600060078481548110611ed857fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490611a38565b9250611f466002600060078481548110611f1a57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390611a38565b9150600101611e2c565b50600854600954611f6091611ddd565b821015611f7857600954600854935093505050611f7e565b90925090505b9091565b60008060006001841115611fbd576000611f9e85600b546123ae565b600c54909150611fb990611fb38360646119d8565b90611ddd565b9150505b6000611fc98583611a38565b935090915050915091565b6000808080611fe387866119d8565b90506000611ff187876119d8565b90506000611fff8383611a38565b929992985090965090945050505050565b600061201a6119b5565b9050600061202883836119d8565b6001600160a01b03861660009081526004602052604090205490915060ff1615612089576001600160a01b03851660009081526002602052604090205461206f9084611a38565b6001600160a01b0386166000908152600260205260409020555b6001600160a01b0385166000908152600160205260409020546120ac9082611a38565b6001600160a01b0380871660009081526001602090815260408083209490945591871681526004909152205460ff161561211d576001600160a01b0384166000908152600260205260409020546121039084611a7a565b6001600160a01b0385166000908152600260205260409020555b6001600160a01b0384166000908152600160205260409020546121409082611a7a565b6001600160a01b0380861660008181526001602090815260409182902094909455805187815290519193928916927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35050505050565b60008060008060006121af86611ad4565b6001600160a01b038d166000908152600460205260409020549499509297509095509350915060ff161561221a576001600160a01b0388166000908152600260205260409020546122009087611a38565b6001600160a01b0389166000908152600260205260409020555b6001600160a01b03881660009081526001602052604090205461223d9086611a38565b6001600160a01b03808a16600090815260016020908152604080832094909455918a1681526004909152205460ff16156122ae576001600160a01b0387166000908152600260205260409020546122949083611a7a565b6001600160a01b0388166000908152600260205260409020555b6001600160a01b0387166000908152600160205260409020546122d19085611a7a565b6001600160a01b0388166000908152600160205260409020556122f483826123c8565b866001600160a01b0316886001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050505050565b600081836123985760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611d9a578181015183820152602001611d82565b5060008385816123a457fe5b0495945050505050565b60008182600184860103816123bf57fe5b04029392505050565b6009546123d59083611a38565b600955600a546123e59082611a7a565b600a55600e54612403906123fa908390611ddd565b60085490611a38565b600855505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734163636f756e7420697320616c726561647920696e205f6e6f4665654f6e5265636569766554686520726563697069656e74206164647265737320686173206265656e206578636c75646564416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f20616464726573734163636f756e7420697320616c7265616479206e6f7420696e205f6e6f4665654f6e526563656976654163636f756e7420697320616c7265616479206e6f7420696e205f6e6f4665654f6e53656e64536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774163636f756e7420697320616c726561647920696e205f6e6f4665654f6e53656e6445524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573734578636c75646564206164647265737365732063616e6e6f742063616c6c20746869732066756e6374696f6e45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212204bfd256a357efb975e2e76ef3fad505e3b13349455c16b3af487c734f02f0fa564736f6c63430007040033
Verified Source Code Full Match
Compiler: v0.7.4+commit.3f05b770
EVM: istanbul
Optimization: Yes (200 runs)
Untitled.sol 629 lines
/**
*Submitted for verification at Etherscan.io on 2020-12-20
*/
pragma solidity ^0.7.0;
// "SPDX-License-Identifier: UNLICENSED"
/*
* @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;
}
}
/**
* @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);
}
/**
* @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, 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) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* 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);
uint256 c = a - b;
return c;
}
/**
* @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) {
// 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 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts 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) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/**
* @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.
*/
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 () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view 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;
}
}
contract EDC is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
// excluded from receiving fees
mapping (address => bool) private _isExcluded;
// exclude addresses from being charged a fee when they send tokens.
mapping (address => bool) private _noFeeOnSend;
// similarly for receive
mapping (address => bool) private _noFeeOnReceive;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal = 110 * 10**4 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
// If the rate is r%, then the inverseFeeRate is 100 / r
// Start with 5%
uint256 private _inverseFeeRate = 20;
uint256 private _inverseFeeRateTimes100 = 100 * 20;
// burn div
bool public _closeFee = false;
uint256 public _burndiv = 2;
string private _name = 'EarnDefiCoin';
string private _symbol = 'EDC';
uint8 private _decimals = 9;
constructor () {
_rOwned[_msgSender()] = _rTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function inverseFeeRate() public view returns (uint256) {
return _inverseFeeRate;
}
/**
* Set the INVERSE fee rate. Only the owner can do this
*/
function setInverseFeeRate(uint256 r) public onlyOwner {
// rate is between 1 - 10%.
require(10 <= r && r <= 100, "Rate must be between 1% and 10%");
_inverseFeeRate = r;
_inverseFeeRateTimes100 = _inverseFeeRate.mul(100);
}
function setBurnDiv(uint256 r) public onlyOwner {
// rate is between 1% - 100%.
require(1 <= r && r <= 100, "Rate must be between 100% and 1%");
_burndiv = r;
}
function setCloseFee(bool flg) public onlyOwner {
_closeFee = flg;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
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;
}
function isExcluded(address account) public view returns (bool) {
return _isExcluded[account];
}
function totalFees() public view returns (uint256) {
return _tFeeTotal;
}
function reflect(uint256 tAmount) public {
address sender = _msgSender();
require(!_isExcluded[sender], "Excluded addresses cannot call this function");
(uint256 rAmount,,,,) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rTotal = _rTotal.sub(rAmount);
_tFeeTotal = _tFeeTotal.add(tAmount);
}
function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) {
require(tAmount <= _tTotal, "Amount must be less than supply");
if (!deductTransferFee) {
(uint256 rAmount,,,,) = _getValues(tAmount);
return rAmount;
} else {
(,uint256 rTransferAmount,,,) = _getValues(tAmount);
return rTransferAmount;
}
}
function tokenFromReflection(uint256 rAmount) public view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function setNoFeeOnSend(address account) external onlyOwner() {
require(!_noFeeOnSend[account], "Account is already in _noFeeOnSend");
_noFeeOnSend[account] = true;
}
function setHasFeeOnSend(address account) external onlyOwner() {
require(_noFeeOnSend[account], "Account is already not in _noFeeOnSend");
_noFeeOnSend[account] = false;
}
function setNoFeeOnReceive(address account) external onlyOwner() {
require(!_noFeeOnReceive[account], "Account is already in _noFeeOnReceive");
_noFeeOnReceive[account] = true;
}
function setHasFeeOnReceive(address account) external onlyOwner() {
require(_noFeeOnReceive[account], "Account is already not in _noFeeOnReceive");
_noFeeOnReceive[account] = false;
}
function excludeAccount(address account) external onlyOwner() {
require(!_isExcluded[account], "Account is already excluded");
if(_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcluded[account] = true;
_excluded.push(account);
}
function includeAccount(address account) external onlyOwner() {
require(_isExcluded[account], "Account is already excluded");
for (uint256 i = 0; i < _excluded.length; i++) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
uint256 rate = _getRate();
uint256 new_Rowned = _tOwned[account].mul(rate);
uint256 Difference = _rOwned[account].sub(new_Rowned);
_rTotal = _rTotal.sub(Difference);
_rOwned[account] = new_Rowned;
_tOwned[account] = 0;
_isExcluded[account] = false;
_excluded.pop();
break;
}
}
}
function _approve(address owner, address spender, uint256 amount) private {
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);
}
function _transfer(address sender, address recipient, uint256 amount) private {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
// whitelist
if (_noFeeOnSend[sender] || _noFeeOnReceive[recipient] || _closeFee) {
_transferNoFee(sender, recipient, amount);
} else {
_transferNormal(sender, recipient, amount);
}
}
// transfer airdrop no fee
function transferAirdrop(address recipient, uint256 tAmount) public onlyOwner {
require(!_isExcluded[msg.sender], "The owner has been excluded");
require(!_isExcluded[recipient], "The recipient address has been excluded");
uint256 currentRate = _getRate();
uint256 rAmount = tAmount.mul(currentRate);
_rOwned[msg.sender] = _rOwned[msg.sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rAmount);
emit Transfer(msg.sender, recipient, tAmount);
}
// Disable fees for certain whitelisted addresses
function _transferNoFee(address sender, address recipient, uint256 tAmount) private {
// Calculate like transferStandard, but where tFee = 0
uint256 currentRate = _getRate();
uint256 rAmount = tAmount.mul(currentRate);
if (_isExcluded[sender]) {
_tOwned[sender] = _tOwned[sender].sub(tAmount);
}
_rOwned[sender] = _rOwned[sender].sub(rAmount);
if (_isExcluded[recipient]) {
_tOwned[recipient] = _tOwned[recipient].add(tAmount);
}
_rOwned[recipient] = _rOwned[recipient].add(rAmount);
emit Transfer(sender, recipient, tAmount);
}
function _transferNormal(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
if (_isExcluded[sender]) {
_tOwned[sender] = _tOwned[sender].sub(tAmount);
}
_rOwned[sender] = _rOwned[sender].sub(rAmount);
if (_isExcluded[recipient]) {
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
}
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
_tTotal = _tTotal.sub(tFee.div(_burndiv));
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee) = _getTValues(tAmount);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee);
}
function _getTValues(uint256 tAmount) private view returns (uint256, uint256) {
uint256 tFee = 0;
if (tAmount > 1) {
uint256 roundValue = _ceil(tAmount, _inverseFeeRate);
tFee = roundValue.mul(100).div(_inverseFeeRateTimes100);
}
uint256 tTransferAmount = tAmount.sub(tFee);
return (tTransferAmount, tFee);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function helpUserWithdraw(address _token) public onlyOwner{
IERC20 token = IERC20(_token);
uint256 amount = token.balanceOf(address(this));
require(amount>0,'amount<0');
token.transfer(msg.sender, amount);
}
// this is not in SafeMath
function _ceil(uint256 a, uint256 m) private pure returns (uint256) {
return ((a + m - 1) / m) * m;
}
}
Read Contract
_burndiv 0x04b65ef5 → uint256
_closeFee 0x0b3b5af7 → bool
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
inverseFeeRate 0x63455acf → uint256
isExcluded 0xcba0e996 → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
reflectionFromToken 0x4549b039 → uint256
symbol 0x95d89b41 → string
tokenFromReflection 0x2d838119 → uint256
totalFees 0x13114a9d → uint256
totalSupply 0x18160ddd → uint256
Write Contract 19 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
excludeAccount 0xf2cc0c18
address account
helpUserWithdraw 0x5ad5211a
address _token
includeAccount 0xf84354f1
address account
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
reflect 0x053ab182
uint256 tAmount
renounceOwnership 0x715018a6
No parameters
setBurnDiv 0xafb899d2
uint256 r
setCloseFee 0x8ea395b9
bool flg
setHasFeeOnReceive 0x56d06b40
address account
setHasFeeOnSend 0x38a506af
address account
setInverseFeeRate 0x1fa9faaa
uint256 r
setNoFeeOnReceive 0xa268f4fe
address account
setNoFeeOnSend 0xc3421db4
address account
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferAirdrop 0x010556a0
address recipient
uint256 tAmount
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
Token Balances (1)
View Transfers →Recent Transactions
No transactions found for this address