Shiba Diamond Honeypot

Reported loss Not disclosed
BNB Chain
Honeypot

What happened

Shiba Diamond (SHIBA) is a BNB Smart Chain token whose transfer and transferFrom both run through a burnTokenCheck modifier. The modifier lets the owner, the address stored as _safeOwner, any transfer to the owner, and owner-whitelisted addresses move tokens freely. Every other holder can only send tokens to the hard-coded _unirouter address or send an amount below _sellAmount, which starts at 0, so a sale into the trading pair reverts until the owner sets that threshold.

De.Fi's REKT database lists the token as an exit scam/honeypot in which the owner could disable transfers and restrict users from selling; no sale attempt, transaction or loss figure was opened for this record.

How it happened

What the code allows:

  1. The constructor sets _safeOwner = owner and _sellAmount starts at 0. _unirouter is hard-coded as 0x10ED43C7…56024E.
  2. The modifier's first branch is if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}. The owner's first transfer therefore stores its recipient as _safeOwner; if that transfer is the liquidity deposit, the recipient is the trading pair.
  3. After that, a second branch passes any transfer where sender == _owner || sender == _safeOwner || recipient == _owner. If _safeOwner is the pair, tokens leaving the pair (purchases) always pass.
  4. For all other senders, _whiteAddress[sender] == true passes with any recipient. The owner fills the whitelist through increaseAllowance(address[]) and through multiTransfer, which also gives the first approvecount receivers a maximum allowance for _unirouter.
  5. A sender that is neither whitelisted nor blacklisted reaches if (amount < _sellAmount){...; _; }else{require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}. With _sellAmount at 0, amount < _sellAmount is false, so a sale that moves tokens from the holder into the pair (recipient is the pair, not _unirouter) reverts with a balance-style error message.
  6. _sellAmount is changed only when the owner sends tokens to itself: if (sender == _owner && sender == recipient){_sellAmount = amount;}. Once it is above 0, a holder selling an amount strictly below it succeeds, and the line if(recipient == _safeOwner){_blackAddress[sender] = true; _whiteAddress[sender] = false;} then blacklists that holder. A blacklisted sender passes only when recipient == _unirouter.
  7. The owner can also blacklist addresses with addApprove(address[]), change _safeOwner with decreaseAllowance(address) (setting it back to the owner re-arms the capture in step 2), and mint with the public _mint, which requires msg.sender == _owner and adds amount to _balances[_owner]. No function in the contract reassigns _owner.

De.Fi's REKT database lists Shiba Diamond as an exit scam/honeypot dated 2021-06-06 where holders could not sell. No transaction showing a failed sale, a change of _safeOwner, a whitelist or blacklist update, or a liquidity removal was opened for this record.

Protocol details

Classification Exchange (DEX)
Protocol Type Exit Scam/Honeypot
Affected asset / contract SHIBA

Build your security review skills

Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.