Users may send more ether than the listing price to the marketplace, but the contract does not refund the excess ethers, an it does not contain any withdrawal function either. Consequently, the surplus ether will be locked within the contract forever.
For each Martenitsa token available for purchase, there is a listed price. Buyers must pay at least this price, and the marketplace will transfer the exact amount of ethers equal to the sale price to the seller. If a user sends more than the sale price, the excess ethers will be locked in the contract, as there is no withdrawal function. For instance, if Chasy sets a Martenitsa token's sale price at 1 wei, but a careless buyer like Bob mistakenly sends 1 ether through MartenitsaMarketplace::buyMartenitsa
, the excess 1 ether minus 1 wei tokens will be permanently locked in the contract.
A simple proof-of-concept is as follows:
The surplus ether remains indefinitely locked in the contract, and the negligent user will not receive a refund.
Manual Review, foundry testing
Send the excess ether back to the user, the transfer process should be careful and follow the check-effect-interaction pattern to prevent reentrancy issue.
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.