Core Contracts

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

Last update timestamp is a single value for all house prices

Summary

In the RAACHousePrices contract when call the setHousePrice we update the lastUpdateTimestamp each time a house price is update. This is incorrect as each house price should have a individual last lastUpdateTimestamp.

Vulnerability Details

Whenever we receive a price update for a house we only store the latest update timestamp for any a house price update. This will be inaccurate if we decide to implement stalness of house price in the LendingPool contract(currently it is missing, but it is recommanded that price oracles are checked for prices stalness).

Impact

Last price update could be inaccurate if we start checking price stalness for houses

Tools Used

Manual Review

Recommendations

Add an extra mapping to the RAACHousePrices contract that stores the last update timestamp for a house token id:

contract RAACHousePrices is Ownable {
+ mapping(uint256 => uint256) public tokenToLastHousePriceUpdate;
....
function setHousePrice(
uint256 _tokenId,
uint256 _amount
) external onlyOracle {
tokenToHousePrice[_tokenId] = _amount;
- lastUpdateTimestamp = block.timestamp;
+ tokenToLastHousePriceUpdate[_tokenId] = block.timestamp;
emit PriceUpdated(_tokenId, _amount);
}
....
Updates

Lead Judging Commences

inallhonesty Lead Judge 7 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 7 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.

Give us feedback!