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

USDC `transferFrom` return value is ignored in `MoneyShelf::depositUSDC`, causing transfer status is unchecked

Description

The function MoneyShelf::depositUSDC ignores return value of usdc.transferFrom, so even if the transfer fails sliently (as long as it doesnt revert), it will still mint crimeMoney to caller.

Impact

bank[to] might be changed, and crimeMoney might be minted to, even if no USDC is transferred to MoneyShelf. That could cause failure when later USDC is withdrawn, because there isnt enough USDC in this contract.

Recommendations

check the return value of usdc.transferFrom, if transfer fails, revert the tx

require(usdc.transferFrom(account, address(this), amount), "Token transfer failed");
Updates

Lead Judging Commences

n0kto Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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