Expand description
cow-weiroll — Layer 2 Weiroll script builder for the CoW Protocol SDK.
Weiroll is a minimal VM for
chaining arbitrary EVM calls into a single transaction. This crate
provides the Rust types for building Weiroll scripts and encoding them
as execute(bytes32[],bytes[]) calldata targeting the canonical Weiroll
executor contract.
§Submodules
| Module | Purpose |
|---|---|
planner (private) | WeirollPlanner builder for accumulating commands/state |
types | WeirollCommand, WeirollScript, WeirollContractRef, factory functions |
§Key items
| Item | Purpose |
|---|---|
WeirollPlanner | Builder: add_command → add_state_slot → plan() |
WeirollCommand | A single 32-byte packed instruction |
WeirollScript | Finalised script (commands + state) |
WeirollContractRef | Contract address + ABI + default call flags |
create_weiroll_contract | Factory for CALL-mode contracts |
create_weiroll_library | Factory for DELEGATECALL-mode libraries |
create_weiroll_delegate_call | Build a complete execute(...) EvmCall |
Re-exports§
pub use types::WEIROLL_ADDRESS;pub use types::WeirollCommand;pub use types::WeirollCommandFlags;pub use types::WeirollContractRef;pub use types::WeirollScript;pub use types::create_weiroll_contract;pub use types::create_weiroll_delegate_call;pub use types::create_weiroll_library;pub use types::define_read_only;pub use types::get_static;
Modules§
- types
- Weiroll script types, command encoding, and contract reference factories.
Structs§
- Weiroll
Planner - Builder that accumulates commands and state slots into a Weiroll script.