@sm-lab/recipes 0.2.0 → 0.3.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.
- package/dist/cli.mjs +201 -3
- package/dist/cli.mjs.map +1 -1
- package/dist/cm.d.mts +2 -2
- package/dist/cm.mjs +1 -1
- package/dist/cm.mjs.map +1 -1
- package/dist/{context-BiYdAnKn.d.mts → context-7_EMmCZw.d.mts} +6 -6
- package/dist/{context-BiYdAnKn.d.mts.map → context-7_EMmCZw.d.mts.map} +1 -1
- package/dist/{cl-activate-CPqr6v_D.mjs → exit-request-c0CS5wKu.mjs} +417 -9
- package/dist/exit-request-c0CS5wKu.mjs.map +1 -0
- package/dist/index.d.mts +178 -4
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/{topup-B2NzJV7_.mjs → topup-CuqmB14u.mjs} +117 -11
- package/dist/topup-CuqmB14u.mjs.map +1 -0
- package/package.json +3 -3
- package/dist/cl-activate-CPqr6v_D.mjs.map +0 -1
- package/dist/topup-B2NzJV7_.mjs.map +0 -1
package/dist/cm.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as Ctx, t as CmGateSelector } from "./context-
|
|
1
|
+
import { i as Ctx, t as CmGateSelector } from "./context-7_EMmCZw.mjs";
|
|
2
2
|
import { Hex } from "@sm-lab/receipts";
|
|
3
3
|
|
|
4
4
|
//#region src/cm/index.d.ts
|
|
@@ -64,7 +64,7 @@ declare function setBondCurveWeight(ctx: Ctx, opts: {
|
|
|
64
64
|
weight: bigint;
|
|
65
65
|
}>;
|
|
66
66
|
interface SeedCmOptions {
|
|
67
|
-
/** cm gate selector for the 3 created operators (default 'po' =
|
|
67
|
+
/** cm gate selector for the 3 created operators (default 'po' = CuratedGatePO). */
|
|
68
68
|
selector?: CmGateSelector | string;
|
|
69
69
|
/** Deterministic seed for the operator addresses + key material. Omit → fresh random. */
|
|
70
70
|
seed?: Hex;
|
package/dist/cm.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as roleMember, E as resolveGate, S as actAs, f as deposit, g as RESUME_ROLE, n as topUpActiveKeys, p as DEFAULT_ADMIN_ROLE, v as SET_TREE_ROLE, x as randomSeed, y as addKeys } from "./topup-CuqmB14u.mjs";
|
|
2
2
|
import { concat, keccak256, toHex, zeroAddress } from "viem";
|
|
3
3
|
import { curatedGateAbi, metaRegistryAbi } from "@sm-lab/receipts";
|
|
4
4
|
import { buildAddressesTree } from "@sm-lab/merkle";
|
package/dist/cm.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cm.mjs","names":[],"sources":["../src/cm/index.ts"],"sourcesContent":["import { buildAddressesTree } from '@sm-lab/merkle';\nimport { curatedGateAbi, metaRegistryAbi } from '@sm-lab/receipts';\nimport type { CmAddressBook, Hex } from '@sm-lab/receipts';\nimport { concat, keccak256, toHex, zeroAddress } from 'viem';\nimport { actAs, roleMember } from '../act-as';\nimport { resolveGate, type Ctx, type CmGateSelector } from '../context';\nimport { randomSeed } from '../random';\nimport { addKeys } from '../recipes/add-keys';\nimport { deposit } from '../recipes/deposit';\nimport { topUpActiveKeys } from '../recipes/topup';\nimport { DEFAULT_ADMIN_ROLE, RESUME_ROLE, SET_TREE_ROLE } from '../roles';\n\n/** An empty MetaRegistry OperatorGroup — used to reset a group to its zero state. */\nconst EMPTY_GROUP = { name: '', subNodeOperators: [], externalOperators: [] };\n\nexport interface CreateCuratedOperatorOptions {\n /** cm gate selector (po/pto/…) or a raw 0x… address. */\n selector: CmGateSelector | string;\n /** The new operator's address; also the merkle leaf proven into the temp tree. */\n operator: Hex;\n /** Second leaf for the N=2 temp tree; derived deterministically from `operator` if omitted. */\n extra?: Hex;\n name?: string;\n description?: string;\n}\n\nexport interface CreateCuratedOperatorResult {\n noId: bigint;\n}\n\n/**\n * Create a node operator through a curated gate by temporarily installing a 2-leaf merkle\n * tree that admits `operator`, creating the operator, then restoring the gate's original\n * tree. (Port of `NodeOperators.createCuratedOperator`; no post-assertions — returns noId.)\n */\nexport async function createCuratedOperator(\n ctx: Ctx,\n opts: CreateCuratedOperatorOptions,\n): Promise<CreateCuratedOperatorResult> {\n if (ctx.module !== 'cm') {\n throw new Error('@sm-lab/recipes/cm: createCuratedOperator requires ctx.module === \"cm\"');\n }\n const gate = { address: resolveGate(ctx, opts.selector), abi: curatedGateAbi } as const;\n const extra = opts.extra ?? deriveExtra(opts.operator);\n\n // Snapshot the original tree so we can restore it after creating the operator.\n const origRoot = await ctx.client.readContract({ ...gate, functionName: 'treeRoot' });\n const origCid = await ctx.client.readContract({ ...gate, functionName: 'treeCid' });\n const admin = await roleMember(ctx, gate, DEFAULT_ADMIN_ROLE);\n\n // N=2 OZ ['address'] tree; prove by value (OZ sorts leaves, so index is unreliable).\n const tree = buildAddressesTree([opts.operator, extra]);\n const tmpRoot = tree.root as Hex;\n const proof = tree.getProof([opts.operator]) as Hex[];\n const tmpCid = `tmp-cid-${opts.operator.toLowerCase()}`;\n\n // Install the temp tree as the gate admin (grant SET_TREE_ROLE, resume if paused, set).\n await actAs(ctx, admin, async (from) => {\n await ctx.client.writeContract({\n ...gate,\n functionName: 'grantRole',\n args: [SET_TREE_ROLE, admin],\n account: from,\n chain: null,\n });\n const paused = await ctx.client.readContract({ ...gate, functionName: 'isPaused' });\n if (paused) {\n await ctx.client.writeContract({\n ...gate,\n functionName: 'grantRole',\n args: [RESUME_ROLE, admin],\n account: from,\n chain: null,\n });\n await ctx.client.writeContract({\n ...gate,\n functionName: 'resume',\n account: from,\n chain: null,\n });\n }\n await ctx.client.writeContract({\n ...gate,\n functionName: 'setTreeParams',\n args: [tmpRoot, tmpCid],\n account: from,\n chain: null,\n });\n });\n\n // Capture the returned noId via simulate, then send the real tx as the operator.\n // The restore runs in `finally` so a failed create never leaves the gate with the\n // temporary tree installed on the fork (matching actAs's stop-on-any-exit discipline).\n try {\n const { result, request } = await ctx.client.simulateContract({\n ...gate,\n functionName: 'createNodeOperator',\n args: [\n opts.name ?? 'fork-operator',\n opts.description ?? 'fork-test',\n zeroAddress,\n zeroAddress,\n proof,\n ],\n account: opts.operator,\n });\n const noId = result as bigint;\n await actAs(ctx, opts.operator, () => ctx.client.writeContract({ ...request, chain: null }));\n return { noId };\n } finally {\n await actAs(ctx, admin, (from) =>\n ctx.client.writeContract({\n ...gate,\n functionName: 'setTreeParams',\n args: [origRoot, origCid],\n account: from,\n chain: null,\n }),\n );\n }\n}\n\nexport interface CreateOperatorGroupOptions {\n /** [nodeOperatorId, shareBps] pairs; shares in basis points (e.g. 6000 = 60%), must sum to 10000. */\n pairs: [bigint, bigint][];\n /** Optional group name (Solidity leaves it ''); default ''. */\n name?: string;\n}\n\nexport interface CreateOperatorGroupResult {\n /** The sub-node-operators written into the NO_GROUP_ID group, in input order. */\n subNodeOperators: { nodeOperatorId: bigint; share: number }[];\n /** Group ids reset to EMPTY_GROUP first (operators previously in a group), de-duplicated. */\n resetGroupIds: bigint[];\n}\n\n/**\n * Create a node-operator group on the MetaRegistry: reset any pre-existing memberships of the\n * named operators, then write a fresh group under `NO_GROUP_ID`. Port of\n * `MetaRegistryHelpers.createOperatorGroup` (the `MANAGE_OPERATOR_GROUPS_ROLE` member acts).\n */\nexport async function createOperatorGroup(\n ctx: Ctx,\n opts: CreateOperatorGroupOptions,\n): Promise<CreateOperatorGroupResult> {\n if (ctx.module !== 'cm') {\n throw new Error('@sm-lab/recipes/cm: createOperatorGroup requires ctx.module === \"cm\"');\n }\n // Validate input BEFORE any chain call — a precise error beats an opaque on-chain revert.\n if (opts.pairs.length < 1)\n throw new Error('@sm-lab/recipes/cm: createOperatorGroup needs ≥1 [noId, shareBps] pair');\n const shareSum = opts.pairs.reduce((acc, [, s]) => acc + s, 0n);\n if (shareSum !== 10000n)\n throw new Error(`@sm-lab/recipes/cm: shares must sum to 10000 bps (got ${shareSum})`);\n\n const mr = {\n address: (ctx.addresses as CmAddressBook).MetaRegistry as Hex,\n abi: metaRegistryAbi,\n } as const;\n const role = (await ctx.client.readContract({\n ...mr,\n functionName: 'MANAGE_OPERATOR_GROUPS_ROLE',\n })) as Hex;\n const manager = await roleMember(ctx, mr, role);\n\n const noGroupId = (await ctx.client.readContract({\n ...mr,\n functionName: 'NO_GROUP_ID',\n })) as bigint;\n\n // Resolve current memberships up front (parallel reads — order-independent), then de-dup the gids\n // to reset (a harmless divergence from Solidity's per-pair reset, which can double-reset an\n // already-emptied gid). A Set preserves insertion order, so resetGroupIds stays deterministic in\n // first-encounter order.\n const gids = (await Promise.all(\n opts.pairs.map(([noId]) =>\n ctx.client.readContract({ ...mr, functionName: 'getNodeOperatorGroupId', args: [noId] }),\n ),\n )) as bigint[];\n const toReset = new Set<bigint>();\n for (const gid of gids) {\n if (gid !== noGroupId) toReset.add(gid);\n }\n const resetGroupIds = [...toReset];\n\n const subNodeOperators = opts.pairs.map(([noId, share]) => ({\n nodeOperatorId: noId, // bigint (uint64)\n share: Number(share), // number (uint16)\n }));\n const group = { name: opts.name ?? '', subNodeOperators, externalOperators: [] };\n\n await actAs(ctx, manager, async (from) => {\n for (const gid of resetGroupIds) {\n // eslint-disable-next-line no-await-in-loop -- sequential by necessity (impersonation is global state)\n await ctx.client.writeContract({\n ...mr,\n functionName: 'createOrUpdateOperatorGroup',\n args: [gid, EMPTY_GROUP],\n account: from,\n chain: null,\n });\n }\n await ctx.client.writeContract({\n ...mr,\n functionName: 'createOrUpdateOperatorGroup',\n args: [noGroupId, group],\n account: from,\n chain: null,\n });\n });\n\n return { subNodeOperators, resetGroupIds };\n}\n\nexport interface ResetOperatorGroupResult {\n groupId: bigint;\n}\n\n/**\n * Reset the operator group that contains `noId` to its empty state. Port of\n * `MetaRegistryHelpers.resetOperatorGroup`; throws if the operator is in no group.\n */\nexport async function resetOperatorGroup(\n ctx: Ctx,\n opts: { noId: bigint },\n): Promise<ResetOperatorGroupResult> {\n if (ctx.module !== 'cm') {\n throw new Error('@sm-lab/recipes/cm: resetOperatorGroup requires ctx.module === \"cm\"');\n }\n const mr = {\n address: (ctx.addresses as CmAddressBook).MetaRegistry as Hex,\n abi: metaRegistryAbi,\n } as const;\n const role = (await ctx.client.readContract({\n ...mr,\n functionName: 'MANAGE_OPERATOR_GROUPS_ROLE',\n })) as Hex;\n const manager = await roleMember(ctx, mr, role);\n\n const gid = (await ctx.client.readContract({\n ...mr,\n functionName: 'getNodeOperatorGroupId',\n args: [opts.noId],\n })) as bigint;\n const noGroupId = (await ctx.client.readContract({\n ...mr,\n functionName: 'NO_GROUP_ID',\n })) as bigint;\n if (gid === noGroupId) throw new Error('@sm-lab/recipes/cm: operator not in a group');\n\n await actAs(ctx, manager, (from) =>\n ctx.client.writeContract({\n ...mr,\n functionName: 'createOrUpdateOperatorGroup',\n args: [gid, EMPTY_GROUP],\n account: from,\n chain: null,\n }),\n );\n\n return { groupId: gid };\n}\n\n/**\n * Set a bond-curve weight on the MetaRegistry. Port of\n * `MetaRegistryHelpers.setBondCurveWeight` (the `SET_BOND_CURVE_WEIGHT_ROLE` member acts).\n */\nexport async function setBondCurveWeight(\n ctx: Ctx,\n opts: { curveId: bigint; weight: bigint },\n): Promise<{ curveId: bigint; weight: bigint }> {\n if (ctx.module !== 'cm') {\n throw new Error('@sm-lab/recipes/cm: setBondCurveWeight requires ctx.module === \"cm\"');\n }\n const mr = {\n address: (ctx.addresses as CmAddressBook).MetaRegistry as Hex,\n abi: metaRegistryAbi,\n } as const;\n const role = (await ctx.client.readContract({\n ...mr,\n functionName: 'SET_BOND_CURVE_WEIGHT_ROLE',\n })) as Hex;\n const setter = await roleMember(ctx, mr, role);\n\n await actAs(ctx, setter, (from) =>\n ctx.client.writeContract({\n ...mr,\n functionName: 'setBondCurveWeight',\n args: [opts.curveId, opts.weight],\n account: from,\n chain: null,\n }),\n );\n\n return { curveId: opts.curveId, weight: opts.weight };\n}\n\n/** A deterministic address distinct from `operator` (low 20 bytes of its keccak hash). */\nfunction deriveExtra(operator: Hex): Hex {\n const h = keccak256(operator); // 0x + 64 hex chars\n return `0x${h.slice(-40)}` as Hex; // low 20 bytes → a valid, distinct address\n}\n\nexport interface SeedCmOptions {\n /** cm gate selector for the 3 created operators (default 'po' = CuratedGates[0]). */\n selector?: CmGateSelector | string;\n /** Deterministic seed for the operator addresses + key material. Omit → fresh random. */\n seed?: Hex;\n}\n\nexport interface SeedCmResult {\n /** The 3 created operators' noIds, in creation order (a/b/c). */\n noIds: [bigint, bigint, bigint];\n /** The operator addresses generated for the gate, parallel to `noIds`. */\n operators: [Hex, Hex, Hex];\n}\n\n/** A deterministic address from a seed + label (low 20 bytes of keccak — mirrors deriveExtra). */\nfunction deriveOperatorAddress(seed: Hex, i: number): Hex {\n const h = keccak256(concat([seed, toHex(`cm-operator-${i}`)]));\n return `0x${h.slice(-40)}` as Hex;\n}\n\n/** A deterministic key seed from a seed + label (so the 7 addKeys calls never collide on pubkeys). */\nfunction keySeed(seed: Hex, label: string): Hex {\n return keccak256(concat([seed, toHex(label)]));\n}\n\n/**\n * Seed a realistic cm fork in one call: create 3 gate operators, group them 34/33/33, then key /\n * deposit / top-up across 3 rounds (and add a final key to two of them). Port of `fork.just\n * seed-cm`. Composes already-tested recipes; uses the noIds returned by `createCuratedOperator`\n * (not hardcoded 0/1/2) so it is correct on a non-fresh fork too. Deterministic when `seed` is set.\n */\nexport async function seedCm(ctx: Ctx, opts: SeedCmOptions = {}): Promise<SeedCmResult> {\n if (ctx.module !== 'cm') {\n throw new Error('@sm-lab/recipes/cm: seedCm requires ctx.module === \"cm\"');\n }\n\n const selector = opts.selector ?? 'po';\n const seed = opts.seed ?? randomSeed();\n const operators: [Hex, Hex, Hex] = [\n deriveOperatorAddress(seed, 0),\n deriveOperatorAddress(seed, 1),\n deriveOperatorAddress(seed, 2),\n ];\n\n // Sequential by necessity: each createCuratedOperator installs/restores the gate temp tree and\n // every later step reads fork state mutated by the prior ones.\n const { noId: na } = await createCuratedOperator(ctx, { selector, operator: operators[0] });\n const { noId: nb } = await createCuratedOperator(ctx, { selector, operator: operators[1] });\n const { noId: nc } = await createCuratedOperator(ctx, { selector, operator: operators[2] });\n const noIds: [bigint, bigint, bigint] = [na, nb, nc];\n\n await createOperatorGroup(ctx, {\n pairs: [\n [na, 3400n],\n [nb, 3300n],\n [nc, 3300n],\n ],\n });\n\n // 3 add/deposit/topup rounds, mapping the source's operator indices 0/1/0 to na/nb/na. Each\n // addKeys gets a distinct per-call label (r0..r4) so na's three calls draw different key material.\n // Note: keccak256(seed) % 2^20 startIndex ranges CAN collide across seeds (birthday in 1M space),\n // but that is benign here — CSM does not dedup pubkeys (SigningKeys.sol has no uniqueness check).\n await addKeys(ctx, { noId: na, count: 4, seed: keySeed(seed, 'r0') });\n await deposit(ctx, { count: 100 });\n await topUpActiveKeys(ctx, { noId: na });\n\n await addKeys(ctx, { noId: nb, count: 5, seed: keySeed(seed, 'r1') });\n await deposit(ctx, { count: 100 });\n await topUpActiveKeys(ctx, { noId: nb });\n\n await addKeys(ctx, { noId: na, count: 6, seed: keySeed(seed, 'r2') });\n await deposit(ctx, { count: 100 });\n await topUpActiveKeys(ctx, { noId: na });\n\n // Final keys, no deposit/topup.\n await addKeys(ctx, { noId: na, count: 1, seed: keySeed(seed, 'r3') });\n await addKeys(ctx, { noId: nb, count: 1, seed: keySeed(seed, 'r4') });\n\n return { noIds, operators };\n}\n"],"mappings":";;;;;;AAaA,MAAM,cAAc;CAAE,MAAM;CAAI,kBAAkB,CAAC;CAAG,mBAAmB,CAAC;AAAE;;;;;;AAsB5E,eAAsB,sBACpB,KACA,MACsC;CACtC,IAAI,IAAI,WAAW,MACjB,MAAM,IAAI,MAAM,0EAAwE;CAE1F,MAAM,OAAO;EAAE,SAAS,YAAY,KAAK,KAAK,QAAQ;EAAG,KAAK;CAAe;CAC7E,MAAM,QAAQ,KAAK,SAAS,YAAY,KAAK,QAAQ;CAGrD,MAAM,WAAW,MAAM,IAAI,OAAO,aAAa;EAAE,GAAG;EAAM,cAAc;CAAW,C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KAAK;CACZ,EACF,CAAC;CAMD,MAAM,QAAQ,KAAK;EAAE,MAAM;EAAI,OAAO;EAAG,MAAM,QAAQ,MAAM,IAAI;CAAE,CAAC;CACpE,MAAM,QAAQ,KAAK,EAAE,OAAO,IAAI,CAAC;CACjC,MAAM,gBAAgB,KAAK,EAAE,MAAM,GAAG,CAAC;CAEvC,MAAM,QAAQ,KAAK;EAAE,MAAM;EAAI,OAAO;EAAG,MAAM,QAAQ,MAAM,IAAI;CAAE,CAAC;CACpE,MAAM,QAAQ,KAAK,EAAE,OAAO,IAAI,CAAC;CACjC,MAAM,gBAAgB,KAAK,EAAE,MAAM,GAAG,CAAC;CAEvC,MAAM,QAAQ,KAAK;EAAE,MAAM;EAAI,OAAO;EAAG,MAAM,QAAQ,MAAM,IAAI;CAAE,CAAC;CACpE,MAAM,QAAQ,KAAK,EAAE,OAAO,IAAI,CAAC;CACjC,MAAM,gBAAgB,KAAK,EAAE,MAAM,GAAG,CAAC;CAGvC,MAAM,QAAQ,KAAK;EAAE,MAAM;EAAI,OAAO;EAAG,MAAM,QAAQ,MAAM,IAAI;CAAE,CAAC;CACpE,MAAM,QAAQ,KAAK;EAAE,MAAM;EAAI,OAAO;EAAG,MAAM,QAAQ,MAAM,IAAI;CAAE,CAAC;CAEpE,OAAO;EAAE;EAAO;CAAU;AAC5B"}
|
|
1
|
+
{"version":3,"file":"cm.mjs","names":[],"sources":["../src/cm/index.ts"],"sourcesContent":["import { buildAddressesTree } from '@sm-lab/merkle';\nimport { curatedGateAbi, metaRegistryAbi } from '@sm-lab/receipts';\nimport type { CmAddressBook, Hex } from '@sm-lab/receipts';\nimport { concat, keccak256, toHex, zeroAddress } from 'viem';\nimport { actAs, roleMember } from '../act-as';\nimport { resolveGate, type Ctx, type CmGateSelector } from '../context';\nimport { randomSeed } from '../random';\nimport { addKeys } from '../recipes/add-keys';\nimport { deposit } from '../recipes/deposit';\nimport { topUpActiveKeys } from '../recipes/topup';\nimport { DEFAULT_ADMIN_ROLE, RESUME_ROLE, SET_TREE_ROLE } from '../roles';\n\n/** An empty MetaRegistry OperatorGroup — used to reset a group to its zero state. */\nconst EMPTY_GROUP = { name: '', subNodeOperators: [], externalOperators: [] };\n\nexport interface CreateCuratedOperatorOptions {\n /** cm gate selector (po/pto/…) or a raw 0x… address. */\n selector: CmGateSelector | string;\n /** The new operator's address; also the merkle leaf proven into the temp tree. */\n operator: Hex;\n /** Second leaf for the N=2 temp tree; derived deterministically from `operator` if omitted. */\n extra?: Hex;\n name?: string;\n description?: string;\n}\n\nexport interface CreateCuratedOperatorResult {\n noId: bigint;\n}\n\n/**\n * Create a node operator through a curated gate by temporarily installing a 2-leaf merkle\n * tree that admits `operator`, creating the operator, then restoring the gate's original\n * tree. (Port of `NodeOperators.createCuratedOperator`; no post-assertions — returns noId.)\n */\nexport async function createCuratedOperator(\n ctx: Ctx,\n opts: CreateCuratedOperatorOptions,\n): Promise<CreateCuratedOperatorResult> {\n if (ctx.module !== 'cm') {\n throw new Error('@sm-lab/recipes/cm: createCuratedOperator requires ctx.module === \"cm\"');\n }\n const gate = { address: resolveGate(ctx, opts.selector), abi: curatedGateAbi } as const;\n const extra = opts.extra ?? deriveExtra(opts.operator);\n\n // Snapshot the original tree so we can restore it after creating the operator.\n const origRoot = await ctx.client.readContract({ ...gate, functionName: 'treeRoot' });\n const origCid = await ctx.client.readContract({ ...gate, functionName: 'treeCid' });\n const admin = await roleMember(ctx, gate, DEFAULT_ADMIN_ROLE);\n\n // N=2 OZ ['address'] tree; prove by value (OZ sorts leaves, so index is unreliable).\n const tree = buildAddressesTree([opts.operator, extra]);\n const tmpRoot = tree.root as Hex;\n const proof = tree.getProof([opts.operator]) as Hex[];\n const tmpCid = `tmp-cid-${opts.operator.toLowerCase()}`;\n\n // Install the temp tree as the gate admin (grant SET_TREE_ROLE, resume if paused, set).\n await actAs(ctx, admin, async (from) => {\n await ctx.client.writeContract({\n ...gate,\n functionName: 'grantRole',\n args: [SET_TREE_ROLE, admin],\n account: from,\n chain: null,\n });\n const paused = await ctx.client.readContract({ ...gate, functionName: 'isPaused' });\n if (paused) {\n await ctx.client.writeContract({\n ...gate,\n functionName: 'grantRole',\n args: [RESUME_ROLE, admin],\n account: from,\n chain: null,\n });\n await ctx.client.writeContract({\n ...gate,\n functionName: 'resume',\n account: from,\n chain: null,\n });\n }\n await ctx.client.writeContract({\n ...gate,\n functionName: 'setTreeParams',\n args: [tmpRoot, tmpCid],\n account: from,\n chain: null,\n });\n });\n\n // Capture the returned noId via simulate, then send the real tx as the operator.\n // The restore runs in `finally` so a failed create never leaves the gate with the\n // temporary tree installed on the fork (matching actAs's stop-on-any-exit discipline).\n try {\n const { result, request } = await ctx.client.simulateContract({\n ...gate,\n functionName: 'createNodeOperator',\n args: [\n opts.name ?? 'fork-operator',\n opts.description ?? 'fork-test',\n zeroAddress,\n zeroAddress,\n proof,\n ],\n account: opts.operator,\n });\n const noId = result as bigint;\n await actAs(ctx, opts.operator, () => ctx.client.writeContract({ ...request, chain: null }));\n return { noId };\n } finally {\n await actAs(ctx, admin, (from) =>\n ctx.client.writeContract({\n ...gate,\n functionName: 'setTreeParams',\n args: [origRoot, origCid],\n account: from,\n chain: null,\n }),\n );\n }\n}\n\nexport interface CreateOperatorGroupOptions {\n /** [nodeOperatorId, shareBps] pairs; shares in basis points (e.g. 6000 = 60%), must sum to 10000. */\n pairs: [bigint, bigint][];\n /** Optional group name (Solidity leaves it ''); default ''. */\n name?: string;\n}\n\nexport interface CreateOperatorGroupResult {\n /** The sub-node-operators written into the NO_GROUP_ID group, in input order. */\n subNodeOperators: { nodeOperatorId: bigint; share: number }[];\n /** Group ids reset to EMPTY_GROUP first (operators previously in a group), de-duplicated. */\n resetGroupIds: bigint[];\n}\n\n/**\n * Create a node-operator group on the MetaRegistry: reset any pre-existing memberships of the\n * named operators, then write a fresh group under `NO_GROUP_ID`. Port of\n * `MetaRegistryHelpers.createOperatorGroup` (the `MANAGE_OPERATOR_GROUPS_ROLE` member acts).\n */\nexport async function createOperatorGroup(\n ctx: Ctx,\n opts: CreateOperatorGroupOptions,\n): Promise<CreateOperatorGroupResult> {\n if (ctx.module !== 'cm') {\n throw new Error('@sm-lab/recipes/cm: createOperatorGroup requires ctx.module === \"cm\"');\n }\n // Validate input BEFORE any chain call — a precise error beats an opaque on-chain revert.\n if (opts.pairs.length < 1)\n throw new Error('@sm-lab/recipes/cm: createOperatorGroup needs ≥1 [noId, shareBps] pair');\n const shareSum = opts.pairs.reduce((acc, [, s]) => acc + s, 0n);\n if (shareSum !== 10000n)\n throw new Error(`@sm-lab/recipes/cm: shares must sum to 10000 bps (got ${shareSum})`);\n\n const mr = {\n address: (ctx.addresses as CmAddressBook).MetaRegistry as Hex,\n abi: metaRegistryAbi,\n } as const;\n const role = (await ctx.client.readContract({\n ...mr,\n functionName: 'MANAGE_OPERATOR_GROUPS_ROLE',\n })) as Hex;\n const manager = await roleMember(ctx, mr, role);\n\n const noGroupId = (await ctx.client.readContract({\n ...mr,\n functionName: 'NO_GROUP_ID',\n })) as bigint;\n\n // Resolve current memberships up front (parallel reads — order-independent), then de-dup the gids\n // to reset (a harmless divergence from Solidity's per-pair reset, which can double-reset an\n // already-emptied gid). A Set preserves insertion order, so resetGroupIds stays deterministic in\n // first-encounter order.\n const gids = (await Promise.all(\n opts.pairs.map(([noId]) =>\n ctx.client.readContract({ ...mr, functionName: 'getNodeOperatorGroupId', args: [noId] }),\n ),\n )) as bigint[];\n const toReset = new Set<bigint>();\n for (const gid of gids) {\n if (gid !== noGroupId) toReset.add(gid);\n }\n const resetGroupIds = [...toReset];\n\n const subNodeOperators = opts.pairs.map(([noId, share]) => ({\n nodeOperatorId: noId, // bigint (uint64)\n share: Number(share), // number (uint16)\n }));\n const group = { name: opts.name ?? '', subNodeOperators, externalOperators: [] };\n\n await actAs(ctx, manager, async (from) => {\n for (const gid of resetGroupIds) {\n // eslint-disable-next-line no-await-in-loop -- sequential by necessity (impersonation is global state)\n await ctx.client.writeContract({\n ...mr,\n functionName: 'createOrUpdateOperatorGroup',\n args: [gid, EMPTY_GROUP],\n account: from,\n chain: null,\n });\n }\n await ctx.client.writeContract({\n ...mr,\n functionName: 'createOrUpdateOperatorGroup',\n args: [noGroupId, group],\n account: from,\n chain: null,\n });\n });\n\n return { subNodeOperators, resetGroupIds };\n}\n\nexport interface ResetOperatorGroupResult {\n groupId: bigint;\n}\n\n/**\n * Reset the operator group that contains `noId` to its empty state. Port of\n * `MetaRegistryHelpers.resetOperatorGroup`; throws if the operator is in no group.\n */\nexport async function resetOperatorGroup(\n ctx: Ctx,\n opts: { noId: bigint },\n): Promise<ResetOperatorGroupResult> {\n if (ctx.module !== 'cm') {\n throw new Error('@sm-lab/recipes/cm: resetOperatorGroup requires ctx.module === \"cm\"');\n }\n const mr = {\n address: (ctx.addresses as CmAddressBook).MetaRegistry as Hex,\n abi: metaRegistryAbi,\n } as const;\n const role = (await ctx.client.readContract({\n ...mr,\n functionName: 'MANAGE_OPERATOR_GROUPS_ROLE',\n })) as Hex;\n const manager = await roleMember(ctx, mr, role);\n\n const gid = (await ctx.client.readContract({\n ...mr,\n functionName: 'getNodeOperatorGroupId',\n args: [opts.noId],\n })) as bigint;\n const noGroupId = (await ctx.client.readContract({\n ...mr,\n functionName: 'NO_GROUP_ID',\n })) as bigint;\n if (gid === noGroupId) throw new Error('@sm-lab/recipes/cm: operator not in a group');\n\n await actAs(ctx, manager, (from) =>\n ctx.client.writeContract({\n ...mr,\n functionName: 'createOrUpdateOperatorGroup',\n args: [gid, EMPTY_GROUP],\n account: from,\n chain: null,\n }),\n );\n\n return { groupId: gid };\n}\n\n/**\n * Set a bond-curve weight on the MetaRegistry. Port of\n * `MetaRegistryHelpers.setBondCurveWeight` (the `SET_BOND_CURVE_WEIGHT_ROLE` member acts).\n */\nexport async function setBondCurveWeight(\n ctx: Ctx,\n opts: { curveId: bigint; weight: bigint },\n): Promise<{ curveId: bigint; weight: bigint }> {\n if (ctx.module !== 'cm') {\n throw new Error('@sm-lab/recipes/cm: setBondCurveWeight requires ctx.module === \"cm\"');\n }\n const mr = {\n address: (ctx.addresses as CmAddressBook).MetaRegistry as Hex,\n abi: metaRegistryAbi,\n } as const;\n const role = (await ctx.client.readContract({\n ...mr,\n functionName: 'SET_BOND_CURVE_WEIGHT_ROLE',\n })) as Hex;\n const setter = await roleMember(ctx, mr, role);\n\n await actAs(ctx, setter, (from) =>\n ctx.client.writeContract({\n ...mr,\n functionName: 'setBondCurveWeight',\n args: [opts.curveId, opts.weight],\n account: from,\n chain: null,\n }),\n );\n\n return { curveId: opts.curveId, weight: opts.weight };\n}\n\n/** A deterministic address distinct from `operator` (low 20 bytes of its keccak hash). */\nfunction deriveExtra(operator: Hex): Hex {\n const h = keccak256(operator); // 0x + 64 hex chars\n return `0x${h.slice(-40)}` as Hex; // low 20 bytes → a valid, distinct address\n}\n\nexport interface SeedCmOptions {\n /** cm gate selector for the 3 created operators (default 'po' = CuratedGatePO). */\n selector?: CmGateSelector | string;\n /** Deterministic seed for the operator addresses + key material. Omit → fresh random. */\n seed?: Hex;\n}\n\nexport interface SeedCmResult {\n /** The 3 created operators' noIds, in creation order (a/b/c). */\n noIds: [bigint, bigint, bigint];\n /** The operator addresses generated for the gate, parallel to `noIds`. */\n operators: [Hex, Hex, Hex];\n}\n\n/** A deterministic address from a seed + label (low 20 bytes of keccak — mirrors deriveExtra). */\nfunction deriveOperatorAddress(seed: Hex, i: number): Hex {\n const h = keccak256(concat([seed, toHex(`cm-operator-${i}`)]));\n return `0x${h.slice(-40)}` as Hex;\n}\n\n/** A deterministic key seed from a seed + label (so the 7 addKeys calls never collide on pubkeys). */\nfunction keySeed(seed: Hex, label: string): Hex {\n return keccak256(concat([seed, toHex(label)]));\n}\n\n/**\n * Seed a realistic cm fork in one call: create 3 gate operators, group them 34/33/33, then key /\n * deposit / top-up across 3 rounds (and add a final key to two of them). Port of `fork.just\n * seed-cm`. Composes already-tested recipes; uses the noIds returned by `createCuratedOperator`\n * (not hardcoded 0/1/2) so it is correct on a non-fresh fork too. Deterministic when `seed` is set.\n */\nexport async function seedCm(ctx: Ctx, opts: SeedCmOptions = {}): Promise<SeedCmResult> {\n if (ctx.module !== 'cm') {\n throw new Error('@sm-lab/recipes/cm: seedCm requires ctx.module === \"cm\"');\n }\n\n const selector = opts.selector ?? 'po';\n const seed = opts.seed ?? randomSeed();\n const operators: [Hex, Hex, Hex] = [\n deriveOperatorAddress(seed, 0),\n deriveOperatorAddress(seed, 1),\n deriveOperatorAddress(seed, 2),\n ];\n\n // Sequential by necessity: each createCuratedOperator installs/restores the gate temp tree and\n // every later step reads fork state mutated by the prior ones.\n const { noId: na } = await createCuratedOperator(ctx, { selector, operator: operators[0] });\n const { noId: nb } = await createCuratedOperator(ctx, { selector, operator: operators[1] });\n const { noId: nc } = await createCuratedOperator(ctx, { selector, operator: operators[2] });\n const noIds: [bigint, bigint, bigint] = [na, nb, nc];\n\n await createOperatorGroup(ctx, {\n pairs: [\n [na, 3400n],\n [nb, 3300n],\n [nc, 3300n],\n ],\n });\n\n // 3 add/deposit/topup rounds, mapping the source's operator indices 0/1/0 to na/nb/na. Each\n // addKeys gets a distinct per-call label (r0..r4) so na's three calls draw different key material.\n // Note: keccak256(seed) % 2^20 startIndex ranges CAN collide across seeds (birthday in 1M space),\n // but that is benign here — CSM does not dedup pubkeys (SigningKeys.sol has no uniqueness check).\n await addKeys(ctx, { noId: na, count: 4, seed: keySeed(seed, 'r0') });\n await deposit(ctx, { count: 100 });\n await topUpActiveKeys(ctx, { noId: na });\n\n await addKeys(ctx, { noId: nb, count: 5, seed: keySeed(seed, 'r1') });\n await deposit(ctx, { count: 100 });\n await topUpActiveKeys(ctx, { noId: nb });\n\n await addKeys(ctx, { noId: na, count: 6, seed: keySeed(seed, 'r2') });\n await deposit(ctx, { count: 100 });\n await topUpActiveKeys(ctx, { noId: na });\n\n // Final keys, no deposit/topup.\n await addKeys(ctx, { noId: na, count: 1, seed: keySeed(seed, 'r3') });\n await addKeys(ctx, { noId: nb, count: 1, seed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EAAE;EAAO;CAAU;AAC5B"}
|
|
@@ -7182,7 +7182,7 @@ declare const STATIC: {
|
|
|
7182
7182
|
readonly type: "function";
|
|
7183
7183
|
readonly name: "setName";
|
|
7184
7184
|
readonly inputs: readonly [{
|
|
7185
|
-
readonly name: "
|
|
7185
|
+
readonly name: "name";
|
|
7186
7186
|
readonly type: "string";
|
|
7187
7187
|
readonly internalType: "string";
|
|
7188
7188
|
}];
|
|
@@ -7885,7 +7885,7 @@ declare const STATIC: {
|
|
|
7885
7885
|
readonly type: "function";
|
|
7886
7886
|
readonly name: "setName";
|
|
7887
7887
|
readonly inputs: readonly [{
|
|
7888
|
-
readonly name: "
|
|
7888
|
+
readonly name: "name";
|
|
7889
7889
|
readonly type: "string";
|
|
7890
7890
|
readonly internalType: "string";
|
|
7891
7891
|
}];
|
|
@@ -8387,11 +8387,11 @@ declare function contract<N extends StaticName>(ctx: Ctx, name: N): {
|
|
|
8387
8387
|
};
|
|
8388
8388
|
/**
|
|
8389
8389
|
* Resolve a gate selector to an address (the `_resolve-gate-addr` port). Accepted forms:
|
|
8390
|
-
* a raw `0x…` 40-hex address (any module); for csm — `ics` →
|
|
8391
|
-
*
|
|
8392
|
-
* for cm — `po|pto|pgo|do|eeo|iodc|iodcp` or a numeric index →
|
|
8390
|
+
* a raw `0x…` 40-hex address (any module); for csm — `ics` → IcsGate, `idvtc` →
|
|
8391
|
+
* IdvtcGate (v3-only; throws on pre-v3 snapshots lacking it);
|
|
8392
|
+
* for cm — `po|pto|pgo|do|eeo|iodc|iodcp` or a numeric index → the named curated gates.
|
|
8393
8393
|
*/
|
|
8394
8394
|
declare function resolveGate(ctx: Ctx, selector: string): Hex;
|
|
8395
8395
|
//#endregion
|
|
8396
8396
|
export { GateSelector as a, contract as c, makeClient as d, Ctx as i, resolveGate as l, ConnectOptions as n, ResolvedAddresses as o, CsmGateSelector as r, connect as s, CmGateSelector as t, RecipeClient as u };
|
|
8397
|
-
//# sourceMappingURL=context-
|
|
8397
|
+
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