CalldataExtractor
Last updated
Last updated
Library for extracting specific chunks of calldata based on configured offsets used in configurable hooks to extract 32 byte chunks from calldata and check them against expected values in the merkle tree
Extract 32-byte chunks from calldata based on config offsets
Number of provided offsets must be <= 16 because that's how many fit in uint256
Calldata must be at least 36 bytes long to be considered valid
All math is unchecked because we validate everything before doing any operations
function extract(bytes memory callData, uint256 calldataOffsetsPacked, uint256 calldataOffsetsCount)
internal
pure
returns (bytes memory);
Parameters
callData
bytes
The calldata to extract from
calldataOffsetsPacked
uint256
Packed 16-bit extraction offsets
calldataOffsetsCount
uint256
Number of extractions to perform
Returns
<none>
bytes
result Concatenated byte values at specific offsets
error Aera__ExtractionNumberTooLarge();
error Aera__CalldataTooShort();
error Aera__OffsetOutOfBounds();