Array Modification:
In the removeWhitelistedChain
function, modifying arrays can be expensive, especially if the array is long. Consider using a mapping for more efficient removal.
The removeWhitelistedChain
function in the SDLPoolCCIPControllerPrimary
contract attempts to remove a whitelisted chain and its associated data from various arrays. However, the implementation employs a loop through the whitelistedChains
array to find the index of the chain to be removed. This approach may lead to higher gas costs and potential inefficiencies, especially when the array is long
Results in higher gas costs, particularly problematic with an increasing number of whitelisted chains.
Compromises scalability due to inefficient whitelisted chain removal.
Raises operational costs with increased gas consumption.
Manual Reviews
Consider refactoring the implementation to use a mapping instead of an array for storing whitelisted chains. This approach would enhance gas efficiency when adding or removing whitelisted chains, providing a more scalable and cost-effective solution.
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.