Address Contract Partially Verified
Address
0xc4A11aaf6ea915Ed7Ac194161d2fC9384F15bff2
Balance
0 ETH
Nonce
1
Code Size
10911 bytes
Creator
0xE2Bf5fda...2f3a at tx 0xfad9e0ba...b38d1a
Indexed Transactions
2 (24,454,743 → 24,454,763)
Gas Used (indexed)
164,242
Contract Bytecode
10911 bytes
0x608060405234801561001057600080fd5b50600436106102325760003560e01c806370a0823111610130578063a457c2d7116100b8578063dd62ed3e1161007c578063dd62ed3e146107b6578063e34869d7146107e4578063e3b99e8514610801578063f2fde38b1461082d578063f53fe70f1461085357610232565b8063a457c2d714610675578063a9059cbb146106a1578063aa271e1a146106cd578063cae9ca51146106f3578063cc48b947146107ae57610232565b80638da5cb5b116100ff5780638da5cb5b1461062f5780638f32d59b1461063757806395d89b411461063f578063983b2d5614610647578063986502751461066d57610232565b806370a08231146105af578063715018a6146105d55780637657f20a146105dd57806379cc67901461060357610232565b806339509351116101be578063588420b711610182578063588420b7146105035780635f112c681461052f57806363380113146105555780636d4354211461055d5780636fb7f5581461058b57610232565b806339509351146103d857806340c10f191461040457806341eb24bb146104305780634273ca161461045657806342966c68146104e657610232565b806318160ddd1161020557806318160ddd1461032557806323b872dd1461033f5780633113ed5c14610375578063313ce5671461039457806338bf3cfa146103b257610232565b806301ffc9a71461023757806305eeb9f71461027257806306fdde031461027c578063095ea7b3146102f9575b600080fd5b61025e6004803603602081101561024d57600080fd5b50356001600160e01b031916610870565b604080519115158252519081900360200190f35b61027a61088f565b005b610284610940565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102be5781810151838201526020016102a6565b50505050905090810190601f1680156102eb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61025e6004803603604081101561030f57600080fd5b506001600160a01b0381351690602001356109d6565b61032d6109f3565b60408051918252519081900360200190f35b61025e6004803603606081101561035557600080fd5b506001600160a01b038135811691602081013590911690604001356109f9565b61027a6004803603602081101561038b57600080fd5b50351515610a0e565b61039c610a73565b6040805160ff9092168252519081900360200190f35b61027a600480360360208110156103c857600080fd5b50356001600160a01b0316610a7c565b61025e600480360360408110156103ee57600080fd5b506001600160a01b038135169060200135610b19565b61025e6004803603604081101561041a57600080fd5b506001600160a01b038135169060200135610b72565b61027a6004803603602081101561044657600080fd5b50356001600160a01b0316610bc9565b61025e6004803603608081101561046c57600080fd5b6001600160a01b038235811692602081013590911691604082013591908101906080810160608201356401000000008111156104a757600080fd5b8201836020820111156104b957600080fd5b803590602001918460018302840111640100000000831117156104db57600080fd5b509092509050610c4b565b61027a600480360360208110156104fc57600080fd5b5035610d2a565b61025e6004803603604081101561051957600080fd5b506001600160a01b038135169060200135610d3e565b61027a6004803603602081101561054557600080fd5b50356001600160a01b0316610dae565b61025e610e30565b61027a6004803603604081101561057357600080fd5b506001600160a01b0381358116916020013516610e40565b610593610efb565b604080516001600160a01b039092168252519081900360200190f35b61032d600480360360208110156105c557600080fd5b50356001600160a01b0316610f0f565b61027a610f2a565b61027a600480360360208110156105f357600080fd5b50356001600160a01b0316610fbb565b61027a6004803603604081101561061957600080fd5b506001600160a01b03813516906020013561102a565b610593611055565b61025e611064565b61028461108a565b61027a6004803603602081101561065d57600080fd5b50356001600160a01b03166110eb565b61027a61113a565b61025e6004803603604081101561068b57600080fd5b506001600160a01b03813516906020013561114c565b61025e600480360360408110156106b757600080fd5b506001600160a01b0381351690602001356111ba565b61025e600480360360208110156106e357600080fd5b50356001600160a01b03166111ce565b61025e6004803603606081101561070957600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561073957600080fd5b82018360208201111561074b57600080fd5b8035906020019184600183028401116401000000008311171561076d57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506111e7945050505050565b610593611212565b61032d600480360360408110156107cc57600080fd5b506001600160a01b0381358116916020013516611221565b61025e600480360360208110156107fa57600080fd5b503561124c565b61025e6004803603604081101561081757600080fd5b506001600160a01b0381351690602001356112bb565b61027a6004803603602081101561084357600080fd5b50356001600160a01b0316611316565b61025e6004803603602081101561086957600080fd5b5035611366565b6001600160e01b03191660009081526009602052604090205460ff1690565b610897611064565b6108d6576040805162461bcd60e51b815260206004820181905260248201526000805160206128fe833981519152604482015290519081900360640190fd5b600a60009054906101000a90046001600160a01b03166001600160a01b031663986502756040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561092657600080fd5b505af115801561093a573d6000803e3d6000fd5b50505050565b60068054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109cc5780601f106109a1576101008083540402835291602001916109cc565b820191906000526020600020905b8154815290600101906020018083116109af57829003601f168201915b5050505050905090565b60006109ea6109e36113c1565b84846113c5565b50600192915050565b60035490565b6000610a068484846114b1565b949350505050565b610a16611064565b610a55576040805162461bcd60e51b815260206004820181905260248201526000805160206128fe833981519152604482015290519081900360640190fd5b60088054911515600160a81b0260ff60a81b19909216919091179055565b60085460ff1690565b610a84611064565b610ac3576040805162461bcd60e51b815260206004820181905260248201526000805160206128fe833981519152604482015290519081900360640190fd5b806001600160a01b031663715018a66040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610afe57600080fd5b505af1158015610b12573d6000803e3d6000fd5b5050505050565b60006109ea610b266113c1565b84610b6d8560026000610b376113c1565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff61152f16565b6113c5565b6000610b84610b7f6113c1565b6111ce565b610bbf5760405162461bcd60e51b81526004018080602001828103825260308152602001806128856030913960400191505060405180910390fd5b6109ea8383611590565b610bd1611064565b610c10576040805162461bcd60e51b815260206004820181905260248201526000805160206128fe833981519152604482015290519081900360640190fd5b806001600160a01b0316636ef8d66d6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610afe57600080fd5b600a546000906001600160a01b03163314610c975760405162461bcd60e51b81526004018080602001828103825260268152602001806129f66026913960400191505060405180910390fd5b610ca2868786611662565b506000610cae85611694565b9050600080610cf286868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061169d92505050565b91509150610d018983856113c5565b6060610d0c826116bf565b9050610d1a8a8486846116e9565b5060019998505050505050505050565b610d3b610d356113c1565b82611998565b50565b6000805460ff16610d84576040805162461bcd60e51b815260206004820152601f60248201526000805160206127a4833981519152604482015290519081900360640190fd5b6000805460ff19169055610d99338484611662565b90506000805460ff1916600117905592915050565b610db6611064565b610df5576040805162461bcd60e51b815260206004820181905260248201526000805160206128fe833981519152604482015290519081900360640190fd5b806001600160a01b031663986502756040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610afe57600080fd5b600854600160a81b900460ff1681565b610e48611064565b610e87576040805162461bcd60e51b815260206004820181905260248201526000805160206128fe833981519152604482015290519081900360640190fd5b816001600160a01b031663f2fde38b826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b158015610edf57600080fd5b505af1158015610ef3573d6000803e3d6000fd5b505050505050565b60085461010090046001600160a01b031681565b6001600160a01b031660009081526001602052604090205490565b610f32611064565b610f71576040805162461bcd60e51b815260206004820181905260248201526000805160206128fe833981519152604482015290519081900360640190fd5b6005546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600580546001600160a01b0319169055565b610fc3611064565b611002576040805162461bcd60e51b815260206004820181905260248201526000805160206128fe833981519152604482015290519081900360640190fd5b600880546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b611033336111ce565b15611047576110428282611998565b611051565b6110518282611a33565b5050565b6005546001600160a01b031690565b6005546000906001600160a01b031661107b6113c1565b6001600160a01b031614905090565b60078054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109cc5780601f106109a1576101008083540402835291602001916109cc565b6110f6610b7f6113c1565b6111315760405162461bcd60e51b81526004018080602001828103825260308152602001806128856030913960400191505060405180910390fd5b610d3b81611a3d565b61114a6111456113c1565b611a85565b565b60006109ea6111596113c1565b84610b6d85604051806060016040528060258152602001612a4660259139600260006111836113c1565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff611acd16565b60006109ea6111c76113c1565b8484611b27565b60006111e160048363ffffffff611bfd16565b92915050565b60006111f384846109d6565b6111fc57600080fd5b611208338585856116e9565b5060019392505050565b600a546001600160a01b031681565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6000805460ff16611292576040805162461bcd60e51b815260206004820152601f60248201526000805160206127a4833981519152604482015290519081900360640190fd5b6000805460ff191690556112a7338084611662565b90506000805460ff19166001179055919050565b6000805460ff16611301576040805162461bcd60e51b815260206004820152601f60248201526000805160206127a4833981519152604482015290519081900360640190fd5b6000805460ff19169055610d99833384611c64565b61131e611064565b61135d576040805162461bcd60e51b815260206004820181905260248201526000805160206128fe833981519152604482015290519081900360640190fd5b610d3b81611dc9565b6000805460ff166113ac576040805162461bcd60e51b815260206004820152601f60248201526000805160206127a4833981519152604482015290519081900360640190fd5b6000805460ff191690556112a7338084611c64565b3390565b6001600160a01b03831661140a5760405162461bcd60e51b81526004018080602001828103825260248152602001806129aa6024913960400191505060405180910390fd5b6001600160a01b03821661144f5760405162461bcd60e51b815260040180806020018281038252602281526020018061280c6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60006114be848484611b27565b611208846114ca6113c1565b610b6d856040518060600160405280602881526020016128d6602891396001600160a01b038a166000908152600260205260408120906115086113c1565b6001600160a01b03168152602081019190915260400160002054919063ffffffff611acd16565b600082820183811015611589576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b61159a8282611e6a565b600854600160a81b900460ff1680156115c2575060085461010090046001600160a01b031615155b156110515760085460408051634a39314960e01b81526000600482018190526001600160a01b03868116602484015260448301869052925161010090940490921692634a39314992606480840193602093929083900390910190829087803b15801561162d57600080fd5b505af1158015611641573d6000803e3d6000fd5b505050506040513d602081101561165757600080fd5b505161105157600080fd5b60006116768361167184611694565b611590565b600a54611208906001600160a01b031685308563ffffffff611f5c16565b633b9aca000290565b60008082516040146116ae57600080fd5b505060208101516040909101519091565b60408051602080825281830190925260609160208201818038833950505060208101929092525090565b632139e50b60e11b6116fb8482611fb6565b6117365760405162461bcd60e51b815260040180806020018281038252603181526020018061282e6031913960400191505060405180910390fd5b60006060856001600160a01b0316838888888860405160240180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156117bf5781810151838201526020016117a7565b50505050905090810190601f1680156117ec5780820380516001836020036101000a031916815260200191505b5060408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909a16999099178952518151919890975087965094509250829150849050835b602083106118545780518252601f199092019160209182019101611835565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146118b6576040519150601f19603f3d011682016040523d82523d6000602084013e6118bb565b606091505b509150915081819061194b5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119105781810151838201526020016118f8565b50505050905090810190601f16801561193d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50602081015191508161198f5760405162461bcd60e51b81526004018080602001828103825260288152602001806129ce6028913960400191505060405180910390fd5b50505050505050565b6119a28282611fd2565b600854600160a81b900460ff1680156119ca575060085461010090046001600160a01b031615155b156110515760085460408051634a39314960e01b81526001600160a01b0385811660048301526000602483018190526044830186905292516101009094041692634a39314992606480840193602093929083900390910190829087803b15801561162d57600080fd5b61105182826120ce565b611a4e60048263ffffffff61212216565b6040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b611a9660048263ffffffff6121a316565b6040516001600160a01b038216907fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669290600090a250565b60008184841115611b1f5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156119105781810151838201526020016118f8565b505050900390565b611b3283838361220a565b600854600160a81b900460ff168015611b5a575060085461010090046001600160a01b031615155b15611bf85760085460408051634a39314960e01b81526001600160a01b038681166004830152858116602483015260448201859052915161010090930490911691634a393149916064808201926020929091908290030181600087803b158015611bc357600080fd5b505af1158015611bd7573d6000803e3d6000fd5b505050506040513d6020811015611bed57600080fd5b5051611bf857600080fd5b505050565b60006001600160a01b038216611c445760405162461bcd60e51b815260040180806020018281038252602281526020018061291e6022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b6000611c708383611998565b6000611c7b83612368565b600a54604080516370a0823160e01b815230600482015290519293506000926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b158015611ccc57600080fd5b505afa158015611ce0573d6000803e3d6000fd5b505050506040513d6020811015611cf657600080fd5b5051905081811015611da057600a546001600160a01b03166340c10f1930611d24858563ffffffff61237216565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015611d7357600080fd5b505af1158015611d87573d6000803e3d6000fd5b505050506040513d6020811015611d9d57600080fd5b50505b600a54611dbd906001600160a01b0316878463ffffffff6123b416565b50600195945050505050565b6001600160a01b038116611e0e5760405162461bcd60e51b81526004018080602001828103825260268152602001806127e66026913960400191505060405180910390fd5b6005546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038216611ec5576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600354611ed8908263ffffffff61152f16565b6003556001600160a01b038216600090815260016020526040902054611f04908263ffffffff61152f16565b6001600160a01b03831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261093a908590612402565b6000611fc1836125ba565b8015611589575061158983836125ed565b6001600160a01b0382166120175760405162461bcd60e51b81526004018080602001828103825260218152602001806129646021913960400191505060405180910390fd5b61205a816040518060600160405280602281526020016127c4602291396001600160a01b038516600090815260016020526040902054919063ffffffff611acd16565b6001600160a01b038316600090815260016020526040902055600354612086908263ffffffff61237216565b6003556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6120d88282611998565b611051826120e46113c1565b610b6d84604051806060016040528060248152602001612940602491396001600160a01b0388166000908152600260205260408120906115086113c1565b61212c8282611bfd565b1561217e576040805162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b6121ad8282611bfd565b6121e85760405162461bcd60e51b81526004018080602001828103825260218152602001806128b56021913960400191505060405180910390fd5b6001600160a01b0316600090815260209190915260409020805460ff19169055565b6001600160a01b03831661224f5760405162461bcd60e51b81526004018080602001828103825260258152602001806129856025913960400191505060405180910390fd5b6001600160a01b0382166122945760405162461bcd60e51b81526004018080602001828103825260238152602001806127816023913960400191505060405180910390fd5b6122d78160405180606001604052806026815260200161285f602691396001600160a01b038616600090815260016020526040902054919063ffffffff611acd16565b6001600160a01b03808516600090815260016020526040808220939093559084168152205461230c908263ffffffff61152f16565b6001600160a01b0380841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b633b9aca00900490565b600061158983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611acd565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611bf89084905b612414826001600160a01b0316612613565b612465576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106124a35780518252601f199092019160209182019101612484565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612505576040519150601f19603f3d011682016040523d82523d6000602084013e61250a565b606091505b509150915081612561576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b80511561093a5780806020019051602081101561257d57600080fd5b505161093a5760405162461bcd60e51b815260040180806020018281038252602a815260200180612a1c602a913960400191505060405180910390fd5b60006125cd826301ffc9a760e01b6125ed565b80156111e157506125e6826001600160e01b03196125ed565b1592915050565b60008060006125fc858561264c565b9150915081801561260a5750805b95945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590610a06575050151592915050565b604080516001600160e01b0319831660248083019190915282518083039091018152604490910182526020810180516001600160e01b03166301ffc9a760e01b1781529151815160009384939284926060926001600160a01b038a169261753092879282918083835b602083106126d45780518252601f1990920191602091820191016126b5565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303818686fa925050503d8060008114612735576040519150601f19603f3d011682016040523d82523d6000602084013e61273a565b606091505b50915091506020815110156127585760008094509450505050612779565b8181806020019051602081101561276e57600080fd5b505190955093505050505b925092905056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573735265656e7472616e637947756172643a207265656e7472616e742063616c6c0045524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332304f6e417070726f76653a207370656e64657220646f65736e277420737570706f7274206f6e417070726f766545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654d696e746572526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204d696e74657220726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332304f6e417070726f76653a206661696c656420746f2063616c6c206f6e417070726f766557544f4e3a206f6e6c792061636365707420544f4e20617070726f76652063616c6c6261636b5361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820b9c2d3c1c3f479025a7ef17ad9483bef45595462f2fc820bc2ea5f485a9d790964736f6c634300050c0032
Verified Source Code Partial Match
Compiler: v0.5.12+commit.7709ece9
EVM: petersburg
Optimization: Yes (200 runs)
WTON.sol 1627 lines
// File: openzeppelin-solidity/contracts/GSN/Context.sol
pragma solidity ^0.5.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// File: openzeppelin-solidity/contracts/ownership/Ownable.sol
pragma solidity ^0.5.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* 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 () internal {
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(isOwner(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
return _msgSender() == _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 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 onlyOwner {
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
pragma solidity ^0.5.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, 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.
*
* _Available since v2.4.0._
*/
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.
*
* _Available since v2.4.0._
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
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.
*
* _Available since v2.4.0._
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
pragma solidity ^0.5.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
pragma solidity ^0.5.0;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20Mintable}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view 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 returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public 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 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 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 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 {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_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 {
require(account != address(0), "ERC20: mint to the zero address");
_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 {
require(account != address(0), "ERC20: burn from the zero address");
_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 is 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 {
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 Destroys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See {_burn} and {_approve}.
*/
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance"));
}
}
// File: openzeppelin-solidity/contracts/access/Roles.sol
pragma solidity ^0.5.0;
/**
* @title Roles
* @dev Library for managing addresses assigned to a Role.
*/
library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev Give an account access to this role.
*/
function add(Role storage role, address account) internal {
require(!has(role, account), "Roles: account already has role");
role.bearer[account] = true;
}
/**
* @dev Remove an account's access to this role.
*/
function remove(Role storage role, address account) internal {
require(has(role, account), "Roles: account does not have role");
role.bearer[account] = false;
}
/**
* @dev Check if an account has this role.
* @return bool
*/
function has(Role storage role, address account) internal view returns (bool) {
require(account != address(0), "Roles: account is the zero address");
return role.bearer[account];
}
}
// File: openzeppelin-solidity/contracts/access/roles/MinterRole.sol
pragma solidity ^0.5.0;
contract MinterRole is Context {
using Roles for Roles.Role;
event MinterAdded(address indexed account);
event MinterRemoved(address indexed account);
Roles.Role private _minters;
constructor () internal {
_addMinter(_msgSender());
}
modifier onlyMinter() {
require(isMinter(_msgSender()), "MinterRole: caller does not have the Minter role");
_;
}
function isMinter(address account) public view returns (bool) {
return _minters.has(account);
}
function addMinter(address account) public onlyMinter {
_addMinter(account);
}
function renounceMinter() public {
_removeMinter(_msgSender());
}
function _addMinter(address account) internal {
_minters.add(account);
emit MinterAdded(account);
}
function _removeMinter(address account) internal {
_minters.remove(account);
emit MinterRemoved(account);
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20Mintable.sol
pragma solidity ^0.5.0;
/**
* @dev Extension of {ERC20} that adds a set of accounts with the {MinterRole},
* which have permission to mint (create) new tokens as they see fit.
*
* At construction, the deployer of the contract is the only minter.
*/
contract ERC20Mintable is ERC20, MinterRole {
/**
* @dev See {ERC20-_mint}.
*
* Requirements:
*
* - the caller must have the {MinterRole}.
*/
function mint(address account, uint256 amount) public onlyMinter returns (bool) {
_mint(account, amount);
return true;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20Burnable.sol
pragma solidity ^0.5.0;
/**
* @dev Extension of {ERC20} that allows token holders to destroy both their own
* tokens and those that they have an allowance for, in a way that can be
* recognized off-chain (via event analysis).
*/
contract ERC20Burnable is Context, ERC20 {
/**
* @dev Destroys `amount` tokens from the caller.
*
* See {ERC20-_burn}.
*/
function burn(uint256 amount) public {
_burn(_msgSender(), amount);
}
/**
* @dev See {ERC20-_burnFrom}.
*/
function burnFrom(address account, uint256 amount) public {
_burnFrom(account, amount);
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol
pragma solidity ^0.5.0;
/**
* @dev Optional functions from the ERC20 standard.
*/
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
/**
* @dev Sets the values for `name`, `symbol`, and `decimals`. All three of
* these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view 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.
*
* 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 returns (uint8) {
return _decimals;
}
}
// File: openzeppelin-solidity/contracts/utils/Address.sol
pragma solidity ^0.5.5;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
/**
* @dev Converts an `address` into `address payable`. Note that this is
* simply a type cast: the actual underlying value is not changed.
*
* _Available since v2.4.0._
*/
function toPayable(address account) internal pure returns (address payable) {
return address(uint160(account));
}
/**
* @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].
*
* _Available since v2.4.0._
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-call-value
(bool success, ) = recipient.call.value(amount)("");
require(success, "Address: unable to send value, recipient may have reverted");
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol
pragma solidity ^0.5.0;
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
// File: openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol
pragma solidity ^0.5.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*
* _Since v2.5.0:_ this module is now much more gas efficient, given net gas
* metering changes introduced in the Istanbul hardfork.
*/
contract ReentrancyGuard {
bool private _notEntered;
constructor () internal {
// Storing an initial non-zero value makes deployment a bit more
// expensive, but in exchange the refund on every call to nonReentrant
// will be lower in amount. Since refunds are capped to a percetange of
// the total transaction's gas, it is best to keep them low in cases
// like this one, to increase the likelihood of the full refund coming
// into effect.
_notEntered = true;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_notEntered, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_notEntered = false;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_notEntered = true;
}
}
// File: openzeppelin-solidity/contracts/introspection/IERC165.sol
pragma solidity ^0.5.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// File: openzeppelin-solidity/contracts/introspection/ERC165.sol
pragma solidity ^0.5.0;
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts may inherit from this and call {_registerInterface} to declare
* their support of an interface.
*/
contract ERC165 is IERC165 {
/*
* bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7
*/
bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;
/**
* @dev Mapping of interface ids to whether or not it's supported.
*/
mapping(bytes4 => bool) private _supportedInterfaces;
constructor () internal {
// Derived contracts need only register support for their own interfaces,
// we register support for ERC165 itself here
_registerInterface(_INTERFACE_ID_ERC165);
}
/**
* @dev See {IERC165-supportsInterface}.
*
* Time complexity O(1), guaranteed to always use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool) {
return _supportedInterfaces[interfaceId];
}
/**
* @dev Registers the contract as an implementer of the interface defined by
* `interfaceId`. Support of the actual ERC165 interface is automatic and
* registering its interface id is not required.
*
* See {IERC165-supportsInterface}.
*
* Requirements:
*
* - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
*/
function _registerInterface(bytes4 interfaceId) internal {
require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
_supportedInterfaces[interfaceId] = true;
}
}
// File: openzeppelin-solidity/contracts/introspection/ERC165Checker.sol
pragma solidity ^0.5.10;
/**
* @dev Library used to query support of an interface declared via {IERC165}.
*
* Note that these functions return the actual result of the query: they do not
* `revert` if an interface is not supported. It is up to the caller to decide
* what to do in these cases.
*/
library ERC165Checker {
// As per the EIP-165 spec, no interface should ever match 0xffffffff
bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff;
/*
* bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7
*/
bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;
/**
* @dev Returns true if `account` supports the {IERC165} interface,
*/
function _supportsERC165(address account) internal view returns (bool) {
// Any contract that implements ERC165 must explicitly indicate support of
// InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid
return _supportsERC165Interface(account, _INTERFACE_ID_ERC165) &&
!_supportsERC165Interface(account, _INTERFACE_ID_INVALID);
}
/**
* @dev Returns true if `account` supports the interface defined by
* `interfaceId`. Support for {IERC165} itself is queried automatically.
*
* See {IERC165-supportsInterface}.
*/
function _supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
// query support of both ERC165 as per the spec and support of _interfaceId
return _supportsERC165(account) &&
_supportsERC165Interface(account, interfaceId);
}
/**
* @dev Returns true if `account` supports all the interfaces defined in
* `interfaceIds`. Support for {IERC165} itself is queried automatically.
*
* Batch-querying can lead to gas savings by skipping repeated checks for
* {IERC165} support.
*
* See {IERC165-supportsInterface}.
*/
function _supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {
// query support of ERC165 itself
if (!_supportsERC165(account)) {
return false;
}
// query support of each interface in _interfaceIds
for (uint256 i = 0; i < interfaceIds.length; i++) {
if (!_supportsERC165Interface(account, interfaceIds[i])) {
return false;
}
}
// all interfaces supported
return true;
}
/**
* @notice Query if a contract implements an interface, does not check ERC165 support
* @param account The address of the contract to query for support of an interface
* @param interfaceId The interface identifier, as specified in ERC-165
* @return true if the contract at account indicates support of the interface with
* identifier interfaceId, false otherwise
* @dev Assumes that account contains a contract that supports ERC165, otherwise
* the behavior of this method is undefined. This precondition can be checked
* with the `supportsERC165` method in this library.
* Interface identification is specified in ERC-165.
*/
function _supportsERC165Interface(address account, bytes4 interfaceId) private view returns (bool) {
// success determines whether the staticcall succeeded and result determines
// whether the contract at account indicates support of _interfaceId
(bool success, bool result) = _callERC165SupportsInterface(account, interfaceId);
return (success && result);
}
/**
* @notice Calls the function with selector 0x01ffc9a7 (ERC165) and suppresses throw
* @param account The address of the contract to query for support of an interface
* @param interfaceId The interface identifier, as specified in ERC-165
* @return success true if the STATICCALL succeeded, false otherwise
* @return result true if the STATICCALL succeeded and the contract at account
* indicates support of the interface with identifier interfaceId, false otherwise
*/
function _callERC165SupportsInterface(address account, bytes4 interfaceId)
private
view
returns (bool, bool)
{
bytes memory encodedParams = abi.encodeWithSelector(_INTERFACE_ID_ERC165, interfaceId);
(bool success, bytes memory result) = account.staticcall.gas(30000)(encodedParams);
if (result.length < 32) return (false, false);
return (success, abi.decode(result, (bool)));
}
}
// File: coinage-token/contracts/lib/DSMath.sol
// https://github.com/dapphub/ds-math/blob/de45767/src/math.sol
/// math.sol -- mixin for inline numerical wizardry
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity >0.4.13;
contract DSMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, "ds-math-add-overflow");
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, "ds-math-sub-underflow");
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, "ds-math-mul-overflow");
}
function min(uint x, uint y) internal pure returns (uint z) {
return x <= y ? x : y;
}
function max(uint x, uint y) internal pure returns (uint z) {
return x >= y ? x : y;
}
function imin(int x, int y) internal pure returns (int z) {
return x <= y ? x : y;
}
function imax(int x, int y) internal pure returns (int z) {
return x >= y ? x : y;
}
uint constant WAD = 10 ** 18;
uint constant RAY = 10 ** 27;
function wmul(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, y), WAD / 2) / WAD;
}
function rmul(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, y), RAY / 2) / RAY;
}
function wdiv(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, WAD), y / 2) / y;
}
function rdiv(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, RAY), y / 2) / y;
}
// This famous algorithm is called "exponentiation by squaring"
// and calculates x^n with x as fixed-point and n as regular unsigned.
//
// It's O(log n), instead of O(n) for naive repeated multiplication.
//
// These facts are why it works:
//
// If n is even, then x^n = (x^2)^(n/2).
// If n is odd, then x^n = x * x^(n-1),
// and applying the equation for even x gives
// x^n = x * (x^2)^((n-1) / 2).
//
// Also, EVM division is flooring and
// floor[(n-1) / 2] = floor[n / 2].
//
function wpow(uint x, uint n) internal pure returns (uint z) {
z = n % 2 != 0 ? x : WAD;
for (n /= 2; n != 0; n /= 2) {
x = wmul(x, x);
if (n % 2 != 0) {
z = wmul(z, x);
}
}
}
function rpow(uint x, uint n) internal pure returns (uint z) {
z = n % 2 != 0 ? x : RAY;
for (n /= 2; n != 0; n /= 2) {
x = rmul(x, x);
if (n % 2 != 0) {
z = rmul(z, x);
}
}
}
}
// File: contracts/stake/interfaces/SeigManagerI.sol
pragma solidity ^0.5.12;
interface SeigManagerI {
function registry() external view returns (address);
function depositManager() external view returns (address);
function ton() external view returns (address);
function wton() external view returns (address);
function powerton() external view returns (address);
function tot() external view returns (address);
function coinages(address layer2) external view returns (address);
function commissionRates(address layer2) external view returns (uint256);
function lastCommitBlock(address layer2) external view returns (uint256);
function seigPerBlock() external view returns (uint256);
function lastSeigBlock() external view returns (uint256);
function pausedBlock() external view returns (uint256);
function unpausedBlock() external view returns (uint256);
function DEFAULT_FACTOR() external view returns (uint256);
function deployCoinage(address layer2) external returns (bool);
function setCommissionRate(address layer2, uint256 commission, bool isCommissionRateNegative) external returns (bool);
function uncomittedStakeOf(address layer2, address account) external view returns (uint256);
function stakeOf(address layer2, address account) external view returns (uint256);
function additionalTotBurnAmount(address layer2, address account, uint256 amount) external view returns (uint256 totAmount);
function onTransfer(address sender, address recipient, uint256 amount) external returns (bool);
function updateSeigniorage() external returns (bool);
function onDeposit(address layer2, address account, uint256 amount) external returns (bool);
function onWithdraw(address layer2, address account, uint256 amount) external returns (bool);
}
// File: contracts/stake/tokens/OnApprove.sol
pragma solidity ^0.5.12;
contract OnApprove is ERC165 {
constructor() public {
_registerInterface(OnApprove(this).onApprove.selector);
}
function onApprove(address owner, address spender, uint256 amount, bytes calldata data) external returns (bool);
}
// File: contracts/stake/tokens/ERC20OnApprove.sol
pragma solidity ^0.5.12;
contract ERC20OnApprove is ERC20 {
function approveAndCall(address spender, uint256 amount, bytes memory data) public returns (bool) {
require(approve(spender, amount));
_callOnApprove(msg.sender, spender, amount, data);
return true;
}
function _callOnApprove(address owner, address spender, uint256 amount, bytes memory data) internal {
bytes4 onApproveSelector = OnApprove(spender).onApprove.selector;
require(ERC165Checker._supportsInterface(spender, onApproveSelector),
"ERC20OnApprove: spender doesn't support onApprove");
(bool ok, bytes memory res) = spender.call(
abi.encodeWithSelector(
onApproveSelector,
owner,
spender,
amount,
data
)
);
// check if low-level call reverted or not
require(ok, string(res));
assembly {
ok := mload(add(res, 0x20))
}
// check if OnApprove.onApprove returns true or false
require(ok, "ERC20OnApprove: failed to call onApprove");
}
}
// File: contracts/stake/tokens/AuthController.sol
pragma solidity ^0.5.12;
interface MinterRoleRenounceTarget {
function renounceMinter() external;
}
interface PauserRoleRenounceTarget {
function renouncePauser() external;
}
interface OwnableTarget {
function renounceOwnership() external;
function transferOwnership(address newOwner) external;
}
contract AuthController is Ownable {
function renounceMinter(address target) public onlyOwner {
MinterRoleRenounceTarget(target).renounceMinter();
}
function renouncePauser(address target) public onlyOwner {
PauserRoleRenounceTarget(target).renouncePauser();
}
function renounceOwnership(address target) public onlyOwner {
OwnableTarget(target).renounceOwnership();
}
function transferOwnership(address target, address newOwner) public onlyOwner {
OwnableTarget(target).transferOwnership(newOwner);
}
}
// File: contracts/stake/tokens/SeigToken.sol
pragma solidity ^0.5.12;
contract SeigToken is ERC20, Ownable, ERC20OnApprove, AuthController {
SeigManagerI public seigManager;
bool public callbackEnabled;
function enableCallback(bool _callbackEnabled) external onlyOwner {
callbackEnabled = _...
// [truncated — 55591 bytes total]
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
callbackEnabled 0x63380113 → bool
decimals 0x313ce567 → uint8
isMinter 0xaa271e1a → bool
isOwner 0x8f32d59b → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
seigManager 0x6fb7f558 → address
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
ton 0xcc48b947 → address
totalSupply 0x18160ddd → uint256
Write Contract 25 functions
These functions modify contract state and require a wallet transaction to execute.
addMinter 0x983b2d56
address account
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
approveAndCall 0xcae9ca51
address spender
uint256 amount
bytes data
returns: bool
burn 0x42966c68
uint256 amount
burnFrom 0x79cc6790
address account
uint256 amount
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
enableCallback 0x3113ed5c
bool _callbackEnabled
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
mint 0x40c10f19
address account
uint256 amount
returns: bool
onApprove 0x4273ca16
address owner
address spender
uint256 tonAmount
bytes data
returns: bool
renounceMinter 0x5f112c68
address target
renounceMinter 0x98650275
No parameters
renounceOwnership 0x38bf3cfa
address target
renounceOwnership 0x715018a6
No parameters
renouncePauser 0x41eb24bb
address target
renounceTonMinter 0x05eeb9f7
No parameters
setSeigManager 0x7657f20a
address _seigManager
swapFromTON 0xe34869d7
uint256 tonAmount
returns: bool
swapFromTONAndTransfer 0x588420b7
address to
uint256 tonAmount
returns: bool
swapToTON 0xf53fe70f
uint256 wtonAmount
returns: bool
swapToTONAndTransfer 0xe3b99e85
address to
uint256 wtonAmount
returns: bool
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0x6d435421
address target
address newOwner
transferOwnership 0xf2fde38b
address newOwner
Top Interactions
| Address | Txns | Sent | Received |
|---|---|---|---|
| 0x8777d04A...7d3E | 1 | 1 | |
| 0x500C6d28...43ad | 1 | 1 |
Recent Transactions
|
| Hash | Block | Age | From/To | Value | |
|---|---|---|---|---|---|
| 0xe3349c7e...7d6bf0 | 24,454,763 | IN | 0x8777d04A...7d3E | 0 ETH | |
| 0x67dbaf22...a31f23 | 24,454,743 | IN | 0x500C6d28...43ad | 0 ETH |