Skip to main content
This guide covers deploying Hooks Trampoline using Cannon, which provides:
  • Deterministic CREATE2 deployments
  • Deployment manifest with ABIs and addresses
  • Multi-chain support with identical addresses

Building

1

Install dependencies

pnpm install
2

Build the Cannon package

yarn build:cannon
Or alternatively:
pnpm cannon build --wipe
3

Verify build artifacts

Check the cannon/ directory for generated artifacts.
The build process:
  • Recompiles Solidity contracts
  • Generates deployment manifests
  • Includes ABIs
  • Calculates predicted deployment addresses

Configuration

The cannonfile.toml defines deployment settings:
  • Package name and version: Identifies the deployment package
  • Dependencies: Pulls from the cow-settlement package (version 2.0.2)
  • CREATE2 salt: Deterministic salt value for address calculation
  • Constructor arguments: Settlement contract address passed automatically from the dependency

Publishing

1

Verify version

Check the version number in the configuration file.
2

Build the package

yarn build:cannon
3

Publish to Cannon registry

yarn cannon:publish
Publishing requires an authorized account with 0.0025 ETH + gas fees on Optimism Mainnet.
4

Select network and provide credentials

Provide your private key and select the target network when prompted.
5

Record deployment artifacts

Use Cannon inspection commands to record deployment artifacts.
6

Bump version and commit

Update the version number and commit the changes.

CREATE2 Deterministic Deployment

The CREATE2 deployment method ensures the same contract address across all EVM networks. The address is determined by:
  • Deployer address
  • Salt value
  • Contract bytecode
  • Constructor arguments
This means you can predict the deployment address before deploying, and the address will be identical on every chain.

Production Deployment

Actual mainnet deployments are handled through the separate cowprotocol/deployments repository, with staging and production phases.

Troubleshooting

Ensure all dependencies are installed with pnpm install and that you’re using the correct Solidity version (0.8.20).
Publishing requires an authorized account. Ensure your account has sufficient ETH on Optimism Mainnet.
Some recording commands may require manual execution. Check the Cannon documentation for the latest commands.

Resources

Last modified on March 4, 2026