User using tokens other than 18 decimals can have severe malfunctioning.
Considering that the smart contract can be used with any ERC20 token as collateral, it does not implement the same. The smart contract uses the PRECISION = 1e18 as a multiplier to calculate token amount and its usd amount. But if the smart contract is to work with all ERC20 tokens whose price feed is supported by Chainlink then it fails.
If users attempt to use tokens that have decimals other than 18 as collateral, the smart contract will miscalculate the token's value and its equivalent in USD. This can lead to a number of problems:
Overvaluation or undervaluation of collateral
Market manipulation
Contract Failure
VS Code
Manual Analysis
Hardhat
Consider taking the decimals of each collateral token as an array in constructor and then multiply that particular precision value to calculate its amount and usd value.
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.