The getPrice()
function in the auction contract does not properly account for cases where integer rounding or misconfiguration may cause the price to return zero or unexpected values. This can result in users being able to buy tokens for free or auction dynamics behaving incorrectly.
Solidity rounds down in integer division, which may result in unexpected zero values in price calculation.
If startingPrice - reservePrice
is small and time calculations do not distribute evenly, price adjustments may become zero, causing getPrice()
to return startingPrice
or lower values earlier than expected.
Misconfiguration Can Cause Unexpected Behavior
If startingPrice == reservePrice
, price calculation is always zero, making the auction ineffective.
If reservePrice > startingPrice
, subtraction results in negative overflow (though Solidity prevents negative unsigned integers, this will return an unintended price).
Impact
manual review
Modify the function to ensure the price never drops below reservePrice
:
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.