Project

One World
NFTDeFi
15,000 USDC
View results
Submission Details
Severity: low
Invalid

Redundant Currency Manager Update in setCurrencyManager Function

Summary

The setCurrencyManager function allows an administrator to update the contract's currencyManager address. However, there is no check to ensure that the newCurrencyManager address is different from the current currencyManager address. This could lead to unnecessary updates without actually changing the currencyManager.

Vulnerability Details

The setCurrencyManager function currently performs only one check: it ensures that the newCurrencyManager is not set to the zero address. However, it does not check if newCurrencyManager is already equal to the existing currencyManager address. This could lead to accidental or redundant updates that do not modify the contract state but still consume gas and can create misleading audit logs or administrative records.

Impact

The vulnerability is considered Low because it does not pose a significant security risk, but it could lead to gas wastage and create unnecessary updates. Additionally, it could clutter the contract's transaction history with redundant state changes that provide no real benefit.

Tools Used

None

Recommendations

Add a check to ensure that newCurrencyManager is different from the existing currencyManager address. Update the setCurrencyManager function as follows:

function setCurrencyManager(address newCurrencyManager) external onlyRole(DEFAULT_ADMIN_ROLE) {
require(newCurrencyManager != address(0), "Invalid address");
require(newCurrencyManager != address(currencyManager), "Address already set");
currencyManager = ICurrencyManager(newCurrencyManager);
}

This change will ensure that the currencyManager address is only updated when a new address is actually provided.

Updates

Lead Judging Commences

0xbrivan2 Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

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