Pieces Protocol

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

Lack of withdraw function

Summary

Implementing this function will allow users to safely withdraw their funds or tokens from the contract.

Vulnerability Details

Including a withdraw function is crucial for allowing users to retrieve their funds or tokens from the contract

Impact

Founds sended to contract will be lock.

Tools Used

manual review

Recommendations

Please add withdrawEther function.

function withdrawEther(uint256 amount) external {
require(balances[msg.sender] >= amount, "Insufficient balance");
balances[msg.sender] -= amount;
payable(msg.sender).transfer(amount);
}
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.