Address Contract Partially Verified
Address
0xcfcEcFe2bD2FED07A9145222E8a7ad9Cf1Ccd22A
Balance
0 ETH
Nonce
1
Code Size
12043 bytes
Creator
0xb6fe3854...AE1f at tx 0x175e5a5e...25e99d
Indexed Transactions
0
Contract Bytecode
12043 bytes
0x608060405234801561001057600080fd5b50600436106102415760003560e01c80636ef8d66d116101455780639d590d07116100bd578063a9059cbb1161008c578063be76ebe511610071578063be76ebe5146107ee578063dd62ed3e14610827578063dfe11cf11461086257610241565b8063a9059cbb14610782578063aa271e1a146107bb57610241565b80639d590d07146106db5780639f727c2714610708578063a2ded11514610710578063a457c2d71461074957610241565b80638456cb591161011457806395d89b41116100f957806395d89b4114610698578063983b2d56146106a057806398650275146106d357610241565b80638456cb591461065d5780638a6db9c31461066557610241565b80636ef8d66d146105bc5780637065cb48146105c457806370a08231146105f757806382dc1ec41461062a57610241565b80633092afd5116101d857806346fbf68e116101a75780635c975abb1161018c5780635c975abb14610548578063643edef9146105505780636b2c0f551461058957610241565b806346fbf68e146104b457806355385c07146104e757610241565b80633092afd514610422578063313ce5671461045557806339509351146104735780633f4ba83a146104ac57610241565b806323b872dd1161021457806323b872dd1461035f57806328c23a45146103a25780632f4c1f90146103aa5780632f54bf6e146103ef57610241565b806306fdde0314610246578063095ea7b3146102c357806317ffc3201461031057806318160ddd14610345575b600080fd5b61024e6108b3565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610288578181015183820152602001610270565b50505050905090810190601f1680156102b55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102fc600480360360408110156102d957600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610967565b604080519115158252519081900360200190f35b6103436004803603602081101561032657600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166109ed565b005b61034d610b23565b60408051918252519081900360200190f35b6102fc6004803603606081101561037557600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610b29565b610343610bb1565b610343600480360360608110156103c057600080fd5b50803590602081013567ffffffffffffffff1690604001356fffffffffffffffffffffffffffffffff16610bc3565b6102fc6004803603602081101561040557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610c45565b6103436004803603602081101561043857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610c5e565b61045d610cd5565b6040805160ff9092168252519081900360200190f35b6102fc6004803603604081101561048957600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610cde565b610343610d5d565b6102fc600480360360208110156104ca57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610eae565b610343600480360360808110156104fd57600080fd5b50803573ffffffffffffffffffffffffffffffffffffffff1690602081013590604081013567ffffffffffffffff1690606001356fffffffffffffffffffffffffffffffff16610ec8565b6102fc610fc3565b6102fc6004803603604081101561056657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610fcc565b6103436004803603602081101561059f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611041565b6103436110aa565b610343600480360360208110156105da57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166110ba565b61034d6004803603602081101561060d57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611123565b6103436004803603602081101561064057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661114b565b6103436111b4565b61034d6004803603602081101561067b57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166112da565b61024e611302565b610343600480360360208110156106b657600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611381565b6103436113ef565b610343600480360360408110156106f157600080fd5b508035906020013567ffffffffffffffff166113ff565b61034361147d565b6102fc6004803603604081101561072657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013561152a565b6102fc6004803603604081101561075f57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356115e5565b6102fc6004803603604081101561079857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135611664565b6102fc600480360360208110156107d157600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166116e3565b6102fc6004803603604081101561080457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356116ee565b61034d6004803603604081101561083d57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602001351661178c565b6102fc6004803603608081101561087857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060208101359067ffffffffffffffff604082013581169160600135166117c4565b60038054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561095d5780601f106109325761010080835404028352916020019161095d565b820191906000526020600020905b81548152906001019060200180831161094057829003601f168201915b5050505050905090565b60075460009060ff16156109dc57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b6109e68383611980565b9392505050565b6109fd6109f8611994565b610c45565b610a52576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180612d61602e913960400191505060405180910390fd5b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905160009173ffffffffffffffffffffffffffffffffffffffff8416916370a0823191602480820192602092909190829003018186803b158015610ac257600080fd5b505afa158015610ad6573d6000803e3d6000fd5b505050506040513d6020811015610aec57600080fd5b50519050610b1f610afb611994565b73ffffffffffffffffffffffffffffffffffffffff8416908363ffffffff61199816565b5050565b60025490565b60075460009060ff1615610b9e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b610ba9848484611a25565b949350505050565b610bc1610bbc611994565b611a98565b565b60075460ff1615610c3557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b610c40838383611aed565b505050565b6000610c5860088363ffffffff611b8016565b92915050565b610c696109f8611994565b610cbe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180612d61602e913960400191505060405180910390fd5b610cc9816000611c1b565b610cd281611cda565b50565b60055460ff1690565b60075460009060ff1615610d5357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b6109e68383611d2f565b610d6d610d68611994565b610eae565b610dc2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526030815260200180612c586030913960400191505060405180910390fd5b60075460ff16610e3357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b600780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa610e84611994565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190a1565b6000610eb982611d90565b80610c585750610c5882610c45565b60075460ff1615610f3a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b610f4382611da3565b604080518481526fffffffffffffffffffffffffffffffff83166020820152815167ffffffffffffffff85169273ffffffffffffffffffffffffffffffffffffffff8816927fba50aca5f20ac3dbd86e8ed7d3ce4a1412e8927a87b28583989b7e0372470c76929081900390910190a3610fbd8484611ea6565b50505050565b60075460ff1690565b6000610fd96109f8611994565b61102e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180612d61602e913960400191505060405180910390fd5b6110388383611c1b565b50600192915050565b61104c6109f8611994565b6110a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180612d61602e913960400191505060405180910390fd5b610cd281611f07565b610bc16110b5611994565b611f07565b6110c56109f8611994565b61111a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180612d61602e913960400191505060405180910390fd5b610cd281611f5c565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b611156610d68611994565b6111ab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526030815260200180612c586030913960400191505060405180910390fd5b610cd281611fb1565b6111bf610d68611994565b611214576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526030815260200180612c586030913960400191505060405180910390fd5b60075460ff161561128657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b600780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610e84611994565b73ffffffffffffffffffffffffffffffffffffffff166000908152600a602052604090205490565b60048054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561095d5780601f106109325761010080835404028352916020019161095d565b61139161138c611994565b6116e3565b6113e6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526030815260200180612d316030913960400191505060405180910390fd5b610cd281612006565b610bc16113fa611994565b611cda565b60075460ff161561147157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b610b1f82826000611aed565b6114886109f8611994565b6114dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180612d61602e913960400191505060405180910390fd5b6114e5611994565b73ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610cd2573d6000803e3d6000fd5b60006115376109f8611994565b61158c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180612d61602e913960400191505060405180910390fd5b611038836115e084604051806060016040528060308152602001612caa6030913973ffffffffffffffffffffffffffffffffffffffff88166000908152600a6020526040902054919063ffffffff61205b16565b611c1b565b60075460009060ff161561165a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b6109e6838361210c565b60075460009060ff16156116d957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b6109e68383612187565b6000610eb98261219b565b60006116fb6109f8611994565b611750576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180612d61602e913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff83166000908152600a60205260409020546110389084906115e0908563ffffffff6121ae16565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b60006117d161138c611994565b611826576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526030815260200180612d316030913960400191505060405180910390fd5b60075460ff161561189857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b6118a183611da3565b6040805167ffffffffffffffff84811682526020820187905282519086169273ffffffffffffffffffffffffffffffffffffffff8916927fc827015d9c397e6928e53a714990475428a406192b1dcdec7f03dab0397dd9c7929081900390910190a361190d8585612222565b611975611918611994565b6115e086604051806060016040528060318152602001612d0060319139600a6000611941611994565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160002054919063ffffffff61205b16565b506001949350505050565b600061103861198d611994565b8484612353565b3390565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610c4090849061249a565b6000611a328484846126d8565b611a8e84611a3e611994565b611a8985604051806060016040528060288152602001612db06028913973ffffffffffffffffffffffffffffffffffffffff8a16600090815260016020526040812090611941611994565b612353565b5060019392505050565b611aa960088263ffffffff6128a916565b60405173ffffffffffffffffffffffffffffffffffffffff8216907f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90600090a250565b611af682611da3565b8167ffffffffffffffff16611b09611994565b604080518681526fffffffffffffffffffffffffffffffff85166020820152815173ffffffffffffffffffffffffffffffffffffffff93909316927fba50aca5f20ac3dbd86e8ed7d3ce4a1412e8927a87b28583989b7e0372470c76929181900390910190a3610c40611b7a611994565b84612955565b600073ffffffffffffffffffffffffffffffffffffffff8216611bee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612dd86022913960400191505060405180910390fd5b5073ffffffffffffffffffffffffffffffffffffffff166000908152602091909152604090205460ff1690565b611c24826116e3565b611c79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526032815260200180612c266032913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166000818152600a6020908152604091829020849055815184815291517ffb033db91d06a612766244cffe6d52a4643bbdba04ee19b9dca3c43b2e03fe029281900390910190a25050565b611ceb60098263ffffffff6128a916565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669290600090a250565b6000611038611d3c611994565b84611a898560016000611d4d611994565b73ffffffffffffffffffffffffffffffffffffffff908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff6121ae16565b6000610c5860068363ffffffff611b8016565b6000611d0f60075b60028160ff1610611e305767ffffffffffffffff8416600882810260ff9081169290921c84821c831618600481901c600f16189450908416600585901b611fe016600c86901b620ff000169490921b62ffff0016939093181891909118907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01611dab565b5061ffff81811690841614610c4057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f577261707065644144533a20696e76616c696420414453206164647265737300604482015290519081900360640190fd5b611eb08282612955565b610b1f82611ebc611994565b611a8984604051806060016040528060248152602001612dfa6024913973ffffffffffffffffffffffffffffffffffffffff8816600090815260016020526040812090611941611994565b611f1860068263ffffffff6128a916565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e90600090a250565b611f6d60088263ffffffff612a9f16565b60405173ffffffffffffffffffffffffffffffffffffffff8216907f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c390600090a250565b611fc260068263ffffffff612a9f16565b60405173ffffffffffffffffffffffffffffffffffffffff8216907f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f890600090a250565b61201760098263ffffffff612a9f16565b60405173ffffffffffffffffffffffffffffffffffffffff8216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b60008184841115612104576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156120c95781810151838201526020016120b1565b50505050905090810190601f1680156120f65780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000611038612119611994565b84611a8985604051806060016040528060258152602001612eb26025913960016000612143611994565b73ffffffffffffffffffffffffffffffffffffffff908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff61205b16565b6000611038612194611994565b84846126d8565b6000610c5860098363ffffffff611b8016565b6000828201838110156109e657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff82166122a457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6002546122b7908263ffffffff6121ae16565b60025573ffffffffffffffffffffffffffffffffffffffff82166000908152602081905260409020546122f0908263ffffffff6121ae16565b73ffffffffffffffffffffffffffffffffffffffff83166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b73ffffffffffffffffffffffffffffffffffffffff83166123bf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612e646024913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff821661242b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612c886022913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6124b98273ffffffffffffffffffffffffffffffffffffffff16612b65565b61252457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b6020831061258d57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101612550565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146125ef576040519150601f19603f3d011682016040523d82523d6000602084013e6125f4565b606091505b50915091508161266557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115610fbd5780806020019051602081101561268157600080fd5b5051610fbd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180612e88602a913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8316612744576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612e3f6025913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166127b0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612be16023913960400191505060405180910390fd5b61280081604051806060016040528060268152602001612cda6026913973ffffffffffffffffffffffffffffffffffffffff8616600090815260208190526040902054919063ffffffff61205b16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152602081905260408082209390935590841681522054612842908263ffffffff6121ae16565b73ffffffffffffffffffffffffffffffffffffffff8084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6128b38282611b80565b612908576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612d8f6021913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff1660009081526020919091526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b73ffffffffffffffffffffffffffffffffffffffff82166129c1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612e1e6021913960400191505060405180910390fd5b612a1181604051806060016040528060228152602001612c046022913973ffffffffffffffffffffffffffffffffffffffff8516600090815260208190526040902054919063ffffffff61205b16565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260208190526040902055600254612a4a908263ffffffff612b9e16565b60025560408051828152905160009173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b612aa98282611b80565b15612b1557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff1660009081526020919091526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590610ba9575050151592915050565b60006109e683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061205b56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e6365577261707065644144533a206d696e74657220617070726f766520666f72206e6f6e2d6d696e74696e672061646472657373506175736572526f6c653a2063616c6c657220646f6573206e6f742068617665207468652050617573657220726f6c6545524332303a20617070726f766520746f20746865207a65726f2061646472657373577261707065644144533a20646563726561736564206d696e746572416c6c6f77616e63652062656c6f77207a65726f45524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365577261707065644144533a206d696e74656420616d6f756e742065786365656473206d696e746572416c6c6f77616e63654d696e746572526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204d696e74657220726f6c654f776e6572526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204f776e657220726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a723158201d7220336f2965df40f860e5aa7e9b07b4c7f038659d6524e7d374f08dfcd0fd64736f6c63430005110032
Verified Source Code Partial Match
Compiler: v0.5.17+commit.d19bba13
EVM: istanbul
Optimization: Yes (100000 runs)
WrappedADS.sol 1117 lines
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;
}
}
/**
* @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;
}
}
/**
* @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);
}
/**
* @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"));
}
}
/**
* @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;
}
}
contract PauserRole is Context {
using Roles for Roles.Role;
event PauserAdded(address indexed account);
event PauserRemoved(address indexed account);
Roles.Role private _pausers;
constructor () internal {
_addPauser(_msgSender());
}
modifier onlyPauser() {
require(isPauser(_msgSender()), "PauserRole: caller does not have the Pauser role");
_;
}
function isPauser(address account) public view returns (bool) {
return _pausers.has(account);
}
function addPauser(address account) public onlyPauser {
_addPauser(account);
}
function renouncePauser() public {
_removePauser(_msgSender());
}
function _addPauser(address account) internal {
_pausers.add(account);
emit PauserAdded(account);
}
function _removePauser(address account) internal {
_pausers.remove(account);
emit PauserRemoved(account);
}
}
/**
* @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.
*/
contract Pausable is Context, PauserRole {
/**
* @dev Emitted when the pause is triggered by a pauser (`account`).
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by a pauser (`account`).
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state. Assigns the Pauser role
* to the deployer.
*/
constructor () internal {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!_paused, "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(_paused, "Pausable: not paused");
_;
}
/**
* @dev Called by a pauser to pause, triggers stopped state.
*/
function pause() public onlyPauser whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Called by a pauser to unpause, returns to normal state.
*/
function unpause() public onlyPauser whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
/**
* @title Pausable token
* @dev ERC20 with pausable transfers and allowances.
*
* Useful if you want to stop trades until the end of a crowdsale, or have
* an emergency switch for freezing all token transfers in the event of a large
* bug.
*/
contract ERC20Pausable is ERC20, Pausable {
function transfer(address to, uint256 value) public whenNotPaused returns (bool) {
return super.transfer(to, value);
}
function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) {
return super.transferFrom(from, to, value);
}
function approve(address spender, uint256 value) public whenNotPaused returns (bool) {
return super.approve(spender, value);
}
function increaseAllowance(address spender, uint256 addedValue) public whenNotPaused returns (bool) {
return super.increaseAllowance(spender, addedValue);
}
function decreaseAllowance(address spender, uint256 subtractedValue) public whenNotPaused returns (bool) {
return super.decreaseAllowance(spender, subtractedValue);
}
}
/**
* @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");
}
}
/**
* @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");
}
}
}
/**
* @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];
}
}
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);
}
}
contract OwnerRole is Context {
using Roles for Roles.Role;
event OwnerAdded(address indexed account);
event OwnerRemoved(address indexed account);
Roles.Role private _owners;
constructor () internal {
_addOwner(_msgSender());
}
modifier onlyOwner() {
require(isOwner(_msgSender()), "OwnerRole: caller does not have the Owner role");
_;
}
function isOwner(address account) public view returns (bool) {
return _owners.has(account);
}
function addOwner(address account) public onlyOwner {
_addOwner(account);
}
function renounceOwner() public {
_removeOwner(_msgSender());
}
function _addOwner(address account) internal {
_owners.add(account);
emit OwnerAdded(account);
}
function _removeOwner(address account) internal {
_owners.remove(account);
emit OwnerRemoved(account);
}
}
contract WrappedADS is ERC20, ERC20Detailed, ERC20Pausable, OwnerRole, MinterRole {
using SafeMath for uint256;
using SafeERC20 for IERC20;
mapping (address => uint256) private _minterAllowances;
constructor () public ERC20Detailed("Adshares", "ADS", 11) {
}
/**
* Wraps received native ADS tokens and mint wrapped tokens. Logs native tx sender and id.
*/
function wrapTo(address account, uint256 amount, uint64 from, uint64 txid) public onlyMinter whenNotPaused returns (bool) {
_checksumCheck(from);
emit Wrap(account, from, txid, amount);
_mint(account, amount);
_minterApprove(_msgSender(), _minterAllowances[_msgSender()].sub(amount, "WrappedADS: minted amount exceeds minterAllowance"));
return true;
}
/**
* Unwrap and destroy `amount` tokens from the caller. Logs native ADS address to receive unwrapped tokens.
*
*/
function unwrap(uint256 amount, uint64 to) public whenNotPaused {
_unwrap(amount, to, 0);
}
/**
* Unwrap and destroy `amount` tokens from the caller. Logs native ADS address to receive unwrapped tokens.
*
*/
function unwrapMessage(uint256 amount, uint64 to, uint128 message) public whenNotPaused {
_unwrap(amount, to, message);
}
function _unwrap(uint256 amount, uint64 to, uint128 message) internal {
_checksumCheck(to);
emit Unwrap(_msgSender(), to, amount, message);
_burn(_msgSender(), amount);
}
/**
* Unwraps and destroys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
* Logs native ADS address to receive unwrapped tokens.
*/
function unwrapFrom(address account, uint256 amount, uint64 to, uint128 message) public whenNotPaused {
_checksumCheck(to);
emit Unwrap(account, to, amount, message);
_burnFrom(account, amount);
}
function minterAllowance(address minter) public view returns (uint256) {
return _minterAllowances[minter];
}
/**
* Set the minterAllowance granted to `minter`.
*
*/
function minterApprove(address minter, uint256 amount) public onlyOwner returns (bool) {
_minterApprove(minter, amount);
return true;
}
/**
* Atomically increases the minterAllowance granted to `minter`.
*
*/
function increaseMinterAllowance(address minter, uint256 addedValue) public onlyOwner returns (bool) {
_minterApprove(minter, _minterAllowances[minter].add(addedValue));
return true;
}
/**
* Atomically decreases the minterAllowance granted to `minter`
*
*/
function decreaseMinterAllowance(address minter, uint256 subtractedValue) public onlyOwner returns (bool) {
_minterApprove(minter, _minterAllowances[minter].sub(subtractedValue, "WrappedADS: decreased minterAllowance below zero"));
return true;
}
function _minterApprove(address minter, uint256 amount) internal {
require(isMinter(minter), "WrappedADS: minter approve for non-minting address");
_minterAllowances[minter] = amount;
emit MinterApproval(minter, amount);
}
function isMinter(address account) public view returns (bool) {
return MinterRole.isMinter(account) || isOwner(account);
}
function removeMinter(address account) public onlyOwner {
_minterApprove(account, 0);
_removeMinter(account);
}
function isPauser(address account) public view returns (bool) {
return PauserRole.isPauser(account) || isOwner(account);
}
function removePauser(address account) public onlyOwner {
_removePauser(account);
}
/**
* Transfer all Ether held by the contract to the owner.
*/
function reclaimEther() external onlyOwner {
_msgSender().transfer(address(this).balance);
}
/**
* Reclaim all ERC20 compatible tokenst
*/
function reclaimToken(IERC20 _token) external onlyOwner {
uint256 balance = _token.balanceOf(address(this));
_token.safeTransfer(_msgSender(), balance);
}
/**
* Verify checksum for ADS address.
*/
function _checksumCheck(uint64 adsAddress) pure internal {
uint8 x;
uint16 crc = 0x1D0F;
for(uint8 i=7;i>=2;i--) {
x = (uint8)(crc >> 8) ^ ((uint8)(adsAddress >> i*8));
x ^= x>>4;
crc = (crc << 8) ^ ((uint16)(x) << 12) ^ ((uint16)(x) <<5) ^ ((uint16)(x));
}
require(crc == (adsAddress & 0xFFFF), "WrappedADS: invalid ADS address");
}
event Wrap(address indexed to, uint64 indexed from, uint64 txid, uint256 amount);
event Unwrap(address indexed from, uint64 indexed to, uint256 amount, uint128 message);
event MinterApproval(address indexed minter, uint256 amount);
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
isMinter 0xaa271e1a → bool
isOwner 0x2f54bf6e → bool
isPauser 0x46fbf68e → bool
minterAllowance 0x8a6db9c3 → uint256
name 0x06fdde03 → string
paused 0x5c975abb → bool
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 24 functions
These functions modify contract state and require a wallet transaction to execute.
addMinter 0x983b2d56
address account
addOwner 0x7065cb48
address account
addPauser 0x82dc1ec4
address account
approve 0x095ea7b3
address spender
uint256 value
returns: bool
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
decreaseMinterAllowance 0xa2ded115
address minter
uint256 subtractedValue
returns: bool
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
increaseMinterAllowance 0xbe76ebe5
address minter
uint256 addedValue
returns: bool
minterApprove 0x643edef9
address minter
uint256 amount
returns: bool
pause 0x8456cb59
No parameters
reclaimEther 0x9f727c27
No parameters
reclaimToken 0x17ffc320
address _token
removeMinter 0x3092afd5
address account
removePauser 0x6b2c0f55
address account
renounceMinter 0x98650275
No parameters
renounceOwner 0x28c23a45
No parameters
renouncePauser 0x6ef8d66d
No parameters
transfer 0xa9059cbb
address to
uint256 value
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool
unpause 0x3f4ba83a
No parameters
unwrap 0x9d590d07
uint256 amount
uint64 to
unwrapFrom 0x55385c07
address account
uint256 amount
uint64 to
uint128 message
unwrapMessage 0x2f4c1f90
uint256 amount
uint64 to
uint128 message
wrapTo 0xdfe11cf1
address account
uint256 amount
uint64 from
uint64 txid
returns: bool
Recent Transactions
No transactions found for this address