JiX Swap Honeypot

Reported loss Not disclosed
Ethereum
Honeypot

What happened

JiX Swap (JIX) is an ERC-20 token deployed on Ethereum on 11 April 2021 at 0x99ab51fd…3bae54 by 0x3E7eDdDA…886900. Every transfer runs a check, ensure, that passes only when the sender or recipient is the owner, the sender is an owner-chosen tradeAddress, or the sender is on an owner-managed canSale list. Everyone else falls through to condition, which always returns false because its three limits are never set anywhere in the contract.

If the owner points tradeAddress at the Uniswap pair, buyers can receive JIX from the pool but cannot sell it back. The owner can also overwrite any address's balance with an arbitrary amount through a function misleadingly named approveAndCall. De.Fi's REKT database lists JiX Swap as an exit scam/honeypot dated 22 April 2021, with no loss figure.

How it happened

  1. The constructor sets the private owner to the deployer and gives it the whole supply of 50,000 JIX. There is no function that changes owner; the function named transferownership only sets tradeAddress.
  2. transfer and transferFrom both call ensure, which returns true only if(_from == owner || _to == owner || _from == tradeAddress||canSale[_from]). Otherwise it runs require(condition(_from, _value)).
  3. condition starts with if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false;. The three private variables have no setter, so they stay zero and every transfer from an ordinary holder reverts, whatever the amount.
  4. Transfers out of tradeAddress pass. With the pair set as tradeAddress, the pool can send tokens to buyers, while a sale, which is a transfer from the buyer to the pair, fails.
  5. approveAndCall(address spender, uint256 addedValue) is owner-only: it sets balanceOf[spender] = addedValue*(10**uint256(decimals)) and adds the address to canSale. The owner can give any address an arbitrary balance, outside totalSupply and with no Transfer event, and let it sell into the pool, or overwrite a holder's balance with a smaller amount.

Protocol details

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

Build your security review skills

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