Beginner FriendlyDeFiFoundry
100 EXP
View results
Submission Details
Severity: high
Invalid

Unchecked Return Value from transfer in MoneyVault

Description
The widthdrawUSDC function in MoneyVault does not check the boolean return value for success or failure. Not all IERC20 implementations revert() when there's a failure in transfer() or transferFrom(). The function signature has a boolean return value which indicates errors, but these errors may go unnoticed if the return value is not checked. This can potentially result in operations that should have been marked as failed going through without actually making a payment.

Impact
Without checking the return value of transfer() or transferFrom(), operations can not be appropriately handled if the transfer fails.

Recommended mitigation

  1. Use appropriate checks such as:

- usdc.transfer(to, amount);
+ require(usdc.transfer(to, amount),
+ "MoneyVault::withdrawUSDC call to transfer failed.");
  1. Consider using openzepplin SafeERC20.

Tools Used:

  • Slither

  • Manual Review

Updates

Lead Judging Commences

n0kto Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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