Array's length value is used directly in loop (removeRewardMine/MiningService.sol) #90
Labels
bug
Something isn't working
duplicate
This issue or pull request already exists
G (Gas Optimization)
Handle
ye0lde
Vulnerability details
Impact
Additional gas usage when an array's length value is used directly in a for loop.
Proof of Concept
The array's length value is used directly in a for loop here:
https://github.com/code-423n4/2021-11-malt/blob/c3a204a2c0f7c653c6c2dda9f4563fd1dc1cecf3/src/contracts/MiningService.sol#L142-L145
Tools Used
Visual Studio Code, Remix
Recommended Mitigation Steps
Change the function removeRewardMine to:
The text was updated successfully, but these errors were encountered: