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.
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.
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.
Manual code review
Add a duplicate check before pushing the new entry.
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.