Core Contracts

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

its irrelivant, as any token id price update will up date lastUpdateTimestamp

Summary

Vulnerability Details

RAACHousePrices.sol is a Contract for managing house prices associated with RAAC tokens.

it has a mapping mapping(uint256 => uint256) public tokenToHousePricethat Maps from RAAC tokenId to house price in USD and a state variable lastUpdateTimestampfor Timestamp of the last price update.

setHousePrice()function called from RAACHousePriceOracle :: _processResponse()to set corresponding HouseId's price

function _processResponse(bytes memory response) internal override {
uint256 price = abi.decode(response, (uint256));
housePrices.setHousePrice(lastHouseId, price);
emit HousePriceUpdated(lastHouseId, price);
}

https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/oracles/RAACHousePriceOracle.sol#L42-L46

function setHousePrice(
uint256 _tokenId,
uint256 _amount
) external onlyOracle {
tokenToHousePrice[_tokenId] = _amount;
lastUpdateTimestamp = block.timestamp; // @audit-issue irrelivant, as any token id price update will up date lastUpdateTimestamp
emit PriceUpdated(_tokenId, _amount);
}

https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/primitives/RAACHousePrices.sol#L49-L59

But here problem when setHousePrice() update price of any HouseID lastUpdateTimestampget updated. So when protocol goes for staleness check for those HouseID prices it will give them inccorect answer, as very old HouseId price will show that these are recently updated

i think its irrelevant, there should be another mapping that indicates which HouseID price updated when, that will helps in staleness check(to determine price is recent one OR updated long time ago).

Impact

Some HouseIds prices could very old

Tools Used

manual review

Recommendations

Like we are tracking HouseId to Price, maintain a same type of mapping to track HouseId to LastupdatedTimestamp for that tokenmapping(uint256 => uint256) public tokenToHousePrice

mapping(uint256 => uint256) public tokenToLastUpdatedTime
function setHousePrice(
uint256 _tokenId,
uint256 _amount
) external onlyOracle {
tokenToHousePrice[_tokenId] = _amount;
tokenToLastUpdatedTime[_tokenId] = block.timestamp;
emit PriceUpdated(_tokenId, _amount);
}
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.