@sherwoodagent/cli 0.86.1 → 0.87.0

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-A2JEYGQS.js} +7 -7
  3. package/dist/{chat-ETZSKQDI.js → chat-OZAAN5LT.js} +8 -8
  4. package/dist/{chunk-ZN2MHIB7.js → chunk-37GT3TJX.js} +5 -5
  5. package/dist/{chunk-45FELUWY.js → chunk-3UYGXGMF.js} +2 -2
  6. package/dist/{chunk-YAS52NEF.js → chunk-CU42ZD4K.js} +5 -5
  7. package/dist/chunk-CU42ZD4K.js.map +1 -0
  8. package/dist/{chunk-PVTZMRC6.js → chunk-G3FUEM5N.js} +2 -2
  9. package/dist/chunk-G3FUEM5N.js.map +1 -0
  10. package/dist/{chunk-XPVXNG2K.js → chunk-GR3GSU3I.js} +6 -6
  11. package/dist/{chunk-KVB5P2OE.js → chunk-IINWI3LD.js} +2 -2
  12. package/dist/{chunk-F3MDCUGO.js → chunk-J2IZWAEW.js} +75 -227
  13. package/dist/chunk-J2IZWAEW.js.map +1 -0
  14. package/dist/{chunk-3IAZQMAW.js → chunk-JGD6A2Q4.js} +29 -82
  15. package/dist/chunk-JGD6A2Q4.js.map +1 -0
  16. package/dist/{chunk-QRMZRAMG.js → chunk-MIAMGVZ4.js} +8 -8
  17. package/dist/chunk-MIAMGVZ4.js.map +1 -0
  18. package/dist/{chunk-EA65CDQH.js → chunk-R6F57QQF.js} +14 -23
  19. package/dist/chunk-R6F57QQF.js.map +1 -0
  20. package/dist/{chunk-EVUKJ7CJ.js → chunk-TTF5TDRV.js} +5 -5
  21. package/dist/{chunk-IAM4VIU2.js → chunk-UOIAY6ZG.js} +6 -39
  22. package/dist/chunk-UOIAY6ZG.js.map +1 -0
  23. package/dist/{chunk-6QBGTX2Q.js → chunk-V7TNYHIK.js} +257 -484
  24. package/dist/chunk-V7TNYHIK.js.map +1 -0
  25. package/dist/{chunk-OUYMZ5ZC.js → chunk-W3XWRWML.js} +5 -5
  26. package/dist/{client-3SE632Q2.js → client-C6N2ASTH.js} +3 -3
  27. package/dist/{eas-KMDAMLXW.js → eas-VFTWEI4K.js} +6 -6
  28. package/dist/{governor-JNSWPJVQ.js → governor-HVBSI6Z2.js} +6 -6
  29. package/dist/identity-OLD25QEP.js +18 -0
  30. package/dist/index.js +91 -305
  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-O3THX2HL.js} +6 -6
  34. package/dist/{providers-BMOHHVUN.js → providers-KZNCCUKT.js} +4 -4
  35. package/dist/{research-W74PNYPO.js → research-ARFBFXIT.js} +7 -7
  36. package/dist/{session-HVRZ6AJM.js → session-A7CYZSSA.js} +14 -12
  37. package/dist/session-A7CYZSSA.js.map +1 -0
  38. package/dist/{trade-EOQY72L7.js → trade-ZCK332E4.js} +15 -15
  39. package/dist/{vault-HWJQJW5U.js → vault-CDI7BELZ.js} +8 -8
  40. package/dist/{xmtp-KW73BGVO.js → xmtp-7LAWDKJT.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-A2JEYGQS.js.map} +0 -0
  54. /package/dist/{chat-ETZSKQDI.js.map → chat-OZAAN5LT.js.map} +0 -0
  55. /package/dist/{chunk-ZN2MHIB7.js.map → chunk-37GT3TJX.js.map} +0 -0
  56. /package/dist/{chunk-45FELUWY.js.map → chunk-3UYGXGMF.js.map} +0 -0
  57. /package/dist/{chunk-XPVXNG2K.js.map → chunk-GR3GSU3I.js.map} +0 -0
  58. /package/dist/{chunk-KVB5P2OE.js.map → chunk-IINWI3LD.js.map} +0 -0
  59. /package/dist/{chunk-EVUKJ7CJ.js.map → chunk-TTF5TDRV.js.map} +0 -0
  60. /package/dist/{chunk-OUYMZ5ZC.js.map → chunk-W3XWRWML.js.map} +0 -0
  61. /package/dist/{client-3SE632Q2.js.map → client-C6N2ASTH.js.map} +0 -0
  62. /package/dist/{eas-KMDAMLXW.js.map → eas-VFTWEI4K.js.map} +0 -0
  63. /package/dist/{governor-JNSWPJVQ.js.map → governor-HVBSI6Z2.js.map} +0 -0
  64. /package/dist/{identity-ATWV2O7Y.js.map → identity-OLD25QEP.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-O3THX2HL.js.map} +0 -0
  67. /package/dist/{providers-BMOHHVUN.js.map → providers-KZNCCUKT.js.map} +0 -0
  68. /package/dist/{research-W74PNYPO.js.map → research-ARFBFXIT.js.map} +0 -0
  69. /package/dist/{trade-EOQY72L7.js.map → trade-ZCK332E4.js.map} +0 -0
  70. /package/dist/{vault-HWJQJW5U.js.map → vault-CDI7BELZ.js.map} +0 -0
  71. /package/dist/{xmtp-KW73BGVO.js.map → xmtp-7LAWDKJT.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] 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: \"A Chainlink push feed backing a portfolio allocation is older than MAX_PUSH_PRICE_AGE (26h). Wait for the feed to 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\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"],"mappings":";;;;;;;;;;AAQA,SAAS,oBAAoB,oBAAoB,UAAU,YAAY;AACvE,SAAS,2BAA2B;;;ACDpC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AAC,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,10 +1,10 @@
