Core Contracts

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

Incorrect Timestamp Tracking in RAACHousePrices Contract May Lead to Inaccurate Data

Summary

The getLatestPrice function in the RAACHousePrices contract returns a single lastUpdateTimestamp for all tokens, which is not specific to each token. This could lead to inaccurate timestamp data for tokens, especially if one token's price is updated while others are not.

Vulnerability Details

https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/core/primitives/RAACHousePrices.sol#L37

Currently, the contract tracks the timestamp of the last price update globally:

uint256 public lastUpdateTimestamp;

This lastUpdateTimestamp is shared across all token prices. However, when calling getLatestPrice, the function returns this global timestamp instead of tracking individual timestamps for each token. This could result in misleading data because the timestamp returned for all tokens will always reflect the most recent update, even if that update was for a different token. In reality, each token should have its own timestamp to accurately track the last update for that specific token.

Impact

The lastUpdateTimestamp returned for any token could be outdated and not reflect the actual last update for that specific token.

Tools Used

Manual review

Recommendations

Update the contract to store and track the timestamp for each token individually, rather than using a global timestamp. For example:

mapping(uint256 => uint256) public tokenIdToLastUpdateTimestamp;
function getLatestPrice(uint256 _tokenId) external view returns (uint256, uint256) {
return (tokenToHousePrice[_tokenId], tokenIdToLastUpdateTimestamp[_tokenId]);
}
Updates

Lead Judging Commences

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

RAACHousePrices uses a single global lastUpdateTimestamp for all NFTs instead of per-token tracking, causing misleading price freshness data

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

RAACHousePrices uses a single global lastUpdateTimestamp for all NFTs instead of per-token tracking, causing misleading price freshness data

Support

FAQs

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