Core Contracts

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

Missing Same-Value Checks in Setter Functions

Summary

Several setter functions in the LendingPool contract do not check if the new value is the same as the current value before updating it. This can result in unnecessary transactions, leading to increased gas costs without any state change. However, a similar function (setStabilityPool) correctly implements this check.

Affected Functions

  • setPrimeRate(uint256 newPrimeRate)

  • setPrimeRateOracle(address newOracle)

  • setProtocolFeeRate(uint256 newProtocolFeeRate)

  • setCurveVault(address newVault)

Vulnerability Details

These functions directly update contract storage variables without verifying whether the new value is the same as the existing value. This oversight can lead to redundant state updates and unnecessary gas consumption.

For example, in setPrimeRateOracle:

function setPrimeRateOracle(address newOracle) external onlyOwner {
// Missing check: should ensure `newOracle != primeRateOracle`
primeRateOracle = newOracle;
}

However, the setStabilityPool function properly validates the same-value condition:

function setStabilityPool(address newStabilityPool) external onlyOwner {
if (newStabilityPool == address(0)) revert AddressCannotBeZero();
if (newStabilityPool == stabilityPool) revert SameAddressNotAllowed(); // Correct check
address oldStabilityPool = stabilityPool;
stabilityPool = newStabilityPool;
emit StabilityPoolUpdated(oldStabilityPool, newStabilityPool);
}

Recommendation

Add same-value checks to all affected functions. Example fix for setPrimeRateOracle:

function setPrimeRateOracle(address newOracle) external onlyOwner {
if (newOracle == primeRateOracle) revert SameAddressNotAllowed();
primeRateOracle = newOracle;
}

Severity: Low

  • Impact: Low (no direct security or financial risk, but inefficient gas usage)

  • Likelihood: Medium (setters are likely to be used, leading to inefficiencies)

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Appeal created

theirrationalone Submitter
7 months ago
inallhonesty Lead Judge
7 months ago
inallhonesty Lead Judge 6 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!