Core Contracts

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

Lack of functionality of Bid Tracking in Auction Contract

Summary

The Auction contract currently only records the latest bid by storing a single bidder in state.lastBidder and updating a cumulative bid amount in bidAmounts. This approach overwrites previous bids, failing to maintain a complete record of all bids as expected by the IAuction interface, which requires tracking each bid individually.

Vulnerability Details

  • Current Implementation:
    In the buy function, the contract updates bid-related state variables as follows:

    bidAmounts[msg.sender] += amount;
    state.lastBidTime = block.timestamp;
    state.lastBidder = msg.sender;

    This logic only retains the details of the most recent bid by any bidder. There is no mechanism to store each bid separately.

  • Expected Behavior:
    The IAuction interface suggests the existence of a structure like:

    struct Bid {
    address bidder;
    uint256 amount;
    }

    This structure should be used to store every bid made during the auction. However, the current implementation neglects this, leading to the loss of bid history.

Impact

Overwriting bid data means that previous bids are lost, which could be crucial for auditability, transparency, and handling disputes.

Tools Used

Manual Review

Recommendations

Implement a data structure to store each bid individually. For example, create a dynamic array of Bid structs to record every bid, ensuring that all bid information is preserved. Adjust the buy function to push each new bid into this array, and update the IAuction interface to reflect this bid tracking mechanism.

Example code fix:

struct Bid {
address bidder;
uint256 amount;
}
Bid[] public bids;
function buy(uint256 amount) external whenActive {
require(amount <= state.totalRemaining, "Not enough ZENO remaining");
uint256 price = getPrice();
uint256 cost = price * amount;
require(usdc.transferFrom(msg.sender, businessAddress, cost), "Transfer failed");
// Record the bid
bids.push(Bid({ bidder: msg.sender, amount: amount }));
bidAmounts[msg.sender] += amount;
state.totalRemaining -= amount;
state.lastBidTime = block.timestamp;
state.lastBidder = msg.sender;
zeno.mint(msg.sender, amount);
emit ZENOPurchased(msg.sender, amount, price);
}

This change ensures that all bids are recorded, providing a complete and transparent bid history for the auction.

Updates

Lead Judging Commences

inallhonesty Lead Judge
9 months ago
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!