Summary
The function getPrice() in Auction.sol contains a potential integer underflow issue when startingPrice = _reservePrice, "Invalid price range");
startingPrice = _startingPrice;
reservePrice = _reservePrice;
// ... existing logic ...
}
Fix 2: Prevent Underflow in getPrice()
Modify the price calculation logic to ensure it never falls below reservePrice:
uint256 priceDrop = ((state.startingPrice - state.reservePrice) * (block.timestamp - state.startTime)) / (state.endTime - state.startTime);
uint256 currentPrice = state.startingPrice > priceDrop ? state.startingPrice - priceDrop : state.reservePrice;
return currentPrice;
This ensures:
The auction price never goes negative.
If startingPrice < reservePrice, the price remains at reservePrice, preventing exploits.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
View preliminary resultsAppeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.