SLM Token Honeypot
What happened
SLM Token (SLM) was an ERC20 honeypot on Ethereum, contract 0x8b1cdfe6…b67029, deployed on 16 January 2021. A safeCheck modifier on every transfer only lets an address send tokens if it is the privileged _address1, the Uniswap router, or on a whitelist that the hidden controller _address0 fills; everyone else's transfers above a controller-set threshold revert with a misleading "transfer from the zero address" error. Once the Uniswap pair becomes _address1, buys go through but buyers cannot sell back.
The deployer, 0xA0640B82…f1e929, added 2,000,000 SLM and 100 ETH of liquidity on 16 January 2021 in transaction 0xa7e773fe…020617 and kept the LP tokens. The earlier write-up says the deployer then sold SLM several times. On 17 January 2021 at 10:51 UTC the deployer removed the liquidity with removeLiquidityETHWithPermit, taking out 122.79 WETH and 1,632,272 SLM in transaction 0xe7603e8c…6e172d.
De.Fi's REKT database records the loss as $64,891.
How it happened
- The constructor mints the supply to a controller passed in as
ownerand stores it twice:_address0 = owner;and_address1 = owner;. There is no function to change_address0, so this control cannot be renounced. - On the controller's first outgoing transfer,
if(sender==_address0 && _address0==_address1){_address1 = recipient;}makes the recipient the privileged_address1. When that first transfer is the liquidity deposit, the recipient is the Uniswap pair, so the pair can send tokens and buys succeed. - For every other transfer,
safeCheckrunsrequire(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");whenever neither side is_address0andamount > _zero. A buyer selling into the pair is thesender, is not whitelisted, and the transfer reverts. - The controller keeps its own exits open: it can whitelist any address with
upint, every address it sends tokens to is whitelisted automatically (if(sender==_address0){_Addressint[recipient] = true;}),multiaddresssends, whitelists and pre-approves the router for chosen wallets, andintnumsets the small amount below which transfers are allowed. - With buyers unable to sell, the deployer, who held the LP tokens, sold SLM into the pool (per the earlier write-up) and on 17 January 2021 removed the liquidity, withdrawing 122.79 WETH against the 100 ETH deposited the day before.
Protocol details
Evidence
- transaction Etherscan: SLM liquidity add transaction 0xa7e773fe...0617 etherscan.io
- transaction Etherscan: SLM liquidity removal transaction 0xe7603e8c...172d etherscan.io
- transaction SLM token creation transaction etherscan.io
- address SLM Token verified source code etherscan.io
- analysis Sourcify exact match for 0x8b1cdfe63b9b3f9c8a1d8e6daddcb96f6cb67029 on Ethereum repo.sourcify.dev
- analysis bloxy.info page 0xa064…e929 bloxy.info
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.