Address Contract Verified
Address
0x6a153cDf5cC58F47c17D6A6b0187C25c86d1acFD
Balance
0 ETH
Nonce
1
Code Size
12087 bytes
Creator
0x1B382A7b...6A03 at tx 0x44b072cf...0804d2
Indexed Transactions
0
Contract Bytecode
12087 bytes
0x6080604052600436106101c65760003560e01c8063938c3739116100f7578063c45a015511610095578063e30c397811610064578063e30c397814610786578063e7bc71501461079b578063ef619561146107d6578063f2fde38b146107eb576101ea565b8063c45a01551461065a578063d06ca61f1461066f578063d326f75c14610726578063e086e5ec14610771576101ea565b8063ad5c4648116100d1578063ad5c4648146105e5578063ad615dec146105fa578063b3249e9e14610630578063c2624e1e14610645576101ea565b8063938c37391461054c578063982c2fa31461058e578063a4eb466f146105d0576101ea565b80636aae593e1161016457806379ba50971161013e57806379ba50971461048557806382f27a1e1461049a57806385f8c259146104e55780638da5cb5b1461051b576101ea565b80636aae593e146104135780636f9fb98a14610446578063727cadc31461045b576101ea565b80633deb4c23116101a05780633deb4c231461037757806351cff8d9146103a1578063549e92ed146103d45780635883aec2146103fe576101ea565b8063031521b7146101ef578063054d50d4146102285780631f00ca7414610270576101ea565b366101ea573373c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2146101e857fe5b005b600080fd5b3480156101fb57600080fd5b506101e86004803603604081101561021257600080fd5b506001600160a01b03813516906020013561081e565b34801561023457600080fd5b5061025e6004803603606081101561024b57600080fd5b5080359060208101359060400135610907565b60408051918252519081900360200190f35b34801561027c57600080fd5b506103276004803603604081101561029357600080fd5b813591908101906040810160208201356401000000008111156102b557600080fd5b8201836020820111156102c757600080fd5b803590602001918460208302840111640100000000831117156102e957600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061091c945050505050565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561036357818101518382015260200161034b565b505050509050019250505060405180910390f35b34801561038357600080fd5b506101e86004803603602081101561039a57600080fd5b5035610946565b3480156103ad57600080fd5b506101e8600480360360208110156103c457600080fd5b50356001600160a01b03166109d1565b3480156103e057600080fd5b506101e8600480360360208110156103f757600080fd5b5035610aa7565b34801561040a57600080fd5b5061025e610b32565b34801561041f57600080fd5b5061025e6004803603602081101561043657600080fd5b50356001600160a01b0316610b38565b34801561045257600080fd5b5061025e610b4a565b34801561046757600080fd5b506101e86004803603602081101561047e57600080fd5b5035610b4e565b34801561049157600080fd5b506101e8610bd9565b3480156104a657600080fd5b506101e8600480360360a08110156104bd57600080fd5b508035906020810135906001600160a01b036040820135169060608101359060800135610c78565b3480156104f157600080fd5b5061025e6004803603606081101561050857600080fd5b5080359060208101359060400135610e3a565b34801561052757600080fd5b50610530610e47565b604080516001600160a01b039092168252519081900360200190f35b6101e8600480360360a081101561056257600080fd5b508035906001600160a01b03602082013581169160408101359091169060608101359060800135610e56565b6101e8600480360360a08110156105a457600080fd5b508035906001600160a01b03602082013581169160408101359091169060608101359060800135611224565b3480156105dc57600080fd5b5061025e611570565b3480156105f157600080fd5b50610530611576565b34801561060657600080fd5b5061025e6004803603606081101561061d57600080fd5b508035906020810135906040013561158e565b34801561063c57600080fd5b5061025e61159b565b34801561065157600080fd5b5061025e6115a1565b34801561066657600080fd5b506105306115a7565b34801561067b57600080fd5b506103276004803603604081101561069257600080fd5b813591908101906040810160208201356401000000008111156106b457600080fd5b8201836020820111156106c657600080fd5b803590602001918460208302840111640100000000831117156106e857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506115bf945050505050565b34801561073257600080fd5b506101e8600480360360a081101561074957600080fd5b508035906020810135906001600160a01b0360408201351690606081013590608001356115e0565b34801561077d57600080fd5b506101e8611877565b34801561079257600080fd5b506105306118dc565b3480156107a757600080fd5b50610327600480360360408110156107be57600080fd5b508035151590602001356001600160a01b03166118eb565b3480156107e257600080fd5b5061025e611a01565b3480156107f757600080fd5b506101e86004803603602081101561080e57600080fd5b50356001600160a01b0316611a07565b6000546001600160a01b0316331461086b576040805162461bcd60e51b81526020600482015260186024820152600080516020612e8a833981519152604482015290519081900360640190fd5b600081116108c0576040805162461bcd60e51b815260206004820152601960248201527f50726f70686572526f757465723a205a45524f5f56414c554500000000000000604482015290519081900360640190fd5b6001600160a01b038216600081815260026020526040808220849055518392917facaf676d034545ea82dad34fc5bf03a027dd229aebce853f54ec9fcf8d61c10c91a35050565b6000610914848484611b00565b949350505050565b606061093d735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f8484611bf0565b90505b92915050565b6000546001600160a01b03163314610993576040805162461bcd60e51b81526020600482015260186024820152600080516020612e8a833981519152604482015290519081900360640190fd5b600481905560408051828152905133917f3f9e9b12d4cc990ecadbeab0a846615426192bc5957b643708652adc4ce7fa11919081900360200190a250565b6000546001600160a01b03163314610a1e576040805162461bcd60e51b81526020600482015260186024820152600080516020612e8a833981519152604482015290519081900360640190fd5b600054604080516370a0823160e01b81523060048201529051610aa49284926001600160a01b0391821692918416916370a0823191602480820192602092909190829003018186803b158015610a7357600080fd5b505afa158015610a87573d6000803e3d6000fd5b505050506040513d6020811015610a9d57600080fd5b5051611d3d565b50565b6000546001600160a01b03163314610af4576040805162461bcd60e51b81526020600482015260186024820152600080516020612e8a833981519152604482015290519081900360640190fd5b600381905560408051828152905133917f67cb0f73dfe7204dd09956ab9b85c058c443e1bfc9df47036baac142a2901e8f919081900360200190a250565b60055481565b60026020526000908152604090205481565b4790565b6000546001600160a01b03163314610b9b576040805162461bcd60e51b81526020600482015260186024820152600080516020612e8a833981519152604482015290519081900360640190fd5b600581905560408051828152905133917fb786d11896d82fe56911524045cbddbcc4e1652a7537e21659ac97c439d8b8cd919081900360200190a250565b33610be26118dc565b6001600160a01b031614610c275760405162461bcd60e51b8152600401808060200182810382526022815260200180612e1a6022913960400191505060405180910390fd5b610c2f6118dc565b600080546001600160a01b0319166001600160a01b03928316178082556040519216917f595ee9ffef04d4d652b768860c56905a48f5ab79124bb3b2279df1885536991d9190a2565b6103e8811115610cb95760405162461bcd60e51b8152600401808060200182810382526021815260200180612cd36021913960400191505060405180910390fd5b612710818602046060610ccd6000866118eb565b905073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031681600183510381518110610cfd57fe5b60200260200101516001600160a01b031614610d60576040805162461bcd60e51b815260206004820152601b60248201527f50726f70686572526f757465723a20494e56414c49445f504154480000000000604482015290519081900360640190fd5b6060610d83735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f848a0184611bf0565b90508681600081518110610d9357fe5b60200260200101511115610dd85760405162461bcd60e51b8152600401808060200182810382526025815260200180612dcd6025913960400191505060405180910390fd5b610dfa81600081518110610de857fe5b60200260200101518984338988611e91565b60408051848152905133917f237dc3cc59ed2345121b102ace6c6ee25b05e01c8a5e61fa09aac27ed833ad9c919081900360200190a25050505050505050565b6000610914848484612150565b6000546001600160a01b031681565b8142811015610ea5576040805162461bcd60e51b8152602060048201526016602482015275141c9bdc1a195c949bdd5d195c8e881156141254915160521b604482015290519081900360640190fd5b6103e8821115610ee65760405162461bcd60e51b8152600401808060200182810382526021815260200180612cd36021913960400191505060405180910390fd5b6060610ef36001876118eb565b905060006127103485020490506000610f0c3483612240565b905073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015610f5d57600080fd5b505af1158015610f71573d6000803e3d6000fd5b505050505073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663a9059cbb610fe0735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f86600081518110610fbe57fe5b602002602001015187600181518110610fd357fe5b6020026020010151612290565b836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561103057600080fd5b505af1158015611044573d6000803e3d6000fd5b505050506040513d602081101561105a57600080fd5b505161106257fe5b6000886001600160a01b03166370a08231896040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b1580156110ba57600080fd5b505afa1580156110ce573d6000803e3d6000fd5b505050506040513d60208110156110e457600080fd5b505190506110f28489612350565b8961119c828660018851038151811061110757fe5b60200260200101516001600160a01b03166370a082318c6040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561116457600080fd5b505afa158015611178573d6000803e3d6000fd5b505050506040513d602081101561118e57600080fd5b50519063ffffffff61224016565b10156111d95760405162461bcd60e51b8152600401808060200182810382526029815260200180612e3c6029913960400191505060405180910390fd5b6040805184815290516001600160a01b038a16917f237dc3cc59ed2345121b102ace6c6ee25b05e01c8a5e61fa09aac27ed833ad9c919081900360200190a250505050505050505050565b8142811015611273576040805162461bcd60e51b8152602060048201526016602482015275141c9bdc1a195c949bdd5d195c8e881156141254915160521b604482015290519081900360640190fd5b6005543411156112b45760405162461bcd60e51b8152600401808060200182810382526023815260200180612cf46023913960400191505060405180910390fd5b6103e88211156112f55760405162461bcd60e51b8152600401808060200182810382526021815260200180612cd36021913960400191505060405180910390fd5b6001600160a01b038516600090815260026020526040812054349190611423576003545b8161141d57806113325761132d8734612648565b61141d565b6040805163938c373960e01b8152600481018b90526001600160a01b038a811660248301528916604482015260648101889052608481018790529051309163938c373991869160a48082019260009290919082900301818588803b15801561139957600080fd5b505af1935050505080156113ab575060015b6113d8576127106004548402816113be57fe5b0492506127106004548a02816113d057fe5b049850611319565b6001600160a01b0388166000908152600260205260408120849055600192506114013485612240565b90508015611413576114138882612648565b5060001901611319565b50611566565b6001600160a01b038716600090815260026020526040902054348110156114dc576040805163938c373960e01b8152600481018b90526001600160a01b038a811660248301528916604482015260648101889052608481018790529051309163938c373991849160a48082019260009290919082900301818588803b1580156114ab57600080fd5b505af11580156114bf573d6000803e3d6000fd5b50505050506114d7876114d23484612240565b612648565b611564565b803411611564576040805163938c373960e01b8152600481018b90526001600160a01b038a811660248301528916604482015260648101889052608481018790529051309163938c373991349160a48082019260009290919082900301818588803b15801561154a57600080fd5b505af115801561155e573d6000803e3d6000fd5b50505050505b505b5050505050505050565b60035481565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b600061091484848461273b565b61271081565b6103e881565b735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f81565b606061093d735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f84846127e7565b814281101561162f576040805162461bcd60e51b8152602060048201526016602482015275141c9bdc1a195c949bdd5d195c8e881156141254915160521b604482015290519081900360640190fd5b6103e88211156116705760405162461bcd60e51b8152600401808060200182810382526021815260200180612cd36021913960400191505060405180910390fd5b606061167d6000866118eb565b90506116d88160008151811061168f57fe5b6020026020010151336116d2735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f856000815181106116bd57fe5b602002602001015186600181518110610fd357fe5b8a61291e565b6116e28130612350565b604080516370a0823160e01b8152306004820152905160009173c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2916370a0823191602480820192602092909190829003018186803b15801561173757600080fd5b505afa15801561174b573d6000803e3d6000fd5b505050506040513d602081101561176157600080fd5b50519050868110156117a45760405162461bcd60e51b8152600401808060200182810382526029815260200180612e3c6029913960400191505060405180910390fd5b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316632e1a7d4d826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156117fe57600080fd5b505af1158015611812573d6000803e3d6000fd5b5050505060006127108583028161182557fe5b049050611836336114d28484612240565b60408051828152905133917f237dc3cc59ed2345121b102ace6c6ee25b05e01c8a5e61fa09aac27ed833ad9c919081900360200190a2505050505050505050565b6000546001600160a01b031633146118c4576040805162461bcd60e51b81526020600482015260186024820152600080516020612e8a833981519152604482015290519081900360640190fd5b6000546118da906001600160a01b031647612648565b565b6001546001600160a01b031690565b604080516002808252606080830184529283929190602083019080368337019050509050831561198a5773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28160008151811061193757fe5b60200260200101906001600160a01b031690816001600160a01b031681525050828160018151811061196557fe5b60200260200101906001600160a01b031690816001600160a01b03168152505061093d565b828160008151811061199857fe5b60200260200101906001600160a01b031690816001600160a01b03168152505073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2816001815181106119da57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250509392505050565b60045481565b6000546001600160a01b03163314611a54576040805162461bcd60e51b81526020600482015260186024820152600080516020612e8a833981519152604482015290519081900360640190fd5b6001600160a01b038116611aaf576040805162461bcd60e51b815260206004820152601b60248201527f50726f70686572526f757465723a205a45524f5f414444524553530000000000604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227009190a350565b6000808411611b405760405162461bcd60e51b815260040180806020018281038252602b815260200180612ed7602b913960400191505060405180910390fd5b600083118015611b505750600082115b611b8b5760405162461bcd60e51b8152600401808060200182810382526028815260200180612df26028913960400191505060405180910390fd5b6000611b9f856103e563ffffffff612a7b16565b90506000611bb3828563ffffffff612a7b16565b90506000611bd983611bcd886103e863ffffffff612a7b16565b9063ffffffff612ade16565b9050808281611be457fe5b04979650505050505050565b6060600282511015611c49576040805162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a20494e56414c49445f504154480000604482015290519081900360640190fd5b815167ffffffffffffffff81118015611c6157600080fd5b50604051908082528060200260200182016040528015611c8b578160200160208202803683370190505b5090508281600183510381518110611c9f57fe5b60209081029190910101528151600019015b8015611d3557600080611cee87866001860381518110611ccd57fe5b6020026020010151878681518110611ce157fe5b6020026020010151612b2d565b91509150611d10848481518110611d0157fe5b60200260200101518383612150565b846001850381518110611d1f57fe5b6020908102919091010152505060001901611cb1565b509392505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b60208310611dba5780518252601f199092019160209182019101611d9b565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611e1c576040519150601f19603f3d011682016040523d82523d6000602084013e611e21565b606091505b5091509150818015611e4f575080511580611e4f5750808060200190516020811015611e4c57600080fd5b50515b611e8a5760405162461bcd60e51b815260040180806020018281038252602d815260200180612eaa602d913960400191505060405180910390fd5b5050505050565b8142811015611ee0576040805162461bcd60e51b8152602060048201526016602482015275141c9bdc1a195c949bdd5d195c8e881156141254915160521b604482015290519081900360640190fd5b611f3385600081518110611ef057fe5b6020026020010151336116d2735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f89600081518110611f1e57fe5b60200260200101518a600181518110610fd357fe5b600085600187510381518110611f4557fe5b60200260200101516001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b158015611fa257600080fd5b505afa158015611fb6573d6000803e3d6000fd5b505050506040513d6020811015611fcc57600080fd5b50519050611fda8630612350565b600086600188510381518110611fec57fe5b60200260200101516001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561204957600080fd5b505afa15801561205d573d6000803e3d6000fd5b505050506040513d602081101561207357600080fd5b5051905060006120838284612240565b9050888110156120c45760405162461bcd60e51b8152600401808060200182810382526029815260200180612e3c6029913960400191505060405180910390fd5b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316632e1a7d4d826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561211e57600080fd5b505af1158015612132573d6000803e3d6000fd5b50505050612144876114d28388612240565b50505050505050505050565b60008084116121905760405162461bcd60e51b815260040180806020018281038252602c815260200180612d17602c913960400191505060405180910390fd5b6000831180156121a05750600082115b6121db5760405162461bcd60e51b8152600401808060200182810382526028815260200180612df26028913960400191505060405180910390fd5b60006121ff6103e86121f3868863ffffffff612a7b16565b9063ffffffff612a7b16565b905060006122196103e56121f3868963ffffffff61224016565b9050612236600182848161222957fe5b049063ffffffff612ade16565b9695505050505050565b80820382811115610940576040805162461bcd60e51b815260206004820152601560248201527464732d6d6174682d7375622d756e646572666c6f7760581b604482015290519081900360640190fd5b600080600061229f8585612bf4565b604080516bffffffffffffffffffffffff19606094851b811660208084019190915293851b81166034830152825160288184030181526048830184528051908501206001600160f81b031960688401529a90941b9093166069840152607d8301989098527f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f609d808401919091528851808403909101815260bd909201909752805196019590952095945050505050565b60005b60018351038110156126435760008084838151811061236e57fe5b602002602001015185846001018151811061238557fe5b602002602001015191509150600061239d8383612bf4565b50905060006123c1735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f8585612290565b9050600080600080846001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561240257600080fd5b505afa158015612416573d6000803e3d6000fd5b505050506040513d606081101561242c57600080fd5b5080516020909101516001600160701b0391821693501690506000806001600160a01b038a811690891614612462578284612465565b83835b915091506124c3828b6001600160a01b03166370a082318a6040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561116457600080fd5b95506124d0868383611b00565b945050505050600080856001600160a01b0316886001600160a01b0316146124fa578260006124fe565b6000835b91509150600060028c51038a10612515578a61253d565b61253d735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f898e8d60020181518110610fd357fe5b604080516000808252602082019283905263022c0d9f60e01b835260248201878152604483018790526001600160a01b038086166064850152608060848501908152845160a48601819052969750908c169563022c0d9f958a958a958a9591949193919260c486019290918190849084905b838110156125c75781810151838201526020016125af565b50505050905090810190601f1680156125f45780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561261657600080fd5b505af115801561262a573d6000803e3d6000fd5b50506001909b019a506123539950505050505050505050565b505050565b604080516000808252602082019092526001600160a01b0384169083906040518082805190602001908083835b602083106126945780518252601f199092019160209182019101612675565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146126f6576040519150601f19603f3d011682016040523d82523d6000602084013e6126fb565b606091505b50509050806126435760405162461bcd60e51b8152600401808060200182810382526034815260200180612d746034913960400191505060405180910390fd5b600080841161277b5760405162461bcd60e51b8152600401808060200182810382526025815260200180612e656025913960400191505060405180910390fd5b60008311801561278b5750600082115b6127c65760405162461bcd60e51b8152600401808060200182810382526028815260200180612df26028913960400191505060405180910390fd5b826127d7858463ffffffff612a7b16565b816127de57fe5b04949350505050565b6060600282511015612840576040805162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a20494e56414c49445f504154480000604482015290519081900360640190fd5b815167ffffffffffffffff8111801561285857600080fd5b50604051908082528060200260200182016040528015612882578160200160208202803683370190505b509050828160008151811061289357fe5b60200260200101818152505060005b6001835103811015611d35576000806128d8878685815181106128c157fe5b6020026020010151878660010181518110611ce157fe5b915091506128fa8484815181106128eb57fe5b60200260200101518383611b00565b84846001018151811061290957fe5b602090810291909101015250506001016128a2565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17815292518251600094606094938a169392918291908083835b602083106129a35780518252601f199092019160209182019101612984565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612a05576040519150601f19603f3d011682016040523d82523d6000602084013e612a0a565b606091505b5091509150818015612a38575080511580612a385750808060200190516020811015612a3557600080fd5b50515b612a735760405162461bcd60e51b8152600401808060200182810382526031815260200180612d436031913960400191505060405180910390fd5b505050505050565b6000811580612a9657505080820282828281612a9357fe5b04145b610940576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6d756c2d6f766572666c6f7760601b604482015290519081900360640190fd5b80820182811015610940576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6164642d6f766572666c6f7760601b604482015290519081900360640190fd5b6000806000612b3c8585612bf4565b509050600080612b4d888888612290565b6001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015612b8557600080fd5b505afa158015612b99573d6000803e3d6000fd5b505050506040513d6060811015612baf57600080fd5b5080516020909101516001600160701b0391821693501690506001600160a01b0387811690841614612be2578082612be5565b81815b90999098509650505050505050565b600080826001600160a01b0316846001600160a01b03161415612c485760405162461bcd60e51b8152600401808060200182810382526025815260200180612da86025913960400191505060405180910390fd5b826001600160a01b0316846001600160a01b031610612c68578284612c6b565b83835b90925090506001600160a01b038216612ccb576040805162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f414444524553530000604482015290519081900360640190fd5b925092905056fe50726f70686572526f757465723a20494e56414c49445f4645455f414d4f554e5450726f70686572526f757465723a2045584345454445445f45544845525f4c494d4954556e697377617056324c6962726172793a20494e53554646494349454e545f4f55545055545f414d4f554e545472616e7366657248656c7065723a3a7472616e7366657246726f6d3a207472616e7366657246726f6d206661696c65645472616e7366657248656c7065723a3a736166655472616e736665724554483a20455448207472616e73666572206661696c6564556e697377617056324c6962726172793a204944454e544943414c5f41444452455353455350726f70686572526f757465723a204558434553534956455f494e5055545f414d4f554e54556e697377617056324c6962726172793a20494e53554646494349454e545f4c495155494449545950726f70686572526f757465723a20554e415554484f52495a45445f43414c4c455250726f70686572526f757465723a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056324c6962726172793a20494e53554646494349454e545f414d4f554e5450726f70686572526f757465723a204e4f54204f574e455200000000000000005472616e7366657248656c7065723a3a736166655472616e736665723a207472616e73666572206661696c6564556e697377617056324c6962726172793a20494e53554646494349454e545f494e5055545f414d4f554e54a26469706673582212203882731486bcd2fc9941aea3ea1ca0490aacdd0c849bfe7f209e9354d64935d264736f6c63430006060033
Verified Source Code Full Match
Compiler: v0.6.6+commit.6c089d02
EVM: istanbul
Optimization: Yes (200 runs)
ProphetRouterV1.sol 418 lines
pragma solidity =0.6.6;
import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol';
import '@uniswap/lib/contracts/libraries/TransferHelper.sol';
import './interfaces/IUniswapV2Router02.sol';
import './libraries/UniswapV2Library.sol';
import './libraries/SafeMath.sol';
import './interfaces/IERC20.sol';
import './interfaces/IWETH.sol';
contract ProphetRouterV1 is IUniswapV2Router02 {
event ProphetFee(uint256 feeAmount, address indexed user);
event OwnershipChanged(address indexed newOwner);
event OwnershipTransferStarted(address indexed Owner, address indexed newOwner);
event tokenToEtherChanged(address indexed token, uint indexed value);
event MaxRetryUpdated(uint newMaxRetry, address indexed updatedBy);
event MaxBuyScaleUpdated(uint newMaxBuyScale, address indexed updatedBy);
event MaxBuyEtherLimitUpdated(uint newMaxBuyEtherLimit, address indexed updatedBy);
event ProphetFeeUpdated(uint newfee, address indexed updatedBy);
using SafeMath for uint;
address public constant override factory = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;
address public constant override WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
uint public constant MAX_BIPS = 10_000;
uint public constant FEE_MAX = 1000; // 10% fee
address public owner;
address private _pendingOwner;
mapping(address => uint) public tokenToEther; //mapping to track the min Ether required for a token address
uint public maxRetry = 10;
uint public maxBuyScale = 6_900;
uint public maxBuyEtherLimit = 0.5 ether; // should be set by owners during deployment
modifier ensure(uint deadline) {
require(deadline >= block.timestamp, 'PropherRouter: EXPIRED');
_;
}
modifier onlyOwner() {
require(msg.sender == owner, 'PropherRouter: NOT OWNER');
_;
}
constructor() public {
owner = msg.sender;
}
receive() external payable {
assert(msg.sender == WETH); // only accept ETH via fallback from the WETH contract
}
// **** LIBRARY FUNCTIONS ****
function quote(uint amountA, uint reserveA, uint reserveB) public pure virtual override returns (uint amountB) {
return UniswapV2Library.quote(amountA, reserveA, reserveB);
}
function getAmountOut(
uint amountIn,
uint reserveIn,
uint reserveOut
) public pure virtual override returns (uint amountOut) {
return UniswapV2Library.getAmountOut(amountIn, reserveIn, reserveOut);
}
function getAmountIn(
uint amountOut,
uint reserveIn,
uint reserveOut
) public pure virtual override returns (uint amountIn) {
return UniswapV2Library.getAmountIn(amountOut, reserveIn, reserveOut);
}
function getAmountsOut(
uint amountIn,
address[] memory path
) public view virtual override returns (uint[] memory amounts) {
return UniswapV2Library.getAmountsOut(factory, amountIn, path);
}
function getAmountsIn(
uint amountOut,
address[] memory path
) public view virtual override returns (uint[] memory amounts) {
return UniswapV2Library.getAmountsIn(factory, amountOut, path);
}
// **** SWAP (supporting fee-on-transfer tokens) ****
// Internal function for swapping tokens supporting fee-on-transfer tokens
function _swapSupportingFeeOnTransferTokens(address[] memory path, address _to) internal virtual {
for (uint i; i < path.length - 1; i++) {
(address input, address output) = (path[i], path[i + 1]);
(address token0, ) = UniswapV2Library.sortTokens(input, output);
IUniswapV2Pair pair = IUniswapV2Pair(UniswapV2Library.pairFor(factory, input, output));
uint amountInput;
uint amountOutput;
{
// scope to avoid stack too deep errors
(uint reserve0, uint reserve1, ) = pair.getReserves();
(uint reserveInput, uint reserveOutput) = input == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
amountInput = IERC20(input).balanceOf(address(pair)).sub(reserveInput);
amountOutput = UniswapV2Library.getAmountOut(amountInput, reserveInput, reserveOutput);
}
(uint amount0Out, uint amount1Out) = input == token0 ? (uint(0), amountOutput) : (amountOutput, uint(0));
address to = i < path.length - 2 ? UniswapV2Library.pairFor(factory, output, path[i + 2]) : _to;
pair.swap(amount0Out, amount1Out, to, new bytes(0));
}
}
/**
* @dev Swaps ERC20 tokens for a specific amount of ETH, supporting fee on transfer tokens.
* @param amountIn The amount of input tokens to swap
* @param amountOutMin The minimum amount of ETH to receive from the swap.
* @param path An array of token addresses representing the swap path.
* @param to The address to receive the swapped ETH.
* @param deadline The deadline by which the swap must be executed.
*/
function swapTokensSupportingFeeOnTransferTokensForExactETH(
uint amountIn,
uint amountOutMin,
address[] memory path,
address to,
uint deadline,
uint feeAmount
) private ensure(deadline) {
TransferHelper.safeTransferFrom(
path[0],
msg.sender,
UniswapV2Library.pairFor(factory, path[0], path[1]),
amountIn
);
uint balanceOfWETHBefore = IERC20(path[path.length - 1]).balanceOf(address(this));
_swapSupportingFeeOnTransferTokens(path, address(this));
uint balanceOfWETHAfter = IERC20(path[path.length - 1]).balanceOf(address(this));
uint amountOut = SafeMath.sub(balanceOfWETHAfter, balanceOfWETHBefore); //The output amount of WETH after the swap
require(amountOut >= amountOutMin, 'PropherRouter: INSUFFICIENT_OUTPUT_AMOUNT');
IWETH(WETH).withdraw(amountOut);
TransferHelper.safeTransferETH(to, SafeMath.sub(amountOut, feeAmount));
}
/// @notice Executes a buy operation with a fee, swapping ETH for tokens
/// @dev This function includes a fee mechanism and supports fee-on-transfer tokens
/// @param amountOutMin The minimum amount of output tokens to receive
/// @param tokenAddress The address of the output token
/// @param deadline The time by which the transaction must be confirmed
function ProphetBuy(
uint amountOutMin,
address tokenAddress,
address to,
uint deadline,
uint fee
)
external
payable
virtual
override
ensure(deadline)
{
require(fee <= FEE_MAX, 'PropherRouter: INVALID_FEE_AMOUNT');
address[] memory path = getPathForTokenToToken(true, tokenAddress);
uint256 feeAmount = (msg.value * fee) / MAX_BIPS;
uint256 amountIn = SafeMath.sub(msg.value, feeAmount);
IWETH(WETH).deposit{value: amountIn}();
assert(IWETH(WETH).transfer(UniswapV2Library.pairFor(factory, path[0], path[1]), amountIn));
uint balanceBefore = IERC20(tokenAddress).balanceOf(to);
_swapSupportingFeeOnTransferTokens(path, to);
require(
IERC20(path[path.length - 1]).balanceOf(to).sub(balanceBefore) >= amountOutMin,
'PropherRouter: INSUFFICIENT_OUTPUT_AMOUNT'
);
emit ProphetFee(feeAmount, to);
}
/**
* @notice Use the ProphetMaxBuy only when buying the tokens which have max buy limit per transaction
* @dev Executes a ProphetMaxBuy transaction, swapping Ether for the specified token.
* @param amountOutMin The minimum amount of the output token that must be received for the transaction not to revert.
* @param tokenAddress The address of the token to be bought.
* @param to The address that will receive the output tokens.
* @param deadline The timestamp by which the transaction must be executed to prevent it from expiring.
* @notice Ensure that the transaction is executed before the specified deadline.
* @dev Refunds any unused Ether back to the sender in case of unsuccessful swaps.
* @dev Handles multiple attempts to execute the ProphetBuy function in case of failure, with decreasing input Ether amounts.
* @dev Updates the minimum Ether required for the specified token if the swap is successful.
* @dev Emits a `tokenToEtherChanged` event on successful update.
*/
function ProphetMaxBuy(
uint amountOutMin,
address tokenAddress,
address to,
uint deadline,
uint fee
)
external
payable
ensure(deadline)
{
require(msg.value <= maxBuyEtherLimit, 'PropherRouter: EXCEEDED_ETHER_LIMIT');
require(fee <= FEE_MAX, 'PropherRouter: INVALID_FEE_AMOUNT');
uint amountIn = msg.value;
bool isSwapComplete = false;
if (tokenToEther[tokenAddress] == 0) {
uint maxAttempts = maxRetry;
while (isSwapComplete == false) {
if (maxAttempts == 0) {
TransferHelper.safeTransferETH(to, msg.value); // adding this to refund the msg.value back to user in case of maxAttempts are over
break;
}
//fee calculation already handled as part of ProphetBuy()
try this.ProphetBuy{value: amountIn}(amountOutMin, tokenAddress, to, deadline, fee){
isSwapComplete = true;
tokenToEther[tokenAddress] = amountIn;
uint amountOutETH = SafeMath.sub(msg.value, amountIn);
if (amountOutETH > 0) TransferHelper.safeTransferETH(to, amountOutETH); //refund the extra ether back to user
} catch {
amountIn = (amountIn * maxBuyScale) / MAX_BIPS;
amountOutMin = (amountOutMin * maxBuyScale) / MAX_BIPS;
continue;
}
maxAttempts = maxAttempts - 1;
}
} else {
// in case the tokenToEther for the current token is updated
uint maxInputEtherAmount = tokenToEther[tokenAddress];
if (msg.value > maxInputEtherAmount) {
this.ProphetBuy{value: maxInputEtherAmount}(amountOutMin, tokenAddress, to, deadline, fee);
TransferHelper.safeTransferETH(to, SafeMath.sub(msg.value, maxInputEtherAmount));
} else if (msg.value <= maxInputEtherAmount) {
this.ProphetBuy{value: msg.value}(amountOutMin, tokenAddress, to, deadline, fee);
}
}
}
/// @notice Executes a sell operation with a fee, swapping tokens for ETH and supporting fee-on-transfer tokens
/// @dev This function includes a fee mechanism and supports fee-on-transfer tokens
/// @param amountIn The amount of input tokens to sell
/// @param amountOutMin The minimum amount of ETH to receive
/// @param tokenAddress The address of the input token
/// @param deadline The time by which the transaction must be confirmed
function ProphetSell(
uint amountIn,
uint amountOutMin,
address tokenAddress,
uint deadline,
uint fee
)
external
virtual
override
ensure(deadline)
{
require(fee <= FEE_MAX, 'PropherRouter: INVALID_FEE_AMOUNT');
address[] memory path = getPathForTokenToToken(false, tokenAddress);
TransferHelper.safeTransferFrom(
path[0],
msg.sender,
UniswapV2Library.pairFor(factory, path[0], path[1]),
amountIn
);
_swapSupportingFeeOnTransferTokens(path, address(this));
uint amountOut = IERC20(WETH).balanceOf(address(this));
require(amountOut >= amountOutMin, 'PropherRouter: INSUFFICIENT_OUTPUT_AMOUNT');
IWETH(WETH).withdraw(amountOut);
// Calculate and collect the fee
uint256 feeAmount = (amountOut * fee) / MAX_BIPS;
TransferHelper.safeTransferETH(msg.sender, SafeMath.sub(amountOut, feeAmount)); //amountOut - feeAmount
emit ProphetFee(feeAmount, msg.sender);
}
/// @notice Executes a smart sell operation with a fee, swapping tokens for ETH
/// @dev This function includes a fee mechanism and uses internal swap functions
/// @param amountOut The amount of ETH to receive from the swap
/// @param amountInMax The maximum amount of input tokens to sell
/// @param tokenAddress The address of the token to sell
/// @param deadline The time by which the transaction must be confirmed
function ProphetSmartSell(
uint amountOut,
uint amountInMax,
address tokenAddress,
uint256 deadline,
uint fee
) public {
require(fee <= FEE_MAX, 'PropherRouter: INVALID_FEE_AMOUNT');
uint256 feeAmount = (amountOut * fee) / MAX_BIPS;
address[] memory path = getPathForTokenToToken(false, tokenAddress);
require(path[path.length - 1] == WETH, 'PropherRouter: INVALID_PATH');
//Gets the amount of tokenAddress required with "amountOut + feeAmount" amount of ETH
uint[] memory amounts = UniswapV2Library.getAmountsIn(factory, amountOut + feeAmount, path);
require(amounts[0] <= amountInMax, 'PropherRouter: EXCESSIVE_INPUT_AMOUNT');
swapTokensSupportingFeeOnTransferTokensForExactETH(
amounts[0], // Amount of tokenAddress
amountOut, // Min Amount of WETH required
path,
msg.sender,
deadline,
feeAmount
);
emit ProphetFee(feeAmount, msg.sender);
}
// **** MISC HELPER FUNCTIONS ****
/**
* @dev Gets the current balance of Ether held by the contract.
* @return The current Ether balance of the contract.
*/
function getContractBalance() external view returns (uint) {
return address(this).balance;
}
/// @notice Allows the contract owner to withdraw tokens from the contract
/// @param _token The token address to withdraw
function withdraw(address _token) external onlyOwner {
TransferHelper.safeTransfer(_token, owner, IERC20(_token).balanceOf(address(this)));
}
/// @notice Allows the contract owner to withdraw ETH from the contract
function withdrawETH() external onlyOwner {
TransferHelper.safeTransferETH(owner, address(this).balance);
}
/**
* @dev Sets the minimum Ether required to buy a specific token address.
* @param token The address of the token.
* @param value The new minimum Ether required for the specified token.
* @notice Only the owner can call this function.
* @dev Emits a `tokenToEtherChanged` event on successful update.
* @param token The address of the token.
* @param value The new minimum Ether required for the specified token.
*/
function setTokenToEther(address token, uint value) public onlyOwner {
require(value > 0, 'PropherRouter: ZERO_VALUE');
tokenToEther[token] = value;
emit tokenToEtherChanged(token, value);
}
/// @notice Helper function to get the swap path for token to token or ETH to token swaps
/// @param swapETH Indicates whether the swap involves ETH -> tokenAddr
/// @param tokenAddr The address of the other token
/// @return path The swap path as an array of addresses
function getPathForTokenToToken(bool swapETH, address tokenAddr) public pure returns (address[] memory) {
address[] memory path = new address[](2);
if (swapETH) {
path[0] = WETH;
path[1] = tokenAddr;
} else {
path[0] = tokenAddr;
path[1] = WETH;
}
return path;
}
/**
* @notice Transfers ownership of the contract to a new address.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0), 'PropherRouter: ZERO_ADDRESS');
_pendingOwner = newOwner;
emit OwnershipTransferStarted(owner, newOwner);
}
/**
* @dev The new owner accepts the ownership transfer.
*/
function acceptOwnership() public virtual {
require(pendingOwner() == msg.sender, 'PropherRouter: UNAUTHORIZED_CALLER');
owner = pendingOwner();
emit OwnershipChanged(owner);
}
/**
* @dev Allows the owner to update the maxRetry variable.
* @param newMaxRetry The new value for maxRetry.
*/
function updateMaxRetry(uint newMaxRetry) external onlyOwner {
maxRetry = newMaxRetry;
emit MaxRetryUpdated(newMaxRetry, msg.sender);
}
/**
* @dev Allows the owner to update the maxBuyScale variable.
* @param newMaxBuyScale The new value for maxBuyScale.
*/
function updateMaxBuyScale(uint newMaxBuyScale) external onlyOwner {
maxBuyScale = newMaxBuyScale;
emit MaxBuyScaleUpdated(newMaxBuyScale, msg.sender);
}
/**
* @dev Sets the maximum buy ether limit.
* @param newLimit The new maximum buy ether limit to be set.
*/
function setMaxBuyEtherLimit(uint newLimit) external onlyOwner {
maxBuyEtherLimit = newLimit;
emit MaxBuyEtherLimitUpdated(newLimit, msg.sender);
}
/**
* @dev Returns the address of the pending owner.
*/
function pendingOwner() public view virtual returns (address) {
return _pendingOwner;
}
}
IWETH.sol 7 lines
pragma solidity >=0.5.0;
interface IWETH {
function deposit() external payable;
function transfer(address to, uint value) external returns (bool);
function withdraw(uint) external;
}
IERC20.sol 17 lines
pragma solidity >=0.5.0;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
SafeMath.sol 17 lines
pragma solidity =0.6.6;
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
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');
}
}
UniswapV2Library.sol 82 lines
pragma solidity >=0.5.0;
import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol';
import "./SafeMath.sol";
library UniswapV2Library {
using SafeMath for uint;
// returns sorted token addresses, used to handle return values from pairs sorted in this order
function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES');
(token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS');
}
// calculates the CREATE2 address for a pair without making any external calls
function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
(address token0, address token1) = sortTokens(tokenA, tokenB);
pair = address(uint(keccak256(abi.encodePacked(
hex'ff',
factory,
keccak256(abi.encodePacked(token0, token1)),
hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash
))));
}
// fetches and sorts the reserves for a pair
function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
(address token0,) = sortTokens(tokenA, tokenB);
(uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves();
(reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
}
// given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) {
require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT');
require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
amountB = amountA.mul(reserveB) / reserveA;
}
// given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {
require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
uint amountInWithFee = amountIn.mul(997);
uint numerator = amountInWithFee.mul(reserveOut);
uint denominator = reserveIn.mul(1000).add(amountInWithFee);
amountOut = numerator / denominator;
}
// given an output amount of an asset and pair reserves, returns a required input amount of the other asset
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) {
require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
uint numerator = reserveIn.mul(amountOut).mul(1000);
uint denominator = reserveOut.sub(amountOut).mul(997);
amountIn = (numerator / denominator).add(1);
}
// performs chained getAmountOut calculations on any number of pairs
function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
amounts = new uint[](path.length);
amounts[0] = amountIn;
for (uint i; i < path.length - 1; i++) {
(uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]);
amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut);
}
}
// performs chained getAmountIn calculations on any number of pairs
function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
amounts = new uint[](path.length);
amounts[amounts.length - 1] = amountOut;
for (uint i = path.length - 1; i > 0; i--) {
(uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]);
amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut);
}
}
}
IUniswapV2Router01.sol 64 lines
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
// function swapExactTokensForTokens(
// uint amountIn,
// uint amountOutMin,
// address[] calldata path,
// address to,
// uint deadline
// ) external returns (uint[] memory amounts);
// function swapTokensForExactTokens(
// uint amountOut,
// uint amountInMax,
// address[] calldata path,
// address to,
// uint deadline
// ) external returns (uint[] memory amounts);
// function swapExactETHForTokens(
// uint amountOutMin,
// address[] calldata path,
// address to,
// uint deadline
// ) external payable returns (uint[] memory amounts);
// function swapTokensForExactETH(
// uint amountOut,
// uint amountInMax,
// address[] calldata path,
// address to,
// uint deadline
// ) external returns (uint[] memory amounts);
// function swapExactTokensForETH(
// uint amountIn,
// uint amountOutMin,
// address[] calldata path,
// address to,
// uint deadline,
// uint fee
// ) external returns (uint[] memory amounts);
// function swapETHForExactTokens(
// uint amountOut,
// address[] calldata path,
// address to,
// uint deadline
// ) external payable returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
IUniswapV2Router02.sol 31 lines
pragma solidity >=0.6.2;
import './IUniswapV2Router01.sol';
interface IUniswapV2Router02 is IUniswapV2Router01 {
// function swapExactTokensForTokensSupportingFeeOnTransferTokens(
// uint amountIn,
// uint amountOutMin,
// address[] calldata path,
// address to,
// uint deadline
// ) external;
function ProphetBuy(
// swapExactETHForTokensSupportingFeeOnTransferTokens
uint amountOutMin,
address tokenAddress,
address to,
uint deadline,
uint fee
) external payable; //@audit-info - ProphetBuy
function ProphetSell(
//swapExactTokensForETHSupportingFeeOnTransferTokens
uint amountIn,
uint amountOutMin,
address tokenAddress,
uint deadline,
uint fee
) external; //@audit-info - ProphetSell
}
TransferHelper.sol 51 lines
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.6.0;
// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
function safeApprove(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeApprove: approve failed'
);
}
function safeTransfer(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeTransfer: transfer failed'
);
}
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::transferFrom: transferFrom failed'
);
}
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}(new bytes(0));
require(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
}
}
IUniswapV2Pair.sol 52 lines
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
IUniswapV2Factory.sol 17 lines
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
Read Contract
FEE_MAX 0xc2624e1e → uint256
MAX_BIPS 0xb3249e9e → uint256
WETH 0xad5c4648 → address
factory 0xc45a0155 → address
getAmountIn 0x85f8c259 → uint256
getAmountOut 0x054d50d4 → uint256
getAmountsIn 0x1f00ca74 → uint256[]
getAmountsOut 0xd06ca61f → uint256[]
getContractBalance 0x6f9fb98a → uint256
getPathForTokenToToken 0xe7bc7150 → address[]
maxBuyEtherLimit 0x5883aec2 → uint256
maxBuyScale 0xef619561 → uint256
maxRetry 0xa4eb466f → uint256
owner 0x8da5cb5b → address
pendingOwner 0xe30c3978 → address
quote 0xad615dec → uint256
tokenToEther 0x6aae593e → uint256
Write Contract 12 functions
These functions modify contract state and require a wallet transaction to execute.
ProphetBuy 0x938c3739
uint256 amountOutMin
address tokenAddress
address to
uint256 deadline
uint256 fee
ProphetMaxBuy 0x982c2fa3
uint256 amountOutMin
address tokenAddress
address to
uint256 deadline
uint256 fee
ProphetSell 0xd326f75c
uint256 amountIn
uint256 amountOutMin
address tokenAddress
uint256 deadline
uint256 fee
ProphetSmartSell 0x82f27a1e
uint256 amountOut
uint256 amountInMax
address tokenAddress
uint256 deadline
uint256 fee
acceptOwnership 0x79ba5097
No parameters
setMaxBuyEtherLimit 0x727cadc3
uint256 newLimit
setTokenToEther 0x031521b7
address token
uint256 value
transferOwnership 0xf2fde38b
address newOwner
updateMaxBuyScale 0x3deb4c23
uint256 newMaxBuyScale
updateMaxRetry 0x549e92ed
uint256 newMaxRetry
withdraw 0x51cff8d9
address _token
withdrawETH 0xe086e5ec
No parameters
Recent Transactions
No transactions found for this address