Creating Orders
Key Concepts
Programmatic orders inComposableCoW rely on the ConditionalOrderParams struct, which incorporates three essential components:
- A handler contract specifying the order type
- A unique salt identifier
- ABI-encoded order parameters (
staticInput)
Core Order Structure
The framework supports multiple handler types:Implementation Steps
The process involves four main phases:1. Parameter Definition
Configure order-specific data based on your chosen handler type.2. Struct Creation
Wrap parameters inConditionalOrderParams with a unique salt.
3. Token Approval
Authorize the vault relayer (0xC92E8bdf79f0507f65a392b0ab4667716BFE0110) to access required tokens.
4. Order Submission
Execute the creation throughComposableCoW.create() from a Safe contract.
Advanced Features
createWithContext: Store on-chain values via value factories during order creation- Batch operations: Bundle multiple order creations together using MultiSend
- Verification: Confirm successful order creation through the
singleOrdersmapping