Skip to main content

Prerequisites

  • Foundry installed
  • A CoW Protocol settlement contract address for deployment

Installation

1

Clone the repository

git clone https://github.com/cowprotocol/hooks-trampoline.git
cd hooks-trampoline
2

Install dependencies

forge install
3

Compile contracts

forge build
Compilation uses Solidity 0.8.20, EVM Shanghai, with optimizer enabled at 1,000,000 runs.
4

Run tests

forge test

Deployment

Forge Script

The constructor accepts one parameter: the settlement contract address.
forge create src/HooksTrampoline.sol:HooksTrampoline \
  --constructor-args <SETTLEMENT_ADDRESS> \
  --rpc-url <YOUR_RPC_URL> \
  --private-key <YOUR_PRIVATE_KEY>
To verify on Etherscan, add --etherscan-api-key and --verify flags.

Cannon

Cannon provides predictable addresses and multi-chain support through configuration files. The system automatically retrieves settlement addresses from the cow-settlement package, reducing manual configuration.
yarn install
yarn build:cannon
yarn cannon:publish
Publishing requires 0.0025 ETH + gas fees on Optimism Mainnet.

Verification

After deployment, verify the contract using cast to check the settlement address:
cast call <TRAMPOLINE_ADDRESS> "settlement()" --rpc-url <YOUR_RPC_URL>
Or verify on Etherscan with constructor argument encoding.

Resources

Last modified on March 4, 2026