The NatSpec documentation for the setHousePrice function incorrectly states that it allows the owner to set the house price for a token, while the implementation restricts access to accounts with the onlyOracle role. This discrepancy creates ambiguity regarding who is authorized to update house prices. Additionally, the function does not verify whether the token exists before updating its price.
NatSpec vs. Implementation Mismatch:
The NatSpec comment describes the function as being callable by the owner:
However, the function is defined with the onlyOracle modifier:
This mismatch leads to confusion about whether the function is intended to be restricted to the owner or to an oracle.
Access Control Confusion:
Stakeholders might assume that the owner is responsible for setting house prices when, in fact, only an account with the onlyOracle role can perform this operation. This can lead to misconfigurations and potential security gaps if the intended access control is not enforced.
Manual code review
Clarify the NatSpec Documentation:
If the intended caller is the oracle, update the NatSpec comment to reflect that the function allows the oracle (and not the owner) to set the house price:
Review and Adjust Access Control:
Determine the intended role:
If the owner should set the house price, change the modifier from onlyOracle to onlyOwner.
If the oracle is intended to set the price, ensure that the documentation and role management are updated accordingly.
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.