The sellErc20
function in TokenDivider.sol does not properly validate the price
parameter, allowing it to be set to 0.
The price
parameter is used in the SellOrder
struct creation.
Setting price
to 0 means creating a SellOrder
with a price of 0.
The vulnerability occurs because there's no validation for the price
parameter before creating the SellOrder
.
This allows for the creation of orders with zero value, which could disrupt the intended functionality of the contract.
Market Manipulation: An attacker could create sell orders with price=0, flooding the market with unattractive orders.
Gas Waste: The contract will still process these orders, potentially wasting gas on unnecessary operations.
manual review
Add a check for price > 0
before creating the SellOrder
. If price
is 0, revert the transaction with an appropriate error message.
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.