diff --git a/src/abstract/FlowCommon.sol b/src/abstract/FlowCommon.sol index b3b89953..4f338ce3 100644 --- a/src/abstract/FlowCommon.sol +++ b/src/abstract/FlowCommon.sol @@ -30,10 +30,7 @@ import {ReentrancyGuardUpgradeable as ReentrancyGuard} from "openzeppelin-contracts-upgradeable/contracts/security/ReentrancyGuardUpgradeable.sol"; import {LibUint256Matrix} from "rain.solmem/lib/LibUint256Matrix.sol"; import {LibNamespace, StateNamespace} from "rain.interpreter.interface/lib/ns/LibNamespace.sol"; -import { - UnsupportedFlowInputs, - InsufficientFlowOutputs -} from "../error/ErrFlow.sol"; +import {UnsupportedFlowInputs, InsufficientFlowOutputs} from "../error/ErrFlow.sol"; /// Thrown when the min outputs for a flow is fewer than the sentinels. /// This is always an implementation bug as the min outputs and sentinel count @@ -154,9 +151,8 @@ abstract contract FlowCommon is ERC721Holder, ERC1155Holder, Multicall, Reentran // Reentrancy is just one of many ways that a malicious deployer // can cause problems, and it's probably the least of your // worries if you're using a malicious deployer. - (IInterpreterV2 interpreter, IInterpreterStoreV2 store, address expression, bytes memory io) = config - .deployer - .deployExpression2(config.bytecode, config.constants); + (IInterpreterV2 interpreter, IInterpreterStoreV2 store, address expression, bytes memory io) = + config.deployer.deployExpression2(config.bytecode, config.constants); { uint256 flowInputs; diff --git a/src/concrete/erc1155/FlowERC1155.sol b/src/concrete/erc1155/FlowERC1155.sol index 42e1d097..572a16a3 100644 --- a/src/concrete/erc1155/FlowERC1155.sol +++ b/src/concrete/erc1155/FlowERC1155.sol @@ -33,10 +33,7 @@ import {SourceIndexV2} from "rain.interpreter.interface/interface/unstable/IInte import {FlowCommon, ERC1155Receiver} from "../../abstract/FlowCommon.sol"; import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.sol"; import {LibNamespace, StateNamespace} from "rain.interpreter.interface/lib/ns/LibNamespace.sol"; -import { - InsufficientHandleTransferOutputs, - UnsupportedHandleTransferInputs -} from "../../error/ErrFlow.sol"; +import {InsufficientHandleTransferOutputs, UnsupportedHandleTransferInputs} from "../../error/ErrFlow.sol"; /// @title FlowERC1155 /// See `IFlowERC1155V4` for documentation. @@ -74,12 +71,9 @@ contract FlowERC1155 is ICloneableV2, IFlowERC1155V4, FlowCommon, ERC1155 { flowCommonInit(flowERC1155Config.flowConfig, FLOW_ERC1155_MIN_FLOW_SENTINELS); if (evalHandleTransfer) { - (IInterpreterV2 interpreter, IInterpreterStoreV2 store, address expression, bytes memory io) = flowERC1155Config - .evaluableConfig - .deployer - .deployExpression2( - flowERC1155Config.evaluableConfig.bytecode, - flowERC1155Config.evaluableConfig.constants + (IInterpreterV2 interpreter, IInterpreterStoreV2 store, address expression, bytes memory io) = + flowERC1155Config.evaluableConfig.deployer.deployExpression2( + flowERC1155Config.evaluableConfig.bytecode, flowERC1155Config.evaluableConfig.constants ); { @@ -226,12 +220,11 @@ contract FlowERC1155 is ICloneableV2, IFlowERC1155V4, FlowCommon, ERC1155 { /// 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(EvaluableV2 memory evaluable, uint256[] memory callerContext, SignedContextV1[] memory signedContexts) - internal - virtual - nonReentrant - returns (FlowERC1155IOV1 memory) - { + function _flow( + EvaluableV2 memory evaluable, + uint256[] memory callerContext, + SignedContextV1[] memory signedContexts + ) internal virtual nonReentrant returns (FlowERC1155IOV1 memory) { unchecked { (Pointer stackBottom, Pointer stackTop, uint256[] memory kvs) = _flowStack(evaluable, callerContext, signedContexts); diff --git a/src/concrete/erc20/FlowERC20.sol b/src/concrete/erc20/FlowERC20.sol index d3143947..c5dd758c 100644 --- a/src/concrete/erc20/FlowERC20.sol +++ b/src/concrete/erc20/FlowERC20.sol @@ -78,12 +78,10 @@ contract FlowERC20 is ICloneableV2, IFlowERC20V5, FlowCommon, ERC20 { flowCommonInit(flowERC20Config.flowConfig, FLOW_ERC20_MIN_FLOW_SENTINELS); if (evalHandleTransfer) { - (IInterpreterV2 interpreter, IInterpreterStoreV2 store, address expression, bytes memory io) = flowERC20Config - .evaluableConfig - .deployer - .deployExpression2( - flowERC20Config.evaluableConfig.bytecode, - flowERC20Config.evaluableConfig.constants); + (IInterpreterV2 interpreter, IInterpreterStoreV2 store, address expression, bytes memory io) = + flowERC20Config.evaluableConfig.deployer.deployExpression2( + flowERC20Config.evaluableConfig.bytecode, flowERC20Config.evaluableConfig.constants + ); { uint256 handleTransferInputs; @@ -203,12 +201,11 @@ contract FlowERC20 is ICloneableV2, IFlowERC20V5, FlowCommon, ERC20 { /// the mints and burns from the `FlowERC20IOV1` struct. The mints are /// processed first, then the burns, then the remaining flow is processed /// as normal. - function _flow(EvaluableV2 memory evaluable, uint256[] memory callerContext, SignedContextV1[] memory signedContexts) - internal - virtual - nonReentrant - returns (FlowERC20IOV1 memory) - { + function _flow( + EvaluableV2 memory evaluable, + uint256[] memory callerContext, + SignedContextV1[] memory signedContexts + ) internal virtual nonReentrant returns (FlowERC20IOV1 memory) { unchecked { (Pointer stackBottom, Pointer stackTop, uint256[] memory kvs) = _flowStack(evaluable, callerContext, signedContexts); diff --git a/src/concrete/erc721/FlowERC721.sol b/src/concrete/erc721/FlowERC721.sol index 551b60b3..a4cc9cd3 100644 --- a/src/concrete/erc721/FlowERC721.sol +++ b/src/concrete/erc721/FlowERC721.sol @@ -112,10 +112,8 @@ contract FlowERC721 is ICloneableV2, IFlowERC721V5, FlowCommon, ERC721 { flowCommonInit(flowERC721Config.flowConfig, FLOW_ERC721_MIN_FLOW_SENTINELS); if (evalHandleTransfer) { - (IInterpreterV2 interpreter, IInterpreterStoreV2 store, address expression, bytes memory io) = flowERC721Config - .evaluableConfig - .deployer - .deployExpression2( + (IInterpreterV2 interpreter, IInterpreterStoreV2 store, address expression, bytes memory io) = + flowERC721Config.evaluableConfig.deployer.deployExpression2( flowERC721Config.evaluableConfig.bytecode, flowERC721Config.evaluableConfig.constants ); @@ -290,12 +288,11 @@ contract FlowERC721 is ICloneableV2, IFlowERC721V5, FlowCommon, ERC721 { /// from the stack as additional sentinel separated tuples. The mints are /// consumed first, then the burns, then the remaining stack is converted to /// a flow as normal. - function _flow(EvaluableV2 memory evaluable, uint256[] memory callerContext, SignedContextV1[] memory signedContexts) - internal - virtual - nonReentrant - returns (FlowERC721IOV1 memory) - { + function _flow( + EvaluableV2 memory evaluable, + uint256[] memory callerContext, + SignedContextV1[] memory signedContexts + ) internal virtual nonReentrant returns (FlowERC721IOV1 memory) { unchecked { (Pointer stackBottom, Pointer stackTop, uint256[] memory kvs) = _flowStack(evaluable, callerContext, signedContexts); diff --git a/src/error/ErrFlow.sol b/src/error/ErrFlow.sol index a412a766..27160f0e 100644 --- a/src/error/ErrFlow.sol +++ b/src/error/ErrFlow.sol @@ -27,4 +27,4 @@ error InsufficientHandleTransferOutputs(); error UnsupportedTokenURIInputs(); error InsufficientTokenURIOutputs(); error UnsupportedFlowInputs(); -error InsufficientFlowOutputs(); \ No newline at end of file +error InsufficientFlowOutputs(); diff --git a/src/interface/unstable/IFlowV5.sol b/src/interface/unstable/IFlowV5.sol index 97e6cd97..95906770 100644 --- a/src/interface/unstable/IFlowV5.sol +++ b/src/interface/unstable/IFlowV5.sol @@ -14,9 +14,7 @@ import { RAIN_FLOW_SENTINEL, MIN_FLOW_SENTINELS } from "../deprecated/v4/IFlowV4.sol"; -import { - UnregisteredFlow -} from "../../error/ErrFlow.sol"; +import {UnregisteredFlow} from "../../error/ErrFlow.sol"; /// @title IFlowV4 /// @notice Interface for a flow contract that does NOT require native minting diff --git a/src/lib/LibFlow.sol b/src/lib/LibFlow.sol index 5be3e153..f8986337 100644 --- a/src/lib/LibFlow.sol +++ b/src/lib/LibFlow.sol @@ -3,12 +3,7 @@ pragma solidity ^0.8.18; import {IFlowV4, 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 {FlowTransferV1, ERC20Transfer, ERC721Transfer, ERC1155Transfer} from "../interface/unstable/IFlowV5.sol"; import {IInterpreterStoreV2} from "rain.interpreter.interface/interface/unstable/IInterpreterStoreV2.sol"; import {LibStackSentinel} from "rain.solmem/lib/LibStackSentinel.sol"; import {DEFAULT_STATE_NAMESPACE} from "rain.interpreter.interface/interface/unstable/IInterpreterV2.sol"; @@ -17,11 +12,7 @@ import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; import {IERC721} from "openzeppelin-contracts/contracts/token/ERC721/IERC721.sol"; import {IERC1155} from "openzeppelin-contracts/contracts/token/ERC1155/IERC1155.sol"; -import { - UnsupportedERC20Flow, - UnsupportedERC721Flow, - UnsupportedERC1155Flow -} from "../error/ErrFlow.sol"; +import {UnsupportedERC20Flow, UnsupportedERC721Flow, UnsupportedERC1155Flow} from "../error/ErrFlow.sol"; /// @title LibFlow /// Standard processing used by all variants of `Flow`. These utilities can't