Skip to content

Commit

Permalink
fix: use slice
Browse files Browse the repository at this point in the history
  • Loading branch information
Amuhar committed Feb 24, 2025
1 parent 65c89e6 commit ad2158d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions contracts/0.8.9/oracle/ValidatorsExitBus.sol
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ contract ValidatorsExitBus is AccessControlEnumerable {

uint256 lastDeliveredKeyIndex = requestStatus.deliveredItemsCount - 1;

bytes memory pubkeys = new bytes(keyIndexes.length * PUBLIC_KEY_LENGTH);
bytes memory pubkeys;

for (uint256 i = 0; i < keyIndexes.length; i++) {
if (keyIndexes[i] >= requestStatus.totalItemsCount) {
Expand All @@ -104,10 +104,7 @@ contract ValidatorsExitBus is AccessControlEnumerable {
}

uint256 requestOffset = keyIndexes[i] * PACKED_REQUEST_LENGTH + 16;

for (uint256 j = 0; j < PUBLIC_KEY_LENGTH; j++) {
pubkeys[i * PUBLIC_KEY_LENGTH + j] = data[requestOffset + j];
}
pubkeys = bytes.concat(pubkeys, data[requestOffset:requestOffset + PUBLIC_KEY_LENGTH]);
}

IWithdrawalVault(withdrawalVaultAddr).addFullWithdrawalRequests{value: requestsFee}(pubkeys);
Expand Down

0 comments on commit ad2158d

Please sign in to comment.