Some ERC20 tokens have more than 18 decimals (e.g. YAM-V2 has 24). If such token is an accepted token, some opperations will underflow. The built-in underflow check of Solidity (version > 0.8.0) will revert the transaction, resulting in complete DOS of the protocol.
The LiquidationPool::distributeAssets() function uses the token decimals to compute the rewards:
If the asset.token.dec is more than 18 it will underflow and the transaction will revert, blocking the liquidation process.
The number of decimals is also used in the PriceCalculator contract (out of scope) which is used to compute the collateral amount of the vaults.
A number of decimals > 18 will block all the vaults operations.
If a token with more than 18 decimals becomes an accepted token, it will lead to a complete DOS of the protocol.
Manual review
Check that token.decimals() <= 18 before adding a new accepted token.
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.