Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
Submission Details
Severity: medium
Invalid

Auction Price Calculation Integer Underflow

Author Revealed upon completion

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.

Updates

Lead Judging Commences

inallhonesty Lead Judge 8 days ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

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