Hawk High

First Flight #39
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Impact: low
Likelihood: medium
Invalid

Bad practice - revert();

Summary

revert(); gives no information about why the transaction failed

Vulnerability Details

  • Without a reason string or custom error gives no information to the user or developer about why the transaction failed.

  • Best practice is to use custom errors (as you defined) or at least a reason string.

Impact

  • It makes debugging and error handling much harder.

Tools Used

Manual Review

Recommendations

Case1:

You can define a new error for this case.

error HH__SessionNotActive();

And then use it like this.

if (inSession == false) {
revert HH__SessionNotActive();
}

Case2:

Or, if you want to use a reason string.

if (inSession == false) {
revert("Session not active");
}
Updates

Lead Judging Commences

yeahchibyke 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.