IFlowV3
Functions
previewFlow
"Dry run" of a flow, returning the resulting token transfers without actually executing them.
function previewFlow(
Evaluable calldata evaluable,
uint256[] calldata callerContext,
SignedContextV1[] calldata signedContexts
) external view returns (FlowTransferV1 calldata flowTransfer);
Parameters
Name | Type | Description |
---|---|---|
evaluable | Evaluable | The evaluable to evaluate. |
callerContext | uint256[] | The caller context to use when evaluating the flow. |
signedContexts | SignedContextV1[] | The signed contexts to use when evaluating the flow. |
flow
Given an evaluable, caller context, and signed contexts, evaluate the evaluable and return the resulting flow transfer. MUST process the flow transfer atomically, either all of it succeeds or none of it succeeds. MUST revert if the evaluable is not registered with the flow contract. MUST revert if the evaluable reverts. MUST revert if the evaluable returns a stack that is malformed. MUST revert if the evaluable returns a stack that contains a token transfer that is not allowed by the flow contract (e.g. if a token is being moved from an address that is not the caller or the flow contract).
function flow(Evaluable calldata evaluable, uint256[] calldata callerContext, SignedContextV1[] calldata signedContexts)
external
returns (FlowTransferV1 calldata flowTransfer);
Parameters
Name | Type | Description |
---|---|---|
evaluable | Evaluable | The evaluable to evaluate. |
callerContext | uint256[] | The caller context to pass to the evaluable. |
signedContexts | SignedContextV1[] | The signed contexts to pass to the evaluable. |
Returns
Name | Type | Description |
---|---|---|
flowTransfer | FlowTransferV1 | The resulting flow transfer. |
Events
Initialize
MUST be emitted when the flow contract is initialized.
event Initialize(address sender, FlowConfig config);
Parameters
Name | Type | Description |
---|---|---|
sender | address | The EOA that deployed the flow contract. |
config | FlowConfig | The list of evaluable configs that define the flows. |