DiamondBalls Honeypot

Reported loss Not disclosed
BNB Chain
Honeypot

What happened

DiamondBalls (DDB) on BNB Smart Chain contains an owner-controlled switch that blocks transfers to chosen addresses. setPanCakeSwapReciever(address _recipient, bool _feeless) lets the owner mark any address in the PanCakeSwapReciever mapping, and _transfer calls calculateFeesBeforeSend, which reverts with "Error: Can not sell this token" whenever the recipient is marked. If the owner marks the trading pair, every sell into it reverts while buys, which come from the pair, are unaffected.

The owner can flip the flag back at any time, and renouncing the whitelist does not touch it. De.Fi's REKT database lists DDB as an Exit Scam/Honeypot, noting that the owner could disable the transfer function and restrict users from selling; the proof link could not be retrieved, so no specific marked address, sale attempt or loss figure is verified here.

How it happened

What the code allows (no transaction was opened, so which addresses the owner actually marked is not verified):

  1. The constructor mints the whole supply to the deployer, who also becomes owner: _transferTO(msg.sender, 1001001001e18); with Ownable setting _owner = _msgSender();.
  2. The owner can mark any address as a blocked recipient: function setPanCakeSwapReciever(address _recipient, bool _feeless) public onlyOwner { ... PanCakeSwapReciever[_recipient] = _feeless; }. Unlike the feeless setters, it is not guarded by canWhitelist, so renounceWhitelist() does not disable it.
  3. Every transfer, including transferFrom used by routers, goes through _transfer, which calls calculateFeesBeforeSend(sender, recipient, amount). That function contains if(PanCakeSwapReciever[recipient]){ revert("Error: Can not sell this token"); }.
  4. The check looks at the recipient only, with no exemption for the owner or any sender. When the recipient is a marked address such as a trading pair, a holder's sell reverts and the sender's balance is restored, because the debit in _transfer happens in the same reverted transaction. Transfers into unmarked addresses and transfers out of a marked address are not affected by this check.
  5. The flag is reversible (PanCakeSwapReciever[_recipient] = _feeless; accepts false), so the owner can unmark the pair. renounceOwnership() exists; calling it would freeze the flag in its current state.

The fee machinery is inert: calculateFeesBeforeSend ends with return (amount, 0);, so no fee is taken on any transfer.

De.Fi's REKT database lists DDB as an Exit Scam/Honeypot dated 2021-09-29, noting that the owner could disable the transfer function and restrict users from selling.

Protocol details

Classification Token
Protocol Type Exit Scam/Honeypot
Affected asset / contract DDB

Build your security review skills

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