In RAACHousePrices contract the setHousePrice function is used to set the price of a house via the Oracle. It updates the price of a RAAC token ID and then updates the global lastUpdateTimestamp variable to the current block timestamp. But this creates an issue in getLatestPrice since it returns the price of a house and the last updated time, which wrongfully would equal to the time of the last updated RAAC token ID.
Steps to reproduce:
Oracle updates the price of token ID 10.
The tokenToHousePrice updates the price of the 10th token and the lastUpdateTimestamp is updated.
getLatestPrice is called for token ID 3, the function wrongfully returns the last updated time of token ID 10.
Results in wrong information about the last time when the RAAC token ID price was updated, the price could be stale but the lastUpdatedTimeStamp might be recent since its the time of the last updated token.
Manual Review
Use mapping for lastUpdateTimestamp
mapping(uint256 tokenID => uint256 time) public lastUpdateTimestamp
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.