The flowControl capability allows dapps to specify how transaction batches should behave when individual calls fail or revert. This provides fine-grained control over transaction execution flow and enables more sophisticated error handling strategies.
This capability is currently proposed in ERC-7867 and is not yet finalized. Implementation details may change as the specification develops.
Parameters
Specifies the behavior when a transaction call fails or reverts.Possible values:
"continue"
: Continue executing remaining calls"stop"
: Stop execution on failure"retry"
: Attempt to retry the failed call
Optional fallback transaction to execute if the primary call fails.
Returns
The flow control capability configuration for the specified chain.
Example Usage
Error Handling
Code | Message | Description |
---|---|---|
4100 | Flow control not supported | Wallet does not support flow control functionality |
5700 | Flow control capability required | Transaction requires flow control but wallet doesn’t support it |
5800 | Invalid flow control parameters | The provided flow control configuration is invalid |
Potential Use Cases
E-commerce Transactions
Handle scenarios where some purchases succeed while others fail:DeFi Operations with Fallbacks
Implement sophisticated DeFi strategies with backup options:Batch Operations with Error Recovery
Execute batch operations that can gracefully handle individual failures:Checking Capability Support
Once implemented, check for flow control support:Expected Benefits
When implemented, flow control will provide:- Better User Experience: Partial success instead of complete failure
- Flexible Error Handling: Apps can define custom failure responses
- Reduced Gas Waste: Avoid re-executing successful operations
- Complex Workflows: Enable sophisticated multi-step processes
Development Status
This capability is actively being developed:- ERC-7867: Formal proposal for flow control capability
- Community Input: Ongoing discussions about implementation details
- Wallet Integration: Pending finalization of specification
Preparing for Flow Control
While waiting for implementation, developers can:- Design Flexible Architecture: Build apps that can adapt to different execution models
- Implement Fallback Logic: Create manual fallback strategies for critical operations
- Monitor Specification: Track ERC-7867 progress for implementation updates
- Test Sequential Execution: Use current capabilities to simulate flow control behavior
Stay updated on ERC-7867 development to implement flow control as soon as it’s available in production wallets.
The examples above are conceptual and may not reflect the final implementation. Always refer to the latest ERC-7867 specification for accurate details.
Related Capabilities
Flow control works alongside other capabilities:- Atomic: For strict all-or-nothing execution
- Paymaster Service: For sponsored transaction flows
- Auxiliary Funds: For flexible funding sources