`buySnow()` accepts payment in either ETH or WETH. The routing logic uses `if (msg.value == fee)` for ETH and `else` for WETH. If a user sends any non-zero `msg.value` that does not exactly match the
required fee, the `else` branch executes: WETH is pulled from the user **and** the sent ETH remains permanently trapped in the contract with no refund mechanism.
```solidity
function buySnow(uint256 amount) external payable canFarmSnow {
if (msg.value == (s_buyFee * amount)) {
_mint(msg.sender, amount);
} else {
i_weth.safeTransferFrom(msg.sender, address(this), (s_buyFee * amount));
_mint(msg.sender, amount);
}
}
```
### Risk
**Likelihood:**
- Users who accidentally attach any ETH while intending to use the WETH payment path
- Users who miscalculate the exact ETH amount required (`s_buyFee * amount`)
**Impact:**
- Sent ETH is permanently locked in the Snow contract — no refund function exists for users
- The ETH is only recoverable by the `collector` via `collectFee()`, not by the original sender
- User effectively pays double: WETH for the Snow tokens plus ETH lost to the contract
```solidity
function test_poc_ETHStuck() public {
address user = makeAddr("user");
deal(user, 10 ether);
weth.mint(user, FEE);
vm.startPrank(user);
weth.approve(address(snow), FEE);
snow.buySnow{value: 1 wei}(1);
vm.stopPrank();
assertEq(snow.balanceOf(user), 1);
assertEq(address(snow).balance, 1 wei);
}
```
Run with: `forge test --match-test test_poc_ETHStuck -vvv`
```diff
function buySnow(uint256 amount) external payable canFarmSnow {
if (msg.value == (s_buyFee * amount)) {
_mint(msg.sender, amount);
} else {
+ if (msg.value > 0) revert S__WrongPaymentMethod();
i_weth.safeTransferFrom(msg.sender, address(this), (s_buyFee * amount));
_mint(msg.sender, amount);
}
}
```