Dria

Swan
NFTHardhat
21,000 USDC
View results
Submission Details
Severity: low
Invalid

Potential Duplication of Market Parameters in `setMarketParameters(...)`

Summary

The setMarketParameters(...) function in SwanManager.sol contract pushes a new market parameter entry to the marketParameters array without any checks for duplicate entries. This could lead to unnecessary duplication of identical or near-identical entries in the array, potentially leading to data bloat and redundant storage costs.

Vulnerability Details

  • Location: setMarketParameters function in the contract

  • Issue: Each call to setMarketParameters appends a new entry to the marketParameters array, even if the new entry is identical to the last entry. This can result in duplicated entries and inefficient storage usage, particularly if frequent updates are made with minimal changes to the parameters.

Impact

Duplicate entries in the marketParameters array could lead to inefficiencies in storage, increasing gas costs for storage access and potentially making it more difficult to access the latest unique parameters in future functions. Over time, this could degrade the contract’s efficiency and readability.

Tools Used

  • Manual code review

Recommendations

Add a duplicate check before pushing the new entry.

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 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.