Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: low
Invalid

Correcting Error Handling in Constructor: Using InvalidVeToken Instead of InvalidPool

Title: Correcting Error Handling in Constructor: Using InvalidVeToken Instead of InvalidPool


Issue:

In the constructor, the contract checks if the _veToken address is the zero address. However, if this condition is met, it incorrectly reverts with the error InvalidPool instead of the more appropriate InvalidVeToken. This misleads developers and users about the source of the error.


Impact:

  • Misleading Error Messages: The wrong error message can confuse developers during debugging, as the error does not accurately reflect that the issue is with the veToken address.

  • Faulty Troubleshooting: With an incorrect error message, diagnosing and resolving the problem becomes more challenging.

  • Potential Security Concerns: Inaccurate error reporting can obscure the true nature of the issue, potentially affecting the contract's reliability and security.


Fix:

Define a new error InvalidVeToken and use it in the constructor. For example:

error InvalidVeToken();
constructor(address _veToken) {
if (_veToken == address(0)) revert InvalidVeToken();
// Other initialization code...
}

This change ensures that if an invalid veToken address is provided, the correct error is thrown, thereby improving clarity during debugging and ensuring proper contract initialization.


Conclusion:

By replacing InvalidPool with InvalidVeToken in the constructor, the error message more accurately reflects the issue, facilitating better debugging and maintaining the integrity of the contract setup.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 month ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
inallhonesty Lead Judge about 1 month ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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