Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0xF3F94D4339437BEfaCc1A703239Fa706d9A5dEfF
Balance 0 ETH
Nonce 102
Code Size 20398 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

20398 bytes
0x60806040526004361062000142575f3560e01c806396e5968211620000b6578063c60058931162000076578063c600589314620003a1578063ca6eccc314620003ca578063d1da962114620003e1578063d3c9cc261462000414578063ec81aadb1462000438578063f6b9ec7c1462000472575f80fd5b806396e5968214620002dd5780639f181b5e1462000310578063ad5c46481462000327578063b17acdcd1462000350578063c38ec0b6146200038a575f80fd5b80637574d9a011620001025780637574d9a0146200022c57806376649d6614620002585780638d99aeb0146200026f5780638f40e8f514620002a257806391ded8fa14620002b9575f80fd5b80631bea83fe146200014e57806320800a0014620001945780633bcc75f614620001ad5780633cfb693614620001ce578063592fe42914620001f9575f80fd5b366200014a57005b5f80fd5b3480156200015a575f80fd5b506200017773c36442b4a4522e871399cd717abdd847ab11fe8881565b6040516001600160a01b0390911681526020015b60405180910390f35b348015620001a0575f80fd5b50620001ab62000489565b005b348015620001b9575f80fd5b5060025462000177906001600160a01b031681565b348015620001da575f80fd5b50600254600160a01b900460ff1660405190151581526020016200018b565b34801562000205575f80fd5b506200021d620002173660046200336f565b620005a2565b6040516200018b9190620034b1565b34801562000238575f80fd5b506200024361271081565b60405162ffffff90911681526020016200018b565b620001ab62000269366004620034e0565b62000c55565b3480156200027b575f80fd5b50620002936200028d366004620035a1565b62001119565b6040516200018b91906200361d565b348015620002ae575f80fd5b5062000243610bb881565b348015620002c5575f80fd5b506200021d620002d736600462003631565b62001190565b348015620002e9575f80fd5b5062000301620002fb3660046200364f565b620015b4565b6040519081526020016200018b565b3480156200031c575f80fd5b506200030160015481565b34801562000333575f80fd5b506200017773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b3480156200035c575f80fd5b50620003746200036e3660046200364f565b6200164e565b604080519283526020830191909152016200018b565b34801562000396575f80fd5b50620001ab62001d68565b348015620003ad575f80fd5b50620001777368b3465833fb72a70ecdf485e0e4c7bd8665fc4581565b348015620003d6575f80fd5b50620001ab62001ecb565b348015620003ed575f80fd5b5062000405620003ff36600462003667565b62001f5f565b6040516200018b919062003688565b34801562000420575f80fd5b5062000405620004323660046200364f565b62002776565b34801562000444575f80fd5b506200045c620004563660046200364f565b62002c28565b6040516200018b989796959493929190620036ee565b3480156200047e575f80fd5b50620002436101f481565b6002546001600160a01b03163314620004bf5760405162461bcd60e51b8152600401620004b69062003771565b60405180910390fd5b4780620005045760405162461bcd60e51b81526020600482015260126024820152714e6f2045544820746f20776974686472617760701b6044820152606401620004b6565b5f336001600160a01b0316826040515b5f6040518083038185875af1925050503d805f811462000550576040519150601f19603f3d011682016040523d82523d5f602084013e62000555565b606091505b50509050806200059e5760405162461bcd60e51b8152602060048201526013602482015272115512081d1c985b9cd9995c8819985a5b1959606a1b6044820152606401620004b6565b5050565b620005ac62003265565b5f825111620005f15760405162461bcd60e51b815260206004820152601060248201526f496e76616c6964206d6574616461746160801b6044820152606401620004b6565b5f60015411620006155760405162461bcd60e51b8152600401620004b690620037a8565b5f7f000000000000000000000000c36442b4a4522e871399cd717abdd847ab11fe886001600160a01b0316634aa4a4fc6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000673573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620006999190620037e6565b90505f7f000000000000000000000000c36442b4a4522e871399cd717abdd847ab11fe886001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015620006f9573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906200071f9190620037e6565b90505f5b60015481101562000c19575f818152602081815260408083208151610100810190925280546001600160a01b0316825260018101805492939192918401916200076c9062003804565b80601f01602080910402602001604051908101604052809291908181526020018280546200079a9062003804565b8015620007e95780601f10620007bf57610100808354040283529160200191620007e9565b820191905f5260205f20905b815481529060010190602001808311620007cb57829003601f168201915b50505050508152602001600282018054620008049062003804565b80601f0160208091040260200160405190810160405280929190818152602001828054620008329062003804565b8015620008815780601f10620008575761010080835404028352916020019162000881565b820191905f5260205f20905b8154815290600101906020018083116200086357829003601f168201915b505050918352505060038201546001600160a01b0316602082015260048201546040820152600582018054606090920191620008bd9062003804565b80601f0160208091040260200160405190810160405280929190818152602001828054620008eb9062003804565b80156200093a5780601f1062000910576101008083540402835291602001916200093a565b820191905f5260205f20905b8154815290600101906020018083116200091c57829003601f168201915b5050509183525050600682015460208083019190915260079092015462ffffff1660409091015287518882012060a08301518051920191909120919250900362000c0f57805160e0820151604051630b4c774160e11b81525f9283926001600160a01b03881692631698ee8292620009ba9290918b91906004016200383e565b602060405180830381865afa158015620009d6573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620009fc9190620037e6565b90506001600160a01b0381161562000b96576040516370a0823160e01b81526001600160a01b0382811660048301525f91908816906370a0823190602401602060405180830381865afa15801562000a56573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000a7c919062003866565b84516040516370a0823160e01b81526001600160a01b0385811660048301529293505f92909116906370a0823190602401602060405180830381865afa15801562000ac9573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000aef919062003866565b90505f855f01516001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000b32573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000b58919062003866565b9050811562000b9257818162000b776714d1120d7b1600008662003892565b62000b839190620038a8565b62000b8f9190620038d6565b94505b5050505b604051806101000160405280845f01516001600160a01b03168152602001846020015181526020018460400151815260200184606001516001600160a01b03168152602001846080015181526020018460a0015181526020018381526020018460e0015162ffffff168152509650505050505050919050565b5060010162000723565b5060405162461bcd60e51b815260206004820152600f60248201526e151bdad95b881b9bdd08199bdd5b99608a1b6044820152606401620004b6565b600254600160a01b900460ff1662000cbf5760405162461bcd60e51b815260206004820152602660248201527f546f6b656e206465706c6f796d656e742069732063757272656e746c792064696044820152651cd8589b195960d21b6064820152608401620004b6565b5f85511162000d115760405162461bcd60e51b815260206004820152601a60248201527f546f6b656e206e616d652063616e6e6f7420626520656d7074790000000000006044820152606401620004b6565b5f84511162000d635760405162461bcd60e51b815260206004820152601c60248201527f546f6b656e2073796d626f6c2063616e6e6f7420626520656d707479000000006044820152606401620004b6565b62ffffff81166101f4148062000d7f575062ffffff8116610bb8145b8062000d91575062ffffff8116612710145b62000df55760405162461bcd60e51b815260206004820152602d60248201527f496e76616c69642066656520746965722e204d757374206265203530302c203360448201526c03030302c206f7220313030303609c1b6064820152608401620004b6565b5f828686333060405162000e0990620032bc565b62000e189493929190620038ec565b8190604051809103905ff590508015801562000e36573d5f803e3d5ffd5b506040516001600160a01b03821681529091507f60122e78030aba0a2e4a67adb3e52b411343cc51778f919095d3fe394090c1b29060200160405180910390a18062000e988173c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28562002e30565b341562000feb575f62000eab34620015b4565b90505f61271062000ebd8334620038a8565b62000ec99190620038d6565b90505f62000ed8823462003939565b6040805160e08101825273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281526001600160a01b038781166020830190815262ffffff8b81168486019081523360608601908152608086018881525f60a0880181815260c0890191825298516304e45aaf60e01b815297518716600489015294518616602488015291519092166044860152905183166064850152516084840152925160a4830152915190911660c48201529091507368b3465833fb72a70ecdf485e0e4c7bd8665fc45906304e45aaf90839060e40160206040518083038185885af115801562000fbf573d5f803e3d5ffd5b50505050506040513d601f19601f8201168201806040525081019062000fe6919062003866565b505050505b60408051610100810182526001600160a01b03838116825260208083018b81528385018b905233606085015242608085015260a084018a90525f60c0850181905262ffffff891660e08601526001805482529281905294909420835181546001600160a01b0319169316929092178255925191929091908201906200107190826200399f565b50604082015160028201906200108890826200399f565b5060608201516003820180546001600160a01b0319166001600160a01b039092169190911790556080820151600482015560a08201516005820190620010cf90826200399f565b5060c0820151600682015560e0909101516007909101805462ffffff191662ffffff90921691909117905560018054905f6200110b8362003a6c565b919050555050505050505050565b6060604051806020016200112d90620032bc565b601f1982820381018352601f90910116604081905262001158908690869086903090602001620038ec565b60408051601f198184030181529082905262001178929160200162003a87565b60405160208183030381529060405290509392505050565b6200119a62003265565b6001600160a01b038216620011ea5760405162461bcd60e51b8152602060048201526015602482015274496e76616c696420746f6b656e206164647265737360581b6044820152606401620004b6565b5f600154116200120e5760405162461bcd60e51b8152600401620004b690620037a8565b5f7f000000000000000000000000c36442b4a4522e871399cd717abdd847ab11fe886001600160a01b0316634aa4a4fc6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200126c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620012929190620037e6565b90505f7f000000000000000000000000c36442b4a4522e871399cd717abdd847ab11fe886001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015620012f2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620013189190620037e6565b90505f5b60015481101562000c19575f818152602081815260408083208151610100810190925280546001600160a01b031682526001810180549293919291840191620013659062003804565b80601f0160208091040260200160405190810160405280929190818152602001828054620013939062003804565b8015620013e25780601f10620013b857610100808354040283529160200191620013e2565b820191905f5260205f20905b815481529060010190602001808311620013c457829003601f168201915b50505050508152602001600282018054620013fd9062003804565b80601f01602080910402602001604051908101604052809291908181526020018280546200142b9062003804565b80156200147a5780601f1062001450576101008083540402835291602001916200147a565b820191905f5260205f20905b8154815290600101906020018083116200145c57829003601f168201915b505050918352505060038201546001600160a01b0316602082015260048201546040820152600582018054606090920191620014b69062003804565b80601f0160208091040260200160405190810160405280929190818152602001828054620014e49062003804565b8015620015335780601f10620015095761010080835404028352916020019162001533565b820191905f5260205f20905b8154815290600101906020018083116200151557829003601f168201915b50505091835250506006820154602082015260079091015462ffffff1660409091015280519091506001600160a01b03808816911603620015aa57805160e0820151604051630b4c774160e11b81525f9283926001600160a01b03881692631698ee8292620009ba9290918b91906004016200383e565b506001016200131c565b5f67011c37937e080000821015620015cd57505f919050565b6706f05b59d3b200008210620015e657506107d0919050565b5f620015fb67011c37937e0800008462003939565b90505f670de0b6b3a7640000620016138380620038a8565b6200161f9190620038d6565b90505f670de0b6b3a76400006200163983612c4a620038a8565b620016459190620038d6565b95945050505050565b5f805f807f000000000000000000000000c36442b4a4522e871399cd717abdd847ab11fe886001600160a01b03166399fbab88866040518263ffffffff1660e01b8152600401620016a191815260200190565b61018060405180830381865afa158015620016be573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620016e4919062003aef565b50505050505050509350935050505f6001600160a01b0316826001600160a01b0316141580156200171d57506001600160a01b03811615155b6200177c5760405162461bcd60e51b815260206004820152602860248201527f496e76616c696420746f6b656e49643a20706f736974696f6e20646f6573206e6044820152671bdd08195e1a5cdd60c21b6064820152608401620004b6565b5f8073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc1196001600160a01b03851601620017af57508190508262001821565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc1196001600160a01b03841601620017e057508290508162001821565b60405162461bcd60e51b815260206004820152601560248201527409ccad2e8d0cae440e8ded6cadc40d2e640ae8aa89605b1b6044820152606401620004b6565b5f826001600160a01b03166302d05d3f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200185f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620018859190620037e6565b9050336001600160a01b0382161480620018a957506002546001600160a01b031633145b620018e85760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b6044820152606401620004b6565b6040516370a0823160e01b81523060048201525f906001600160a01b038516906370a0823190602401602060405180830381865afa1580156200192d573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062001953919062003866565b6040516370a0823160e01b81523060048201529091505f906001600160a01b038516906370a0823190602401602060405180830381865afa1580156200199b573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620019c1919062003866565b604080516080810182528c815230602082019081526001600160801b0382840181815260608401828152945163fc6f786560e01b81528451600482015292516001600160a01b0390811660248501529051821660448401529351166064820152929350917f000000000000000000000000c36442b4a4522e871399cd717abdd847ab11fe889091169063fc6f78659060840160408051808303815f875af115801562001a6f573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062001a95919062003bd7565b50506040516370a0823160e01b81523060048201525f9084906001600160a01b038916906370a0823190602401602060405180830381865afa15801562001ade573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062001b04919062003866565b62001b10919062003939565b6040516370a0823160e01b81523060048201529091505f9084906001600160a01b038916906370a0823190602401602060405180830381865afa15801562001b5a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062001b80919062003866565b62001b8c919062003939565b9050811562001c0a5760405163a9059cbb60e01b815261dead6004820152602481018390526001600160a01b0389169063a9059cbb906044016020604051808303815f875af115801562001be2573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062001c08919062003bfa565b505b801562001d1f575f62001c1f600283620038d6565b604051632e1a7d4d60e01b8152600481018290529091506001600160a01b03891690632e1a7d4d906024015f604051808303815f87803b15801562001c62575f80fd5b505af115801562001c75573d5f803e3d5ffd5b505050505f876001600160a01b0316826040515f6040518083038185875af1925050503d805f811462001cc4576040519150601f19603f3d011682016040523d82523d5f602084013e62001cc9565b606091505b505090508062001d1c5760405162461bcd60e51b815260206004820152601e60248201527f455448207472616e7366657220746f2063726561746f72206661696c656400006044820152606401620004b6565b50505b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc1196001600160a01b038b160162001d56579c909b509950505050505050505050565b909c909b509950505050505050505050565b6002546001600160a01b0316331462001d955760405162461bcd60e51b8152600401620004b69062003771565b6040516370a0823160e01b81523060048201525f9073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2906370a0823190602401602060405180830381865afa15801562001de5573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062001e0b919062003866565b90505f811162001e545760405162461bcd60e51b81526020600482015260136024820152724e6f205745544820746f20776974686472617760681b6044820152606401620004b6565b604051632e1a7d4d60e01b81526004810182905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290632e1a7d4d906024015f604051808303815f87803b15801562001e9f575f80fd5b505af115801562001eb2573d5f803e3d5ffd5b505050505f336001600160a01b03168260405162000514565b6002546001600160a01b0316331462001ef85760405162461bcd60e51b8152600401620004b69062003771565b6002805460ff600160a01b808304821615810260ff60a01b1990931692909217928390556040517f23b245aef68788c75af318d8094538a8a3f52d764943a05397577e032b8bfd159362001f559390049091161515815260200190565b60405180910390a1565b60015460609060509062001f875760405162461bcd60e51b8152600401620004b690620037a8565b5f8160018360015462001f9b919062003892565b62001fa7919062003939565b62001fb39190620038d6565b905080851062001ffa5760405162461bcd60e51b815260206004820152601160248201527050616765206f7574206f662072616e676560781b6044820152606401620004b6565b5f805f865f036200208e57846200201389600162003892565b6200201f9190620038a8565b600154116200202f575f62002058565b846200203d89600162003892565b620020499190620038a8565b60015462002058919062003939565b9250620020668589620038a8565b60015462002075919062003939565b9150600154821115620020885760015491505b620020bb565b6200209a8589620038a8565b9250620020a8858462003892565b9150600154821115620020bb5760015491505b5f620020c8848462003939565b67ffffffffffffffff811115620020e357620020e3620032ca565b6040519080825280602002602001820160405280156200212057816020015b6200210c62003265565b815260200190600190039081620021025790505b5090505f7f000000000000000000000000c36442b4a4522e871399cd717abdd847ab11fe886001600160a01b0316634aa4a4fc6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562002181573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620021a79190620037e6565b90505f7f000000000000000000000000c36442b4a4522e871399cd717abdd847ab11fe886001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801562002207573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906200222d9190620037e6565b9050855b8581101562002764575f8b156200224957816200226e565b62002255888362003939565b6200226260018962003939565b6200226e919062003939565b5f818152602081815260408083208151610100810190925280546001600160a01b03168252600181018054959650939491939092840191620022b09062003804565b80601f0160208091040260200160405190810160405280929190818152602001828054620022de9062003804565b80156200232d5780601f1062002303576101008083540402835291602001916200232d565b820191905f5260205f20905b8154815290600101906020018083116200230f57829003601f168201915b50505050508152602001600282018054620023489062003804565b80601f0160208091040260200160405190810160405280929190818152602001828054620023769062003804565b8015620023c55780601f106200239b57610100808354040283529160200191620023c5565b820191905f5260205f20905b815481529060010190602001808311620023a757829003601f168201915b505050918352505060038201546001600160a01b0316602082015260048201546040820152600582018054606090920191620024019062003804565b80601f01602080910402602001604051908101604052809291908181526020018280546200242f9062003804565b80156200247e5780601f1062002454576101008083540402835291602001916200247e565b820191905f5260205f20905b8154815290600101906020018083116200246057829003601f168201915b50505091835250506006820154602082015260079091015462ffffff16604091820152815160e08301519151630b4c774160e11b81529293505f9283926001600160a01b03891692631698ee8292620024dc928c916004016200383e565b602060405180830381865afa158015620024f8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906200251e9190620037e6565b90506001600160a01b03811615620026b8576040516370a0823160e01b81526001600160a01b0382811660048301525f91908916906370a0823190602401602060405180830381865afa15801562002578573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906200259e919062003866565b84516040516370a0823160e01b81526001600160a01b0385811660048301529293505f92909116906370a0823190602401602060405180830381865afa158015620025eb573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062002611919062003866565b90505f855f01516001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562002654573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906200267a919062003866565b90508115620026b4578181620026996714d1120d7b1600008662003892565b620026a59190620038a8565b620026b19190620038d6565b94505b5050505b604051806101000160405280845f01516001600160a01b03168152602001846020015181526020018460400151815260200184606001516001600160a01b03168152602001846080015181526020018460a0015181526020018381526020018460e0015162ffffff16815250888a80620027329062003a6c565b9b508151811062002747576200274762003c1b565b602002602001018190525050505050808060010191505062002231565b50919750505050505050505b92915050565b60605f600154116200279c5760405162461bcd60e51b8152600401620004b690620037a8565b5f6107d090505f81600183600154620027b6919062003892565b620027c2919062003939565b620027ce9190620038d6565b9050808410620028155760405162461bcd60e51b815260206004820152601160248201527050616765206f7574206f662072616e676560781b6044820152606401620004b6565b5f826200282486600162003892565b620028309190620038a8565b6001541162002840575f62002869565b826200284e86600162003892565b6200285a9190620038a8565b60015462002869919062003939565b90505f620028788487620038a8565b60015462002887919062003939565b90506001548111156200289957506001545b5f620028a6838362003939565b67ffffffffffffffff811115620028c157620028c1620032ca565b604051908082528060200260200182016040528015620028fe57816020015b620028ea62003265565b815260200190600190039081620028e05790505b509050825b8281101562002c1d575f62002919858362003939565b6200292660018662003939565b62002932919062003939565b5f818152602081815260408083208151610100810190925280546001600160a01b03168252600181018054959650939491939092840191620029749062003804565b80601f0160208091040260200160405190810160405280929190818152602001828054620029a29062003804565b8015620029f15780601f10620029c757610100808354040283529160200191620029f1565b820191905f5260205f20905b815481529060010190602001808311620029d357829003601f168201915b5050505050815260200160028201805462002a0c9062003804565b80601f016020809104026020016040519081016040528092919081815260200182805462002a3a9062003804565b801562002a895780601f1062002a5f5761010080835404028352916020019162002a89565b820191905f5260205f20905b81548152906001019060200180831162002a6b57829003601f168201915b505050918352505060038201546001600160a01b031660208201526004820154604082015260058201805460609092019162002ac59062003804565b80601f016020809104026020016040519081016040528092919081815260200182805462002af39062003804565b801562002b425780601f1062002b185761010080835404028352916020019162002b42565b820191905f5260205f20905b81548152906001019060200180831162002b2457829003601f168201915b5050505050815260200160068201548152602001600782015f9054906101000a900462ffffff1662ffffff1662ffffff16815250509050604051806101000160405280825f01516001600160a01b03168152602001826020015181526020018260400151815260200182606001516001600160a01b03168152602001826080015181526020018260a0015181526020015f81526020018260e0015162ffffff1681525084878562002bf4919062003939565b8151811062002c075762002c0762003c1b565b6020908102919091010152505060010162002903565b509695505050505050565b5f60208190529081526040902080546001820180546001600160a01b03909216929162002c559062003804565b80601f016020809104026020016040519081016040528092919081815260200182805462002c839062003804565b801562002cd25780601f1062002ca85761010080835404028352916020019162002cd2565b820191905f5260205f20905b81548152906001019060200180831162002cb457829003601f168201915b50505050509080600201805462002ce99062003804565b80601f016020809104026020016040519081016040528092919081815260200182805462002d179062003804565b801562002d665780601f1062002d3c5761010080835404028352916020019162002d66565b820191905f5260205f20905b81548152906001019060200180831162002d4857829003601f168201915b505050506003830154600484015460058501805494956001600160a01b03909316949193509062002d979062003804565b80601f016020809104026020016040519081016040528092919081815260200182805462002dc59062003804565b801562002e145780601f1062002dea5761010080835404028352916020019162002e14565b820191905f5260205f20905b81548152906001019060200180831162002df657829003601f168201915b50505050600683015460079093015491929162ffffff16905088565b6001600160a01b03808316908416105f8162002e4d578362002e4f565b845b90505f8262002e5f578562002e61565b845b905073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc1196001600160a01b0383160162002f155760405163095ea7b360e01b815273c36442b4a4522e871399cd717abdd847ab11fe8860048201525f1960248201526001600160a01b0382169063095ea7b3906044016020604051808303815f875af115801562002ee8573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062002f0e919062003bfa565b5062002f9c565b60405163095ea7b360e01b815273c36442b4a4522e871399cd717abdd847ab11fe8860048201525f1960248201526001600160a01b0383169063095ea7b3906044016020604051808303815f875af115801562002f74573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062002f9a919062003bfa565b505b5f8362002fb8576d64dbacb643e10eedf7378a0b5df762002fc5565b6a0289c06ea6df5a36ae398a5b6dffffffffffffffffffffffffffff1690505f62002ff68662ffffff165f9081526003602052604090205460020b90565b90505f808615620030135750620318f7199050620d89a062003020565b50620d899f199050620318f85b826200302d818462003c2f565b62003039919062003c6d565b91508262003048818362003c2f565b62003054919062003c6d565b90505f8762003064575f62003072565b6b033b2e3c9fd0803ce80000005b6001600160601b031690505f8862003097576b033b2e3c9fd0803ce800000062003099565b5f5b6040516309f56ab160e11b81526001600160a01b038a81166004830152898116602483015262ffffff8d16604483015288811660648301526001600160601b039290921692507f000000000000000000000000c36442b4a4522e871399cd717abdd847ab11fe88909116906313ead562906084016020604051808303815f875af11580156200312a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620031509190620037e6565b507f000000000000000000000000c36442b4a4522e871399cd717abdd847ab11fe886001600160a01b031663883164566040518061016001604052808b6001600160a01b031681526020018a6001600160a01b031681526020018d62ffffff1681526020018760020b81526020018660020b81526020018581526020018481526020015f81526020015f8152602001306001600160a01b03168152602001428152506040518263ffffffff1660e01b815260040162003210919062003c96565b6080604051808303815f875af11580156200322d573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062003253919062003d5f565b50505050505050505050505050505050565b6040518061010001604052805f6001600160a01b0316815260200160608152602001606081526020015f6001600160a01b031681526020015f8152602001606081526020015f81526020015f62ffffff1681525090565b6111dd8062003d9c83390190565b634e487b7160e01b5f52604160045260245ffd5b5f82601f830112620032ee575f80fd5b813567ffffffffffffffff808211156200330c576200330c620032ca565b604051601f8301601f19908116603f01168101908282118183101715620033375762003337620032ca565b8160405283815286602085880101111562003350575f80fd5b836020870160208301375f602085830101528094505050505092915050565b5f6020828403121562003380575f80fd5b813567ffffffffffffffff81111562003397575f80fd5b620033a584828501620032de565b949350505050565b5f5b83811015620033c9578181015183820152602001620033af565b50505f910152565b5f8151808452620033ea816020860160208601620033ad565b601f01601f19169290920160200192915050565b5f61010060018060a01b03835116845260208301518160208601526200342782860182620033d1565b91505060408301518482036040860152620034438282620033d1565b91505060608301516200346160608601826001600160a01b03169052565b506080830151608085015260a083015184820360a0860152620034858282620033d1565b91505060c083015160c085015260e0830151620034a960e086018262ffffff169052565b509392505050565b602081525f620034c56020830184620033fe565b9392505050565b62ffffff81168114620034dd575f80fd5b50565b5f805f805f60a08688031215620034f5575f80fd5b853567ffffffffffffffff808211156200350d575f80fd5b6200351b89838a01620032de565b9650602088013591508082111562003531575f80fd5b6200353f89838a01620032de565b9550604088013591508082111562003555575f80fd5b506200356488828901620032de565b9350506060860135915060808601356200357e81620034cc565b809150509295509295909350565b6001600160a01b0381168114620034dd575f80fd5b5f805f60608486031215620035b4575f80fd5b833567ffffffffffffffff80821115620035cc575f80fd5b620035da87838801620032de565b94506020860135915080821115620035f0575f80fd5b50620035ff86828701620032de565b925050604084013562003612816200358c565b809150509250925092565b602081525f620034c56020830184620033d1565b5f6020828403121562003642575f80fd5b8135620034c5816200358c565b5f6020828403121562003660575f80fd5b5035919050565b5f806040838503121562003679575f80fd5b50508035926020909101359150565b5f60208083016020845280855180835260408601915060408160051b8701019250602087015f5b82811015620036e157603f19888603018452620036ce858351620033fe565b94509285019290850190600101620036af565b5092979650505050505050565b6001600160a01b038981168252610100602083018190525f91620037158483018c620033d1565b915083820360408501526200372b828b620033d1565b915080891660608501525086608084015282810360a0840152620037508187620033d1565b9150508360c083015262ffffff831660e08301529998505050505050505050565b60208082526018908201527f43616c6c6572206973206e6f7420636f6e74726f6c6c65720000000000000000604082015260600190565b602080825260129082015271139bc81d1bdad95b9cc819195c1b1bde595960721b604082015260600190565b8051620037e1816200358c565b919050565b5f60208284031215620037f7575f80fd5b8151620034c5816200358c565b600181811c908216806200381957607f821691505b6020821081036200383857634e487b7160e01b5f52602260045260245ffd5b50919050565b6001600160a01b03938416815291909216602082015262ffffff909116604082015260600190565b5f6020828403121562003877575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b808201808211156200277057620027706200387e565b80820281158282048414176200277057620027706200387e565b634e487b7160e01b5f52601260045260245ffd5b5f82620038e757620038e7620038c2565b500490565b608081525f620039006080830187620033d1565b8281036020840152620039148187620033d1565b6001600160a01b03958616604085015293909416606090920191909152509392505050565b818103818111156200277057620027706200387e565b601f8211156200399a57805f5260205f20601f840160051c81016020851015620039765750805b601f840160051c820191505b8181101562003997575f815560010162003982565b50505b505050565b815167ffffffffffffffff811115620039bc57620039bc620032ca565b620039d481620039cd845462003804565b846200394f565b602080601f83116001811462003a0a575f8415620039f25750858301515b5f19600386901b1c1916600185901b17855562003a64565b5f85815260208120601f198616915b8281101562003a3a5788860151825594840194600190910190840162003a19565b508582101562003a5857878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b5f6001820162003a805762003a806200387e565b5060010190565b5f835162003a9a818460208801620033ad565b83519083019062003ab0818360208801620033ad565b01949350505050565b8051620037e181620034cc565b8051600281900b8114620037e1575f80fd5b80516001600160801b0381168114620037e1575f80fd5b5f805f805f805f805f805f806101808d8f03121562003b0c575f80fd5b8c516001600160601b038116811462003b23575f80fd5b9b5062003b3360208e01620037d4565b9a5062003b4360408e01620037d4565b995062003b5360608e01620037d4565b985062003b6360808e0162003ab9565b975062003b7360a08e0162003ac6565b965062003b8360c08e0162003ac6565b955062003b9360e08e0162003ad8565b94506101008d015193506101208d0151925062003bb46101408e0162003ad8565b915062003bc56101608e0162003ad8565b90509295989b509295989b509295989b565b5f806040838503121562003be9575f80fd5b505080516020909101519092909150565b5f6020828403121562003c0b575f80fd5b81518015158114620034c5575f80fd5b634e487b7160e01b5f52603260045260245ffd5b5f8160020b8360020b8062003c485762003c48620038c2565b627fffff1982145f198214161562003c645762003c646200387e565b90059392505050565b5f8260020b8260020b028060020b915080821462003c8f5762003c8f6200387e565b5092915050565b81516001600160a01b031681526101608101602083015162003cc360208401826001600160a01b03169052565b50604083015162003cdb604084018262ffffff169052565b50606083015162003cf1606084018260020b9052565b50608083015162003d07608084018260020b9052565b5060a083015160a083015260c083015160c083015260e083015160e08301526101008084015181840152506101208084015162003d4e828501826001600160a01b03169052565b505061014092830151919092015290565b5f805f806080858703121562003d73575f80fd5b8451935062003d856020860162003ad8565b604086015160609096015194979096509250505056fe608060405234801562000010575f80fd5b50604051620011dd380380620011dd8339810160408190526200003391620004cd565b83836003620000438382620005e0565b506004620000528282620005e0565b5050505f62000066620000ee60201b60201c565b6200007390600a620007bb565b6200008390633b9aca00620007d2565b600580546001600160a01b038086166001600160a01b03199283161790925560068054928716929091169190911790554260075590506064620000c8600283620007d2565b620000d49190620007ec565b600855620000e38282620000f3565b505050505062000822565b601290565b6001600160a01b038216620001225760405163ec442f0560e01b81525f60048201526024015b60405180910390fd5b6200012f5f838362000133565b5050565b6001600160a01b03831615806200015157506001600160a01b038216155b806200016a57506006546001600160a01b038381169116145b806200018357506005546001600160a01b038381169116145b806200019c57506005546001600160a01b038481169116145b15620001b457620001af838383620002c1565b505050565b60075442908103620002095760405162461bcd60e51b815260206004820152601760248201527f4e6f2062757973206174206c61756e636820626c6f636b000000000000000000604482015260640162000119565b603c6007546200021a91906200080c565b811080156200025557506008548262000247856001600160a01b03165f9081526020819052604090205490565b6200025391906200080c565b115b15620002ae5760405162461bcd60e51b815260206004820152602160248201527f4d61782032252077616c6c6574206c696d697420647572696e67206c61756e636044820152600d60fb1b606482015260840162000119565b620002bb848484620002c1565b50505050565b6001600160a01b038316620002ef578060025f828254620002e391906200080c565b90915550620003619050565b6001600160a01b0383165f9081526020819052604090205481811015620003435760405163391434e360e21b81526001600160a01b0385166004820152602481018290526044810183905260640162000119565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b0382166200037f576002805482900390556200039d565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051620003e391815260200190565b60405180910390a3505050565b634e487b7160e01b5f52604160045260245ffd5b5f82601f83011262000414575f80fd5b81516001600160401b0380821115620004315762000431620003f0565b604051601f8301601f19908116603f011681019082821181831017156200045c576200045c620003f0565b816040528381526020925086602085880101111562000479575f80fd5b5f91505b838210156200049c57858201830151818301840152908201906200047d565b5f602085830101528094505050505092915050565b80516001600160a01b0381168114620004c8575f80fd5b919050565b5f805f8060808587031215620004e1575f80fd5b84516001600160401b0380821115620004f8575f80fd5b620005068883890162000404565b955060208701519150808211156200051c575f80fd5b506200052b8782880162000404565b9350506200053c60408601620004b1565b91506200054c60608601620004b1565b905092959194509250565b600181811c908216806200056c57607f821691505b6020821081036200058b57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f821115620001af57805f5260205f20601f840160051c81016020851015620005b85750805b601f840160051c820191505b81811015620005d9575f8155600101620005c4565b5050505050565b81516001600160401b03811115620005fc57620005fc620003f0565b62000614816200060d845462000557565b8462000591565b602080601f8311600181146200064a575f8415620006325750858301515b5f19600386901b1c1916600185901b178555620006a4565b5f85815260208120601f198616915b828110156200067a5788860151825594840194600190910190840162000659565b50858210156200069857878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b634e487b7160e01b5f52601160045260245ffd5b600181815b808511156200070057815f1904821115620006e457620006e4620006ac565b80851615620006f257918102915b93841c9390800290620006c5565b509250929050565b5f826200071857506001620007b5565b816200072657505f620007b5565b81600181146200073f57600281146200074a576200076a565b6001915050620007b5565b60ff8411156200075e576200075e620006ac565b50506001821b620007b5565b5060208310610133831016604e8410600b84101617156200078f575081810a620007b5565b6200079b8383620006c0565b805f1904821115620007b157620007b1620006ac565b0290505b92915050565b5f620007cb60ff84168362000708565b9392505050565b8082028115828204841417620007b557620007b5620006ac565b5f826200080757634e487b7160e01b5f52601260045260245ffd5b500490565b80820180821115620007b557620007b5620006ac565b6109ad80620008305f395ff3fe608060405234801561000f575f80fd5b50600436106100e5575f3560e01c806342966c681161008857806379cc67901161006357806379cc6790146101dd57806395d89b41146101f0578063a9059cbb146101f8578063dd62ed3e1461020b575f80fd5b806342966c681461018d5780634bde38c8146101a257806370a08231146101b5575f80fd5b806318160ddd116100c357806318160ddd1461015157806323b872dd146101635780632f4237c014610176578063313ce5671461017e575f80fd5b806302d05d3f146100e957806306fdde0314610119578063095ea7b31461012e575b5f80fd5b6006546100fc906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b610121610243565b60405161011091906107f0565b61014161013c366004610857565b6102d3565b6040519015158152602001610110565b6002545b604051908152602001610110565b61014161017136600461087f565b6102ec565b61014161030f565b60405160128152602001610110565b6101a061019b3660046108b8565b610326565b005b6005546100fc906001600160a01b031681565b6101556101c33660046108cf565b6001600160a01b03165f9081526020819052604090205490565b6101a06101eb366004610857565b610333565b61012161034c565b610141610206366004610857565b61035b565b6101556102193660046108ef565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b60606003805461025290610920565b80601f016020809104026020016040519081016040528092919081815260200182805461027e90610920565b80156102c95780601f106102a0576101008083540402835291602001916102c9565b820191905f5260205f20905b8154815290600101906020018083116102ac57829003601f168201915b5050505050905090565b5f336102e0818585610368565b60019150505b92915050565b5f336102f985828561037a565b6103048585856103fb565b506001949350505050565b5f603c60075461031f9190610958565b4210905090565b6103303382610458565b50565b61033e82338361037a565b6103488282610458565b5050565b60606004805461025290610920565b5f336102e08185856103fb565b610375838383600161048c565b505050565b6001600160a01b038381165f908152600160209081526040808320938616835292905220545f198110156103f557818110156103e757604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064015b60405180910390fd5b6103f584848484035f61048c565b50505050565b6001600160a01b03831661042457604051634b637e8f60e11b81525f60048201526024016103de565b6001600160a01b03821661044d5760405163ec442f0560e01b81525f60048201526024016103de565b61037583838361055e565b6001600160a01b03821661048157604051634b637e8f60e11b81525f60048201526024016103de565b610348825f8361055e565b6001600160a01b0384166104b55760405163e602df0560e01b81525f60048201526024016103de565b6001600160a01b0383166104de57604051634a1406b160e11b81525f60048201526024016103de565b6001600160a01b038085165f90815260016020908152604080832093871683529290522082905580156103f557826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161055091815260200190565b60405180910390a350505050565b6001600160a01b038316158061057b57506001600160a01b038216155b8061059357506006546001600160a01b038381169116145b806105ab57506005546001600160a01b038381169116145b806105c357506005546001600160a01b038481169116145b156105d3576103758383836106ca565b600754429081036106265760405162461bcd60e51b815260206004820152601760248201527f4e6f2062757973206174206c61756e636820626c6f636b00000000000000000060448201526064016103de565b603c6007546106359190610958565b8110801561066c575060085482610660856001600160a01b03165f9081526020819052604090205490565b61066a9190610958565b115b156106c35760405162461bcd60e51b815260206004820152602160248201527f4d61782032252077616c6c6574206c696d697420647572696e67206c61756e636044820152600d60fb1b60648201526084016103de565b6103f58484845b6001600160a01b0383166106f4578060025f8282546106e99190610958565b909155506107649050565b6001600160a01b0383165f90815260208190526040902054818110156107465760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016103de565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b0382166107805760028054829003905561079e565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516107e391815260200190565b60405180910390a3505050565b5f602080835283518060208501525f5b8181101561081c57858101830151858201604001528201610800565b505f604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610852575f80fd5b919050565b5f8060408385031215610868575f80fd5b6108718361083c565b946020939093013593505050565b5f805f60608486031215610891575f80fd5b61089a8461083c565b92506108a86020850161083c565b9150604084013590509250925092565b5f602082840312156108c8575f80fd5b5035919050565b5f602082840312156108df575f80fd5b6108e88261083c565b9392505050565b5f8060408385031215610900575f80fd5b6109098361083c565b91506109176020840161083c565b90509250929050565b600181811c9082168061093457607f821691505b60208210810361095257634e487b7160e01b5f52602260045260245ffd5b50919050565b808201808211156102e657634e487b7160e01b5f52601160045260245ffdfea264697066735822122069dc1eb441152a81907d2620f15ca4cb3e69b766dd97115bd700015d772cc62e64736f6c63430008180033a2646970667358221220ebf9915bf684dd20bd410476f791ab74d8290bf3ac17e426f91ba8758aba054064736f6c63430008180033

