DSCEngine.sol contract has a range of view function that present information about protocol and users. However, their usage is omitted and direct storage call used
The code will be much cleaner if we use view function instead of storage call.
Particularly:
getCollateralTokenPriceFeed(token) instead of s_priceFeeds[token];
getCollateralBalanceOfUser(user, token) instead of s_collateralDeposited[user][token];
View functions name are more self-explanatory and easy to read, thus current implementation may mislead users
Observation
Change:
s_priceFeeds[token] to getCollateralTokenPriceFeed(token) in lines 103, 344, 362 of DSCEngine.sol
s_collateralDeposited[user][token] to getCollateralBalanceOfUser(user, token) in line 355 of DSCEngine.sol
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.