The buyOrder
function lacks a mechanism to refund excess ETH when buyers send more than the required amount for a purchase. Any excess ETH sent becomes trapped in the contract.
The buyOrder
function only validates that the sent ETH meets minimum requirements but doesn't handle excess amounts:
The function validates:
That sent ETH covers the order price (msg.value < order.price
)
That sent ETH covers price plus fees (msg.value < order.price + sellerFee
)
However, there is no mechanism to:
Check for excess ETH sent above these requirements
Return any excess back to the sender
Prevent users from accidentally overpaying
Users who accidentally send more ETH than required will lose their excess funds
These excess funds become permanently trapped in the contract
No mechanism exists to recover these funds
Manual review
Implement a refund mechanism for excess ETH. After buying and deducting the required ETH, return any excess ETH to the user.
This ensures users receive back any ETH sent above the required amount, preventing accidental loss of funds.
The extra eth sent by the user in the buy order will be locked in the contract forever
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.