The AaveDIVAWrapperCore contract uses the _registerCollateralToken function to register tokens that have not already been registered and that are supported by Aave. However, there is no function that allows to unregister tokens that are no longer supported by Aave.
There are various reasons, why tokens may become unsupported on Aave (governance decisions, regulatory issues, security concerns...) and the AaveDiva Wrapper should ideally reflect those changes and revert immediately if any of the key function on the AaveDIVAWrapper contract is called with a token that is no longer supported on Aave.
If a token on Aave becomes unsupported, users can no longer deposit those tokens, but they can still withdraw the token.
Instead of failing immediately when any of the concerned functions is called, those funcctions will only revert when either the IAave(_aaveV3Pool).supply() function in _handleTokenOperations() is called or when the IAave(_aaveV3Pool).withdraw() function in _redeemWTokenPrivate() is called.
This means, for someone calling any of those functions with a token that is no longer supported on Aave, the gas cost the user has to pay will be higher than necessary.
Manual Review
Add a _unregisterCollateralToken function to AaveDIVAWrapperCore and AaveDIVAWrapper
_createContingentPool and _addLiquidity should no longer work for unregistered tokens, however, _removeLiquidity, _redeemPositionToken and _redeemWToken will still need to wwork for those tokens in order to allow the user to withdraw corresponding collateral tokens from Aave.
This is invalid. If the collateral token is not supported by Aave or invalid, the `registerCollateralToken` will revert. If the collateral token is deprecated by Aave due to a given issue, this is known issue: "Integration risk with both Aave V3 and DIVA Protocol - vulnerabilities in either protocol may affect AaveDIVAWrapper."
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.