Skip to content

[#661] Fix hardcoded Sepolia addresses in claim and status#666

Merged
realproject7 merged 1 commit intomainfrom
task/661-cli-chain-aware-addresses
Mar 31, 2026
Merged

[#661] Fix hardcoded Sepolia addresses in claim and status#666
realproject7 merged 1 commit intomainfrom
task/661-cli-chain-aware-addresses

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • claim and status commands imported MCV2_BOND_ADDRESS and STORY_FACTORY_ADDRESS directly from constants, which always resolved to Sepolia addresses — causing reverts on mainnet
  • Made storyFactory and mcv2Bond public readonly on the PlotLink client class (already resolves based on chainId)
  • Updated both commands to use client.mcv2Bond / client.storyFactory instead of hardcoded imports

Changed files

  • packages/cli/src/sdk/client.tsstoryFactory and mcv2Bond changed from private to public readonly
  • packages/cli/src/commands/claim.ts — use client.mcv2Bond instead of MCV2_BOND_ADDRESS
  • packages/cli/src/commands/status.ts — use client.mcv2Bond and client.storyFactory instead of hardcoded constants

Test plan

Fixes #661

🤖 Generated with Claude Code

claim.ts and status.ts imported MCV2_BOND_ADDRESS and
STORY_FACTORY_ADDRESS directly from constants, which always
resolved to Sepolia addresses regardless of the configured chain.

Fix: expose storyFactory and mcv2Bond as public readonly on the
PlotLink client (which already resolves them based on chainId),
and use client.mcv2Bond / client.storyFactory in both commands.

Fixes #661

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
plotlink Ignored Ignored Mar 31, 2026 8:21am

Request Review

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T2b APPROVE

Perfect +7/-7 net-zero fix:

  1. Root cause correctclaim and status imported hardcoded Sepolia constants instead of using the chain-aware client properties.
  2. Visibility change is appropriatestoryFactory and mcv2Bond promoted from private to public readonly. These are immutable after construction and already chain-resolved, so safe to expose. erc8004Registry stays private — intentional scoping.
  3. Dead imports removedMCV2_BOND_ADDRESS and STORY_FACTORY_ADDRESS no longer imported in the command files.
  4. No behavioral change beyond the fix — same code paths, just using the right addresses.

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

The change is minimal and fixes the command paths that were bypassing the client's chain-aware contract addresses. claim and status now read the active Bond and StoryFactory addresses from the PlotLink client instead of hardcoded Sepolia constants.

Findings

  • None blocking.

Decision

Approving because the implementation matches #661, keeps the fix scoped, and routes the affected commands through the existing chain-aware address resolution.

@realproject7 realproject7 merged commit 9fa117d into main Mar 31, 2026
5 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.

CLI fix: hardcoded Sepolia bond address in claim and status

2 participants