@sherwoodagent/cli 0.86.1 → 0.87.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/{abis-WVW2EBI3.js → abis-WJQ6IVYV.js} +2 -2
  2. package/dist/{agent-TBLC3WNJ.js → agent-FCGZL4GF.js} +7 -7
  3. package/dist/{chat-ETZSKQDI.js → chat-AKLYUJZV.js} +8 -8
  4. package/dist/{chunk-ZN2MHIB7.js → chunk-4ITTHKRX.js} +5 -5
  5. package/dist/{chunk-EVUKJ7CJ.js → chunk-6D3FNU75.js} +5 -5
  6. package/dist/{chunk-45FELUWY.js → chunk-6SAE2VDK.js} +2 -2
  7. package/dist/{chunk-EA65CDQH.js → chunk-BH3VTJ4F.js} +14 -23
  8. package/dist/chunk-BH3VTJ4F.js.map +1 -0
  9. package/dist/{chunk-QRMZRAMG.js → chunk-D4BSBW3Q.js} +221 -10
  10. package/dist/chunk-D4BSBW3Q.js.map +1 -0
  11. package/dist/{chunk-KVB5P2OE.js → chunk-EEI6FRTE.js} +2 -2
  12. package/dist/{chunk-IAM4VIU2.js → chunk-FWQESFFM.js} +18 -41
  13. package/dist/chunk-FWQESFFM.js.map +1 -0
  14. package/dist/{chunk-PVTZMRC6.js → chunk-G3FUEM5N.js} +2 -2
  15. package/dist/chunk-G3FUEM5N.js.map +1 -0
  16. package/dist/{chunk-YAS52NEF.js → chunk-G5MXVAFC.js} +18 -5
  17. package/dist/chunk-G5MXVAFC.js.map +1 -0
  18. package/dist/{chunk-F3MDCUGO.js → chunk-J2IZWAEW.js} +75 -227
  19. package/dist/chunk-J2IZWAEW.js.map +1 -0
  20. package/dist/{chunk-XPVXNG2K.js → chunk-N2E2Q5GL.js} +6 -6
  21. package/dist/{chunk-3IAZQMAW.js → chunk-QFGZQYZA.js} +29 -82
  22. package/dist/chunk-QFGZQYZA.js.map +1 -0
  23. package/dist/{chunk-OUYMZ5ZC.js → chunk-SI65QHTY.js} +5 -5
  24. package/dist/{chunk-6QBGTX2Q.js → chunk-VYCLG5DE.js} +264 -487
  25. package/dist/chunk-VYCLG5DE.js.map +1 -0
  26. package/dist/{client-3SE632Q2.js → client-PYFE6YQR.js} +3 -3
  27. package/dist/{eas-KMDAMLXW.js → eas-DV3Z7AT3.js} +6 -6
  28. package/dist/{governor-JNSWPJVQ.js → governor-QFBN6RYS.js} +8 -6
  29. package/dist/identity-M4TXM7EX.js +18 -0
  30. package/dist/index.js +352 -355
  31. package/dist/index.js.map +1 -1
  32. package/dist/{network-FEHRFDPJ.js → network-7445KSCF.js} +2 -2
  33. package/dist/{price-YNPYE2EO.js → price-EXZDYVDD.js} +6 -6
  34. package/dist/{providers-BMOHHVUN.js → providers-6UZKDFQD.js} +4 -4
  35. package/dist/{research-W74PNYPO.js → research-44GHYE4H.js} +7 -7
  36. package/dist/{session-HVRZ6AJM.js → session-45NQAHFI.js} +14 -12
  37. package/dist/session-45NQAHFI.js.map +1 -0
  38. package/dist/{trade-EOQY72L7.js → trade-FO52SP62.js} +15 -15
  39. package/dist/{vault-HWJQJW5U.js → vault-WWGSRNRP.js} +8 -8
  40. package/dist/{xmtp-KW73BGVO.js → xmtp-72IRK7JL.js} +6 -6
  41. package/package.json +1 -1
  42. package/dist/chunk-3IAZQMAW.js.map +0 -1
  43. package/dist/chunk-6QBGTX2Q.js.map +0 -1
  44. package/dist/chunk-EA65CDQH.js.map +0 -1
  45. package/dist/chunk-F3MDCUGO.js.map +0 -1
  46. package/dist/chunk-IAM4VIU2.js.map +0 -1
  47. package/dist/chunk-PVTZMRC6.js.map +0 -1
  48. package/dist/chunk-QRMZRAMG.js.map +0 -1
  49. package/dist/chunk-YAS52NEF.js.map +0 -1
  50. package/dist/identity-ATWV2O7Y.js +0 -15
  51. package/dist/session-HVRZ6AJM.js.map +0 -1
  52. /package/dist/{abis-WVW2EBI3.js.map → abis-WJQ6IVYV.js.map} +0 -0
  53. /package/dist/{agent-TBLC3WNJ.js.map → agent-FCGZL4GF.js.map} +0 -0
  54. /package/dist/{chat-ETZSKQDI.js.map → chat-AKLYUJZV.js.map} +0 -0
  55. /package/dist/{chunk-ZN2MHIB7.js.map → chunk-4ITTHKRX.js.map} +0 -0
  56. /package/dist/{chunk-EVUKJ7CJ.js.map → chunk-6D3FNU75.js.map} +0 -0
  57. /package/dist/{chunk-45FELUWY.js.map → chunk-6SAE2VDK.js.map} +0 -0
  58. /package/dist/{chunk-KVB5P2OE.js.map → chunk-EEI6FRTE.js.map} +0 -0
  59. /package/dist/{chunk-XPVXNG2K.js.map → chunk-N2E2Q5GL.js.map} +0 -0
  60. /package/dist/{chunk-OUYMZ5ZC.js.map → chunk-SI65QHTY.js.map} +0 -0
  61. /package/dist/{client-3SE632Q2.js.map → client-PYFE6YQR.js.map} +0 -0
  62. /package/dist/{eas-KMDAMLXW.js.map → eas-DV3Z7AT3.js.map} +0 -0
  63. /package/dist/{governor-JNSWPJVQ.js.map → governor-QFBN6RYS.js.map} +0 -0
  64. /package/dist/{identity-ATWV2O7Y.js.map → identity-M4TXM7EX.js.map} +0 -0
  65. /package/dist/{network-FEHRFDPJ.js.map → network-7445KSCF.js.map} +0 -0
  66. /package/dist/{price-YNPYE2EO.js.map → price-EXZDYVDD.js.map} +0 -0
  67. /package/dist/{providers-BMOHHVUN.js.map → providers-6UZKDFQD.js.map} +0 -0
  68. /package/dist/{research-W74PNYPO.js.map → research-44GHYE4H.js.map} +0 -0
  69. /package/dist/{trade-EOQY72L7.js.map → trade-FO52SP62.js.map} +0 -0
  70. /package/dist/{vault-HWJQJW5U.js.map → vault-WWGSRNRP.js.map} +0 -0
  71. /package/dist/{xmtp-KW73BGVO.js.map → xmtp-72IRK7JL.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/client.ts","../src/lib/errors.ts"],"sourcesContent":["/**\n * viem client factory — resolves chain and RPC from the network module.\n * Private key is read from ~/.sherwood/config.json (set via `sherwood config set --private-key`),\n * with PRIVATE_KEY env var as fallback.\n */\n\n// dotenv loaded at entrypoint\nimport type { Hex, TransactionReceipt } from \"viem\";\nimport { createPublicClient, createWalletClient, fallback, http } from \"viem\";\nimport { privateKeyToAccount } from \"viem/accounts\";\nimport { getChain, getRpcUrls, getMinGasReserve } from \"./network.js\";\nimport { requirePrivateKey } from \"./config.js\";\nimport { formatContractError } from \"./errors.js\";\nexport { formatContractError } from \"./errors.js\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet _publicClient: any = null;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet _walletClient: any = null;\n\n/**\n * Build a viem fallback transport over the chain's RPC URL list.\n * Transparently advances to the next URL on rate-limit / network errors\n * (issue #182). `retryCount: 0` on the inner `http` avoids wasting 10+s\n * spinning on a dead RPC before the fallback layer advances.\n */\nfunction buildTransport() {\n const urls = getRpcUrls();\n return fallback(\n urls.map((url) => http(url, { retryCount: 0, timeout: 8_000 })),\n { rank: false, retryCount: 0 },\n );\n}\n\nexport function getPublicClient() {\n const chain = getChain();\n // Auto-invalidate if network changed since last creation\n if (_publicClient && _publicClient.chain?.id !== chain.id) {\n _publicClient = null;\n }\n if (!_publicClient) {\n _publicClient = createPublicClient({\n chain,\n transport: buildTransport(),\n });\n }\n return _publicClient as ReturnType<typeof createPublicClient>;\n}\n\nexport function getWalletClient() {\n const chain = getChain();\n // Auto-invalidate if network changed since last creation\n if (_walletClient && _walletClient.chain?.id !== chain.id) {\n _walletClient = null;\n }\n if (!_walletClient) {\n const account = privateKeyToAccount(requirePrivateKey());\n _walletClient = createWalletClient({\n account,\n chain,\n transport: buildTransport(),\n });\n }\n return _walletClient as ReturnType<typeof createWalletClient>;\n}\n\n/**\n * Reset cached clients. Required for tests that call setNetwork()\n * after a client was already created.\n */\nexport function resetClients() {\n _publicClient = null;\n _walletClient = null;\n}\n\nexport function getAccount() {\n return privateKeyToAccount(requirePrivateKey());\n}\n\n/**\n * Estimate EIP-1559 fees with a 20% buffer to avoid stuck txs on Base gas spikes.\n */\nexport async function estimateFeesWithBuffer() {\n const client = getPublicClient();\n const { maxFeePerGas, maxPriorityFeePerGas } =\n await client.estimateFeesPerGas();\n let fee = (maxFeePerGas * 120n) / 100n;\n let tip = (maxPriorityFeePerGas * 120n) / 100n;\n // #462: some RPCs (Robinhood testnet after activity bursts) suggest fees\n // orders of magnitude above the live base fee; viem's worst-case prefund\n // check (gas × maxFeePerGas) then rejects large txs from small wallets even\n // though real cost is negligible. Clamp to 10× live base, but ONLY when the\n // suggestion exceeds 1000× base (never true on healthy chains — Base gas\n // spikes stay untouched). Best-effort: a failed getBlock skips the clamp.\n let base: bigint | null | undefined;\n try {\n base = (await client.getBlock()).baseFeePerGas;\n } catch {\n base = undefined;\n }\n if (base !== null && base !== undefined && base > 0n && fee > base * 1000n) {\n fee = base * 10n;\n if (tip > fee) tip = fee;\n }\n return { maxFeePerGas: fee, maxPriorityFeePerGas: tip };\n}\n\n/**\n * Conservative per-op gas-unit budgets for the native-ETH-wrap deposit/redeem\n * sequences. Multiplied by the live buffered `maxFeePerGas` (× a safety factor)\n * to derive the ETH gas cushion — replacing the old hardcoded 0.0005-ETH,\n * Base-calibrated constant that rejected valid deposits on low-fee chains\n * (Robinhood testnet, ~14-wei base fee). Deliberately generous; the realized\n * cost is a fraction of these on any chain.\n */\nexport const GAS_UNITS = {\n wrap: 55_000n,\n approve: 60_000n,\n deposit: 250_000n,\n redeem: 250_000n,\n} as const;\n\n/**\n * Derive the ETH gas cushion from live chain gas instead of a fixed constant:\n *\n * cushion = gasUnits × bufferedMaxFeePerGas × safetyFactor, floored at the\n * active chain's `minGasReserve`.\n *\n * `gasUnits` is the summed budget for the tx sequence (e.g. wrap+approve+deposit\n * via `GAS_UNITS`). Falls back to the per-chain floor when the live fee estimate\n * is unavailable (RPC error). On a ~14-wei-base-fee chain the derived term is\n * negligible, so the tiny per-chain floor dominates; on Base the live term\n * scales with the gas market and the Base-scale floor is the lower bound.\n */\nexport async function estimateGasCushion(\n gasUnits: bigint,\n safetyFactor = 2n,\n): Promise<bigint> {\n const floor = getMinGasReserve();\n try {\n const { maxFeePerGas } = await estimateFeesWithBuffer();\n const derived = gasUnits * maxFeePerGas * safetyFactor;\n return derived > floor ? derived : floor;\n } catch {\n return floor;\n }\n}\n\n// ── Nonce management + retry helpers ──\n//\n// Handles: nonce collisions, underpriced replacements, stuck pending txs.\n// Gas bump ceiling: base * 1.2 (buffer) * 1.1^3 (max retries) ≈ 1.6x base fee.\n\nconst MAX_RETRIES = 3;\nconst RETRY_DELAY_MS = 1500; // backoff between retries\nconst STUCK_NONCE_CONFIRM_DELAY_MS = 2500; // staleness check delay\nconst GAS_BUMP_NUMERATOR = 110n;\nconst GAS_BUMP_DENOMINATOR = 100n;\n\nfunction isUnderpricedError(msg: string): boolean {\n return msg.includes(\"replacement transaction underpriced\");\n}\n\nfunction isNonceStaleError(msg: string): boolean {\n return msg.includes(\"nonce too low\") || msg.includes(\"NONCE_EXPIRED\");\n}\n\nfunction isRetryableError(err: unknown): boolean {\n const msg = err instanceof Error ? err.message : String(err);\n return isUnderpricedError(msg) || isNonceStaleError(msg);\n}\n\nfunction bumpFees(fees: { maxFeePerGas: bigint; maxPriorityFeePerGas: bigint }) {\n return {\n maxFeePerGas: (fees.maxFeePerGas * GAS_BUMP_NUMERATOR) / GAS_BUMP_DENOMINATOR,\n maxPriorityFeePerGas: (fees.maxPriorityFeePerGas * GAS_BUMP_NUMERATOR) / GAS_BUMP_DENOMINATOR,\n };\n}\n\n// ── Stuck nonce detection ──\n\n/**\n * Check if the wallet has a stuck nonce (pending tx count > confirmed tx count).\n * Returns the stuck nonce number, or null if the wallet is clean.\n *\n * Includes a staleness guard: if pending > confirmed, waits ~2.5s and re-checks\n * to avoid false positives from propagation delays.\n */\nexport async function detectStuckNonce(): Promise<number | null> {\n const client = getPublicClient();\n const address = getAccount().address;\n const [confirmed, pending] = await Promise.all([\n client.getTransactionCount({ address, blockTag: \"latest\" }),\n client.getTransactionCount({ address, blockTag: \"pending\" }),\n ]);\n if (pending <= confirmed) return null;\n\n // Staleness guard: re-check after a short delay to avoid false positives\n await new Promise((r) => setTimeout(r, STUCK_NONCE_CONFIRM_DELAY_MS));\n const [confirmed2, pending2] = await Promise.all([\n client.getTransactionCount({ address, blockTag: \"latest\" }),\n client.getTransactionCount({ address, blockTag: \"pending\" }),\n ]);\n return pending2 > confirmed2 ? confirmed2 : null;\n}\n\n/**\n * Clear a single stuck nonce by sending a 0-value self-transfer with aggressively bumped gas.\n * Uses 5x the buffered fee estimate to guarantee replacement even if the original tx\n * was sent during a gas spike (EIP-1559 requires >= 110% of original maxPriorityFeePerGas).\n */\nasync function unstickWalletSingle(): Promise<Hex> {\n const stuckNonce = await detectStuckNonce();\n if (stuckNonce === null) {\n throw new Error(\"No stuck nonce detected — wallet is clean.\");\n }\n\n console.warn(` Unsticking wallet: replacing stuck tx at nonce ${stuckNonce}...`);\n const wallet = getWalletClient();\n const account = getAccount();\n\n // Use 5x gas buffer to guarantee replacement even for txs sent during gas spikes\n const { maxFeePerGas, maxPriorityFeePerGas } = await estimateFeesWithBuffer();\n const hash = await wallet.sendTransaction({\n account,\n chain: wallet.chain,\n to: account.address,\n value: 0n,\n nonce: stuckNonce,\n maxFeePerGas: maxFeePerGas * 5n,\n maxPriorityFeePerGas: maxPriorityFeePerGas * 5n,\n });\n\n const client = getPublicClient();\n await client.waitForTransactionReceipt({ hash });\n console.warn(` Wallet unstuck (nonce ${stuckNonce} replaced).`);\n return hash;\n}\n\n/**\n * Unstick a wallet by clearing ALL stuck nonces, not just the first one.\n * Loops until pending == confirmed nonce count.\n */\nexport async function unstickWallet(): Promise<Hex[]> {\n const hashes: Hex[] = [];\n while ((await detectStuckNonce()) !== null) {\n hashes.push(await unstickWalletSingle());\n }\n if (hashes.length === 0) {\n throw new Error(\"No stuck nonce detected — wallet is clean.\");\n }\n return hashes;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype TxSender = (params: any) => Promise<Hex>;\n\n/**\n * Shared retry loop: explicit nonce + EIP-1559 fee buffer + gas-bump on underpriced errors.\n * On \"nonce too low\" / \"NONCE_EXPIRED\", re-fetches nonce from pending state before retrying.\n * Also detects stuck nonces before sending and auto-unsticks the wallet.\n */\nasync function withRetry(send: TxSender, txParams: Record<string, unknown>): Promise<Hex> {\n const client = getPublicClient();\n const account = getAccount();\n let fees = await estimateFeesWithBuffer();\n\n // Auto-detect and clear ALL stuck nonces before attempting the tx\n while ((await detectStuckNonce()) !== null) {\n await unstickWalletSingle();\n }\n\n let nonce = await client.getTransactionCount({ address: account.address, blockTag: \"pending\" });\n\n for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {\n try {\n return await send({ ...txParams, ...fees, nonce });\n } catch (err) {\n if (attempt >= MAX_RETRIES || !isRetryableError(err)) {\n // Decode contract revert into a human-readable message before throwing\n throw new Error(formatContractError(err));\n }\n\n const msg = err instanceof Error ? err.message : String(err);\n console.warn(` Retry ${attempt + 1}/${MAX_RETRIES}: ${isNonceStaleError(msg) ? \"refreshing nonce\" : \"bumping gas\"}...`);\n\n // Backoff between retries to let mempool settle\n await new Promise((r) => setTimeout(r, RETRY_DELAY_MS));\n\n if (isNonceStaleError(msg)) {\n // Fresh nonce = fresh tx, no replacement needed — only bump fees for underpriced errors\n nonce = await client.getTransactionCount({ address: account.address, blockTag: \"pending\" });\n } else {\n fees = bumpFees(fees);\n }\n }\n }\n throw new Error(\"withRetry: exhausted retries\");\n}\n\n/**\n * Send a raw transaction with automatic gas-bump retry on nonce/underpriced errors.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport async function sendTxWithRetry(txParams: Record<string, any>): Promise<Hex> {\n const wallet = getWalletClient();\n return withRetry((p) => wallet.sendTransaction(p), txParams);\n}\n\n/**\n * Call writeContract with automatic gas-bump retry on nonce/underpriced errors.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport async function writeContractWithRetry(txParams: Record<string, any>): Promise<Hex> {\n const wallet = getWalletClient();\n return withRetry((p) => wallet.writeContract(p), txParams);\n}\n\n/**\n * Wait for a tx receipt. On timeout, checks for stuck nonce and auto-unsticks.\n *\n * **Important**: After unsticking, the error is still re-thrown because the original\n * tx is lost. Callers should use `writeContractWithRetry` / `sendTxWithRetry` which\n * re-fetch nonces automatically. Do NOT manually retry after this throws — use the\n * retry-aware wrappers instead.\n */\nexport async function waitForReceipt(hash: Hex): Promise<TransactionReceipt> {\n const client = getPublicClient();\n try {\n return await client.waitForTransactionReceipt({ hash });\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (err: any) {\n // If receipt wait times out, check for stuck nonce\n const msg = err instanceof Error ? err.message : String(err);\n if (msg.includes(\"timeout\") || msg.includes(\"Timed out\")) {\n if ((await detectStuckNonce()) !== null) {\n console.warn(` Tx ${hash} appears stuck — attempting to unstick wallet...`);\n while ((await detectStuckNonce()) !== null) {\n await unstickWalletSingle();\n }\n }\n }\n throw err;\n }\n}\n","/**\n * Contract error decoding — turns raw reverts into human-readable messages.\n *\n * Uses viem's decodeErrorResult() against a combined ABI of all custom errors\n * from SyndicateVault, SyndicateGovernor, GovernorParameters, SyndicateFactory,\n * and strategy contracts.\n */\n\nimport { type Hex, decodeErrorResult, BaseError } from \"viem\";\nimport { getChain } from \"./network.js\";\n\n// ── Combined error-only ABI for decoding ──\n\nexport const CONTRACT_ERRORS_ABI = [\n // ── SyndicateVault ──\n { type: \"error\", name: \"InvalidOwner\", inputs: [] },\n { type: \"error\", name: \"InvalidExecutorImpl\", inputs: [] },\n { type: \"error\", name: \"NotActiveAgent\", inputs: [] },\n { type: \"error\", name: \"SimulationFailed\", inputs: [] },\n { type: \"error\", name: \"InvalidDepositor\", inputs: [] },\n { type: \"error\", name: \"DepositorAlreadyApproved\", inputs: [] },\n { type: \"error\", name: \"DepositorNotApproved\", inputs: [] },\n { type: \"error\", name: \"NotApprovedDepositor\", inputs: [] },\n { type: \"error\", name: \"AgentAlreadyRegistered\", inputs: [] },\n { type: \"error\", name: \"AgentNotActive\", inputs: [] },\n { type: \"error\", name: \"InvalidAgentRegistry\", inputs: [] },\n { type: \"error\", name: \"NotAgentOwner\", inputs: [] },\n { type: \"error\", name: \"NotGovernor\", inputs: [] },\n { type: \"error\", name: \"RedemptionsLocked\", inputs: [] },\n { type: \"error\", name: \"DepositsLocked\", inputs: [] },\n { type: \"error\", name: \"InvalidAgentAddress\", inputs: [] },\n { type: \"error\", name: \"TransferFailed\", inputs: [] },\n { type: \"error\", name: \"ZeroAddress\", inputs: [] },\n { type: \"error\", name: \"CannotRescueAsset\", inputs: [] },\n { type: \"error\", name: \"NotFactory\", inputs: [] },\n { type: \"error\", name: \"DisallowedBatchCallee\", inputs: [{ name: \"target\", type: \"address\" }] },\n\n // ── SyndicateGovernor ──\n { type: \"error\", name: \"VaultNotRegistered\", inputs: [] },\n { type: \"error\", name: \"VaultAlreadyRegistered\", inputs: [] },\n { type: \"error\", name: \"NotRegisteredAgent\", inputs: [] },\n { type: \"error\", name: \"PerformanceFeeTooHigh\", inputs: [] },\n { type: \"error\", name: \"StrategyDurationTooLong\", inputs: [] },\n { type: \"error\", name: \"StrategyDurationTooShort\", inputs: [] },\n { type: \"error\", name: \"EmptyExecuteCalls\", inputs: [] },\n { type: \"error\", name: \"EmptySettlementCalls\", inputs: [] },\n { type: \"error\", name: \"NotWithinVotingPeriod\", inputs: [] },\n { type: \"error\", name: \"NoVotingPower\", inputs: [] },\n { type: \"error\", name: \"AlreadyVoted\", inputs: [] },\n { type: \"error\", name: \"ProposalNotFound\", inputs: [] },\n { type: \"error\", name: \"ProposalNotApproved\", inputs: [] },\n { type: \"error\", name: \"ExecutionWindowExpired\", inputs: [] },\n { type: \"error\", name: \"StrategyAlreadyActive\", inputs: [] },\n { type: \"error\", name: \"CooldownNotElapsed\", inputs: [] },\n { type: \"error\", name: \"ProposalNotExecuted\", inputs: [] },\n { type: \"error\", name: \"ProposalNotCancellable\", inputs: [] },\n { type: \"error\", name: \"NotProposer\", inputs: [] },\n { type: \"error\", name: \"InvalidVotingPeriod\", inputs: [] },\n { type: \"error\", name: \"InvalidExecutionWindow\", inputs: [] },\n { type: \"error\", name: \"InvalidVetoThresholdBps\", inputs: [] },\n { type: \"error\", name: \"InvalidMaxPerformanceFeeBps\", inputs: [] },\n { type: \"error\", name: \"InvalidStrategyDurationBounds\", inputs: [] },\n { type: \"error\", name: \"InvalidCooldownPeriod\", inputs: [] },\n { type: \"error\", name: \"InvalidVault\", inputs: [] },\n { type: \"error\", name: \"NotVaultOwner\", inputs: [] },\n { type: \"error\", name: \"StrategyDurationNotElapsed\", inputs: [] },\n { type: \"error\", name: \"InvalidProtocolFeeBps\", inputs: [] },\n { type: \"error\", name: \"InvalidProtocolFeeRecipient\", inputs: [] },\n { type: \"error\", name: \"NotCoProposer\", inputs: [] },\n { type: \"error\", name: \"CollaborationExpired\", inputs: [] },\n { type: \"error\", name: \"AlreadyApproved\", inputs: [] },\n { type: \"error\", name: \"InvalidSplits\", inputs: [] },\n { type: \"error\", name: \"TooManyCoProposers\", inputs: [] },\n { type: \"error\", name: \"SplitTooLow\", inputs: [] },\n { type: \"error\", name: \"LeadSplitTooLow\", inputs: [] },\n { type: \"error\", name: \"DuplicateCoProposer\", inputs: [] },\n { type: \"error\", name: \"NotDraftState\", inputs: [] },\n { type: \"error\", name: \"InvalidCollaborationWindow\", inputs: [] },\n { type: \"error\", name: \"NotAuthorized\", inputs: [] },\n { type: \"error\", name: \"InvalidMaxCoProposers\", inputs: [] },\n { type: \"error\", name: \"Reentrancy\", inputs: [] },\n { type: \"error\", name: \"Tier2CallCapExceedsCeiling\", inputs: [{ name: \"index\", type: \"uint256\" }] },\n\n // ── GovernorParameters (timelock) ──\n { type: \"error\", name: \"ChangeAlreadyPending\", inputs: [] },\n { type: \"error\", name: \"NoChangePending\", inputs: [] },\n { type: \"error\", name: \"ChangeNotReady\", inputs: [] },\n { type: \"error\", name: \"InvalidParameterChangeDelay\", inputs: [] },\n { type: \"error\", name: \"InvalidParameterKey\", inputs: [] },\n\n // ── SyndicateFactory ──\n { type: \"error\", name: \"InvalidVaultImpl\", inputs: [] },\n { type: \"error\", name: \"InvalidENSRegistrar\", inputs: [] },\n { type: \"error\", name: \"SubdomainTooShort\", inputs: [] },\n { type: \"error\", name: \"SubdomainTaken\", inputs: [] },\n { type: \"error\", name: \"NotCreator\", inputs: [] },\n { type: \"error\", name: \"InvalidGovernor\", inputs: [] },\n { type: \"error\", name: \"InsufficientCreationFee\", inputs: [] },\n { type: \"error\", name: \"InvalidFeeToken\", inputs: [] },\n { type: \"error\", name: \"ManagementFeeTooHigh\", inputs: [] },\n { type: \"error\", name: \"UpgradesDisabled\", inputs: [] },\n { type: \"error\", name: \"VaultNotDeployed\", inputs: [] },\n { type: \"error\", name: \"StrategyActive\", inputs: [] },\n\n // ── BaseStrategy ──\n { type: \"error\", name: \"AlreadyInitialized\", inputs: [] },\n { type: \"error\", name: \"NotVault\", inputs: [] },\n { type: \"error\", name: \"NotExecuted\", inputs: [] },\n { type: \"error\", name: \"AlreadyExecuted\", inputs: [] },\n { type: \"error\", name: \"AlreadySettled\", inputs: [] },\n\n // ── MoonwellSupplyStrategy / WstETHMoonwellStrategy ──\n { type: \"error\", name: \"InvalidAmount\", inputs: [] },\n { type: \"error\", name: \"MintFailed\", inputs: [] },\n { type: \"error\", name: \"RedeemFailed\", inputs: [] },\n\n // ── AerodromeLPStrategy ──\n { type: \"error\", name: \"GaugeMismatch\", inputs: [] },\n\n // ── WstETHMoonwellStrategy / VeniceInferenceStrategy ──\n { type: \"error\", name: \"SwapFailed\", inputs: [] },\n { type: \"error\", name: \"AlreadySettledParams\", inputs: [] },\n\n // ── PortfolioStrategy / UniswapSwapAdapter ──\n { type: \"error\", name: \"QuoteUnavailable\", inputs: [] },\n { type: \"error\", name: \"UnsupportedMode\", inputs: [] },\n { type: \"error\", name: \"InvalidWeights\", inputs: [] },\n { type: \"error\", name: \"LengthMismatch\", inputs: [] },\n { type: \"error\", name: \"TooManyTokens\", inputs: [] },\n { type: \"error\", name: \"RebalancingInProgress\", inputs: [] },\n { type: \"error\", name: \"StalePrice\", inputs: [] },\n { type: \"error\", name: \"InvalidSlippage\", inputs: [] },\n { type: \"error\", name: \"InvalidPriceDecimals\", inputs: [] },\n\n // ── VeniceInferenceStrategy ──\n { type: \"error\", name: \"NoAgent\", inputs: [] },\n\n // ── ExposureLedger ──\n { type: \"error\", name: \"ApproveLockBelowFloor\", inputs: [] },\n { type: \"error\", name: \"CoverageInputsUnreadable\", inputs: [] },\n { type: \"error\", name: \"InsufficientApproveCoverage\", inputs: [] },\n\n // ── StakedWood ──\n { type: \"error\", name: \"CoverageStillOpen\", inputs: [] },\n\n // ── SyndicateGovernor / GovernorEmergency — v1 additions\n // (bond escrow, tier gates, strategy registration, settle-price floor) ──\n { type: \"error\", name: \"CallCapsExceedMaxCapital\", inputs: [] },\n { type: \"error\", name: \"CallCapsLengthMismatch\", inputs: [] },\n { type: \"error\", name: \"CancelNotAllowedNearQuorum\", inputs: [] },\n { type: \"error\", name: \"ChallengeWindowOpen\", inputs: [] },\n { type: \"error\", name: \"CoProposerShareUnderflow\", inputs: [] },\n { type: \"error\", name: \"CoverageRegressed\", inputs: [] },\n { type: \"error\", name: \"EmergencyNotProposed\", inputs: [] },\n { type: \"error\", name: \"EmergencySettleBlocked\", inputs: [] },\n { type: \"error\", name: \"EmergencySettleNotReady\", inputs: [] },\n { type: \"error\", name: \"ExposureLedgerUnset\", inputs: [] },\n { type: \"error\", name: \"InvalidDrawdown\", inputs: [] },\n { type: \"error\", name: \"InvalidGuardianFeeBps\", inputs: [] },\n { type: \"error\", name: \"InvalidGuardiansFeeRecipient\", inputs: [] },\n { type: \"error\", name: \"InvalidInitialization\", inputs: [] },\n { type: \"error\", name: \"InvalidMaxCapitalBps\", inputs: [] },\n { type: \"error\", name: \"InvalidTier2CallCapBps\", inputs: [] },\n { type: \"error\", name: \"LedgerEscrowMismatch\", inputs: [] },\n { type: \"error\", name: \"MalformedAssetCall\", inputs: [{ name: \"selector\", type: \"bytes4\" }] },\n { type: \"error\", name: \"MaxCapitalCeilingRegressed\", inputs: [] },\n { type: \"error\", name: \"MaxCapitalExceedsCeiling\", inputs: [] },\n { type: \"error\", name: \"MetadataURITooLong\", inputs: [] },\n { type: \"error\", name: \"NoBondToReclaim\", inputs: [] },\n { type: \"error\", name: \"NotARegisteredStrategy\", inputs: [{ name: \"target\", type: \"address\" }] },\n { type: \"error\", name: \"NotInGuardianReview\", inputs: [] },\n { type: \"error\", name: \"NotInitializing\", inputs: [] },\n { type: \"error\", name: \"NotLeadProposer\", inputs: [] },\n { type: \"error\", name: \"OwnerBondInsufficient\", inputs: [] },\n { type: \"error\", name: \"OwnerBondNotLive\", inputs: [] },\n { type: \"error\", name: \"ParamsFrozenDuringProposal\", inputs: [] },\n { type: \"error\", name: \"ProposalInDraft\", inputs: [] },\n { type: \"error\", name: \"ProposalNotTerminal\", inputs: [] },\n { type: \"error\", name: \"RegistryNotSet\", inputs: [] },\n { type: \"error\", name: \"SettlePriceBelowFloor\", inputs: [{ name: \"ppsNow\", type: \"uint256\" }, { name: \"ppsFloor\", type: \"uint256\" }] },\n { type: \"error\", name: \"StrategyNotRegistered\", inputs: [{ name: \"strategy\", type: \"address\" }] },\n { type: \"error\", name: \"TierRegistryNotWired\", inputs: [] },\n { type: \"error\", name: \"TierRegressed\", inputs: [] },\n { type: \"error\", name: \"TooManyCalls\", inputs: [] },\n { type: \"error\", name: \"TransferFromNotVault\", inputs: [{ name: \"from\", type: \"address\" }] },\n { type: \"error\", name: \"VaultHasOpenProposal\", inputs: [] },\n { type: \"error\", name: \"VaultProposalActive\", inputs: [] },\n { type: \"error\", name: \"ZeroMaxCapital\", inputs: [] },\n\n // ── GuardianRegistry — review / emergency / pause lifecycle ──\n { type: \"error\", name: \"AddressEmptyCode\", inputs: [{ name: \"target\", type: \"address\" }] },\n { type: \"error\", name: \"AlreadyPaused\", inputs: [] },\n { type: \"error\", name: \"CooldownBelowReviewPeriod\", inputs: [] },\n { type: \"error\", name: \"ERC1967InvalidImplementation\", inputs: [{ name: \"implementation\", type: \"address\" }] },\n { type: \"error\", name: \"ERC1967NonPayable\", inputs: [] },\n { type: \"error\", name: \"EmergencyAlreadyOpen\", inputs: [] },\n { type: \"error\", name: \"EmergencyHashMismatch\", inputs: [] },\n { type: \"error\", name: \"EmergencyTooManyCalls\", inputs: [] },\n { type: \"error\", name: \"FailedCall\", inputs: [] },\n { type: \"error\", name: \"InvalidParameter\", inputs: [] },\n { type: \"error\", name: \"InvalidReviewWindow\", inputs: [] },\n { type: \"error\", name: \"NewSideFull\", inputs: [] },\n { type: \"error\", name: \"NoVoteChange\", inputs: [] },\n { type: \"error\", name: \"NotActiveGuardian\", inputs: [] },\n { type: \"error\", name: \"NotPausedOrDeadmanNotElapsed\", inputs: [] },\n { type: \"error\", name: \"OwnableInvalidOwner\", inputs: [{ name: \"owner\", type: \"address\" }] },\n { type: \"error\", name: \"OwnableUnauthorizedAccount\", inputs: [{ name: \"account\", type: \"address\" }] },\n { type: \"error\", name: \"ProtocolPaused\", inputs: [] },\n { type: \"error\", name: \"ReentrancyGuardReentrantCall\", inputs: [] },\n { type: \"error\", name: \"RefundCapExceeded\", inputs: [] },\n { type: \"error\", name: \"ReviewAlreadyRegistered\", inputs: [] },\n { type: \"error\", name: \"ReviewNotOpen\", inputs: [] },\n { type: \"error\", name: \"ReviewNotReadyForResolve\", inputs: [] },\n { type: \"error\", name: \"SafeERC20FailedOperation\", inputs: [{ name: \"token\", type: \"address\" }] },\n { type: \"error\", name: \"UUPSUnauthorizedCallContext\", inputs: [] },\n { type: \"error\", name: \"UUPSUnsupportedProxiableUUID\", inputs: [{ name: \"slot\", type: \"bytes32\" }] },\n { type: \"error\", name: \"UnauthorizedGovernor\", inputs: [] },\n { type: \"error\", name: \"VoteChangeLockedOut\", inputs: [] },\n\n // ── StakedWood (sWOOD) — staking, owner bonds, slashing ──\n { type: \"error\", name: \"ApproverAlreadySlashed\", inputs: [] },\n { type: \"error\", name: \"BindingNotApproved\", inputs: [] },\n { type: \"error\", name: \"CheckpointUnorderedInsertion\", inputs: [] },\n { type: \"error\", name: \"DuplicateApprover\", inputs: [] },\n { type: \"error\", name: \"InsufficientStake\", inputs: [] },\n { type: \"error\", name: \"NoActiveStake\", inputs: [] },\n { type: \"error\", name: \"NotAuthorizedSlasher\", inputs: [] },\n { type: \"error\", name: \"NotRegistry\", inputs: [] },\n { type: \"error\", name: \"PreparedStakeAlreadyExists\", inputs: [] },\n { type: \"error\", name: \"PreparedStakeNotFound\", inputs: [] },\n { type: \"error\", name: \"PriorStakeNotCleared\", inputs: [] },\n { type: \"error\", name: \"RegistryAlreadySet\", inputs: [] },\n { type: \"error\", name: \"SlashBpsLengthMismatch\", inputs: [] },\n { type: \"error\", name: \"UnstakeAlreadyRequested\", inputs: [] },\n { type: \"error\", name: \"UnstakeNotRequested\", inputs: [] },\n { type: \"error\", name: \"VaultHasActiveProposal\", inputs: [] },\n { type: \"error\", name: \"VerdictNotPast\", inputs: [] },\n\n // ── StrategyFactory — clone + register ──\n { type: \"error\", name: \"FailedDeployment\", inputs: [] },\n { type: \"error\", name: \"InsufficientBalance\", inputs: [{ name: \"balance\", type: \"uint256\" }, { name: \"needed\", type: \"uint256\" }] },\n { type: \"error\", name: \"InvalidSyndicateFactory\", inputs: [] },\n { type: \"error\", name: \"NotAStrategy\", inputs: [{ name: \"strategy\", type: \"address\" }] },\n { type: \"error\", name: \"ProposerMustBeSender\", inputs: [] },\n { type: \"error\", name: \"TemplateNotApproved\", inputs: [{ name: \"template\", type: \"address\" }] },\n\n // ── TierRegistry — strategy certification + submitter bonds ──\n { type: \"error\", name: \"BondActive\", inputs: [] },\n { type: \"error\", name: \"BondConfigUnset\", inputs: [] },\n { type: \"error\", name: \"BondNotReleasable\", inputs: [] },\n { type: \"error\", name: \"BondPendingRelease\", inputs: [] },\n { type: \"error\", name: \"BondTooLarge\", inputs: [] },\n { type: \"error\", name: \"BondsOutstanding\", inputs: [] },\n { type: \"error\", name: \"BoundRequired\", inputs: [] },\n { type: \"error\", name: \"CertificationExpired\", inputs: [] },\n { type: \"error\", name: \"CertifyDelayNotElapsed\", inputs: [] },\n { type: \"error\", name: \"ClassNotCertified\", inputs: [] },\n { type: \"error\", name: \"CodehashChanged\", inputs: [] },\n { type: \"error\", name: \"CodehashMatches\", inputs: [] },\n { type: \"error\", name: \"InvalidDelay\", inputs: [] },\n { type: \"error\", name: \"InvalidStrategyFactory\", inputs: [] },\n { type: \"error\", name: \"InvalidTier\", inputs: [] },\n { type: \"error\", name: \"NoPendingCertification\", inputs: [] },\n { type: \"error\", name: \"NoPendingClassCertification\", inputs: [] },\n { type: \"error\", name: \"NotAContract\", inputs: [] },\n { type: \"error\", name: \"NotAuthorizedDemoter\", inputs: [] },\n { type: \"error\", name: \"NotCertified\", inputs: [] },\n { type: \"error\", name: \"NotSubmitter\", inputs: [] },\n { type: \"error\", name: \"TemplateCodehashChanged\", inputs: [] },\n { type: \"error\", name: \"ZeroAddressSubmitter\", inputs: [] },\n\n // ── ProposerBondEscrow — proposer bond custody ──\n { type: \"error\", name: \"AmountTooLarge\", inputs: [] },\n { type: \"error\", name: \"BondAlreadyLocked\", inputs: [] },\n { type: \"error\", name: \"FeeBpsTooHigh\", inputs: [] },\n { type: \"error\", name: \"NoBond\", inputs: [] },\n { type: \"error\", name: \"NotAuthorizedConvictor\", inputs: [] },\n { type: \"error\", name: \"NotAuthorizedGovernor\", inputs: [] },\n] as const;\n\n// ── Human-readable error messages ──\n\nconst ERROR_MESSAGES: Record<string, string> = {\n // Vault — permissions / state\n InvalidOwner: \"The caller is not the vault owner.\",\n NotActiveAgent: \"Your wallet is not registered as an active agent on this vault. Ask the creator to run: sherwood fund approve --agent-id <id> --wallet <your-address>\",\n NotApprovedDepositor: \"Your address is not on the depositor whitelist. Ask the vault creator to approve you.\",\n NotGovernor: \"This operation can only be called by the governor contract.\",\n NotFactory: \"This operation can only be called by the factory contract.\",\n RedemptionsLocked: \"Redemptions are locked while a strategy is executing. Wait for the proposal to be settled.\",\n DepositsLocked: \"Deposits are locked while an active proposal exists. Wait for settlement.\",\n InvalidDepositor: \"Invalid depositor address.\",\n DepositorAlreadyApproved: \"This depositor is already on the whitelist.\",\n DepositorNotApproved: \"This depositor is not on the whitelist.\",\n AgentAlreadyRegistered: \"This agent wallet is already registered on the vault.\",\n AgentNotActive: \"This agent is registered but not active.\",\n InvalidAgentRegistry: \"Agent registry address is invalid.\",\n NotAgentOwner: \"You do not own this ERC-8004 agent identity NFT.\",\n InvalidAgentAddress: \"Invalid agent wallet address (cannot be zero).\",\n InvalidExecutorImpl: \"Executor implementation address is invalid.\",\n SimulationFailed: \"Transaction simulation failed — the batch calls would revert onchain.\",\n TransferFailed: \"ERC-20 token transfer failed. Check token balance and approvals.\",\n ZeroAddress: \"A required address parameter is the zero address.\",\n CannotRescueAsset: \"Cannot rescue the vault's underlying asset — use redeem() instead.\",\n DisallowedBatchCallee: \"A governor-batch call targeted an address that is neither the vault's underlying asset nor a TierRegistry-allowlisted adapter.\",\n\n // Governor — proposal lifecycle\n VaultNotRegistered: \"This vault is not registered with the governor. The factory registers vaults automatically on creation.\",\n VaultAlreadyRegistered: \"This vault is already registered with the governor.\",\n NotRegisteredAgent: \"Your wallet is not a registered agent on this vault. Register first via: sherwood fund approve\",\n PerformanceFeeTooHigh: \"Performance fee exceeds the governor's maxPerformanceFeeBps. Check: sherwood governor info\",\n StrategyDurationTooLong: \"Strategy duration exceeds the governor's maxStrategyDuration. Check: sherwood governor info\",\n StrategyDurationTooShort: \"Strategy duration is below the governor's minStrategyDuration. Check: sherwood governor info\",\n EmptyExecuteCalls: \"Proposal must include at least one execute call.\",\n EmptySettlementCalls: \"Proposal must include at least one settlement call.\",\n NotWithinVotingPeriod: \"Voting period has not started or has already ended. Check: sherwood proposal show <id>\",\n NoVotingPower: \"You have no voting power (zero vault shares at the snapshot time).\",\n AlreadyVoted: \"You have already voted on this proposal.\",\n ProposalNotFound: \"Proposal does not exist. Check the proposal ID.\",\n ProposalNotApproved: \"Proposal is not in Approved state. It may still be in voting or was rejected.\",\n ExecutionWindowExpired: \"The execution window has closed. The proposal is now Expired.\",\n StrategyAlreadyActive: \"Another strategy is currently executing on this vault. Settle it first before executing a new proposal.\",\n CooldownNotElapsed: \"A proposal was recently settled. Wait for the cooldown period to elapse. Check: sherwood governor info\",\n ProposalNotExecuted: \"Proposal has not been executed yet. Execute it first.\",\n ProposalNotCancellable: \"This proposal cannot be cancelled in its current state.\",\n NotProposer: \"Only the original proposer can perform this action.\",\n StrategyDurationNotElapsed: \"Strategy duration has not elapsed yet. Only the proposer can settle early.\",\n\n // Governor — parameter validation\n InvalidVotingPeriod: \"Voting period is outside allowed bounds (check governor constants).\",\n InvalidExecutionWindow: \"Execution window is outside allowed bounds.\",\n InvalidVetoThresholdBps: \"Veto threshold must be between the allowed bounds (in bps).\",\n InvalidMaxPerformanceFeeBps: \"Max performance fee is outside allowed bounds.\",\n InvalidStrategyDurationBounds: \"Strategy duration bounds are invalid (min must be < max).\",\n InvalidCooldownPeriod: \"Cooldown period is outside allowed bounds.\",\n InvalidVault: \"Invalid vault address.\",\n NotVaultOwner: \"Only the vault owner can perform this action.\",\n InvalidProtocolFeeBps: \"Protocol fee exceeds the 10% maximum (1000 bps).\",\n InvalidProtocolFeeRecipient: \"Protocol fee recipient must be set before enabling protocol fees.\",\n\n // Governor — collaborative proposals\n NotCoProposer: \"You are not listed as a co-proposer on this proposal.\",\n CollaborationExpired: \"The collaboration window has expired.\",\n AlreadyApproved: \"This co-proposer has already approved.\",\n InvalidSplits: \"Co-proposer fee splits must sum correctly with the lead proposer split.\",\n TooManyCoProposers: \"Exceeds the maximum number of co-proposers. Check: sherwood governor info\",\n SplitTooLow: \"A co-proposer's fee split is below the minimum.\",\n LeadSplitTooLow: \"The lead proposer's fee split is below the minimum.\",\n DuplicateCoProposer: \"Duplicate co-proposer address in the list.\",\n NotDraftState: \"Proposal must be in Draft state for this operation.\",\n InvalidCollaborationWindow: \"Collaboration window is outside allowed bounds.\",\n NotAuthorized: \"You are not authorized to perform this action.\",\n InvalidMaxCoProposers: \"Max co-proposers value is outside allowed bounds.\",\n Reentrancy: \"Reentrancy detected — this call cannot be made during another call.\",\n Tier2CallCapExceedsCeiling: \"A tier-2 call cap exceeds the vault's tier-2 per-call ceiling (totalAssets × tier2CallCapBps / 10_000). Lower that call's cap.\",\n\n // Governor — parameter timelock\n ChangeAlreadyPending: \"A parameter change is already pending for this parameter. Finalize or cancel it first.\",\n NoChangePending: \"No parameter change is pending for this key.\",\n ChangeNotReady: \"Parameter change timelock has not elapsed yet. Wait for the delay to pass, then finalize.\",\n InvalidParameterChangeDelay: \"Parameter change delay is outside allowed bounds.\",\n InvalidParameterKey: \"Unknown parameter key.\",\n\n // Factory\n InvalidVaultImpl: \"Vault implementation address is invalid.\",\n InvalidENSRegistrar: \"ENS registrar address is invalid.\",\n SubdomainTooShort: \"Subdomain must be at least 3 characters.\",\n SubdomainTaken: \"This subdomain is already taken. Choose a different name.\",\n NotCreator: \"Only the fund creator can perform this action.\",\n InvalidGovernor: \"Governor address is invalid.\",\n InsufficientCreationFee: \"Insufficient creation fee. Check the required fee amount.\",\n InvalidFeeToken: \"Invalid fee token address.\",\n ManagementFeeTooHigh: \"Management fee exceeds the maximum allowed.\",\n UpgradesDisabled: \"Vault upgrades are currently disabled by the factory owner.\",\n VaultNotDeployed: \"Vault has not been deployed yet.\",\n StrategyActive: \"Cannot perform this action while a strategy is actively executing.\",\n\n // Strategy — base\n AlreadyInitialized: \"This strategy clone was already initialized. Deploy a fresh clone.\",\n NotVault: \"Only the vault can call this strategy function.\",\n NotExecuted: \"Strategy has not been executed yet.\",\n AlreadyExecuted: \"Strategy has already been executed.\",\n AlreadySettled: \"Strategy has already been settled.\",\n\n // Strategy — Moonwell / WstETH\n InvalidAmount: \"Invalid amount — must be greater than zero.\",\n MintFailed: \"Moonwell cToken mint failed. The underlying supply may have hit the market cap.\",\n RedeemFailed: \"Moonwell cToken redeem failed. Check that sufficient liquidity is available.\",\n\n // Strategy — Aerodrome\n GaugeMismatch: \"Aerodrome gauge does not match the expected pool.\",\n\n // Strategy — WstETH / Venice\n SwapFailed: \"Token swap failed. Check slippage tolerance and pool liquidity.\",\n AlreadySettledParams: \"Settlement parameters have already been set.\",\n\n // Strategy — Portfolio / UniswapSwapAdapter\n QuoteUnavailable:\n \"Uniswap quoter returned 0 or reverted for a portfolio allocation. \" +\n \"Usually means: (a) no V3 pool exists at the requested fee tier for one of the tokens, \" +\n \"(b) the strategy clone was initialized against an old/broken UniswapSwapAdapter \" +\n \"(check the clone's swapAdapter() vs the current chains JSON), or \" +\n \"(c) the adapter is calling Quoter with the wrong ABI (pre-PR #317 bug).\",\n UnsupportedMode: \"UniswapSwapAdapter doesn't support that swap mode. Only V3 single-hop (mode 0) and multi-hop (mode 1) are supported.\",\n InvalidWeights: \"Portfolio weights must sum to 10000 bps (100%).\",\n LengthMismatch: \"Portfolio input arrays (tokens / weights / swapExtraData / priceDecimals / feeds) must have the same length.\",\n TooManyTokens: \"Portfolio basket exceeds the maximum allocation count (20).\",\n RebalancingInProgress: \"A rebalance is already in flight on this clone. Wait for it to finish.\",\n StalePrice:\n \"A Chainlink push feed read fail-closed because it is stale (or non-positive). Two sources share this \" +\n \"selector: PortfolioStrategy on every execute/settle/rebalance price read (MAX_PUSH_PRICE_AGE = 26h), and \" +\n \"ExposureLedger.coverageUsd on the vault asset at propose time (per-asset maxDelay). Wait for the feed to \" +\n \"update, or drop that allocation.\",\n InvalidSlippage: \"maxSlippageBps must be > 0 and < 10000.\",\n InvalidPriceDecimals: \"priceDecimals entry exceeds 36. Use 8 for tokenized-stock feeds, 18 for crypto pairs.\",\n\n // Strategy — Venice\n NoAgent: \"No agent is registered on the vault. Register an agent first.\",\n\n // ExposureLedger\n ApproveLockBelowFloor:\n \"An approver slot costs min(ceil(need/100), your whole budget), valued in USD at vote time. \" +\n \"Three ways to hit this: (1) the lock booked to zero — your free budget (k x stake minus open \" +\n \"exposure) is used up, so close an open lock or wait for one to age out; (2) your budget values \" +\n \"to zero — you have no slashable stake, or WOOD prices to zero right now; (3) what you declared \" +\n \"is worth less than the floor — raise --lock-wood on `sherwood proposal review-vote`.\",\n CoverageInputsUnreadable:\n \"The ledger could not read this proposal's coverage inputs (vault asset / required coverage). \" +\n \"Usually there is no such proposal on that governor — an unknown id reads back a zero vault. \" +\n \"Check the proposal id, and that the address really is this vault's governor.\",\n InsufficientApproveCoverage: \"No bonded guardian coverage was raised for this proposal. Execution requires at least one identified, bonded approver with slashable coverage.\",\n\n // StakedWood\n CoverageStillOpen: \"Cannot release the unstake yet — this guardian still backs a proposal that could be challenged. The unstake request stays open; retry after coverage closes.\",\n\n // GuardianRegistry — review lifecycle\n NotActiveGuardian:\n \"Your wallet is not an active guardian at this review's snapshot. Vote weight is measured at \" +\n \"`openedAt - 1`, so stake that landed in the same block the review opened counts as zero — and a \" +\n \"guardian with a pending unstake request is not active at all. Check: sherwood guardian status\",\n ReviewNotOpen: \"No guardian review is open for this proposal. It opens once the voting period ends (`openReview`), and closes at `reviewEnd`.\",\n ReviewNotReadyForResolve: \"The review window has not closed yet — `resolveReview` only works after `reviewEnd`.\",\n ReviewAlreadyRegistered: \"A guardian review is already registered for this (governor, proposal) pair.\",\n VoteChangeLockedOut: \"Vote changes are locked out in the final 10% of the review window. Your earlier vote stands.\",\n NewSideFull: \"The side you are switching to is full — approvers are capped at 100 per proposal (blockers are uncapped).\",\n NoVoteChange: \"That is the vote you already cast — nothing to change.\",\n UnauthorizedGovernor: \"This governor is not authorized on the GuardianRegistry. The factory authorizes a vault's governor at createSyndicate.\",\n InvalidReviewWindow: \"Review window is outside the registry's allowed bounds.\",\n CooldownBelowReviewPeriod: \"The unstake cooldown cannot be shorter than the review period — a guardian could otherwise exit before a slash lands.\",\n RefundCapExceeded: \"The slash-appeal refund exceeds the per-epoch cap (20% of the Slash Appeal Reserve).\",\n EmergencyAlreadyOpen: \"An emergency settle is already open for this proposal. Cancel it first (`cancelEmergencySettle`).\",\n EmergencyHashMismatch: \"The calls passed to finalizeEmergencySettle do not match the calldata hash committed when the emergency was opened.\",\n EmergencyTooManyCalls: \"The emergency settle carries more calls than the registry allows.\",\n NotPausedOrDeadmanNotElapsed: \"The registry is not paused, or the 7-day deadman delay has not elapsed yet.\",\n ProtocolPaused: \"The guardian registry is paused — review voting and claims are suspended.\",\n AlreadyPaused: \"The registry is already paused.\",\n InvalidParameter: \"A parameter is outside the contract's allowed bounds.\",\n\n // StakedWood (sWOOD)\n UnstakeAlreadyRequested: \"This stake already has a pending unstake request — top-ups are refused while one is open (it would grow the quorum denominator without adding votable weight). Cancel the request first.\",\n UnstakeNotRequested: \"No unstake request is pending for this stake.\",\n NoActiveStake: \"No active stake for this address. A slash clears the unstake request, so a slashed guardian cannot cancel back into the active set.\",\n InsufficientStake: \"Stake is below the amount this operation needs.\",\n OwnerBondInsufficient: \"The vault owner's WOOD bond is below `requiredOwnerBond(vault) = max(minOwnerStake, TVL * ownerStakeTvlBps / 10_000)`. Top it up: sherwood guardian prepare-owner-stake <amount>\",\n PreparedStakeAlreadyExists: \"A prepared owner stake already exists for this address — bind or withdraw it before preparing another.\",\n PreparedStakeNotFound: \"No prepared owner stake found. Run `sherwood guardian prepare-owner-stake <amount>` before creating the fund.\",\n PriorStakeNotCleared: \"A prior stake for this slot has not been cleared yet.\",\n VaultHasActiveProposal: \"The vault has an open proposal — the owner bond cannot be unstaked until it settles or is cancelled.\",\n NotRegistry: \"Only the GuardianRegistry can call this sWOOD function.\",\n NotAuthorizedSlasher: \"The caller is not an authorized slasher.\",\n VerdictNotPast: \"The verdict is not final yet.\",\n ApproverAlreadySlashed: \"This approver was already slashed for that review.\",\n DuplicateApprover: \"Duplicate approver in the slash list.\",\n SlashBpsLengthMismatch: \"The slash-bps array does not line up with the approver array.\",\n RegistryAlreadySet: \"sWOOD's registry is set once at wiring time and cannot be re-pointed.\",\n BindingNotApproved: \"The owner-stake binding was not approved by the factory.\",\n\n // StrategyFactory\n TemplateNotApproved: \"This strategy template is not on the StrategyFactory allowlist. The factory owner must call setTemplateApproval(template, true).\",\n NotAStrategy: \"That address is not a strategy — it has no code, or does not answer vault() / proposer() / executed().\",\n ProposerMustBeSender: \"cloneAndInit / cloneAndInitDeterministic require proposer == msg.sender. Deploy the clone from the proposer's own wallet.\",\n FailedDeployment: \"CREATE2 deployment failed — a clone already occupies that deterministic address. Re-run with a different --salt.\",\n InvalidSyndicateFactory: \"The StrategyFactory's SyndicateFactory address is invalid.\",\n\n // Governor — v1 bond / tier / strategy gates\n StrategyNotRegistered:\n \"The proposal's strategy is not registered on the StrategyFactory. Deploy it with \" +\n \"`sherwood strategy propose` / `strategy clone` (both go through StrategyFactory.cloneAndInitDeterministic, \" +\n \"which registers atomically) — a raw ERC-1167 clone deployed from an EOA is never registered.\",\n NotARegisteredStrategy: \"A batch call targets an address that is not a registered strategy.\",\n ProposalNotTerminal: \"The proposal is not in a terminal state. A bond is only reclaimable from Rejected / Expired / Cancelled / Settled.\",\n NoBondToReclaim: \"This proposal has no proposer bond left to reclaim — it was never bonded, or the bond was already released or forfeited.\",\n ChallengeWindowOpen: \"The challenge window on this executed proposal is still open. The bond unlocks at executedAt + strategyDuration + challengeWindow.\",\n ExposureLedgerUnset: \"No ExposureLedger is wired, so the challenge-window gate cannot be evaluated — the reclaim fails closed.\",\n ParamsFrozenDuringProposal: \"Governor parameters are frozen while a proposal is open. Settle or cancel it first.\",\n OwnerBondNotLive: \"The vault owner's bond is not live on sWOOD.\",\n VaultHasOpenProposal: \"This vault already has an open proposal. Settle or cancel it first.\",\n VaultProposalActive: \"A proposal is already active on this vault.\",\n InvalidDrawdown: \"maxDrawdownBps must be 0-10000.\",\n ZeroMaxCapital: \"The proposal's maxCapital envelope is zero — declare what the batch may deploy.\",\n MaxCapitalExceedsCeiling: \"maxCapital exceeds the vault's per-proposal ceiling (totalAssets * maxCapitalBps / 10_000).\",\n CallCapsLengthMismatch: \"The per-call caps array does not line up with its calls array.\",\n CallCapsExceedMaxCapital: \"The per-call caps sum to more than the proposal's maxCapital envelope.\",\n TooManyCalls: \"The proposal carries more batch calls than the governor allows.\",\n MetadataURITooLong: \"The metadata URI exceeds the governor's length cap. Pin the JSON and pass the short ipfs:// URI.\",\n SettlePriceBelowFloor: \"Settlement would land below the price floor the proposal's declared drawdown allows. Widening it requires a new proposal.\",\n TierRegistryNotWired: \"The governor has no TierRegistry wired — tier-gated proposals cannot be validated.\",\n TierRegressed: \"The strategy's certified tier dropped after the proposal was created.\",\n CoverageRegressed: \"Guardian coverage fell below what this proposal had when it was approved.\",\n LedgerEscrowMismatch: \"The pinned ExposureLedger and ProposerBondEscrow disagree — the bond gates cannot be evaluated.\",\n NotInGuardianReview: \"The proposal is not in GuardianReview.\",\n NotLeadProposer: \"Only the lead proposer can perform this action.\",\n EmergencyNotProposed: \"No emergency settle is pending for this proposal.\",\n EmergencySettleNotReady: \"The emergency review window has not elapsed yet.\",\n EmergencySettleBlocked: \"Guardians reached block quorum on this emergency settle — it cannot be finalized.\",\n CancelNotAllowedNearQuorum: \"Cancel is blocked this close to a block quorum — the proposer must commit at this point.\",\n\n // ProposerBondEscrow\n NoBond: \"No bond is held in escrow for this (governor, proposal) pair.\",\n BondAlreadyLocked: \"A bond is already locked for this (governor, proposal) pair.\",\n NotAuthorizedGovernor: \"Only the governor that locked the bond can release or forfeit it.\",\n\n // OpenZeppelin — shared\n OwnableUnauthorizedAccount: \"Only the contract owner can call this. Your wallet is not the owner.\",\n ReentrancyGuardReentrantCall: \"Reentrant call rejected by the contract's reentrancy guard.\",\n InvalidInitialization: \"This proxy is already initialized (or initialization is not currently allowed).\",\n SafeERC20FailedOperation: \"An ERC-20 transfer/approval failed. Check balance, allowance and that the token returns a bool.\",\n FailedCall: \"A low-level call inside the contract failed without a reason.\",\n AddressEmptyCode: \"The call targeted an address with no code.\",\n};\n\n// ── Decoding ──\n\n/**\n * Attempt to decode a hex revert selector into a human-readable error message.\n * Returns null if the selector doesn't match any known contract error.\n */\nexport function decodeContractError(data: Hex): { name: string; message: string } | null {\n try {\n const decoded = decodeErrorResult({\n abi: CONTRACT_ERRORS_ABI,\n data,\n });\n const message = ERROR_MESSAGES[decoded.errorName] || `Contract error: ${decoded.errorName}`;\n return { name: decoded.errorName, message };\n } catch {\n return null;\n }\n}\n\n/**\n * Extract a hex error selector from a viem error's walk chain.\n * viem wraps contract call reverts in ContractFunctionRevertedError which\n * contains a `data` field with the raw 4-byte (or longer) revert payload.\n */\nfunction extractRevertData(err: unknown): Hex | null {\n if (!(err instanceof BaseError)) return null;\n\n // Walk the viem error chain to find revert data\n const revertError = err.walk((e) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (e as any).data !== undefined;\n });\n\n if (revertError) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const data = (revertError as any).data;\n // data can be the hex string directly, or an object with a data field\n if (typeof data === \"string\" && data.startsWith(\"0x\")) {\n return data as Hex;\n }\n if (typeof data === \"object\" && data?.data && typeof data.data === \"string\") {\n return data.data as Hex;\n }\n }\n\n // Fallback: extract 0x + hex from the error message (e.g. \"reverted with 0x62df0545\")\n const msg = err.message || \"\";\n const match = msg.match(/(?:signature|data)\\s*\"?(0x[0-9a-fA-F]+)\"?/);\n if (match) return match[1] as Hex;\n\n return null;\n}\n\n// ── Known common EVM / ERC-20 revert strings ──\n\nconst KNOWN_REVERT_STRINGS: Record<string, string> = {\n \"ERC20: transfer amount exceeds balance\": \"Insufficient token balance for this transfer.\",\n \"ERC20: transfer amount exceeds allowance\": \"Token allowance insufficient. An approval step may have been skipped.\",\n \"ERC20: insufficient allowance\": \"Token allowance insufficient. An approval step may have been skipped.\",\n \"Ownable: caller is not the owner\": \"Only the contract owner can call this function.\",\n \"Pausable: paused\": \"The contract is currently paused.\",\n};\n\n/**\n * Format any caught error into a user-friendly message.\n *\n * Tries (in order):\n * 1. Decode custom error selector from our contract ABIs\n * 2. Match known EVM/ERC-20 revert reason strings\n * 3. Identify nonce / gas issues with actionable advice\n * 4. Fall back to the raw error message\n */\nexport function formatContractError(err: unknown): string {\n // 1. Try to decode custom contract error\n const revertData = extractRevertData(err);\n if (revertData && revertData.length >= 10) {\n const decoded = decodeContractError(revertData);\n if (decoded) return decoded.message;\n }\n\n const rawMsg = err instanceof Error ? err.message : String(err);\n\n // 2. Check for known revert reason strings\n for (const [pattern, message] of Object.entries(KNOWN_REVERT_STRINGS)) {\n if (rawMsg.includes(pattern)) return message;\n }\n\n // 3. Nonce / gas issues — already handled by retry, but surface clearly if they bubble up\n if (rawMsg.includes(\"replacement transaction underpriced\")) {\n return \"A previous transaction is stuck. The CLI retried with higher gas but the error persists. Try again in a moment.\";\n }\n if (rawMsg.includes(\"nonce too low\") || rawMsg.includes(\"NONCE_EXPIRED\")) {\n return \"Transaction nonce conflict — a previous transaction is still pending. Wait a moment and retry.\";\n }\n if (rawMsg.includes(\"insufficient funds for gas\")) {\n return `Insufficient ETH for gas fees. Top up your wallet with ETH on ${getChain().name}.`;\n }\n\n // 4. Clean up common viem wrapper noise\n // Strip \"ContractFunctionRevertedError:\" prefix and \"Docs:\" links\n let cleaned = rawMsg\n .replace(/ContractFunctionRevertedError:\\s*/g, \"\")\n .replace(/Docs:\\s*https:\\/\\/\\S+/g, \"\")\n .replace(/Version:\\s*viem@\\S+/g, \"\")\n .replace(/Request Arguments:[\\s\\S]*$/m, \"\")\n .replace(/Contract Call:[\\s\\S]*?(?=\\n\\n|\\n[A-Z]|$)/m, \"\")\n .trim();\n\n // If we still have \"reverted with the following signature: 0x...\" try one more decode\n const sigMatch = cleaned.match(/signature[:\\s]+\"?(0x[0-9a-fA-F]{8,})\"?/);\n if (sigMatch) {\n const decoded = decodeContractError(sigMatch[1] as Hex);\n if (decoded) return decoded.message;\n // If we can't decode it, at least explain what it is\n const explorer = getChain().blockExplorers?.default?.name ?? \"the block explorer\";\n cleaned = `Contract reverted with unknown error selector ${sigMatch[1]}. Check the transaction on ${explorer} for details.`;\n }\n\n return cleaned;\n}\n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AAChD;AAMA,eAAsB,gBAAgB,UAA6C;AACjF,QAAM,SAAS,gBAAgB;AAC/B,SAAO,UAAU,CAAC,MAAM,OAAO,gBAAgB,CAAC,GAAG,QAAQ;AAC7D;AAMA,eAAsB,uBAAuB,UAA6C;AACxF,QAAM,SAAS,gBAAgB;AAC/B,SAAO,UAAU,CAAC,MAAM,OAAO,cAAc,CAAC,GAAG,QAAQ;AAC3D;AAUA,eAAsB,eAAe,MAAwC;AAC3E,QAAM,SAAS,gBAAgB;AAC/B,MAAI;AACF,WAAO,MAAM,OAAO,0BAA0B,EAAE,KAAK,CAAC;AAAA,EAExD,SAAS,KAAU;AAEjB,UAAM,MAAM,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;AAC3D,QAAI,IAAI,SAAS,SAAS,KAAK,IAAI,SAAS,WAAW,GAAG;AACxD,UAAK,MAAM,iBAAiB,MAAO,MAAM;AACvC,gBAAQ,KAAK,QAAQ,IAAI,uDAAkD;AAC3E,eAAQ,MAAM,iBAAiB,MAAO,MAAM;AAC1C,gBAAM,oBAAoB;AAAA,QAC5B;AAAA,MACF;AAAA,IACF;AACA,UAAM;AAAA,EACR;AACF;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getAccount
3
- } from "./chunk-QRMZRAMG.js";
3
+ } from "./chunk-D4BSBW3Q.js";
4
4
  import {
5
5
  getVeniceApiKey,
6
6
  setVeniceApiKey
@@ -186,4 +186,4 @@ export {
186
186
  chatCompletion,
187
187
  listModels
188
188
  };
189
- //# sourceMappingURL=chunk-KVB5P2OE.js.map
189
+ //# sourceMappingURL=chunk-EEI6FRTE.js.map
@@ -1,9 +1,6 @@
1
1
  import {
2
2
  getNetwork
3
- } from "./chunk-PVTZMRC6.js";
4
-
5
- // src/lib/addresses.ts
6
- import { isAddress } from "viem";
3
+ } from "./chunk-G3FUEM5N.js";
7
4
 
