CalldataExtractor

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

Functions

extract

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

Name
Type
Description

callData

bytes

The calldata to extract from

calldataOffsetsPacked

uint256

Packed 16-bit extraction offsets

calldataOffsetsCount

uint256

Number of extractions to perform

Returns

Name
Type
Description

<none>

bytes

result Concatenated byte values at specific offsets

Errors

Aera__ExtractionNumberTooLarge

error Aera__ExtractionNumberTooLarge();

Aera__CalldataTooShort

error Aera__CalldataTooShort();

Aera__OffsetOutOfBounds

error Aera__OffsetOutOfBounds();

Last updated