Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0xCd8eAbAc84eD4Bf824a414A04CC6bE7E3B0D140D
Balance 0 ETH
Nonce 1
Code Size 12528 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

12528 bytes
0x608060405234801561000f575f80fd5b506004361061037d575f3560e01c8063715018a6116101d4578063a9059cbb11610109578063dd62ed3e116100a9578063e90f7aa411610079578063e90f7aa414610821578063ed314a0214610834578063f0bbcec414610847578063f2fde38b14610869575f80fd5b8063dd62ed3e146107ba578063e30c3978146107f2578063e456af1614610805578063e80a8d2114610819575f80fd5b8063c8fbcf26116100e4578063c8fbcf2614610762578063cd2c664b14610792578063cee8e0fe146107a5578063d0aa96c0146107b2575f80fd5b8063a9059cbb14610729578063c149ec171461073c578063c1efcca41461074f575f80fd5b80638ecad7211161017457806395d89b411161014f57806395d89b41146106d65780639f2d8b80146106fa578063a377175014610703578063a457c2d714610716575f80fd5b80638ecad7211461068557806391b98e0e1461069857806395bae2fe146106ab575f80fd5b806379cc6790116101af57806379cc67901461064357806381c1ead7146106565780638456cb591461066a5780638da5cb5b14610672575f80fd5b8063715018a61461062a57806371f110ff1461063257806379ba50971461063b575f80fd5b80633d4b8f90116102b55780634e151e14116102555780635c975abb116102255780635c975abb146105c8578063637e8ab4146105dc5780636bb2060e146105ef57806370a0823114610602575f80fd5b80634e151e1414610592578063539a1c421461059a5780635923f705146105ad5780635a2b2fcb146105c0575f80fd5b806342966c681161029057806342966c681461050b57806342b181111461051e5780634623c81e146105265780634dda551814610530575f80fd5b80633d4b8f90146104dd5780633f4ba83a146104f057806340c10f19146104f8575f80fd5b806324e0eba9116103205780632fb63ff9116102fb5780632fb63ff9146104a0578063313ce567146104a857806332e822e4146104b757806339509351146104ca575f80fd5b806324e0eba91461044d5780632861ff2d146104555780632ec7cff91461045d575f80fd5b806318160ddd1161035b57806318160ddd146103f357806323452b9c1461040557806323b872dd1461040f578063244bb30914610422575f80fd5b806306fdde0314610381578063095ea7b3146103bd57806316279055146103e0575b5f80fd5b60408051808201909152600e81526d21a6aa2222902b19902a37b5b2b760911b60208201525b6040516103b49190612b74565b60405180910390f35b6103d06103cb366004612bd6565b61087c565b60405190151581526020016103b4565b6103d06103ee366004612c00565b6108c6565b6003545b6040519081526020016103b4565b61040d6108d1565b005b6103d061041d366004612c22565b61090d565b600954610435906001600160a01b031681565b6040516001600160a01b0390911681526020016103b4565b61040d6109d7565b61040d610a37565b61047061046b366004612c60565b610b04565b604080516001600160a01b03909516855260208501939093529015159183019190915260608201526080016103b4565b61040d610b57565b604051601281526020016103b4565b61040d6104c5366004612c84565b610d6a565b6103d06104d8366004612bd6565b610e1a565b61040d6104eb366004612c00565b610e7b565b61040d611024565b61040d610506366004612bd6565b611085565b61040d610519366004612c60565b611358565b61040d611447565b6103f76201518081565b61056b61053e366004612c60565b600c6020525f90815260409020805460018201546002909201546001600160a01b03909116919060ff1683565b604080516001600160a01b03909416845260208401929092521515908201526060016103b4565b6004546103f7565b61040d6105a8366004612c60565b61162c565b6103f76b204fce5e3e2502611000000081565b6103f7606481565b6009546103d090600160a01b900460ff1681565b600754610435906001600160a01b031681565b61040d6105fd366004612cbb565b61165b565b6103f7610610366004612c00565b6001600160a01b03165f9081526020819052604090205490565b61040d61177c565b6103f7600a5481565b61040d6117fe565b61040d610651366004612bd6565b6118a8565b6103f75f8051602061301b83398151915281565b61040d611a30565b600554610435906001600160a01b031681565b6103f76b033b2e3c9fd0803ce800000081565b61040d6106a6366004612bd6565b611a97565b6103d06106b9366004612c00565b6001600160a01b03165f9081526002602052604090205460ff1690565b604080518082019091526008815267434d5444455f563360c01b60208201526103a7565b6103f7600b5481565b61040d610711366004612c00565b611c35565b6103d0610724366004612bd6565b611dd2565b6103d0610737366004612bd6565b611e81565b61040d61074a366004612c00565b611eb8565b61040d61075d366004612c00565b611fd0565b61076a6120ea565b604080519586526020860194909452928401919091526060830152608082015260a0016103b4565b600854610435906001600160a01b031681565b600d546103d09060ff1681565b61040d61217b565b6103f76107c8366004612d2a565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b600654610435906001600160a01b031681565b6103f75f8051602061305b83398151915281565b61040d6121de565b61040d61082f366004612c00565b6122a1565b61040d610842366004612cbb565b612390565b6103d0610855366004612c00565b60026020525f908152604090205460ff1681565b61040d610877366004612c00565b6124e1565b6009545f90600160a01b900460ff16156108b15760405162461bcd60e51b81526004016108a890612d56565b60405180910390fd5b6108bc338484612584565b5060015b92915050565b5f6064823b116108c0565b6005546001600160a01b031633146108fb5760405162461bcd60e51b81526004016108a890612d76565b600680546001600160a01b0319169055565b6009545f90600160a01b900460ff16156109395760405162461bcd60e51b81526004016108a890612d56565b6001600160a01b0384165f908152600160209081526040808320338452909152902054828110156109a55760405162461bcd60e51b8152602060048201526016602482015275496e73756666696369656e7420616c6c6f77616e636560501b60448201526064016108a8565b6109b0858585612618565b5f1981146109cc576109cc85336109c78685612dad565b612584565b506001949350505050565b6005546001600160a01b03163314610a015760405162461bcd60e51b81526004016108a890612d76565b600d805460ff1916905560405133907f7bf03a6497a8ebfdf9546499c29668ffe2ffa0890b1c4af959c2c6c1c98be3d4905f90a2565b6005546001600160a01b03163314610a615760405162461bcd60e51b81526004016108a890612d76565b5f8051602061301b8339815191525f908152600c6020525f8051602061307b83398151915280546001600160a01b03191690557fa02157a634693572da24407cb9a3b013ba2935f4d516a6da648218597862d445555f80516020612ffb833981519152805460ff191690556040517f398f5cf8f855122db89da49d854fc11a87bcd3c9925838154284d7195e724e8590610afa90612dc0565b60405180910390a1565b5f818152600c602052604081208054600182015460028301546001600160a01b0390921693909260ff90921691828015610b3d57508342105b15610b4f57610b4c4285612dad565b91505b509193509193565b6005546001600160a01b03163314610b815760405162461bcd60e51b81526004016108a890612d76565b5f8051602061301b8339815191525f52600c6020525f80516020612ffb833981519152545f8051602061307b8339815191529060ff16610bf75760405162461bcd60e51b81526020600482015260116024820152704e6f2070656e64696e67206368616e676560781b60448201526064016108a8565b8060010154421015610c425760405162461bcd60e51b8152602060048201526014602482015273151a5b595b1bd8dac81b9bdd08195e1c1a5c995960621b60448201526064016108a8565b6007805482546001600160a01b03198083166001600160a01b03928316179093555f8051602061301b8339815191525f908152600c6020525f8051602061307b83398151915280549094169093557fa02157a634693572da24407cb9a3b013ba2935f4d516a6da648218597862d445929092555f80516020612ffb833981519152805460ff191690558254604051918316927fc6ac4afdb7901d4d9d0ef52304fd640dc1526268268bc35718e7134d21ab816092610d039290911690612dec565b60405180910390a16007546040516c54726164696e674d6f64756c6560981b81526001600160a01b0391821691831690600d015b604051908190038120907fe5340bb646fa554a3082f7baa2b415eb1874ff7d4c3f118686180386e71f738e905f90a45050565b6005546001600160a01b03163314610d945760405162461bcd60e51b81526004016108a890612d76565b816001600160a01b038116610dbb5760405162461bcd60e51b81526004016108a890612e32565b6001600160a01b0383165f81815260026020908152604091829020805460ff191686151590811790915591519182527fa1d7b5c592bd084c13e11644e05a9f756554f46458f70dccd62416adcd21ef0c910160405180910390a2505050565b6009545f90600160a01b900460ff1615610e465760405162461bcd60e51b81526004016108a890612d56565b335f8181526001602090815260408083206001600160a01b03881684529091529020546108bc919085906109c7908690612e58565b6005546001600160a01b03163314610ea55760405162461bcd60e51b81526004016108a890612d76565b806001600160a01b038116610ecc5760405162461bcd60e51b81526004016108a890612e32565b610ed582612b0e565b610f215760405162461bcd60e51b815260206004820152601f60248201527f496e76616c69642054726164696e674d6f64756c6520696e746572666163650060448201526064016108a8565b6040518060600160405280836001600160a01b031681526020016201518042610f4a9190612e58565b815260016020918201525f8051602061301b8339815191525f52600c815281515f8051602061307b83398151915280546001600160a01b0319166001600160a01b039092169190911790558101517fa02157a634693572da24407cb9a3b013ba2935f4d516a6da648218597862d44555604001515f80516020612ffb833981519152805460ff19169115159190911790557fbbd9cfe0848dd91d3f1036e490a5430a815ba3d6506f151caabfbae485837cf78261100a6201518042612e58565b604051611018929190612e6b565b60405180910390a15050565b6005546001600160a01b0316331461104e5760405162461bcd60e51b81526004016108a890612d76565b6009805460ff60a01b191690556040517fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d16933905f90a1565b6005546001600160a01b03163314806110a857506007546001600160a01b031633145b806110bd57506008546001600160a01b031633145b806110d257506009546001600160a01b031633145b61110f5760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b60448201526064016108a8565b816001600160a01b0381166111365760405162461bcd60e51b81526004016108a890612e32565b600954600160a01b900460ff16156111605760405162461bcd60e51b81526004016108a890612d56565b5f82116111af5760405162461bcd60e51b815260206004820152601760248201527f416d6f756e74206d75737420626520706f73697469766500000000000000000060448201526064016108a8565b6b033b2e3c9fd0803ce800000082111561120b5760405162461bcd60e51b815260206004820152601760248201527f45786365656473206d6178206d696e742070657220747800000000000000000060448201526064016108a8565b62015180600b544261121d9190612dad565b1061122b575f600a5542600b555b6b204fce5e3e2502611000000082600a546112469190612e58565b111561128d5760405162461bcd60e51b8152602060048201526016602482015275045786365656473206461696c79206d696e74206361760541b60448201526064016108a8565b81600a5f82825461129e9190612e58565b90915550506001600160a01b0383165f90815260208190526040812080548492906112ca908490612e58565b925050819055508160035f8282546112e29190612e58565b90915550506040518281526001600160a01b038416907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859060200160405180910390a26040518281526001600160a01b038416905f905f8051602061303b833981519152906020015b60405180910390a3505050565b600954600160a01b900460ff16156113825760405162461bcd60e51b81526004016108a890612d56565b335f908152602081905260409020548111156113b05760405162461bcd60e51b81526004016108a890612eb0565b335f90815260208190526040812080548392906113ce908490612dad565b925050819055508060035f8282546113e69190612dad565b909155505060405181815233907fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59060200160405180910390a26040518181525f9033905f8051602061303b8339815191529060200160405180910390a350565b6005546001600160a01b031633146114715760405162461bcd60e51b81526004016108a890612d76565b5f8051602061305b8339815191525f52600c6020525f8051602061309b833981519152545f80516020612fdb8339815191529060ff166114e75760405162461bcd60e51b81526020600482015260116024820152704e6f2070656e64696e67206368616e676560781b60448201526064016108a8565b80600101544210156115325760405162461bcd60e51b8152602060048201526014602482015273151a5b595b1bd8dac81b9bdd08195e1c1a5c995960621b60448201526064016108a8565b6009805482546001600160a01b03198083166001600160a01b03928316179093555f8051602061305b8339815191525f908152600c6020525f80516020612fdb83398151915280549094169093557f6757e54d83a358bd4ad7f4de36635fb12d3b05c6324d927402a1b22769f8adbf929092555f8051602061309b833981519152805460ff191690558254604051918316927fc6ac4afdb7901d4d9d0ef52304fd640dc1526268268bc35718e7134d21ab8160926115f39290911690612ede565b60405180910390a16009546040516d436f6e666967526567697374727960901b81526001600160a01b0391821691831690600e01610d37565b6005546001600160a01b031633146116565760405162461bcd60e51b81526004016108a890612d76565b600455565b6005546001600160a01b031633146116855760405162461bcd60e51b81526004016108a890612d76565b808015801590611696575060328111155b6116d95760405162461bcd60e51b8152602060048201526014602482015273092dcecc2d8d2c840c2e4e4c2f240d8cadccee8d60631b60448201526064016108a8565b5f5b8181101561173d575f60025f8686858181106116f9576116f9612f0b565b905060200201602081019061170e9190612c00565b6001600160a01b0316815260208101919091526040015f20805460ff19169115159190911790556001016116db565b50604080518281525f60208201527f6f2aa4d8fd452b3282a31deb6ebbd31e6082000532cc2d2fa2feae013ad28e6291015b60405180910390a1505050565b6005546001600160a01b031633146117a65760405162461bcd60e51b81526004016108a890612d76565b600580546001600160a01b0319808216909255600680549092169091556040516001600160a01b03909116905f9082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a350565b6006546001600160a01b0316331461184c5760405162461bcd60e51b81526020600482015260116024820152702737ba103832b73234b7339037bbb732b960791b60448201526064016108a8565b60058054600680546001600160a01b03198084166001600160a01b038381169182179096559116909155604051929091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a350565b600954600160a01b900460ff16156118d25760405162461bcd60e51b81526004016108a890612d56565b6001600160a01b0382165f9081526001602090815260408083203384529091529020548181101561193e5760405162461bcd60e51b81526020600482015260166024820152754275726e206578636565647320616c6c6f77616e636560501b60448201526064016108a8565b61194d83336109c78585612dad565b6001600160a01b0383165f908152602081905260409020548211156119845760405162461bcd60e51b81526004016108a890612eb0565b6001600160a01b0383165f90815260208190526040812080548492906119ab908490612dad565b925050819055508160035f8282546119c39190612dad565b90915550506040518281526001600160a01b038416907fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59060200160405180910390a26040518281525f906001600160a01b038516905f8051602061303b8339815191529060200161134b565b6005546001600160a01b03163314611a5a5760405162461bcd60e51b81526004016108a890612d76565b6009805460ff60a01b1916600160a01b1790556040517f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e752905f90a1565b6005546001600160a01b0316331480611aba57506007546001600160a01b031633145b80611acf57506008546001600160a01b031633145b80611ae457506009546001600160a01b031633145b611b215760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b60448201526064016108a8565b600954600160a01b900460ff1615611b4b5760405162461bcd60e51b81526004016108a890612d56565b6001600160a01b0382165f90815260208190526040902054811115611b825760405162461bcd60e51b81526004016108a890612eb0565b6001600160a01b0382165f9081526020819052604081208054839290611ba9908490612dad565b925050819055508060035f828254611bc19190612dad565b90915550506040518181526001600160a01b038316907fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59060200160405180910390a26040518181525f906001600160a01b038416905f8051602061303b8339815191529060200160405180910390a35050565b6005546001600160a01b03163314611c5f5760405162461bcd60e51b81526004016108a890612d76565b806001600160a01b038116611c865760405162461bcd60e51b81526004016108a890612e32565b611c8f82612b0e565b611cdb5760405162461bcd60e51b815260206004820181905260248201527f496e76616c696420436f6e666967526567697374727920696e7465726661636560448201526064016108a8565b6040518060600160405280836001600160a01b031681526020016201518042611d049190612e58565b815260016020918201525f8051602061305b8339815191525f52600c815281515f80516020612fdb83398151915280546001600160a01b0319166001600160a01b039092169190911790558101517f6757e54d83a358bd4ad7f4de36635fb12d3b05c6324d927402a1b22769f8adbf55604001515f8051602061309b833981519152805460ff19169115159190911790557fbbd9cfe0848dd91d3f1036e490a5430a815ba3d6506f151caabfbae485837cf782611dc46201518042612e58565b604051611018929190612f1f565b6009545f90600160a01b900460ff1615611dfe5760405162461bcd60e51b81526004016108a890612d56565b335f9081526001602090815260408083206001600160a01b038716845290915290205482811015611e685760405162461bcd60e51b8152602060048201526014602482015273416c6c6f77616e63652062656c6f77207a65726f60601b60448201526064016108a8565b611e7733856109c78685612dad565b5060019392505050565b6009545f90600160a01b900460ff1615611ead5760405162461bcd60e51b81526004016108a890612d56565b6108bc338484612618565b6005546001600160a01b03163314611ee25760405162461bcd60e51b81526004016108a890612d76565b806001600160a01b038116611f095760405162461bcd60e51b81526004016108a890612e32565b6007546001600160a01b031615611f6d5760405162461bcd60e51b815260206004820152602260248201527f55736520717565756554726164696e674d6f64756c6520666f72207570646174604482015261657360f01b60648201526084016108a8565b611f7682612b0e565b611f925760405162461bcd60e51b81526004016108a890612f4c565b600780546001600160a01b0319166001600160a01b0384169081179091556040516c54726164696e674d6f64756c6560981b81525f90600d01610d37565b6005546001600160a01b03163314611ffa5760405162461bcd60e51b81526004016108a890612d76565b806001600160a01b0381166120215760405162461bcd60e51b81526004016108a890612e32565b6009546001600160a01b0316156120865760405162461bcd60e51b815260206004820152602360248201527f557365207175657565436f6e666967526567697374727920666f72207570646160448201526274657360e81b60648201526084016108a8565b61208f82612b0e565b6120ab5760405162461bcd60e51b81526004016108a890612f4c565b600980546001600160a01b0319166001600160a01b0384169081179091556040516d436f6e666967526567697374727960901b81525f90600e01610d37565b600a54600b545f906b033b2e3c9fd0803ce8000000906b204fce5e3e25026110000000908390620151809061211f9042612dad565b1061213a57506b204fce5e3e2502611000000092505f612174565b600a54612153906b204fce5e3e25026110000000612dad565b935042600b54620151806121679190612e58565b6121719190612dad565b90505b9091929394565b6005546001600160a01b031633146121a55760405162461bcd60e51b81526004016108a890612d76565b600d805460ff1916600117905560405133907fea11799b3458309a243208b63c163a0f65a13938efbdfce0850bf916cdcbbdde905f90a2565b6005546001600160a01b031633146122085760405162461bcd60e51b81526004016108a890612d76565b5f8051602061305b8339815191525f908152600c6020525f80516020612fdb83398151915280546001600160a01b03191690557f6757e54d83a358bd4ad7f4de36635fb12d3b05c6324d927402a1b22769f8adbf555f8051602061309b833981519152805460ff191690556040517f398f5cf8f855122db89da49d854fc11a87bcd3c9925838154284d7195e724e8590610afa90612f77565b6005546001600160a01b031633146122cb5760405162461bcd60e51b81526004016108a890612d76565b806001600160a01b0381166122f25760405162461bcd60e51b81526004016108a890612e32565b6122fb82612b0e565b6123175760405162461bcd60e51b81526004016108a890612f4c565b600880546001600160a01b038481166001600160a01b03198316811790935560405191169190829061235c906c26a2ab283937ba32b1ba34b7b760991b8152600d0190565b604051908190038120907fe5340bb646fa554a3082f7baa2b415eb1874ff7d4c3f118686180386e71f738e905f90a4505050565b6005546001600160a01b031633146123ba5760405162461bcd60e51b81526004016108a890612d76565b8080158015906123cb575060328111155b61240e5760405162461bcd60e51b8152602060048201526014602482015273092dcecc2d8d2c840c2e4e4c2f240d8cadccee8d60631b60448201526064016108a8565b5f5b818110156124aa575f84848381811061242b5761242b612f0b565b90506020020160208101906124409190612c00565b6001600160a01b0316146124a257600160025f86868581811061246557612465612f0b565b905060200201602081019061247a9190612c00565b6001600160a01b0316815260208101919091526040015f20805460ff19169115159190911790555b600101612410565b5060408051828152600160208201527f6f2aa4d8fd452b3282a31deb6ebbd31e6082000532cc2d2fa2feae013ad28e62910161176f565b6005546001600160a01b0316331461250b5760405162461bcd60e51b81526004016108a890612d76565b806001600160a01b0381166125325760405162461bcd60e51b81526004016108a890612e32565b600680546001600160a01b0319166001600160a01b03848116918217909255600554604051919216907f8573d4aae9f7fb051c6b88d7440011a1c12376acda6603a45f45bad36a8db4ce905f90a35050565b6001600160a01b038316158015906125a457506001600160a01b03821615155b6125c05760405162461bcd60e51b81526004016108a890612e32565b6001600160a01b038381165f8181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910161134b565b816001600160a01b03811661263f5760405162461bcd60e51b81526004016108a890612e32565b6001600160a01b03841661268a5760405162461bcd60e51b81526020600482015260126024820152715472616e736665722066726f6d207a65726f60701b60448201526064016108a8565b6001600160a01b0384165f90815260208190526040902054828110156126e95760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b60448201526064016108a8565b600d5460ff16612a87576008546001600160a01b031615612a205760085460405163fe575a8760e01b81526001600160a01b03878116600483015290911690819063fe575a8790602401602060405180830381865afa15801561274e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127729190612fa4565b156127b45760405162461bcd60e51b815260206004820152601260248201527114d95b99195c88189b1858dadb1a5cdd195960721b60448201526064016108a8565b60405163fe575a8760e01b81526001600160a01b03868116600483015282169063fe575a8790602401602060405180830381865afa1580156127f8573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061281c9190612fa4565b156128615760405162461bcd60e51b8152602060048201526015602482015274149958da5c1a595b9d08189b1858dadb1a5cdd1959605a1b60448201526064016108a8565b6064853b11156129b557604051634cfbc2a560e11b81526001600160a01b0387811660048301525f91908316906399f7854a90602401602060405180830381865afa1580156128b2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906128d69190612fa4565b604051634add717f60e11b81526001600160a01b0388811660048301529192505f918416906395bae2fe90602401602060405180830381865afa15801561291f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906129439190612fa4565b9050818061295e57506005546001600160a01b038981169116145b806129665750805b6129b25760405162461bcd60e51b815260206004820181905260248201527f4f6e6c79206f776e65722f4c5073206f7220617070726f76656420706f6f6c7360448201526064016108a8565b50505b60405163cc1dd94f60e01b81526001600160a01b03878116600483015286811660248301526044820186905282169063cc1dd94f906064015f604051808303815f87803b158015612a04575f80fd5b505af1158015612a16573d5f803e3d5ffd5b5050505050612a87565b6064843b1115612a87576005546001600160a01b03868116911614612a875760405162461bcd60e51b815260206004820152601c60248201527f4f6e6c79206f776e65722063616e2073656e6420746f20706f6f6c730000000060448201526064016108a8565b612a918382612dad565b6001600160a01b038087165f908152602081905260408082209390935590861681529081208054859290612ac6908490612e58565b92505081905550836001600160a01b0316856001600160a01b03165f8051602061303b83398151915285604051612aff91815260200190565b60405180910390a35050505050565b5f816001600160a01b0316630c2b72e96040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612b69575060408051601f3d908101601f19168201909252612b6691810190612fbf565b60015b6108bc57505f919050565b5f6020808352835180828501525f5b81811015612b9f57858101830151858201604001528201612b83565b505f604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b0381168114612bd3575f80fd5b50565b5f8060408385031215612be7575f80fd5b8235612bf281612bbf565b946020939093013593505050565b5f60208284031215612c10575f80fd5b8135612c1b81612bbf565b9392505050565b5f805f60608486031215612c34575f80fd5b8335612c3f81612bbf565b92506020840135612c4f81612bbf565b929592945050506040919091013590565b5f60208284031215612c70575f80fd5b5035919050565b8015158114612bd3575f80fd5b5f8060408385031215612c95575f80fd5b8235612ca081612bbf565b91506020830135612cb081612c77565b809150509250929050565b5f8060208385031215612ccc575f80fd5b823567ffffffffffffffff80821115612ce3575f80fd5b818501915085601f830112612cf6575f80fd5b813581811115612d04575f80fd5b8660208260051b8501011115612d18575f80fd5b60209290920196919550909350505050565b5f8060408385031215612d3b575f80fd5b8235612d4681612bbf565b91506020830135612cb081612bbf565b60208082526006908201526514185d5cd95960d21b604082015260600190565b6020808252600990820152682737ba1037bbb732b960b91b604082015260600190565b634e487b7160e01b5f52601160045260245ffd5b818103818111156108c0576108c0612d99565b602081525f6108c060208301600d81526c54726164696e674d6f64756c6560981b602082015260400190565b604081525f612e1860408301600d81526c54726164696e674d6f64756c6560981b602082015260400190565b6001600160a01b0393909316602092909201919091525090565b6020808252600c908201526b5a65726f206164647265737360a01b604082015260600190565b808201808211156108c0576108c0612d99565b606081525f612e9760608301600d81526c54726164696e674d6f64756c6560981b602082015260400190565b6001600160a01b03949094166020830152506040015290565b6020808252601490820152734275726e20657863656564732062616c616e636560601b604082015260600190565b604081525f612e1860408301600e81526d436f6e666967526567697374727960901b602082015260400190565b634e487b7160e01b5f52603260045260245ffd5b606081525f612e9760608301600e81526d436f6e666967526567697374727960901b602082015260400190565b602080825260119082015270496e76616c696420696e7465726661636560781b604082015260600190565b602081525f6108c060208301600e81526d436f6e666967526567697374727960901b602082015260400190565b5f60208284031215612fb4575f80fd5b8151612c1b81612c77565b5f60208284031215612fcf575f80fd5b8151612c1b81612bbf56fe6757e54d83a358bd4ad7f4de36635fb12d3b05c6324d927402a1b22769f8adbea02157a634693572da24407cb9a3b013ba2935f4d516a6da648218597862d446f9f42f6731a06ee32f16ab97b00e0c92898f26c77a0788bb3e6ac0e7ac080a50ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef740690a02a46a00c73ac4d8d87220755b83e4ed66ff93d526adcd90d29e71dfba02157a634693572da24407cb9a3b013ba2935f4d516a6da648218597862d4446757e54d83a358bd4ad7f4de36635fb12d3b05c6324d927402a1b22769f8adc0a2646970667358221220332328a3a23b2eb8976fe61de9f3234ec9e3b5b7c0c2142719d1463e7ec0883464736f6c63430008150033

