Fee-on-transfer token bug can permanently lock funds in Solidity vaults
A security researcher discovered a critical smart contract vulnerability during a recent audit of an undisclosed DeFi protocol. The flaw affects Solidity vaults that use fee-on-transfer tokens, where a 5% fee causes the actual received amount to be less than the amount recorded in the contract's internal accounting. Because the vault logs the requested transfer amount rather than the actual amount received, withdrawal attempts always revert due to an apparent balance shortfall, locking funds permanently. A proof-of-concept test confirmed that depositing 1,000 tokens results in only 950 tokens received, while the vault expects to pay out 1,000 on every withdrawal. The fix requires a single extra balanceOf check before and after the transfer to record only what was actually received.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in