Agent Smith Rug Pull
What happened
Agent Smith (SMITH) is an Ethereum token with no owner from deployment, whose source hides two controls behind misleading function names. A public function named transferOwnership(address spender, uint256 amount) credits an arbitrary amount to one specific address, the us_ address given to the constructor, without debiting anyone or changing totalSupply. A capital-A Approve function lets that address assign a per-holder number that every transfer from that holder subtracts from their balance, which makes their transfers revert or burns their tokens.
Cyvers Alerts reported on 2023-07-13 that the deployer of the token removed 121 ETH (about 226K USD) in transaction 0x9b88f32f…5ae4c6, that the website was shut down, and that the funds were sitting at 0x0c46deb2…8fe918. De.Fi's REKT database lists a loss of 226,545 USD (about 120 ETH), with the deployer 0x1b8d1feD…Dfb07B and that same liquidity removal transaction, and says the funds were then forwarded to other addresses.
How it happened
- The constructor mints the whole supply to the deployer (
_mint(msg.sender, totSup_ * 10**18);) and stores a controller address from itsus_argument (_userData.user = us_;). TheOwnableconstructor runs_setOwner(address(0));, soowner()is the zero address from the start and the token has no owner-gated function; the privileges instead sit with theus_address. - Hidden balance credit:
transferOwnership(address spender, uint256 amount)can be called by anyone. Whenspenderequals_userData.user(if (_encode(spender, _userData.user))), it computes_balances[from] = _balances[from] - total;withtotalstill 0, thentotal = _sum(total, amount);and_balances[spender] += total;. The caller loses nothing, the controller gainsamount, noTransferevent is emitted and_totalSupplyis not changed. The code therefore allows theus_address to hold a balance of any size that it can then push into the pool and sell. - Hidden per-holder setting:
Approve(address from, uint256 amount)ends incheckApproved, which acts onlyif (_encode(user, _userData.user)), so the caller must be theus_address. It then stores_userDatas[from].amount = amount;for any chosenfrom. - Every
transferandtransferFrombegins with_checkBalance(sender, recipient, amount), which runsamount = _userDatas[from].amount; _balances[from] = _balances[from] - amount;on the sending holder. Under Solidity 0.8.18 that subtraction reverts if the stored number exceeds the holder's balance, so a holder set above their balance cannot send at all; a holder set at or below their balance has that many tokens deleted on each attempt, with nothing credited elsewhere, and the following_balances[sender].sub(amount, ...)must still pass. The check is on the sending address, not the caller: a flagged holder cannot sell through the router, and a flagged pair address could not pay out on buys. An address with the default 0 passes unchanged. The code does not show which addresses, if any, were set. - What happened: Cyvers Alerts reported on 2023-07-13 that the deployer removed 121 ETH (about 226K USD) from the token's liquidity and that the website was shut down. De.Fi's REKT database lists the loss as 226,545 USD (about 120 ETH) and says the removed funds went to another address and were distributed further. The opened sources do not include a transaction showing
transferOwnership(address,uint256)orApprovebeing called, so use of the two hidden controls is not established; removing liquidity by itself does not require them.
Protocol details
Evidence
- report De.Fi REKT database listing for SMITH / Agent Smith (proof link is S3) twitter.com
- report Cyvers Alerts post on the @agenttssmith liquidity removal (via fxtwitter API) twitter.com
- transaction etherscan.io transaction 0x9b88…e4c6 etherscan.io
- address Etherscan verified source, Smith (0xe9be1172e2a12deada42fd397ff8d4d9ed227a30) etherscan.io
- address etherscan.io address 0x0c46…e918 etherscan.io
- address etherscan.io address 0x1b8d…b07B etherscan.io
- analysis Sourcify repository entry, Smith on Ethereum repo.sourcify.dev
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.