Part 2

Zaros
PerpetualsDEXFoundrySolidity
70,000 USDC
View results
Submission Details
Severity: medium
Invalid

ERC20 missing return value check

Description: The deposit function performs an ERC20.approve() call but does not check the success return value.
Some tokens do not revert if the approval failed but return false instead.

function deposit(
uint128 vaultId,
uint128 assets,
uint128 minShares,
bytes memory referralCode,
bool isCustomReferralCode
)
external
{
--SNIP--
@> IERC20(ctx.vaultAsset).approve(indexTokenCache, ctx.assetsMinusFees);
--SNIP--
}

Impact: Tokens that don't actually perform the approve and return false are still counted as a correct approve.

Recommended Mitigation Steps:
We recommend using OpenZeppelin’s SafeERC20 versions with the safeApprove function that handles the return value check as well as non-standard-compliant tokens.

Updates

Lead Judging Commences

inallhonesty Lead Judge 6 months ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.