FestivalPass::withdraw
function.Description: The FestivalPass::withdraw
function uses the onlyOwner
modifier (correctly enforcing that only the contract owner can withdraw ETH). However, the inline comment (// Organizer withdraws ETH
) and the emitted event (IFestivalPass::FundsWithdrawn(address organizer, uint256 amount)
) imply that the organizer, not the owner, is the authorized actor.
This mismatch between the code and the documentation/comments may lead to confusion or misimplementation in the frontend or by other developers.
Impact:
Developers may incorrectly assume the organizer
can withdraw ETH.
Event consumers (e.g. analytics, frontend) might mislabel the withdrawer as the organizer
.
While no unauthorized access occurs, the inconsistent naming and documentation pose a medium risk to system clarity and maintainability.
Proof of Concept: Add this to your FestivalPass.t.sol:
The following test demonstrates that the FestivalPass::withdraw
function allows the owner to withdraw ETH, even though the in-code comment implies the organizer should be authorized.
Recommended Mitigation: Choose one of the following, depending on the intended business logic:
If only the owner should withdraw, rename the event to FundsWithdrawn(address owner, uint256 amount) and correct the inline comment.
If the organizer is the true withdrawer, change the modifier to onlyOrganizer.
Most importantly, ensure the code, comments, and interface all reflect the same authorized role to avoid confusion.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.