he checkAuctionEnded
function in the Auction
contract can be called multiple times, leading to redundant event emissions and potential gas wastage. While this does not directly impact security, it creates inefficiencies and unnecessary costs for users and network congestion.
The following code snippet demonstrates the issue:
The function does not restrict multiple calls, meaning any user can call it repeatedly after the auction ends, causing unnecessary event emissions.
This can lead to network spam and increased on-chain data storage requirements.
A malicious user can create scripts to invoke this function indefinitely, leading to increased blockchain state bloat.
Scenario:
Auction ends at timestamp X
.
A user calls checkAuctionEnded()
, emitting AuctionEnded
.
Another user (or the same user) calls it again, emitting another AuctionEnded
event.
This continues indefinitely, causing unnecessary event emissions and gas consumption.
Increased blockchain state growth due to unnecessary event logs.
Users may unintentionally waste gas by calling the function multiple times.
Potential for spam-like behavior affecting chain performance.
Manual review.
Modify the function to include a state flag that ensures it can only be called once:
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.