XenonFinance Honeypot
What happened
De.Fi's REKT database lists XenonFinance (XENON) on BNB Smart Chain as an Exit Scam/Honeypot and describes the contract owner as able to disable the transfer function, which restricted users from selling. The verified source for 0x1874a5e0…aa8db5 has an owner-only setFeeEnabled switch. While it is on, any non-exempt transfer to the liquidity pair takes a fee computed as mul(div(amount, 100), 100), which is the whole amount rounded down to a multiple of 100 base units.
The pair receives at most 99 base units of a sell, while the seller's balance is debited the full amount.
How it happened
- The constructor mints 100,000,000 tokens with 9 decimals to the deployer (
_totalSupply = 100000000 * 10**9;,_balances[_owner] = _totalSupply;) and creates a pair for the token against the router'sWETH()._feeEnabledstarts asfalse. - Only the owner can switch the fee on or off:
function setFeeEnabled(bool feeEnabled) external { require(_owner == msg.sender); _feeEnabled = feeEnabled; }. There is no cap and no other limit on it, and the source has no function to transfer or renounce ownership. _transferfirst debits the sender in full:_balances[from] = sub(_balances[from], amount);.- When
_feeEnabled && to == uniswapV2Pair && from != address(uniswapV2Router) && from != _owner && from != address(this), it setsuint256 fee = mul(div(amount, 100), 100);.div(amount, 100)truncates andmul(..., 100)scales it back, sofeeequals the amount except for a remainder of 0 to 99 base units. - The pair is credited only
sub(amount, fee), and the fee is removed from supply with_totalSupply = sub(_totalSupply, fee);. A holder selling into the pair while the fee is on therefore gives up essentially the entire amount. A sale made through the router would normally havefromequal to the seller, who is not exempt. - Buys, where
tois not the pair, and any transfer by the owner are not affected. Whether the owner ever calledsetFeeEnabled(true)is not shown by the code.
Protocol details
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.