Skip to main content

Why Hooks Trampoline?

Hooks Trampoline protects CoW Protocol settlements from malicious or poorly configured user hooks.

Security Isolation

Executes hooks from an unprivileged context, preventing malicious hooks from accessing settlement contract funds or state.

Gas Protection

Enforces gas limits on hook execution to prevent INVALID opcodes from consuming excessive gas and making settlements expensive.

Revert Tolerance

Allows individual hooks to revert without failing the entire settlement, preventing DoS attacks on other orders.

Settlement Access Control

Only accepts calls from the CoW Protocol settlement contract, allowing hooks to verify they’re part of a valid settlement.

Quick Start

Get started with Hooks Trampoline in minutes.
1

Install Foundry dependencies

Clone the repository and install dependencies:
forge install
2

Deploy the contract

Deploy Hooks Trampoline with your settlement contract address:
HooksTrampoline trampoline = new HooksTrampoline(settlementAddress);
3

Create and execute hooks

Define hooks and execute them through the trampoline:
HooksTrampoline.Hook[] memory hooks = new HooksTrampoline.Hook[](1);
hooks[0] = HooksTrampoline.Hook({
    target: hookContract,
    callData: abi.encodeCall(MyHook.execute, ()),
    gasLimit: 100000
});

// Called from settlement contract
trampoline.execute(hooks);

Explore the Documentation

Learn more about Hooks Trampoline’s architecture and how to use it effectively.

Ready to integrate Hooks Trampoline?

Follow our installation guide to deploy and integrate Hooks Trampoline into your CoW Protocol settlement workflow.

Get Started

Follow the installation guide to deploy Hooks Trampoline.
Last modified on March 4, 2026