Verified Source Code Full Match

Compiler: v0.8.21+commit.d9974bed EVM: shanghai Optimization: Yes (200 runs)
2_CMTDE_V3.sol 632 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.21;

/**
 * ═══════════════════════════════════════════════════════════════════════════
 * CMTDE V3 - GOLD-BACKED TOKEN (IMMUTABLE CORE)
 * ═══════════════════════════════════════════════════════════════════════════
 * 
 * @title CMTDE_V3
 * @dev Immutable ERC-20 token with modular architecture
 * @notice Deploy with NO constructor parameters
 * 
 * Security Features:
 * - 24-hour timelock for TradingModule & ConfigRegistry changes
 * - Instant MEVProtection updates (defensive - needs fast response)
 * - Immutable mint caps (1B per tx, 10B daily)
 * - Module interface verification
 * - Emergency bypass mode
 * - 2-step ownership transfer
 * - Pool restrictions via MEVProtection
 * 
 * Pool Protection (via MEVProtection module):
 * - Owner/LPs can send to ANY contract
 * - Users can send to APPROVED pools only
 * - Global pool cooldown toggle (OFF by default, enable if attacked)
 * - When global cooldown ON: only 1 tx per pool per block
 * 
 * Recommended: Transfer ownership to Gnosis Safe (2-of-4 multi-sig)
 * ═══════════════════════════════════════════════════════════════════════════
 */

