Standard ERC20 tokens without decimals() function cannot be registered
According to docs, compatible tokens must have 6-18 decimals and NOT be rebasable/fee-on-tranfer. When trying to register a collateralToken, _registerCollateralToken()
will call * *_collateralTokenContract.decimals()
to deploy the corresponding wToken. However this function is NOT mandatory in ERC20 tokens as indicated by EIP20, and other contracts MUST NOT expect this function to be present in the ERC20 token they are dealing with: https://eips.ethereum.org/EIPS/eip-20#decimals
_collateralTokenContract.decimals()
will revert when called on a token that does not implement decimals() function.
Tokens that fulfill the protocol compatibility criteria (6-18 decimals, NOT rebase/fee-on-transfer and registered in Aave) without decimals() function cannot be registered as collateral tokens, taking into account decimals() function is NOT mandatory and contracts interacting with ERC20 tokens must not expect them to implement decimals() function (according to EIP20)
Manual review
Do not revert in case decimals() function is NOT present. As `registerCollateralToken()` can only be called by owner, use an additional parameter in case decimals() function does not exist:
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.