Skip to content
Business logic Audit finding Intermediate

Non-standard ERC20 Tokens are Not Supported

The SuperVault contract calls the standard ERC20 approve function, which reverts for tokens like USDT that do not return a boolean. This prevents the vault from operating with such tokens, impacting function availability.

ych18 Follow

Originally disclosed on Code4rena

Submitted by ych18, also found by MaratCerby, robee, and defsec

When trying to call SuperVault.executeOperation the transaction reverts. This is because the call to asset.approve() in line{97} doesn’t match the expected function signature of approve() on the target contract like in the case of USDT.

This issue exists in any call to approve function when the asset could be any ERC20.

Recommendation : consider using safeApprove of OZ

m19 (Mimo DeFi) acknowledged

gzeoneth (judge) decreased severity to Medium and commented:

Judging as Med Risk as function availability could be impacted. Unlike the core protocol, SuperVault can take any token as input and USDT is listed on various lending protocol like AAVE.


The original report as published on Code4rena, by ych18. 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 the standard ERC20 approve function directly, which reverts for tokens whose approve does not return a boolean.

Impact

The vault's executeOperation function reverts for non-standard tokens like USDT, so the vault cannot operate with them, affecting availability.

What the attacker needed

Vault uses a non-standard ERC20 like USDT

The fix

The report recommends using OpenZeppelin's safeApprove, which handles tokens that do not return a boolean.

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, such as USDT, have an approve function that does not return a value, while the standard expects a true or false. The vault's code assumes the standard behaviour, so when it tries to approve USDT the call fails and the whole transaction is undone. This means the vault cannot be used with 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 ych18

View all

3 more disclosed reports, best first.

More from Mimo DeFi 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.