Address Contract Partially Verified
Address
0xe7B2265F981aA8D8Ac20401ED658eF8c4Ee8D1e1
Balance
1.0024 ETH
Nonce
1
Code Size
13263 bytes
Creator
0x5763e08a...3282 at tx 0x8c1d9f0e...100546
Indexed Transactions
0
Contract Bytecode
13263 bytes
0x60806040526004361061035e575f3560e01c80637571336a116101bd578063c0246668116100f2578063dd62ed3e11610092578063eba4c3331161006d578063eba4c333146109fa578063f2fde38b14610a19578063f8b45b0514610a38578063fb3dd95f14610a4d575f5ffd5b8063dd62ed3e1461098d578063e211ca00146109d1578063e2f45605146109e5575f5ffd5b8063d246d891116100cd578063d246d89114610911578063d257b34f14610938578063d80528ae14610957578063d85ba06314610978575f5ffd5b8063c0246668146108c8578063c8c8ebe4146108e7578063cc2ffe7c146108fc575f5ffd5b80639a7a23d61161015d578063a85c38ef11610138578063a85c38ef146107f8578063a9059cbb1461085d578063b62496f51461087c578063bbc0c742146108aa575f5ffd5b80639a7a23d6146107a65780639e78fb4f146107c5578063a457c2d7146107d9575f5ffd5b80638a8c523c116101985780638a8c523c146107425780638da5cb5b14610756578063924de9b71461077357806395d89b4114610792575f5ffd5b80637571336a146106ef5780637973bfd21461070e5780638948f08414610723575f5ffd5b80634e6fd6c4116102935780636b2fb12411610233578063715018a61161020e578063715018a61461067357806371fc468814610689578063735de9f7146106a8578063751039fc146106db575f5ffd5b80636b2fb1241461060b5780636ddd17131461062057806370a082311461063f575f5ffd5b8063599270441161026e57806359927044146105ad5780635c068a8c146105cc5780635cd5cca4146105e15780636a486a8e146105f6575f5ffd5b80634e6fd6c4146105415780634fbee19314610556578063590015531461058d575f5ffd5b8063313ce567116102fe5780634626402b116102d95780634626402b146104d057806346d63676146104f457806349bd5a5e146105095780634a62bb6514610528575f5ffd5b8063313ce5671461045757806337d277d41461047257806339509351146104b1575f5ffd5b806318160ddd1161033957806318160ddd146103f057806323b872dd1461040e5780632a58b3301461042d5780632b14a8fe14610442575f5ffd5b806306fdde0314610369578063095ea7b31461039357806310d5de53146103c2575f5ffd5b3661036557005b5f5ffd5b348015610374575f5ffd5b5061037d610a6c565b60405161038a9190612e3d565b60405180910390f35b34801561039e575f5ffd5b506103b26103ad366004612e86565b610afc565b604051901515815260200161038a565b3480156103cd575f5ffd5b506103b26103dc366004612eb0565b601a6020525f908152604090205460ff1681565b3480156103fb575f5ffd5b506002545b60405190815260200161038a565b348015610419575f5ffd5b506103b2610428366004612ecb565b610b12565b348015610438575f5ffd5b5061040060085481565b34801561044d575f5ffd5b50610400600a5481565b348015610462575f5ffd5b506040516012815260200161038a565b34801561047d575f5ffd5b5061049973c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6040516001600160a01b03909116815260200161038a565b3480156104bc575f5ffd5b506103b26104cb366004612e86565b610bbf565b3480156104db575f5ffd5b50600e546104999061010090046001600160a01b031681565b3480156104ff575f5ffd5b50610400600b5481565b348015610514575f5ffd5b50600754610499906001600160a01b031681565b348015610533575f5ffd5b506013546103b29060ff1681565b34801561054c575f5ffd5b5061049961dead81565b348015610561575f5ffd5b506103b2610570366004612eb0565b6001600160a01b03165f9081526019602052604090205460ff1690565b348015610598575f5ffd5b506104995f51602061337a5f395f51905f5281565b3480156105b8575f5ffd5b50600f54610499906001600160a01b031681565b3480156105d7575f5ffd5b5061040060155481565b3480156105ec575f5ffd5b50610400600d5481565b348015610601575f5ffd5b5061040060165481565b348015610616575f5ffd5b5061040060175481565b34801561062b575f5ffd5b506013546103b29062010000900460ff1681565b34801561064a575f5ffd5b50610400610659366004612eb0565b6001600160a01b03165f9081526020819052604090205490565b34801561067e575f5ffd5b50610687610bfa565b005b348015610694575f5ffd5b506106876106a3366004612f09565b610c2f565b3480156106b3575f5ffd5b506104997f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b3480156106e6575f5ffd5b506103b2610c63565b3480156106fa575f5ffd5b50610687610709366004612f2d565b610c9f565b348015610719575f5ffd5b50610400600c5481565b34801561072e575f5ffd5b5061068761073d366004612f09565b610cf3565b34801561074d575f5ffd5b506106876112ff565b348015610761575f5ffd5b506005546001600160a01b0316610499565b34801561077e575f5ffd5b5061068761078d366004612f64565b61133c565b34801561079d575f5ffd5b5061037d611382565b3480156107b1575f5ffd5b506106876107c0366004612f2d565b611391565b3480156107d0575f5ffd5b5061068761144d565b3480156107e4575f5ffd5b506103b26107f3366004612e86565b611635565b348015610803575f5ffd5b5061083b610812366004612f09565b60096020525f908152604090208054600182015460028301546003909301549192909160ff1684565b604080519485526020850193909352918301521515606082015260800161038a565b348015610868575f5ffd5b506103b2610877366004612e86565b6116cd565b348015610887575f5ffd5b506103b2610896366004612eb0565b601b6020525f908152604090205460ff1681565b3480156108b5575f5ffd5b506013546103b290610100900460ff1681565b3480156108d3575f5ffd5b506106876108e2366004612f2d565b6116d9565b3480156108f2575f5ffd5b5061040060105481565b348015610907575f5ffd5b5061040060185481565b34801561091c575f5ffd5b50610499734250569cdce5065c96b597b5982f6e6d9c32971481565b348015610943575f5ffd5b506103b2610952366004612f09565b611761565b348015610962575f5ffd5b5061096b611796565b60405161038a9190612f7f565b348015610983575f5ffd5b5061040060145481565b348015610998575f5ffd5b506104006109a7366004612fc1565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b3480156109dc575f5ffd5b506106876118e5565b3480156109f0575f5ffd5b5061040060115481565b348015610a05575f5ffd5b50610687610a14366004612f09565b611dcf565b348015610a24575f5ffd5b50610687610a33366004612eb0565b611e03565b348015610a43575f5ffd5b5061040060125481565b348015610a58575f5ffd5b50610400610a67366004612f09565b611e9b565b606060038054610a7b90612fed565b80601f0160208091040260200160405190810160405280929190818152602001828054610aa790612fed565b8015610af25780601f10610ac957610100808354040283529160200191610af2565b820191905f5260205f20905b815481529060010190602001808311610ad557829003601f168201915b5050505050905090565b5f610b08338484612057565b5060015b92915050565b5f610b1e84848461217a565b6001600160a01b0384165f90815260016020908152604080832033845290915290205482811015610ba75760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b610bb48533858403612057565b506001949350505050565b335f8181526001602090815260408083206001600160a01b03871684529091528120549091610b08918590610bf5908690613039565b612057565b6005546001600160a01b03163314610c245760405162461bcd60e51b8152600401610b9e9061304c565b610c2d5f61277c565b565b6005546001600160a01b03163314610c595760405162461bcd60e51b8152600401610b9e9061304c565b6015819055601455565b6005545f906001600160a01b03163314610c8f5760405162461bcd60e51b8152600401610b9e9061304c565b506013805460ff19169055600190565b6005546001600160a01b03163314610cc95760405162461bcd60e51b8152600401610b9e9061304c565b6001600160a01b03919091165f908152601a60205260409020805460ff1916911515919091179055565b610cfb6127cd565b600d54610d09906005613039565b431015610d635760405162461bcd60e51b815260206004820152602260248201527f73656c6c4d6f6720636f6f6c646f776e3a2077616974206d6f726520626c6f636044820152616b7360f01b6064820152608401610b9e565b5f818152600960205260409020600381015460ff1615610db45760405162461bcd60e51b815260206004820152600c60248201526b105b1c9958591e481cdbdb1960a21b6044820152606401610b9e565b8054610dc39061044c90613081565b610dd08260010154611e9b565b610ddc906103e8613081565b1015610e2a5760405162461bcd60e51b815260206004820152601860248201527f50726f666974207468726573686f6c64206e6f74206d657400000000000000006044820152606401610b9e565b60018101546040516370a0823160e01b81523060048201525f51602061337a5f395f51905f52906370a0823190602401602060405180830381865afa158015610e75573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e999190613098565b1015610ee75760405162461bcd60e51b815260206004820152601a60248201527f4e6f7420656e6f756768204d4f4720696e20636f6e74726163740000000000006044820152606401610b9e565b60405163095ea7b360e01b81526001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d1660048201525f60248201525f51602061337a5f395f51905f529063095ea7b3906044016020604051808303815f875af1158015610f5d573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f8191906130af565b50600181015460405163095ea7b360e01b81526001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d16600482015260248101919091525f51602061337a5f395f51905f529063095ea7b3906044016020604051808303815f875af1158015610fff573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061102391906130af565b50604080516003808252608082019092525f91602082016060803683370190505090505f51602061337a5f395f51905f52815f81518110611066576110666130de565b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110e2573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061110691906130f2565b81600181518110611119576111196130de565b60200260200101906001600160a01b031690816001600160a01b031681525050308160028151811061114d5761114d6130de565b6001600160a01b039283166020918202929092010152600183015460405163d06ca61f60e01b81525f927f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d169163d06ca61f916111af91908690600401613150565b5f60405180830381865afa1580156111c9573d5f5f3e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526111f09190810190613170565b90505f606482600281518110611208576112086130de565b6020026020010151605f61121c9190613081565b6112269190613238565b6001850154604051635c11d79560e01b81529192506001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d1691635c11d79591611282918590889061dead904290600401613257565b5f604051808303815f87803b158015611299575f5ffd5b505af11580156112ab573d5f5f3e3d5ffd5b50505060038501805460ff191660011790555043600d55600b54604051339180156108fc02915f818181858888f193505050501580156112ed573d5f5f3e3d5ffd5b50505050506112fc6001600655565b50565b6005546001600160a01b031633146113295760405162461bcd60e51b8152600401610b9e9061304c565b6013805462ffff00191662010100179055565b6005546001600160a01b031633146113665760405162461bcd60e51b8152600401610b9e9061304c565b60138054911515620100000262ff000019909216919091179055565b606060048054610a7b90612fed565b6005546001600160a01b031633146113bb5760405162461bcd60e51b8152600401610b9e9061304c565b6007546001600160a01b039081169083160361143f5760405162461bcd60e51b815260206004820152603960248201527f54686520706169722063616e6e6f742062652072656d6f7665642066726f6d2060448201527f6175746f6d617465644d61726b65744d616b65725061697273000000000000006064820152608401610b9e565b6114498282612826565b5050565b6005546001600160a01b031633146114775760405162461bcd60e51b8152600401610b9e9061304c565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156114d3573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114f791906130f2565b6001600160a01b031663c9c65396307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611562573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061158691906130f2565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303815f875af11580156115d0573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115f491906130f2565b600780546001600160a01b0319166001600160a01b0392909216918217905561161e906001610c9f565b600754610c2d906001600160a01b03166001612826565b335f9081526001602090815260408083206001600160a01b0386168452909152812054828110156116b65760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610b9e565b6116c33385858403612057565b5060019392505050565b5f610b0833848461217a565b6005546001600160a01b031633146117035760405162461bcd60e51b8152600401610b9e9061304c565b6001600160a01b0382165f81815260196020908152604091829020805460ff191685151590811790915591519182527f9d8f7706ea1113d1a167b526eca956215946dd36cc7df39eb16180222d8b5df7910160405180910390a25050565b6005545f906001600160a01b0316331461178d5760405162461bcd60e51b8152600401610b9e9061304c565b50601155600190565b604080516003808252608082019092526060915f9190602082018480368337019050506040516370a0823160e01b815261dead600482015290915030906370a0823190602401602060405180830381865afa1580156117f7573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061181b9190613098565b815f8151811061182d5761182d6130de565b602002602001018181525050478160018151811061184d5761184d6130de565b60209081029190910101526040516370a0823160e01b81523060048201525f51602061337a5f395f51905f52906370a0823190602401602060405180830381865afa15801561189e573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118c29190613098565b816002815181106118d5576118d56130de565b6020908102919091010152919050565b6118ed6127cd565b600c546118fb906005613039565b4310156119545760405162461bcd60e51b815260206004820152602160248201527f6275794d6f6720636f6f6c646f776e3a2077616974206d6f726520626c6f636b6044820152607360f81b6064820152608401610b9e565b600b54600a54479161196591613039565b8110156119b45760405162461bcd60e51b815260206004820152601a60248201527f4e6f7420656e6f7567682045544820696e2074726561737572790000000000006044820152606401610b9e565b6040516370a0823160e01b81523060048201525f905f51602061337a5f395f51905f52906370a0823190602401602060405180830381865afa1580156119fc573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611a209190613098565b6040805160028082526060820183529293505f9290916020830190803683370190505090507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611aa1573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611ac591906130f2565b815f81518110611ad757611ad76130de565b60200260200101906001600160a01b031690816001600160a01b0316815250505f51602061337a5f395f51905f5281600181518110611b1857611b186130de565b6001600160a01b039283166020918202929092010152600b545f917f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d169063d06ca61f90611b669087613292565b846040518363ffffffff1660e01b8152600401611b84929190613150565b5f60405180830381865afa158015611b9e573d5f5f3e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611bc59190810190613170565b90505f606482600181518110611bdd57611bdd6130de565b6020026020010151605f611bf19190613081565b611bfb9190613238565b90507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663b6f9de95600b5487611c3a9190613292565b838630426040518663ffffffff1660e01b8152600401611c5d94939291906132a5565b5f604051808303818588803b158015611c74575f5ffd5b505af1158015611c86573d5f5f3e3d5ffd5b50506040516370a0823160e01b81523060048201525f93505f51602061337a5f395f51905f5292506370a082319150602401602060405180830381865afa158015611cd3573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611cf79190613098565b90505f611d048683613292565b600880549192505f919082611d18836132d9565b9190505590506040518060800160405280600b548a611d379190613292565b81526020808201859052426040808401919091525f6060938401819052858152600983528181208551815592850151600184015584820151600284015593909201516003909101805460ff191691151591909117905543600c55600b54905133926108fc831502929190818181858888f19350505050158015611dbc573d5f5f3e3d5ffd5b505050505050505050610c2d6001600655565b6005546001600160a01b03163314611df95760405162461bcd60e51b8152600401610b9e9061304c565b6017819055601655565b6005546001600160a01b03163314611e2d5760405162461bcd60e51b8152600401610b9e9061304c565b6001600160a01b038116611e925760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b9e565b6112fc8161277c565b6040805160028082526060820183525f92839291906020830190803683370190505090505f51602061337a5f395f51905f52815f81518110611edf57611edf6130de565b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f5b573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f7f91906130f2565b81600181518110611f9257611f926130de565b6001600160a01b03928316602091820292909201015260405163d06ca61f60e01b81525f917f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d169063d06ca61f90611ff09087908690600401613150565b5f60405180830381865afa15801561200a573d5f5f3e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526120319190810190613170565b905080600181518110612046576120466130de565b602002602001015192505050919050565b6001600160a01b0383166120b95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610b9e565b6001600160a01b03821661211a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610b9e565b6001600160a01b038381165f8181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166121a05760405162461bcd60e51b8152600401610b9e906132f1565b6001600160a01b0382166121c65760405162461bcd60e51b8152600401610b9e90613336565b805f036121dd576121d883835f612879565b505050565b60135460ff161561252c576005546001600160a01b0384811691161480159061221457506005546001600160a01b03838116911614155b801561222857506001600160a01b03821615155b80156122375750600e5460ff16155b1561252c57601354610100900460ff166122cd576001600160a01b0383165f9081526019602052604090205460ff168061228857506001600160a01b0382165f9081526019602052604090205460ff165b6122cd5760405162461bcd60e51b81526020600482015260166024820152752a3930b234b7339034b9903737ba1030b1ba34bb329760511b6044820152606401610b9e565b6001600160a01b0383165f908152601b602052604090205460ff16801561230c57506001600160a01b0382165f908152601a602052604090205460ff16155b156123ef576010548111156123815760405162461bcd60e51b815260206004820152603560248201527f427579207472616e7366657220616d6f756e742065786365656473207468652060448201527436b0bc2a3930b739b0b1ba34b7b720b6b7bab73a1760591b6064820152608401610b9e565b6012546001600160a01b0383165f908152602081905260409020546123a69083613039565b11156123ea5760405162461bcd60e51b815260206004820152601360248201527213585e081dd85b1b195d08195e18d959591959606a1b6044820152606401610b9e565b61252c565b6001600160a01b0382165f908152601b602052604090205460ff16801561242e57506001600160a01b0383165f908152601a602052604090205460ff16155b156124a4576010548111156123ea5760405162461bcd60e51b815260206004820152603660248201527f53656c6c207472616e7366657220616d6f756e742065786365656473207468656044820152751036b0bc2a3930b739b0b1ba34b7b720b6b7bab73a1760511b6064820152608401610b9e565b6001600160a01b0382165f908152601a602052604090205460ff1661252c576012546001600160a01b0383165f908152602081905260409020546124e89083613039565b111561252c5760405162461bcd60e51b815260206004820152601360248201527213585e081dd85b1b195d08195e18d959591959606a1b6044820152606401610b9e565b305f9081526020819052604090205460115481108015908190612557575060135462010000900460ff165b80156125665750600e5460ff16155b801561258a57506001600160a01b0385165f908152601b602052604090205460ff16155b80156125ae57506001600160a01b0385165f9081526019602052604090205460ff16155b80156125d257506001600160a01b0384165f9081526019602052604090205460ff16155b156125f757600e805460ff191660011790556125ec6129cc565b600e805460ff191690555b600e546001600160a01b0386165f9081526019602052604090205460ff9182161591168061263c57506001600160a01b0385165f9081526019602052604090205460ff165b1561264457505f5b5f8115612768576001600160a01b0386165f908152601b602052604090205460ff16801561267357505f601654115b156126d057612698606461269260165488612c5f90919063ffffffff16565b90612c71565b9050601654601754826126ab9190613081565b6126b59190613238565b60185f8282546126c59190613039565b9091555061274a9050565b6001600160a01b0387165f908152601b602052604090205460ff1680156126f857505f601454115b1561274a57612717606461269260145488612c5f90919063ffffffff16565b90506014546015548261272a9190613081565b6127349190613238565b60185f8282546127449190613039565b90915550505b801561275b5761275b873083612879565b6127658186613292565b94505b612773878787612879565b50505050505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b60026006540361281f5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b9e565b6002600655565b6001600160a01b0382165f818152601b6020526040808220805460ff191685151590811790915590519092917fffa9187bf1f18bf477bd0ea1bcbb64e93b6a98132473929edfce215cd9b16fab91a35050565b6001600160a01b03831661289f5760405162461bcd60e51b8152600401610b9e906132f1565b6001600160a01b0382166128c55760405162461bcd60e51b8152600401610b9e90613336565b6001600160a01b0383165f908152602081905260409020548181101561293c5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610b9e565b6001600160a01b038085165f90815260208190526040808220858503905591851681529081208054849290612972908490613039565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516129be91815260200190565b60405180910390a350505050565b305f9081526020819052604081205460185490918215806129eb575081155b156129f557505050565b601154612a03906014613081565b831115612a1b57601154612a18906014613081565b92505b8247612a2682612c7c565b5f612a314783612e32565b5f6018819055909150612a4a606461269284600a612c5f565b90505f612a5d606461269285600a612c5f565b600f549091506001600160a01b031615612ac657600f546040516001600160a01b039091169083905f81818185875af1925050503d805f8114612abb576040519150601f19603f3d011682016040523d82523d5f602084013e612ac0565b606091505b50909650505b6040805160028082526060820183525f926020830190803683370190505090507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b42573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612b6691906130f2565b815f81518110612b7857612b786130de565b60200260200101906001600160a01b031690816001600160a01b031681525050734250569cdce5065c96b597b5982f6e6d9c32971481600181518110612bc057612bc06130de565b6001600160a01b03928316602091820292909201015260405163b6f9de9560e01b81527f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d9091169063b6f9de95908490612c26905f90869061dead9042906004016132a5565b5f604051808303818588803b158015612c3d575f5ffd5b505af1158015612c4f573d5f5f3e3d5ffd5b5050505050505050505050505050565b5f612c6a8284613081565b9392505050565b5f612c6a8284613238565b6040805160028082526060820183525f9260208301908036833701905050905030815f81518110612caf57612caf6130de565b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612d2b573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612d4f91906130f2565b81600181518110612d6257612d626130de565b60200260200101906001600160a01b031690816001600160a01b031681525050612dad307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84612057565b60405163791ac94760e01b81526001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d169063791ac94790612e019085905f90869030904290600401613257565b5f604051808303815f87803b158015612e18575f5ffd5b505af1158015612e2a573d5f5f3e3d5ffd5b505050505050565b5f612c6a8284613292565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b6001600160a01b03811681146112fc575f5ffd5b5f5f60408385031215612e97575f5ffd5b8235612ea281612e72565b946020939093013593505050565b5f60208284031215612ec0575f5ffd5b8135612c6a81612e72565b5f5f5f60608486031215612edd575f5ffd5b8335612ee881612e72565b92506020840135612ef881612e72565b929592945050506040919091013590565b5f60208284031215612f19575f5ffd5b5035919050565b80151581146112fc575f5ffd5b5f5f60408385031215612f3e575f5ffd5b8235612f4981612e72565b91506020830135612f5981612f20565b809150509250929050565b5f60208284031215612f74575f5ffd5b8135612c6a81612f20565b602080825282518282018190525f918401906040840190835b81811015612fb6578351835260209384019390920191600101612f98565b509095945050505050565b5f5f60408385031215612fd2575f5ffd5b8235612fdd81612e72565b91506020830135612f5981612e72565b600181811c9082168061300157607f821691505b60208210810361301f57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610b0c57610b0c613025565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b8082028115828204841417610b0c57610b0c613025565b5f602082840312156130a8575f5ffd5b5051919050565b5f602082840312156130bf575f5ffd5b8151612c6a81612f20565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b5f60208284031215613102575f5ffd5b8151612c6a81612e72565b5f8151808452602084019350602083015f5b828110156131465781516001600160a01b031686526020958601959091019060010161311f565b5093949350505050565b828152604060208201525f613168604083018461310d565b949350505050565b5f60208284031215613180575f5ffd5b815167ffffffffffffffff811115613196575f5ffd5b8201601f810184136131a6575f5ffd5b805167ffffffffffffffff8111156131c0576131c06130ca565b8060051b604051601f19603f830116810181811067ffffffffffffffff821117156131ed576131ed6130ca565b60405291825260208184018101929081018784111561320a575f5ffd5b6020850194505b8385101561322d57845180825260209586019590935001613211565b509695505050505050565b5f8261325257634e487b7160e01b5f52601260045260245ffd5b500490565b85815284602082015260a060408201525f61327560a083018661310d565b6001600160a01b0394909416606083015250608001529392505050565b81810381811115610b0c57610b0c613025565b848152608060208201525f6132bd608083018661310d565b6001600160a01b03949094166040830152506060015292915050565b5f600182016132ea576132ea613025565b5060010190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b60608201526080019056fe000000000000000000000000aaee1a9723aadb7afa2810263653a34ba2c21c7aa26469706673582212206a5efbbe4764831775569dd598cafc44de493379632b163a5229021a3fd8e47764736f6c634300081e0033
Verified Source Code Partial Match
Compiler: v0.8.30+commit.73712a01
EVM: prague
Optimization: Yes (200 runs)
MOG_STRATEGY.sol 1494 lines
// SPDX-License-Identifier: MIT
// Twitter: https://x.com/PepeStrategy_
// Website: https://mog.pepestrategy.io/
// Telegram: https://t.me/PepeStrategyeth
/*
🫵😹
MOG Strategy - MOGSTR
*/
// File: @uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
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)
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);
}
// File: @uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol
pragma solidity >=0.6.2;
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
// File: @uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol
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;
}
// File: @openzeppelin/contracts/security/ReentrancyGuard.sol
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}
pragma solidity ^0.8.19;
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @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 a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol)
pragma solidity ^0.8.19;
/**
* @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 meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
pragma solidity ^0.8.0;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead 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, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
_afterTokenTransfer(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:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.19;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
pragma solidity ^0.8.30;
contract MOG_STRATEGY is ERC20, Ownable,ReentrancyGuard {
using SafeMath for uint256;
IUniswapV2Router02 public immutable uniswapRouter;
address public uniswapV2Pair;
address constant public MOG_TOKEN = payable(0xaaeE1A9723aaDB7afA2810263653A34bA2C21C7a);
address constant public PEPESTR_TOKEN = payable(0x4250569cDCE5065c96B597b5982F6E6D9c329714);
address constant public WETH_TOKEN = payable(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2);
address constant public DEAD_ADDRESS = payable(0x000000000000000000000000000000000000dEaD);
uint256 private constant PROFIT_BPS = 1100;
struct Order {
uint256 ethSpent;
uint256 mogBought;
uint256 timestamp;
bool sold;
}
uint256 public nextOrderId = 1;
mapping(uint256 => Order) public orders;
uint256 public minMogBuy = 2 ether;
uint256 public txReward = 0.01 ether;
uint256 public lastBuyBlock;
uint256 public lastSellBlock;
bool private swapping;
address public treasuryWallet;
address public teamWallet;
uint256 public maxTransactionAmount;
uint256 public swapTokensAtAmount;
uint256 public maxWallet;
bool public limitsInEffect = true;
bool public tradingActive = false;
bool public swapEnabled = false;
uint256 public buyTotalFees;
uint256 public buyTreasuryFee;
uint256 public sellTotalFees;
uint256 public sellTreasuryFee;
uint256 public tokensForTreasury;
mapping(address => bool) private _isExcludedFromFees;
mapping(address => bool) public _isExcludedMaxTransactionAmount;
mapping(address => bool) public automatedMarketMakerPairs;
event UpdateUniswapRouter(
address indexed newAddress,
address indexed oldAddress
);
event ExcludeFromFees(address indexed account, bool isExcluded);
event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);
event treasuryWalletUpdated(
address indexed newWallet,
address indexed oldWallet
);
constructor() ERC20("MOG Strategy", "MOGSTR") {
IUniswapV2Router02 _uniswapRouter = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapRouter), true);
uniswapRouter = _uniswapRouter;
uint256 _buyTreasuryFee = 40; // 40% off at launch, 10% normally
uint256 _sellTreasuryFee = 40; // 40% off at launch, 10% normally
uint256 totalSupply = 1_000_000_000 * 1e18;
maxTransactionAmount = totalSupply / 100;
maxWallet = totalSupply / 100;
swapTokensAtAmount = (totalSupply * 5) / 10000;
buyTreasuryFee = _buyTreasuryFee;
buyTotalFees = buyTreasuryFee;
sellTreasuryFee = _sellTreasuryFee;
sellTotalFees = sellTreasuryFee;
treasuryWallet = address(this);
teamWallet = msg.sender;
excludeFromFees(owner(), true);
excludeFromFees(address(this), true);
excludeFromMaxTransaction(owner(), true);
excludeFromMaxTransaction(address(this), true);
_mint(msg.sender, totalSupply);
lastBuyBlock = block.number - 5;
lastSellBlock = block.number - 5;
}
receive() external payable {}
function createPair() external onlyOwner {
uniswapV2Pair = IUniswapV2Factory(uniswapRouter.factory())
.createPair(address(this), uniswapRouter.WETH());
excludeFromMaxTransaction(address(uniswapV2Pair), true);
_setAutomatedMarketMakerPair(address(uniswapV2Pair), true);
}
function enableTrading() external onlyOwner {
tradingActive = true;
swapEnabled = true;
}
// remove limits after token is stable
function removeLimits() external onlyOwner returns (bool) {
limitsInEffect = false;
return true;
}
// change the minimum amount of tokens to sell from fees
function updateSwapTokensAtAmount(uint256 newAmount)
external
onlyOwner
returns (bool)
{
swapTokensAtAmount = newAmount;
return true;
}
function excludeFromMaxTransaction(address updAds, bool isEx)
public
onlyOwner
{
_isExcludedMaxTransactionAmount[updAds] = isEx;
}
function updateSwapEnabled(bool enabled) external onlyOwner {
swapEnabled = enabled;
}
function updateBuyFees(
uint256 _treasuryFee
) external onlyOwner {
buyTreasuryFee = _treasuryFee;
buyTotalFees = buyTreasuryFee;
}
function updateSellFees(
uint256 _treasuryFee
) external onlyOwner {
sellTreasuryFee = _treasuryFee;
sellTotalFees = sellTreasuryFee;
}
function excludeFromFees(address account, bool excluded) public onlyOwner {
_isExcludedFromFees[account] = excluded;
emit ExcludeFromFees(account, excluded);
}
function setAutomatedMarketMakerPair(address pair, bool value)
public
onlyOwner
{
require(
pair != uniswapV2Pair,
"The pair cannot be removed from automatedMarketMakerPairs"
);
_setAutomatedMarketMakerPair(pair, value);
}
function _setAutomatedMarketMakerPair(address pair, bool value) private {
automatedMarketMakerPairs[pair] = value;
emit SetAutomatedMarketMakerPair(pair, value);
}
function isExcludedFromFees(address account) public view returns (bool) {
return _isExcludedFromFees[account];
}
function _transfer(
address from,
address to,
uint256 amount
) internal override {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
if (amount == 0) {
super._transfer(from, to, 0);
return;
}
if (limitsInEffect) {
if (
from != owner() &&
to != owner() &&
to != address(0) &&
!swapping
) {
if (!tradingActive) {
require(
_isExcludedFromFees[from] || _isExcludedFromFees[to],
"Trading is not active."
);
}
//when buy
if (
automatedMarketMakerPairs[from] &&
!_isExcludedMaxTransactionAmount[to]
) {
require(
amount <= maxTransactionAmount,
"Buy transfer amount exceeds the maxTransactionAmount."
);
require(
amount + balanceOf(to) <= maxWallet,
"Max wallet exceeded"
);
}
//when sell
else if (
automatedMarketMakerPairs[to] &&
!_isExcludedMaxTransactionAmount[from]
) {
require(
amount <= maxTransactionAmount,
"Sell transfer amount exceeds the maxTransactionAmount."
);
} else if (!_isExcludedMaxTransactionAmount[to]) {
require(
amount + balanceOf(to) <= maxWallet,
"Max wallet exceeded"
);
}
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= swapTokensAtAmount;
if (
canSwap &&
swapEnabled &&
!swapping &&
!automatedMarketMakerPairs[from] &&
!_isExcludedFromFees[from] &&
!_isExcludedFromFees[to]
) {
swapping = true;
swapBack();
swapping = false;
}
bool takeFee = !swapping;
// if any account belongs to _isExcludedFromFee account then remove the fee
if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {
takeFee = false;
}
uint256 fees = 0;
// only take fees on buys/sells, do not take on wallet transfers
if (takeFee) {
// on sell
if (automatedMarketMakerPairs[to] && sellTotalFees > 0) {
fees = amount.mul(sellTotalFees).div(100);
tokensForTreasury += (fees * sellTreasuryFee) / sellTotalFees;
}
// on buy
else if (automatedMarketMakerPairs[from] && buyTotalFees > 0) {
fees = amount.mul(buyTotalFees).div(100);
tokensForTreasury += (fees * buyTreasuryFee) / buyTotalFees;
}
if (fees > 0) {
super._transfer(from, address(this), fees);
}
amount -= fees;
}
super._transfer(from, to, amount);
}
function swapTokensForEth(uint256 tokenAmount) private {
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapRouter.WETH();
_approve(address(this), address(uniswapRouter), tokenAmount);
// make the swap
uniswapRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function swapBack() private {
uint256 contractBalance = balanceOf(address(this));
uint256 totalTokensToSwap = tokensForTreasury;
bool success;
if (contractBalance == 0 || totalTokensToSwap == 0) {
return;
}
if (contractBalance > swapTokensAtAmount * 20) {
contractBalance = swapTokensAtAmount * 20;
}
uint256 amountToSwapForETH = contractBalance;
uint256 initialETHBalance = address(this).balance;
swapTokensForEth(amountToSwapForETH);
uint256 ethBalance = address(this).balance.sub(initialETHBalance);
tokensForTreasury = 0;
uint256 teamShare = ethBalance.mul(10).div(100);
uint256 PEPESTR_SHARE = ethBalance.mul(10).div(100);
if (teamWallet != address(0)) {
(success, ) = teamWallet.call{value: teamShare}("");
}
if (PEPESTR_TOKEN != address(0)) {
// buy pepestr and burn
address[] memory path = new address[](2);
path[0] = uniswapRouter.WETH();
path[1] = PEPESTR_TOKEN;
uniswapRouter.swapExactETHForTokensSupportingFeeOnTransferTokens{value: PEPESTR_SHARE}(
0,
path,
address(DEAD_ADDRESS),
block.timestamp
);
}
}
/* mog funcs */
function buyMog() external nonReentrant{
require(block.number >= lastBuyBlock + 5, "buyMog cooldown: wait more blocks");
uint256 treasuryBalance = address(this).balance;
require(treasuryBalance >= minMogBuy + txReward, "Not enough ETH in treasury");
uint256 beforeMogBalance = IERC20(MOG_TOKEN).balanceOf(address(this));
address[] memory path = new address[](2);
path[0] = uniswapRouter.WETH();
path[1] = MOG_TOKEN;
uint256[] memory amounts = uniswapRouter.getAmountsOut(treasuryBalance - txReward, path);
uint256 minOut = amounts[1] * 95 / 100;
uniswapRouter.swapExactETHForTokensSupportingFeeOnTransferTokens{value: treasuryBalance - txReward}(
minOut,
path,
address(this),
block.timestamp
);
uint256 afterMogBalance = IERC20(MOG_TOKEN).balanceOf(address(this));
uint256 mogBought = afterMogBalance - beforeMogBalance;
uint256 orderId = nextOrderId++;
orders[orderId] = Order({
ethSpent: treasuryBalance - txReward,
mogBought: mogBought,
timestamp: block.timestamp,
sold: false
});
lastBuyBlock = block.number;
payable(msg.sender).transfer(txReward);
}
function sellMog(uint256 orderId) external nonReentrant{
require(block.number >= lastSellBlock + 5, "sellMog cooldown: wait more blocks");
Order storage order = orders[orderId];
require(!order.sold, "Already sold");
require(previewSell(order.mogBought) * 1000 >= order.ethSpent * PROFIT_BPS, "Profit threshold not met");
require(IERC20(MOG_TOKEN).balanceOf(address(this)) >= order.mogBought, "Not enough MOG in contract");
IERC20(MOG_TOKEN).approve(address(uniswapRouter), 0);
IERC20(MOG_TOKEN).approve(address(uniswapRouter), order.mogBought);
address[] memory path = new address[](3);
path[0] = MOG_TOKEN;
path[1] = uniswapRouter.WETH();
path[2] = address(this);
uint256[] memory amounts = uniswapRouter.getAmountsOut(order.mogBought, path);
uint256 minOut = amounts[2] * 95 / 100;
uniswapRouter.swapExactTokensForTokensSupportingFeeOnTransferTokens(
order.mogBought,
minOut,
path,
address(DEAD_ADDRESS),
block.timestamp
);
order.sold = true;
lastSellBlock = block.number;
payable(msg.sender).transfer(txReward);
}
function previewSell(uint256 amountIn) public view returns (uint256 ethExpected) {
address[] memory path = new address[](2);
path[0] = MOG_TOKEN;
path[1] = uniswapRouter.WETH();
uint[] memory amounts = uniswapRouter.getAmountsOut(amountIn, path);
ethExpected = amounts[1]; // path[1] = ETH (WETH)
}
function stats() public view returns(uint256[] memory){
uint256[] memory data = new uint256[](3);
data[0] = IERC20(address(this)).balanceOf(DEAD_ADDRESS); // data0
data[1] = address(this).balance; // data1
data[2] = IERC20(MOG_TOKEN).balanceOf(address(this)); // data2
return data;
}
}
Read Contract
DEAD_ADDRESS 0x4e6fd6c4 → address
MOG_TOKEN 0x59001553 → address
PEPESTR_TOKEN 0xd246d891 → address
WETH_TOKEN 0x37d277d4 → address
_isExcludedMaxTransactionAmount 0x10d5de53 → bool
allowance 0xdd62ed3e → uint256
automatedMarketMakerPairs 0xb62496f5 → bool
balanceOf 0x70a08231 → uint256
buyTotalFees 0xd85ba063 → uint256
buyTreasuryFee 0x5c068a8c → uint256
decimals 0x313ce567 → uint8
isExcludedFromFees 0x4fbee193 → bool
lastBuyBlock 0x7973bfd2 → uint256
lastSellBlock 0x5cd5cca4 → uint256
limitsInEffect 0x4a62bb65 → bool
maxTransactionAmount 0xc8c8ebe4 → uint256
maxWallet 0xf8b45b05 → uint256
minMogBuy 0x2b14a8fe → uint256
name 0x06fdde03 → string
nextOrderId 0x2a58b330 → uint256
orders 0xa85c38ef → uint256, uint256, uint256, bool
owner 0x8da5cb5b → address
previewSell 0xfb3dd95f → uint256
sellTotalFees 0x6a486a8e → uint256
sellTreasuryFee 0x6b2fb124 → uint256
stats 0xd80528ae → uint256[]
swapEnabled 0x6ddd1713 → bool
swapTokensAtAmount 0xe2f45605 → uint256
symbol 0x95d89b41 → string
teamWallet 0x59927044 → address
tokensForTreasury 0xcc2ffe7c → uint256
totalSupply 0x18160ddd → uint256
tradingActive 0xbbc0c742 → bool
treasuryWallet 0x4626402b → address
txReward 0x46d63676 → uint256
uniswapRouter 0x735de9f7 → address
uniswapV2Pair 0x49bd5a5e → address
Write Contract 19 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
buyMog 0xe211ca00
No parameters
createPair 0x9e78fb4f
No parameters
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
enableTrading 0x8a8c523c
No parameters
excludeFromFees 0xc0246668
address account
bool excluded
excludeFromMaxTransaction 0x7571336a
address updAds
bool isEx
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
removeLimits 0x751039fc
No parameters
returns: bool
renounceOwnership 0x715018a6
No parameters
sellMog 0x8948f084
uint256 orderId
setAutomatedMarketMakerPair 0x9a7a23d6
address pair
bool value
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
updateBuyFees 0x71fc4688
uint256 _treasuryFee
updateSellFees 0xeba4c333
uint256 _treasuryFee
updateSwapEnabled 0x924de9b7
bool enabled
updateSwapTokensAtAmount 0xd257b34f
uint256 newAmount
returns: bool
Token Balances (1)
View Transfers →Recent Transactions
No transactions found for this address