Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0x4EE06a55c5AA9F1731937B1BE9c09ff8C0803176
Balance 0 ETH
Nonce 1
Code Size 10879 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

10879 bytes
0x6080604052600436106101d3575f3560e01c8063715018a6116100fd578063a9059cbb11610092578063dd62ed3e11610062578063dd62ed3e146105c9578063ef3f18b61461061a578063f2fde38b14610639578063fb2f349214610658575f5ffd5b8063a9059cbb1461053e578063af81d1361461055d578063b62496f51461057c578063b70143c9146105aa575f5ffd5b80638da5cb5b116100cd5780638da5cb5b146104c257806395d89b41146104ec5780639a7a23d614610500578063a457c2d71461051f575f5ffd5b8063715018a614610467578063741af87f1461047b578063751fd1791461048f5780638a8c523c146104ae575f5ffd5b806325379fc31161017357806349bd5a5e1161014357806349bd5a5e146103a15780634c43e307146103d45780635e8b5ae3146103e857806370a0823114610426575f5ffd5b806325379fc31461030c57806331392fcb14610338578063313ce567146103675780633950935114610382575f5ffd5b80631006ee0c116101ae5780631006ee0c146102585780631694505e1461027757806318160ddd146102cf57806323b872dd146102ed575f5ffd5b806302af2095146101de57806306fdde03146101ff578063095ea7b314610229575f5ffd5b366101da57005b5f5ffd5b3480156101e9575f5ffd5b506101fd6101f83660046125f3565b610677565b005b34801561020a575f5ffd5b50610213610760565b604051610220919061265f565b60405180910390f35b348015610234575f5ffd5b506102486102433660046126d3565b6107f0565b6040519015158152602001610220565b348015610263575f5ffd5b506101fd6102723660046126fd565b610806565b348015610282575f5ffd5b506102aa7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610220565b3480156102da575f5ffd5b506002545b604051908152602001610220565b3480156102f8575f5ffd5b5061024861030736600461271d565b6109a4565b348015610317575f5ffd5b50600b546102aa9073ffffffffffffffffffffffffffffffffffffffff1681565b348015610343575f5ffd5b50600654600754610352919082565b60408051928352602083019190915201610220565b348015610372575f5ffd5b5060405160128152602001610220565b34801561038d575f5ffd5b5061024861039c3660046126d3565b610a8a565b3480156103ac575f5ffd5b506102aa7f00000000000000000000000028496fa9a31fa6df1b64ac50f45d6ac3fb8a6b1881565b3480156103df575f5ffd5b506101fd610ad2565b3480156103f3575f5ffd5b50600854600954600a5461040992919060ff1683565b604080519384526020840192909252151590820152606001610220565b348015610431575f5ffd5b506102df61044036600461275b565b73ffffffffffffffffffffffffffffffffffffffff165f9081526020819052604090205490565b348015610472575f5ffd5b506101fd610bdd565b348015610486575f5ffd5b506101fd610c69565b34801561049a575f5ffd5b506101fd6104a936600461278a565b610d31565b3480156104b9575f5ffd5b506101fd610dc0565b3480156104cd575f5ffd5b5060055473ffffffffffffffffffffffffffffffffffffffff166102aa565b3480156104f7575f5ffd5b50610213610e7e565b34801561050b575f5ffd5b506101fd61051a36600461278a565b610e8d565b34801561052a575f5ffd5b506102486105393660046126d3565b61103e565b348015610549575f5ffd5b506102486105583660046126d3565b611115565b348015610568575f5ffd5b506101fd6105773660046127bd565b611121565b348015610587575f5ffd5b5061024861059636600461275b565b600c6020525f908152604090205460ff1681565b3480156105b5575f5ffd5b506101fd6105c43660046127ef565b6111dc565b3480156105d4575f5ffd5b506102df6105e3366004612806565b73ffffffffffffffffffffffffffffffffffffffff9182165f90815260016020908152604080832093909416825291909152205490565b348015610625575f5ffd5b506101fd61063436600461275b565b61135c565b348015610644575f5ffd5b506101fd61065336600461275b565b6114f9565b348015610663575f5ffd5b506101fd61067236600461283d565b611626565b821580159061068557508281145b6106f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f42563a20496e76616c696420696e70757420617272617973000000000000000060448201526064015b60405180910390fd5b5f5b838110156107595761075085858381811061070f5761070f612884565b9050602002016020810190610724919061275b565b84848481811061073657610736612884565b90506020020135670de0b6b3a764000061055891906128de565b506001016106f2565b5050505050565b60606003805461076f906128f5565b80601f016020809104026020016040519081016040528092919081815260200182805461079b906128f5565b80156107e65780601f106107bd576101008083540402835291602001916107e6565b820191905f5260205f20905b8154815290600101906020018083116107c957829003601f168201915b5050505050905090565b5f6107fc33848461173c565b5060015b92915050565b60055473ffffffffffffffffffffffffffffffffffffffff163314610887576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106e7565b60058211156108f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f42563a20427579206665652063616e6e6f74206578636565642035250000000060448201526064016106e7565b600581111561095d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f42563a2053656c6c206665652063616e6e6f742065786365656420352500000060448201526064016106e7565b6006829055600781905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b5f6109b08484846118ee565b73ffffffffffffffffffffffffffffffffffffffff84165f90815260016020908152604080832033845290915290205482811015610a70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160448201527f6c6c6f77616e636500000000000000000000000000000000000000000000000060648201526084016106e7565b610a7d853385840361173c565b60019150505b9392505050565b335f81815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490916107fc918590610acd908690612946565b61173c565b600b5473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b69576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f42563a2043616c6c6572206973206e6f742061207465616d2077616c6c65740060448201526064016106e7565b4780610bd1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f42563a204e6f2045544820746f20646973747269627574652e0000000000000060448201526064016106e7565b610bda81611ce1565b50565b60055473ffffffffffffffffffffffffffffffffffffffff163314610c5e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106e7565b610c675f611dce565b565b60055473ffffffffffffffffffffffffffffffffffffffff163314610cea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106e7565b5f600681905560078190556040805182815260208101929092527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a1565b60055473ffffffffffffffffffffffffffffffffffffffff163314610db2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106e7565b610dbc8282611e44565b5050565b60055473ffffffffffffffffffffffffffffffffffffffff163314610e41576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106e7565b600f805460017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009182168117909255600a80549091169091179055565b60606004805461076f906128f5565b60055473ffffffffffffffffffffffffffffffffffffffff163314610f0e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106e7565b7f00000000000000000000000028496fa9a31fa6df1b64ac50f45d6ac3fb8a6b1873ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610fe9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f42563a2043616e6e6f7420616c74657220746865206d61696e2070616972277360448201527f207374617475732e00000000000000000000000000000000000000000000000060648201526084016106e7565b73ffffffffffffffffffffffffffffffffffffffff919091165f908152600c6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b335f90815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff86168452909152812054828110156110fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084016106e7565b61110b338585840361173c565b5060019392505050565b5f6107fc3384846118ee565b60055473ffffffffffffffffffffffffffffffffffffffff1633146111a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106e7565b600892909255600955600a80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b600f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055600b5473ffffffffffffffffffffffffffffffffffffffff166112283390565b73ffffffffffffffffffffffffffffffffffffffff16146112a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f42563a2043616c6c6572206973206e6f742061207465616d2077616c6c65740060448201526064016106e7565b305f9081526020819052604090205481111580156112c257505f81115b611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f42563a20496e76616c696420616d6f756e7420666f722073776170000000000060448201526064016106e7565b61133181611ecd565b50600f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055565b60055473ffffffffffffffffffffffffffffffffffffffff1633146113dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106e7565b73ffffffffffffffffffffffffffffffffffffffff8116611480576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f42563a2057616c6c6574732063616e6e6f74206265207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016106e7565b600b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040519081527f3922141fbedd334295f9a52b0e0fb37966bdff0a7bfe585c90cd0af3de15b1829060200160405180910390a150565b60055473ffffffffffffffffffffffffffffffffffffffff16331461157a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106e7565b73ffffffffffffffffffffffffffffffffffffffff811661161d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016106e7565b610bda81611dce565b60055473ffffffffffffffffffffffffffffffffffffffff1633146116a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106e7565b5f5b828110156117365781600e5f8686858181106116c7576116c7612884565b90506020020160208101906116dc919061275b565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f2080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790556001016116a9565b50505050565b73ffffffffffffffffffffffffffffffffffffffff83166117de576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016106e7565b73ffffffffffffffffffffffffffffffffffffffff8216611881576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016106e7565b73ffffffffffffffffffffffffffffffffffffffff8381165f8181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316611991576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016106e7565b73ffffffffffffffffffffffffffffffffffffffff8216611a34576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016106e7565b73ffffffffffffffffffffffffffffffffffffffff83165f908152600e602052604090205460ff16158015611a8e575073ffffffffffffffffffffffffffffffffffffffff82165f908152600e602052604090205460ff16155b611af4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f42563a204164647265737320697320626c61636b6c69737465642e000000000060448201526064016106e7565b805f03611b0b57611b0683835f6120ea565b505050565b600f5460ff16611bd25773ffffffffffffffffffffffffffffffffffffffff83165f908152600d602052604090205460ff1680611b6c575073ffffffffffffffffffffffffffffffffffffffff82165f908152600d602052604090205460ff165b611bd2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f42563a2054726164696e67206973206e6f742079657420656e61626c65642e0060448201526064016106e7565b600f54610100900460ff1615611bed57611b068383836120ea565b305f9081526020819052604090205460085481108015908190611c125750600a5460ff165b8015611c43575073ffffffffffffffffffffffffffffffffffffffff85165f908152600c602052604090205460ff16155b8015611c74575073ffffffffffffffffffffffffffffffffffffffff85165f908152600d602052604090205460ff16155b8015611ca5575073ffffffffffffffffffffffffffffffffffffffff84165f908152600d602052604090205460ff16155b15611cb257611cb261239b565b5f611cbe86868661247d565b90505f611ccb858361258a565b9050611cd88787836120ea565b50505050505050565b600b546040515f9173ffffffffffffffffffffffffffffffffffffffff169083908381818185875af1925050503d805f8114611d38576040519150601f19603f3d011682016040523d82523d5f602084013e611d3d565b606091505b5050905080610dbc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f42563a204d61726b6574696e672077616c6c657420455448207472616e73666560448201527f72206661696c656400000000000000000000000000000000000000000000000060648201526084016106e7565b6005805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b73ffffffffffffffffffffffffffffffffffffffff82165f818152600d602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915591519182527f9d8f7706ea1113d1a167b526eca956215946dd36cc7df39eb16180222d8b5df7910160405180910390a25050565b6040805160028082526060820183525f9260208301908036833701905050905030815f81518110611f0057611f00612884565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611fa3573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611fc79190612959565b81600181518110611fda57611fda612884565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061203f307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d8461173c565b6040517f791ac94700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d169063791ac947906120b99085905f90869030904290600401612974565b5f604051808303815f87803b1580156120d0575f5ffd5b505af11580156120e2573d5f5f3e3d5ffd5b505050505050565b73ffffffffffffffffffffffffffffffffffffffff831661218d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016106e7565b73ffffffffffffffffffffffffffffffffffffffff8216612230576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016106e7565b73ffffffffffffffffffffffffffffffffffffffff83165f90815260208190526040902054818110156122e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016106e7565b73ffffffffffffffffffffffffffffffffffffffff8085165f90815260208190526040808220858503905591851681529081208054849290612328908490612946565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161238e91815260200190565b60405180910390a3611736565b600f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055305f908152602081905260408120549050805f036123e55750612453565b6009545f9082116123f657816123fa565b6009545b905061240581611ecd565b47801561244f5761241581611ce1565b60408051838152602081018390527f10da9408d1358808fea34ded33d675db0ba8e618a2fb814298059b2a6b0a473f910160405180910390a15b5050505b600f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055565b73ffffffffffffffffffffffffffffffffffffffff83165f908152600d602052604081205460ff16806124d4575073ffffffffffffffffffffffffffffffffffffffff83165f908152600d602052604090205460ff165b156124e057505f610a83565b73ffffffffffffffffffffffffffffffffffffffff83165f908152600c602052604081205460ff16156125165750600754612548565b73ffffffffffffffffffffffffffffffffffffffff85165f908152600c602052604090205460ff161561254857506006545b8015612580575f612564606461255e8685612595565b906125a0565b90508015612577576125778630836120ea565b9150610a839050565b505f949350505050565b5f610a8382846129fe565b5f610a8382846128de565b5f610a838284612a11565b5f5f83601f8401126125bb575f5ffd5b50813567ffffffffffffffff8111156125d2575f5ffd5b6020830191508360208260051b85010111156125ec575f5ffd5b9250929050565b5f5f5f5f60408587031215612606575f5ffd5b843567ffffffffffffffff81111561261c575f5ffd5b612628878288016125ab565b909550935050602085013567ffffffffffffffff811115612647575f5ffd5b612653878288016125ab565b95989497509550505050565b602081525f82518060208401528060208501604085015e5f6040828501015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011684010191505092915050565b73ffffffffffffffffffffffffffffffffffffffff81168114610bda575f5ffd5b5f5f604083850312156126e4575f5ffd5b82356126ef816126b2565b946020939093013593505050565b5f5f6040838503121561270e575f5ffd5b50508035926020909101359150565b5f5f5f6060848603121561272f575f5ffd5b833561273a816126b2565b9250602084013561274a816126b2565b929592945050506040919091013590565b5f6020828403121561276b575f5ffd5b8135610a83816126b2565b80358015158114612785575f5ffd5b919050565b5f5f6040838503121561279b575f5ffd5b82356127a6816126b2565b91506127b460208401612776565b90509250929050565b5f5f5f606084860312156127cf575f5ffd5b83359250602084013591506127e660408501612776565b90509250925092565b5f602082840312156127ff575f5ffd5b5035919050565b5f5f60408385031215612817575f5ffd5b8235612822816126b2565b91506020830135612832816126b2565b809150509250929050565b5f5f5f6040848603121561284f575f5ffd5b833567ffffffffffffffff811115612865575f5ffd5b612871868287016125ab565b90945092506127e6905060208501612776565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082028115828204841417610800576108006128b1565b600181811c9082168061290957607f821691505b602082108103612940577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b50919050565b80820180821115610800576108006128b1565b5f60208284031215612969575f5ffd5b8151610a83816126b2565b5f60a0820187835286602084015260a0604084015280865180835260c0850191506020880192505f5b818110156129d157835173ffffffffffffffffffffffffffffffffffffffff1683526020938401939092019160010161299d565b505073ffffffffffffffffffffffffffffffffffffffff9590951660608401525050608001529392505050565b81810381811115610800576108006128b1565b5f82612a44577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea26469706673582212204ad510ea4e64c972f8edb9f90205a6f576b28c9846ed0ccaa662f47f4f51f9ef64736f6c634300081e0033