1
1
  import {
2
2
  PROPOSAL_STATES,
3
3
  getProposal
4
- } from "./chunk-YAS52NEF.js";
4
+ } from "./chunk-CU42ZD4K.js";
5
5
  import {
6
6
  getPublicClient
7
- } from "./chunk-QRMZRAMG.js";
7
+ } from "./chunk-MIAMGVZ4.js";
8
8
  import {
9
9
  resolveMetadataSummary
10
10
  } from "./chunk-YMB4RJOR.js";
@@ -16,32 +16,18 @@ var VAULT_EVENTS = [
16
16
  parseAbiItem("event AgentRegistered(uint256 indexed agentId, address indexed agentAddress)"),
17
17
  parseAbiItem("event AgentRemoved(address indexed agentAddress)"),
18
18
  parseAbiItem("event DepositorApproved(address indexed depositor)"),
19
- parseAbiItem("event DepositorRemoved(address indexed depositor)"),
20
- parseAbiItem("event RedemptionsLockedEvent()"),
21
- parseAbiItem("event RedemptionsUnlockedEvent()"),
22
- // ISyndicateVault.SandboxRun — a proposal's sandbox was minted, funded and run.
23
- // NAME COLLISION WARNING: ICallSandbox also declares a `SandboxRun` event with a
24
- // DIFFERENT shape (SandboxRun(address,uint256,uint256), topic0 0x2638b671…) than
25
- // this vault-side one (topic0 0x6fbfaa03…). Downstream consumers (the
26
- // sherwood-monitor Hermes plugin) route by the `type` string, so ONLY the vault
27
- // event may be emitted as "SandboxRun". If the ICallSandbox event is ever wired
28
- // here, it MUST get a distinct type string (e.g. "CallSandboxRun").
29
- parseAbiItem("event SandboxRun(uint256 indexed pid, address indexed sandbox, uint256 funding)")
19
+ parseAbiItem("event DepositorRemoved(address indexed depositor)")
30
20
  ];
31
21
  var GOVERNOR_EVENTS = [
32
22
  parseAbiItem("event ProposalCreated(uint256 indexed proposalId, address indexed proposer, address indexed vault, uint256 performanceFeeBps, uint256 strategyDuration, uint256 executeCallCount, uint256 settlementCallCount, string metadataURI)"),
33
23
  parseAbiItem("event VoteCast(uint256 indexed proposalId, address indexed voter, uint8 support, uint256 weight)"),
34
24
  parseAbiItem("event ProposalExecuted(uint256 indexed proposalId, address indexed vault, uint256 capitalSnapshot)"),
35
25
  parseAbiItem("event ProposalSettled(uint256 indexed proposalId, address indexed vault, int256 pnl, uint256 performanceFee, uint256 duration)"),
36
- parseAbiItem("event ProposalCancelled(uint256 indexed proposalId, address indexed cancelledBy)"),
37
- // ISyndicateGovernor.SandboxPayloadStored — a proposeWithSandbox payload was
38
- // stored for proposalId. The call set itself is not in the log (read it via
39
- // `sandboxPayload`); the counts are the cheap off-chain signal.
40
- parseAbiItem("event SandboxPayloadStored(uint256 indexed proposalId, uint256 funding, uint256 callCount, uint256 tokenCount)")
26
+ parseAbiItem("event ProposalCancelled(uint256 indexed proposalId, address indexed cancelledBy)")
41
27
  ];
42
28
  var GUARDIAN_REGISTRY_EVENTS = [
43
- parseAbiItem("event ReviewOpened(uint256 indexed proposalId, uint128 totalStakeAtOpen)"),
44
- parseAbiItem("event ReviewResolved(uint256 indexed proposalId, bool blocked, uint256 slashedAmount)")
29
+ parseAbiItem("event ReviewOpened(address indexed governor, uint256 indexed proposalId, uint128 totalStakeAtOpen)"),
30
+ parseAbiItem("event ReviewResolved(address indexed governor, uint256 indexed proposalId, bool blocked, uint256 slashedAmount)")
45
31
  ];
46
32
  var STAKED_WOOD_EVENTS = [
47
33
  parseAbiItem("event GuardianSlashed(bytes32 indexed reviewKey, address indexed approver, uint256 ownSlash, uint256 delegatedSlash)")
@@ -114,7 +100,7 @@ async function getGovernorEvents(governorAddress, vaultAddress, fromBlock, toBlo
114
100
  return logToChainEvent(log, eventName);
115
101
  });
116
102
  }
117
- async function getGuardianRegistryEvents(registryAddress, fromBlock, toBlock) {
103
+ async function getGuardianRegistryEvents(registryAddress, fromBlock, toBlock, governor) {
118
104
  if (registryAddress === "0x0000000000000000000000000000000000000000") {
119
105
  return [];
120
106
  }
@@ -124,7 +110,12 @@ async function getGuardianRegistryEvents(registryAddress, fromBlock, toBlock) {
124
110
  fromBlock,
125
111
  toBlock
126
112
  });
127
- return logs.map((log) => {
113
+ const want = governor?.toLowerCase();
114
+ return logs.filter((log) => {
115
+ if (!want) return true;
116
+ const args = log.args;
117
+ return !args?.governor || args.governor.toLowerCase() === want;
118
+ }).map((log) => {
128
119
  const eventName = log.eventName || "UnknownGuardianRegistryEvent";
129
120
  return logToChainEvent(log, eventName);
130
121
  });
@@ -221,4 +212,4 @@ export {
221
212
  getCurrentBlock,
222
213
  enrichProposalEvents
223
214
  };
224
- //# sourceMappingURL=chunk-EA65CDQH.js.map
215
+ //# sourceMappingURL=chunk-R6F57QQF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/events.ts"],"sourcesContent":["/**\n * On-chain event reader — fetches vault and governor events via viem getLogs.\n *\n * Uses HTTP RPC (no WebSocket needed). Block ranges are capped at 10,000\n * per call to avoid RPC timeouts (~83 minutes on Base at 2 blocks/sec).\n */\n\nimport type { Address, Log } from \"viem\";\nimport { parseAbiItem } from \"viem\";\nimport { getPublicClient } from \"./client.js\";\nimport { getProposal, PROPOSAL_STATES } from \"./governor.js\";\nimport { resolveMetadataSummary } from \"./ipfs.js\";\n\nconst MAX_BLOCK_RANGE = 10_000n;\n\n// ── Event signatures (parseAbiItem format for getLogs) ──\n\nexport const VAULT_EVENTS = [\n parseAbiItem(\"event AgentRegistered(uint256 indexed agentId, address indexed agentAddress)\"),\n parseAbiItem(\"event AgentRemoved(address indexed agentAddress)\"),\n parseAbiItem(\"event DepositorApproved(address indexed depositor)\"),\n parseAbiItem(\"event DepositorRemoved(address indexed depositor)\"),\n] as const;\n\nexport const GOVERNOR_EVENTS = [\n parseAbiItem(\"event ProposalCreated(uint256 indexed proposalId, address indexed proposer, address indexed vault, uint256 performanceFeeBps, uint256 strategyDuration, uint256 executeCallCount, uint256 settlementCallCount, string metadataURI)\"),\n parseAbiItem(\"event VoteCast(uint256 indexed proposalId, address indexed voter, uint8 support, uint256 weight)\"),\n parseAbiItem(\"event ProposalExecuted(uint256 indexed proposalId, address indexed vault, uint256 capitalSnapshot)\"),\n parseAbiItem(\"event ProposalSettled(uint256 indexed proposalId, address indexed vault, int256 pnl, uint256 performanceFee, uint256 duration)\"),\n parseAbiItem(\"event ProposalCancelled(uint256 indexed proposalId, address indexed cancelledBy)\"),\n] as const;\n\n// IGuardianRegistry — guardian review lifecycle for proposals.\n// Every proposal-keyed event leads with `address indexed governor`: the\n// registry serves every per-vault governor, so a proposalId alone is\n// ambiguous. Dropping the governor topic here silently mixes reviews from\n// unrelated vaults into one stream.\nexport const GUARDIAN_REGISTRY_EVENTS = [\n parseAbiItem(\"event ReviewOpened(address indexed governor, uint256 indexed proposalId, uint128 totalStakeAtOpen)\"),\n parseAbiItem(\"event ReviewResolved(address indexed governor, uint256 indexed proposalId, bool blocked, uint256 slashedAmount)\"),\n] as const;\n\n// StakedWood — approver slashes for blocked proposals.\nexport const STAKED_WOOD_EVENTS = [\n parseAbiItem(\"event GuardianSlashed(bytes32 indexed reviewKey, address indexed approver, uint256 ownSlash, uint256 delegatedSlash)\"),\n] as const;\n\n/** Normalized event returned by the session check. */\nexport interface ChainEvent {\n source: \"chain\";\n type: string;\n block: number;\n tx: string;\n args: Record<string, string>;\n}\n\nfunction logToChainEvent(log: Log, eventName: string): ChainEvent {\n const args: Record<string, string> = {};\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const decoded = (log as any).args;\n if (decoded) {\n for (const [key, value] of Object.entries(decoded)) {\n args[key] = String(value);\n }\n }\n\n return {\n source: \"chain\",\n type: eventName,\n block: Number(log.blockNumber),\n tx: log.transactionHash || \"\",\n args,\n };\n}\n\n/**\n * Fetch events in chunks to stay within RPC limits.\n * Returns all logs from `fromBlock` to `toBlock` inclusive.\n * Exported for reuse (e.g. vault.ts getNetDeposited's 0→latest scan).\n */\nexport async function getLogsChunked(params: {\n address: Address;\n events: readonly ReturnType<typeof parseAbiItem>[];\n fromBlock: bigint;\n toBlock: bigint;\n}): Promise<Log[]> {\n const client = getPublicClient();\n const { address, events, fromBlock, toBlock } = params;\n\n const allLogs: Log[] = [];\n let cursor = fromBlock;\n\n while (cursor <= toBlock) {\n const end =\n cursor + MAX_BLOCK_RANGE - 1n > toBlock\n ? toBlock\n : cursor + MAX_BLOCK_RANGE - 1n;\n\n const logs = await client.getLogs({\n address,\n events: events as never,\n fromBlock: cursor,\n toBlock: end,\n });\n\n allLogs.push(...logs);\n cursor = end + 1n;\n }\n\n return allLogs;\n}\n\n/** Fetch vault events (AgentRegistered, Ragequit, etc.) */\nexport async function getVaultEvents(\n vaultAddress: Address,\n fromBlock: bigint,\n toBlock: bigint,\n): Promise<ChainEvent[]> {\n const logs = await getLogsChunked({\n address: vaultAddress,\n events: VAULT_EVENTS,\n fromBlock,\n toBlock,\n });\n\n return logs.map((log) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const eventName = (log as any).eventName || \"UnknownVaultEvent\";\n return logToChainEvent(log, eventName);\n });\n}\n\n/** Fetch governor events filtered to a specific vault. */\nexport async function getGovernorEvents(\n governorAddress: Address,\n vaultAddress: Address,\n fromBlock: bigint,\n toBlock: bigint,\n): Promise<ChainEvent[]> {\n if (governorAddress === \"0x0000000000000000000000000000000000000000\") {\n return []; // Governor not deployed yet\n }\n\n const logs = await getLogsChunked({\n address: governorAddress,\n events: GOVERNOR_EVENTS,\n fromBlock,\n toBlock,\n });\n\n // Filter governor events to only those involving our vault\n return logs\n .filter((log) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const args = (log as any).args;\n if (!args) return true;\n // ProposalCreated, ProposalExecuted, ProposalSettled have `vault` in args\n if (args.vault) {\n return (args.vault as string).toLowerCase() === vaultAddress.toLowerCase();\n }\n // VoteCast, ProposalCancelled don't have vault — include them\n // (agents care about all votes/cancellations on their governor)\n return true;\n })\n .map((log) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const eventName = (log as any).eventName || \"UnknownGovernorEvent\";\n return logToChainEvent(log, eventName);\n });\n}\n\n/**\n * Fetch guardian review events (ReviewOpened, ReviewResolved) from the\n * GuardianRegistry. Returns [] when the registry is not deployed (zero address).\n *\n * The registry serves every per-vault governor, and a proposalId is only\n * unique within one — so pass `governor` to keep another vault's reviews out\n * of the stream. Omitting it returns every review on the chain's registry.\n */\nexport async function getGuardianRegistryEvents(\n registryAddress: Address,\n fromBlock: bigint,\n toBlock: bigint,\n governor?: Address,\n): Promise<ChainEvent[]> {\n if (registryAddress === \"0x0000000000000000000000000000000000000000\") {\n return []; // GuardianRegistry not deployed on this chain\n }\n\n const logs = await getLogsChunked({\n address: registryAddress,\n events: GUARDIAN_REGISTRY_EVENTS,\n fromBlock,\n toBlock,\n });\n\n const want = governor?.toLowerCase();\n return logs\n .filter((log) => {\n if (!want) return true;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const args = (log as any).args;\n return !args?.governor || (args.governor as string).toLowerCase() === want;\n })\n .map((log) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const eventName = (log as any).eventName || \"UnknownGuardianRegistryEvent\";\n return logToChainEvent(log, eventName);\n });\n}\n\n/**\n * Fetch guardian slash events (GuardianSlashed) from StakedWood.\n * Returns [] when sWOOD is not deployed (zero address).\n */\nexport async function getStakedWoodEvents(\n stakedWoodAddress: Address,\n fromBlock: bigint,\n toBlock: bigint,\n): Promise<ChainEvent[]> {\n if (stakedWoodAddress === \"0x0000000000000000000000000000000000000000\") {\n return []; // StakedWood not deployed on this chain\n }\n\n const logs = await getLogsChunked({\n address: stakedWoodAddress,\n events: STAKED_WOOD_EVENTS,\n fromBlock,\n toBlock,\n });\n\n return logs.map((log) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const eventName = (log as any).eventName || \"UnknownStakedWoodEvent\";\n return logToChainEvent(log, eventName);\n });\n}\n\n/** Get current block number from the RPC. */\nexport async function getCurrentBlock(): Promise<bigint> {\n const client = getPublicClient();\n return client.getBlockNumber();\n}\n\n// ── Proposal event enrichment ──\n\nconst PROPOSAL_EVENT_TYPES = new Set([\n \"ProposalCreated\",\n \"VoteCast\",\n \"ProposalExecuted\",\n \"ProposalSettled\",\n \"ProposalCancelled\",\n]);\n\n/**\n * Enrich proposal-related events with IPFS metadata (name, description)\n * and current on-chain state. Best-effort — events are returned un-enriched\n * if RPC or IPFS calls fail.\n *\n * `vault` identifies which per-vault governor to read proposal state from\n * (proposal IDs are scoped to a vault's governor in the per-vault design).\n *\n * An optional metadataCache avoids redundant IPFS fetches across poll cycles\n * in streaming mode (proposal metadata is immutable once pinned).\n */\nexport async function enrichProposalEvents(\n vault: Address,\n events: ChainEvent[],\n metadataCache?: Map<string, { name: string; description: string }>,\n): Promise<ChainEvent[]> {\n const cache = metadataCache ?? new Map<string, { name: string; description: string }>();\n\n const proposalEvents = events.filter((e) => PROPOSAL_EVENT_TYPES.has(e.type));\n if (proposalEvents.length === 0) return events;\n\n // Collect unique proposalIds and their metadata sources\n const idsNeedingLookup = new Set<string>();\n const createdURIs = new Map<string, string>(); // proposalId → metadataURI from event args\n\n for (const event of proposalEvents) {\n const pid = event.args.proposalId;\n if (!pid) continue;\n\n if (event.type === \"ProposalCreated\" && event.args.metadataURI) {\n createdURIs.set(pid, event.args.metadataURI);\n } else if (!cache.has(pid)) {\n idsNeedingLookup.add(pid);\n }\n }\n\n // Fetch on-chain proposal data for non-Created events (parallel, deduplicated)\n const proposalData = new Map<string, { metadataURI: string; state: number }>();\n\n await Promise.all(\n Array.from(idsNeedingLookup).map(async (pid) => {\n try {\n const p = await getProposal(vault, BigInt(pid));\n proposalData.set(pid, { metadataURI: p.metadataURI, state: p.state });\n } catch {\n // RPC failure — skip enrichment for this proposalId\n }\n }),\n );\n\n // Resolve IPFS metadata (parallel, deduplicated, uses cache)\n const allURIs = new Map<string, string>();\n for (const [pid, uri] of createdURIs) allURIs.set(pid, uri);\n for (const [pid, data] of proposalData) {\n if (!allURIs.has(pid)) allURIs.set(pid, data.metadataURI);\n }\n\n await Promise.all(\n Array.from(allURIs.entries()).map(async ([pid, uri]) => {\n if (cache.has(pid) || !uri) return;\n const summary = await resolveMetadataSummary(uri);\n if (summary) cache.set(pid, summary);\n }),\n );\n\n // Inject enrichment fields into event args\n return events.map((event) => {\n if (!PROPOSAL_EVENT_TYPES.has(event.type)) return event;\n const pid = event.args.proposalId;\n if (!pid) return event;\n\n const meta = cache.get(pid);\n const pData = proposalData.get(pid);\n const enrichedArgs = { ...event.args };\n\n if (meta) {\n enrichedArgs.proposalName = meta.name;\n enrichedArgs.proposalDescription = meta.description;\n }\n\n if (event.type === \"ProposalCreated\") {\n enrichedArgs.proposalState = \"Pending\";\n } else if (pData) {\n enrichedArgs.proposalState = PROPOSAL_STATES[pData.state] || \"Unknown\";\n }\n\n return { ...event, args: enrichedArgs };\n });\n}\n"],"mappings":";;;;;;;;;;;;AAQA,SAAS,oBAAoB;AAK7B,IAAM,kBAAkB;AAIjB,IAAM,eAAe;AAAA,EAC1B,aAAa,8EAA8E;AAAA,EAC3F,aAAa,kDAAkD;AAAA,EAC/D,aAAa,oDAAoD;AAAA,EACjE,aAAa,mDAAmD;AAClE;AAEO,IAAM,kBAAkB;AAAA,EAC7B,aAAa,oOAAoO;AAAA,EACjP,aAAa,kGAAkG;AAAA,EAC/G,aAAa,oGAAoG;AAAA,EACjH,aA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AAa,SAAQ,IAAI,KAAK,GAAG;AAC1D,aAAW,CAAC,KAAK,IAAI,KAAK,cAAc;AACtC,QAAI,CAAC,QAAQ,IAAI,GAAG,EAAG,SAAQ,IAAI,KAAK,KAAK,WAAW;AAAA,EAC1D;AAEA,QAAM,QAAQ;AAAA,IACZ,MAAM,KAAK,QAAQ,QAAQ,CAAC,EAAE,IAAI,OAAO,CAAC,KAAK,GAAG,MAAM;AACtD,UAAI,MAAM,IAAI,GAAG,KAAK,CAAC,IAAK;AAC5B,YAAM,UAAU,MAAM,uBAAuB,GAAG;AAChD,UAAI,QAAS,OAAM,IAAI,KAAK,OAAO;AAAA,IACrC,CAAC;AAAA,EACH;AAGA,SAAO,OAAO,IAAI,CAAC,UAAU;AAC3B,QAAI,CAAC,qBAAqB,IAAI,MAAM,IAAI,EAAG,QAAO;AAClD,UAAM,MAAM,MAAM,KAAK;AACvB,QAAI,CAAC,IAAK,QAAO;AAEjB,UAAM,OAAO,MAAM,IAAI,GAAG;AAC1B,UAAM,QAAQ,aAAa,IAAI,GAAG;AAClC,UAAM,eAAe,EAAE,GAAG,MAAM,KAAK;AAErC,QAAI,MAAM;AACR,mBAAa,eAAe,KAAK;AACjC,mBAAa,sBAAsB,KAAK;AAAA,IAC1C;AAEA,QAAI,MAAM,SAAS,mBAAmB;AACpC,mBAAa,gBAAgB;AAAA,IAC/B,WAAW,OAAO;AAChB,mBAAa,gBAAgB,gBAAgB,MAAM,KAAK,KAAK;AAAA,IAC/D;AAEA,WAAO,EAAE,GAAG,OAAO,MAAM,aAAa;AAAA,EACxC,CAAC;AACH;","names":[]}
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  SHERWOOD
3
- } from "./chunk-IAM4VIU2.js";
3
+ } from "./chunk-UOIAY6ZG.js";
4
4
  import {
5
5
  getAccount,
6
6
  getPublicClient,
7
7
  waitForReceipt,
8
8
  writeContractWithRetry
9
- } from "./chunk-QRMZRAMG.js";
9
+ } from "./chunk-MIAMGVZ4.js";
10
10
  import {
11
11
  getChain
12
- } from "./chunk-PVTZMRC6.js";
12
+ } from "./chunk-G3FUEM5N.js";
13
13
  import {
14
14
  SYNDICATE_FACTORY_ABI
15
- } from "./chunk-F3MDCUGO.js";
15
+ } from "./chunk-J2IZWAEW.js";
16
16
 
