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

Use Custom Errors

Summary

Instead of using require, to reduce deployment and runtime cost, you should use Custom Errors. This would save both deployment and runtime cost.

Vulnerability Details

When a revert condition is met in Fees.sol sellProfits() function, the runtime gas cost will be higher with normal compared to custom errors.

Impact

Increase in both deploy and runtime gas costs.

Tools Used

Manual review

Recommendations

+error Unauthorized();
-require(_profits != WETH, "not allowed");
+if(_profits != WETH) revert Unauthorized();

Support

FAQs

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

Give us feedback!