Skip to content

feat(write): mint-pod mainnet support (--share 0-100)#25

Merged
anajuliabit merged 1 commit intomainfrom
feat/mint-pod-mainnet
May 6, 2026
Merged

feat(write): mint-pod mainnet support (--share 0-100)#25
anajuliabit merged 1 commit intomainfrom
feat/mint-pod-mainnet

Conversation

@anajuliabit
Copy link
Copy Markdown
Collaborator

Branched off main. Closes the asymmetry: mainnet `mint-pod` was returning `NETWORK_NOT_SUPPORTED`. Now it's the canonical production flow.

Summary

`mint-pod` branches on network:

Network Function Required flag Fee
mainnet `mintPod(to, emissionSharePercent)` `--share <0-100>` `publishingFee()` in REPPO
testnet `mintPodWithREPPO` / `mintPodWithPrimaryToken``(to, datanetId)` `--datanet ` implicit in mint, no separate fee

Both have optional `--to ` (defaults to caller) and the standard `--idempotency-key` / `--dry-run` flags.

Why this matters

Per the Reppo team (Slack confirmation): testnet was forked from mainnet and had subnet/datanet logic added for a client experiment. Mainnet is canonical production, not a "V1 to be deprecated." The previous comment framing throughout the codebase ("V1/V2 split") was misleading. This PR fixes the framing in the same change.

New error codes

Code When
`MISSING_SHARE` mainnet, no `--share`
`INVALID_SHARE` not an integer 0-100
`INSUFFICIENT_REPPO_BALANCE` mainnet, balance < publishingFee
`INSUFFICIENT_ALLOWANCE` mainnet, allowance to PodManager < publishingFee
`MISSING_DATANET` testnet, no `--datanet`

Pre-existing testnet codes preserved: `INVALID_DATANET_ID`, `INVALID_TOKEN`, `DATANET_NOT_FOUND`.

Comment + doc cleanup (V1/V2 → mainnet/testnet param-variant)

The "V1/V2 PodManager split" labeling implied one was being deprecated. Renamed throughout:

  • `CLAUDE.md` (project-shape comment + bug-surface bullet + reference)
  • `src/chain/abis.ts` (top-of-file comment)
  • `src/chain/contracts.ts` (top-of-file comment)
  • `src/commands/query/pod.ts` (header)
  • `src/commands/claim-emissions.ts` (inline note)
  • `src/chain/contracts.test.ts` (test names)
  • `.claude/agents/abi-pairing-reviewer.md` (description + bug class 1)
  • `.claude/skills/command-scaffold/SKILL.md` (common traps section)

Test plan (local)

  • `npm run lint` exits 0
  • `npm run typecheck` exits 0
  • `npm test` — 90/90 passing (88 prior + 2 new mint-pod tests for MISSING_SHARE / INVALID_SHARE / MISSING_DATANET)
  • `npm run build` emits `dist/commands/mint-pod.js`
  • mainnet, no `--share` → `MISSING_SHARE`
  • mainnet, `--share 150` → `INVALID_SHARE`
  • testnet, no `--datanet` → `MISSING_DATANET`

End-to-end mainnet mint requires a funded EOA on Base mainnet — covered by the integration harness (PR #8) once that's unblocked.

Status update on #5

9 → 10 commands fully implemented (mainnet + testnet). Remaining 3 blocked: `create-datanet`, `register-agent` (need platform API spec), `query emissions-due` (needs pod enumeration), `swap` (deferred-by-scope).

🤖 Generated with Claude Code

Closes the testnet/mainnet asymmetry — mainnet mint-pod was previously
returning NETWORK_NOT_SUPPORTED. The mainnet flow is canonical
production, not a "V1 to be deprecated" — testnet was forked from
mainnet and had subnet/datanet logic added for a client experiment
(per the Reppo team).

mint-pod now branches on network:
  - mainnet: mintPod(to, emissionSharePercent) — pays publishingFee in REPPO.
    Required: --share <0-100>. Pre-flight checks publishingFee, balance,
    allowance.
  - testnet: mintPodWithREPPO(to, subnetId) (or mintPodWithPrimaryToken
    via --token primary). Required: --datanet <id>. Pre-flight: validSubnet.

New error codes (mainnet path):
  MISSING_SHARE, INVALID_SHARE, INSUFFICIENT_REPPO_BALANCE,
  INSUFFICIENT_ALLOWANCE.
New error codes (testnet path):
  MISSING_DATANET (was rejected by clipanion as "required" before;
  now optional at clipanion level, validated in execute()).

Comment + doc cleanup (the "V1/V2 split" framing was misleading —
implies one is older/being-deprecated, but they're both current
deployments with different params):
  - CLAUDE.md, src/chain/abis.ts, src/chain/contracts.ts,
    src/commands/query/pod.ts, src/commands/claim-emissions.ts,
    src/chain/contracts.test.ts: rename "V1/V2" → "mainnet vs testnet
    param-variant" with one-line context.
  - .claude/agents/abi-pairing-reviewer.md,
    .claude/skills/command-scaffold/SKILL.md: same rename.

Test updates:
  - src/__tests__/command-error-paths.test.ts: replace the
    NETWORK_NOT_SUPPORTED test with MISSING_SHARE + INVALID_SHARE +
    MISSING_DATANET (mainnet/testnet param-variant validation).

Smoke-tested locally:
  - mainnet, no --share → MISSING_SHARE
  - mainnet, --share 150 → INVALID_SHARE
  - testnet, no --datanet → MISSING_DATANET

Pipeline: lint, typecheck, test (90/90), build all green.
@anajuliabit anajuliabit merged commit 8d94e24 into main May 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant