AaveDIVAWrapperCore._registerCollateralToken leading to Unexpected behaviorDescription:
The function AaveDIVAWrapperCore._registerCollateralToken uses _wTokenContract.approve(_diva, type(uint256).max); and _collateralTokenContract.approve(_aaveV3Pool, type(uint256).max); . However, some ERC20s on some chains don't return a value. Since _collateralTokenContract is an external token chosen by users, it could be a non-standard ERC20(like USDT) and might return false instead of reverting on failure. If approve() fails, the contract won’t notice, and it may lead to unexpected issues when interacting with Aave.
impact:
If the _collateralTokenContract is a non-standard ERC20, the approve() fails silently, the contract will assume that the approval was granted, but future transactions will fail unexpectedly. This could lead to unexpected behavior in the contract. If approve() fails, the contract won’t notice, and it may lead to unexpected issues when interacting with Aave.
Proof of Concept:
Recomended Mitigation:
Use safeApprove() from OpenZeppelin.
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.