Verified Source Code Full Match

Compiler: v0.8.30+commit.73712a01 EVM: prague Optimization: Yes (1000000 runs)
QubeSmart.sol 873 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.21;

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

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

abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);


    constructor() {
        _transferOwnership(_msgSender());
    }


    function owner() public view virtual returns (address) {
        return _owner;
    }


    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }


    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

interface IERC20 {

    function totalSupply() external view returns (uint256);

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

    function transfer(address recipient, 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 sender,
        address recipient,
        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);
}

contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

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


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

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

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

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

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

    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

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

    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        unchecked {
            _approve(sender, _msgSender(), currentAllowance - amount);
        }

        return true;
    }

    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(_msgSender(), spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[sender] = senderBalance - amount;
        }
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, amount);
    }

    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

library SafeMath {

    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

interface IUniswapV2Factory {
    event PairCreated(
        address indexed token0,
        address indexed token1,
        address pair,
        uint256
    );

    function feeTo() external view returns (address);

    function feeToSetter() external view returns (address);

    function getPair(address tokenA, address tokenB)
        external
        view
        returns (address pair);

    function allPairs(uint256) external view returns (address pair);

    function allPairsLength() external view returns (uint256);

    function createPair(address tokenA, address tokenB)
        external
        returns (address pair);

    function setFeeTo(address) external;

    function setFeeToSetter(address) external;
}

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

    function name() external pure returns (string memory);

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

    function decimals() external pure returns (uint8);

    function totalSupply() external view returns (uint256);

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

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

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

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

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

    function DOMAIN_SEPARATOR() external view returns (bytes32);

    function PERMIT_TYPEHASH() external pure returns (bytes32);

    function nonces(address owner) external view returns (uint256);

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    event Mint(address indexed sender, uint256 amount0, uint256 amount1);
    event Burn(
        address indexed sender,
        uint256 amount0,
        uint256 amount1,
        address indexed to
    );
    event Swap(
        address indexed sender,
        uint256 amount0In,
        uint256 amount1In,
        uint256 amount0Out,
        uint256 amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint256);

    function factory() external view returns (address);

    function token0() external view returns (address);

    function token1() external view returns (address);

    function getReserves()
        external
        view
        returns (
            uint112 reserve0,
            uint112 reserve1,
            uint32 blockTimestampLast
        );

    function price0CumulativeLast() external view returns (uint256);

    function price1CumulativeLast() external view returns (uint256);

    function kLast() external view returns (uint256);

    function mint(address to) external returns (uint256 liquidity);

    function burn(address to)
        external
        returns (uint256 amount0, uint256 amount1);

    function swap(
        uint256 amount0Out,
        uint256 amount1Out,
        address to,
        bytes calldata data
    ) external;

    function skim(address to) external;

    function sync() external;

    function initialize(address, address) external;
}

