diff --git a/packages/cli/src/commands/claim.ts b/packages/cli/src/commands/claim.ts index 6911576a..97d79f9a 100644 --- a/packages/cli/src/commands/claim.ts +++ b/packages/cli/src/commands/claim.ts @@ -1,6 +1,6 @@ import type { Command } from "commander"; import { type Address, erc20Abi, formatUnits, isAddress } from "viem"; -import { MCV2_BOND_ADDRESS, mcv2BondAbi } from "../sdk/index.js"; +import { mcv2BondAbi } from "../sdk/index.js"; import { buildClient } from "../sdk.js"; export function registerClaim(program: Command): void { @@ -20,7 +20,7 @@ export function registerClaim(program: Command): void { // Fetch bond data (creator = beneficiary, reserve token for display) console.log("Checking royalties..."); const bond = await client.publicClient.readContract({ - address: MCV2_BOND_ADDRESS, + address: client.mcv2Bond, abi: mcv2BondAbi, functionName: "tokenBond", args: [tokenAddress], diff --git a/packages/cli/src/commands/status.ts b/packages/cli/src/commands/status.ts index 0f6a738e..a9a7b690 100644 --- a/packages/cli/src/commands/status.ts +++ b/packages/cli/src/commands/status.ts @@ -1,7 +1,7 @@ import type { Command } from "commander"; import { createClient } from "@supabase/supabase-js"; import { type Address, erc20Abi, formatUnits } from "viem"; -import { MCV2_BOND_ADDRESS, mcv2BondAbi, STORY_FACTORY_ADDRESS } from "../sdk/index.js"; +import { mcv2BondAbi } from "../sdk/index.js"; import { buildClient } from "../sdk.js"; import { loadConfig } from "../config.js"; @@ -45,7 +45,7 @@ export function registerStatus(program: Command): void { .from("storylines") .select("plot_count, last_plot_time, has_deadline, sunset, writer_type, block_timestamp") .eq("storyline_id", Number(storylineId)) - .eq("contract_address", STORY_FACTORY_ADDRESS.toLowerCase()) + .eq("contract_address", client.storyFactory.toLowerCase()) .single(); dbRow = data; } @@ -59,7 +59,7 @@ export function registerStatus(program: Command): void { let bondReserveToken: Address | null = null; try { const bond = await client.publicClient.readContract({ - address: MCV2_BOND_ADDRESS, + address: client.mcv2Bond, abi: mcv2BondAbi, functionName: "tokenBond", args: [info.tokenAddress], diff --git a/packages/cli/src/sdk/client.ts b/packages/cli/src/sdk/client.ts index 64b59b0c..224e7db5 100644 --- a/packages/cli/src/sdk/client.ts +++ b/packages/cli/src/sdk/client.ts @@ -149,8 +149,8 @@ export class PlotLink { readonly walletClient: WalletClient; readonly address: Address; - private readonly storyFactory: Address; - private readonly mcv2Bond: Address; + readonly storyFactory: Address; + readonly mcv2Bond: Address; private readonly erc8004Registry: Address; private readonly filebase: FilebaseConfig | undefined; private readonly chain: Chain;