Address Contract Verified
Address
0x45B337e8f0f36e8D69c0d1242eFEad64D1f31972
Balance
0 ETH
Nonce
1
Code Size
16012 bytes
Creator
0xc3c39e69...1578 at tx 0x99600526...f90d95
Indexed Transactions
0
Contract Bytecode
16012 bytes
0x608060405234801561001057600080fd5b50600436106101e1576000357c0100000000000000000000000000000000000000000000000000000000900480638384005211610116578063a9059cbb116100b4578063d7b96d4e1161008e578063d7b96d4e146106dc578063dd62ed3e146106e4578063f2fde38b14610712578063f70c12d314610738576101e1565b8063a9059cbb146106a0578063bac15203146106cc578063d1600df5146106d4576101e1565b80638e6e9e22116100f05780638e6e9e22146105b757806393018547146105e657806395d89b411461066c578063a457c2d714610674576101e1565b8063838400521461052f5780638978a49b1461055e5780638da5cb5b14610593576101e1565b806342e219751161018357806352985d2a1161015d57806352985d2a146104345780635c975abb146104f957806370a0823114610501578063715018a614610527576101e1565b806342e2197514610365578063439766ce1461036d5780634571e3a614610375576101e1565b806318160ddd116101bf57806318160ddd146102cb57806323b872dd146102e5578063313ce5671461031b5780633950935114610339576101e1565b806306fdde03146101e6578063095ea7b314610263578063171060ec146102a3575b600080fd5b6101ee610767565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610228578181015183820152602001610210565b50505050905090810190601f1680156102555780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61028f6004803603604081101561027957600080fd5b50600160a060020a0381351690602001356107fe565b604080519115158252519081900360200190f35b6102c9600480360360208110156102b957600080fd5b5035600160a060020a031661081c565b005b6102d36108b0565b60408051918252519081900360200190f35b61028f600480360360608110156102fb57600080fd5b50600160a060020a038135811691602081013590911690604001356108b6565b610323610943565b6040805160ff9092168252519081900360200190f35b61028f6004803603604081101561034f57600080fd5b50600160a060020a03813516906020013561094c565b6101ee6109a0565b6102c9610a2e565b6102c96004803603606081101561038b57600080fd5b600160a060020a0382358116926020810135909116918101906060810160408201356401000000008111156103bf57600080fd5b8201836020820111156103d157600080fd5b803590602001918460018302840111640100000000831117156103f357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610a9d945050505050565b61028f6004803603606081101561044a57600080fd5b81019060208101813564010000000081111561046557600080fd5b82018360208201111561047757600080fd5b8035906020019184602083028401116401000000008311171561049957600080fd5b9193909290916020810190356401000000008111156104b757600080fd5b8201836020820111156104c957600080fd5b803590602001918460208302840111640100000000831117156104eb57600080fd5b91935091503560ff166116d6565b61028f611997565b6102d36004803603602081101561051757600080fd5b5035600160a060020a03166119a0565b6102c96119bb565b6102d36004803603604081101561054557600080fd5b508035600160a060020a0316906020013560ff16611a77565b61028f6004803603606081101561057457600080fd5b50600160a060020a038135169060ff6020820135169060400135611e1f565b61059b612231565b60408051600160a060020a039092168252519081900360200190f35b61028f600480360360408110156105cd57600080fd5b508035600160a060020a0316906020013560ff16612240565b610615600480360360408110156105fc57600080fd5b508035600160a060020a0316906020013560ff166125c0565b6040805160ff9a8b16815260208101999099528881019790975260608801959095529287166080870152951660a085015260c084019490945292151560e08301529115156101008201529051908190036101200190f35b6101ee612621565b61028f6004803603604081101561068a57600080fd5b50600160a060020a038135169060200135612682565b61028f600480360360408110156106b657600080fd5b50600160a060020a0381351690602001356126f0565b6102c9612704565b6102d3612771565b61059b612779565b6102d3600480360360408110156106fa57600080fd5b50600160a060020a0381358116916020013516612788565b6102c96004803603602081101561072857600080fd5b5035600160a060020a03166127b3565b6102d36004803603604081101561074e57600080fd5b508035600160a060020a0316906020013560ff166128c9565b60688054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107f35780601f106107c8576101008083540402835291602001916107f3565b820191906000526020600020905b8154815290600101906020018083116107d657829003601f168201915b505050505090505b90565b600061081261080b6129b5565b84846129b9565b5060015b92915050565b6108246129b5565b600160a060020a0316610835612231565b600160a060020a031614610881576040805160e560020a62461bcd0281526020600482018190526024820152600080516020613cd7833981519152604482015290519081900360640190fd5b60fe805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60675490565b60006108c3848484612aab565b610939846108cf6129b5565b61093485604051806060016040528060288152602001613c7960289139600160a060020a038a1660009081526066602052604081209061090d6129b5565b600160a060020a03168152602081019190915260400160002054919063ffffffff612b6516565b6129b9565b5060019392505050565b606a5460ff1690565b60006108126109596129b5565b84610934856066600061096a6129b5565b600160a060020a03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff612bff16565b60fb805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610a265780601f106109fb57610100808354040283529160200191610a26565b820191906000526020600020905b815481529060010190602001808311610a0957829003601f168201915b505050505081565b610a366129b5565b600160a060020a0316610a47612231565b600160a060020a031614610a93576040805160e560020a62461bcd0281526020600482018190526024820152600080516020613cd7833981519152604482015290519081900360640190fd5b610a9b612c63565b565b600054610100900460ff1680610ab65750610ab6612d13565b80610ac4575060005460ff16155b610b025760405160e560020a62461bcd02815260040180806020018281038252602e815260200180613bf7602e913960400191505060405180910390fd5b600054610100900460ff16158015610b2d576000805460ff1961ff0019909116610100171660011790555b610b35612d24565b610ba96040518060400160405280600881526020017f506c617963656e740000000000000000000000000000000000000000000000008152506040518060400160405280600481526020017f50434e5400000000000000000000000000000000000000000000000000000000815250612dd9565b610bb1612e91565b610bcd610bbc612231565b6a2da90dfefdc9a384000000612f39565b610be2846a01fc3842bd1f071c000000612f39565b610bf7836a01fc3842bd1f071c000000612f39565b8151610c0a9060fb9060208501906139d4565b506040518060c00160405280600060ff168152602001600c60ff168152602001602060ff168152602001600060ff168152602001600560ff1681526020016a0771d2fa45345aa900000081525060fc600080815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a082015181600101559050506040518060c00160405280600160ff168152602001600360ff168152602001600d60ff168152602001600060ff168152602001600a60ff1681526020016a03f870857a3e0e3800000081525060fc60006001815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a082015181600101559050506040518060c00160405280600260ff168152602001600360ff168152602001600d60ff168152602001600060ff168152602001600a60ff1681526020016a03f870857a3e0e3800000081525060fc60006002815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a082015181600101559050506040518060c00160405280600360ff168152602001600160ff168152602001600b60ff168152602001600060ff168152602001600a60ff1681526020016a01fc3842bd1f071c00000081525060fc60006003815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a082015181600101559050506040518060c00160405280600460ff168152602001600160ff168152602001600660ff168152602001600060ff168152602001601460ff1681526020016a03f870857a3e0e3800000081525060fc60006004815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a082015181600101559050506040518060c00160405280600560ff168152602001600360ff168152602001601c60ff168152602001600060ff168152602001600460ff1681526020016a0771d2fa45345aa900000081525060fc60006005815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a082015181600101559050506040518060c00160405280600660ff168152602001600660ff168152602001601f60ff168152602001600060ff168152602001600460ff1681526020016a03796274caf64c7100000081525060fc60006006815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a082015181600101559050506040518060c00160405280600760ff168152602001600160ff168152602001600760ff168152602001600a60ff168152602001600f60ff1681526020016a04b7059e8129b0e280000081525060fc60006007815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a082015181600101559050506040518060c00160405280600860ff168152602001600160ff168152602001600560ff168152602001600f60ff168152602001601460ff1681526020016a04777e962985cfff00000081525060fc60006008815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a082015181600101559050506040518060c00160405280600960ff168152602001600160ff168152602001600460ff168152602001601460ff168152602001601460ff1681526020016a0437f78dd1e1ef1b80000081525060fc60006009815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a0820151816001015590505080156116d0576000805461ff00191690555b50505050565b60006116e06129b5565b600160a060020a03166116f1612231565b600160a060020a03161461173d576040805160e560020a62461bcd0281526020600482018190526024820152600080516020613cd7833981519152604482015290519081900360640190fd5b8160098160ff16111561179a576040805160e560020a62461bcd02815260206004820152601560248201527f496e76616c69642056657374696e6720496e6465780000000000000000000000604482015290519081900360640190fd5b8584146117f1576040805160e560020a62461bcd02815260206004820152601560248201527f556e657175616c20617272617973207061737365640000000000000000000000604482015290519081900360640190fd5b6117f9613a52565b5060ff808416600090815260fc60209081526040808320815160c081018352815480871682526101008104871694820194909452620100008404861692810192909252630100000083048516606083015264010000000090920490931660808401526001015460a08301528790805b8281101561191d578660008c8c8481811061187f57fe5b90506020020135600160a060020a0316905060008b8b8581811061189f57fe5b90506020020135905060008760200151905060008860400151905060006118cd848b6060015160ff1661303a565b905060006118e2858c6080015160ff1661303a565b90508f8f898181106118f057fe5b905060200201358901985061190a8688878787878761305d565b5050600190950194506118689350505050565b50600061193061192b612231565b6119a0565b9050818110156119745760405160e560020a62461bcd028152600401808060200182810382526028815260200180613d1d6028913960400191505060405180910390fd5b61198661197f612231565b3084612aab565b5060019a9950505050505050505050565b60975460ff1690565b600160a060020a031660009081526065602052604090205490565b6119c36129b5565b600160a060020a03166119d4612231565b600160a060020a031614611a20576040805160e560020a62461bcd0281526020600482018190526024820152600080516020613cd7833981519152604482015290519081900360640190fd5b603354604051600091600160a060020a0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36033805473ffffffffffffffffffffffffffffffffffffffff19169055565b600160a060020a038216600090815260fd6020908152604080832060ff808616855292528220600601548491849116611ae45760405160e560020a62461bcd02815260040180806020018281038252602c815260200180613d6a602c913960400191505060405180910390fd5b611aec613a87565b50600160a060020a038516600090815260fd6020908152604080832060ff8089168552908352818420825161012081018452815483168152600182015494810194909452600281015492840192909252600382015460608401526004820154808216608085015261010090819004821660a0850152600583015460c0850152600690920154808216151560e085015282900416151590820152908080611b90612771565b90506000611b9c61329a565b90506000611bb0828463ffffffff61329e16565b90506000611bcc611bbf6132fe565b839063ffffffff61330516565b90506000611be8611bdb61336f565b849063ffffffff61330516565b90506000611bfd82601e63ffffffff61337616565b9050600081118015611c0f5750600083115b15611c1b576001830192505b8860a0015160ff168311611c79576040805160e560020a62461bcd02815260206004820152601d60248201527f56657374696e6720436c696666204e6f742043726f7373656420596574000000604482015290519081900360640190fd5b886080015160ff16831115611cb4576000611c948f8f6128c9565b60208b0151909150611cac908263ffffffff61329e16565b985050611e0d565b6000611cd08a60a0015160ff168561329e90919063ffffffff16565b905060008111611d2a576040805160e560020a62461bcd02815260206004820181905260248201527f4e756d626572206f66206d6f6e74687320656c6170736564206973205a45524f604482015290519081900360640190fd5b896000015160ff1660091415611d8057611d42613ad3565b601460208083019190915260326040830152605060608301528b0151611d7890828460048110611d6e57fe5b602002015161303a565b985050611d98565b60608a0151611d95908263ffffffff6133e016565b97505b8960c001518811611df3576040805160e560020a62461bcd02815260206004820181905260248201527f4e6f20436c61696d61626c6520546f6b656e7320617420746869732054696d65604482015290519081900360640190fd5b60c08a0151611e0990899063ffffffff61329e16565b9850505b50959c9b505050505050505050505050565b6000611e29612771565b611e3161329a565b11611e705760405160e560020a62461bcd028152600401808060200182810382526026815260200180613cf76026913960400191505060405180910390fd5b611e78611997565b15611ecd576040805160e560020a62461bcd02815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a038416600090815260fd6020908152604080832060ff80881685529252909120600601548591859116611f3b5760405160e560020a62461bcd02815260040180806020018281038252602c815260200180613d6a602c913960400191505060405180910390fd5b611f43613a87565b50600160a060020a038616600090815260fd6020908152604080832060ff808a168552908352818420825161012081018452815483168152600182015494810194909452600281015492840192909252600382015460608401526004820154808216608085015261010090819004821660a0850152600583015460c0850152600690920154808216151560e08501528290041615159082015290611fe788886128c9565b90506000611ff58989611a77565b9050600081116120395760405160e560020a62461bcd02815260040180806020018281038252602b815260200180613b9d602b913960400191505060405180910390fd5b8087111561207b5760405160e560020a62461bcd02815260040180806020018281038252602a815260200180613e2d602a913960400191505060405180910390fd5b6000612086306119a0565b9050878110156120ca5760405160e560020a62461bcd028152600401808060200182810382526024815260200180613dba6024913960400191505060405180910390fd5b60208401516120df848a63ffffffff612bff16565b1115612135576040805160e560020a62461bcd02815260206004820181905260248201527f43616e6e6f7420436c61696d206d6f7265207468616e20416c6c6f6361746564604482015290519081900360640190fd5b60c084018051890190526020840151612154848a63ffffffff612bff16565b141561216257600060e08501525b600160a060020a038a16600090815260fd6020908152604080832060ff808e168552908352928190208751815490851660ff1991821617825592880151600182015590870151600282015560608701516003820155608087015160048201805460a08a0151861661010090810261ff00199490971691861691909117831695909517905560c0880151600583015560e088015160069092018054858a0151151590950292151594909316939093179092169190911790556122238a8961343c565b505050505050509392505050565b603354600160a060020a031690565b600061224a612771565b61225261329a565b116122915760405160e560020a62461bcd028152600401808060200182810382526026815260200180613cf76026913960400191505060405180910390fd5b612299611997565b156122ee576040805160e560020a62461bcd02815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a038316600090815260fd6020908152604080832060ff8087168552925290912060060154849184911661235c5760405160e560020a62461bcd02815260040180806020018281038252602c815260200180613d6a602c913960400191505060405180910390fd5b612364613a87565b50600160a060020a038516600090815260fd6020908152604080832060ff80891685529083529281902081516101208101835281548516808252600183015494820194909452600282015492810192909252600381015460608301526004810154808516608084015261010090819004851660a0840152600582015460c0840152600690910154808516151560e084015281900490931615159281019290925260071180159061241c57506009816000015160ff1611155b61245a5760405160e560020a62461bcd02815260040180806020018281038252602f815260200180613bc8602f913960400191505060405180910390fd5b6101008101511561249f5760405160e560020a62461bcd028152600401808060200182810382526036815260200180613ca16036913960400191505060405180910390fd5b604081015160006124af306119a0565b9050818110156124f35760405160e560020a62461bcd028152600401808060200182810382526024815260200180613dba6024913960400191505060405180910390fd5b6001610100808501828152600160a060020a038b16600090815260fd6020908152604080832060ff808f168552908352928190208951815490851660ff19918216178255928a015196810196909655880151600286015560608801516003860155608088015160048601805460a08b01518516870261ff0019939095169084161782169390931790925560c0880151600586015560e08801516006909501805493511515909402941515921691909117169190911790556125b4888361343c565b50505050505092915050565b60fd602090815260009283526040808420909152908252902080546001820154600283015460038401546004850154600586015460069096015460ff9586169694959394929382811693610100938490048216939092808316929190041689565b60698054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107f35780601f106107c8576101008083540402835291602001916107f3565b600061081261268f6129b5565b8461093485604051806060016040528060258152602001613dde60259139606660006126b96129b5565b600160a060020a03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff612b6516565b60006108126126fd6129b5565b8484612aab565b61270c6129b5565b600160a060020a031661271d612231565b600160a060020a031614612769576040805160e560020a62461bcd0281526020600482018190526024820152600080516020613cd7833981519152604482015290519081900360640190fd5b610a9b613449565b636043ca2890565b60fe54600160a060020a031681565b600160a060020a03918216600090815260666020908152604080832093909416825291909152205490565b6127bb6129b5565b600160a060020a03166127cc612231565b600160a060020a031614612818576040805160e560020a62461bcd0281526020600482018190526024820152600080516020613cd7833981519152604482015290519081900360640190fd5b600160a060020a0381166128605760405160e560020a62461bcd028152600401808060200182810382526026815260200180613b2f6026913960400191505060405180910390fd5b603354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36033805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000806128d4613a87565b50600160a060020a038416600090815260fd6020908152604080832060ff808816855290835292819020815161012081018352815485168152600182015493810193909352600281015491830191909152600381015460608301526004810154808416608084015261010090819004841660a0840152600582015460c08401819052600690920154808516151560e08501528190049093161515928201929092529061298790839063ffffffff612bff16565b9150806101000151156129ad5760408101516129aa90839063ffffffff612bff16565b91505b509392505050565b3390565b600160a060020a038316612a015760405160e560020a62461bcd028152600401808060200182810382526024815260200180613d966024913960400191505060405180910390fd5b600160a060020a038216612a495760405160e560020a62461bcd028152600401808060200182810382526022815260200180613b556022913960400191505060405180910390fd5b600160a060020a03808416600081815260666020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60fe54600160a060020a031615612b555760fe54604080517faa61a9dd000000000000000000000000000000000000000000000000000000008152600160a060020a0386811660048301528581166024830152825193169263aa61a9dd926044808401939192918290030181600087803b158015612b2857600080fd5b505af1158015612b3c573d6000803e3d6000fd5b505050506040513d6040811015612b5257600080fd5b50505b612b608383836134d8565b505050565b60008184841115612bf75760405160e560020a62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612bbc578181015183820152602001612ba4565b50505050905090810190601f168015612be95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015612c5c576040805160e560020a62461bcd02815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b612c6b611997565b15612cc0576040805160e560020a62461bcd02815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b6097805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612cf66129b5565b60408051600160a060020a039092168252519081900360200190a1565b6000612d1e30613647565b15905090565b600054610100900460ff1680612d3d5750612d3d612d13565b80612d4b575060005460ff16155b612d895760405160e560020a62461bcd02815260040180806020018281038252602e815260200180613bf7602e913960400191505060405180910390fd5b600054610100900460ff16158015612db4576000805460ff1961ff0019909116610100171660011790555b612dbc61364d565b612dc46136f0565b8015612dd6576000805461ff00191690555b50565b600054610100900460ff1680612df25750612df2612d13565b80612e00575060005460ff16155b612e3e5760405160e560020a62461bcd02815260040180806020018281038252602e815260200180613bf7602e913960400191505060405180910390fd5b600054610100900460ff16158015612e69576000805460ff1961ff0019909116610100171660011790555b612e7161364d565b612e7b83836137f9565b8015612b60576000805461ff0019169055505050565b600054610100900460ff1680612eaa5750612eaa612d13565b80612eb8575060005460ff16155b612ef65760405160e560020a62461bcd02815260040180806020018281038252602e815260200180613bf7602e913960400191505060405180910390fd5b600054610100900460ff16158015612f21576000805460ff1961ff0019909116610100171660011790555b612f2961364d565b612f316138d4565b612dc461364d565b600160a060020a038216612f97576040805160e560020a62461bcd02815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b612fa360008383613982565b606754612fb6908263ffffffff612bff16565b606755600160a060020a038216600090815260656020526040902054612fe2908263ffffffff612bff16565b600160a060020a03831660008181526065602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000612c5c6064613051858563ffffffff6133e016565b9063ffffffff61330516565b8686600160a060020a0382166130bd576040805160e560020a62461bcd02815260206004820152600f60248201527f496e76616c696420416464726573730000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a038216600090815260fd6020908152604080832060ff808616855292529091206006015416156131285760405160e560020a62461bcd028152600401808060200182810382526033815260200180613c256033913960400191505060405180910390fd5b613130613a87565b6040518061012001604052808a60ff1681526020018981526020018681526020018581526020018760ff1681526020018860ff168152602001600081526020016001151581526020016000151581525090508060fd60008c600160a060020a0316600160a060020a0316815260200190815260200160002060008b60ff1660ff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548160ff021916908360ff16021790555060a08201518160040160016101000a81548160ff021916908360ff16021790555060c0820151816005015560e08201518160060160006101000a81548160ff0219169083151502179055506101008201518160060160016101000a81548160ff02191690831515021790555090505050505050505050505050565b4290565b6000828211156132f8576040805160e560020a62461bcd02815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b62278d0090565b600080821161335e576040805160e560020a62461bcd02815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161336757fe5b049392505050565b6201518090565b60008082116133cf576040805160e560020a62461bcd02815260206004820152601860248201527f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000604482015290519081900360640190fd5b8183816133d857fe5b069392505050565b6000826133ef57506000610816565b828202828482816133fc57fe5b0414612c5c5760405160e560020a62461bcd028152600401808060200182810382526021815260200180613c586021913960400191505060405180910390fd5b6000610812308484612aab565b613451611997565b6134a5576040805160e560020a62461bcd02815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b6097805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612cf66129b5565b600160a060020a0383166135205760405160e560020a62461bcd028152600401808060200182810382526025815260200180613d456025913960400191505060405180910390fd5b600160a060020a0382166135685760405160e560020a62461bcd028152600401808060200182810382526023815260200180613b0c6023913960400191505060405180910390fd5b613573838383613982565b6135b681604051806060016040528060268152602001613b7760269139600160a060020a038616600090815260656020526040902054919063ffffffff612b6516565b600160a060020a0380851660009081526065602052604080822093909355908416815220546135eb908263ffffffff612bff16565b600160a060020a0380841660008181526065602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b3b151590565b600054610100900460ff16806136665750613666612d13565b80613674575060005460ff16155b6136b25760405160e560020a62461bcd02815260040180806020018281038252602e815260200180613bf7602e913960400191505060405180910390fd5b600054610100900460ff16158015612dc4576000805460ff1961ff0019909116610100171660011790558015612dd6576000805461ff001916905550565b600054610100900460ff16806137095750613709612d13565b80613717575060005460ff16155b6137555760405160e560020a62461bcd02815260040180806020018281038252602e815260200180613bf7602e913960400191505060405180910390fd5b600054610100900460ff16158015613780576000805460ff1961ff0019909116610100171660011790555b600061378a6129b5565b6033805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508015612dd6576000805461ff001916905550565b600054610100900460ff16806138125750613812612d13565b80613820575060005460ff16155b61385e5760405160e560020a62461bcd02815260040180806020018281038252602e815260200180613bf7602e913960400191505060405180910390fd5b600054610100900460ff16158015613889576000805460ff1961ff0019909116610100171660011790555b825161389c9060689060208601906139d4565b5081516138b09060699060208501906139d4565b50606a805460ff191660121790558015612b60576000805461ff0019169055505050565b600054610100900460ff16806138ed57506138ed612d13565b806138fb575060005460ff16155b6139395760405160e560020a62461bcd02815260040180806020018281038252602e815260200180613bf7602e913960400191505060405180910390fd5b600054610100900460ff16158015613964576000805460ff1961ff0019909116610100171660011790555b6097805460ff191690558015612dd6576000805461ff001916905550565b61398d838383612b60565b613995611997565b15612b605760405160e560020a62461bcd02815260040180806020018281038252602a815260200180613e03602a913960400191505060405180910390fd5b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613a1557805160ff1916838001178555613a42565b82800160010185558215613a42579182015b82811115613a42578251825591602001919060010190613a27565b50613a4e929150613af1565b5090565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b6040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e0810182905261010081019190915290565b60405180608001604052806004906020820280388339509192915050565b6107fb91905b80821115613a4e5760008155600101613af756fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654e6f20746f6b656e7320746f207472616e73666572206174207468697320706f696e74206f662074696d6556657374696e672043617465676f727920646f65736e27742062656c6f6e6720746f2053414c452056457374696e67496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564557365722056657374696e672044657461696c7320416c726561647920416464656420746f20746869732043617465676f7279536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636554474520546f6b656e73204861766520616c7265616479206265656e20636c61696d656420666f7220476976656e20416464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572546f6b656e2047656e65726174696f6e204576656e74204e6f742053746172746564205965744f776e657220646f65732774206861766520726571756972656420746f6b656e2062616c616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737355736572204e4f5420616464656420746f207468652070726f76696465642076657374696e6720496e64657845524332303a20617070726f76652066726f6d20746865207a65726f20616464726573734e6f7420456e6f75676820546f6b656e2042616c616e636520696e20436f6e747261637445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f45524332305061757361626c653a20746f6b656e207472616e73666572207768696c652070617573656443616e6e6f7420436c61696d206d6f7265207468616e204d6f6e74686c79205665737420416d6f756e74a2646970667358221220fab3193149e67d042cea0a45c9f0bfaca673f3f2c21ca266e53fbf8864e34b6e64736f6c63430006020033
Verified Source Code Full Match
Compiler: v0.6.2+commit.bacdbe57
EVM: byzantium
Optimization: Yes (200 runs)
Initializable.sol 55 lines
// SPDX-License-Identifier: MIT
// solhint-disable-next-line compiler-version
pragma solidity >=0.4.24 <0.8.0;
import "../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
*/
bool private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Modifier to protect an initializer function from being invoked twice.
*/
modifier initializer() {
require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized");
bool isTopLevelCall = !_initializing;
if (isTopLevelCall) {
_initializing = true;
_initialized = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
}
}
/// @dev Returns true if and only if the function is running in the constructor
function _isConstructor() private view returns (bool) {
return !AddressUpgradeable.isContract(address(this));
}
}
ILocker.sol 19 lines
pragma solidity >=0.6.0 <0.8.0;
interface ILiquiditySyncer {
function syncLiquiditySupply(address pool) external;
}
interface ILocker {
/**
* @dev Fails if transaction is not allowed. Otherwise returns the penalty.
* Returns a bool and a uint16, bool clarifying the penalty applied, and uint16 the penaltyOver1000
*/
function lockOrGetPenalty(address source, address dest)
external
returns (bool, uint256);
}
interface ILockerUser {
function locker() external view returns (ILocker);
}
PlaycentTokenV1.sol 512 lines
pragma solidity 0.6.2;
// SPDX-License-Identifier: MIT
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
import "./safety/ILocker.sol";
contract PlaycentTokenV1 is
Initializable,
OwnableUpgradeable,
ERC20PausableUpgradeable,
ILockerUser
{
using SafeMathUpgradeable for uint256;
/**
* Category 0 - Team
* Category 1 - Operations
* Category 2 - Marketing/Partners
* Category 3 - Advisors
* Category 4 - Staking/Earn Incentives
* Category 5 - Play/Mining
* Category 6 - Reserve
* Category 7 - Seed Sale
* Category 8 - Private 1
* Category 9 - Private 2
*/
string public releaseSHA;
struct VestType {
uint8 indexId;
uint8 lockPeriod;
uint8 vestingDuration;
uint8 tgePercent;
uint8 monthlyPercent;
uint256 totalTokenAllocation;
}
struct VestAllocation {
uint8 vestIndexID;
uint256 totalTokensAllocated;
uint256 totalTGETokens;
uint256 monthlyTokens;
uint8 vestingDuration;
uint8 lockPeriod;
uint256 totalVestTokensClaimed;
bool isVesting;
bool isTgeTokensClaimed;
}
mapping(uint256 => VestType) internal vestTypes;
mapping(address => mapping(uint8 => VestAllocation))
public walletToVestAllocations;
ILocker public override locker;
function initialize(address _PublicSaleAddress, address _exchangeLiquidityAddress, string memory _hash)
public
initializer
{
__Ownable_init();
__ERC20_init("Playcent", "PCNT");
__ERC20Pausable_init();
_mint(owner(), 55200000 ether);
_mint(_PublicSaleAddress, 2400000 ether);
_mint(_exchangeLiquidityAddress, 2400000 ether);
releaseSHA = _hash;
vestTypes[0] = VestType(0, 12, 32, 0, 5, 9000000 ether); // Team
vestTypes[1] = VestType(1, 3, 13, 0, 10, 4800000 ether); // Operations
vestTypes[2] = VestType(2, 3, 13, 0, 10, 4800000 ether); // Marketing/Partners
vestTypes[3] = VestType(3, 1, 11, 0, 10, 2400000 ether); // Advisors
vestTypes[4] = VestType(4, 1, 6, 0, 20, 4800000 ether); //Staking/Early Incentive Rewards
vestTypes[5] = VestType(5, 3, 28, 0, 4, 9000000 ether); //Play Mining
vestTypes[6] = VestType(6, 6, 31, 0, 4, 4200000 ether); //Reserve
// Sale Vesting Strategies
vestTypes[7] = VestType(7, 1, 7, 10, 15, 5700000 ether); // Seed Sale
vestTypes[8] = VestType(8, 1, 5, 15, 20, 5400000 ether); // Private Sale 1
vestTypes[9] = VestType(9, 1, 4, 20, 20, 5100000 ether); // Private Sale 2
}
modifier onlyValidVestingBenifciary(
address _userAddresses,
uint8 _vestingIndex
) {
require(_userAddresses != address(0), "Invalid Address");
require(
!walletToVestAllocations[_userAddresses][_vestingIndex].isVesting,
"User Vesting Details Already Added to this Category"
);
_;
}
modifier checkVestingStatus(address _userAddresses, uint8 _vestingIndex) {
require(
walletToVestAllocations[_userAddresses][_vestingIndex].isVesting,
"User NOT added to the provided vesting Index"
);
_;
}
modifier onlyValidVestingIndex(uint8 _vestingIndex) {
require(_vestingIndex >= 0 && _vestingIndex <= 9, "Invalid Vesting Index");
_;
}
modifier onlyAfterTGE() {
require(
getCurrentTime() > getTGETime(),
"Token Generation Event Not Started Yet"
);
_;
}
function setLocker(address _locker) external onlyOwner() {
locker = ILocker(_locker);
}
// function _transfer(address sender, address recipient, uint256 amount) internal virtual override {
// if (address(locker) != address(0)) {
// locker.lockOrGetPenalty(sender, recipient);
// }
// return ERC20._transfer(sender, recipient, amount);
// }
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual override {
if (address(locker) != address(0)) {
locker.lockOrGetPenalty(sender, recipient);
}
return super._transfer(sender, recipient, amount);
}
/**
* @notice Returns current time
*/
function getCurrentTime() internal view returns (uint256) {
return block.timestamp;
}
/**
* @notice Returns the total number of seconds in 1 Day
*/
function daysInSeconds() internal pure returns (uint256) {
return 86400;
}
/**
* @notice Returns the total number of seconds in 1 month
*/
function monthInSeconds() internal pure returns (uint256) {
return 2592000;
}
/**
* @notice Returns the TGE time
*/
function getTGETime() public pure returns (uint256) {
return 1615055400; // March 6, 2021 @ 6:30:00 pm
}
/**
* @notice Calculates the amount of tokens on the basis of monthly rate assigned
*/
function percentage(uint256 _totalAmount, uint256 _rate)
internal
pure
returns (uint256)
{
return _totalAmount.mul(_rate).div(100);
}
/**
* @notice Pauses the contract.
* @dev Can only be called by the owner
*/
function pauseContract() external onlyOwner {
_pause();
}
/**
* @notice Pauses the contract.
* @dev Can only be called by the owner
*/
function unPauseContract() external onlyOwner {
_unpause();
}
/**
* @notice - Allows only the Owner to ADD an array of Addresses as well as their Vesting Amount
- The array of user and amounts should be passed along with the vestingCategory Index.
- Thus, a particular batch of addresses shall be added under only one Vesting Category Index
* @param _userAddresses array of addresses of the Users
* @param _vestingAmounts array of amounts to be vested
* @param _vestingType allows the owner to select the type of vesting category
* @return - true if Function executes successfully
*/
function addVestingDetails(
address[] calldata _userAddresses,
uint256[] calldata _vestingAmounts,
uint8 _vestingType
) external onlyOwner onlyValidVestingIndex(_vestingType) returns (bool) {
require(
_userAddresses.length == _vestingAmounts.length,
"Unequal arrays passed"
);
// Get Vesting Category Details
VestType memory vestData = vestTypes[_vestingType];
uint256 arrayLength = _userAddresses.length;
uint256 providedVestAmount;
for (uint256 i = 0; i < arrayLength; i++) {
uint8 vestIndexID = _vestingType;
address userAddress = _userAddresses[i];
uint256 totalAllocation = _vestingAmounts[i];
uint8 lockPeriod = vestData.lockPeriod;
uint8 vestingDuration = vestData.vestingDuration;
uint256 tgeAmount = percentage(totalAllocation, vestData.tgePercent);
uint256 monthlyAmount =
percentage(totalAllocation, vestData.monthlyPercent);
providedVestAmount += _vestingAmounts[i];
addUserVestingDetails(
userAddress,
vestIndexID,
totalAllocation,
lockPeriod,
vestingDuration,
tgeAmount,
monthlyAmount
);
}
uint256 ownerBalance = balanceOf(owner());
require(
ownerBalance >= providedVestAmount,
"Owner does't have required token balance"
);
_transfer(owner(), address(this), providedVestAmount);
return true;
}
/** @notice - Internal functions that is initializes the VestAllocation Struct with the respective arguments passed
* @param _userAddresses addresses of the User
* @param _totalAllocation total amount to be lockedUp
* @param _vestingIndex denotes the type of vesting selected
* @param _lockPeriod denotes the lock of the vesting category selcted
* @param _vestingDuration denotes the total duration of the vesting category selcted
* @param _tgeAmount denotes the total TGE amount to be transferred to the userVestingData
* @param _monthlyAmount denotes the total Monthly Amount to be transferred to the user
*/
function addUserVestingDetails(
address _userAddresses,
uint8 _vestingIndex,
uint256 _totalAllocation,
uint8 _lockPeriod,
uint8 _vestingDuration,
uint256 _tgeAmount,
uint256 _monthlyAmount
) internal onlyValidVestingBenifciary(_userAddresses, _vestingIndex) {
VestAllocation memory userVestingData =
VestAllocation(
_vestingIndex,
_totalAllocation,
_tgeAmount,
_monthlyAmount,
_vestingDuration,
_lockPeriod,
0,
true,
false
);
walletToVestAllocations[_userAddresses][_vestingIndex] = userVestingData;
}
/**
* @notice Calculates the total amount of tokens Claimed by the User in a particular vesting category
* @param _userAddresses address of the User
* @param _vestingIndex index number of the vesting type
*/
function totalTokensClaimed(address _userAddresses, uint8 _vestingIndex)
public
view
returns (uint256)
{
// Get Vesting Details
uint256 totalClaimedTokens;
VestAllocation memory vestData =
walletToVestAllocations[_userAddresses][_vestingIndex];
totalClaimedTokens = totalClaimedTokens.add(
vestData.totalVestTokensClaimed
);
if (vestData.isTgeTokensClaimed) {
totalClaimedTokens = totalClaimedTokens.add(vestData.totalTGETokens);
}
return totalClaimedTokens;
}
/**
* @notice An internal function to calculate the total claimable tokens at any given point
* @param _userAddresses address of the User
* @param _vestingIndex index number of the vesting type
*/
function calculateClaimableVestTokens(
address _userAddresses,
uint8 _vestingIndex
)
public
view
checkVestingStatus(_userAddresses, _vestingIndex)
returns (uint256)
{
// Get Vesting Details
VestAllocation memory vestData =
walletToVestAllocations[_userAddresses][_vestingIndex];
// Get Time Details
uint256 actualClaimableAmount;
uint256 tokensAfterElapsedMonths;
uint256 vestStartTime = getTGETime();
uint256 currentTime = getCurrentTime();
uint256 timeElapsed = currentTime.sub(vestStartTime);
// Get the Elapsed Days and Months
uint256 totalMonthsElapsed = timeElapsed.div(monthInSeconds());
uint256 totalDaysElapsed = timeElapsed.div(daysInSeconds());
uint256 partialDaysElapsed = totalDaysElapsed.mod(30);
if (partialDaysElapsed > 0 && totalMonthsElapsed > 0) {
totalMonthsElapsed += 1;
}
//Check whether or not the VESTING CLIFF has been reached
require(
totalMonthsElapsed > vestData.lockPeriod,
"Vesting Cliff Not Crossed Yet"
);
// If total duration of Vesting already crossed, return pending tokens to claimed
if (totalMonthsElapsed > vestData.vestingDuration) {
uint256 _totalTokensClaimed =
totalTokensClaimed(_userAddresses, _vestingIndex);
actualClaimableAmount = vestData.totalTokensAllocated.sub(
_totalTokensClaimed
);
// if current time has crossed the Vesting Cliff but not the total Vesting Duration
// Calculating Actual Months(Excluding the CLIFF) to initiate vesting
} else {
uint256 actualMonthElapsed = totalMonthsElapsed.sub(vestData.lockPeriod);
require(actualMonthElapsed > 0, "Number of months elapsed is ZERO");
// Calculate the Total Tokens on the basis of Vesting Index and Month elapsed
if (vestData.vestIndexID == 9) {
uint256[4] memory monthsToRates;
monthsToRates[1] = 20;
monthsToRates[2] = 50;
monthsToRates[3] = 80;
tokensAfterElapsedMonths = percentage(
vestData.totalTokensAllocated,
monthsToRates[actualMonthElapsed]
);
} else {
tokensAfterElapsedMonths = vestData.monthlyTokens.mul(
actualMonthElapsed
);
}
require(
tokensAfterElapsedMonths > vestData.totalVestTokensClaimed,
"No Claimable Tokens at this Time"
);
// Get the actual Claimable Tokens
actualClaimableAmount = tokensAfterElapsedMonths.sub(
vestData.totalVestTokensClaimed
);
}
return actualClaimableAmount;
}
/**
* @notice Function to transfer tokens from this contract to the user
* @param _beneficiary address of the User
* @param _amountOfTokens number of tokens to be transferred
*/
function _sendTokens(address _beneficiary, uint256 _amountOfTokens)
private
returns (bool)
{
_transfer(address(this), _beneficiary, _amountOfTokens);
return true;
}
/**
* @notice Calculates and Transfer the total tokens to be transferred to the user after Token Generation Event is over
* @dev The function shall only work for users under Sale Vesting Category(index - 7,8,9).
* @dev The function can only be called once by the user(only if the isTgeTokensClaimed boolean value is FALSE).
* Once the tokens have been transferred, isTgeTokensClaimed becomes TRUE for that particular address
* @param _userAddresses address of the User
* @param _vestingIndex index of the vesting Type
*/
function claimTGETokens(address _userAddresses, uint8 _vestingIndex)
public
onlyAfterTGE
whenNotPaused
checkVestingStatus(_userAddresses, _vestingIndex)
returns (bool)
{
// Get Vesting Details
VestAllocation memory vestData =
walletToVestAllocations[_userAddresses][_vestingIndex];
require(
vestData.vestIndexID >= 7 && vestData.vestIndexID <= 9,
"Vesting Category doesn't belong to SALE VEsting"
);
require(
vestData.isTgeTokensClaimed == false,
"TGE Tokens Have already been claimed for Given Address"
);
uint256 tokensToTransfer = vestData.totalTGETokens;
uint256 contractTokenBalance = balanceOf(address(this));
require(
contractTokenBalance >= tokensToTransfer,
"Not Enough Token Balance in Contract"
);
// Updating Contract State
vestData.isTgeTokensClaimed = true;
walletToVestAllocations[_userAddresses][_vestingIndex] = vestData;
_sendTokens(_userAddresses, tokensToTransfer);
}
/**
* @notice Calculates and Transfers the total tokens to be transferred to the user by calculating the Amount of tokens to be transferred at the given time
* @dev The function shall only work for users under Vesting Category is valid(index - 1 to 9).
* @dev isVesting becomes false if all allocated tokens have been claimed.
* @dev User cannot claim more tokens than actually allocated to them by the OWNER
* @param _userAddresses address of the User
* @param _vestingIndex index of the vesting Type
* @param _tokenAmount the amount of tokens user wishes to withdraw
*/
function claimVestTokens(
address _userAddresses,
uint8 _vestingIndex,
uint256 _tokenAmount
)
public
onlyAfterTGE
whenNotPaused
checkVestingStatus(_userAddresses, _vestingIndex)
returns (bool)
{
// Get Vesting Details
VestAllocation memory vestData =
walletToVestAllocations[_userAddresses][_vestingIndex];
// Get total amount of tokens claimed till date
uint256 _totalTokensClaimed =
totalTokensClaimed(_userAddresses, _vestingIndex);
// Get the total claimable token amount at the time of calling this function
uint256 tokensToTransfer =
calculateClaimableVestTokens(_userAddresses, _vestingIndex);
require(
tokensToTransfer > 0,
"No tokens to transfer at this point of time"
);
require(
_tokenAmount <= tokensToTransfer,
"Cannot Claim more than Monthly Vest Amount"
);
uint256 contractTokenBalance = balanceOf(address(this));
require(
contractTokenBalance >= _tokenAmount,
"Not Enough Token Balance in Contract"
);
require(
_totalTokensClaimed.add(_tokenAmount) <= vestData.totalTokensAllocated,
"Cannot Claim more than Allocated"
);
vestData.totalVestTokensClaimed += _tokenAmount;
if (
_totalTokensClaimed.add(_tokenAmount) == vestData.totalTokensAllocated
) {
vestData.isVesting = false;
}
walletToVestAllocations[_userAddresses][_vestingIndex] = vestData;
_sendTokens(_userAddresses, _tokenAmount);
}
// Commented Out the withdraw function
// function withdrawContractTokens() external onlyOwner returns (bool) {
// uint256 remainingTokens = balanceOf(address(this));
// _sendTokens(owner(), remainingTokens);
// }
}
SafeMathUpgradeable.sol 214 lines
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.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 SafeMathUpgradeable {
/**
* @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;
}
}
AddressUpgradeable.sol 165 lines
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
ContextUpgradeable.sol 32 lines
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "../proxy/Initializable.sol";
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with 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 ContextUpgradeable is Initializable {
function __Context_init() internal initializer {
__Context_init_unchained();
}
function __Context_init_unchained() internal initializer {
}
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;
}
uint256[50] private __gap;
}
OwnableUpgradeable.sol 75 lines
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal initializer {
__Context_init_unchained();
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal initializer {
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;
}
uint256[49] private __gap;
}
PausableUpgradeable.sol 97 lines
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "./ContextUpgradeable.sol";
import "../proxy/Initializable.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
function __Pausable_init() internal initializer {
__Context_init_unchained();
__Pausable_init_unchained();
}
function __Pausable_init_unchained() internal initializer {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
uint256[49] private __gap;
}
ERC20Upgradeable.sol 313 lines
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "../../utils/ContextUpgradeable.sol";
import "./IERC20Upgradeable.sol";
import "../../math/SafeMathUpgradeable.sol";
import "../../proxy/Initializable.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin 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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable {
using SafeMathUpgradeable 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.
*/
function __ERC20_init(string memory name_, string memory symbol_) internal initializer {
__Context_init_unchained();
__ERC20_init_unchained(name_, symbol_);
}
function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {
_name = name_;
_symbol = symbol_;
_decimals = 18;
}
/**
* @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 { }
uint256[44] private __gap;
}
IERC20Upgradeable.sol 77 lines
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Upgradeable {
/**
* @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);
}
ERC20PausableUpgradeable.sol 38 lines
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "./ERC20Upgradeable.sol";
import "../../utils/PausableUpgradeable.sol";
import "../../proxy/Initializable.sol";
/**
* @dev ERC20 token with pausable token transfers, minting and burning.
*
* Useful for scenarios such as preventing trades until the end of an evaluation
* period, or having an emergency switch for freezing all token transfers in the
* event of a large bug.
*/
abstract contract ERC20PausableUpgradeable is Initializable, ERC20Upgradeable, PausableUpgradeable {
function __ERC20Pausable_init() internal initializer {
__Context_init_unchained();
__Pausable_init_unchained();
__ERC20Pausable_init_unchained();
}
function __ERC20Pausable_init_unchained() internal initializer {
}
/**
* @dev See {ERC20-_beforeTokenTransfer}.
*
* Requirements:
*
* - the contract must not be paused.
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override {
super._beforeTokenTransfer(from, to, amount);
require(!paused(), "ERC20Pausable: token transfer while paused");
}
uint256[50] private __gap;
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
calculateClaimableVestTokens 0x83840052 → uint256
decimals 0x313ce567 → uint8
getTGETime 0xd1600df5 → uint256
locker 0xd7b96d4e → address
name 0x06fdde03 → string
owner 0x8da5cb5b → address
paused 0x5c975abb → bool
releaseSHA 0x42e21975 → string
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
totalTokensClaimed 0xf70c12d3 → uint256
walletToVestAllocations 0x93018547 → uint8, uint256, uint256, uint256, uint8, uint8, uint256, bool, bool
Write Contract 14 functions
These functions modify contract state and require a wallet transaction to execute.
addVestingDetails 0x52985d2a
address[] _userAddresses
uint256[] _vestingAmounts
uint8 _vestingType
returns: bool
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
claimTGETokens 0x8e6e9e22
address _userAddresses
uint8 _vestingIndex
returns: bool
claimVestTokens 0x8978a49b
address _userAddresses
uint8 _vestingIndex
uint256 _tokenAmount
returns: bool
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
initialize 0x4571e3a6
address _PublicSaleAddress
address _exchangeLiquidityAddress
string _hash
pauseContract 0x439766ce
No parameters
renounceOwnership 0x715018a6
No parameters
setLocker 0x171060ec
address _locker
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
unPauseContract 0xbac15203
No parameters
Recent Transactions
No transactions found for this address