The audit identified an issue related to the usage of the transfer and transferFrom functions in ERC20 token transactions. The implementation directly calls these functions, which may cause compatibility issues with tokens that do not adhere strictly to the ERC20 standard.
The protocol aims to support all ERC20 tokens but directly uses the standard transfer and transferFrom functions. Some tokens, such as USDT, do not fully comply with the ERC20 standard and do not return a boolean success value. As a result, calling these functions expecting a return value can lead to transaction reverts.
The following functions suffer from this issue:
Treasury in deposit
Treasury in withdraw
Tokens that do not strictly follow the ERC20 standard, such as USDT, may revert transactions when transfer or transferFrom is called expecting a return value. This could render these tokens unusable within the protocol.
Manual code review
Use OpenZeppelin’s SafeERC20 Library
Replace direct calls to transfer and transferFrom with safeTransfer and safeTransferFrom from OpenZeppelin’s SafeERC20 library.
Ensure Compatibility with Non-Standard ERC20 Tokens
Implement handling for tokens that do not return a success boolean.
Consider using low-level calls (call) to interact with these tokens safely.
By implementing these mitigations, the protocol can support a wider range of ERC20 tokens, including those with non-standard implementations like USDT, ensuring better usability and security.
LightChaser Low-60
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.