Core Contracts

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

Users can't buy ZENO for the start price

Summary

Incorrect condition in the whenActive modifier makes it impossible to buy ZENO for the state.startingPrice price. So users will always buy ZENO at a discount which causes some losses for the protocol.

Vulnerability Details

The Auction.whenActive modifier prevents buying when block.timestamp == state.startTime:

modifier whenActive() {
>> require(block.timestamp > state.startTime, "Auction not started");
require(block.timestamp < state.endTime, "Auction ended");
_;
}

This way users can buy ZENO only at a discount:

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

Impact

Unintended behavior, some losses

Tools used

Manual Review

Recommendations

Consider starting an auction at the state.startTime:

modifier whenActive() {
- require(block.timestamp > state.startTime, "Auction not started");
+ require(block.timestamp => state.startTime, "Auction not started");
require(block.timestamp < state.endTime, "Auction ended");
_;
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!