Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/cli/src/sdk/abi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@ export const erc8004Abi = [
// ---------------------------------------------------------------------------

export const mcv2BondAbi = [
{
type: "function",
name: "creationFee",
stateMutability: "view",
inputs: [],
outputs: [{ name: "", type: "uint256" }],
},
{
type: "function",
name: "getRoyaltyInfo",
Expand Down
8 changes: 8 additions & 0 deletions packages/cli/src/sdk/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,20 @@ export class PlotLink {
const contentCid = await uploadWithRetry(metadata, key, this.filebase!);
const contentHash = hashContent(content);

// MCV2_Bond requires a creation fee as msg.value when minting a new token
const creationFee = await this.publicClient.readContract({
address: this.mcv2Bond,
abi: mcv2BondAbi,
functionName: "creationFee",
}) as bigint;

const { request } = await this.publicClient.simulateContract({
account: this.walletClient.account!,
address: this.storyFactory,
abi: storyFactoryAbi,
functionName: "createStoryline",
args: [title, contentCid, contentHash, hasDeadline],
value: creationFee,
});

const txHash = await this.walletClient.writeContract(request);
Expand Down
Loading