Verified Source Code Full Match

Compiler: v0.8.24+commit.e11b9ed9 EVM: shanghai Optimization: Yes (200 runs)
mainnet.sol 939 lines
// SPDX-License-Identifier: MIT

// https://twap.dev
// http://t.me/TWAPDeployerBot
// https://x.com/twapforeth
// https://t.me/TwapAlerts

pragma solidity ^0.8.20;

interface IToken {
    function creator() external view returns (address);
}

interface IWETH {
    function withdraw(uint256 amount) external;
}

interface IUniswapV3Factory {
    function getPool(
        address tokenA,
        address tokenB,
        uint24 fee
    ) external view returns (address);
}

interface ISwapRouter02 {
    struct ExactInputSingleParams {
        address tokenIn;
        address tokenOut;
        uint24 fee;
        address recipient;
        uint256 amountIn;
        uint256 amountOutMinimum;
        uint160 sqrtPriceLimitX96;
    }

    function exactInputSingle(
        ExactInputSingleParams calldata params
    ) external payable returns (uint256 amountOut);
}

interface INonfungiblePositionManager {
    struct MintParams {
        address token0;
        address token1;
        uint24 fee;
        int24 tickLower;
        int24 tickUpper;
        uint256 amount0Desired;
        uint256 amount1Desired;
        uint256 amount0Min;
        uint256 amount1Min;
        address recipient;
        uint256 deadline;
    }

