The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: low
Invalid

Unsafe ERC20 transfer

Summary

There are multiple instances of unsafe ERC20 transfers which could lead to stakers losing their rewards.

Vulnerability Details

Although SafeERC20 library is imported in LiquidationPool and used for transferFrom, it is not used for transfer and the value from the transfer is not checked. If the transfer of ERC20 tokens fails (for example if it returns false), the protocol wouldn't know and will assume that everything is fine. If we look at LiquidationPool::claimRewards, we can see that we delete the rewards mapping before the transfer so if the transfer fails the user loses his rewards.
EIP20 states that the value returned from transfer should always be checked:

Callers MUST handle false from returns (bool success). Callers MUST NOT assume that false is never returned!

Impact

Leads to loss of rewards for users if the transfer of tokens fails

Tools Used

Manual Review

Recommendations

Use the SafeERC20 library for transfer as well. More precisely the safeTransfer function.

Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue
Assigned finding tags:

unchecked-transfer

informational/invalid

Support

FAQs

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