Sparkn

CodeFox Inc.
DeFiFoundryProxy
15,000 USDC
View results
Submission Details
Severity: low

Missing Error Message in Revert Statements

Description:

In the constructor of the ProxyFactory contract, the revert statements are missing accompanying error messages. This omission makes it challenging to diagnose the cause of a transaction failure when interacting with the contract.

Impact:

When transactions fail due to issues related to zero addresses or empty arrays, users and developers won't receive meaningful feedback about what went wrong. This can result in confusion and hinder efficient debugging.

Proof of Concept:

  • Deploy the ProxyFactory contract.

  • Call the constructor with an empty _whitelistedTokens array.

  • The transaction will revert, but the error message will provide no information about the underlying problem.

Recommendation:

Add explicit error messages to the revert statements in the constructor to provide context on the specific issue. For instance:

if (_whitelistedTokens[i] == address(0)) revert ProxyFactory__NoZeroAddress();

This will improve the user experience by providing clearer error messages.

Support

FAQs

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