Description
Flow.sol:45 declares the error BadMinStackLength inline at file scope:
/// 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
/// should both be compile time constants.
/// @param flowMinOutputs The min outputs for the flow.
error BadMinStackLength(uint256 flowMinOutputs);
Every other error reverted from Flow.sol (UnsupportedFlowInputs, InsufficientFlowOutputs, UnregisteredFlow, InitializeSignatureFn) is declared in a dedicated error file: src/error/ErrFlow.sol for the first three, and rain.factory/.../ICloneableV2.sol for the fourth. BadMinStackLength is the only outlier — it lives in the implementation file even though the convention in this repo is to centralise error declarations.
This forces consumers (interfaces, ABI bindings, integrators) to import Flow.sol (a concrete contract pulling in OZ Multicall, ReentrancyGuard, the interpreter caller, etc.) just to get the error selector.
Location
src/concrete/Flow.sol:41-45
Proposed fix
Move BadMinStackLength (and its NatSpec) to src/error/ErrFlow.sol, then import it from Flow.sol alongside UnsupportedFlowInputs / InsufficientFlowOutputs:
-import {UnsupportedFlowInputs, InsufficientFlowOutputs} from "../error/ErrFlow.sol";
+import {UnsupportedFlowInputs, InsufficientFlowOutputs, BadMinStackLength} from "../error/ErrFlow.sol";
...
-/// Thrown when the min outputs for a flow is fewer than the sentinels.
-/// ...
-error BadMinStackLength(uint256 flowMinOutputs);
And in ErrFlow.sol, add the declaration with its NatSpec.
Description
Flow.sol:45declares the errorBadMinStackLengthinline at file scope:Every other error reverted from
Flow.sol(UnsupportedFlowInputs,InsufficientFlowOutputs,UnregisteredFlow,InitializeSignatureFn) is declared in a dedicated error file:src/error/ErrFlow.solfor the first three, andrain.factory/.../ICloneableV2.solfor the fourth.BadMinStackLengthis the only outlier — it lives in the implementation file even though the convention in this repo is to centralise error declarations.This forces consumers (interfaces, ABI bindings, integrators) to import
Flow.sol(a concrete contract pulling in OZ Multicall, ReentrancyGuard, the interpreter caller, etc.) just to get the error selector.Location
src/concrete/Flow.sol:41-45Proposed fix
Move
BadMinStackLength(and its NatSpec) tosrc/error/ErrFlow.sol, then import it fromFlow.solalongsideUnsupportedFlowInputs/InsufficientFlowOutputs:And in
ErrFlow.sol, add the declaration with its NatSpec.