Skip to content
Business logic Audit finding Beginner

CompoundToNotionalV2.notionalCallback ERC20 return values not checked

The contract calls ERC20 transferFrom without checking the return value, so tokens like USDT that return void will cause the call to revert. This makes such tokens unusable in the protocol.

cmichel Follow

Originally disclosed on Code4rena

Submitted by cmichel

Some tokens (like USDT) don’t correctly implement the EIP20 standard and their transfer/transferFrom functions return void, instead of a success boolean. Calling these functions with the correct EIP20 function signatures will always revert. See CompoundToNotionalV2.notionalCallback’s IERC20(underlyingToken).transferFrom call.

Tokens that don’t correctly implement the latest EIP20 spec, like USDT, will be unusable in the protocol as they revert the transaction because of the missing return value. The fact that there is a cToken with USDT as the underlying this issue directly applies to the protocol.

We recommend using OpenZeppelin’s SafeERC20 versions with the safeTransfer and safeTransferFrom functions that handle the return value check as well as non-standard-compliant tokens.

jeffywu (Notional) confirmed

The original report as published on Code4rena, by cmichel. 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 uses the standard IERC20 interface and does not check the return value of transferFrom, which reverts for tokens that return void.

Impact

Tokens like USDT cannot be used in the protocol because transactions revert due to the missing return value.

What the attacker needed

Token like USDT that returns void

The fix

Use OpenZeppelin's SafeERC20 safeTransfer and safeTransferFrom functions, which handle return value checks and non-standard tokens.

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 tokens, like USDT, don't follow the standard exactly: their transfer functions don't return a true/false value. The contract expects a return value, so when it calls transferFrom on such a token, the call fails and the whole transaction reverts. This means the protocol can't handle those tokens.

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 by cmichel

View all

196 more disclosed reports, best first.

More from Notional 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.