DittoETH

Ditto
DeFiFoundryOracle
55,000 USDC
View results
Submission Details
Severity: low
Invalid

revert Without a message

DESCRIPTION

In the onlyDiamond modifier, there is a revert statement without a specific error message. It is essential to provide a clear and informative error message when a revert occurs to help users and developers understand the reason for the revert. Without a message, debugging and understanding issues can be challenging.

Code:

 modifier onlyDiamond() {
     if (msg.sender != diamond) {
         revert NotDiamond(); // Missing error message
     }
     _;
 }

Recommendation:

Add a clear error message when using the revert statement to provide context for the revert:

  modifier onlyDiamond() {
     if (msg.sender != diamond) {
         revert("Only the diamond contract can call this function."); // Provide an error message
     }
    _;
 }
Updates

Lead Judging Commences

0xnevi Lead Judge
about 2 years ago
0xnevi Lead Judge about 2 years ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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