In the docs, it's stated:
However there's no actual check for tokens' decimals in _registerCollateralToken
AAVE V3 only checks if the token has at least 6 decimals source. So AAVE V3 may support tokens with more decimals up to 255.
This may allow registering tokens that have more than 18 decimals.
Calculations might overflow
Rounding errors become more significant
Yield calculations might be inaccurate
Balance comparisons might fail
Amount conversions could fail
Storage variables might not be able to hold the full amounts
Cause unexpected behavior in Aave's interest calculations
Break assumptions in the protocol's math libraries
Lead to incorrect collateralization ratios
Manua review.
Add the check to _registerCollateralToken
and introduce a new error TokenDecimalsTooHigh
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.