Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: low
Valid

no one can buy at exactly `endTime` in Auction.sol even though the modifier allows it

Summary

No one can buy zeno tokens at exactly endTime, even though getPrice() still provides a valid price because the modifier uses < not <=.

Vulnerability Details

The modifier modifier whenActive()only allows for buying at exactly less thanendtime`

require(block.timestamp < state.endTime, "Auction ended");

however getPrice still appears to get zeno token price at the endtime and return it to the buy function

function getPrice() public view returns (uint256) {
if (block.timestamp < state.startTime) return state.startingPrice;
*** if (block.timestamp >= state.endTime) return state.reservePrice;

hence buyers will be able got get the prices at endtime but will not be able to purchase the tokens

Tools Used

manual search

Recommendations

change the modifier sign of state.endTime from < to <=
or
getPrice state.endTime from > to >=

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Auction.sol's whenActive modifier prevents bidding at endTime when price reaches reservePrice, contradicting documentation and preventing purchases at the intended floor price

Support

FAQs

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