It appears that the contract includes a payable function to accept Ether but lacks a corresponding function to withdraw it, which leads to the Ether being locked in the contract. To resolve this issue, please implement a public or external function that allows for the withdrawal of Ether from the contract.
Likelihood: Medium
Even the protocol doesn't require ETH, both NFTDealers::mintNft and NFTDealers::buy are payable functions. This means that users can accidentally send ETH with the transaction when interacting with the contract.
In practice this can happen due to:
User mistakes when sending transactions from wallets like MetaMask.
Frontend bugs where ETH value is unintentionally attached.
Scripted interactions / bots that attach ETH by default.
Developers or integrators misunderstanding the payment logic (since the protocol uses USDC).
Because Ethereum transactions allow sending ETH to any payable function, the contract cannot prevent users from attaching ETH unless payable is removed.
Impact: High
Any ETH sent to mintNft or buy is permanently locked in the contract. Since the protocol exclusively uses USDC for all payments, payable serves no purpose. Users who accidentally send ETH alongside a transaction lose it forever — the owner has no mechanism to recover it
Add this test to NFTDealersTest.t.sol
Since ETH plays no role in the protocol, simply remove payable from both functions:
This prevents ETH from ever entering the contract. Or, if you plan to receive ETH, implement a withdraw function that withdraws ETH to the owner.
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.
The contest is complete and the rewards are being distributed.