Part 2

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

Unsafe ERC20 Operations should not be used, function convertAccumulatedFeesToWeth, FeeDistributionBranch.sol

Summary

Function convertAccumulatedFeesToWeth approve the collateral token.

IERC20(asset).approve(dexSwapStrategy.dexAdapter, ctx.assetAmount);

Vulnerability Details

ERC20 functions may not behave as expected. For example: return values are not always meaningful.

ERC-20 functions like approve(), transfer(), and transferFrom() do not always behave as expected.

  • Some tokens do not return a boolean (true/false) when calling these functions.

  • Others return false instead of reverting on failure, meaning the transaction does not revert but still fails silently.

Impact

If a token fails to approve, the contract will not know, and the transaction will continue as if the approval was successful, leading to unexpected behavior or security risks.

Tools Used

Manual review

Recommendations

It is recommended to use OpenZeppelin's SafeERC20 library, and replace approve with safeApprove

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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