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

Custom Errors naming

Summary

The errors in utils/Errors.sol not named according to best practise

Vulnerability Details

Error naming is not indicative of the contract name in which the errors will be thrown. It is best practise for errors to have a prefix of the contract they are applied in.

Impact

Informational : Not naming errors with indication of contract can make error tracking, debuggin, analysis difficult as error data bubbles through chain of calls so it may not be clear if error contract receives is from where

Tools Used

Manual analysis

Recommendations

It is recommended the errors be named in accordance to the name of the contract in which they will be thrown e. g
error PoolConfig(); -> error Lender__PoolConfig();
error LoanTooSmall(); -> error Lender__LoanTooSmall();
error LoanTooLarge(); -> error Lender__LoanTooLarge();
error RatioTooHigh(); -> error Lender__RatioTooHigh();
error FeeTooHigh(); -> error Lender__FeeTooHigh();
error TokenMismatch(); -> error Lender__TokenMismatch();
error Unauthorized(); -> error Lender__Unauthorized();
error AuctionStarted(); -> error Lender__AuctionStarted();
error AuctionNotStarted(); -> error Lender__AuctionNotStarted();
error AuctionEnded(); -> error Lender__AuctionEnded();
error AuctionNotEnded(); -> error Lender__AuctionNotEnded();
error RateTooHigh(); -> error Lender__RateTooHigh();
error PoolTooSmall(); -> error Lender__PoolTooSmall();
error ZeroCollateral(); -> error Lender__ZeroCollateral();
error AuctionTooShort(); -> error Lender__AuctionTooShort();

Support

FAQs

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