FlowERC1155

Git Source

Inherits: ICloneableV2, IFlowERC1155V4, FlowCommon, ERC1155

State Variables

sEvalHandleTransfer

True if the evaluable needs to be called on every transfer.

bool private sEvalHandleTransfer;

sEvaluable

The Evaluable that handles transfers.

Evaluable internal sEvaluable;

Functions

constructor

Forwards the FlowCommon constructor.

constructor(DeployerDiscoverableMetaV2ConstructionConfig memory config) FlowCommon(CALLER_META_HASH, config);

initialize

Overloaded typed initialize function MUST revert with this error. As per ICloneableV2 interface.

function initialize(FlowERC1155ConfigV2 memory) external pure;

initialize

function initialize(bytes calldata data) external initializer returns (bytes32);

supportsInterface

Needed here to fix Open Zeppelin implementing supportsInterface on multiple base contracts.

function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155, ERC1155Receiver) returns (bool);

_afterTokenTransfer

function _afterTokenTransfer(
    address operator,
    address from,
    address to,
    uint256[] memory ids,
    uint256[] memory amounts,
    bytes memory data
) internal virtual override;

stackToFlow

As per IFlowV4 but returns a FlowERC1155IOV1 instead of a FlowTransferV1.

function stackToFlow(uint256[] memory stack) external pure override returns (FlowERC1155IOV1 memory flowERC1155IO);

Parameters

NameTypeDescription
stackuint256[]The stack to convert to a FlowERC1155IOV1.

Returns

NameTypeDescription
flowERC1155IOFlowERC1155IOV1The FlowERC1155IOV1 representation of the stack.

flow

As per IFlowV4 but returns a FlowERC1155IOV1 instead of a FlowTransferV1 and mints/burns itself as an ERC1155 accordingly.

function flow(Evaluable memory evaluable, uint256[] memory callerContext, SignedContextV1[] memory signedContexts)
    external
    virtual
    returns (FlowERC1155IOV1 memory);

Parameters

NameTypeDescription
evaluableEvaluableThe Evaluable to use to evaluate the flow.
callerContextuint256[]The caller context to use to evaluate the flow.
signedContextsSignedContextV1[]The signed contexts to use to evaluate the flow.

Returns

NameTypeDescription
<none>FlowERC1155IOV1flowERC1155IO The FlowERC1155IOV1 representing all token mint/burns and transfers that occurred during the flow.

_stackToFlow

Wraps the standard LibFlow.stackToFlow function with the addition of consuming the mint/burn sentinels from the stack and returning them in the FlowERC1155IOV1.

function _stackToFlow(Pointer stackBottom, Pointer stackTop) internal pure returns (FlowERC1155IOV1 memory);

Parameters

NameTypeDescription
stackBottomPointerThe bottom of the stack.
stackTopPointerThe top of the stack.

Returns

NameTypeDescription
<none>FlowERC1155IOV1flowERC1155IO The FlowERC1155IOV1 representation of the stack.

_flow

Wraps the standard LibFlow.flow function to handle minting and burning of the flow contract itself. This involves consuming the mint/burn sentinels from the stack and minting/burning the tokens accordingly, then calling LibFlow.flow to handle the rest of the flow.

function _flow(Evaluable memory evaluable, uint256[] memory callerContext, SignedContextV1[] memory signedContexts)
    internal
    virtual
    nonReentrant
    returns (FlowERC1155IOV1 memory);