Skip to content
Business logic Audit finding Intermediate

No check transferFrom() return value

The smart contract does not check the return value of token transfer functions, so a token that returns false instead of reverting could let a user deposit without actually transferring funds.

s1m0 Follow

Originally disclosed on Code4rena

Submitted by s1m0, also found by pauliax, shw, 0xRajeev, JMukesh, Lucius and cmichel

The smart contract doesn’t check the return value of token.transfer() and token.transferFrom(), some erc20 token might not revert in case of error but return false. In the TracerPerpetualSwaps:deposit and Insurance:deposit this would allow a user to deposit for free. See issue page for other places.

Recommend wrapping the call into a require() or using openzeppelin’s SafeERC20 library.

raymogg (Tracer) confirmed

The original report as published on Code4rena, by s1m0. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The contract calls token transfer functions without checking their boolean return value, so a false return is ignored.

Impact

A user could deposit tokens for free if the token returns false instead of reverting on failure.

What the attacker needed

A token that returns false on failure

The fix

The call should be wrapped in a require() or use OpenZeppelin’s SafeERC20 library.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Some digital tokens report success or failure by returning true or false instead of stopping with an error. If a contract ignores that true/false answer, it may think a payment succeeded when it actually failed, letting someone get credit without paying.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More from Tracer contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.