Skip to content

Commit

Permalink
iflow5
Browse files Browse the repository at this point in the history
  • Loading branch information
thedavidmeister committed Feb 28, 2024
1 parent 79b567f commit 3be5179
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
10 changes: 5 additions & 5 deletions src/concrete/basic/Flow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity =0.8.19;

import {ICloneableV2, ICLONEABLE_V2_SUCCESS} from "rain.factory/src/interface/ICloneableV2.sol";
import {FlowCommon, LibContext} from "../../abstract/FlowCommon.sol";
import {IFlowV4, MIN_FLOW_SENTINELS, FlowTransferV1} from "../../interface/unstable/IFlowV5.sol";
import {IFlowV5, MIN_FLOW_SENTINELS, FlowTransferV1} from "../../interface/unstable/IFlowV5.sol";
import {LibFlow} from "../../lib/LibFlow.sol";
import {LibUint256Matrix} from "rain.solmem/lib/LibUint256Matrix.sol";
import {Pointer} from "rain.solmem/lib/LibPointer.sol";
Expand All @@ -12,8 +12,8 @@ import {EvaluableV2} from "rain.interpreter.interface/lib/caller/LibEvaluable.so
import {SignedContextV1, EvaluableConfigV3} from "rain.interpreter.interface/interface/IInterpreterCallerV2.sol";

/// @title Flow
/// See `IFlowV4` docs.
contract Flow is ICloneableV2, IFlowV4, FlowCommon {
/// See `IFlowV5` docs.
contract Flow is ICloneableV2, IFlowV5, FlowCommon {
using LibUint256Matrix for uint256[];
using LibUint256Array for uint256[];

Expand All @@ -32,12 +32,12 @@ contract Flow is ICloneableV2, IFlowV4, FlowCommon {
return ICLONEABLE_V2_SUCCESS;
}

/// @inheritdoc IFlowV4
/// @inheritdoc IFlowV5
function stackToFlow(uint256[] memory stack) external pure virtual override returns (FlowTransferV1 memory) {
return LibFlow.stackToFlow(stack.dataPointer(), stack.endPointer());
}

/// @inheritdoc IFlowV4
/// @inheritdoc IFlowV5
function flow(EvaluableV2 memory evaluable, uint256[] memory callerContext, SignedContextV1[] memory signedContexts)
external
virtual
Expand Down
4 changes: 0 additions & 4 deletions src/concrete/erc20/FlowERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.sol";
import {LibNamespace, StateNamespace} from "rain.interpreter.interface/lib/ns/LibNamespace.sol";
import {UnsupportedHandleTransferInputs, InsufficientHandleTransferOutputs} from "../../error/ErrFlow.sol";

/// @dev The hash of the meta data expected to be passed to `FlowCommon`'s
/// constructor.
bytes32 constant CALLER_META_HASH = bytes32(0xff0499e4ee7171a54d176cfe13165a7ea512d146dbd99d42b3d3ec9963025acf);

/// @title FlowERC20
/// See `IFlowERC20V5` for documentation.
contract FlowERC20 is ICloneableV2, IFlowERC20V5, FlowCommon, ERC20 {
Expand Down
7 changes: 4 additions & 3 deletions src/interface/deprecated/v4/IFlowV4.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// SPDX-License-Identifier: CAL
pragma solidity ^0.8.18;

import {SignedContextV1, EvaluableConfigV3} from "rain.interpreter.interface/interface/IInterpreterCallerV2.sol";
import {EvaluableConfigV2, Evaluable} from "rain.interpreter.interface/interface/deprecated/IInterpreterCallerV1.sol";
import {SignedContextV1} from "rain.interpreter.interface/interface/IInterpreterCallerV2.sol";
import {EvaluableV2} from "rain.interpreter.interface/lib/caller/LibEvaluable.sol";
import {Sentinel} from "rain.solmem/lib/LibStackSentinel.sol";
import {Pointer} from "rain.solmem/lib/LibPointer.sol";
Expand Down Expand Up @@ -122,7 +123,7 @@ interface IFlowV4 {
/// MUST be emitted when the flow contract is initialized.
/// @param sender The EOA that deployed the flow contract.
/// @param config The list of evaluable configs that define the flows.
event Initialize(address sender, EvaluableConfigV3[] config);
event Initialize(address sender, EvaluableConfigV2[] config);

/// Given a stack of values, convert it to a flow transfer. MUST NOT modify
/// state but MAY revert if the stack is malformed. The intended workflow is
Expand Down Expand Up @@ -151,7 +152,7 @@ interface IFlowV4 {
/// @param signedContexts The signed contexts to pass to the evaluable.
/// @return flowTransfer The resulting flow transfer.
function flow(
EvaluableV2 calldata evaluable,
Evaluable calldata evaluable,
uint256[] calldata callerContext,
SignedContextV1[] calldata signedContexts
) external returns (FlowTransferV1 calldata flowTransfer);
Expand Down
4 changes: 2 additions & 2 deletions src/interface/unstable/IFlowV5.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from "../deprecated/v4/IFlowV4.sol";
import {UnregisteredFlow} from "../../error/ErrFlow.sol";

/// @title IFlowV4
/// @title IFlowV5
/// @notice Interface for a flow contract that does NOT require native minting
/// or burning of itself as a token. This is the base case that all other flow
/// interfaces model themselves after, with the addition of token minting and
Expand Down Expand Up @@ -119,7 +119,7 @@ import {UnregisteredFlow} from "../../error/ErrFlow.sol";
/// native gas movements. This will be fixed in a future version of the interface
/// where batching is handled by the flow contract itself, rather than relying
/// on `Multicall`.
interface IFlowV4 {
interface IFlowV5 {
/// MUST be emitted when the flow contract is initialized.
/// @param sender The EOA that deployed the flow contract.
/// @param config The list of evaluable configs that define the flows.
Expand Down
2 changes: 1 addition & 1 deletion src/lib/LibFlow.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: CAL
pragma solidity ^0.8.18;

import {IFlowV4, RAIN_FLOW_SENTINEL} from "../interface/unstable/IFlowV5.sol";
import {IFlowV5, RAIN_FLOW_SENTINEL} from "../interface/unstable/IFlowV5.sol";
import {Pointer} from "rain.solmem/lib/LibPointer.sol";
import {FlowTransferV1, ERC20Transfer, ERC721Transfer, ERC1155Transfer} from "../interface/unstable/IFlowV5.sol";
import {IInterpreterStoreV2} from "rain.interpreter.interface/interface/unstable/IInterpreterStoreV2.sol";
Expand Down

0 comments on commit 3be5179

Please sign in to comment.