Pieces Protocol

First Flight #32
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: high
Invalid

Lack of "price" check can lead to loss of contract integrity and price manipulation.

Summary:

TokenDivider is missing a "require" check in the function "sellErc20" that can exploit the "price" to sell the tokens at without paying for them.

Vulnerability Details:

Affected code lines 221-242

relates back to "price" having no require statement in the function "sellErc20()" which can lead to a loss of contract integrity, meaning that it breaks assumptions made elsewhere in the codebase wherever it is used for calculations and is a business logic flaw. Price manipulation then becomes possible because there is no set price for the "price" to sell at and a malicious actor could create malicious "sell orders" and drain the tokens from the "buy" orders.

Impact:

High

  1. Price manipulation

  2. Contract integrity loss

Tools Used:

Foundry

Recommendations:

include a "require" in the function "sellErc20()" check to ensure that a price is set for the tokens in the function and it functions correctly throughout its use places in the smart contract.

Updates

Lead Judging Commences

fishy Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

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