    function factory() external view returns (address);

    function WETH9() external view returns (address);

    function positions(
        uint256 tokenId
    )
        external
        view
        returns (
            uint96 nonce,
            address operator,
            address token0,
            address token1,
            uint24 fee,
            int24 tickLower,
            int24 tickUpper,
            uint128 liquidity,
            uint256 feeGrowthInside0LastX128,
            uint256 feeGrowthInside1LastX128,
            uint128 tokensOwed0,
            uint128 tokensOwed1
        );

    function createAndInitializePoolIfNecessary(
        address token0,
        address token1,
        uint24 fee,
        uint160 sqrtPriceX96
    ) external returns (address pool);

    function mint(
        MintParams calldata params
    )
        external
        returns (
            uint256 tokenId,
            uint128 liquidity,
            uint256 amount0,
            uint256 amount1
        );

    struct CollectParams {
        uint256 tokenId;
        address recipient;
        uint128 amount0Max;
        uint128 amount1Max;
    }

    function collect(
        CollectParams calldata params
    ) external payable returns (uint256 amount0, uint256 amount1);

    function getApproved(uint256 tokenId) external view returns (address);

    function isApprovedForAll(
        address owner,
        address operator
    ) external view returns (bool);

    function ownerOf(uint256 tokenId) external view returns (address);
}

