@@ -182,28 +182,28 @@ library ERC7579Utils {
182
182
if (bufferLength < 32 ) revert ERC7579DecodingError ();
183
183
184
184
// Get the offset of the array (pointer to the array length).
185
- uint256 arrayLengthPointer = uint256 (bytes32 (executionCalldata[0 :32 ]));
185
+ uint256 arrayLengthOffset = uint256 (bytes32 (executionCalldata[0 :32 ]));
186
186
187
- // The array length (at arrayLengthPointer ) should be 32 bytes long. We check that this is within the
187
+ // The array length (at arrayLengthOffset ) should be 32 bytes long. We check that this is within the
188
188
// buffer bounds. Since we know bufferLength is at least 32, we can subtract with no overflow risk.
189
- if (arrayLengthPointer > bufferLength - 32 ) revert ERC7579DecodingError ();
189
+ if (arrayLengthOffset > bufferLength - 32 ) revert ERC7579DecodingError ();
190
190
191
- // Get the array length. arrayLengthPointer + 32 is bounded by bufferLength so it does not overflow.
192
- uint256 arrayLength = uint256 (bytes32 (executionCalldata[arrayLengthPointer:arrayLengthPointer + 32 ]));
191
+ // Get the array length. arrayLengthOffset + 32 is bounded by bufferLength so it does not overflow.
192
+ uint256 arrayLength = uint256 (bytes32 (executionCalldata[arrayLengthOffset:arrayLengthOffset + 32 ]));
193
193
194
194
// Check that the buffer is long enough to store the array elements as "offset pointer":
195
195
// - each element of the array is an "offset pointer" to the data.
196
196
// - each "offset pointer" (to an array element) takes 32 bytes.
197
197
// - validity of the calldata at that location is checked when the array element is accessed, so we only
198
198
// need to check that the buffer is large enough to hold the pointers.
199
199
//
200
- // Since we know bufferLength is at least arrayLengthPointer + 32, we can subtract with no overflow risk.
200
+ // Since we know bufferLength is at least arrayLengthOffset + 32, we can subtract with no overflow risk.
201
201
// Solidity limits length of such arrays to 2**64-1, this guarantees `arrayLength * 32` does not overflow.
202
- if (arrayLength > type (uint64 ).max || bufferLength - arrayLengthPointer - 32 < arrayLength * 32 )
202
+ if (arrayLength > type (uint64 ).max || bufferLength - arrayLengthOffset - 32 < arrayLength * 32 )
203
203
revert ERC7579DecodingError ();
204
204
205
205
assembly ("memory-safe" ) {
206
- executionBatch.offset := add (add (executionCalldata.offset, arrayLengthPointer ), 32 )
206
+ executionBatch.offset := add (add (executionCalldata.offset, arrayLengthOffset ), 32 )
207
207
executionBatch.length := arrayLength
208
208
}
209
209
}
0 commit comments