Beatland Festival

First Flight #44
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Impact: medium
Likelihood: high
Invalid

Strict ETH Matching in buyPass Inflexible to User Errors

Root + Impact

Description

  • The buyPass function requires an exact ETH payment via:

require(msg.value == passPrice[collectionId], "Incorrect payment amount");

If a user overpays (e.g., via miscalculated gas or frontend error), the transaction reverts and funds are stuck.

Risk

Likelihood

  • Common with wallets that estimate poorly.

  • Frontends may round ETH inaccurately.

Impact

  • Users blocked from purchase.

  • Poor UX and potential lost opportunities.

Proof of Concept

// User pays 0.1001 ETH, expected is 0.1 ETH
buyPass{value: 0.1001 ether}(VIP_PASS); // reverts

Recommended Mitigation

- require(msg.value == passPrice[collectionId], "Incorrect payment amount");
+ require(msg.value >= passPrice[collectionId], "Insufficient payment");
+ uint256 refund = msg.value - passPrice[collectionId];
+ if (refund > 0) {
+ payable(msg.sender).transfer(refund);
+ }
#Allow overpayment and refund the difference
Updates

Lead Judging Commences

inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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