_whitelistedCurrencies.length
in currencymanager.sol
is read from storage when trying to access function viewWhitelistedCurrencies
. we can save gas by assigning it to memory
https://github.com/Cyfrin/2024-11-one-world/blob/1e872c7ab393c380010a507398d4b4caca1ae32b/contracts/dao/CurrencyManager.sol#L92
more gas cost
manual view
assign _whitelistedCurrencies.length
to a local variable
example
uint256 totalCurrencies = _whitelistedCurrencies.length();
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.