Core Contracts

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

Constructor Fails to Validate End Time or any time period

Summary

The constructor in the provided Solidity code does not validate whether the endTime is greater than startTime. This oversight could potentially lead to logical errors in the auction contract, disrupting the proper functioning of the auction.

Vulnerability Details

The aunction contract is used to create aunctions for users intending to by zeno tokens while transferring usdc to the aunction contract. The issue lies in constructor part of the contract which fails to validate the two time standpoints of the aunction, being the start time and the end time. In a scenario where the end time is misappropriately lower than the start time, the aunction might end just before it started leading to a failed aunction process, also whenever users endeavour to participate in the aunction, the current timestamo is used to assess if they are still eligible to partcipate using the "whenActive" modifier, now the current timestamp was not in any way used to check if the start time or end time is not going to be in the past during the creation of the aunction.

constructor(
address _zenoAddress,
address _usdcAddress,
address _businessAddress,
uint256 _startTime,
uint256 _endTime,
uint256 _startingPrice,
uint256 _reservePrice,
uint256 _totalAllocated,
address _initialOwner
) Ownable(_initialOwner) {
zeno = ZENO(_zenoAddress);
usdc = IUSDC(_usdcAddress);
businessAddress = _businessAddress;
state = AuctionState({
startTime: _startTime,//start time can be equal to end time
endTime: _endTime,//end time can be less than start time
startingPrice: _startingPrice,
reservePrice: _reservePrice,
totalAllocated: _totalAllocated,
totalRemaining: _totalAllocated,
lastBidTime: 0,
lastBidder: address(0)
});
}

Impact

Dos for intending buyers as aunctions may end before they actually start.

Tools Used

manual review

Recommendations

To appropriate ensure irregularity with time during aunction creation the following measures should be implemented:
-Ensure the start time and end time are greater than the block time stamp during the aunction creation.

-Ensure the end time is not less than the start time

-Hard code a time period interval for the aunction which ensures that the start tim and end time are never the same

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!