contract Factory {
    event ERC20TokenCreated(address tokenAddress);
    event DeploymentStatusChanged(bool enabled);

    struct TokenInfo {
        address tokenAddress;
        string name;
        string symbol;
        address deployer;
        uint256 time;
        string metadata;
        uint256 marketCapInETH;
        uint24 feeTier;
    }

    mapping(uint256 => TokenInfo) public deployedTokens;
    uint256 public tokenCount = 0;
    address public platformController;

    bool private _isDeploymentActive = false;

    address public constant POSITION_MANAGER = 0xC36442b4a4522E871399CD717aBDD847Ab11FE88;
    address public constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
    address public constant SWAP_ROUTER = 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45;

    uint24 public constant FEE_TIER_LOW = 500;
    uint24 public constant FEE_TIER_MEDIUM = 3000;
    uint24 public constant FEE_TIER_HIGH = 10000;

    uint256 private constant VIRTUAL_ETH = 1.5 ether;

    event TokenPurchased(
        address buyer,
        address tokenOut,
        uint256 ethSpent,
        uint256 tokensReceived
    );

    mapping(uint24 => int24) private tickSpacings;

    INonfungiblePositionManager private immutable positionManager;

    constructor() {
        platformController = msg.sender;
        
        positionManager = INonfungiblePositionManager(POSITION_MANAGER);
        
        IERC20(WETH).approve(POSITION_MANAGER, type(uint256).max);
        IERC20(WETH).approve(SWAP_ROUTER, type(uint256).max);

        tickSpacings[FEE_TIER_LOW] = 10;
        tickSpacings[FEE_TIER_MEDIUM] = 60;
        tickSpacings[FEE_TIER_HIGH] = 200;
    }

    receive() external payable {}

    function isDeploymentActive() external view returns (bool) {
        return _isDeploymentActive;
    }

    function deployToken(
        string memory _name,
        string memory _symbol,
        string memory _metadata,
        bytes32 salt,
        uint24 feeTier
    ) public payable {
        require(_isDeploymentActive, "Token deployment is currently disabled");
        require(bytes(_name).length > 0, "Token name cannot be empty");
        require(bytes(_symbol).length > 0, "Token symbol cannot be empty");
        require(
            feeTier == FEE_TIER_LOW ||
                feeTier == FEE_TIER_MEDIUM ||
                feeTier == FEE_TIER_HIGH,
            "Invalid fee tier. Must be 500, 3000, or 10000"
        );

        Token t = new Token{salt: salt}(
            _name,
            _symbol,
            msg.sender,
            address(this)
        );
        emit ERC20TokenCreated(address(t));

        address token_address = address(t);
        provideLiquidity(token_address, WETH, feeTier);

        if (msg.value > 0) {
            uint256 taxBps = getPenalty(msg.value);
            uint256 tax = (msg.value * taxBps) / 10000;
            uint256 amountAfterTax = msg.value - tax;

            ISwapRouter02(SWAP_ROUTER).exactInputSingle{value: amountAfterTax}(
                ISwapRouter02.ExactInputSingleParams({
                    tokenIn: WETH,
                    tokenOut: token_address,
                    fee: feeTier,
                    recipient: msg.sender,
                    amountIn: amountAfterTax,
                    amountOutMinimum: 0,
                    sqrtPriceLimitX96: 0
                })
            );
        }

        deployedTokens[tokenCount] = TokenInfo({
            tokenAddress: token_address,
            name: _name,
            symbol: _symbol,
            deployer: msg.sender,
            time: block.timestamp,
            metadata: _metadata,
            marketCapInETH: 0,
            feeTier: feeTier
        });
        tokenCount++;
    }

    function getTokenBytecode(
        string memory _name,
        string memory _symbol,
        address creator
    ) public view returns (bytes memory bytecode) {
        bytecode = abi.encodePacked(
            type(Token).creationCode,
            abi.encode(_name, _symbol, creator, address(this))
        );
    }

    function getPenalty(uint256 ethAmount) public pure returns (uint256) {
        if (ethAmount < 0.08 ether) return 0;
        if (ethAmount >= 0.5 ether) return 2000;

        uint256 delta = ethAmount - 0.08 ether;
        uint256 deltaSquared = (delta * delta) / 1 ether;
        uint256 penalty = (deltaSquared * 11338) / 1 ether;

        return penalty;
    }

    function getTokensByPage(
        uint256 page,
        uint256 order
    ) public view returns (TokenInfo[] memory) {
        uint256 itemsPerPage = 80;
        require(tokenCount > 0, "No tokens deployed");

        uint256 totalPages = (tokenCount + itemsPerPage - 1) / itemsPerPage;
        require(page < totalPages, "Page out of range");

        uint256 start;
        uint256 end;
        uint256 j = 0;

        if (order == 0) {
            start = tokenCount > (page + 1) * itemsPerPage
                ? tokenCount - (page + 1) * itemsPerPage
                : 0;
            end = tokenCount - page * itemsPerPage;
            if (end > tokenCount) end = tokenCount;
        } else {
            start = page * itemsPerPage;
            end = start + itemsPerPage;
            if (end > tokenCount) end = tokenCount;
        }

        TokenInfo[] memory tokens = new TokenInfo[](end - start);
        address weth = positionManager.WETH9();
        address factory = positionManager.factory();

        for (uint256 i = start; i < end; i++) {
            uint256 index = order == 0 ? end - 1 - (i - start) : i;
            TokenInfo memory info = deployedTokens[index];

            uint256 marketCap = 0;
            address pool = IUniswapV3Factory(factory).getPool(
                info.tokenAddress,
                weth,
                info.feeTier
            );
            if (pool != address(0)) {
                uint256 wethInPool = IERC20(weth).balanceOf(pool);
                uint256 tokenInPool = IERC20(info.tokenAddress).balanceOf(pool);
                uint256 totalSupply = IERC20(info.tokenAddress).totalSupply();

                if (tokenInPool > 0) {
                    marketCap =
                        ((wethInPool + VIRTUAL_ETH) * totalSupply) /
                        tokenInPool;
                }
            }

            tokens[j++] = TokenInfo({
                tokenAddress: info.tokenAddress,
                name: info.name,
                symbol: info.symbol,
                deployer: info.deployer,
                time: info.time,
                metadata: info.metadata,
                marketCapInETH: marketCap,
                feeTier: info.feeTier
            });
        }

        return tokens;
    }

    function getTokens(uint256 page) public view returns (TokenInfo[] memory) {
        require(tokenCount > 0, "No tokens deployed");

        uint256 itemsPerPage = 2000;
        uint256 totalPages = (tokenCount + itemsPerPage - 1) / itemsPerPage;
        require(page < totalPages, "Page out of range");

        uint256 start = tokenCount > (page + 1) * itemsPerPage
            ? tokenCount - (page + 1) * itemsPerPage
            : 0;
        uint256 end = tokenCount - page * itemsPerPage;
        if (end > tokenCount) end = tokenCount;

        TokenInfo[] memory tokens = new TokenInfo[](end - start);

        for (uint256 i = start; i < end; i++) {
            uint256 index = end - 1 - (i - start);
            TokenInfo memory info = deployedTokens[index];

            tokens[i - start] = TokenInfo({
                tokenAddress: info.tokenAddress,
                name: info.name,
                symbol: info.symbol,
                deployer: info.deployer,
                time: info.time,
                metadata: info.metadata,
                marketCapInETH: 0,
                feeTier: info.feeTier
            });
        }

        return tokens;
    }

    function getTokenByAddress(
        address tokenAddress
    ) public view returns (TokenInfo memory) {
        require(tokenAddress != address(0), "Invalid token address");
        require(tokenCount > 0, "No tokens deployed");

        address weth = positionManager.WETH9();
        address factory = positionManager.factory();

        for (uint256 i = 0; i < tokenCount; i++) {
            TokenInfo memory info = deployedTokens[i];
            if (info.tokenAddress == tokenAddress) {
                uint256 marketCap = 0;
                address pool = IUniswapV3Factory(factory).getPool(
                    info.tokenAddress,
                    weth,
                    info.feeTier
                );
                if (pool != address(0)) {
                    uint256 wethInPool = IERC20(weth).balanceOf(pool);
                    uint256 tokenInPool = IERC20(info.tokenAddress).balanceOf(
                        pool
                    );
                    uint256 totalSupply = IERC20(info.tokenAddress)
                        .totalSupply();

                    if (tokenInPool > 0) {
                        marketCap =
                            ((wethInPool + VIRTUAL_ETH) * totalSupply) /
                            tokenInPool;
                    }
                }

                return
                    TokenInfo({
                        tokenAddress: info.tokenAddress,
                        name: info.name,
                        symbol: info.symbol,
                        deployer: info.deployer,
                        time: info.time,
                        metadata: info.metadata,
                        marketCapInETH: marketCap,
                        feeTier: info.feeTier
                    });
            }
        }

        revert("Token not found");
    }

    function getTokenByMetadata(
        string memory metadata
    ) public view returns (TokenInfo memory) {
        require(bytes(metadata).length > 0, "Invalid metadata");
        require(tokenCount > 0, "No tokens deployed");

        address weth = positionManager.WETH9();
        address factory = positionManager.factory();

        for (uint256 i = 0; i < tokenCount; i++) {
            TokenInfo memory info = deployedTokens[i];
            if (keccak256(bytes(info.metadata)) == keccak256(bytes(metadata))) {
                uint256 marketCap = 0;
                address pool = IUniswapV3Factory(factory).getPool(
                    info.tokenAddress,
                    weth,
                    info.feeTier
                );
                if (pool != address(0)) {
                    uint256 wethInPool = IERC20(weth).balanceOf(pool);
                    uint256 tokenInPool = IERC20(info.tokenAddress).balanceOf(
                        pool
                    );
                    uint256 totalSupply = IERC20(info.tokenAddress)
                        .totalSupply();

                    if (tokenInPool > 0) {
                        marketCap =
                            ((wethInPool + VIRTUAL_ETH) * totalSupply) /
                            tokenInPool;
                    }
                }

                return
                    TokenInfo({
                        tokenAddress: info.tokenAddress,
                        name: info.name,
                        symbol: info.symbol,
                        deployer: info.deployer,
                        time: info.time,
                        metadata: info.metadata,
                        marketCapInETH: marketCap,
                        feeTier: info.feeTier
                    });
            }
        }

        revert("Token not found");
    }

    function rescueWETH() external {
        require(msg.sender == platformController, "Caller is not controller");
        uint256 wethBalance = IERC20(WETH).balanceOf(address(this));
        require(wethBalance > 0, "No WETH to withdraw");

        IWETH(WETH).withdraw(wethBalance);

        (bool success, ) = msg.sender.call{value: wethBalance}("");
        require(success, "ETH transfer failed");
    }

    function rescueETH() external {
        require(msg.sender == platformController, "Caller is not controller");

        uint256 ethBalance = address(this).balance;
        require(ethBalance > 0, "No ETH to withdraw");

        (bool success, ) = msg.sender.call{value: ethBalance}("");
        require(success, "ETH transfer failed");
    }

    function toggleDeployToken() external {
        require(msg.sender == platformController, "Caller is not controller");
        _isDeploymentActive = !_isDeploymentActive;
        emit DeploymentStatusChanged(_isDeploymentActive);
    }

    function getTickSpacing(uint24 feeTier) internal view returns (int24) {
        return tickSpacings[feeTier];
    }

    function provideLiquidity(
        address tokenA,
        address tokenB,
        uint24 feeTier
    ) internal {
        bool tokenAIsToken0 = tokenA < tokenB;
        address token0 = tokenAIsToken0 ? tokenA : tokenB;
        address token1 = tokenAIsToken0 ? tokenB : tokenA;

        if (token0 == WETH) {
            IERC20(token1).approve(POSITION_MANAGER, type(uint256).max);
        } else {
            IERC20(token0).approve(POSITION_MANAGER, type(uint256).max);
        }

        uint160 sqrtPriceX96 = tokenAIsToken0
            ? 3068365595550320841079178
            : 2045645379722529521098596513701367;

        int24 tickSpacing = getTickSpacing(feeTier);

        int24 tickLower;
        int24 tickUpper;

        if (tokenAIsToken0) {
            tickLower = -203000;
            tickUpper = 887200;
        } else {
            tickLower = -887200;
            tickUpper = 203000;
        }

        tickLower = (tickLower / tickSpacing) * tickSpacing;
        tickUpper = (tickUpper / tickSpacing) * tickSpacing;

        uint256 amount0Desired = tokenAIsToken0
            ? 1000000000000000000000000000
            : 0;
        uint256 amount1Desired = tokenAIsToken0
            ? 0
            : 1000000000000000000000000000;

        positionManager.createAndInitializePoolIfNecessary(
            token0,
            token1,
            feeTier,
            sqrtPriceX96
        );

        positionManager.mint(
            INonfungiblePositionManager.MintParams({
                token0: token0,
                token1: token1,
                fee: feeTier,
                tickLower: tickLower,
                tickUpper: tickUpper,
                amount0Desired: amount0Desired,
                amount1Desired: amount1Desired,
                amount0Min: 0,
                amount1Min: 0,
                recipient: address(this),
                deadline: block.timestamp
            })
        );
    }

    function collectFees(
        uint256 tokenId
    ) external returns (uint256 amount0, uint256 amount1) {
        (
            ,
            ,
            address token0Raw,
            address token1Raw,
            ,
            ,
            ,
            ,
            ,
            ,
            ,
        ) = positionManager.positions(tokenId);

        require(
            token0Raw != address(0) && token1Raw != address(0),
            "Invalid tokenId: position does not exist"
        );

        address createdToken;
        address wethToken;

        if (token0Raw == WETH) {
            createdToken = token1Raw;
            wethToken = token0Raw;
        } else if (token1Raw == WETH) {
            createdToken = token0Raw;
            wethToken = token1Raw;
        } else {
            revert("Neither token is WETH");
        }

        address creator = IToken(createdToken).creator();
        require(
            msg.sender == creator || msg.sender == platformController,
            "Not authorized"
        );

        uint256 beforeCreatedToken = IERC20(createdToken).balanceOf(
            address(this)
        );
        uint256 beforeWETH = IERC20(wethToken).balanceOf(address(this));

        INonfungiblePositionManager.CollectParams
            memory params = INonfungiblePositionManager.CollectParams({
                tokenId: tokenId,
                recipient: address(this),
                amount0Max: type(uint128).max,
                amount1Max: type(uint128).max
            });

        positionManager.collect(params);

        uint256 collectedCreatedToken = IERC20(createdToken).balanceOf(
            address(this)
        ) - beforeCreatedToken;
        uint256 collectedWETH = IERC20(wethToken).balanceOf(address(this)) -
            beforeWETH;

        if (collectedCreatedToken > 0) {
            IERC20(createdToken).transfer(
                address(0x000000000000000000000000000000000000dEaD),
                collectedCreatedToken
            );
        }

        if (collectedWETH > 0) {
            uint256 half = collectedWETH / 2;

            IWETH(wethToken).withdraw(half);

            (bool success, ) = payable(creator).call{value: half}("");
            require(success, "ETH transfer to creator failed");
        }

        if (token0Raw == WETH) {
            return (collectedWETH, collectedCreatedToken);
        } else {
            return (collectedCreatedToken, collectedWETH);
        }
    }
}

