LibEncodedDispatch

Git Source

Establishes and implements a convention for encoding an interpreter dispatch. Handles encoding of several things required for efficient dispatch.

Functions

encode2

Builds an EncodedDispatch from its constituent parts.

function encode2(address expression, SourceIndexV2 sourceIndex, uint256 maxOutputs)
    internal
    pure
    returns (EncodedDispatch);

Parameters

NameTypeDescription
expressionaddressThe onchain address of the expression to run.
sourceIndexSourceIndexV2The index of the source to run within the expression as an entrypoint.
maxOutputsuint256The maximum outputs the caller can meaningfully use. If the interpreter returns a larger stack than this it is merely wasting gas across the external call boundary.

Returns

NameTypeDescription
<none>EncodedDispatchThe encoded dispatch.

decode2

function decode2(EncodedDispatch dispatch) internal pure returns (address, SourceIndexV2, uint256);