8
5
  // src/lib/address-overrides.ts
9
6
  import { readFileSync } from "fs";
@@ -235,39 +232,13 @@ var ROBINHOOD_TESTNET_SYNTHRA = {
235
232
  FACTORY: "0x911b4000D3422F482F4062a913885f7b035382Df"
236
233
  };
237
234
  var ROBINHOOD_TESTNET_CHAINLINK = {
238
- VERIFIER_PROXY: "0x72790f9eB82db492a7DDb6d2af22A270Dcc3Db64",
239
235
  WSTETH_ETH_FEED: ZERO,
240
- // Tokenized-equity push feeds exist only on the mainnet fork (Data-Streams
241
- // mode here). Keyed as ZERO so the registry shape covers both chains and the
242
- // fork's `<SYM>_USD_FEED` auto-resolve (template-encoder.ts) has a slot.
236
+ // Tokenized-equity push feeds exist only on the mainnet fork. Keyed as ZERO
237
+ // so the registry shape covers both chains and the fork's `<SYM>_USD_FEED`
238
+ // auto-resolve (template-encoder.ts) has a slot.
243
239
  ...noneOf(forkStockFeeds())
244
240
  };
245
241
  var ROBINHOOD_STOCK_ROUTES = {};
246
- var ROBINHOOD_NON_EQUITY_FEEDS = /* @__PURE__ */ new Set(["ETH", "WETH", "BTC", "LINK", "USDG", "USDC"]);
247
- function isRobinhoodEquityFeed(symbol) {
248
- return !ROBINHOOD_NON_EQUITY_FEEDS.has(symbol.toUpperCase());
249
- }
250
- function symbolForTokenAddress(address, tokens) {
251
- if (!address || address.toLowerCase() === ZERO.toLowerCase()) return void 0;
252
- const want = address.toLowerCase();
253
- for (const [symbol, addr] of Object.entries(tokens)) {
254
- if (addr && addr !== ZERO && addr.toLowerCase() === want) return symbol;
255
- }
256
- return void 0;
257
- }
258
- function robinhoodEquityMaxAge(tokenSpec, tokens, equityMaxAgeSeconds) {
259
- let symbol;
260
- if (isAddress(tokenSpec)) {
261
- symbol = symbolForTokenAddress(tokenSpec, tokens);
262
- if (!symbol) return { maxPriceAge: 0, unknownAddress: true };
263
- } else {
264
- symbol = tokenSpec;
265
- }
266
- return {
267
- maxPriceAge: isRobinhoodEquityFeed(symbol) ? equityMaxAgeSeconds : 0,
268
- unknownAddress: false
269
- };
270
- }
271
242
  var ROBINHOOD_TESTNET_INFRA = {
272
243
  MULTICALL3: "0xcA11bde05977b3631167028862bE2a173976CA11"
273
244
  // Deterministic, same everywhere
@@ -296,7 +267,6 @@ var ROBINHOOD_TESTNET_SHERWOOD = {
296
267
  PROTOCOL_CONFIG: "0xC104Eb6a522d6718cA28F344B2373B29d57FF2E0",
297
268
  PRICE_ROUTER: "0xDd302ffcfA08071780eC1A2f12BccFB9ba6b6731",
298
269
  TIER_REGISTRY: "0x99b8068Dc0F6093466964D581f72d947e3e380DB",
299
- CALL_SANDBOX_IMPL: "0xf09f6AF7DeBB964eD731376C9Af389F2Ce3d872A",
300
270
  // Not in chains/46630.json (econ-security stack not deployed there yet).
301
271
  EXPOSURE_LEDGER: ZERO,
302
272
  PROPOSER_BOND_ESCROW: ZERO,
@@ -321,7 +291,10 @@ var ROBINHOOD_TESTNET_STRATEGY_TEMPLATES = {
321
291
  HYPERLIQUID_PERP: ZERO,
322
292
  HYPERLIQUID_GRID: ZERO,
323
293
  // V2 redeploy PORTFOLIO_TEMPLATE (chain 46630).
324
- PORTFOLIO: "0x67420Cc504d70a42Adfd8867d878afe0978C7d10"
294
+ PORTFOLIO: "0x67420Cc504d70a42Adfd8867d878afe0978C7d10",
295
+ // v1 templates — deployed on the fork only so far (no 46630 equivalent).
296
+ MORPHO_SUPPLY: ZERO,
297
+ CONCENTRATED_LIQUIDITY: ZERO
325
298
  };
326
299
  var ROBINHOOD_MAINNET_EAS = {
327
300
  EAS: "0x7d70441Bb10AcE5d9771dc0b6205D89ddf63205B",
@@ -358,7 +331,6 @@ var ROBINHOOD_FORK_UNISWAP = {
358
331
  SWAP_ADAPTER: "0x54E6A7af53143556973493fDeC9d7837A77c67eF"
359
332
  };
360
333
  var ROBINHOOD_FORK_CHAINLINK = {
361
- VERIFIER_PROXY: ZERO,
362
334
  WSTETH_ETH_FEED: ZERO,
363
335
  ...forkStockFeeds()
364
336
  };
@@ -376,10 +348,9 @@ var ROBINHOOD_FORK_SHERWOOD = {
376
348
  BATCH_EXECUTOR_LIB: "0x899FC2Cac572F64A233344115b488E71E0044f34",
377
349
  GOVERNOR_BEACON: "0x3CF45eFE9fBDdd6cB749384Bf5c1bA5Ec96af05d",
378
350
  PROTOCOL_CONFIG: "0x8aDb5810B5bF8B9149BE3Ca45Cb441818a9679bB",
379
- // Not in chains/9994663.json (no PriceRouter / CallSandbox on the fork).
351
+ // Not in chains/9994663.json (no PriceRouter on the fork).
380
352
  PRICE_ROUTER: ZERO,
381
353
  TIER_REGISTRY: "0x4614f058920941A0a9a852e62485fbDE692D75E1",
382
- CALL_SANDBOX_IMPL: ZERO,
383
354
  EXPOSURE_LEDGER: "0x99D789E7C8E65dB5597dCa692F082B47BE30AB33",
384
355
  PROPOSER_BOND_ESCROW: "0x7d25058c891d3AC5C8bc8Da6aA937DFeE648B5cF",
385
356
  CHALLENGE_GAME: "0x7046FececcA6c0f5E66Cc998099593ae71A1bbee",
@@ -393,7 +364,14 @@ var ROBINHOOD_FORK_STRATEGY_TEMPLATES = {
393
364
  MAMO_YIELD: ZERO,
394
365
  HYPERLIQUID_PERP: ZERO,
395
366
  HYPERLIQUID_GRID: ZERO,
396
- PORTFOLIO: "0xAA5872009c527cCb80343E41C52840CEdb095eb0"
367
+ PORTFOLIO: "0xAA5872009c527cCb80343E41C52840CEdb095eb0",
368
+ // MORPHO_SUPPLY_TEMPLATE / CONCENTRATED_LIQUIDITY_TEMPLATE from
369
+ // sherwood-protocol/chains/9994663.json. Both are live and on the
370
+ // StrategyFactory allowlist; the CLI has no init encoder for their init
371
+ // tuples yet, so `strategy list` shows them and `clone`/`propose` say so
372
+ // explicitly instead of the address book pretending they don't exist.
373
+ MORPHO_SUPPLY: "0x5B55E1Da361573CB0788e750038567D2569BE41d",
374
+ CONCENTRATED_LIQUIDITY: "0xcba9C84F2d382729D1519c5F7f4a9AAaC075f8B5"
397
375
  };
398
376
  var TOKEN_REGISTRY = {
399
377
  "robinhood-testnet": ROBINHOOD_TESTNET_TOKENS,
@@ -526,7 +504,6 @@ function CHAINLINK() {
526
504
 
527
505
  export {
528
506
  ROBINHOOD_STOCK_ROUTES,
529
- robinhoodEquityMaxAge,
530
507
  TOKENS,
531
508
  MOONWELL,
532
509
  UNISWAP,
@@ -541,4 +518,4 @@ export {
541
518
  SYNTHRA,
542
519
  CHAINLINK
543
520
  };
544
- //# sourceMappingURL=chunk-IAM4VIU2.js.map
521
+ //# sourceMappingURL=chunk-FWQESFFM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/address-overrides.ts","../src/lib/fork-tokens.ts","../src/lib/addresses.ts"],"sourcesContent":["/**\n * SIM_ADDRESSES_FILE override layer (spec G1).\n *\n * Points the CLI at a vnet deployment: a chains/{chainId}.json-shaped file\n * (CAPS_SNAKE_CASE keys, written by contracts deploy scripts) is mapped onto\n * the CLI's per-registry key names and merged over the base network registry\n * at call time. Only 0x-string values are considered. Fail-closed: a set-but-\n * unreadable file throws rather than silently using mainnet addresses.\n */\nimport { readFileSync } from \"node:fs\";\nimport type { Address } from \"viem\";\n\ntype RegistryName = \"SHERWOOD\" | \"STRATEGY_TEMPLATES\" | \"ENS\" | \"UNISWAP\";\n\n// chains-json key → CLI registry key, grouped by target registry.\n// Extend when deploy scripts gain keys the CLI reads (Task 1 Step 2).\n//\n// STRATEGY_TEMPLATES note (Task 1 Step 2 finding): the deploy scripts\n// (DeployTemplates.s.sol / DeployStrategyFactory.s.sol) write chains.json\n// keys with a `_TEMPLATE` suffix (e.g. `MOONWELL_SUPPLY_TEMPLATE`), but the\n// CLI-side STRATEGY_TEMPLATES() registry (cli/src/lib/addresses.ts\n// `BASE_STRATEGY_TEMPLATES`) and its consumers (e.g.\n// cli/src/commands/strategy-template.ts `addressKey: \"MOONWELL_SUPPLY\"`) key\n// off the UNSUFFIXED name. The map below strips the suffix so overrides\n// actually reach the keys the CLI reads.\nconst CHAINS_TO_CLI: Record<RegistryName, Record<string, string>> = {\n SHERWOOD: {\n SYNDICATE_FACTORY: \"FACTORY\",\n SYNDICATE_GOVERNOR: \"GOVERNOR\",\n GUARDIAN_REGISTRY: \"GUARDIAN_REGISTRY\",\n STAKED_WOOD: \"STAKED_WOOD\",\n WOOD: \"WOOD_TOKEN\",\n WOOD_TOKEN: \"WOOD_TOKEN\",\n STRATEGY_FACTORY: \"STRATEGY_FACTORY\",\n },\n STRATEGY_TEMPLATES: {\n MOONWELL_SUPPLY_TEMPLATE: \"MOONWELL_SUPPLY\",\n AERODROME_LP_TEMPLATE: \"AERODROME_LP\",\n VENICE_INFERENCE_TEMPLATE: \"VENICE_INFERENCE\",\n WSTETH_MOONWELL_TEMPLATE: \"WSTETH_MOONWELL\",\n MAMO_YIELD_TEMPLATE: \"MAMO_YIELD\",\n PORTFOLIO_TEMPLATE: \"PORTFOLIO\",\n HYPERLIQUID_PERP_TEMPLATE: \"HYPERLIQUID_PERP\",\n HYPERLIQUID_GRID_TEMPLATE: \"HYPERLIQUID_GRID\",\n },\n ENS: {\n L2_REGISTRAR: \"L2_REGISTRAR\",\n L2_REGISTRY: \"L2_REGISTRY\",\n },\n UNISWAP: {\n UNISWAP_SWAP_ADAPTER: \"SWAP_ADAPTER\",\n },\n};\n\nlet cached: Record<string, Address> | null | undefined;\n\nfunction loadFile(): Record<string, Address> | null {\n if (cached !== undefined) return cached;\n const file = process.env.SIM_ADDRESSES_FILE;\n if (!file) {\n cached = null;\n return cached;\n }\n let raw: Record<string, unknown>;\n try {\n raw = JSON.parse(readFileSync(file, \"utf8\")) as Record<string, unknown>;\n } catch (err) {\n throw new Error(\n `SIM_ADDRESSES_FILE is set (${file}) but unreadable: ${err instanceof Error ? err.message : String(err)}`,\n );\n }\n const out: Record<string, Address> = {};\n for (const [k, v] of Object.entries(raw)) {\n if (typeof v === \"string\" && v.startsWith(\"0x\")) out[k] = v as Address;\n }\n cached = out;\n return cached;\n}\n\n/** Mapped overrides for one CLI registry; {} when SIM_ADDRESSES_FILE unset. */\nexport function overridesFor(registry: RegistryName): Record<string, Address> {\n const file = loadFile();\n if (!file) return {};\n const map = CHAINS_TO_CLI[registry];\n const out: Record<string, Address> = {};\n for (const [chainsKey, cliKey] of Object.entries(map)) {\n if (file[chainsKey]) out[cliKey] = file[chainsKey];\n }\n return out;\n}\n\nexport function __resetOverridesCacheForTests(): void {\n cached = undefined;\n}\n","/**\n * Robinhood mainnet fork (Tenderly vnet, chain 9994663) — tokenized-stock map.\n *\n * ONE table for every stock the fork address book carries\n * (sherwood-protocol/chains/9994663.json): token address, its Chainlink USD\n * push feed, and the swap route the fork's Uniswap deployment ACTUALLY quotes\n * for USDG -> stock. `addresses.ts` derives `ROBINHOOD_FORK_TOKENS` and the\n * fork's `<SYM>_USD_FEED` registry from here; the sim's basket builder\n * (`simulation/proposal-specs.ts`) reads feed + route from here.\n *\n * THE ROUTES ARE MEASURED, NOT GUESSED. Every entry below was quoted\n * read-only against the fork's V4Quoter (0x8dc178ef…) and, where v4 had no\n * pool, the v3 QuoterV2 (0x33e885ed…), at 100 USDG on 2026-09-05 (vnet block\n * 21,179,183), and cross-checked against the token's own Chainlink feed. The\n * per-entry `quotedOut` / `feedDeviationBps` fields are that measurement.\n * Tiers probed: v4 3000/60, 10000/200, 500/10, 100/1; v3 500, 3000, 10000.\n *\n * `eligible` is the sim's basket-generation gate, and it is stricter than\n * \"quotes\": PortfolioStrategy floors every buy at the ORACLE-implied amount\n * discounted by maxSlippageBps (`_buyFloor`, push-feed mode), so a pool whose\n * price sits further above the frozen feed than the sim's 5% tolerance\n * executes to a revert no matter how well it quotes. That is META today\n * (+8.3%). SLV is the other exclusion: it has NO v4 pool on any tier and only\n * quotes on v3, and this vnet's v3 position manager is known-corrupted\n * (state-injected token ids), so the v3 leg is unverified end to end. Both\n * stay in the map with their measured route so an explicit\n * `--tokens META --swap-routes v4:3000:60 --max-slippage 1000` still works;\n * they are just not handed to the sim by default.\n *\n * Re-quote before trusting any of this on a fresh fork — the vnet's pools are\n * traded by every sim run and the feeds are frozen at fork time.\n */\n\nimport type { Address } from \"viem\";\n\nexport interface ForkStock {\n /** Tokenized-stock ERC-20 on the fork (18-dec). */\n address: Address;\n /** Chainlink AggregatorV3 USD feed (8-dec) for the same stock. */\n feed: Address;\n /**\n * Swap-route spec in `--swap-routes` syntax (`v4:<fee>:<tickSpacing>` or\n * `v3:<fee>`), or null when no USDG pool quoted on any probed tier.\n */\n route: string | null;\n /** True when the only quoting pool is Uniswap v3 (no v4 pool on any tier). */\n v3Only?: boolean;\n /** Include in sim basket generation. False = keep out of default baskets. */\n eligible: boolean;\n /** Stock received for 100 USDG on the recorded route (human units). */\n quotedOut?: string;\n /** (pool-implied price / Chainlink feed − 1) in bps at the time of the quote. */\n feedDeviationBps?: number;\n /** Why a token is ineligible / unroutable, or anything the next re-quote should know. */\n note?: string;\n}\n\n/** Symbol order mirrors chains/9994663.json. */\nexport const ROBINHOOD_FORK_STOCKS = {\n AAPL: {\n address: \"0xaF3D76f1834A1d425780943C99Ea8A608f8a93f9\" as Address,\n feed: \"0x6B22A786bAa607d76728168703a39Ea9C99f2cD0\" as Address,\n route: \"v4:3000:60\",\n eligible: true,\n quotedOut: \"0.30994905\",\n feedDeviationBps: 252,\n },\n TSLA: {\n address: \"0x322F0929c4625eD5bAd873c95208D54E1c003b2d\" as Address,\n feed: \"0x4A1166a659A55625345e9515b32adECea5547C38\" as Address,\n route: \"v4:3000:60\",\n eligible: true,\n quotedOut: \"0.27501216\",\n feedDeviationBps: 265,\n },\n NVDA: {\n address: \"0xd0601CE157Db5bdC3162BbaC2a2C8aF5320D9EEC\" as Address,\n feed: \"0x379EC4f7C378F34a1B47E4F3cbeBCbAC3E8E9F15\" as Address,\n route: \"v4:3000:60\",\n eligible: true,\n quotedOut: \"0.43142676\",\n feedDeviationBps: 199,\n },\n MSFT: {\n address: \"0xe93237C50D904957Cf27E7B1133b510C669c2e74\" as Address,\n feed: \"0x45C3C877C15E6BA2EBB19eA114Ea508d14C1Af2E\" as Address,\n route: \"v4:3000:60\",\n eligible: true,\n quotedOut: \"0.19882872\",\n feedDeviationBps: -18,\n },\n AMZN: {\n address: \"0x12f190a9F9d7D37a250758b26824B97CE941bF54\" as Address,\n feed: \"0xD5a1508ceD74c084eBf3cBe853e2C968fB2a651C\" as Address,\n route: \"v4:3000:60\",\n eligible: true,\n quotedOut: \"0.37998363\",\n feedDeviationBps: 264,\n },\n META: {\n address: \"0xc0D6457C16Cc70d6790Dd43521C899C87ce02f35\" as Address,\n feed: \"0x7C38C00C30BEe9378381E7B6135d7283356D71b1\" as Address,\n route: \"v4:3000:60\",\n eligible: false,\n quotedOut: \"0.16185932\",\n feedDeviationBps: 829,\n note:\n \"Quotes, but the pool sits 8.3% above the frozen META/USD feed (v3 agrees: +8.2%), \" +\n \"past the sim's 5% buy floor and near the contract's 10% ceiling. Excluded from \" +\n \"generated baskets until the pool or feed is re-based.\",\n },\n AMD: {\n address: \"0x86923f96303D656E4aa86D9d42D1e57ad2023fdC\" as Address,\n feed: \"0x943A29E7ae51A4798823ca9eEd2ed533B2A22C72\" as Address,\n // The fee-3000 pool does NOT exist — only the 10000/200 tier quotes. This\n // is the case that makes guessing a fee tier a bug.\n route: \"v4:10000:200\",\n eligible: true,\n quotedOut: \"0.20887416\",\n feedDeviationBps: 53,\n },\n SPY: {\n address: \"0x117cc2133c37B721F49dE2A7a74833232B3B4C0C\" as Address,\n feed: \"0x319724394D3A0e3669269846abE664Cd621f9f6A\" as Address,\n route: \"v4:3000:60\",\n eligible: true,\n quotedOut: \"0.12913164\",\n feedDeviationBps: 63,\n },\n QQQ: {\n address: \"0xD5f3879160bc7c32ebb4dC785F8a4F505888de68\" as Address,\n feed: \"0x80901d846d5D7B030F26B480776EE3b29374C2ae\" as Address,\n // A 10000/200 pool also exists but quoted +48.8% vs feed (near-empty) —\n // never route QQQ through it.\n route: \"v4:3000:60\",\n eligible: true,\n quotedOut: \"0.13873445\",\n feedDeviationBps: 23,\n },\n SLV: {\n address: \"0x411eFb0E7f985935DAec3D4C3ebaEa0d0AD7D89f\" as Address,\n feed: \"0x209b73908e92Ae021826eD79609845451Ecba2ce\" as Address,\n route: \"v3:500\",\n v3Only: true,\n eligible: false,\n quotedOut: \"1.66443692\",\n feedDeviationBps: -389,\n note:\n \"No v4 USDG pool on any probed tier; only Uniswap v3 quotes (500/3000/10000 all \" +\n \"do, 500 best). This vnet's v3 position manager is corrupted, so the v3 swap leg \" +\n \"is unverified end to end — excluded from generated baskets.\",\n },\n GOOGL: {\n address: \"0x2e0847E8910a9732eB3fb1bb4b70a580ADAD4FE3\" as Address,\n feed: \"0xF6f373a037c30F0e5010d854385cA89185AE638b\" as Address,\n route: \"v4:3000:60\",\n eligible: true,\n quotedOut: \"0.29346562\",\n feedDeviationBps: 11,\n },\n} as const satisfies Record<string, ForkStock>;\n\nexport type ForkStockSymbol = keyof typeof ROBINHOOD_FORK_STOCKS;\n\nexport const ROBINHOOD_FORK_STOCK_SYMBOLS = Object.keys(ROBINHOOD_FORK_STOCKS) as ForkStockSymbol[];\n\n/** Symbols the sim may put in a generated basket (routable AND inside the slippage floor). */\nexport function forkBasketSymbols(): ForkStockSymbol[] {\n return ROBINHOOD_FORK_STOCK_SYMBOLS.filter((s) => ROBINHOOD_FORK_STOCKS[s].eligible);\n}\n\n/**\n * Feed + route for a basket token, or undefined when the symbol is unknown,\n * unroutable, or gated out of basket generation. Callers own the error text.\n */\nexport function forkBasketMeta(symbol: string): { feed: Address; route: string } | undefined {\n const entry = (ROBINHOOD_FORK_STOCKS as Record<string, ForkStock>)[symbol.toUpperCase()];\n if (!entry || !entry.eligible || !entry.route) return undefined;\n return { feed: entry.feed, route: entry.route };\n}\n\n/** `{ SYM: address }` for the token registry. */\nexport function forkStockAddresses(): Record<ForkStockSymbol, Address> {\n return Object.fromEntries(\n ROBINHOOD_FORK_STOCK_SYMBOLS.map((s) => [s, ROBINHOOD_FORK_STOCKS[s].address]),\n ) as Record<ForkStockSymbol, Address>;\n}\n\n/** `{ SYM_USD_FEED: feed }` for the Chainlink registry (push-feed auto-resolve). */\nexport function forkStockFeeds(): Record<`${ForkStockSymbol}_USD_FEED`, Address> {\n return Object.fromEntries(\n ROBINHOOD_FORK_STOCK_SYMBOLS.map((s) => [`${s}_USD_FEED`, ROBINHOOD_FORK_STOCKS[s].feed]),\n ) as Record<`${ForkStockSymbol}_USD_FEED`, Address>;\n}\n","/**\n * Contract addresses by network.\n *\n * All exports are functions — they resolve at call time based on the\n * current network set via setNetwork(). This ensures --chain works\n * even when modules are imported before the flag is parsed.\n *\n * Current deployment target: Robinhood L2 testnet (chain 46630) only. Other\n * chains may be added back later; when they are, their address blocks + registry\n * entries re-enter here alongside the robinhood-testnet ones.\n *\n * Zero addresses = protocol not deployed on that chain. Strategies that\n * need them will fail at execution time with a clear allowlist error.\n */\n\nimport type { Address, Hex } from \"viem\";\nimport { type Network, getNetwork } from \"./network.js\";\nimport { overridesFor } from \"./address-overrides.js\";\nimport { forkStockAddresses, forkStockFeeds } from \"./fork-tokens.js\";\n\nconst ZERO: Address = \"0x0000000000000000000000000000000000000000\";\nconst ZERO_BYTES32 =\n \"0x0000000000000000000000000000000000000000000000000000000000000000\" as `0x${string}`;\n\n// ── Robinhood L2 Testnet (Arbitrum Orbit, chain 46630) ──\n// Synthra DEX for swaps. Stock tokens available.\n\nconst ROBINHOOD_TESTNET_TOKENS = {\n USDC: ZERO,\n // USDG (Robinhood-chain stablecoin, 6-dec). Zero on testnet (Synthra WETH-quoted);\n // real on the mainnet fork. Keyed so `--asset USDG` resolves + decimals=6.\n USDG: ZERO,\n // WETH resolves to Synthra's WETH9 (SYNTHRA_WETH): ALL stock DEX liquidity is\n // denominated in it (e.g. the TSLA fee-3000 pool holds ~37.8 WETH here vs\n // ~0.0003 in the canonical WETH pool). It is WETH9-style (payable deposit()),\n // so --use-eth wrapping works against it. Canonical WETH kept as WETH_CANONICAL\n // so the reference isn't lost.\n WETH: \"0x33e4191705c386532ba27cBF171Db86919200B94\" as Address,\n WETH_CANONICAL: \"0x7943e237c7F95DA44E0301572D358911207852Fa\" as Address,\n cbETH: ZERO,\n wstETH: ZERO,\n cbBTC: ZERO,\n DAI: ZERO,\n AERO: ZERO,\n TSLA: \"0xC9f9c86933092BbbfFF3CCb4b105A4A94bf3Bd4E\" as Address,\n AMZN: \"0x5884aD2f920c162CFBbACc88C9C51AA75eC09E02\" as Address,\n PLTR: \"0x1FBE1a0e43594b3455993B5dE5Fd0A7A266298d0\" as Address,\n NFLX: \"0x3b8262A63d25f0477c4DDE23F83cfe22Cb768C93\" as Address,\n AMD: \"0x71178BAc73cBeb415514eB542a8995b82669778d\" as Address,\n // Stocks the mainnet fork carries and the testnet does not (lib/fork-tokens.ts).\n // Keyed here as ZERO so the token-shape type covers both chains.\n AAPL: ZERO,\n NVDA: ZERO,\n MSFT: ZERO,\n META: ZERO,\n SPY: ZERO,\n QQQ: ZERO,\n SLV: ZERO,\n GOOGL: ZERO,\n} as const;\n\nconst ROBINHOOD_TESTNET_MOONWELL = {\n COMPTROLLER: ZERO,\n mUSDC: ZERO,\n mWETH: ZERO,\n mCbETH: ZERO,\n mWstETH: ZERO,\n mCbBTC: ZERO,\n mDAI: ZERO,\n mAERO: ZERO,\n} as const;\n\n// Synthra is Uniswap-V3-compatible; the deployed UniswapSwapAdapter is backed by\n// Synthra's router + a QuoterV2 shim (SYNTHRA_QUOTER_V2_SHIM). SWAP_ROUTER /\n// QUOTER_V2 mirror the Synthra addresses so a direct v3 quote path also resolves.\nconst ROBINHOOD_TESTNET_UNISWAP = {\n SWAP_ROUTER: \"0x3Ce954107b1A675826B33bF23060Dd655e3758fE\" as Address,\n QUOTER_V2: \"0xb06788F027268a9A06c3AD41a88559530D2E54b1\" as Address,\n SWAP_ADAPTER: \"0x4fc3492117cC3bbcE0b210D22a8DC244f9d86490\" as Address,\n} as const;\n\n// ── Synthra DEX (Robinhood L2 — Uniswap V3-compatible concentrated liquidity) ──\n\nconst ROBINHOOD_TESTNET_SYNTHRA = {\n ROUTER: \"0x3Ce954107b1A675826B33bF23060Dd655e3758fE\" as Address,\n QUOTER: \"0x231606c321A99DE81e28fE48B07a93F1ba49e713\" as Address,\n FACTORY: \"0x911b4000D3422F482F4062a913885f7b035382Df\" as Address,\n} as const;\n\n// ── Chainlink AggregatorV3 push feeds ──\n//\n// Data Streams is gone at v1: PortfolioStrategy binds an AggregatorV3 proxy\n// ADDRESS per allocation and there is no verifier proxy to configure.\n\nconst ROBINHOOD_TESTNET_CHAINLINK = {\n WSTETH_ETH_FEED: ZERO,\n // Tokenized-equity push feeds exist only on the mainnet fork. Keyed as ZERO\n // so the registry shape covers both chains and the fork's `<SYM>_USD_FEED`\n // auto-resolve (template-encoder.ts) has a slot.\n ...noneOf(forkStockFeeds()),\n} as const;\n\n// ── Robinhood portfolio-basket route + feed metadata ──\n//\n// Data-driven replacement for the hand-drifting \"known stock\" Set that used to\n// live in strategy-template.ts. Every entry is a VERIFIED-liquidity default\n// swap route for a basket token. Absence from this map means \"no verified\n// default route\" — the CLI fails fast and demands an explicit --swap-routes\n// rather than falling through to a v3 auto-detect that would be dead.\n//\n// `kind: \"v4-native\"` = a Uniswap v4 mode-3 multi-hop USDG → native ETH → stock,\n// consumed by portfolio-template.ts as\n// v4PathExtraData([{currency: ETH, ...native}, {currency: <token>, ...stock}]).\nexport interface RobinhoodStockRoute {\n kind: \"v4-native\";\n nativeFee: number;\n nativeTickSpacing: number;\n stockFee: number;\n stockTickSpacing: number;\n}\n\n// No verified default stock swap routes on the Robinhood testnet — the\n// machinery is retained (see portfolio-template.ts) but the map is empty, so\n// every basket token falls to the existing fail-fast route error until a\n// verified route is added.\n// LOCKSTEP: the app's quote-probe geometry (app/src/lib/price-quote.ts\n// V4_DIRECT_TIERS + via-native path) must stay consistent with any route added\n// here, or the dashboard displays a tier the strategy won't execute.\nexport const ROBINHOOD_STOCK_ROUTES: Record<string, RobinhoodStockRoute> = {};\n\nconst ROBINHOOD_TESTNET_INFRA = {\n MULTICALL3: \"0xcA11bde05977b3631167028862bE2a173976CA11\" as Address, // Deterministic, same everywhere\n} as const;\n\n// ── ENS / Durin ──\n\nconst ROBINHOOD_TESTNET_ENS = {\n L2_REGISTRAR: ZERO,\n L2_REGISTRY: ZERO,\n} as const;\n\n// ── ERC-8004 Agent Identity ──\n//\n// Zero on purpose, not \"pending a deploy\": no ERC-8004 registry exists on the\n// testnet or on the fork, and none should. Identity is a coordination-chain\n// concern — every identity op (mint / load / find / status) runs against 4663\n// via `withNetwork(COORDINATION_NETWORK, …)`, whatever chain the fund is on.\nconst ROBINHOOD_TESTNET_AGENT_REGISTRY = {\n IDENTITY_REGISTRY: ZERO,\n REPUTATION_REGISTRY: ZERO,\n} as const;\n\n// ── Sherwood Protocol (our deployed contracts) ──\n//\n// V2 redeploy (chain 46630): fresh factory/governor/vault-impl/executor plus a\n// full guardian layer (registry + sWOOD + WOOD fixture token) and the V2\n// live-NAV surface (PriceRouter, UniswapSwapAdapter via the Synthra QuoterV2\n// shim, Portfolio template, StrategyFactory). WOOD_TOKEN here is a testnet\n// fixture, not the mainnet OFT.\n//\n// GOVERNOR is the deploy-time bootstrap governor. Governors are per-vault since\n// PR #421 — resolve one at runtime via `factory.governorOf(vault)`\n// (lib/governor.ts `getGovernorOf`), never from this table.\n// Key parity with the SDK book (sdk/src/addresses.ts SherwoodDeployment) is\n// pinned by lib/address-parity.test.ts — add new keys to BOTH books.\nconst ROBINHOOD_TESTNET_SHERWOOD = {\n FACTORY: \"0xa91AA45AFF32f52b6357044B02a16EBA775feC0b\" as Address,\n GOVERNOR: ZERO, // zeroed since the post-#421 redeploy — always factory.governorOf(vault)\n GUARDIAN_REGISTRY: \"0xA400eFcfFc820C6f812203C58ee00423AeCC0903\" as Address,\n STAKED_WOOD: \"0x21A69A6c9814c0d339C57fDdafed3B283702a739\" as Address,\n WOOD_TOKEN: \"0xCCb4fB59cf40de1E23083037ee81Da1DD747D8d7\" as Address,\n STRATEGY_FACTORY: \"0xb683Bb8EEcBc2419BC3801df6FeA88f96657e670\" as Address,\n MERKL_DISTRIBUTOR: ZERO,\n // Guardian-era contracts from contracts/chains/46630.json (SHE-93).\n VAULT_IMPL: \"0xC57e12d6e2d8Ed49316F0b69c51893CcA44151F7\" as Address,\n BATCH_EXECUTOR_LIB: \"0xF3b8db5aa41c7Ce92478A0Fa9C55a6460533eb86\" as Address,\n GOVERNOR_BEACON: \"0x3D46Ec018cd5893b685b4dfdc3921A4Eb64E11d1\" as Address,\n PROTOCOL_CONFIG: \"0xC104Eb6a522d6718cA28F344B2373B29d57FF2E0\" as Address,\n PRICE_ROUTER: \"0xDd302ffcfA08071780eC1A2f12BccFB9ba6b6731\" as Address,\n TIER_REGISTRY: \"0x99b8068Dc0F6093466964D581f72d947e3e380DB\" as Address,\n // Not in chains/46630.json (econ-security stack not deployed there yet).\n EXPOSURE_LEDGER: ZERO,\n PROPOSER_BOND_ESCROW: ZERO,\n CHALLENGE_GAME: ZERO,\n TOKEN_COURT: ZERO,\n} as const;\n\n// ── Venice (VVV governance + sVVV staking + DIEM compute) ──\n\nconst ROBINHOOD_TESTNET_VENICE = {\n VVV: ZERO,\n STAKING: ZERO,\n DIEM: ZERO,\n} as const;\n\n// ── Aerodrome (Base ve(3,3) DEX) ──\n\nconst ROBINHOOD_TESTNET_AERODROME = {\n ROUTER: ZERO,\n FACTORY: ZERO,\n} as const;\n\n// ── Strategy Templates (ERC-1167 clonable singletons) ──\n// Populated after running script/DeployTemplates.s.sol\n\nconst ROBINHOOD_TESTNET_STRATEGY_TEMPLATES = {\n MOONWELL_SUPPLY: ZERO as Address,\n AERODROME_LP: ZERO as Address,\n VENICE_INFERENCE: ZERO as Address,\n WSTETH_MOONWELL: ZERO as Address,\n MAMO_YIELD: ZERO as Address,\n HYPERLIQUID_PERP: ZERO as Address,\n HYPERLIQUID_GRID: ZERO as Address,\n // V2 redeploy PORTFOLIO_TEMPLATE (chain 46630).\n PORTFOLIO: \"0x67420Cc504d70a42Adfd8867d878afe0978C7d10\" as Address,\n // v1 templates — deployed on the fork only so far (no 46630 equivalent).\n MORPHO_SUPPLY: ZERO as Address,\n CONCENTRATED_LIQUIDITY: ZERO as Address,\n} as const;\n\n// ── EAS (Ethereum Attestation Service) ──\n\nconst ROBINHOOD_TESTNET_EAS = {\n EAS: ZERO,\n SCHEMA_REGISTRY: ZERO,\n} as const;\n\n// EAS on Robinhood Chain mainnet (4663). Deployed by Sherwood — EAS is not a\n// predeploy on an Arbitrum Orbit chain. sherwoodagent/sherwood-protocol#278.\nconst ROBINHOOD_MAINNET_EAS = {\n EAS: \"0x7d70441Bb10AcE5d9771dc0b6205D89ddf63205B\" as Address,\n SCHEMA_REGISTRY: \"0xdd7521Ba10773e556Defa6D6c133cB2F663b5c26\" as Address,\n} as const;\n\n/**\n * Schema UIDs are chain-INDEPENDENT: uid = keccak256(schema, resolver,\n * revocable) carries no chainId. With resolver = address(0) these are the same\n * UIDs already registered on Base, and re-registering the same definitions on\n * any chain reproduces them. Verified against Base's live SchemaRegistry.\n */\nconst SHERWOOD_EAS_SCHEMAS = {\n SYNDICATE_JOIN_REQUEST: \"0x1e7ce17b16233977ba913b156033e98f52029f4bee273a4abefe6c15ce11d5ef\" as Hex,\n AGENT_APPROVED: \"0x1013f7b38f433b2a93fc5ac162482813081c64edd67cea9b5a90698531ddb607\" as Hex,\n X402_RESEARCH: \"0x86c67f0a59acb3093ecbeb6c4d1d4352e4a48143672e92ef9dd2fdfc8a9ca708\" as Hex,\n VENICE_PROVISION: \"0x76d4d6baa72307826cd2fd4ce069bb42ee54cdda6ed6ab208c8d233c893fb7f1\" as Hex,\n VENICE_INFERENCE: \"0xf9b4e530f3016c19439b67372a1c213c9339857627fb817032614b97433a2a14\" as Hex,\n TRADE_EXECUTED: \"0x06bb488363a468f7f857ddc8cfffe918d048b8746a0d59eca9cd7f58dbdb4af6\" as Hex,\n} as const;\n\n/**\n * Every non-EAS address book, for the coordination chain. Sherwood core is not\n * deployed on 4663, so these are all zero BY CONSTRUCTION rather than by\n * omission — mapping them to the testnet book would silently hand out 46630\n * addresses during the brief `withNetwork` window an EAS write opens.\n */\nfunction noneOf<T extends Record<string, unknown>>(shape: T): T {\n return Object.fromEntries(Object.keys(shape).map((k) => [k, ZERO])) as T;\n}\n\n// ── EAS Schema UIDs (populated after running scripts/register-eas-schemas.ts) ──\n\nconst ROBINHOOD_TESTNET_EAS_SCHEMAS = {\n SYNDICATE_JOIN_REQUEST: ZERO_BYTES32,\n AGENT_APPROVED: ZERO_BYTES32,\n X402_RESEARCH: ZERO_BYTES32,\n VENICE_PROVISION: ZERO_BYTES32,\n VENICE_INFERENCE: ZERO_BYTES32,\n TRADE_EXECUTED: ZERO_BYTES32,\n} as const;\n\n// ── Robinhood Chain mainnet fork (Tenderly vnet, chain 9994663) ──\n//\n// Fork of Robinhood *mainnet*: USDG stablecoin (6-dec), official Uniswap v3+v4,\n// Chainlink PUSH feeds. Core addresses\n// come from sherwood-protocol/chains/9994663.json (fresh deploy). All 11\n// tokenized stocks + their feeds come from lib/fork-tokens.ts (one table, with\n// the measured swap route per token); the feeds are keyed here as\n// `<SYM>_USD_FEED` so a symbol basket auto-resolves its push feed on the fork.\n// Swap routes still need an explicit --swap-routes (ROBINHOOD_STOCK_ROUTES is\n// a different shape and lockstepped with the app's quote probe).\n\nconst ROBINHOOD_FORK_TOKENS: typeof ROBINHOOD_TESTNET_TOKENS = {\n USDC: ZERO,\n USDG: \"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168\" as Address,\n WETH: \"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73\" as Address,\n WETH_CANONICAL: \"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73\" as Address,\n cbETH: ZERO,\n wstETH: ZERO,\n cbBTC: ZERO,\n DAI: ZERO,\n AERO: ZERO,\n PLTR: ZERO,\n NFLX: ZERO,\n ...forkStockAddresses(),\n};\n\nconst ROBINHOOD_FORK_UNISWAP: typeof ROBINHOOD_TESTNET_UNISWAP = {\n SWAP_ROUTER: \"0xcaf681a66d020601342297493863e78c959e5cb2\" as Address,\n QUOTER_V2: \"0x33e885ed0ec9bf04ecfb19341582aadcb4c8a9e7\" as Address,\n SWAP_ADAPTER: \"0x54E6A7af53143556973493fDeC9d7837A77c67eF\" as Address,\n};\n\n// `<SYM>_USD_FEED` for all 11 stocks so `strategy propose portfolio --tokens\n// AAPL,…` resolves feeds without --feeds (template-encoder.ts auto-resolve).\nconst ROBINHOOD_FORK_CHAINLINK: typeof ROBINHOOD_TESTNET_CHAINLINK = {\n WSTETH_ETH_FEED: ZERO,\n ...forkStockFeeds(),\n};\n\nconst ROBINHOOD_FORK_SHERWOOD: typeof ROBINHOOD_TESTNET_SHERWOOD = {\n FACTORY: \"0x619af1488F32B4797f6faDa3C3a8De72a5B693E0\" as Address,\n GOVERNOR: ZERO, // per-vault — always factory.governorOf(vault)\n GUARDIAN_REGISTRY: \"0xD8F9E7446E6d6c02198AAaF674A0C5e3d5D1BF72\" as Address,\n STAKED_WOOD: \"0xdDf2B4C52B9575e0e6D03a3A57D75D06a4a9e203\" as Address,\n WOOD_TOKEN: \"0xF8BC08092C06dB6148114DCf82AF881F1085f92b\" as Address,\n STRATEGY_FACTORY: \"0xb06788F027268a9A06c3AD41a88559530D2E54b1\" as Address,\n MERKL_DISTRIBUTOR: ZERO,\n // Guardian-era contracts from sherwood-protocol/chains/9994663.json (SHE-93).\n VAULT_IMPL: \"0xdaB4707c9997a84e931FE98F4688adaFc70b6B95\" as Address,\n BATCH_EXECUTOR_LIB: \"0x899FC2Cac572F64A233344115b488E71E0044f34\" as Address,\n GOVERNOR_BEACON: \"0x3CF45eFE9fBDdd6cB749384Bf5c1bA5Ec96af05d\" as Address,\n PROTOCOL_CONFIG: \"0x8aDb5810B5bF8B9149BE3Ca45Cb441818a9679bB\" as Address,\n // Not in chains/9994663.json (no PriceRouter on the fork).\n PRICE_ROUTER: ZERO,\n TIER_REGISTRY: \"0x4614f058920941A0a9a852e62485fbDE692D75E1\" as Address,\n EXPOSURE_LEDGER: \"0x99D789E7C8E65dB5597dCa692F082B47BE30AB33\" as Address,\n PROPOSER_BOND_ESCROW: \"0x7d25058c891d3AC5C8bc8Da6aA937DFeE648B5cF\" as Address,\n CHALLENGE_GAME: \"0x7046FececcA6c0f5E66Cc998099593ae71A1bbee\" as Address,\n TOKEN_COURT: \"0xC30bA62727be65fd867385Ce27Ff7C78bd66A897\" as Address,\n};\n\nconst ROBINHOOD_FORK_STRATEGY_TEMPLATES: typeof ROBINHOOD_TESTNET_STRATEGY_TEMPLATES = {\n MOONWELL_SUPPLY: ZERO,\n AERODROME_LP: ZERO,\n VENICE_INFERENCE: ZERO,\n WSTETH_MOONWELL: ZERO,\n MAMO_YIELD: ZERO,\n HYPERLIQUID_PERP: ZERO,\n HYPERLIQUID_GRID: ZERO,\n PORTFOLIO: \"0xAA5872009c527cCb80343E41C52840CEdb095eb0\" as Address,\n // MORPHO_SUPPLY_TEMPLATE / CONCENTRATED_LIQUIDITY_TEMPLATE from\n // sherwood-protocol/chains/9994663.json. Both are live and on the\n // StrategyFactory allowlist; the CLI has no init encoder for their init\n // tuples yet, so `strategy list` shows them and `clone`/`propose` say so\n // explicitly instead of the address book pretending they don't exist.\n MORPHO_SUPPLY: \"0x5B55E1Da361573CB0788e750038567D2569BE41d\" as Address,\n CONCENTRATED_LIQUIDITY: \"0xcba9C84F2d382729D1519c5F7f4a9AAaC075f8B5\" as Address,\n};\n\n// ── Registries (map-based lookup) ──\n\nconst TOKEN_REGISTRY: Record<Network, typeof ROBINHOOD_TESTNET_TOKENS> = {\n \"robinhood-testnet\": ROBINHOOD_TESTNET_TOKENS,\n \"robinhood-fork\": ROBINHOOD_FORK_TOKENS,\n \"robinhood-mainnet\": noneOf(ROBINHOOD_TESTNET_TOKENS), // coordination chain — no Sherwood contracts\n};\n\nconst MOONWELL_REGISTRY: Record<Network, typeof ROBINHOOD_TESTNET_MOONWELL> = {\n \"robinhood-testnet\": ROBINHOOD_TESTNET_MOONWELL,\n \"robinhood-fork\": ROBINHOOD_TESTNET_MOONWELL,\n \"robinhood-mainnet\": noneOf(ROBINHOOD_TESTNET_MOONWELL), // coordination chain — no Sherwood contracts\n};\n\nconst UNISWAP_REGISTRY: Record<Network, typeof ROBINHOOD_TESTNET_UNISWAP> = {\n \"robinhood-testnet\": ROBINHOOD_TESTNET_UNISWAP,\n \"robinhood-fork\": ROBINHOOD_FORK_UNISWAP,\n \"robinhood-mainnet\": noneOf(ROBINHOOD_TESTNET_UNISWAP), // coordination chain — no Sherwood contracts\n};\n\nconst INFRA_REGISTRY: Record<Network, typeof ROBINHOOD_TESTNET_INFRA> = {\n \"robinhood-testnet\": ROBINHOOD_TESTNET_INFRA,\n \"robinhood-fork\": ROBINHOOD_TESTNET_INFRA,\n \"robinhood-mainnet\": noneOf(ROBINHOOD_TESTNET_INFRA), // coordination chain — no Sherwood contracts\n};\n\nconst ENS_REGISTRY: Record<Network, typeof ROBINHOOD_TESTNET_ENS> = {\n \"robinhood-testnet\": ROBINHOOD_TESTNET_ENS,\n \"robinhood-fork\": ROBINHOOD_TESTNET_ENS,\n \"robinhood-mainnet\": noneOf(ROBINHOOD_TESTNET_ENS), // coordination chain — no Sherwood contracts\n};\n\n// Canonical ERC-8004 registries ARE live on 4663 (verified on-chain) — the\n// same 0x8004… addresses as Base. Like EAS, identity coordinates there:\n// mint/load/find/status all run against the coordination chain regardless of\n// the fund chain, which is why the testnet/fork entries above stay zero.\nconst ROBINHOOD_MAINNET_AGENT_REGISTRY = {\n IDENTITY_REGISTRY: \"0x8004A169FB4a3325136EB29fA0ceB6D2e539a432\" as Address,\n REPUTATION_REGISTRY: \"0x8004BAa17C55a88189AE136b182e5fdA19dE9b63\" as Address,\n} as const;\n\nconst AGENT_REGISTRY_MAP: Record<Network, typeof ROBINHOOD_TESTNET_AGENT_REGISTRY> = {\n \"robinhood-testnet\": ROBINHOOD_TESTNET_AGENT_REGISTRY,\n \"robinhood-fork\": ROBINHOOD_TESTNET_AGENT_REGISTRY,\n \"robinhood-mainnet\": ROBINHOOD_MAINNET_AGENT_REGISTRY,\n};\n\nconst SHERWOOD_REGISTRY: Record<Network, typeof ROBINHOOD_TESTNET_SHERWOOD> = {\n \"robinhood-testnet\": ROBINHOOD_TESTNET_SHERWOOD,\n \"robinhood-fork\": ROBINHOOD_FORK_SHERWOOD,\n \"robinhood-mainnet\": noneOf(ROBINHOOD_TESTNET_SHERWOOD), // coordination chain — no Sherwood contracts\n};\n\nconst VENICE_REGISTRY: Record<Network, typeof ROBINHOOD_TESTNET_VENICE> = {\n \"robinhood-testnet\": ROBINHOOD_TESTNET_VENICE,\n \"robinhood-fork\": ROBINHOOD_TESTNET_VENICE,\n \"robinhood-mainnet\": noneOf(ROBINHOOD_TESTNET_VENICE), // coordination chain — no Sherwood contracts\n};\n\nconst AERODROME_REGISTRY: Record<Network, typeof ROBINHOOD_TESTNET_AERODROME> = {\n \"robinhood-testnet\": ROBINHOOD_TESTNET_AERODROME,\n \"robinhood-fork\": ROBINHOOD_TESTNET_AERODROME,\n \"robinhood-mainnet\": noneOf(ROBINHOOD_TESTNET_AERODROME), // coordination chain — no Sherwood contracts\n};\n\nconst STRATEGY_TEMPLATE_REGISTRY: Record<Network, typeof ROBINHOOD_TESTNET_STRATEGY_TEMPLATES> = {\n \"robinhood-testnet\": ROBINHOOD_TESTNET_STRATEGY_TEMPLATES,\n \"robinhood-fork\": ROBINHOOD_FORK_STRATEGY_TEMPLATES,\n \"robinhood-mainnet\": noneOf(ROBINHOOD_TESTNET_STRATEGY_TEMPLATES), // coordination chain — no Sherwood contracts\n};\n\nconst SYNTHRA_REGISTRY: Record<Network, typeof ROBINHOOD_TESTNET_SYNTHRA> = {\n \"robinhood-testnet\": ROBINHOOD_TESTNET_SYNTHRA,\n \"robinhood-fork\": ROBINHOOD_TESTNET_SYNTHRA, // unused on the fork (Uniswap, not Synthra)\n \"robinhood-mainnet\": noneOf(ROBINHOOD_TESTNET_SYNTHRA), // coordination chain — no Sherwood contracts\n};\n\nconst CHAINLINK_REGISTRY: Record<Network, typeof ROBINHOOD_TESTNET_CHAINLINK> = {\n \"robinhood-testnet\": ROBINHOOD_TESTNET_CHAINLINK,\n \"robinhood-fork\": ROBINHOOD_FORK_CHAINLINK,\n \"robinhood-mainnet\": noneOf(ROBINHOOD_TESTNET_CHAINLINK), // coordination chain — no Sherwood contracts\n};\n\n// Attestations live on chain 4663 no matter which chain the fund is on,\n// so every network resolves to the same book (spec §5.1).\nconst EAS_CONTRACT_REGISTRY: Record<Network, typeof ROBINHOOD_MAINNET_EAS> = {\n \"robinhood-testnet\": ROBINHOOD_MAINNET_EAS,\n \"robinhood-fork\": ROBINHOOD_MAINNET_EAS,\n \"robinhood-mainnet\": ROBINHOOD_MAINNET_EAS,\n};\n\n// Attestations live on chain 4663 no matter which chain the fund is on,\n// so every network resolves to the same book (spec §5.1).\nconst EAS_SCHEMA_REGISTRY: Record<Network, typeof SHERWOOD_EAS_SCHEMAS> = {\n \"robinhood-testnet\": SHERWOOD_EAS_SCHEMAS,\n \"robinhood-fork\": SHERWOOD_EAS_SCHEMAS,\n \"robinhood-mainnet\": SHERWOOD_EAS_SCHEMAS,\n};\n\n// ── Exports (functions, resolved at call time) ──\n\nexport function TOKENS() {\n return TOKEN_REGISTRY[getNetwork()];\n}\n\nexport function MOONWELL() {\n return MOONWELL_REGISTRY[getNetwork()];\n}\n\nexport function UNISWAP() {\n return { ...UNISWAP_REGISTRY[getNetwork()], ...overridesFor(\"UNISWAP\") };\n}\n\nexport function INFRA() {\n return INFRA_REGISTRY[getNetwork()];\n}\n\nexport function ENS() {\n return { ...ENS_REGISTRY[getNetwork()], ...overridesFor(\"ENS\") };\n}\n\nexport function AGENT_REGISTRY() {\n return AGENT_REGISTRY_MAP[getNetwork()];\n}\n\nexport function VENICE() {\n return VENICE_REGISTRY[getNetwork()];\n}\n\nexport function SHERWOOD() {\n return { ...SHERWOOD_REGISTRY[getNetwork()], ...overridesFor(\"SHERWOOD\") };\n}\n\nexport function AERODROME() {\n return AERODROME_REGISTRY[getNetwork()];\n}\n\nexport function STRATEGY_TEMPLATES() {\n return {\n ...STRATEGY_TEMPLATE_REGISTRY[getNetwork()],\n ...overridesFor(\"STRATEGY_TEMPLATES\"),\n };\n}\n\nexport function EAS_CONTRACTS() {\n return EAS_CONTRACT_REGISTRY[getNetwork()];\n}\n\nexport function EAS_SCHEMAS() {\n return EAS_SCHEMA_REGISTRY[getNetwork()];\n}\n\nexport function SYNTHRA() {\n return SYNTHRA_REGISTRY[getNetwork()];\n}\n\nexport function CHAINLINK() {\n return CHAINLINK_REGISTRY[getNetwork()];\n}\n"],"mappings":";;;;;AASA,SAAS,oBAAoB;AAgB7B,IAAM,gBAA8D;AAAA,EAClE,UAAU;AAAA,IACR,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,mBAAmB;AAAA,IACnB,aAAa;AAAA,IACb,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,kBAAkB;AAAA,EACpB;AAAA,EACA,oBAAoB;AAAA,IAClB,0BAA0B;AAAA,IAC1B,uBAAuB;AAAA,IACvB,2BAA2B;AAAA,IAC3B,0BAA0B;AAAA,IAC1B,qBAAqB;AAAA,IACrB,oBAAoB;AAAA,IACpB,2BAA2B;AAAA,IAC3B,2BAA2B;AAAA,EAC7B;AAAA,EACA,KAAK;AAAA,IACH,cAAc;AAAA,IACd,aAAa;AAAA,EACf;AAAA,EACA,SAAS;AAAA,IACP,sBAAsB;AAAA,EACxB;AACF;AAEA,IAAI;AAEJ,SAAS,WAA2C;AAClD,MAAI,WAAW,OAAW,QAAO;AACjC,QAAM,OAAO,QAAQ,IAAI;AACzB,MAAI,CAAC,MAAM;AACT,aAAS;AACT,WAAO;AAAA,EACT;AACA,MAAI;AACJ,MAAI;AACF,UAAM,KAAK,MAAM,aAAa,MAAM,MAAM,CAAC;AAAA,EAC7C,SAAS,KAAK;AACZ,UAAM,IAAI;AAAA,MACR,8BAA8B,IAAI,qBAAqB,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC;AAAA,IACzG;AAAA,EACF;AACA,QAAM,MAA+B,CAAC;AACtC,aAAW,CAAC,GAAG,CAA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AAE;AACjE;AAEO,SAAS,iBAAiB;AAC/B,SAAO,mBAAmB,WAAW,CAAC;AACxC;AAEO,SAAS,SAAS;AACvB,SAAO,gBAAgB,WAAW,CAAC;AACrC;AAEO,SAAS,WAAW;AACzB,SAAO,EAAE,GAAG,kBAAkB,WAAW,CAAC,GAAG,GAAG,aAAa,UAAU,EAAE;AAC3E;AAEO,SAAS,YAAY;AAC1B,SAAO,mBAAmB,WAAW,CAAC;AACxC;AAEO,SAAS,qBAAqB;AACnC,SAAO;AAAA,IACL,GAAG,2BAA2B,WAAW,CAAC;AAAA,IAC1C,GAAG,aAAa,oBAAoB;AAAA,EACtC;AACF;AAEO,SAAS,gBAAgB;AAC9B,SAAO,sBAAsB,WAAW,CAAC;AAC3C;AAEO,SAAS,cAAc;AAC5B,SAAO,oBAAoB,WAAW,CAAC;AACzC;AAEO,SAAS,UAAU;AACxB,SAAO,iBAAiB,WAAW,CAAC;AACtC;AAEO,SAAS,YAAY;AAC1B,SAAO,mBAAmB,WAAW,CAAC;AACxC;","names":[]}
@@ -19,7 +19,7 @@ var robinhoodTestnet = defineChain({
19
19
  },
20
20
  testnet: true
21
21
  });
22
- var ROBINHOOD_FORK_PUBLIC_RPC = "https://virtual.robinhood-chain.eu.rpc.tenderly.co/moonwell/wormhole-bridge/231af1";
22
+ var ROBINHOOD_FORK_PUBLIC_RPC = "https://virtual.robinhood-chain.eu.rpc.tenderly.co/moonwell/wormhole-bridge/f509bc-4fdefe";
23
23
  var ROBINHOOD_FORK_EXPLORER = "https://dashboard.tenderly.co/explorer/vnet/6ad5961e-fbca-452f-939f-ca9a8c020933";
24
24
  var robinhoodFork = defineChain({
25
25
  id: 9994663,
@@ -186,4 +186,4 @@ export {
186
186
  getExplorerUrl,
187
187
  isTestnet
188
188
  };
189
- //# sourceMappingURL=chunk-PVTZMRC6.js.map
189
+ //# sourceMappingURL=chunk-G3FUEM5N.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/network.ts"],"sourcesContent":["/**\n * Network state singleton.\n *\n * Called once at CLI startup via the --chain flag's preAction hook.\n * Every other module reads from here — never hardcodes a chain.\n *\n * Deployment targets: the Robinhood Chain mainnet fork (chain 9994663) — the\n * DEFAULT, and what the product ships against (app.sherwood.sh and the docs\n * both point there) — plus the Robinhood L2 testnet (chain 46630), still\n * reachable via `--chain robinhood-testnet`. Sherwood launches on Robinhood\n * first; other chains may be added back later, at which point they re-enter\n * the Network union + CHAIN_REGISTRY below.\n */\n\nimport { type Chain, defineChain, parseEther } from \"viem\";\nimport { getConfigRpcUrl } from \"./config.js\";\n\n// ── Robinhood L2 Testnet (Arbitrum Orbit, chain ID 46630) ──\n\nexport const robinhoodTestnet = defineChain({\n id: 46630,\n name: \"Robinhood Chain Testnet\",\n nativeCurrency: { name: \"Ethereum\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: { http: [\"https://rpc.testnet.chain.robinhood.com\"] },\n },\n blockExplorers: {\n default: {\n name: \"Blockscout\",\n url: \"https://explorer.testnet.chain.robinhood.com\",\n },\n },\n testnet: true,\n});\n\n// ── Robinhood Chain mainnet fork (Tenderly Virtual TestNet, chain ID 9994663) ──\n//\n// A fork of Robinhood Chain *mainnet* (USDG stablecoin, official Uniswap v3+v4,\n// Chainlink push feeds, tokenized-stock liquidity). Used for mainnet-faithful\n// e2e + guardian-network simulations. Ephemeral: Tenderly vnets expire — the RPC\n// is overridable via ROBINHOOD_FORK_RPC_URL when a new vnet is minted.\n\n/**\n * The PUBLIC RPC endpoint of the vnet carrying the v1 redeploy — safe to\n * bundle and to hand to users: it serves reads and accepts broadcast txs, but\n * exposes no state-cheat surface.\n *\n * Admin/cheat calls (`tenderly_setBalance`, `tenderly_setStorageAt`,\n * `evm_increaseTime`, …) need that vnet's *admin* RPC, which is private —\n * pull it from the Tenderly dashboard and pass it via ROBINHOOD_FORK_RPC_URL.\n *\n * Several vnets have answered to chain id 9994663 over time and the retired\n * ones return `not_found` rather than an RPC error, which reads as a network\n * hiccup. The address book is the tell: this endpoint is the one the\n * SyndicateFactory in chains/9994663.json (0x619af148…, deployed at block\n * 67,079,667) actually has code at.\n */\nconst ROBINHOOD_FORK_PUBLIC_RPC =\n \"https://virtual.robinhood-chain.eu.rpc.tenderly.co/moonwell/wormhole-bridge/f509bc-4fdefe\";\n\n/**\n * Tenderly scopes a vnet explorer under its vnet id — the bare\n * `dashboard.tenderly.co` host resolves to the user's own dashboard, not to\n * this fork's blocks, so tx/address links must carry the full prefix.\n */\nconst ROBINHOOD_FORK_EXPLORER =\n \"https://dashboard.tenderly.co/explorer/vnet/6ad5961e-fbca-452f-939f-ca9a8c020933\";\n\nexport const robinhoodFork = defineChain({\n id: 9994663,\n name: \"Robinhood Chain (fork)\",\n nativeCurrency: { name: \"Ethereum\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [ROBINHOOD_FORK_PUBLIC_RPC],\n },\n },\n blockExplorers: {\n default: {\n name: \"Tenderly\",\n url: ROBINHOOD_FORK_EXPLORER,\n },\n },\n testnet: true,\n});\n\n// ── Types ──\n\nexport type Network = \"robinhood-testnet\" | \"robinhood-fork\" | \"robinhood-mainnet\";\n\nexport interface ChainConfig {\n chain: Chain;\n /**\n * Ordered list of public RPC URLs tried in sequence when no user RPC is set.\n * First entry is the primary; the rest are fallbacks used transparently via\n * viem's `fallback` transport on rate-limit / network errors.\n */\n rpcFallbacks: string[];\n /** Legacy env var for backwards compat (optional per chain) */\n rpcEnvVar?: string;\n explorerHost: string;\n /**\n * Full URL prefix for explorer links, when the explorer is not rooted at\n * `https://${explorerHost}` — a Tenderly vnet scopes its blocks under\n * `/explorer/vnet/<id>`. Defaults to `https://${explorerHost}`.\n */\n explorerBaseUrl?: string;\n /** EAS GraphQL endpoint — null if EAS is not available on this chain */\n easGraphqlUrl: string | null;\n /** EAS scan host — null if unavailable */\n easScanHost: string | null;\n xmtpEnv: \"production\" | \"dev\";\n isTestnet: boolean;\n /**\n * ETH held back for gas in the native-ETH-wrap deposit path — the floor and\n * fallback for the live per-tx cushion estimate (`estimateGasCushion` in\n * client.ts), NOT a fixed requirement. High-fee chains (Base) want a\n * Base-scale reserve; near-zero-fee chains (Robinhood testnet, ~14-wei base\n * fee) want a tiny one so a valid deposit isn't rejected client-side. Unset →\n * `DEFAULT_MIN_GAS_RESERVE`.\n */\n minGasReserve?: bigint;\n}\n\n/**\n * Base-scale default reserve, used when a chain omits `minGasReserve`. Matches\n * the old hardcoded 0.0005-ETH cushion so higher-fee chains keep prior behavior.\n */\nexport const DEFAULT_MIN_GAS_RESERVE = parseEther(\"0.0005\");\n\n/**\n * Robinhood Chain mainnet (4663) — the EAS **coordination chain**.\n *\n * Sherwood core is NOT deployed here. This entry exists so attestations have a\n * single permanent home regardless of which chain a fund lives on, and it is\n * deliberately excluded from VALID_NETWORKS so it can never be picked as one.\n *\n * See docs/superpowers/specs/2026-08-26-eas-robinhood-mainnet-design.md §5.1.\n */\nexport const robinhoodMainnet = defineChain({\n id: 4663,\n name: \"Robinhood Chain\",\n nativeCurrency: {name: \"Ethereum\", symbol: \"ETH\", decimals: 18},\n rpcUrls: {default: {http: [\"https://rpc.mainnet.chain.robinhood.com\"]}},\n blockExplorers: {\n default: {name: \"Blockscout\", url: \"https://robinhoodchain.blockscout.com\"},\n },\n});\n\n// ── Chain Registry ──\n\nexport const CHAIN_REGISTRY: Record<Network, ChainConfig> = {\n \"robinhood-testnet\": {\n chain: robinhoodTestnet,\n rpcFallbacks: [\"https://rpc.testnet.chain.robinhood.com\"],\n rpcEnvVar: \"ROBINHOOD_TESTNET_RPC_URL\",\n explorerHost: \"explorer.testnet.chain.robinhood.com\",\n easGraphqlUrl: null,\n easScanHost: null,\n xmtpEnv: \"production\",\n isTestnet: true,\n // ~14-wei base fee: a full wrap+approve+deposit sequence costs a few\n // million wei (~1e-11 ETH). 0.00002 ETH is a generous floor that still\n // leaves a 0.00058-ETH wallet room to wrap 0.0005 and deposit.\n minGasReserve: parseEther(\"0.00002\"),\n },\n \"robinhood-fork\": {\n chain: robinhoodFork,\n rpcFallbacks: [ROBINHOOD_FORK_PUBLIC_RPC],\n rpcEnvVar: \"ROBINHOOD_FORK_RPC_URL\",\n explorerHost: \"dashboard.tenderly.co\",\n explorerBaseUrl: ROBINHOOD_FORK_EXPLORER,\n easGraphqlUrl: null,\n easScanHost: null,\n xmtpEnv: \"production\",\n isTestnet: true,\n // Robinhood-mainnet-fork gas (~0.17 gwei) is higher than testnet's ~14 wei —\n // keep a modest reserve so the ETH-wrap deposit path isn't rejected.\n minGasReserve: parseEther(\"0.0005\"),\n },\n \"robinhood-mainnet\": {\n chain: robinhoodMainnet,\n // Public endpoint kept only as a last-resort fallback: it sits behind\n // Cloudflare and challenges non-browser clients under load, and Robinhood's\n // own docs call it unsuitable for production. ROBINHOOD_RPC_URL (Alchemy)\n // is what actually gets used.\n rpcFallbacks: [\"https://rpc.mainnet.chain.robinhood.com\"],\n rpcEnvVar: \"ROBINHOOD_RPC_URL\",\n explorerHost: \"robinhoodchain.blockscout.com\",\n // Self-hosted EAS indexer — easscan does not index 4663. Serves GraphQL at\n // the root, so no /graphql suffix.\n easGraphqlUrl: \"https://sherwood-indexer-production.up.railway.app\",\n // No easscan-equivalent UI for this chain yet; attestation permalinks are\n // pending the app's own /attestation route (spec §10.2).\n easScanHost: null,\n xmtpEnv: \"production\",\n isTestnet: false,\n },\n};\n\n/**\n * Networks a user may select with `--chain`.\n *\n * NOT simply the CHAIN_REGISTRY keys: `robinhood-mainnet` is a coordination\n * chain for attestations only (no Sherwood contracts deployed there), so\n * selecting it as a fund's home chain would resolve every address to zero.\n */\nexport const COORDINATION_ONLY_NETWORKS: readonly Network[] = [\"robinhood-mainnet\"];\n\nexport const VALID_NETWORKS = (Object.keys(CHAIN_REGISTRY) as Network[]).filter(\n (n) => !COORDINATION_ONLY_NETWORKS.includes(n),\n);\n\n/**\n * The network a bare CLI invocation (no `--chain`) targets.\n *\n * The fork is where the product actually lives: app.sherwood.sh defaults to\n * chain 9994663, the docs banner declares it, and the redeployed 46630 factory\n * holds zero syndicates — so a default of `robinhood-testnet` landed a fresh\n * agent on an empty chain. `--chain robinhood-testnet` still selects 46630.\n *\n * 46630 was NOT redeployed for v1: it still runs the pre-v1 contracts, so\n * this CLI's ABIs do not match what is deployed there. Selecting it is a\n * broken path until that chain is redeployed off `v1-deploy`.\n */\nexport const DEFAULT_NETWORK: Network = \"robinhood-fork\";\n\n// ── Singleton state ──\n\nlet _network: Network = DEFAULT_NETWORK;\n\nexport function setNetwork(n: Network) {\n const config = CHAIN_REGISTRY[n];\n if (!config) {\n throw new Error(\n `Unknown network: ${n}. Valid: ${VALID_NETWORKS.join(\", \")}`,\n );\n }\n _network = n;\n}\n\nexport function getNetwork(): Network {\n return _network;\n}\n\n/**\n * Run `fn` with the network singleton temporarily switched to `network`,\n * restoring the previous network in `finally`.\n *\n * The viem clients (`getPublicClient`, `getWalletClient`) auto-invalidate on\n * chain change, so callers get fresh per-chain RPC + chain context inside the\n * block. Used for cross-chain fund resolution.\n */\nexport async function withNetwork<T>(\n network: Network,\n fn: () => Promise<T>,\n): Promise<T> {\n const previous = _network;\n _network = network;\n try {\n return await fn();\n } finally {\n _network = previous;\n }\n}\n\nexport function getChainConfig(): ChainConfig {\n return CHAIN_REGISTRY[_network];\n}\n\n/**\n * Per-chain ETH gas reserve floor/fallback for the ETH-wrap deposit path.\n * Falls back to the Base-scale default when the active chain doesn't set one.\n */\nexport function getMinGasReserve(): bigint {\n return CHAIN_REGISTRY[_network].minGasReserve ?? DEFAULT_MIN_GAS_RESERVE;\n}\n\n/**\n * Dev/CI-only chain-id override (`SIM_CHAIN_ID`) for custom-chainId vnet forks.\n * viem asserts the node's chainId matches the chain definition on every write,\n * so signing for such a fork requires the id to be swapped at the source.\n *\n * Interlock: honored ONLY while `SIM_ADDRESSES_FILE` is also set (the vnet\n * e2e harness's address override). A bare SIM_CHAIN_ID does nothing, so this\n * can never redirect signing on a real network run.\n */\nexport function applyChainIdOverride(chain: Chain): Chain {\n const raw = process.env.SIM_CHAIN_ID;\n if (!raw || !process.env.SIM_ADDRESSES_FILE) return chain;\n const id = Number(raw);\n if (!Number.isInteger(id) || id <= 0) return chain;\n return { ...chain, id };\n}\n\nexport function getChain(): Chain {\n return applyChainIdOverride(CHAIN_REGISTRY[_network].chain);\n}\n\n/**\n * Ordered list of RPC URLs to try, deduped:\n * 1. User config (~/.sherwood/config.json) — honored first\n * 2. The active chain's legacy env var (`rpcEnvVar` — ROBINHOOD_FORK_RPC_URL\n * on the default fork, ROBINHOOD_TESTNET_RPC_URL on 46630)\n * 3. Public fallback list from CHAIN_REGISTRY\n *\n * Fed to viem's `fallback()` transport so rate-limited RPCs transparently\n * advance to the next entry. See issue #182.\n */\nexport function getRpcUrls(): string[] {\n const cfg = CHAIN_REGISTRY[_network];\n const urls: string[] = [];\n\n const fromConfig = getConfigRpcUrl(_network);\n if (fromConfig) urls.push(fromConfig);\n\n if (cfg.rpcEnvVar && process.env[cfg.rpcEnvVar]) {\n urls.push(process.env[cfg.rpcEnvVar]!);\n }\n\n // Vnet harness (SIM_CHAIN_ID + SIM_ADDRESSES_FILE interlock): the fork RPC\n // is the ONLY valid endpoint — the public fallbacks point at the real\n // network. viem's fallback() otherwise rotates there on a vnet hiccup and\n // silently estimates gas/fees against MAINNET state (live finding: an\n // approve estimated at 21.9k gas on mainnet — no code at that address —\n // reverted out-of-gas on the vnet where it needs ~46k). A vnet call must\n // fail loudly, never retarget the real chain.\n if (process.env.SIM_CHAIN_ID && process.env.SIM_ADDRESSES_FILE && urls.length > 0) {\n return Array.from(new Set(urls));\n }\n\n urls.push(...cfg.rpcFallbacks);\n\n return Array.from(new Set(urls));\n}\n\nexport function getRpcUrl(): string {\n return getRpcUrls()[0];\n}\n\nexport function getExplorerUrl(txHash: string): string {\n const cfg = CHAIN_REGISTRY[_network];\n const base = cfg.explorerBaseUrl ?? `https://${cfg.explorerHost}`;\n return `${base}/tx/${txHash}`;\n}\n\nexport function isTestnet(): boolean {\n return CHA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
5
  getAccount,
6
6
  getPublicClient,
7
7
  waitForReceipt,
8
8
  writeContractWithRetry
9
- } from "./chunk-QRMZRAMG.js";
9
+ } from "./chunk-D4BSBW3Q.js";
10
10
  import {
11
11
  getChain
12
- } from "./chunk-PVTZMRC6.js";
12
+ } from "./chunk-G3FUEM5N.js";
13
13
  import {
14
14
  PROTOCOL_CONFIG_ABI,
15
15
  SYNDICATE_FACTORY_ABI,
16
16
  SYNDICATE_GOVERNOR_ABI
17
- } from "./chunk-F3MDCUGO.js";
17
+ } from "./chunk-J2IZWAEW.js";
18
18
 
19
19
  // src/lib/governor.ts
20
20
  import { parseEventLogs } from "viem";
@@ -372,6 +372,18 @@ async function cancelProposal(vault, proposalId) {
372
372
  const receipt = await waitForReceipt(hash);
373
373
  return receipt.transactionHash;
374
374
  }
375
+ async function reclaimProposerBond(vault, proposalId) {
376
+ const hash = await writeContractWithRetry({
377
+ account: getAccount(),
378
+ chain: getChain(),
379
+ address: await getGovernorOf(vault),
380
+ abi: SYNDICATE_GOVERNOR_ABI,
381
+ functionName: "reclaimProposerBond",
382
+ args: [proposalId]
383
+ });
384
+ const receipt = await waitForReceipt(hash);
385
+ return receipt.transactionHash;
386
+ }
375
387
  async function emergencyCancel(vault, proposalId) {
376
388
  const hash = await writeContractWithRetry({
377
389
  account: getAccount(),
@@ -483,6 +495,7 @@ export {
483
495
  settleProposal,
484
496
  emergencySettle,
485
497
  cancelProposal,
498
+ reclaimProposerBond,
486
499
  emergencyCancel,
487
500
  setVotingPeriod,
488
501
  setExecutionWindow,
@@ -494,4 +507,4 @@ export {
494
507
  setMgmtSplit,
495
508
  setPerfSplit
496
509
  };
497
- //# sourceMappingURL=chunk-YAS52NEF.js.map
510
+ //# sourceMappingURL=chunk-G5MXVAFC.js.map