Pieces Protocol

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

Stuck Ether in the Contract Due to Lack of Withdraw Function

Summary

The buyOrder function allows users to send Ether to the contract for purchasing tokens. However, in scenarios where there is an overpayment (due to user error or miscalculations in the function), the excess Ether sent to the contract remains stuck, as there is no mechanism for withdrawing the trapped funds.

Vulnerability Details

Impact

Any Ether accidentally overpaid by the buyer is permanently stuck in the contract.

Ether left in the contract as a result of a calculation error in buyerOrder is stuck in the contract

Tools Used

Manual Review

Recommendations

Add a withdrawEther function to allow the contract owner to recover stuck Ether in the contract.

Updates

Lead Judging Commences

fishy Lead Judge 8 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.