EpsilonFinance Honeypot
What happened
EpsilonFinance (EPSILON) on BNB Smart Chain, contract 0x6c095b95…88d71e, contains an owner switch, setFeeEnabled, that turns on a sell fee which works out to almost the whole amount sold. With the switch on, a holder's full amount is debited but the pair is credited only the remainder left after the fee, and the fee is not credited to anyone. De.Fi's REKT database lists this token as an Exit Scam/Honeypot and states that the contract owner could disable the transfer function, which restricted users in selling their tokens.
How it happened
- The deployer is stored as
_ownerand receives the whole supply; the constructor also creates the pair:.createPair(address(this), uniswapV2Router.WETH());._feeEnabledstarts asfalse. - Only the owner can change the switch:
function setFeeEnabled(bool feeEnabled) external { require(_owner == msg.sender); _feeEnabled = feeEnabled; }. There is no function to change_owneror give it up. - In
_transferthe sender is debited the full amount first:_balances[from] = sub(_balances[from], amount);. - When
_feeEnabledis true, the recipient is the pair and the sender is not the router,_owneror the contract (_feeEnabled && to == uniswapV2Pair && from != address(uniswapV2Router) && from != _owner && from != address(this)), the fee isuint256 fee = mul(div(amount, 100), 100);. This isamount / 100 * 100, i.e. the amount rounded down to a multiple of 100 raw units, so the fee is nearly 100% of the sale. - The pair is credited only
sub(amount, fee), which isamount % 100raw units (at most 99 units of a 9-decimal token), and_totalSupply = sub(_totalSupply, fee);removes the fee from supply. A sale of fewer than 100 raw units pays no fee. - Because
fromis the seller in a router-mediated sale (transferFrom(sender, pair, amount)), thefrom != address(uniswapV2Router)exemption does not help ordinary sellers, while the owner is exempt and can remove liquidity or sell at will. Whether the owner switched the fee on, or when, was not checked in a transaction.
Protocol details
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.