17
17
  // src/lib/factory.ts
18
18
  import { decodeEventLog } from "viem";
@@ -144,4 +144,4 @@ export {
144
144
  getActiveFunds,
145
145
  updateMetadata
146
146
  };
147
- //# sourceMappingURL=chunk-EVUKJ7CJ.js.map
147
+ //# sourceMappingURL=chunk-TTF5TDRV.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,
@@ -358,7 +328,6 @@ var ROBINHOOD_FORK_UNISWAP = {
358
328
  SWAP_ADAPTER: "0x54E6A7af53143556973493fDeC9d7837A77c67eF"
359
329
  };
360
330
  var ROBINHOOD_FORK_CHAINLINK = {
361
- VERIFIER_PROXY: ZERO,
362
331
  WSTETH_ETH_FEED: ZERO,
363
332
  ...forkStockFeeds()
364
333
  };
@@ -376,10 +345,9 @@ var ROBINHOOD_FORK_SHERWOOD = {
376
345
  BATCH_EXECUTOR_LIB: "0x899FC2Cac572F64A233344115b488E71E0044f34",
377
346
  GOVERNOR_BEACON: "0x3CF45eFE9fBDdd6cB749384Bf5c1bA5Ec96af05d",
378
347
  PROTOCOL_CONFIG: "0x8aDb5810B5bF8B9149BE3Ca45Cb441818a9679bB",
379
- // Not in chains/9994663.json (no PriceRouter / CallSandbox on the fork).
348
+ // Not in chains/9994663.json (no PriceRouter on the fork).
380
349
  PRICE_ROUTER: ZERO,
381
350
  TIER_REGISTRY: "0x4614f058920941A0a9a852e62485fbDE692D75E1",
382
- CALL_SANDBOX_IMPL: ZERO,
383
351
  EXPOSURE_LEDGER: "0x99D789E7C8E65dB5597dCa692F082B47BE30AB33",
384
352
  PROPOSER_BOND_ESCROW: "0x7d25058c891d3AC5C8bc8Da6aA937DFeE648B5cF",
385
353
  CHALLENGE_GAME: "0x7046FececcA6c0f5E66Cc998099593ae71A1bbee",
@@ -526,7 +494,6 @@ function CHAINLINK() {
526
494
 
527
495
  export {
528
496
  ROBINHOOD_STOCK_ROUTES,
529
- robinhoodEquityMaxAge,
530
497
  TOKENS,
531
498
  MOONWELL,
532
499
  UNISWAP,
@@ -541,4 +508,4 @@ export {
541
508
  SYNTHRA,
542
509
  CHAINLINK
543
510
  };
544
- //# sourceMappingURL=chunk-IAM4VIU2.js.map
511
+ //# sourceMappingURL=chunk-UOIAY6ZG.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} 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};\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,W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