The function has ambiguous behavior when an invalid ETH amount is sent, potentially leading to failed WETH transfers if user approvals are missing.
If ETH amount does not match expected price, contract attempts to collect WETH.
If WETH allowance is insufficient, transaction will revert unexpectedly.
User may think ETH was sufficient and UX confusion occurs.
Unexpected reverts.
UX confusion.
Inconsistent payment flow.
MEDIUM
MEDIUM
Fail early when ETH amount is incorrect:
require(msg.value == s_buyFee * amount, "Invalid ETH amount");
Or fully separate ETH vs WETH purchase flows.
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.