Skip to content

Commit

Permalink
fix(claim): cache variable outside loop
Browse files Browse the repository at this point in the history
  • Loading branch information
PierrickGT committed Sep 7, 2023
1 parent 2c8b3de commit 8b45d38
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Claimer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,11 @@ contract Claimer is Multicall {
uint96 _feePerClaim
) internal returns (uint256) {
uint256 actualClaimCount;
uint256 prizeIndicesLength;

// `_winners.length` is not cached cause via-ir would need to be used
for (uint256 w = 0; w < _winners.length; w++) {
uint256 prizeIndicesLength = _prizeIndices[w].length;
prizeIndicesLength = _prizeIndices[w].length;
for (uint256 p = 0; p < prizeIndicesLength; p++) {
try
_vault.claimPrize(_winners[w], _tier, _prizeIndices[w][p], _feePerClaim, _feeRecipient)
Expand Down

0 comments on commit 8b45d38

Please sign in to comment.