interface IERC20Errors {
    error ERC20InsufficientBalance(
        address sender,
        uint256 balance,
        uint256 needed
    );
    error ERC20InvalidSender(address sender);
    error ERC20InvalidReceiver(address receiver);
    error ERC20InsufficientAllowance(
        address spender,
        uint256 allowance,
        uint256 needed
    );
    error ERC20InvalidApprover(address approver);
    error ERC20InvalidSpender(address spender);
}

interface IERC20 {
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(
        address indexed owner,
        address indexed spender,
        uint256 value
    );

    function totalSupply() external view returns (uint256);

    function balanceOf(address account) external view returns (uint256);

    function transfer(address to, uint256 value) external returns (bool);

    function allowance(
        address owner,
        address spender
    ) external view returns (uint256);

    function approve(address spender, uint256 value) external returns (bool);

    function transferFrom(
        address from,
        address to,
        uint256 value
    ) external returns (bool);
}

interface IERC20Metadata is IERC20 {
    function name() external view returns (string memory);

    function symbol() external view returns (string memory);

    function decimals() external view returns (uint8);
}

abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
    mapping(address => uint256) private _balances;
    mapping(address => mapping(address => uint256)) private _allowances;
    uint256 private _totalSupply;
    string private _name;
    string private _symbol;

    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    function name() public view virtual returns (string memory) {
        return _name;
    }

    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    function decimals() public view virtual returns (uint8) {
        return 18;
    }

    function totalSupply() public view virtual returns (uint256) {
        return _totalSupply;
    }

    function balanceOf(address account) public view virtual returns (uint256) {
        return _balances[account];
    }

    function transfer(address to, uint256 value) public virtual returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, value);
        return true;
    }

    function allowance(
        address owner,
        address spender
    ) public view virtual returns (uint256) {
        return _allowances[owner][spender];
    }

    function approve(
        address spender,
        uint256 value
    ) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, value);
        return true;
    }

    function transferFrom(
        address from,
        address to,
        uint256 value
    ) public virtual returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, value);
        _transfer(from, to, value);
        return true;
    }

    function _transfer(address from, address to, uint256 value) internal {
        if (from == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        if (to == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(from, to, value);
    }

    function _update(address from, address to, uint256 value) internal virtual {
        if (from == address(0)) {
            _totalSupply += value;
        } else {
            uint256 fromBalance = _balances[from];
            if (fromBalance < value) {
                revert ERC20InsufficientBalance(from, fromBalance, value);
            }
            unchecked {
                _balances[from] = fromBalance - value;
            }
        }

        if (to == address(0)) {
            unchecked {
                _totalSupply -= value;
            }
        } else {
            unchecked {
                _balances[to] += value;
            }
        }

        emit Transfer(from, to, value);
    }

    function _mint(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(address(0), account, value);
    }

    function _burn(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        _update(account, address(0), value);
    }

    function _approve(address owner, address spender, uint256 value) internal {
        _approve(owner, spender, value, true);
    }

    function _approve(
        address owner,
        address spender,
        uint256 value,
        bool emitEvent
    ) internal virtual {
        if (owner == address(0)) {
            revert ERC20InvalidApprover(address(0));
        }
        if (spender == address(0)) {
            revert ERC20InvalidSpender(address(0));
        }
        _allowances[owner][spender] = value;
        if (emitEvent) {
            emit Approval(owner, spender, value);
        }
    }

    function _spendAllowance(
        address owner,
        address spender,
        uint256 value
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance < type(uint256).max) {
            if (currentAllowance < value) {
                revert ERC20InsufficientAllowance(
                    spender,
                    currentAllowance,
                    value
                );
            }
            unchecked {
                _approve(owner, spender, currentAllowance - value, false);
            }
        }
    }
}

abstract contract ERC20Burnable is Context, ERC20 {
    function burn(uint256 value) public virtual {
        _burn(_msgSender(), value);
    }

    function burnFrom(address account, uint256 value) public virtual {
        _spendAllowance(account, _msgSender(), value);
        _burn(account, value);
    }
}

contract Token is ERC20, ERC20Burnable {
    address public platform;
    address public creator;
    uint256 private launchTime;
    uint256 private maxTxAmount;
    uint256 private constant INITIAL_TIMELOCK = 60;
    uint256 private constant WALLET_CAP_PERCENT = 2;

    constructor(
        string memory _name,
        string memory _symbol,
        address _creator,
        address _platform
    ) ERC20(_name, _symbol) {
        uint256 totalTokens = 1000000000 * 10 ** decimals();

        platform = _platform;
        creator = _creator;
        launchTime = block.timestamp;
        maxTxAmount = (totalTokens * WALLET_CAP_PERCENT) / 100;

        _mint(_platform, totalTokens);
    }

    function _update(
        address from,
        address to,
        uint256 value
    ) internal override {
        if (
            from == address(0) ||
            to == address(0) ||
            to == creator ||
            to == platform ||
            from == platform
        ) {
            super._update(from, to, value);
            return;
        }

        uint256 currentTime = block.timestamp;

        if (currentTime == launchTime) revert("No buys at launch block");

        if (
            currentTime < launchTime + INITIAL_TIMELOCK &&
            balanceOf(to) + value > maxTxAmount
        ) {
            revert("Max 2% wallet limit during launch");
        }

        super._update(from, to, value);
    }

    function isLaunchPeriodActive() public view returns (bool) {
        return block.timestamp < launchTime + INITIAL_TIMELOCK;
    }
}

Read Contract

FEE_TIER_HIGH 0x7574d9a0 → uint24
FEE_TIER_LOW 0xf6b9ec7c → uint24
FEE_TIER_MEDIUM 0x8f40e8f5 → uint24
POSITION_MANAGER 0x1bea83fe → address
SWAP_ROUTER 0xc6005893 → address
WETH 0xad5c4648 → address
deployedTokens 0xec81aadb → address, string, string, address, uint256, string, uint256, uint24
getPenalty 0x96e59682 → uint256
getTokenByAddress 0x91ded8fa → tuple
getTokenByMetadata 0x592fe429 → tuple
getTokenBytecode 0x8d99aeb0 → bytes
getTokens 0xd3c9cc26 → tuple[]
getTokensByPage 0xd1da9621 → tuple[]
isDeploymentActive 0x3cfb6936 → bool
platformController 0x3bcc75f6 → address
tokenCount 0x9f181b5e → uint256

Write Contract 5 functions

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

collectFees 0xb17acdcd
uint256 tokenId
returns: uint256, uint256
deployToken 0x76649d66
string _name
string _symbol
string _metadata
bytes32 salt
uint24 feeTier
rescueETH 0x20800a00
No parameters
rescueWETH 0xc38ec0b6
No parameters
toggleDeployToken 0xca6eccc3
No parameters

Recent Transactions

No transactions found for this address