The approve
function in CapitalPool.sol uses a low-level call to interact with the tokenAddr address. According to the Solidity documentation, low-level functions (call, delegatecall, and staticcall) return true as their first return value if the account called is non-existent.
This behavior can lead to potential overlooked failures in the approve function.
The low-level call to tokenAddr will return true as the first return value if the tokenAddr is a non-existent address. This means that the success variable will be true, and the function will not detect that the call failed due to the non-existence of the tokenAddr.
Manual Analysis
To mitigate this issue, it is recommended to check if the tokenAddr address is a contract before performing the low-level call. This can be done by checking if the tokenAddr address has code associated with it.
Invalid, low level call will always return true as long as the call succeeds without reverting, so this has no impact described, given approvals can only fail when some weird tokens do not allow a uint256.max approval, which is not described in any of the issues below.
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.