Prerequisites
Before installing Hooks Trampoline, ensure you have:- Foundry installed
- A CoW Protocol settlement contract address for deployment
Installation
Install dependencies
Install Solidity dependencies using Foundry:This will install all required libraries as specified in the project configuration.
Build the contracts
Compile the smart contracts:The contracts are compiled with the following settings (from
foundry.toml):- Solidity version:
0.8.20 - EVM version:
shanghai - Optimizer: enabled with
1000000runs
Deployment
Hooks Trampoline can be deployed using either Foundry’s forge script or Cannon for multi-chain deployments.Using Forge Script
TheHooksTrampoline constructor requires a single parameter: the address of the CoW Protocol settlement contract.
Replace
<SETTLEMENT_ADDRESS> with the actual CoW Protocol settlement contract address for your target network.Using Cannon for Deployment
Cannon provides a more robust deployment workflow with predictable addresses and multi-chain support.Configure deployment settings
The deployment is configured in
cannonfile.toml:cannonfile.toml
The configuration automatically pulls the settlement address from the
cow-settlement package, ensuring compatibility.Build the Cannon package
Generate the deployment artifact:This creates a deployment manifest with:
- Compiled contract ABIs
- Predicted deployment addresses (using CREATE2)
- Solidity input JSON
- Default configuration settings
Deployment Verification
After deployment, verify your Hooks Trampoline contract:Network Addresses
For production deployments, refer to the cowprotocol/deployments repository or the cow-omnibus package on Cannon Explorer for official contract addresses.Next Steps
Now that you have deployed Hooks Trampoline, learn how to use it in your CoW Protocol integrations:Usage Guide
Learn how to create and execute hooks with Hooks Trampoline