interface IERC20 {
    function totalSupply() external view returns (uint256);
    function balanceOf(address account) external view returns (uint256);
    function transfer(address to, uint256 amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint256);
    function approve(address spender, uint256 amount) external returns (bool);
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

interface IERC20Metadata is IERC20 {
    function name() external view returns (string memory);
    function symbol() external view returns (string memory);
    function decimals() external view returns (uint8);
}

interface ICMTDE_V3_MEVProtection {
    function checkTransfer(address from, address to, uint256 amount) external;
    function isBlacklisted(address account) external view returns (bool);
    function isLiquidityProvider(address account) external view returns (bool);
    function isApprovedPool(address pool) external view returns (bool);
    function coreToken() external view returns (address);
}

interface ICMTDE_V3_TradingModule {
    function coreToken() external view returns (address);
}

interface ICMTDE_V3_ConfigRegistry {
    function coreToken() external view returns (address);
}

contract CMTDE_V3 is IERC20, IERC20Metadata {
    
    // ═══════════════════════════════════════════════════════════════════
    //                         STATE VARIABLES
    // ═══════════════════════════════════════════════════════════════════
    
    mapping(address => uint256) private _balances;
    mapping(address => mapping(address => uint256)) private _allowances;
    mapping(address => bool) public approvedPools;
    
    uint256 private _totalSupply;
    uint256 private _goldReserves;
    
    address public owner;
    address public pendingOwner;
    address public tradingModule;
    address public mevProtection;
    address public configRegistry;
    
    bool public paused;
    
    // ═══════════════════════════════════════════════════════════════════
    //                    IMMUTABLE SECURITY CONSTANTS
    // ═══════════════════════════════════════════════════════════════════
    
    uint256 public constant CONTRACT_SIZE_THRESHOLD = 100;
    uint256 public constant TIMELOCK_DURATION = 24 hours;
    uint256 public constant MAX_MINT_PER_TX = 1_000_000_000 * 10**18;      // 1B tokens (~$450M)
    uint256 public constant MAX_DAILY_MINT = 10_000_000_000 * 10**18;     // 10B tokens (~$4.5B)
    
    string private constant _name = "CMTDE V3 Token";
    string private constant _symbol = "CMTDE_V3";
    uint8 private constant _decimals = 18;
    
    // ═══════════════════════════════════════════════════════════════════
    //                      MINT CAP TRACKING
    // ═══════════════════════════════════════════════════════════════════
    
    uint256 public dailyMintedAmount;
    uint256 public lastMintResetTime;
    
    // ═══════════════════════════════════════════════════════════════════
    //                      TIMELOCK STRUCTURES
    // ═══════════════════════════════════════════════════════════════════
    
    struct PendingModuleChange {
        address newAddress;
        uint256 executeTime;
        bool exists;
    }
    
    mapping(bytes32 => PendingModuleChange) public pendingChanges;
    
    bytes32 public constant TRADING_MODULE_KEY = keccak256("TradingModule");
    bytes32 public constant CONFIG_REGISTRY_KEY = keccak256("ConfigRegistry");
    
    // ═══════════════════════════════════════════════════════════════════
    //                      EMERGENCY BYPASS
    // ═══════════════════════════════════════════════════════════════════
    
    bool public emergencyBypassEnabled;

    // ═══════════════════════════════════════════════════════════════════
    //                           EVENTS
    // ═══════════════════════════════════════════════════════════════════

    event Mint(address indexed to, uint256 value);
    event Burn(address indexed from, uint256 value);
    event Paused();
    event Unpaused();
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    event OwnershipTransferPending(address indexed currentOwner, address indexed pendingOwner);
    event ModuleUpdated(string indexed moduleName, address indexed oldModule, address indexed newModule);
    event PoolApprovalUpdated(address indexed pool, bool approved);
    event BatchPoolsApproved(uint256 count, bool approved);
    
    // Timelock events
    event ModuleChangeQueued(string moduleName, address newAddress, uint256 executeTime);
    event ModuleChangeExecuted(string moduleName, address newAddress);
    event ModuleChangeCancelled(string moduleName);
    
    // Emergency events
    event EmergencyBypassEnabled(address indexed enabledBy);
    event EmergencyBypassDisabled(address indexed disabledBy);

    // ═══════════════════════════════════════════════════════════════════
    //                          MODIFIERS
    // ═══════════════════════════════════════════════════════════════════

    modifier onlyOwner() {
        require(msg.sender == owner, "Not owner");
        _;
    }
    
    modifier onlyOwnerOrModule() {
        require(
            msg.sender == owner || 
            msg.sender == tradingModule ||
            msg.sender == mevProtection ||
            msg.sender == configRegistry,
            "Not authorized"
        );
        _;
    }
    
    modifier whenNotPaused() {
        require(!paused, "Paused");
        _;
    }
    
    modifier validAddress(address addr) {
        require(addr != address(0), "Zero address");
        _;
    }

    // ═══════════════════════════════════════════════════════════════════
    //                         CONSTRUCTOR
    // ═══════════════════════════════════════════════════════════════════

    constructor() {
        owner = msg.sender;
        lastMintResetTime = block.timestamp;
        
        uint256 initialSupply = 20_000_000_000 * 10**18; // 20 billion tokens
        _totalSupply = initialSupply;
        _balances[owner] = initialSupply;
        emit Transfer(address(0), owner, initialSupply);
    }

    // ═══════════════════════════════════════════════════════════════════
    //                      ERC-20 VIEW FUNCTIONS
    // ═══════════════════════════════════════════════════════════════════

    function name() public pure override returns (string memory) { return _name; }
    function symbol() public pure override returns (string memory) { return _symbol; }
    function decimals() public pure override returns (uint8) { return _decimals; }
    function totalSupply() public view override returns (uint256) { return _totalSupply; }
    function balanceOf(address account) public view override returns (uint256) { return _balances[account]; }
    function allowance(address tokenOwner, address spender) public view override returns (uint256) { return _allowances[tokenOwner][spender]; }
    function goldReserves() public view returns (uint256) { return _goldReserves; }

    // ═══════════════════════════════════════════════════════════════════
    //                    ERC-20 TRANSFER FUNCTIONS
    // ═══════════════════════════════════════════════════════════════════

    function transfer(address to, uint256 amount) public override whenNotPaused returns (bool) {
        _transfer(msg.sender, to, amount);
        return true;
    }

    function approve(address spender, uint256 amount) public override whenNotPaused returns (bool) {
        _approve(msg.sender, spender, amount);
        return true;
    }

    function transferFrom(address from, address to, uint256 amount) public override whenNotPaused returns (bool) {
        uint256 currentAllowance = _allowances[from][msg.sender];
        require(currentAllowance >= amount, "Insufficient allowance");
        _transfer(from, to, amount);
        if (currentAllowance != type(uint256).max) {
            _approve(from, msg.sender, currentAllowance - amount);
        }
        return true;
    }

    function increaseAllowance(address spender, uint256 addedValue) public whenNotPaused returns (bool) {
        _approve(msg.sender, spender, _allowances[msg.sender][spender] + addedValue);
        return true;
    }

    function decreaseAllowance(address spender, uint256 subtractedValue) public whenNotPaused returns (bool) {
        uint256 currentAllowance = _allowances[msg.sender][spender];
        require(currentAllowance >= subtractedValue, "Allowance below zero");
        _approve(msg.sender, spender, currentAllowance - subtractedValue);
        return true;
    }

    // ═══════════════════════════════════════════════════════════════════
    //                      INTERNAL FUNCTIONS
    // ═══════════════════════════════════════════════════════════════════

    function _isContract(address account) internal view returns (bool) {
        uint256 size;
        assembly { size := extcodesize(account) }
        return size > CONTRACT_SIZE_THRESHOLD;
    }

    function _transfer(address from, address to, uint256 amount) internal validAddress(to) {
        require(from != address(0), "Transfer from zero");
        
        // Check balance once at the start
        uint256 senderBalance = _balances[from];
        require(senderBalance >= amount, "Insufficient balance");
        
        // Emergency bypass - skip all module checks for basic transfers
        if (!emergencyBypassEnabled) {
            // Normal flow with module checks
            if (mevProtection != address(0)) {
                ICMTDE_V3_MEVProtection protection = ICMTDE_V3_MEVProtection(mevProtection);
                require(!protection.isBlacklisted(from), "Sender blacklisted");
                require(!protection.isBlacklisted(to), "Recipient blacklisted");
                
                // POOL PROTECTION: 
                // - Owner and LPs can send to ANY contract
                // - Anyone can send to APPROVED pools (checked via MEVProtection)
                // - Non-approved contracts blocked for regular users
                if (_isContract(to)) {
                    bool isLP = protection.isLiquidityProvider(from);
                    bool isPoolApproved = protection.isApprovedPool(to);
                    
                    require(
                        isLP || from == owner || isPoolApproved,
                        "Only owner/LPs or approved pools"
                    );
                }
                protection.checkTransfer(from, to, amount);
            } else {
                // Fallback when MEVProtection not set: only owner can send to contracts
                if (_isContract(to)) {
                    require(from == owner, "Only owner can send to pools");
                }
            }
        }
        
        // Execute transfer
        _balances[from] = senderBalance - amount;
        _balances[to] += amount;
        emit Transfer(from, to, amount);
    }

    function _approve(address tokenOwner, address spender, uint256 amount) internal {
        require(tokenOwner != address(0) && spender != address(0), "Zero address");
        _allowances[tokenOwner][spender] = amount;
        emit Approval(tokenOwner, spender, amount);
    }

    // ═══════════════════════════════════════════════════════════════════
    //                    MINT/BURN WITH CAPS
    // ═══════════════════════════════════════════════════════════════════

    function mint(address to, uint256 amount) external onlyOwnerOrModule validAddress(to) whenNotPaused {
        require(amount > 0, "Amount must be positive");
        require(amount <= MAX_MINT_PER_TX, "Exceeds max mint per tx");
        
        // Reset daily counter if 24 hours passed
        if (block.timestamp - lastMintResetTime >= 1 days) {
            dailyMintedAmount = 0;
            lastMintResetTime = block.timestamp;
        }
        
        require(dailyMintedAmount + amount <= MAX_DAILY_MINT, "Exceeds daily mint cap");
        dailyMintedAmount += amount;
        
        _balances[to] += amount;
        _totalSupply += amount;
        emit Mint(to, amount);
        emit Transfer(address(0), to, amount);
    }

    function burn(uint256 amount) public whenNotPaused {
        require(_balances[msg.sender] >= amount, "Burn exceeds balance");
        _balances[msg.sender] -= amount;
        _totalSupply -= amount;
        emit Burn(msg.sender, amount);
        emit Transfer(msg.sender, address(0), amount);
    }

    function burnFrom(address account, uint256 amount) public whenNotPaused {
        uint256 currentAllowance = _allowances[account][msg.sender];
        require(currentAllowance >= amount, "Burn exceeds allowance");
        _approve(account, msg.sender, currentAllowance - amount);
        require(_balances[account] >= amount, "Burn exceeds balance");
        _balances[account] -= amount;
        _totalSupply -= amount;
        emit Burn(account, amount);
        emit Transfer(account, address(0), amount);
    }
    
    function moduleBurn(address account, uint256 amount) external onlyOwnerOrModule whenNotPaused {
        require(_balances[account] >= amount, "Burn exceeds balance");
        _balances[account] -= amount;
        _totalSupply -= amount;
        emit Burn(account, amount);
        emit Transfer(account, address(0), amount);
    }

    // ═══════════════════════════════════════════════════════════════════
    //                 TIMELOCK MODULE MANAGEMENT
    // ═══════════════════════════════════════════════════════════════════

    /**
     * @dev Queue a TradingModule change (24-hour delay)
     */
    function queueTradingModule(address _newModule) external onlyOwner validAddress(_newModule) {
        require(_verifyTradingModuleInterface(_newModule), "Invalid TradingModule interface");
        
        pendingChanges[TRADING_MODULE_KEY] = PendingModuleChange({
            newAddress: _newModule,
            executeTime: block.timestamp + TIMELOCK_DURATION,
            exists: true
        });
        
        emit ModuleChangeQueued("TradingModule", _newModule, block.timestamp + TIMELOCK_DURATION);
    }
    
    function executeTradingModule() external onlyOwner {
        PendingModuleChange storage pending = pendingChanges[TRADING_MODULE_KEY];
        require(pending.exists, "No pending change");
        require(block.timestamp >= pending.executeTime, "Timelock not expired");
        
        address oldModule = tradingModule;
        tradingModule = pending.newAddress;
        
        delete pendingChanges[TRADING_MODULE_KEY];
        
        emit ModuleChangeExecuted("TradingModule", pending.newAddress);
        emit ModuleUpdated("TradingModule", oldModule, tradingModule);
    }
    
    function cancelTradingModuleChange() external onlyOwner {
        delete pendingChanges[TRADING_MODULE_KEY];
        emit ModuleChangeCancelled("TradingModule");
    }

    /**
     * @dev Queue a ConfigRegistry change (24-hour delay)
     */
    function queueConfigRegistry(address _newModule) external onlyOwner validAddress(_newModule) {
        require(_verifyConfigRegistryInterface(_newModule), "Invalid ConfigRegistry interface");
        
        pendingChanges[CONFIG_REGISTRY_KEY] = PendingModuleChange({
            newAddress: _newModule,
            executeTime: block.timestamp + TIMELOCK_DURATION,
            exists: true
        });
        
        emit ModuleChangeQueued("ConfigRegistry", _newModule, block.timestamp + TIMELOCK_DURATION);
    }
    
    function executeConfigRegistry() external onlyOwner {
        PendingModuleChange storage pending = pendingChanges[CONFIG_REGISTRY_KEY];
        require(pending.exists, "No pending change");
        require(block.timestamp >= pending.executeTime, "Timelock not expired");
        
        address oldModule = configRegistry;
        configRegistry = pending.newAddress;
        
        delete pendingChanges[CONFIG_REGISTRY_KEY];
        
        emit ModuleChangeExecuted("ConfigRegistry", pending.newAddress);
        emit ModuleUpdated("ConfigRegistry", oldModule, configRegistry);
    }
    
    function cancelConfigRegistryChange() external onlyOwner {
        delete pendingChanges[CONFIG_REGISTRY_KEY];
        emit ModuleChangeCancelled("ConfigRegistry");
    }

    // ═══════════════════════════════════════════════════════════════════
    //                 INITIAL MODULE SETUP (NO TIMELOCK)
    // ═══════════════════════════════════════════════════════════════════
    
    /**
     * @dev Set TradingModule for the first time (no timelock)
     * @notice Can only be used when module is not yet set (address(0))
     */
    function setTradingModule(address _tradingModule) external onlyOwner validAddress(_tradingModule) {
        require(tradingModule == address(0), "Use queueTradingModule for updates");
        require(_verifyTradingModuleInterface(_tradingModule), "Invalid interface");
        tradingModule = _tradingModule;
        emit ModuleUpdated("TradingModule", address(0), _tradingModule);
    }
    
    /**
     * @dev Set MEVProtection module (INSTANT - no timelock)
     * @notice MEVProtection is defensive and may need immediate updates during attacks
     */
    function setMEVProtection(address _mevProtection) external onlyOwner validAddress(_mevProtection) {
        require(_verifyMEVProtectionInterface(_mevProtection), "Invalid interface");
        address oldModule = mevProtection;
        mevProtection = _mevProtection;
        emit ModuleUpdated("MEVProtection", oldModule, _mevProtection);
    }
    
    /**
     * @dev Set ConfigRegistry for the first time (no timelock)
     * @notice Can only be used when module is not yet set (address(0))
     */
    function setConfigRegistry(address _configRegistry) external onlyOwner validAddress(_configRegistry) {
        require(configRegistry == address(0), "Use queueConfigRegistry for updates");
        require(_verifyConfigRegistryInterface(_configRegistry), "Invalid interface");
        configRegistry = _configRegistry;
        emit ModuleUpdated("ConfigRegistry", address(0), _configRegistry);
    }

    // ═══════════════════════════════════════════════════════════════════
    //                  INTERFACE VERIFICATION
    // ═══════════════════════════════════════════════════════════════════

    function _verifyTradingModuleInterface(address _module) internal view returns (bool) {
        try ICMTDE_V3_TradingModule(_module).coreToken() returns (address) {
            return true;
        } catch {
            return false;
        }
    }
    
    function _verifyMEVProtectionInterface(address _module) internal view returns (bool) {
        try ICMTDE_V3_MEVProtection(_module).coreToken() returns (address) {
            return true;
        } catch {
            return false;
        }
    }
    
    function _verifyConfigRegistryInterface(address _module) internal view returns (bool) {
        try ICMTDE_V3_ConfigRegistry(_module).coreToken() returns (address) {
            return true;
        } catch {
            return false;
        }
    }

    // ═══════════════════════════════════════════════════════════════════
    //                      EMERGENCY BYPASS
    // ═══════════════════════════════════════════════════════════════════

    /**
     * @dev Enable emergency bypass - allows basic transfers without module checks
     * @notice Use only if modules are compromised/malfunctioning
     */
    function enableEmergencyBypass() external onlyOwner {
        emergencyBypassEnabled = true;
        emit EmergencyBypassEnabled(msg.sender);
    }
    
    /**
     * @dev Disable emergency bypass - re-enable module checks
     */
    function disableEmergencyBypass() external onlyOwner {
        emergencyBypassEnabled = false;
        emit EmergencyBypassDisabled(msg.sender);
    }

    // ═══════════════════════════════════════════════════════════════════
    //                      POOL APPROVAL MANAGEMENT
    // ═══════════════════════════════════════════════════════════════════
    // 
    // NOTE: _transfer() checks MEVProtection.isApprovedPool() - use that!
    //       MEVProtection.setApprovedPool() is the authoritative source
    //       MEVProtection also has global pool cooldown toggle
    //
    // These local functions kept for backward compatibility / emergencies
    // but are NOT checked in _transfer() flow
    // ═══════════════════════════════════════════════════════════════════

    /// @notice Local pool approval (NOT checked in _transfer - use MEVProtection instead)
    function setApprovedPool(address pool, bool approved) external onlyOwner validAddress(pool) {
        approvedPools[pool] = approved;
        emit PoolApprovalUpdated(pool, approved);
    }
    
    /// @notice Local batch approval (NOT checked in _transfer - use MEVProtection instead)
    function batchApprovePools(address[] calldata pools) external onlyOwner {
        uint256 length = pools.length;
        require(length > 0 && length <= 50, "Invalid array length");
        for (uint256 i = 0; i < length;) {
            if (pools[i] != address(0)) approvedPools[pools[i]] = true;
            unchecked { ++i; }
        }
        emit BatchPoolsApproved(length, true);
    }
    
    /// @notice Local batch revoke (NOT checked in _transfer - use MEVProtection instead)
    function batchRevokePools(address[] calldata pools) external onlyOwner {
        uint256 length = pools.length;
        require(length > 0 && length <= 50, "Invalid array length");
        for (uint256 i = 0; i < length;) {
            approvedPools[pools[i]] = false;
            unchecked { ++i; }
        }
        emit BatchPoolsApproved(length, false);
    }
    
    /// @notice Returns LOCAL approval status (MEVProtection is what's actually enforced)
    function isApprovedPool(address pool) external view returns (bool) { return approvedPools[pool]; }
    function isContract(address account) external view returns (bool) { return _isContract(account); }

    // ═══════════════════════════════════════════════════════════════════
    //                      ADMIN FUNCTIONS
    // ═══════════════════════════════════════════════════════════════════

    function pause() external onlyOwner { paused = true; emit Paused(); }
    function unpause() external onlyOwner { paused = false; emit Unpaused(); }
    function auditGoldReserves(uint256 auditedAmount) external onlyOwner { _goldReserves = auditedAmount; }

    // ═══════════════════════════════════════════════════════════════════
    //                      VIEW FUNCTIONS
    // ═══════════════════════════════════════════════════════════════════

    /**
     * @dev Get pending module change details
     */
    function getPendingChange(bytes32 moduleKey) external view returns (
        address newAddress,
        uint256 executeTime,
        bool exists,
        uint256 timeRemaining
    ) {
        PendingModuleChange storage pending = pendingChanges[moduleKey];
        newAddress = pending.newAddress;
        executeTime = pending.executeTime;
        exists = pending.exists;
        
        if (exists && block.timestamp < executeTime) {
            timeRemaining = executeTime - block.timestamp;
        }
    }
    
    /**
     * @dev Get mint cap status
     */
    function getMintCapStatus() external view returns (
        uint256 dailyMinted,
        uint256 dailyRemaining,
        uint256 maxPerTx,
        uint256 maxDaily,
        uint256 resetTime
    ) {
        dailyMinted = dailyMintedAmount;
        maxPerTx = MAX_MINT_PER_TX;
        maxDaily = MAX_DAILY_MINT;
        
        if (block.timestamp - lastMintResetTime >= 1 days) {
            dailyRemaining = MAX_DAILY_MINT;
            resetTime = 0;
        } else {
            dailyRemaining = MAX_DAILY_MINT - dailyMintedAmount;
            resetTime = lastMintResetTime + 1 days - block.timestamp;
        }
    }

    // ═══════════════════════════════════════════════════════════════════
    //                   OWNERSHIP TRANSFER (2-STEP)
    // ═══════════════════════════════════════════════════════════════════

    function transferOwnership(address newOwner) external onlyOwner validAddress(newOwner) {
        pendingOwner = newOwner;
        emit OwnershipTransferPending(owner, newOwner);
    }
    
    function acceptOwnership() external {
        require(msg.sender == pendingOwner, "Not pending owner");
        address oldOwner = owner;
        owner = pendingOwner;
        pendingOwner = address(0);
        emit OwnershipTransferred(oldOwner, owner);
    }
    
    function cancelOwnershipTransfer() external onlyOwner { pendingOwner = address(0); }
    
    function renounceOwnership() external onlyOwner {
        address oldOwner = owner;
        owner = address(0);
        pendingOwner = address(0);
        emit OwnershipTransferred(oldOwner, address(0));
    }
}

Read Contract

CONFIG_REGISTRY_KEY 0xe456af16 → bytes32
CONTRACT_SIZE_THRESHOLD 0x5a2b2fcb → uint256
MAX_DAILY_MINT 0x5923f705 → uint256
MAX_MINT_PER_TX 0x8ecad721 → uint256
TIMELOCK_DURATION 0x4623c81e → uint256
TRADING_MODULE_KEY 0x81c1ead7 → bytes32
allowance 0xdd62ed3e → uint256
approvedPools 0xf0bbcec4 → bool
balanceOf 0x70a08231 → uint256
configRegistry 0x244bb309 → address
dailyMintedAmount 0x71f110ff → uint256
decimals 0x313ce567 → uint8
emergencyBypassEnabled 0xcee8e0fe → bool
getMintCapStatus 0xc8fbcf26 → uint256, uint256, uint256, uint256, uint256
getPendingChange 0x2ec7cff9 → address, uint256, bool, uint256
goldReserves 0x4e151e14 → uint256
isApprovedPool 0x95bae2fe → bool
isContract 0x16279055 → bool
lastMintResetTime 0x9f2d8b80 → uint256
mevProtection 0xcd2c664b → address
name 0x06fdde03 → string
owner 0x8da5cb5b → address
paused 0x5c975abb → bool
pendingChanges 0x4dda5518 → address, uint256, bool
pendingOwner 0xe30c3978 → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
tradingModule 0x637e8ab4 → address

Write Contract 30 functions

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

acceptOwnership 0x79ba5097
No parameters
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
auditGoldReserves 0x539a1c42
uint256 auditedAmount
batchApprovePools 0xed314a02
address[] pools
batchRevokePools 0x6bb2060e
address[] pools
burn 0x42966c68
uint256 amount
burnFrom 0x79cc6790
address account
uint256 amount
cancelConfigRegistryChange 0xe80a8d21
No parameters
cancelOwnershipTransfer 0x23452b9c
No parameters
cancelTradingModuleChange 0x2861ff2d
No parameters
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
disableEmergencyBypass 0x24e0eba9
No parameters
enableEmergencyBypass 0xd0aa96c0
No parameters
executeConfigRegistry 0x42b18111
No parameters
executeTradingModule 0x2fb63ff9
No parameters
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
mint 0x40c10f19
address to
uint256 amount
moduleBurn 0x91b98e0e
address account
uint256 amount
pause 0x8456cb59
No parameters
queueConfigRegistry 0xa3771750
address _newModule
queueTradingModule 0x3d4b8f90
address _newModule
renounceOwnership 0x715018a6
No parameters
setApprovedPool 0x32e822e4
address pool
bool approved
setConfigRegistry 0xc1efcca4
address _configRegistry
setMEVProtection 0xe90f7aa4
address _mevProtection
setTradingModule 0xc149ec17
address _tradingModule
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
unpause 0x3f4ba83a
No parameters

Recent Transactions

No transactions found for this address