Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: high
Valid

Unused line in `HorseStore.huff::MAIN` can lead to future errors

Description

At the end of the MAIN macro in HorseStore.huff, there is an unused line: MINT_HORSE(). In future updates, if a function is added right above this line and does not return, revert, or stop, it could inadvertently call MINT_HORSE, leading to protocol errors. Additionally, this line results in unnecessary gas consumption during bytecode deployment.

#define macro MAIN() = takes (0) returns (0) {
.
.
.
@> MINT_HORSE()
}

Impact

  • Gas consumption.

  • Potential future errors if a function added above doesn't revert, return, or stop.

Recommended Mitigation

Remove the unused line to prevent potential future errors and reduce unnecessary gas consumption.

#define macro MAIN() = takes (0) returns (0) {
.
.
.
- MINT_HORSE()
}
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

MAIN() macro is not properly implemented

Any call data sent to the contract that doesn't contain a function selector will randomly mint a horse.

Support

FAQs

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