20,000 USDC
View results
Submission Details
Severity: medium

unchecked-transfer

Vulnerability Details

The contract transfers fees amount of tokens to the 'feeReceiver' address without checking the return value of the transfer function

Impact

If the transfer function fails due to reasons like invalid transactions or insufficient balance, it can lead to unintended consequences. For example, the fees amount may not be correctly collected, affecting the revenue for the protocol.

Tools Used

Slither

Recommendations or mitigation: To mitigate this issue, first reduce contract size, you can consider using error codes or constants instead of string literals in revert statements. Error codes or constants are stored more efficiently in the contract's bytecode, leading to smaller contract sizes. Then handle the return value (or error codes) of the transfer function. Example shown below:

require(
IERC20(loan.loanToken).transfer(feeReceiver, fees),
"Token transfer to feeReceiver failed"

);

Support

FAQs

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