Pieces Protocol

First Flight #32
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: low
Valid

Surplus ETH Sent to `TokenDivider::buyOrder` Becomes Irretrievable Due to Lack of Reimbursement Mechanism

Vulnerability Details

TokenDivider::buyOrder is called by users to purchase an order from a seller, and users must set a msg.value according to the price of the sell order they wish to buy. However, there is no mechanism to reimburse any surplus ETH sent if msg.value > order.price + sellerFee.

Impact

Loss of ETH for users, with the surplus ETH becoming stuck in the contract due to the absence of a withdrawal function.

Recommendations

Revert the transaction if msg.value > order.price + sellerFee, or implement a mechanism to reimburse users in the event of a surplus msg.value.

Updates

Lead Judging Commences

fishy Lead Judge 5 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Token misshandling

The extra eth sent by the user in the buy order will be locked in the contract forever

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.