interface IUniswapV2Router02 {
    function factory() external pure returns (address);

    function WETH() external pure returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint256 amountADesired,
        uint256 amountBDesired,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline
    )
        external
        returns (
            uint256 amountA,
            uint256 amountB,
            uint256 liquidity
        );

    function addLiquidityETH(
        address token,
        uint256 amountTokenDesired,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    )
        external
        payable
        returns (
            uint256 amountToken,
            uint256 amountETH,
            uint256 liquidity
        );

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;

    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external payable;

    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;
}

contract QubeSmart is ERC20, Ownable {
    using SafeMath for uint256;

    // --- Configuration Structs ---

    /**
     * @dev Holds the fee percentages for buy and sell transactions.
     */
    struct FeeConfiguration {
        uint256 buyFeePercent;
        uint256 sellFeePercent;
    }

    /**
     * @dev Holds settings related to the automated token swap mechanism.
     * @swapThreshold the minimum number of tokens the contract must hold to trigger a swap.
     * @maxSwapAmount the maximum number of tokens to swap in a single transaction.
     */
    struct SwapConfiguration {
        uint256 swapThreshold;
        uint256 maxSwapAmount;    
        bool isSwapEnabled;
    }

    /**
     * @dev Stores the addresses for distributing collected fees.
     */
    struct FeeRecipientWallets {
        address marketingWallet;
    }

    // --- State Variables ---

    IUniswapV2Router02 public immutable uniswapV2Router;
    address public immutable uniswapV2Pair;

    FeeConfiguration public taxSettings;
    SwapConfiguration public swapSettings;
    FeeRecipientWallets public feeWallets;

    mapping(address => bool) public automatedMarketMakerPairs;
    mapping(address => bool) private _isFeeExempt;
    mapping(address => bool) private _isBlacklisted;

    bool private _isTradingLive;
    bool private _inSwap; // Re-entrancy guard to prevent multiple swaps at the same time.

    // fee calculations in basis points (100%)
    uint256 private constant FEE_BASIS_POINTS = 100;

    // --- Events ---

    event FeesUpdated(uint256 buyFee, uint256 sellFee);
    event WalletsUpdated(address marketingWallet);
    event ExcludeFromFees(address indexed account, bool isExcluded);
    event SwapAndDistribute(uint256 tokensSwapped, uint256 ethReceived);

    // --- Modifiers ---

    /**
     * @dev Prevents re-entrancy for the swap mechanism.
     */
    modifier lockTheSwap() {
        _inSwap = true;
        _;
        _inSwap = false;
    }

    // --- Constructor ---

    constructor(address newOwner)  ERC20("QubeSmart", "CS") {
        require(newOwner != address(0), "Owner wallet cannot be zero address");
        // Uniswap Router - Mainnet address
        IUniswapV2Router02 _router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
        uniswapV2Router = _router;

        // Create the trading pair for this token and WETH
        uniswapV2Pair = IUniswapV2Factory(_router.factory()).createPair(address(this), _router.WETH());
        automatedMarketMakerPairs[uniswapV2Pair] = true;

        // --- Configurations ---
        uint256 totalSupply = 1_00_000_000 * 1e18;

        // Initial swap settings: swap at 0.01% of total supply, max swap is 1%
        swapSettings = SwapConfiguration({
            swapThreshold: totalSupply / 10000,
            maxSwapAmount: totalSupply / 100,
            isSwapEnabled: false // Trading starts disabled
        });

        /**
        * Initial tax settings
        * 0% buy, 4% sell
        */
        taxSettings = FeeConfiguration({
            buyFeePercent: 0,
            sellFeePercent: 4
        });

        // Initialize fee recipient wallets
        feeWallets = FeeRecipientWallets({
            marketingWallet: 0x29aCa368a5F4424Cf44739D7B4e25E17795872a3
        });

        // Mint the total supply
        // _mint(owner(), totalSupply);
        _mint(newOwner, totalSupply);
        _transferOwnership(newOwner);

        // --- Exclude Core Addresses From Fees ---
        _setFeeExemption(owner(), true);
        _setFeeExemption(address(this), true);
        _setFeeExemption(address(0xdead), true);
        _setFeeExemption(feeWallets.marketingWallet, true);
    }

    // Receive ETH from the router when swapping.
    receive() external payable {}

    // --- Core Logic ---

    /**
     * @dev Overrides the internal _transfer function to implement custom tax and swap logic.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal override {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");
        require(!_isBlacklisted[from] && !_isBlacklisted[to], "BV: Address is blacklisted.");

        if (amount == 0) {
            super._transfer(from, to, 0);
            return;
        }

        // Enforce trading status
        if (!_isTradingLive) {
            require(_isFeeExempt[from] || _isFeeExempt[to], "BV: Trading is not yet enabled.");
        }
        
        // If we are already in a swap, perform a standard transfer to avoid loops.
        if (_inSwap) {
            super._transfer(from, to, amount);
            return;
        }

        /*
        * Check if conditions are met to trigger an automatic token swap.
        * This is done on transfers and sells, but not on buys (where `from` is a pair).
        */ 
        uint256 contractTokenBalance = balanceOf(address(this));
        bool canSwap = contractTokenBalance >= swapSettings.swapThreshold;
        
        if (
            canSwap &&
            swapSettings.isSwapEnabled &&
            !automatedMarketMakerPairs[from] &&
            !_isFeeExempt[from] &&
            !_isFeeExempt[to]
        ) {
            _swapAndDistributeETH();
        }
        
        // Apply fees to the transaction
        uint256 fees = _handleFees(from, to, amount);
        uint256 transferAmount = amount.sub(fees);

        // Perform the transfer with the adjusted amount
        super._transfer(from, to, transferAmount);
    }

    /**
     * @dev Calculates and collects fees for buy and sell transactions.
     * @return The amount of tokens taken as fees.
     */
    function _handleFees(address from, address to, uint256 amount) private returns (uint256) {
        if (_isFeeExempt[from] || _isFeeExempt[to]) {
            return 0;
        }

        uint256 feePercent = 0;
        if (automatedMarketMakerPairs[to]) { // Sell transaction
            feePercent = taxSettings.sellFeePercent;
        } else if (automatedMarketMakerPairs[from]) { // Buy transaction
            feePercent = taxSettings.buyFeePercent;
        }

        if (feePercent > 0) {
            uint256 feeAmount = amount.mul(feePercent).div(FEE_BASIS_POINTS);
            if (feeAmount > 0) {
                super._transfer(from, address(this), feeAmount);
            }
            return feeAmount;
        }

        return 0;
    }

    // --- Swap and Distribution Logic ---

    /**
     * @dev Main function to swap collected tokens for ETH and distribute to wallets.
     */
    function _swapAndDistributeETH() private lockTheSwap {
        uint256 contractBalance = balanceOf(address(this));
        if (contractBalance == 0) {
            return;
        }

        uint256 amountToSwap = (contractBalance > swapSettings.maxSwapAmount)
            ? swapSettings.maxSwapAmount
            : contractBalance;

        _swapTokensForETH(amountToSwap);
        
        uint256 ethBalance = address(this).balance;
        if (ethBalance > 0) {
            _distributeETH(ethBalance);
            emit SwapAndDistribute(amountToSwap, ethBalance);
        }
    }

    /**
     * @dev Swaps a specific amount of this contract's tokens for ETH.
     */
    function _swapTokensForETH(uint256 tokenAmount) private {
        address[] memory path = new address[](2);
        path[0] = address(this);
        path[1] = uniswapV2Router.WETH();

        _approve(address(this), address(uniswapV2Router), tokenAmount);

        uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
            tokenAmount,
            0, // accept any amount of ETH
            path,
            address(this), // Send ETH to this contract
            block.timestamp
        );
    }

    /**
     * @dev Distributes a given amount of ETH equally between the marketing and dev wallets.
     * for now only dev wallet
     */
    function _distributeETH(uint256 amount) private {
        (bool success, ) = feeWallets.marketingWallet.call{value: amount}("");
        require(success, "BV: Marketing wallet ETH transfer failed");
    }


    // --- Owner Functions ---

    function enableTrading() external onlyOwner {
        _isTradingLive = true;
        swapSettings.isSwapEnabled = true;
    }

    function disableAllFees() external onlyOwner {
        taxSettings.buyFeePercent = 0;
        taxSettings.sellFeePercent = 0;
        emit FeesUpdated(0, 0);
    }

    function updateTaxes(uint256 newBuyFee, uint256 newSellFee) external onlyOwner {
        require(newBuyFee <= 5, "BV: Buy fee cannot exceed 5%");
        require(newSellFee <= 5, "BV: Sell fee cannot exceed 5%");
        taxSettings.buyFeePercent = newBuyFee;
        taxSettings.sellFeePercent = newSellFee;
        emit FeesUpdated(newBuyFee, newSellFee);
    }

    function updateSwapConfiguration(uint256 newThreshold, uint256 newMaxAmount, bool enabled) external onlyOwner {
        swapSettings.swapThreshold = newThreshold;
        swapSettings.maxSwapAmount = newMaxAmount;
        swapSettings.isSwapEnabled = enabled;
    }

    function _setFeeExemption(address account, bool isExempt) internal {
        _isFeeExempt[account] = isExempt;
        emit ExcludeFromFees(account, isExempt);
    }

    function setFeeExemption(address account, bool isExempt) public onlyOwner {
        _setFeeExemption(account, isExempt);
    }

    function manageBlacklist(address[] calldata accounts, bool isBlacklisted) public onlyOwner {
        for (uint256 i = 0; i < accounts.length; i++) {
            _isBlacklisted[accounts[i]] = isBlacklisted;
        }
    }

    function updateFeeWallets(address newMarketingWallet) external onlyOwner {
        require(newMarketingWallet != address(0), "BV: Wallets cannot be zero address");
        feeWallets.marketingWallet = newMarketingWallet;
        emit WalletsUpdated(newMarketingWallet);
    }
    
    function setAutomatedMarketMakerPair(address pair, bool isPair) public onlyOwner {
        require(pair != uniswapV2Pair, "BV: Cannot alter the main pair's status.");
        automatedMarketMakerPairs[pair] = isPair;
    }
    
    // --- Manual & Utility Functions ---

    /**
     * @dev Allows team wallets to manually trigger a token swap.
     */
    function manualSwap(uint256 amount) external lockTheSwap {
        require(_msgSender() == feeWallets.marketingWallet, "BV: Caller is not a team wallet");
        require(amount <= balanceOf(address(this)) && amount > 0, "BV: Invalid amount for swap");
        _swapTokensForETH(amount);
    }

    /**
     * @dev Allows team wallets to manually distribute any ETH held by the contract.
     */
    function manualDistribute() external {
        require(_msgSender() == feeWallets.marketingWallet, "BV: Caller is not a team wallet");
        uint256 ethBalance = address(this).balance;
        require(ethBalance > 0, "BV: No ETH to distribute.");
        _distributeETH(ethBalance);
    }
    
    /**
     * @dev Allows a user to send tokens to multiple addresses in a single transaction.
     */
    function massTransfer(address[] calldata recipients, uint256[] calldata amounts) external {
        require(recipients.length > 0 && recipients.length == amounts.length, "BV: Invalid input arrays");
        for (uint i = 0; i < recipients.length; i++) {
            transfer(recipients[i], amounts[i] * (10**18));
        }
    }
}

