putty
API ReferenceTools

Draft a hook deployment to sign

Validates `params` against the hook's real constructor and returns the **unsigned** deployment: the constructor arguments ABI-encoded, the address suffix the deploy must land on, and the hook's audit status. **Nothing is deployed and nothing is signed.** There is no key in this module and no broadcast call in it. The caller signs the transaction through the B0 signing path and putty never holds the signer, which is the same split the Launch Kit keeps. **Nothing is defaulted into existence.** A parameter the hook does not take is a **400** naming the names it does take; a required one that is missing is a **400** naming it; a value that is not the right shape for its declared type is a **400** naming the shape. Every argument arrives as a string and is encoded as the Solidity type the constructor declares — a `uint24` sent as a JSON `number` has already lost precision on the wire. A `hookId` that is not in the catalog is a **404** that lists the ids that are. It is never a default and never a 400, because a caller who asked for a hook that does not exist and got one that does would sign a transaction for something they did not choose. **`expectedAddress` is `null` until a CREATE2 salt has been mined** for these exact constructor arguments on this chain. Mining is a search, not a calculation, and a client must show "not mined yet" rather than a guessed or zero address. The treasury parameter goes through the same `assertTreasurySafe` guard the pool and launch paths use, so a fee cannot be pointed at the zero address — a transaction that is valid onchain and silently wrong.

POST
/hook-catalog

Validates params against the hook's real constructor and returns the unsigned deployment: the constructor arguments ABI-encoded, the address suffix the deploy must land on, and the hook's audit status. Nothing is deployed and nothing is signed. There is no key in this module and no broadcast call in it. The caller signs the transaction through the B0 signing path and putty never holds the signer, which is the same split the Launch Kit keeps. Nothing is defaulted into existence. A parameter the hook does not take is a 400 naming the names it does take; a required one that is missing is a 400 naming it; a value that is not the right shape for its declared type is a 400 naming the shape. Every argument arrives as a string and is encoded as the Solidity type the constructor declares — a uint24 sent as a JSON number has already lost precision on the wire. A hookId that is not in the catalog is a 404 that lists the ids that are. It is never a default and never a 400, because a caller who asked for a hook that does not exist and got one that does would sign a transaction for something they did not choose. expectedAddress is null until a CREATE2 salt has been mined for these exact constructor arguments on this chain. Mining is a search, not a calculation, and a client must show "not mined yet" rather than a guessed or zero address. The treasury parameter goes through the same assertTreasurySafe guard the pool and launch paths use, so a fee cannot be pointed at the zero address — a transaction that is valid onchain and silently wrong.

Request Body

application/json

The catalog id and its constructor arguments as strings.

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/hook-catalog" \  -H "Content-Type: application/json" \  -d '{    "hookId": "string",    "params": {      "property1": "string",      "property2": "string"    }  }'
{  "hookId": "string",  "calldata": "string",  "expectedAddress": "string",  "hookFlags": "string",  "auditStatus": "audited"}

The hooks a user can select GET

Every hook putty ships, one row per Solidity file in `packages/contracts/src/hooks/`. Each row carries what the hook **does** (written from the contract's own NatSpec), what a deployment **needs** (the constructor arguments and the capabilities it cannot work without), the Uniswap v4 **permission bits** its address must end in, and its **audit status**. **Every row is `experimental`, and a client must render that as "not audited".** These seven contracts are hand-written in this repo and none has been through an external audit. The label is the contracts module's own `CONTRACT_AUDIT_LABELS` vocabulary (`audited` / `reviewed` / `experimental`) so a preset and a hook cannot be described in two different sets of words. Do not collapse `experimental` into a tick. **`hookFlags` is a number a deployer needs before deploying.** A Uniswap v4 hook's low 14 address bits ARE its permission manifest, and a CREATE2 deploy must be MINED to an address ending in those bits or the pool refuses the hook. Each value is transcribed from that contract's own `getHookPermissions()` body, and it is checked at load against the miner. **`source` is a path into `packages/contracts`.** The description is a summary putty wrote; the contract is the thing the user is about to trust with real funds. **This list is asserted against the directory it describes.** The suite fails if a file is added to or removed from `packages/contracts/src/hooks/` without a row here, or if a row names a file that does not exist. A catalog entry nobody can select — or a shipped hook nobody can find — is the same dead surface as an unregistered tool, and it does not ship.