Hawk High

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

Detects the comparison to boolean constants.

Summary

  • Boolean constants can be used directly and do not need to be compare to true or false.

Vulnerability Details

Impact

Tools Used

  • foundry

Recommendations

  • Use if(x) and if(!x) instead of if(x == true) or if(x == false).

```diff
function expel(address _student) public onlyPrincipal {
+if (!inSession ) {
-if (inSession == false) {
revert();
}
```
```diff
modifier notYetInSession() {
+if (inSession) {
-if (inSession == true) {
revert HH__AlreadyInSession();
}
_;
}
```
Updates

Lead Judging Commences

yeahchibyke Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!