Forkchoice Ethereum Mainnet

Address Contract Partially Verified

Address 0x85f1B3C07cb4c6596471a5D7b08EDf3FD50694d7
Balance 0 ETH
Nonce 1
Code Size 10978 bytes
Indexed Transactions 0 (1 on-chain, 0.6% indexed)
External Etherscan · Sourcify

Contract Bytecode

10978 bytes
0x6080604052600436106102695760003560e01c80638da5cb5b11610143578063c04a894c116100bb578063dff90b5b11610077578063dff90b5b14610719578063e01af92c1461072e578063e99c9d091461074e578063f2fde38b1461076e578063f34eb0b81461078e578063ffb54a99146107ae57005b8063c04a894c14610678578063c0f17acd14610698578063c1aea0c3146106ae578063c9567bf9146106c4578063d077b48f146106d9578063dd62ed3e146106f957005b8063a457c2d71161010a578063a457c2d7146105cc578063a9059cbb146105ec578063aa4bde281461060c578063ac0a18a214610622578063afa4f3b214610642578063b6cf8ce61461066257005b80638da5cb5b1461054d57806395d89b41146105755780639c3b4fdc1461058a5780639e93ad8e146105a0578063a0d82dc5146105b657005b8063313ce567116101e15780636ddd17131161019d5780636ddd17131461049757806370a08231146104b7578063715018a6146104ed578063743fdd7214610502578063751039fc1461052257806388e765ff1461053757005b8063313ce567146103d757806339509351146103f35780633bbac5791461041357806366d602ae1461044c57806367c45349146104625780636d6591811461047757005b80631f110500116102305780631f1105001461032c5780631f53ac021461034c57806320800a001461036c57806323b872dd1461038157806327a14fc2146103a1578063312394a0146103c157005b806306fdde0314610272578063095ea7b31461029d5780630a3d5b55146102cd5780630b01aa51146102ed57806318160ddd1461030d57005b3661027057005b005b34801561027e57600080fd5b506102876107c8565b60405161029491906125b6565b60405180910390f35b3480156102a957600080fd5b506102bd6102b8366004612629565b61085a565b6040519015158152602001610294565b3480156102d957600080fd5b506102706102e8366004612684565b610874565b3480156102f957600080fd5b5061027061030836600461275b565b6108e8565b34801561031957600080fd5b506002545b604051908152602001610294565b34801561033857600080fd5b50610270610347366004612684565b6109c9565b34801561035857600080fd5b5061027061036736600461275b565b610a38565b34801561037857600080fd5b50610270610b14565b34801561038d57600080fd5b506102bd61039c366004612778565b610b69565b3480156103ad57600080fd5b506102706103bc3660046127b9565b610b8d565b3480156103cd57600080fd5b5061031e60185481565b3480156103e357600080fd5b5060405160128152602001610294565b3480156103ff57600080fd5b506102bd61040e366004612629565b610c2f565b34801561041f57600080fd5b506102bd61042e36600461275b565b6001600160a01b031660009081526009602052604090205460ff1690565b34801561045857600080fd5b5061031e600c5481565b34801561046e57600080fd5b50610270610c51565b34801561048357600080fd5b506102706104923660046127d2565b610c75565b3480156104a357600080fd5b50600a546102bd9062010000900460ff1681565b3480156104c357600080fd5b5061031e6104d236600461275b565b6001600160a01b031660009081526020819052604090205490565b3480156104f957600080fd5b50610270610cf0565b34801561050e57600080fd5b5061027061051d36600461275b565b610d04565b34801561052e57600080fd5b50610270610de0565b34801561054357600080fd5b5061031e600b5481565b34801561055957600080fd5b506005546040516001600160a01b039091168152602001610294565b34801561058157600080fd5b50610287610e04565b34801561059657600080fd5b5061031e60145481565b3480156105ac57600080fd5b5061031e6103e881565b3480156105c257600080fd5b5061031e601a5481565b3480156105d857600080fd5b506102bd6105e7366004612629565b610e13565b3480156105f857600080fd5b506102bd610607366004612629565b610e8e565b34801561061857600080fd5b5061031e600d5481565b34801561062e57600080fd5b5061027061063d3660046127d2565b610e9c565b34801561064e57600080fd5b5061027061065d3660046127b9565b610f11565b34801561066e57600080fd5b5061031e601c5481565b34801561068457600080fd5b50610270610693366004612684565b61101e565b3480156106a457600080fd5b5061031e60125481565b3480156106ba57600080fd5b5061031e60165481565b3480156106d057600080fd5b5061027061114b565b3480156106e557600080fd5b506102706106f436600461275b565b6111f8565b34801561070557600080fd5b5061031e6107143660046127fe565b6113db565b34801561072557600080fd5b50610270611406565b34801561073a57600080fd5b50610270610749366004612837565b611418565b34801561075a57600080fd5b506102706107693660046127b9565b61143c565b34801561077a57600080fd5b5061027061078936600461275b565b6114d2565b34801561079a57600080fd5b506102706107a93660046127b9565b611548565b3480156107ba57600080fd5b50600a546102bd9060ff1681565b6060600380546107d790612854565b80601f016020809104026020016040519081016040528092919081815260200182805461080390612854565b80156108505780601f1061082557610100808354040283529160200191610850565b820191906000526020600020905b81548152906001019060200180831161083357829003601f168201915b5050505050905090565b6000336108688185856115d7565b60019150505b92915050565b61087c6116fb565b60005b82518110156108e357816008600085848151811061089f5761089f61288e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108db816128ba565b91505061087f565b505050565b6108f06116fb565b6001600160a01b03811661094b5760405162461bcd60e51b815260206004820152601e60248201527f5f6c697157616c6c657420616464726573732063616e6e6f742062652030000060448201526064015b60405180910390fd5b602480546001600160a01b039081166000908152600760208181526040808420805460ff19908116909155865486168552600880845282862080548316905587546001600160a01b03191698871698891788559785529282528084208054841660019081179091559554909416835294909452208054909216179055565b6109d16116fb565b60005b82518110156108e35781600760008584815181106109f4576109f461288e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610a30816128ba565b9150506109d4565b610a406116fb565b6001600160a01b038116610a965760405162461bcd60e51b815260206004820152601e60248201527f5f64657657616c6c657420616464726573732063616e6e6f74206265203000006044820152606401610942565b602380546001600160a01b039081166000908152600760208181526040808420805460ff19908116909155865486168552600880845282862080548316905587546001600160a01b03191698871698891788559785529282528084208054841660019081179091559554909416835294909452208054909216179055565b610b1c6116fb565b604051600090339047908381818185875af1925050503d8060008114610b5e576040519150601f19603f3d011682016040523d82523d6000602084013e610b63565b606091505b50505050565b600033610b77858285611755565b610b828585856117c9565b506001949350505050565b610b956116fb565b610bb56103e8610baf6001610ba960025490565b90611d5f565b90611d72565b811015610c2a5760405162461bcd60e51b815260206004820152603960248201527f4d61782077616c6c657420616d6f756e742063616e6e6f74206265206c6f776560448201527f72207468616e20302e312520746f74616c20737570706c792e000000000000006064820152608401610942565b600d55565b600033610868818585610c4283836113db565b610c4c91906128d3565b6115d7565b610c596116fb565b30600090815260208190526040902054610c7281611d7e565b50565b610c7d6116fb565b61012c610c9482610c8e8686611ed8565b90611ed8565b1115610ce25760405162461bcd60e51b815260206004820152601d60248201527f4d757374206b656570206275792074617865732062656c6f77203330250000006044820152606401610942565b601292909255601455601655565b610cf86116fb565b610d026000611ee4565b565b610d0c6116fb565b6001600160a01b038116610d625760405162461bcd60e51b815260206004820152601f60248201527f5f6d6b746757616c6c657420616464726573732063616e6e6f742062652030006044820152606401610942565b602280546001600160a01b039081166000908152600760208181526040808420805460ff19908116909155865486168552600880845282862080548316905587546001600160a01b03191698871698891788559785529282528084208054841660019081179091559554909416835294909452208054909216179055565b610de86116fb565b6b033b2e3c9fd0803ce8000000600b819055600c819055600d55565b6060600480546107d790612854565b60003381610e2182866113db565b905083811015610e815760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610942565b610b8282868684036115d7565b6000336108688185856117c9565b610ea46116fb565b61012c610eb582610c8e8686611ed8565b1115610f035760405162461bcd60e51b815260206004820152601e60248201527f4d757374206b6565702073656c6c2074617865732062656c6f772033302500006044820152606401610942565b601892909255601a55601c55565b610f196116fb565b610f2e620186a0610baf6001610ba960025490565b811015610f9b5760405162461bcd60e51b815260206004820152603560248201527f5377617020616d6f756e742063616e6e6f74206265206c6f776572207468616e60448201527410181718181892903a37ba30b61039bab838363c9760591b6064820152608401610942565b610faf6103e8610baf6005610ba960025490565b8111156110195760405162461bcd60e51b815260206004820152603260248201527f5377617020616d6f756e742063616e6e6f74206265206869676865722074686160448201527137101892903a37ba30b61039bab838363c9760711b6064820152608401610942565b602155565b6110266116fb565b60005b82518110156108e35760255483516001600160a01b03909116908490839081106110555761105561288e565b60200260200101516001600160a01b03161415801561109f5750306001600160a01b031683828151811061108b5761108b61288e565b60200260200101516001600160a01b031614155b80156110dd575060065483516001600160a01b03909116908490839081106110c9576110c961288e565b60200260200101516001600160a01b031614155b156111395781600960008584815181106110f9576110f961288e565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80611143816128ba565b915050611029565b6111536116fb565b600a5460ff16156111a65760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610942565b600a805462ff00001916620100001790556b033b2e3c9fd0803ce8000000600b819055600c819055600d8190556111e69061271090610baf906005611d5f565b602155600a805460ff19166001179055565b6112006116fb565b306001600160a01b038216036112585760405162461bcd60e51b815260206004820152601a60248201527f43616e6e6f74207769746864726177207468697320746f6b656e0000000000006044820152606401610942565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa15801561129f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c391906128e6565b116112fc5760405162461bcd60e51b81526020600482015260096024820152684e6f20746f6b656e7360b81b6044820152606401610942565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015611343573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136791906128e6565b60405163a9059cbb60e01b8152336004820152602481018290529091506001600160a01b0383169063a9059cbb906044016020604051808303816000875af11580156113b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e391906128ff565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b61140e6116fb565b47610c7281611f36565b6114206116fb565b600a8054911515620100000262ff000019909216919091179055565b6114446116fb565b6114586103e8610baf6001610ba960025490565b8110156114cd5760405162461bcd60e51b815260206004820152603760248201527f4d61782073656c6c20616d6f756e742063616e6e6f74206265206c6f7765722060448201527f7468616e20302e312520746f74616c20737570706c792e0000000000000000006064820152608401610942565b600c55565b6114da6116fb565b6001600160a01b03811661153f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610942565b610c7281611ee4565b6115506116fb565b6115646103e8610baf6001610ba960025490565b8110156115d25760405162461bcd60e51b815260206004820152603660248201527f4d61782062757920616d6f756e742063616e6e6f74206265206c6f77657220746044820152753430b71018171892903a37ba30b61039bab838363c9760511b6064820152608401610942565b600b55565b6001600160a01b0383166116395760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610942565b6001600160a01b03821661169a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610942565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6005546001600160a01b03163314610d025760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610942565b600061176184846113db565b90506000198114610b6357818110156117bc5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610942565b610b6384848484036115d7565b6001600160a01b0383166117ef5760405162461bcd60e51b81526004016109429061291c565b6001600160a01b0382166118155760405162461bcd60e51b815260040161094290612961565b600081116118775760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610942565b6001600061188d6005546001600160a01b031690565b6001600160a01b0316856001600160a01b0316141580156118bc57506005546001600160a01b03858116911614155b80156118d057506001600160a01b03841615155b80156118e757506001600160a01b03841661dead14155b80156118fb5750600a54610100900460ff16155b15611c0a576001600160a01b03851660009081526009602052604090205460ff1615801561194257506001600160a01b03841660009081526009602052604090205460ff16155b6119775760405162461bcd60e51b8152600401610942906020808252600490820152632137ba1760e11b604082015260600190565b600a5460ff16611a0c576001600160a01b03851660009081526007602052604090205460ff16806119c057506001600160a01b03841660009081526007602052604090205460ff165b611a0c5760405162461bcd60e51b815260206004820152601b60248201527f54726164696e67206973206e6f7420616c6c6f776564207965742e00000000006044820152606401610942565b6025546001600160a01b038681169116148015611a3757506006546001600160a01b03858116911614155b8015611a5c57506001600160a01b03841660009081526008602052604090205460ff16155b15611b4c57600b54831115611ac55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206578636565647320746865206d6178426044820152683abca0b6b7bab73a1760b91b6064820152608401610942565b600d5483611ae8866001600160a01b031660009081526020819052604090205490565b611af291906128d3565b1115611b4c5760405162461bcd60e51b8152602060048201526024808201527f45786365656473206d6178696d756d2077616c6c657420746f6b656e20616d6f6044820152633ab73a1760e11b6064820152608401610942565b6025546001600160a01b038581169116148015611b7757506006546001600160a01b03868116911614155b8015611b9c57506001600160a01b03851660009081526008602052604090205460ff16155b15611c0a57600c54831115611c065760405162461bcd60e51b815260206004820152602a60248201527f5472616e7366657220616d6f756e74206578636565647320746865206d61785360448201526932b63620b6b7bab73a1760b11b6064820152608401610942565b5060015b6001600160a01b03851660009081526007602052604090205460ff1680611c4957506001600160a01b03841660009081526007602052604090205460ff165b15611c5357600091505b6025546001600160a01b03868116911614801590611c7f57506025546001600160a01b03858116911614155b15611c8957600091505b306000908152602081905260408120549050600060215482118015611cab5750825b9050808015611cc25750600a5462010000900460ff165b8015611cd65750600a54610100900460ff16155b8015611cfb57506001600160a01b03871660009081526007602052604090205460ff16155b8015611d2057506001600160a01b03861660009081526007602052604090205460ff16155b15611d4957600a805461ff001916610100179055611d3d82611fbf565b600a805461ff00191690555b611d56878787878761219a565b50505050505050565b6000611d6b82846129a4565b9392505050565b6000611d6b82846129bb565b6040805160028082526060820183526000926020830190803683370190505090503081600081518110611db357611db361288e565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611e0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e3091906129dd565b81600181518110611e4357611e4361288e565b6001600160a01b039283166020918202929092010152600654611e6991309116846115d7565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac94790611ea29085906000908690309042906004016129fa565b600060405180830381600087803b158015611ebc57600080fd5b505af1158015611ed0573d6000803e3d6000fd5b505050505050565b6000611d6b82846128d3565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6022546001600160a01b03166108fc611f50836002611d72565b6040518115909202916000818181858888f19350505050158015611f78573d6000803e3d6000fd5b506023546001600160a01b03166108fc611f93836002611d72565b6040518115909202916000818181858888f19350505050158015611fbb573d6000803e3d6000fd5b5050565b6000611fde602054610c8e601f54601e54611ed890919063ffffffff16565b90506000821580611fed575081155b15611ff757505050565b602154612005906005611d5f565b83111561201d5760215461201a906005611d5f565b92505b600061203d6002610baf85610baf60205489611d5f90919063ffffffff16565b9050600061204b85836121fa565b90504761205782611d7e565b600061206347836121fa565b9050600061208087610baf601e5485611d5f90919063ffffffff16565b9050600061209d88610baf601f5486611d5f90919063ffffffff16565b905060006120b5826120af86866121fa565b906121fa565b6000601e819055601f819055602055905086158015906120d55750600081115b156120e4576120e48782612206565b6023546040516001600160a01b03909116908390600081818185875af1925050503d8060008114612131576040519150601f19603f3d011682016040523d82523d6000602084013e612136565b606091505b50506022546040519199506001600160a01b0316904790600081818185875af1925050503d8060008114612186576040519150601f19603f3d011682016040523d82523d6000602084013e61218b565b606091505b50505050505050505050505050565b816121ac576121a76122b4565b6121ba565b6121b785848361233c565b92505b6121c5858585612437565b816121f3576121f3601354601255601554601455601754601655601954601855601b54601a55601d54601c55565b5050505050565b6000611d6b8284612a6b565b60065461221e9030906001600160a01b0316846115d7565b6006546024805460405163f305d71960e01b815230600482015291820185905260006044830181905260648301526001600160a01b0390811660848301524260a48301529091169063f305d71990839060c40160606040518083038185885af115801561228f573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906121f39190612a7e565b6012541580156122c45750601454155b80156122d05750601654155b80156122dc5750601854155b80156122e85750601a54155b80156122f45750601c54155b156122fb57565b60128054601355601480546015556016805460175560188054601955601a8054601b55601c8054601d55600095869055938590559184905583905582905555565b600081156123515761234c612561565b612359565b61235961258e565b600e54600090156124135761237f6103e8610baf600e5487611d5f90919063ffffffff16565b9050600e54600f548261239291906129a4565b61239c91906129bb565b601e60008282546123ad91906128d3565b9091555050600e546010546123c290836129a4565b6123cc91906129bb565b601f60008282546123dd91906128d3565b9091555050600e546010546123f290836129a4565b6123fc91906129bb565b6020600082825461240d91906128d3565b90915550505b801561242457612424853083612437565b61242e8185612a6b565b95945050505050565b6001600160a01b03831661245d5760405162461bcd60e51b81526004016109429061291c565b6001600160a01b0382166124835760405162461bcd60e51b815260040161094290612961565b6001600160a01b038316600090815260208190526040902054818110156124fb5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610942565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610b63565b601854600f819055601a546010819055601c546011819055612589929091610c8e9190611ed8565b600e55565b601254600f81905560145460108190556016546011819055612589929091610c8e9190611ed8565b600060208083528351808285015260005b818110156125e3578581018301518582016040015282016125c7565b506000604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b0381168114610c7257600080fd5b803561262481612604565b919050565b6000806040838503121561263c57600080fd5b823561264781612604565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b8015158114610c7257600080fd5b80356126248161266b565b6000806040838503121561269757600080fd5b823567ffffffffffffffff808211156126af57600080fd5b818501915085601f8301126126c357600080fd5b81356020828211156126d7576126d7612655565b8160051b604051601f19603f830116810181811086821117156126fc576126fc612655565b60405292835281830193508481018201928984111561271a57600080fd5b948201945b8386101561273f5761273086612619565b8552948201949382019361271f565b965061274e9050878201612679565b9450505050509250929050565b60006020828403121561276d57600080fd5b8135611d6b81612604565b60008060006060848603121561278d57600080fd5b833561279881612604565b925060208401356127a881612604565b929592945050506040919091013590565b6000602082840312156127cb57600080fd5b5035919050565b6000806000606084860312156127e757600080fd5b505081359360208301359350604090920135919050565b6000806040838503121561281157600080fd5b823561281c81612604565b9150602083013561282c81612604565b809150509250929050565b60006020828403121561284957600080fd5b8135611d6b8161266b565b600181811c9082168061286857607f821691505b60208210810361288857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016128cc576128cc6128a4565b5060010190565b8082018082111561086e5761086e6128a4565b6000602082840312156128f857600080fd5b5051919050565b60006020828403121561291157600080fd5b8151611d6b8161266b565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b808202811582820484141761086e5761086e6128a4565b6000826129d857634e487b7160e01b600052601260045260246000fd5b500490565b6000602082840312156129ef57600080fd5b8151611d6b81612604565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015612a4a5784516001600160a01b031683529383019391830191600101612a25565b50506001600160a01b03969096166060850152505050608001529392505050565b8181038181111561086e5761086e6128a4565b600080600060608486031215612a9357600080fd5b835192506020840151915060408401519050925092509256fea26469706673582212204fd82caa19f19fab8447e141965c45064ce56a8dcd2e8110a73ac24fbe57204e64736f6c63430008110033

