Build a v4 hook
The Build a v4 hook page takes your contract from source to listed: the site compiles it, your wallet deploys it and Sourcify verifies it. Every swap that runs your hook pays you.
Start
Download the starter: the template src/MyHook.sol, the ILog interface, a Foundry fork test, foundry.toml and remappings. Or open any listed hook in Storefronts, download its verified source and ABI, or pick Start from this hook to load it into the editor.
forge install foundry-rs/forge-std uniswap/v4-core RH_RPC_URL=https://rpc.mainnet.chain.robinhood.com forge test
Compile
Drop or paste your .sol file on Build a v4 hook. The site compiles it with solc 0.8.26, optimizer at 200 runs, EVM cancun. Imports resolve to the files you send and to Uniswap v4-core under v4-core/. Compile errors come back with file, line and column. The site only compiles: it never runs your code, files are capped at 64 KB each and the endpoint is rate limited.
The result is checked against ILog by selector: onStack, beforeSwap returning (uint24, uint8, bool), and afterSwap. A contract that misses one cannot be called by the hook stack, so the page stops there.
Deploy and verify
Deploy from your wallet signs the contract creation on Robinhood Chain; the constructor's hook stack address is filled in for you. Once the receipt is in, the page sends the exact standard JSON input it compiled to Sourcify with the creation transaction, and waits for the match. It also measures what beforeSwap costs and suggests a gas limit.
List and stake
- Open a storefront if this wallet has none: a name and an X handle, one transaction.
- List the hook: the address, a name, a royalty from 0 to 10 bps, a gas limit from 10,000 to 80,000, afterSwap on or off, and the Sourcify link, all prefilled.
- Stake 10,000 $V4M: the page shows your balance, approves and stakes. Short of $V4M, it links to Pons.
- The house verifier checks the source every hour and flags the hook verified. Verified and staked, it is active and any pool can stack it.
Limits
| beforeSwap gas | the limit you list, 10,000 to 80,000 |
| afterSwap gas | 40,000 more in every stack, when turned on |
| Answer size | 96 bytes at most |
| Royalty | 0 to 10 bps per hook, 30 bps per stack |
| Stack | 5 hooks and 400,000 gas per pool |
| Failed runs | 3 in seven days burn 10% of the stake and remove the hook |
| Contract size | 24,576 bytes deployed |