Address Contract Verified
Address
0x7A41345d0FD5599e97020378f887921887d2a5fc
Balance
0 ETH
Nonce
1
Code Size
8906 bytes
Creator
0xFEB008ED...Dc39 at tx 0xafd2f32c...041108
Indexed Transactions
0
Contract Bytecode
8906 bytes
0x60806040526004361015610018575b361561001657005b005b5f3560e01c806301339c21146116c357806306fdde0314611608578063095ea7b314611586578063106a5a8f146114e85780631694505e146114a457806318160ddd1461148757806323b872dd146113a85780632b14ca561461138b578063307aebc914611366578063313ce5671461134b5780633bbac5791461130e57806341aea9de146112a6578063470624021461128957806349bd5a5e146112455780634e6fd6c4146112295780634fbee193146111ec578063538ba4f9146111d25780635932ead11461116a57806359512ab0146111025780635cce86cd146110c55780635d0044ca146110575780636ca541e51461103257806370a0823114610ffa57806370db69d614610fdd578063715018a614610f5057806372ac248614610ec6578063790ca41314610ea95780638da5cb5b14610e8257806395927c2514610e2657806395d89b4114610d225780639a7a23d614610c5f5780639c0db5f314610a9e578063a9059cbb14610a6d578063acb2ad6f14610a50578063ad29ffde146109ad578063afa4f3b214610911578063b62496f5146108d4578063b8eb3546146108b7578063bc063e1a1461089c578063c04a541414610874578063cb963728146106af578063d00efb2f14610692578063d26ed3e314610636578063d5759ba314610611578063dcf7aef3146105a6578063dd62ed3e14610556578063e2f4560514610539578063e6c1909b14610514578063ee5ecc891461047a578063ef998cf01461040c578063f2fde38b14610348578063f53bc835146102b7578063f8b45b051461029a5763fd72e22a0361000e5734610296575f366003190112610296576006546040516001600160a01b039091168152602090f35b5f80fd5b34610296575f366003190112610296576020600d54604051908152f35b34610296576020366003190112610296576004356102d36118bc565b6003548060011b9080820460021490151715610334576103e890048110610325576020817f16fd9174d80e7089ed0c10c47c8079476be2ec28b97c4b40846cffd8a7aa9e9f92600b55604051908152a1005b631fbaba3560e01b5f5260045ffd5b634e487b7160e01b5f52601160045260245ffd5b3461029657602036600319011261029657610361611760565b6103696118bc565b6001600160a01b0381169081156103f9575f5461039f91906001600160a01b0316806103e1575b5061039a81612148565b61192f565b5f80546001600160a01b03198116831782556001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3005b806103ee6103f3926120fb565b6118e2565b83610390565b631e4fbdf760e01b5f525f60045260245ffd5b34610296576020366003190112610296576004356104286118bc565b6003548060011b9080820460021490151715610334576103e890048110610325576020817f3c0ac525ebd597ae4e1201e687d8a7424b740a53b775b1527eb1c1936c1bd3b792600c55604051908152a1005b3461029657602036600319011261029657610493611760565b61049b6118bc565b6001600160a01b0316801561050557600680546001600160a01b031981168317909155604080516001600160a01b0393841681529290911660208301527fe20a721838fcbbb3840bd5d97dde1ffeb479fe73d75736fa6fdfc0f220aae0059190819081015b0390a1005b639fabe1c160e01b5f5260045ffd5b34610296575f36600319011261029657602060ff60075460b01c166040519015158152f35b34610296575f366003190112610296576020600e54604051908152f35b346102965760403660031901126102965761056f611760565b610577611776565b6001600160a01b039182165f908152600260209081526040808320949093168252928352819020549051908152f35b34610296576020366003190112610296576004356105c26118bc565b601981116106025760407f5fcc0eea159d45a3b8d481be746c9beed251431a542a5fed4484be37ab783e8d91600f5481600f5582519182526020820152a1005b63cd4e616760e01b5f5260045ffd5b34610296575f36600319011261029657602060ff60075460a01c166040519015158152f35b34610296576020366003190112610296576004356106526118bc565b601981116106025760407f8fd531ce6f3cbc5b8cc01a0413b630e3f11569780ee5cf8d0c78e03bca30bc25916011548160115582519182526020820152a1005b34610296575f366003190112610296576020600854604051908152f35b34610296576020366003190112610296576106c8611760565b6106d06118bc565b6001600160a01b038116806107615750478015610752575f80808084335af16106f761187d565b5015610743577f07c81a5e6d155913a9ed2ce53630058179c89fc94bb5de130620b0245c9f6a0b915b604080516001600160a01b03909216825260208201929092529081908101610500565b633398652560e11b5f5260045ffd5b634870bf9160e01b5f5260045ffd5b6040516370a0823160e01b8152306004820152602081602481855afa908115610828575f91610842575b50809181156108335760405163a9059cbb60e01b81523360048201526024810192909252602090829060449082905f905af18015610828576107f0575b507f07c81a5e6d155913a9ed2ce53630058179c89fc94bb5de130620b0245c9f6a0b91610720565b6020813d602011610820575b81610809602093836117fc565b8101031261029657518015150361029657826107c8565b3d91506107fc565b6040513d5f823e3d90fd5b63df95788360e01b5f5260045ffd5b90506020813d60201161086c575b8161085d602093836117fc565b8101031261029657518361078b565b3d9150610850565b34610296575f366003190112610296576007546040516001600160a01b039091168152602090f35b34610296575f36600319011261029657602060405160198152f35b34610296575f366003190112610296576020600c54604051908152f35b34610296576020366003190112610296576001600160a01b036108f5611760565b165f526015602052602060ff60405f2054166040519015158152f35b346102965760203660031901126102965760043561092d6118bc565b600354801581800460011481171561033457620f42408204831061032557600582029182046005141715610334576103e89004811161099e5760407f190dc7c30bc62ef30e35c5f5512ad715a1bd03230f2d89c965249246c8d8ecca91600e5481600e5582519182526020820152a1005b63fd7850ad60e01b5f5260045ffd5b34610296576109bb3661179b565b906109c46118bc565b5f5b8181106109cf57005b807f9d8f7706ea1113d1a167b526eca956215946dd36cc7df39eb16180222d8b5df784610a07610a02600195878a611832565b611856565b848060a01b0381165f526013602052610a2f8260405f209060ff801983541691151516179055565b604080516001600160a01b039290921682529115156020820152a1016109c6565b34610296575f366003190112610296576020601154604051908152f35b3461029657604036600319011261029657610a93610a89611760565b6024359033611980565b602060405160018152f35b3461029657610aac3661179b565b9091610ab66118bc565b5f5b838110610ac157005b6001906001600160a01b03610ada610a02838887611832565b165f52601560205260ff60405f2054161580610c19575b80610bfa575b80610bdd575b80610b86575b610b0e575b01610ab8565b7ff7f8b40d08076851dfb7cfd6c584ae9a829a570f264abee45e0d7ca342ae8dc884610b3e610a02848988611832565b848060a01b0381165f526012602052610b668260405f209060ff801983541691151516179055565b604080516001600160a01b039290921682529115156020820152a1610b08565b50818060a01b03610b9b610a02838887611832565b165f52601360205260ff60405f205416158015610b035750818060a01b03610bc7610a02838887611832565b165f52601460205260ff60405f20541615610b03565b50818060a01b03610bf2610a02838887611832565b161515610afd565b50610c09610a02828786611832565b3090838060a01b03161415610af7565b50610c28610a02828786611832565b828060a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d1690838060a01b03161415610af1565b3461029657604036600319011261029657610c78611760565b602435801515810361029657610c8c6118bc565b6001600160a01b0382165f8181526015602052604090205490929060ff16610d13577fffa9187bf1f18bf477bd0ea1bcbb64e93b6a98132473929edfce215cd9b16fab925f526015602052610cf08260405f209060ff801983541691151516179055565b604080516001600160a01b03909216825291151560208201529081908101610500565b6304eb79b560e31b5f5260045ffd5b34610296575f366003190112610296576040515f6005548060011c90600181168015610e1c575b602083108114610e0857828552908115610de45750600114610d86575b610d8283610d76818503826117fc565b60405191829182611736565b0390f35b91905060055f527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0915f905b808210610dca57509091508101602001610d76610d66565b919260018160209254838588010152019101909291610db2565b60ff191660208086019190915291151560051b84019091019150610d769050610d66565b634e487b7160e01b5f52602260045260245ffd5b91607f1691610d49565b3461029657602036600319011261029657600435610e426118bc565b601981116106025760407f125b37650f21d088600cef1223439f6a8bd70800debfd486c503a8a2d19d4b01916010548160105582519182526020820152a1005b34610296575f366003190112610296575f546040516001600160a01b039091168152602090f35b34610296575f366003190112610296576020600954604051908152f35b3461029657602036600319011261029657610edf611760565b610ee76118bc565b6001600160a01b0316801561050557600780546001600160a01b031981168317909155604080516001600160a01b0393841681529290911660208301527f2b355c7f17401d9755d704a4cf6149a26deb56a381bb5d06c87b608183dbe09c919081908101610500565b34610296575f36600319011261029657610f686118bc565b5f546001600160a01b031680610fca575b610f825f612148565b610f8b5f61192f565b5f80546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b806103ee610fd7926120fb565b80610f79565b34610296575f366003190112610296576020600b54604051908152f35b34610296576020366003190112610296576001600160a01b0361101b611760565b165f526001602052602060405f2054604051908152f35b34610296575f36600319011261029657602060ff60075460a81c166040519015158152f35b34610296576020366003190112610296576004356110736118bc565b600354600381029080820460031490151715610334576103e890048110610325576020817fa2c87c3e7a3048198ae94e814f6a27e12a4e2a7476e33a0db4d97ffeaf63618692600d55604051908152a1005b34610296576020366003190112610296576001600160a01b036110e6611760565b165f526014602052602060ff60405f2054166040519015158152f35b34610296576020366003190112610296577f06cf69227e5c2b5a71319bc3784f6a5355ea0ba2a69bc4c39d64413dfa5a012b602061113e61178c565b6111466118bc565b151560075460ff60b01b8260b01b169060ff60b01b191617600755604051908152a1005b34610296576020366003190112610296577f381fb4c4aa72df83c60e7e567b9b6faf3fc2b05a6da932da9f071d63442c828f60206111a661178c565b6111ae6118bc565b151560075460ff60a81b8260a81b169060ff60a81b191617600755604051908152a1005b34610296575f3660031901126102965760206040515f8152f35b34610296576020366003190112610296576001600160a01b0361120d611760565b165f526013602052602060ff60405f2054166040519015158152f35b34610296575f36600319011261029657602060405161dead8152f35b34610296575f366003190112610296576040517f00000000000000000000000000040c9a74105fca1bce2151943749adab86cce16001600160a01b03168152602090f35b34610296575f366003190112610296576020600f54604051908152f35b34610296576020366003190112610296577ff771b1e218dc92494b39e21852f9c24c3b448d6697c2b485cc1f0cff3c9ec78160206112e261178c565b6112ea6118bc565b151560075460ff60a01b8260a01b169060ff60a01b191617600755604051908152a1005b34610296576020366003190112610296576001600160a01b0361132f611760565b165f526012602052602060ff60405f2054166040519015158152f35b34610296575f36600319011261029657602060405160128152f35b34610296575f36600319011261029657602060ff60075460c01c166040519015158152f35b34610296575f366003190112610296576020601054604051908152f35b34610296576060366003190112610296576113c1611760565b6113c9611776565b6001600160a01b0382165f8181526002602090815260408083203384529091529020549092604435929160018101611407575b50610a939350611980565b83811061146c57841561145957331561144657610a93945f52600260205260405f2060018060a01b0333165f526020528360405f2091039055846113fc565b634a1406b160e11b5f525f60045260245ffd5b63e602df0560e01b5f525f60045260245ffd5b8390637dc7a0d960e11b5f523360045260245260445260645ffd5b34610296575f366003190112610296576020600354604051908152f35b34610296575f366003190112610296576040517f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b03168152602090f35b34610296576114f63661179b565b906114ff6118bc565b5f5b81811061150a57005b807f4b89c347592b1d537e066cb4ed98d87696ae35164745d7e370e4add16941dc928461153d610a02600195878a611832565b848060a01b0381165f5260146020526115658260405f209060ff801983541691151516179055565b604080516001600160a01b039290921682529115156020820152a101611501565b346102965760403660031901126102965761159f611760565b602435903315611459576001600160a01b031690811561144657335f52600260205260405f20825f526020528060405f20556040519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560203392a3602060405160018152f35b34610296575f366003190112610296576040515f6004548060011c906001811680156116b9575b602083108114610e0857828552908115610de4575060011461165b57610d8283610d76818503826117fc565b91905060045f527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b915f905b80821061169f57509091508101602001610d76610d66565b919260018160209254838588010152019101909291611687565b91607f169161162f565b34610296575f366003190112610296576116db6118bc565b60075460ff8160c01c166117275760ff60c01b1916600160c01b1760075543600855426009557f02ac8168caf2f254b394bd39e19417c5c28124ab89c9bc2d44921b19808e26695f80a1005b6319f4db0f60e31b5f5260045ffd5b602060409281835280519182918282860152018484015e5f828201840152601f01601f1916010190565b600435906001600160a01b038216820361029657565b602435906001600160a01b038216820361029657565b60043590811515820361029657565b9060406003198301126102965760043567ffffffffffffffff811161029657826023820112156102965780600401359267ffffffffffffffff84116102965760248460051b8301011161029657602401919060243580151581036102965790565b90601f8019910116810190811067ffffffffffffffff82111761181e57604052565b634e487b7160e01b5f52604160045260245ffd5b91908110156118425760051b0190565b634e487b7160e01b5f52603260045260245ffd5b356001600160a01b03811681036102965790565b8181029291811591840414171561033457565b3d156118b7573d9067ffffffffffffffff821161181e57604051916118ac601f8201601f1916602001846117fc565b82523d5f602084013e565b606090565b5f546001600160a01b031633036118cf57565b63118cdaa760e01b5f523360045260245ffd5b60407f4b89c347592b1d537e066cb4ed98d87696ae35164745d7e370e4add16941dc929160018060a01b0316805f526014602052815f2060ff19815416905581519081525f6020820152a1565b60407f4b89c347592b1d537e066cb4ed98d87696ae35164745d7e370e4add16941dc929160018060a01b0316805f526014602052815f20600160ff19825416179055815190815260016020820152a1565b6001600160a01b0381169291905f84156120e8576001600160a01b0383169384156120d5578094865f52601260205260ff60405f20541661208f5786331480156120be575b1561208f5786321480156120b5575b801561209e575b1561208f5760075460ff8160c01c168015612079575b8015612063575b156120545760ff8160a01c1680612046575b80612012575b611dd6575b506007549160ff8360b01c169283611dc7575b5082611d91575b82611c9f575b5050305f52600160205260405f205490600e549681611c87575b5080611c7d575b611a69575b5050611a6793506121b3565b565b600a54431115611a5b576007805460ff60b81b1916600160b81b1790556040519581611a966060896117fc565b6002885260208801916040368437885115611842573083526040516315ab88c960e31b81527f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b03169490602081600481895afa908115610828575f91611c3b575b508a5160011015611842576001600160a01b031660408b015260148281029280159084049091141715610334578110611c33575b50823b1561029657969060405197889263791ac94760e01b845260a484019160048501525f602485015260a060448501525180915260c4830191905f5b818110611c115750505091815f81819530606483015242608483015203925af194851561082857611a6795611bfe575b508080804781808080611bb6600586048096612199565b6006546001600160a01b03165af150611bcd61187d565b506007546001600160a01b03165af150611be561187d565b506007805460ff60b81b1916905543600a555f80611a5b565b611c0a91505f906117fc565b5f80611b9f565b82516001600160a01b031684528a945060209384019390920191600101611b6f565b90505f611b32565b90506020813d602011611c75575b81611c56602093836117fc565b8101031261029657516001600160a01b0381168103610296575f611afe565b3d9150611c49565b5085811015611a56565b90505f52601560205260ff60405f205416155f611a4f565b5f91805f52601560205260ff60405f20541680611d86575b15611cf5575090506064611ccd6010548361186a565b04905b8115611a355781611cee929750611ce691612199565b9530856121b3565b5f80611a35565b885f52601560205260ff60405f20541680611d7b575b15611d28575090506064611d21600f548361186a565b0490611cd0565b5f52601560205260ff60405f2054161580611d64575b80611d59575b15611cd05790506064611d216011548361186a565b506011541515611d44565b50875f52601560205260ff60405f20541615611d3e565b50600f541515611d0b565b506010541515611cb7565b9150865f52601360205260ff60405f2054168015611db1575b1591611a2f565b50805f52601360205260ff60405f205416611daa565b60b81c60ff161592505f611a28565b5f546001600160a01b0316888114159081612007575b5080611fff575b80611ff3575b15611a155760a81c60ff16611f19575b865f52601560205260ff60405f20541680611f02575b15611e7057600b548211611e6157805f526001602052611e4360405f2054836121a6565b600d5410611e52575b5f611a15565b63d867451160e01b5f5260045ffd5b632c676b8560e21b5f5260045ffd5b805f52601560205260ff60405f20541680611eeb575b15611ea957600c548211611e9a575b611e4c565b6338aa438560e21b5f5260045ffd5b805f52601460205260ff60405f205416611e4c57805f526001602052611ed360405f2054836121a6565b600d541015611e955763d867451160e01b5f5260045ffd5b50865f52601460205260ff60405f20541615611e86565b50805f52601460205260ff60405f20541615611e1f565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031681141580611fc0575b15611e0957325f52601660205260405f20546002194301904382116103345781119081611faa575b5015611f9b57325f5260166020524360405f2055805f5260166020524360405f2055611e09565b630301a6ed60e61b5f5260045ffd5b9050815f52601660205260405f2054105f611f74565b507f00000000000000000000000000040c9a74105fca1bce2151943749adab86cce16001600160a01b0316811415611f4c565b5061dead821415611df9565b506001611df3565b90508214155f611dec565b50875f52601460205260ff60405f2054168015612030575b15611a10565b50815f52601460205260ff60405f20541661202a565b5060ff8160b81c1615611a0a565b638dda39df60e01b5f5260045ffd5b50815f52601460205260ff60405f2054166119f8565b50875f52601460205260ff60405f2054166119f1565b6339a9b03560e21b5f5260045ffd5b50325f52601260205260ff60405f205416156119db565b503332146119d4565b50335f52601260205260ff60405f205416156119c5565b63ec442f0560e01b5f525f60045260245ffd5b634b637e8f60e11b5f525f60045260245ffd5b60407f9d8f7706ea1113d1a167b526eca956215946dd36cc7df39eb16180222d8b5df79160018060a01b0316805f526013602052815f2060ff19815416905581519081525f6020820152a1565b60407f9d8f7706ea1113d1a167b526eca956215946dd36cc7df39eb16180222d8b5df79160018060a01b0316805f526013602052815f20600160ff19825416179055815190815260016020820152a1565b9190820391821161033457565b9190820180921161033457565b6001600160a01b0316908161222d5760207fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef916121f2856003546121a6565b6003555b6001600160a01b031693846122175780600354036003555b604051908152a3565b845f526001825260405f2081815401905561220e565b815f52600160205260405f2054838110612279577fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9184602092855f52600184520360405f20556121f6565b91905063391434e360e21b5f5260045260245260445260645ffdfea2646970667358221220502e391b84d6fcef5fc2424fbdc0ba24412f849cc792da5cd1bcc5c1749cfb4b64736f6c634300081a0033
Verified Source Code Full Match
Compiler: v0.8.26+commit.8a97fa7a
EVM: cancun
Optimization: Yes (200 runs)
StackAIToken.sol 1221 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender)
external
view
returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 value
) external returns (bool);
}
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol)
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
/**
* @dev Standard ERC20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
*/
interface IERC20Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientBalance(
address sender,
uint256 balance,
uint256 needed
);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC20InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC20InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
* @param spender Address that may be allowed to operate on tokens without being their owner.
* @param allowance Amount of tokens a `spender` is allowed to operate with.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientAllowance(
address spender,
uint256 allowance,
uint256 needed
);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC20InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.
* @param spender Address that may be allowed to operate on tokens without being their owner.
*/
error ERC20InvalidSpender(address spender);
}
/**
* @dev Standard ERC721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
* Used in balance queries.
* @param owner Address of the current owner of a token.
*/
error ERC721InvalidOwner(address owner);
/**
* @dev Indicates a `tokenId` whose `owner` is the zero address.
* @param tokenId Identifier number of a token.
*/
error ERC721NonexistentToken(uint256 tokenId);
/**
* @dev Indicates an error related to the ownership over a particular token. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param tokenId Identifier number of a token.
* @param owner Address of the current owner of a token.
*/
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC721InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC721InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param tokenId Identifier number of a token.
*/
error ERC721InsufficientApproval(address operator, uint256 tokenId);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC721InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC721InvalidOperator(address operator);
}
/**
* @dev Standard ERC1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
*/
interface IERC1155Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
* @param tokenId Identifier number of a token.
*/
error ERC1155InsufficientBalance(
address sender,
uint256 balance,
uint256 needed,
uint256 tokenId
);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC1155InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC1155InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param owner Address of the current owner of a token.
*/
error ERC1155MissingApprovalForAll(address operator, address owner);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC1155InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC1155InvalidOperator(address operator);
/**
* @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
* Used in batch transfers.
* @param idsLength Length of the array of token identifiers
* @param valuesLength Length of the array of token amounts
*/
error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
*
* TIP: For a detailed writeup see our guide
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*/
abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the default value returned by this function, unless
* it's overridden.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `value`.
*/
function transfer(address to, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_transfer(owner, to, value);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender)
public
view
virtual
returns (uint256)
{
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `value` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 value)
public
virtual
returns (bool)
{
address owner = _msgSender();
_approve(owner, spender, value);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `value`.
* - the caller must have allowance for ``from``'s tokens of at least
* `value`.
*/
function transferFrom(
address from,
address to,
uint256 value
) public virtual returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, value);
_transfer(from, to, value);
return true;
}
/**
* @dev Moves a `value` amount of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _transfer(
address from,
address to,
uint256 value
) internal {
if (from == address(0)) {
revert ERC20InvalidSender(address(0));
}
if (to == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(from, to, value);
}
/**
* @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
* (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
* this function.
*
* Emits a {Transfer} event.
*/
function _update(
address from,
address to,
uint256 value
) internal virtual {
if (from == address(0)) {
// Overflow check required: The rest of the code assumes that totalSupply never overflows
_totalSupply += value;
} else {
uint256 fromBalance = _balances[from];
if (fromBalance < value) {
revert ERC20InsufficientBalance(from, fromBalance, value);
}
unchecked {
// Overflow not possible: value <= fromBalance <= totalSupply.
_balances[from] = fromBalance - value;
}
}
if (to == address(0)) {
unchecked {
// Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
_totalSupply -= value;
}
} else {
unchecked {
// Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
_balances[to] += value;
}
}
emit Transfer(from, to, value);
}
/**
* @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
* Relies on the `_update` mechanism
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _mint(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(address(0), account, value);
}
/**
* @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
* Relies on the `_update` mechanism.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead
*/
function _burn(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidSender(address(0));
}
_update(account, address(0), value);
}
/**
* @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*
* Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
*/
function _approve(
address owner,
address spender,
uint256 value
) internal {
_approve(owner, spender, value, true);
}
/**
* @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
*
* By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
* `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
* `Approval` event during `transferFrom` operations.
*
* Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
* true using the following override:
* ```
* function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
* super._approve(owner, spender, value, true);
* }
* ```
*
* Requirements are the same as {_approve}.
*/
function _approve(
address owner,
address spender,
uint256 value,
bool emitEvent
) internal virtual {
if (owner == address(0)) {
revert ERC20InvalidApprover(address(0));
}
if (spender == address(0)) {
revert ERC20InvalidSpender(address(0));
}
_allowances[owner][spender] = value;
if (emitEvent) {
emit Approval(owner, spender, value);
}
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `value`.
*
* Does not update the allowance value in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Does not emit an {Approval} event.
*/
function _spendAllowance(
address owner,
address spender,
uint256 value
) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
if (currentAllowance < value) {
revert ERC20InsufficientAllowance(
spender,
currentAllowance,
value
);
}
unchecked {
_approve(owner, spender, currentAllowance - value, false);
}
}
}
}
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
contract StackAIToken is Ownable, ERC20 {
IUniswapV2Router public immutable uniswapV2Router;
address public constant ZERO_ADDRESS = address(0);
address public constant DEAD_ADDRESS = address(0xdEaD);
address public immutable uniswapV2Pair;
address public operationsWallet;
address public developmentWallet;
bool public isLimitsEnabled;
bool public isCooldownEnabled;
bool public isTaxEnabled;
bool private inSwapBack;
bool public isLaunched;
uint256 public launchBlock;
uint256 public launchTime;
uint256 private lastSwapBackExecutionBlock;
uint256 public constant MAX_FEE = 25;
uint256 public maxBuy;
uint256 public maxSell;
uint256 public maxWallet;
uint256 public swapTokensAtAmount;
uint256 public buyFee;
uint256 public sellFee;
uint256 public transferFee;
mapping(address => bool) public isBot;
mapping(address => bool) public isExcludedFromFees;
mapping(address => bool) public isExcludedFromLimits;
mapping(address => bool) public automatedMarketMakerPairs;
mapping(address => uint256) private _holderLastTransferTimestamp;
event Launch();
event SetOperationsWallet(address newWallet, address oldWallet);
event SetDevelopmentWallet(address newWallet, address oldWallet);
event SetLimitsEnabled(bool status);
event SetCooldownEnabled(bool status);
event SetTaxesEnabled(bool status);
event SetMaxBuy(uint256 amount);
event SetMaxSell(uint256 amount);
event SetMaxWallet(uint256 amount);
event SetSwapTokensAtAmount(uint256 newValue, uint256 oldValue);
event SetBuyFees(uint256 newValue, uint256 oldValue);
event SetSellFees(uint256 newValue, uint256 oldValue);
event SetTransferFees(uint256 newValue, uint256 oldValue);
event ExcludeFromFees(address account, bool isExcluded);
event ExcludeFromLimits(address account, bool isExcluded);
event SetBots(address account, bool isExcluded);
event SetAutomatedMarketMakerPair(address pair, bool value);
event WithdrawStuckTokens(address token, uint256 amount);
error AlreadyLaunched();
error AddressZero();
error AmountTooLow();
error AmountTooHigh();
error FeeTooHigh();
error AMMAlreadySet();
error NoNativeTokens();
error NoTokens();
error FailedToWithdrawNativeTokens();
error BotDetected();
error TransferDelay();
error MaxBuyAmountExceed();
error MaxSellAmountExceed();
error MaxWalletAmountExceed();
error NotLaunched();
modifier lockSwapBack() {
inSwapBack = true;
_;
inSwapBack = false;
}
constructor() Ownable(msg.sender) ERC20("Stack AI", "STACK") {
address sender = msg.sender;
_mint(sender, 1_000_000_000 ether);
uint256 totalSupply = totalSupply();
operationsWallet = 0x77e46F302D5270e00Bbb5DFAD14D6ff123B65FF3;
developmentWallet = 0xa43d9E984a1e96696B868CCcCdCbeBa1177Ade6B;
maxBuy = (totalSupply * 13) / 1000;
maxSell = (totalSupply * 13) / 1000;
maxWallet = (totalSupply * 13) / 1000;
swapTokensAtAmount = (totalSupply * 5) / 10000;
isLimitsEnabled = true;
isCooldownEnabled = true;
isTaxEnabled = true;
buyFee = 25;
sellFee = 25;
transferFee = 50;
uniswapV2Router = IUniswapV2Router(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(
address(this),
uniswapV2Router.WETH()
);
_setAutomatedMarketMakerPair(uniswapV2Pair, true);
_approve(address(this), address(uniswapV2Router), type(uint256).max);
_excludeFromFees(address(this), true);
_excludeFromFees(DEAD_ADDRESS, true);
_excludeFromFees(sender, true);
_excludeFromFees(operationsWallet, true);
_excludeFromFees(developmentWallet, true);
_excludeFromLimits(address(this), true);
_excludeFromLimits(DEAD_ADDRESS, true);
_excludeFromLimits(sender, true);
_excludeFromLimits(operationsWallet, true);
_excludeFromLimits(developmentWallet, true);
}
receive() external payable {}
fallback() external payable {}
function _transferOwnership(address newOwner) internal override {
address oldOwner = owner();
if (oldOwner != address(0)) {
_excludeFromFees(oldOwner, false);
_excludeFromLimits(oldOwner, false);
}
_excludeFromFees(newOwner, true);
_excludeFromLimits(newOwner, true);
super._transferOwnership(newOwner);
}
function launch() external onlyOwner {
require(!isLaunched, AlreadyLaunched());
isLaunched = true;
launchBlock = block.number;
launchTime = block.timestamp;
emit Launch();
}
function setOperationsWallet(address _operationsWallet) external onlyOwner {
require(_operationsWallet != address(0), AddressZero());
address oldWallet = operationsWallet;
operationsWallet = _operationsWallet;
emit SetOperationsWallet(operationsWallet, oldWallet);
}
function setDevelopmentWallet(address _developmentWallet)
external
onlyOwner
{
require(_developmentWallet != address(0), AddressZero());
address oldWallet = developmentWallet;
developmentWallet = _developmentWallet;
emit SetDevelopmentWallet(developmentWallet, oldWallet);
}
function setLimitsEnabled(bool value) external onlyOwner {
isLimitsEnabled = value;
emit SetLimitsEnabled(value);
}
function setCooldownEnabled(bool value) external onlyOwner {
isCooldownEnabled = value;
emit SetCooldownEnabled(value);
}
function setTaxesEnabled(bool value) external onlyOwner {
isTaxEnabled = value;
emit SetTaxesEnabled(value);
}
function setMaxBuy(uint256 amount) external onlyOwner {
require(amount >= ((totalSupply() * 2) / 1000), AmountTooLow());
maxBuy = amount;
emit SetMaxBuy(maxBuy);
}
function setMaxSell(uint256 amount) external onlyOwner {
require(amount >= ((totalSupply() * 2) / 1000), AmountTooLow());
maxSell = amount;
emit SetMaxSell(maxSell);
}
function setMaxWallet(uint256 amount) external onlyOwner {
require(amount >= ((totalSupply() * 3) / 1000), AmountTooLow());
maxWallet = amount;
emit SetMaxWallet(maxWallet);
}
function setSwapTokensAtAmount(uint256 amount) external onlyOwner {
uint256 _totalSupply = totalSupply();
require(amount >= (_totalSupply * 1) / 1000000, AmountTooLow());
require(amount <= (_totalSupply * 5) / 1000, AmountTooHigh());
uint256 oldValue = swapTokensAtAmount;
swapTokensAtAmount = amount;
emit SetSwapTokensAtAmount(amount, oldValue);
}
function setBuyFees(uint256 _buyFee) external onlyOwner {
require(_buyFee <= MAX_FEE, FeeTooHigh());
uint256 oldValue = buyFee;
buyFee = _buyFee;
emit SetBuyFees(_buyFee, oldValue);
}
function setSellFees(uint256 _sellFee) external onlyOwner {
require(_sellFee <= MAX_FEE, FeeTooHigh());
uint256 oldValue = sellFee;
sellFee = _sellFee;
emit SetSellFees(_sellFee, oldValue);
}
function setTransferFees(uint256 _transferFee) external onlyOwner {
require(_transferFee <= MAX_FEE, FeeTooHigh());
uint256 oldValue = transferFee;
transferFee = _transferFee;
emit SetTransferFees(_transferFee, oldValue);
}
function excludeFromFees(address[] calldata accounts, bool value)
external
onlyOwner
{
for (uint256 i = 0; i < accounts.length; i++) {
_excludeFromFees(accounts[i], value);
}
}
function excludeFromLimits(address[] calldata accounts, bool value)
external
onlyOwner
{
for (uint256 i = 0; i < accounts.length; i++) {
_excludeFromLimits(accounts[i], value);
}
}
function setBots(address[] calldata accounts, bool value)
external
onlyOwner
{
for (uint256 i = 0; i < accounts.length; i++) {
if (
(!automatedMarketMakerPairs[accounts[i]]) &&
(accounts[i] != address(uniswapV2Router)) &&
(accounts[i] != address(this)) &&
(accounts[i] != ZERO_ADDRESS) &&
(!isExcludedFromFees[accounts[i]] &&
!isExcludedFromLimits[accounts[i]])
) _setBots(accounts[i], value);
}
}
function setAutomatedMarketMakerPair(address pair, bool value)
external
onlyOwner
{
require(!automatedMarketMakerPairs[pair], AMMAlreadySet());
_setAutomatedMarketMakerPair(pair, value);
}
function withdrawStuckTokens(address _token) external onlyOwner {
address sender = msg.sender;
uint256 amount;
if (_token == ZERO_ADDRESS) {
bool success;
amount = address(this).balance;
require(amount > 0, NoNativeTokens());
(success, ) = address(sender).call{value: amount}("");
require(success, FailedToWithdrawNativeTokens());
} else {
amount = IERC20(_token).balanceOf(address(this));
require(amount > 0, NoTokens());
IERC20(_token).transfer(msg.sender, amount);
}
emit WithdrawStuckTokens(_token, amount);
}
function _update(
address from,
address to,
uint256 amount
) internal virtual override {
address sender = msg.sender;
address origin = tx.origin;
uint256 blockNumber = block.number;
require(!isBot[from], BotDetected());
require(sender == from || !isBot[sender], BotDetected());
require(
origin == from || origin == sender || !isBot[origin],
BotDetected()
);
require(
isLaunched ||
isExcludedFromLimits[from] ||
isExcludedFromLimits[to],
NotLaunched()
);
bool limits = isLimitsEnabled &&
!inSwapBack &&
!(isExcludedFromLimits[from] || isExcludedFromLimits[to]);
if (limits) {
if (
from != owner() &&
to != owner() &&
to != ZERO_ADDRESS &&
to != DEAD_ADDRESS
) {
if (isCooldownEnabled) {
if (to != address(uniswapV2Router) && to != uniswapV2Pair) {
require(
_holderLastTransferTimestamp[origin] <
blockNumber - 3 &&
_holderLastTransferTimestamp[to] <
blockNumber - 3,
TransferDelay()
);
_holderLastTransferTimestamp[origin] = blockNumber;
_holderLastTransferTimestamp[to] = blockNumber;
}
}
if (
automatedMarketMakerPairs[from] && !isExcludedFromLimits[to]
) {
require(amount <= maxBuy, MaxBuyAmountExceed());
require(
amount + balanceOf(to) <= maxWallet,
MaxWalletAmountExceed()
);
} else if (
automatedMarketMakerPairs[to] && !isExcludedFromLimits[from]
) {
require(amount <= maxSell, MaxSellAmountExceed());
} else if (!isExcludedFromLimits[to]) {
require(
amount + balanceOf(to) <= maxWallet,
MaxWalletAmountExceed()
);
}
}
}
bool takeFee = isTaxEnabled &&
!inSwapBack &&
!(isExcludedFromFees[from] || isExcludedFromFees[to]);
if (takeFee) {
uint256 fees = 0;
if (automatedMarketMakerPairs[to] && sellFee > 0) {
fees = (amount * sellFee) / 100;
} else if (automatedMarketMakerPairs[from] && buyFee > 0) {
fees = (amount * buyFee) / 100;
} else if (
!automatedMarketMakerPairs[to] &&
!automatedMarketMakerPairs[from] &&
transferFee > 0
) {
fees = (amount * transferFee) / 100;
}
if (fees > 0) {
amount -= fees;
super._update(from, address(this), fees);
}
}
uint256 balance = balanceOf(address(this));
bool shouldSwap = balance >= swapTokensAtAmount;
if (takeFee && !automatedMarketMakerPairs[from] && shouldSwap) {
if (blockNumber > lastSwapBackExecutionBlock) {
_swapBack(balance);
lastSwapBackExecutionBlock = blockNumber;
}
}
super._update(from, to, amount);
}
function _swapBack(uint256 balance) internal virtual lockSwapBack {
bool success;
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
uint256 maxSwapAmount = swapTokensAtAmount * 20;
if (balance > maxSwapAmount) {
balance = maxSwapAmount;
}
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
balance,
0,
path,
address(this),
block.timestamp
);
uint256 ethBalance = address(this).balance;
uint256 ethForDevelopment = ethBalance / 5;
uint256 ethForOperations = ethBalance - ethForDevelopment;
(success, ) = address(operationsWallet).call{value: ethForOperations}(
""
);
(success, ) = address(developmentWallet).call{value: ethForDevelopment}(
""
);
}
function _excludeFromFees(address account, bool value) internal virtual {
isExcludedFromFees[account] = value;
emit ExcludeFromFees(account, value);
}
function _excludeFromLimits(address account, bool value) internal virtual {
isExcludedFromLimits[account] = value;
emit ExcludeFromLimits(account, value);
}
function _setBots(address account, bool value) internal virtual {
isBot[account] = value;
emit SetBots(account, value);
}
function _setAutomatedMarketMakerPair(address pair, bool value)
internal
virtual
{
automatedMarketMakerPairs[pair] = value;
emit SetAutomatedMarketMakerPair(pair, value);
}
}
Read Contract
DEAD_ADDRESS 0x4e6fd6c4 → address
MAX_FEE 0xbc063e1a → uint256
ZERO_ADDRESS 0x538ba4f9 → address
allowance 0xdd62ed3e → uint256
automatedMarketMakerPairs 0xb62496f5 → bool
balanceOf 0x70a08231 → uint256
buyFee 0x47062402 → uint256
decimals 0x313ce567 → uint8
developmentWallet 0xc04a5414 → address
isBot 0x3bbac579 → bool
isCooldownEnabled 0x6ca541e5 → bool
isExcludedFromFees 0x4fbee193 → bool
isExcludedFromLimits 0x5cce86cd → bool
isLaunched 0x307aebc9 → bool
isLimitsEnabled 0xd5759ba3 → bool
isTaxEnabled 0xe6c1909b → bool
launchBlock 0xd00efb2f → uint256
launchTime 0x790ca413 → uint256
maxBuy 0x70db69d6 → uint256
maxSell 0xb8eb3546 → uint256
maxWallet 0xf8b45b05 → uint256
name 0x06fdde03 → string
operationsWallet 0xfd72e22a → address
owner 0x8da5cb5b → address
sellFee 0x2b14ca56 → uint256
swapTokensAtAmount 0xe2f45605 → uint256
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
transferFee 0xacb2ad6f → uint256
uniswapV2Pair 0x49bd5a5e → address
uniswapV2Router 0x1694505e → address
Write Contract 23 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 value
returns: bool
excludeFromFees 0xad29ffde
address[] accounts
bool value
excludeFromLimits 0x106a5a8f
address[] accounts
bool value
launch 0x01339c21
No parameters
renounceOwnership 0x715018a6
No parameters
setAutomatedMarketMakerPair 0x9a7a23d6
address pair
bool value
setBots 0x9c0db5f3
address[] accounts
bool value
setBuyFees 0xdcf7aef3
uint256 _buyFee
setCooldownEnabled 0x5932ead1
bool value
setDevelopmentWallet 0x72ac2486
address _developmentWallet
setLimitsEnabled 0x41aea9de
bool value
setMaxBuy 0xf53bc835
uint256 amount
setMaxSell 0xef998cf0
uint256 amount
setMaxWallet 0x5d0044ca
uint256 amount
setOperationsWallet 0xee5ecc89
address _operationsWallet
setSellFees 0x95927c25
uint256 _sellFee
setSwapTokensAtAmount 0xafa4f3b2
uint256 amount
setTaxesEnabled 0x59512ab0
bool value
setTransferFees 0xd26ed3e3
uint256 _transferFee
transfer 0xa9059cbb
address to
uint256 value
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool
transferOwnership 0xf2fde38b
address newOwner
withdrawStuckTokens 0xcb963728
address _token
Recent Transactions
No transactions found for this address