Core Contracts

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

[M-6] Inconsistent Access Control in `setHousePrice`

Description:
The function setHousePrice in RAACHousePrices.sol is meant to allow the owner to set the house price for a given token, as stated in the function comment. However, the actual implementation restricts this action to the oracle (onlyOracle) instead of the owner. This discrepancy creates confusion about who has the authority to update house prices.

Impact:

  • Misleading Documentation: The comment suggests owner control, but only the oracle can set prices. This can lead to incorrect assumptions by developers and auditors.

  • Potential Incorrect Role Assignment: If the intention was to give price-setting authority to the owner, using onlyOracle may be an implementation error, potentially limiting the contract’s flexibility.

Proof of Concept:

function setHousePrice(
uint256 _tokenId,
uint256 _amount
) external onlyOracle { //@audit Comment says "owner" but restricted to "oracle"
tokenToHousePrice[_tokenId] = _amount;
lastUpdateTimestamp = block.timestamp;
emit PriceUpdated(_tokenId, _amount);
}

Recommended Mitigation:

  • Clarify Intent: If the oracle should set prices, update the comment to reflect that accurately.

  • Fix Access Control: If the owner should set prices, replace onlyOracle with onlyOwner or allow both roles (onlyOwnerOrOracle).

Updates

Lead Judging Commences

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

RAACHousePrices implementation restricts setHousePrice to oracle only despite documentation stating owner access, preventing manual price corrections during oracle failures

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

RAACHousePrices implementation restricts setHousePrice to oracle only despite documentation stating owner access, preventing manual price corrections during oracle failures

Support

FAQs

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