Verified Source Code Partial Match

Compiler: v0.8.17+commit.8df45f5f EVM: london Optimization: Yes (200 runs)
CONFIDENTIAL.sol 1193 lines
// SPDX-License-Identifier: MIT
pragma solidity =0.8.17;
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with 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;
    }
}
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 * 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 Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }
    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }
    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        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);
    }
}
// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
 * @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 subtraction 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;
        }
    }
}
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);
    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
    /**
     * @dev 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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from,
        address to,
        uint256 amount
    ) external returns (bool);
}
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
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 v4.8.0) (token/ERC20/ERC20.sol)
/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.openzeppelin.com/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:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, 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}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, 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}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, 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) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, 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) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }
        return true;
    }
    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * 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:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");
        _beforeTokenTransfer(from, to, amount);
        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
            // decrementing then incrementing.
            _balances[to] += amount;
        }
        emit Transfer(from, to, amount);
        _afterTokenTransfer(from, to, 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;
        unchecked {
            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
            _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;
            // Overflow not possible: amount <= accountBalance <= totalSupply.
            _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 Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - 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 {}
}
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;
}

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);
}

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;
}
contract CONFIDENTIAL is Context, ERC20, Ownable {
    using SafeMath for uint256;
    IUniswapV2Router02 private uniswapV2Router;
    mapping (address => bool) private _excludedFees;
    mapping (address => bool) private _excludedMaxTx;
    mapping (address => bool) private _isBot;
    bool public tradingOpen;
    bool private _swapping;
    bool public swapEnabled = false;
    uint256 private constant _tSupply = 1000000000 * (10**18);
    uint256 public maxBuyAmount = _tSupply;
    uint256 public maxSellAmount = _tSupply;
    uint256 public maxWalletAmount = _tSupply;
    uint256 public constant FEE_DIVISOR = 1000;
    uint256 private _totalFees;
    uint256 private _mktgFee;
    uint256 private _devFee;
    uint256 private _liqFee;
    uint256 public buyMktgFee = 20;
    uint256 private _previousBuyMktgFee = buyMktgFee;
    uint256 public buyDevFee = 10;
    uint256 private _previousBuyDevFee = buyDevFee;
    uint256 public buyLiqFee = 10;
    uint256 private _previousBuyLiqFee = buyLiqFee;
    uint256 public sellMktgFee = 20;
    uint256 private _previousSellMktgFee = sellMktgFee;
    uint256 public sellDevFee = 10;
    uint256 private _previousSellDevFee = sellDevFee;
    uint256 public sellLiqFee = 10;
    uint256 private _previousSellLiqFee = sellLiqFee;
    uint256 private _tokensForMktg;
    uint256 private _tokensForDev;
    uint256 private _tokensForLiq;
    uint256 private _swapTokensAtAmount = 0;
    address payable private _mktgWallet = payable(0x5d74B1aC320d8647dDf5DfbBa32C89265946D502);
    address payable private _devWallet = payable(0xe62B199E5C8cbC96Ec2530c3cE70A995586941AF);
    address payable private _liqWallet = payable(0x5d74B1aC320d8647dDf5DfbBa32C89265946D502);
    address private uniswapV2Pair;
    address constant private DEAD = 0x000000000000000000000000000000000000dEaD;
    address constant private ZERO = 0x0000000000000000000000000000000000000000;
    
    constructor() ERC20("CONFIDENTIAL", "$CFDL") {
        uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
        _approve(address(this), address(uniswapV2Router), _tSupply);
        uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
        IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
        _excludedFees[owner()] = true;
        _excludedFees[address(this)] = true;
        _excludedFees[DEAD] = true;
        _excludedFees[_mktgWallet] = true;
        _excludedFees[_liqWallet] = true;
        _excludedMaxTx[owner()] = true;
        _excludedMaxTx[address(this)] = true;
        _excludedMaxTx[DEAD] = true;
        _excludedMaxTx[_mktgWallet] = true;
        _excludedMaxTx[_liqWallet] = true;
        _mint(owner(), _tSupply);
    }
    function _transfer(address from, address to, uint256 amount) internal override {
        require(from != ZERO, "ERC20: transfer from the zero address");
        require(to != ZERO, "ERC20: transfer to the zero address");
        require(amount > 0, "Transfer amount must be greater than zero");
        bool takeFee = true;
        bool shouldSwap = false;
        if (from != owner() && to != owner() && to != ZERO && to != DEAD && !_swapping) {
            require(!_isBot[from] && !_isBot[to], "Bot.");
            if(!tradingOpen) require(_excludedFees[from] || _excludedFees[to], "Trading is not allowed yet.");
            if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_excludedMaxTx[to]) {
                require(amount <= maxBuyAmount, "Transfer amount exceeds the maxBuyAmount.");
                require(balanceOf(to) + amount <= maxWalletAmount, "Exceeds maximum wallet token amount.");
            }
            
            if (to == uniswapV2Pair && from != address(uniswapV2Router) && !_excludedMaxTx[from]) {
                require(amount <= maxSellAmount, "Transfer amount exceeds the maxSellAmount.");
                shouldSwap = true;
            }
        }
        if(_excludedFees[from] || _excludedFees[to]) takeFee = false;
        if(from != uniswapV2Pair && to != uniswapV2Pair) takeFee = false;  
        uint256 contractBalance = balanceOf(address(this));
        bool canSwap = (contractBalance > _swapTokensAtAmount) && shouldSwap;
        if (canSwap && swapEnabled && !_swapping && !_excludedFees[from] && !_excludedFees[to]) {
            _swapping = true;
            _swapBack(contractBalance);
            _swapping = false;
        }
        _tokenTransfer(from, to, amount, takeFee, shouldSwap);
    }
    function _swapBack(uint256 contractBalance) internal {
        uint256 totalTokensToSwap =  _tokensForMktg.add(_tokensForDev).add(_tokensForLiq);
        bool success;
        
        if (contractBalance == 0 || totalTokensToSwap == 0) return;
        if (contractBalance > _swapTokensAtAmount.mul(5)) contractBalance = _swapTokensAtAmount.mul(5);
        uint256 liquidityTokens = contractBalance.mul(_tokensForLiq).div(totalTokensToSwap).div(2);
        uint256 amountToSwapForETH = contractBalance.sub(liquidityTokens);
        uint256 initialETHBalance = address(this).balance;
        swapTokensForETH(amountToSwapForETH);
        
        uint256 ETHBalance = address(this).balance.sub(initialETHBalance);
        uint256 ETHForMktg = ETHBalance.mul(_tokensForMktg).div(totalTokensToSwap);
        uint256 ETHForDev = ETHBalance.mul(_tokensForDev).div(totalTokensToSwap);
        uint256 ETHForLiq = ETHBalance.sub(ETHForMktg).sub(ETHForDev);
        
        _tokensForMktg = 0;
        _tokensForDev = 0;
        _tokensForLiq = 0;
        if(liquidityTokens > 0 && ETHForLiq > 0) _addLiquidity(liquidityTokens, ETHForLiq);
        (success,) = address(_devWallet).call{value: ETHForDev}("");
        (success,) = address(_mktgWallet).call{value: address(this).balance}("");
    }
    function swapTokensForETH(uint256 tokenAmount) internal {
        address[] memory path = new address[](2);
        path[0] = address(this);
        path[1] = uniswapV2Router.WETH();
        _approve(address(this), address(uniswapV2Router), tokenAmount);
        uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
            tokenAmount,
            0,
            path,
            address(this),
            block.timestamp
        );
    }
    function _addLiquidity(uint256 tokenAmount, uint256 ETHAmount) internal {
        _approve(address(this), address(uniswapV2Router), tokenAmount);
        uniswapV2Router.addLiquidityETH{value: ETHAmount}(
            address(this),
            tokenAmount,
            0,
            0,
            _liqWallet,
            block.timestamp
        );
    }
        
    function sendETHToFee(uint256 amount) internal {
        _mktgWallet.transfer(amount.div(2));
        _devWallet.transfer(amount.div(2));
    }
    function isBot(address wallet) external view returns (bool) {
        return _isBot[wallet];
    }
    function openTrading() public onlyOwner {
        require(!tradingOpen, "Trading is already open");
        swapEnabled = true;
        maxBuyAmount = _tSupply;
        maxSellAmount = _tSupply;
        maxWalletAmount = _tSupply;
        _swapTokensAtAmount = _tSupply.mul(5).div(10000);
        tradingOpen = true;
    }
    function setSwapEnabled(bool onoff) public onlyOwner {
        swapEnabled = onoff;
    }
    function setMaxBuyAmount(uint256 _maxBuyAmount) public onlyOwner {
        require(_maxBuyAmount >= (totalSupply().mul(1).div(1000)), "Max buy amount cannot be lower than 0.1% total supply.");
        maxBuyAmount = _maxBuyAmount;
    }
    function setMaxSellAmount(uint256 _maxSellAmount) public onlyOwner {
        require(_maxSellAmount >= (totalSupply().mul(1).div(1000)), "Max sell amount cannot be lower than 0.1% total supply.");
        maxSellAmount = _maxSellAmount;
    }
    
    function setMaxWalletAmount(uint256 _maxWalletAmount) public onlyOwner {
        require(_maxWalletAmount >= (totalSupply().mul(1).div(1000)), "Max wallet amount cannot be lower than 0.1% total supply.");
        maxWalletAmount = _maxWalletAmount;
    }
    
    function setSwapTokensAtAmount(uint256 swapTokensAtAmount) public onlyOwner {
        require(swapTokensAtAmount >= (totalSupply().mul(1).div(100000)), "Swap amount cannot be lower than 0.001% total supply.");
        require(swapTokensAtAmount <= (totalSupply().mul(5).div(1000)), "Swap amount cannot be higher than 1% total supply.");
        _swapTokensAtAmount = swapTokensAtAmount;
    }
    function setMktgWallet(address mktgWallet) public onlyOwner {
        require(mktgWallet != ZERO, "_mktgWallet address cannot be 0");
        _excludedFees[_mktgWallet] = false;
        _excludedMaxTx[_mktgWallet] = false;
        _mktgWallet = payable(mktgWallet);
        _excludedFees[_mktgWallet] = true;
        _excludedMaxTx[_mktgWallet] = true;
    }
    function setDevWallet(address devWallet) public onlyOwner {
        require(devWallet != ZERO, "_devWallet address cannot be 0");
        _excludedFees[_devWallet] = false;
        _excludedMaxTx[_devWallet] = false;
        _devWallet = payable(devWallet);
        _excludedFees[_devWallet] = true;
        _excludedMaxTx[_devWallet] = true;
    }
    function setLiqWallet(address liqWallet) public onlyOwner {
        require(liqWallet != ZERO, "_liqWallet address cannot be 0");
        _excludedFees[_liqWallet] = false;
        _excludedMaxTx[_liqWallet] = false;
        _liqWallet = payable(liqWallet);
        _excludedFees[_liqWallet] = true;
        _excludedMaxTx[_liqWallet] = true;
    }
    function excludeFees(address[] memory accounts, bool exclude) public onlyOwner {
        for (uint i = 0; i < accounts.length; i++) _excludedFees[accounts[i]] = exclude;
    }
    
    function excludeMaxTx(address[] memory accounts, bool exclude) public onlyOwner {
        for (uint i = 0; i < accounts.length; i++) _excludedMaxTx[accounts[i]] = exclude;
    }
    
    function bots(address[] memory accounts, bool bl) public onlyOwner {
        for (uint i = 0; i < accounts.length; i++) {
            if((accounts[i] != uniswapV2Pair) && (accounts[i] != address(this)) && (accounts[i] != address(uniswapV2Router))) _isBot[accounts[i]] = bl;
        }
    }
    function buyFee(uint256 _buyMktgFee, uint256 _buyDevFee, uint256 _buyLiqFee) public onlyOwner {
        require(_buyMktgFee.add(_buyDevFee).add(_buyLiqFee) <= 300, "Must keep buy taxes below 30%");
        buyMktgFee = _buyMktgFee;
        buyDevFee = _buyDevFee;
        buyLiqFee = _buyLiqFee;
    }
    function sellFee(uint256 _sellMktgFee, uint256 _sellDevFee, uint256 _sellLiqFee) public onlyOwner {
        require(_sellMktgFee.add(_sellDevFee).add(_sellLiqFee) <= 300, "Must keep sell taxes below 30%");
        sellMktgFee = _sellMktgFee;
        sellDevFee = _sellDevFee;
        sellLiqFee = _sellLiqFee;
    }
    function removeAllFee() internal {
        if (buyMktgFee == 0 && buyDevFee == 0 && buyLiqFee == 0 && sellMktgFee == 0 && sellDevFee == 0 && sellLiqFee == 0) return;
        _previousBuyMktgFee = buyMktgFee;
        _previousBuyDevFee = buyDevFee;
        _previousBuyLiqFee = buyLiqFee;
        _previousSellMktgFee = sellMktgFee;
        _previousSellDevFee = sellDevFee;
        _previousSellLiqFee = sellLiqFee;
        
        buyMktgFee = 0;
        buyDevFee = 0;
        buyLiqFee = 0;
        sellMktgFee = 0;
        sellDevFee = 0;
        sellLiqFee = 0;
    }
    
    function restoreAllFee() internal {
        buyMktgFee = _previousBuyMktgFee;
        buyDevFee = _previousBuyDevFee;
        buyLiqFee = _previousBuyLiqFee;
        sellMktgFee = _previousSellMktgFee;
        sellDevFee = _previousSellDevFee;
        sellLiqFee = _previousSellLiqFee;
    }
        
    function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee, bool isSell) internal {
        if (!takeFee) removeAllFee();
        else amount = _takeFees(sender, amount, isSell);
        super._transfer(sender, recipient, amount);
        
        if (!takeFee) restoreAllFee();
    }
    function _takeFees(address sender, uint256 amount, bool isSell) internal returns (uint256) {
        if (isSell) _setSell();
        else _setBuy();
        
        uint256 fees;
        if (_totalFees > 0) {
            fees = amount.mul(_totalFees).div(FEE_DIVISOR);
            _tokensForMktg += fees * _mktgFee / _totalFees;
            _tokensForDev += fees * _devFee / _totalFees;
            _tokensForLiq += fees * _devFee / _totalFees;
        }
        if (fees > 0) super._transfer(sender, address(this), fees);
        return amount -= fees;
    }
    function _setSell() internal {
        _mktgFee = sellMktgFee;
        _devFee = sellDevFee;
        _liqFee = sellLiqFee;
        _totalFees = _mktgFee.add(_devFee).add(_liqFee);
    }
    function _setBuy() internal {
        _mktgFee = buyMktgFee;
        _devFee = buyDevFee;
        _liqFee = buyLiqFee;
        _totalFees = _mktgFee.add(_devFee).add(_liqFee);
    }
    
    function unclog() public onlyOwner {
        uint256 contractBalance = balanceOf(address(this));
        swapTokensForETH(contractBalance);
    }
    
    function sendFees() public onlyOwner {
        uint256 contractETHBalance = address(this).balance;
        sendETHToFee(contractETHBalance);
    }
    function rescueETH() public onlyOwner {
        bool success;
        (success,) = address(msg.sender).call{value: address(this).balance}("");
    }
    function rescueForeignTokens(address tkn) public onlyOwner {
        require(tkn != address(this), "Cannot withdraw this token");
        require(IERC20(tkn).balanceOf(address(this)) > 0, "No tokens");
        uint amount = IERC20(tkn).balanceOf(address(this));
        IERC20(tkn).transfer(msg.sender, amount);
    }
    function removeLimits() public onlyOwner {
        maxBuyAmount = _tSupply;
        maxSellAmount = _tSupply;
        maxWalletAmount = _tSupply;
    }
    receive() external payable {}
    fallback() external payable {}
}

Read Contract

FEE_DIVISOR 0x9e93ad8e → uint256
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
buyDevFee 0x9c3b4fdc → uint256
buyLiqFee 0xc1aea0c3 → uint256
buyMktgFee 0xc0f17acd → uint256
decimals 0x313ce567 → uint8
isBot 0x3bbac579 → bool
maxBuyAmount 0x88e765ff → uint256
maxSellAmount 0x66d602ae → uint256
maxWalletAmount 0xaa4bde28 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
sellDevFee 0xa0d82dc5 → uint256
sellLiqFee 0xb6cf8ce6 → uint256
sellMktgFee 0x312394a0 → uint256
swapEnabled 0x6ddd1713 → bool
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
tradingOpen 0xffb54a99 → bool

Write Contract 26 functions

These functions modify contract state and require a wallet transaction to execute.

approve 0x095ea7b3
address spender
uint256 amount
returns: bool
bots 0xc04a894c
address[] accounts
bool bl
buyFee 0x6d659181
uint256 _buyMktgFee
uint256 _buyDevFee
uint256 _buyLiqFee
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
excludeFees 0x1f110500
address[] accounts
bool exclude
excludeMaxTx 0x0a3d5b55
address[] accounts
bool exclude
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
openTrading 0xc9567bf9
No parameters
removeLimits 0x751039fc
No parameters
renounceOwnership 0x715018a6
No parameters
rescueETH 0x20800a00
No parameters
rescueForeignTokens 0xd077b48f
address tkn
sellFee 0xac0a18a2
uint256 _sellMktgFee
uint256 _sellDevFee
uint256 _sellLiqFee
sendFees 0xdff90b5b
No parameters
setDevWallet 0x1f53ac02
address devWallet
setLiqWallet 0x0b01aa51
address liqWallet
setMaxBuyAmount 0xf34eb0b8
uint256 _maxBuyAmount
setMaxSellAmount 0xe99c9d09
uint256 _maxSellAmount
setMaxWalletAmount 0x27a14fc2
uint256 _maxWalletAmount
setMktgWallet 0x743fdd72
address mktgWallet
setSwapEnabled 0xe01af92c
bool onoff
setSwapTokensAtAmount 0xafa4f3b2
uint256 swapTokensAtAmount
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
unclog 0x67c45349
No parameters

Recent Transactions

This address has 1 on-chain transactions, but only 0.6% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →