The constructor does not validate that reservePrice is less than or equal to startingPrice. If reservePrice > startingPrice, the getPrice() function will return a negative value, which is invalid in Solidity and can cause unexpected behavior.
The getPrice() function calculates the price using this formula:
If state.reservePrice > state.startingPrice, then:
(state.startingPrice - state.reservePrice) becomes negative.
This results in an invalid subtraction operation, potentially breaking the contract’s logic.
Since Solidity does not support negative numbers in uint256 arithmetic, this underflow will likely cause a revert or unintended behavior.
Contract Malfunction: The auction may not function correctly, as the getPrice() calculation will break, potentially leading to a revert or incorrect price values.
Bid Rejection: Users may be unable to place bids if price calculations fail due to underflow.
Auction Fails: If the auction price mechanism is broken, no valid bids can be placed, rendering the auction useless.
Manual Review
reservePrice ≤ startingPriceModify the constructor to validate input values and prevent this issue:
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.