import { defineChain } from "viem"; import { DEPLOYMENTS, type Deployment } from "./deployments"; /** Robinhood Chain mainnet, where Captain Hook runs. */ export const robinhood = defineChain({ id: 4663, name: "Robinhood Chain", nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }, rpcUrls: { default: { http: ["https://rpc.mainnet.chain.robinhood.com"] } }, blockExplorers: { default: { name: "Blockscout", url: "https://robinhoodchain.blockscout.com" } }, contracts: { multicall3: { address: "0xcA11bde05977b3631167028862bE2a173976CA11" } }, }); /** * Captain Hook's contracts on a chain: v1's hook, launch factory and router, Uniswap's pool manager, * and v2's hook, factory, router and vault in `v2` once v2 is deployed there. */ export type Addresses = Deployment; /** Captain Hook's contracts on Robinhood Chain mainnet. */ export const ADDRESSES: Addresses = DEPLOYMENTS[robinhood.id]!; /** Which version a pool is on, from its hook: 2 for v2's hook, else 1. */ export function versionOfHook(hook: string, addresses: Addresses = ADDRESSES): 1 | 2 { return addresses.v2 && hook.toLowerCase() === addresses.v2.hook.toLowerCase() ? 2 : 1; }