Sauron Honeypot
What happened
Sauron (SRN) is an ERC-20 token on Ethereum that blocks ordinary holders from selling and hides a balance-setting backdoor. Its ensure check lets tokens move freely only when the sender is the owner, the Uniswap router or pair, a tradeAddress, or an address flagged in canSale; any other holder's transfer goes through condition, which returns false while the owner's sale limits are all zero, so the transfer reverts. A public function named Approve, callable by the owner or a hard-coded second address, overwrites any account's balance with an arbitrary amount and whitelists it for selling.
On December 9, 2020, address 0xBD0f9a24…E1C764 sold 1,000M SRN, far more than the 10,000 SRN total supply, into the Uniswap pool for about 17.99 ETH in transaction 0xab2c318b…b414b2.
How it happened
- The constructor mints 10,000
SRNto the deployer, stores it as the privateowner, and pre-approves the Uniswap V2 router to spend the owner's tokens. - Buys succeed because
ensurereturns true when_fromis the router or the Uniswap pair computed bypairFor. - A sale moves tokens from the holder, so
ensurefalls through tocondition. With_saleNum,_minSaleand_maxSaleall zero,conditionreturns false andrequire(condition(_from, _value))reverts. The owner can set these limits withinitto allow only narrow sales, for example a maximum number of transfers per address. Approve(spender, addedValue)can be called by the owner or by 0xbd486897…439192 (hard-coded as a decimal number). It setsbalanceOf[spender]toaddedValuetimes 10^18 without changingtotalSupply, and setscanSale[spender] = trueso that account can sell.- The owner can also run arbitrary code in the token's storage through
delegate, which does adelegatecallto any address, and can whitelist another sender through the misleadingly namedTransferownership, which only setstradeAddress. - On 2020-12-09 at 16:48 UTC, 0xBD0f9a24…E1C764 sold 1,000M
SRNthrough the Uniswap router and received about 17.99 ETH from the pool.
Protocol details
Evidence
- report @CaptainJackAPE incident report twitter.com
- transaction Etherscan transaction 0xab2c318b... (swapExactTokensForETH) etherscan.io
- address Sauron (SRN) verified contract source, Etherscan etherscan.io
- analysis Sourcify match, chain 1, 0xf803479D0b762E67aDD90Ad9b8E4aCE54191875b repo.sourcify.dev
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.