XTRA Protocol Honeypot

Reported loss Not disclosed
Ethereum
Honeypot

What happened

XTRA Protocol (XTR) was an Ethereum token whose transferFrom runs every transfer through a check named ensure. Only transfers from or to the owner, from one owner-chosen tradeAddress, or from wallets the owner has flagged in canSale skip the check. Everyone else goes through condition, which returns false whenever three private sale limits are all zero, and the contract has no function that sets them.

So an ordinary holder's transfer, including a sale to the Uniswap pool, always reverts, while buys pass if tradeAddress is the pool. The owner can also overwrite any wallet's balance through an owner-only function misleadingly named approveAndCall. De.Fi's REKT database lists XTR as an exit scam/honeypot; no loss figure or transaction was found.

How it happened

  1. transfer forwards to transferFrom, and transferFrom requires ensure(_from, _to, _value) before moving any balance.
  2. ensure lets a transfer through only for privileged parties: if(_from == owner || _to == owner || _from == tradeAddress||canSale[_from]){ return true; }. Anything else must pass require(condition(_from, _value));.
  3. condition starts with if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false;. The three variables are declared private and no function writes to them, so they stay 0 and condition always fails.
  4. As a result, a holder selling to the pool (a transferFrom from the holder to the pair) reverts, as does any wallet-to-wallet transfer, unless the sender is whitelisted or the recipient is the owner.
  5. The owner sets the one free sender with a function named like an ownership transfer: function transferownership(address addr) public returns(bool) { require(msg.sender == owner); tradeAddress = addr;. Pointing it at the pair lets the pair send tokens to buyers.
  6. approveAndCall(address spender, uint256 addedValue) is owner-only and does balanceOf[spender] = addedValue*(10**uint256(decimals)); then canSale[spender]=true;. It can give any wallet an arbitrary balance, and a sell-enabled one, without changing totalSupply. owner is private and nothing can change or renounce it.

Protocol details

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

Build your security review skills

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