Read Contract

allowance 0xdd62ed3e → uint256
automatedMarketMakerPairs 0xb62496f5 → bool
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
feeWallets 0x25379fc3 → address
name 0x06fdde03 → string
owner 0x8da5cb5b → address
swapSettings 0x5e8b5ae3 → uint256, uint256, bool
symbol 0x95d89b41 → string
taxSettings 0x31392fcb → uint256, uint256
totalSupply 0x18160ddd → uint256
uniswapV2Pair 0x49bd5a5e → address
uniswapV2Router 0x1694505e → address

Write Contract 18 functions

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

approve 0x095ea7b3
address spender
uint256 amount
returns: bool
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
disableAllFees 0x741af87f
No parameters
enableTrading 0x8a8c523c
No parameters
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
manageBlacklist 0xfb2f3492
address[] accounts
bool isBlacklisted
manualDistribute 0x4c43e307
No parameters
manualSwap 0xb70143c9
uint256 amount
massTransfer 0x02af2095
address[] recipients
uint256[] amounts
renounceOwnership 0x715018a6
No parameters
setAutomatedMarketMakerPair 0x9a7a23d6
address pair
bool isPair
setFeeExemption 0x751fd179
address account
bool isExempt
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
updateFeeWallets 0xef3f18b6
address newMarketingWallet
updateSwapConfiguration 0xaf81d136
uint256 newThreshold
uint256 newMaxAmount
bool enabled
updateTaxes 0x1006ee0c
uint256 newBuyFee
uint256 newSellFee

Recent Transactions

No transactions found for this address