1. Cache length of array before loop to optimize gas #106
Labels
bug
Something isn't working
duplicate
This issue or pull request already exists
G (Gas Optimization)
Handle
xYrYuYx
Vulnerability details
Impact
We can cache length of array before loop, to optimize gas.
https://github.com/code-423n4/2021-11-nested/blob/main/contracts/OperatorResolver.sol#L45
https://github.com/code-423n4/2021-11-nested/blob/main/contracts/OperatorResolver.sol#L56
https://github.com/code-423n4/2021-11-nested/blob/main/contracts/FeeSplitter.sol#L108
https://github.com/code-423n4/2021-11-nested/blob/main/contracts/FeeSplitter.sol#L125
https://github.com/code-423n4/2021-11-nested/blob/main/contracts/FeeSplitter.sol#L227
https://github.com/code-423n4/2021-11-nested/blob/main/contracts/MixinOperatorResolver.sol#L32
https://github.com/code-423n4/2021-11-nested/blob/main/contracts/MixinOperatorResolver.sol#L48
Tools Used
Manual
Recommended Mitigation Steps
Cache length
The text was updated successfully, but these errors were encountered: