Incorrect NatSpec Tag in removeRateOracle() Misrepresents Function Reference
The removeRateOracle() function in RateOracleRegistry.sol has a NatSpec comment that incorrectly references the addRateOracle function instead of the correct removeRateOracle function. This misdocumentation could confuse developers, auditors, and automated tools, but does not affect contract execution or security.
Originally disclosed on Immunefi
- Disclosed after under an hour
# #43971 \[SC-Insight] Incorrect NatSpec Tag in removeRateOracle() Misrepresents Function Reference
**Submitted on Apr 15th 2025 at 06:24:49 UTC by @Glitch\_Hunter for** [**Audit Comp | Spectra Finance**](https://immunefi.com/audit-competition/audit-comp-spectra-finance)
* **Report ID:** #43971
* **Report Type:** Smart Contract
* **Report severity:** Insight
* **Target:** <https://github.com/immunefi-team/Spectra-Audit-Competition/blob/main/src/RateOracleRegistry.sol>
* **Impacts:**
## Description
## Brief/Intro
The removeRateOracle() function in RateOracleRegistry.sol includes a NatSpec comment that incorrectly references IRateOracleRegistry-addRateOracle. This can mislead readers or automated tools, such as doc generators and IDEs, when tracing inheritance or interface implementation, resulting in misdocumentation or confusion.
## Vulnerability Details
The function in question contains this NatSpec tag:
```solidity
/** @dev See {IRateOracleRegistry-addRateOracle}. */
function removeRateOracle(address _pt, address _rateOracle) external override restricted {
```
However, this tag incorrectly refers to the addRateOracle function. It should point to the corresponding function in the interface:
```solidity
/** @dev See {IRateOracleRegistry-removeRateOracle}. */
```
This is particularly important for automated documentation tooling, interface verification, and clarity when reviewing inherited functionality or permissions in AccessManagedUpgradeable contracts.
## Impact Details
While this issue does not directly affect contract execution or security, it falls under documentation improvements that impact:
* Developer experience
* Audit trail clarity
* IDE integration and NatSpec tracing
* Public documentation consistency
Mistakenly referencing the wrong function misrepresents what behavior is inherited or overridden and may confuse future maintainers or auditors
## References
None
## Proof of Concept
## Proof of Concept
RateOracleRegistry.sol
```diff
--- /** @dev See {IRateOracleRegistry-addRateOracle}. */ // ❌ Incorrect reference
+++ /** @dev See {IRateOracleRegistry-removeRateOracle}. */ // �
Correct reference
function removeRateOracle(address _pt, address _rateOracle) external override restricted {
```Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a copy-paste error in the NatSpec comment, where the reference to addRateOracle was not updated to removeRateOracle.
Impact
This issue does not directly affect contract execution or security, but it may confuse future maintainers or auditors and mislead automated documentation tools.
What the attacker needed
None
The fix
The NatSpec comment should be corrected to reference IRateOracleRegistry-removeRateOracle instead of addRateOracle.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This is a documentation mistake in a smart contract. A comment meant to point to the correct function actually points to a different one, which could confuse people reading the code or tools that generate documentation. It does not change how the contract works or create a security hole.