Skip to main content
The HooksTrampoline contract defines custom errors for access control and execution failures.

NotASettlement

Definition

Description

This error is thrown when a caller attempts to execute hooks through the trampoline without being the authorized settlement contract. The mechanism enforces that exclusively the CoW Protocol settlement contract can execute hooks, functioning as a critical security control.

When It’s Thrown

The error activates through the onlySettlement modifier when:
  • msg.sender does not match the settlement address stored in the contract
  • Any external caller (other than the settlement contract) attempts to call execute()

Code Location

Example Scenarios

Successful Call (No Error)
Failed Call (Error Thrown)

Catching the Error

Error Selector

How to Handle

Prevention

Never call HooksTrampoline.execute() directly from your contracts or EOAs. The trampoline is designed to be called exclusively by the CoW Protocol settlement contract.

Design Pattern

Debugging

1

Verify caller

Check that the caller is the settlement contract address using events or debuggers to inspect msg.sender.
2

Check trampoline configuration

Verify the trampoline was deployed with the correct settlement address.
3

Review integration flow

Ensure your integration follows the correct pattern: order -> settlement -> trampoline -> hook target.

Testing

Out of Gas

While not a custom error, hooks may fail due to insufficient gas:
Unlike NotASettlement, out-of-gas errors are not caught. The entire transaction will revert if any hook’s gas limit cannot be satisfied.

Hook Target Reverts

Hook target reverts do not cause NotASettlement or block the settlement. They simply result in the hook not executing its logic.
Last modified on March 4, 2026