20,000 USDC
View results
Submission Details
Severity: medium

Users may lost their collateral in pool with some legasy ERC20 tokens

Summary

Lender.sol contract uses transfer/transferFrom function without checking return values for main functions - addToPool, removeFromPool, borrow, repay, etc

Vulnerability Details

Some ERC20 tokens don't throw but just return false when a transfer fails. As return value of transfer/transferFrom calls is not checked, this can be abused to trick the functions to change protocol state without actual tokens movement. A good example of such a token is ZRX: Etherscan code

Impact

Pool without providing token might be created. Users that would like to borrow from such pools might lost their collateral without getting any fund back

Tools Used

Observation

Recommendations

Use safeERC20 for ERC20 transfer calls

Support

FAQs

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