15,000 USDC
View results
Submission Details
Severity: gas
Valid

[L-02] It is not specified which token is not allowed

Summary

The error DSCEngine__NotAllowedToken() should include the address of the disallowed token, to make it easier for the user or dev to see what token is throwing the error.

Vulnerability Details

The use of errors should describe the situation that presents the error, in this case the error DSCEngine__NotAllowedToken() error does not include the address of the token that is not allowed, even when the modifier that uses it is passed this address by parameter.

Impact

Low

Tools Used

Manual code review

Recommendations

Change for :

- `error DSCEngine__NotAllowedToken()`
+ `error DSCEngine__NotAllowedToken(address token)`

and

modifier isAllowedToken(address token) {
if (s_priceFeeds[token] == address(0)) {
- revert DSCEngine__NotAllowedToken();
+ revert DSCEngine__NotAllowedToken(token);
}
_;
}

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.