From 98bc7efcf0255011ba2a5c8d1c3b8002700d15d9 Mon Sep 17 00:00:00 2001 From: Cho Young-Hwi Date: Tue, 17 Mar 2026 10:01:48 +0000 Subject: [PATCH] [#244] Add explicit gas params to fix MetaMask estimation errors - Add gas?: bigint to WriteCall interface in usePublish - createStoryline: gas 5M (deploys bonding curve token) - chainPlot: gas 500K (lighter write operation) Fixes #244 Co-Authored-By: Claude Opus 4.6 (1M context) --- src/app/create/page.tsx | 1 + src/hooks/useChainPlot.ts | 1 + src/hooks/usePublish.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/src/app/create/page.tsx b/src/app/create/page.tsx index 66b251b1..3acc29de 100644 --- a/src/app/create/page.tsx +++ b/src/app/create/page.tsx @@ -117,6 +117,7 @@ export default function CreateStorylinePage() { abi: storyFactoryAbi as unknown as [], functionName: "createStoryline", args: [title.trim(), cid, contentHash, hasDeadline], + gas: BigInt(5_000_000), }), }); }} diff --git a/src/hooks/useChainPlot.ts b/src/hooks/useChainPlot.ts index de72ab4c..22f4b129 100644 --- a/src/hooks/useChainPlot.ts +++ b/src/hooks/useChainPlot.ts @@ -23,6 +23,7 @@ export function useChainPlot() { abi: storyFactoryAbi as unknown as [], functionName: "chainPlot", args: [BigInt(storylineId), title, cid, contentHash], + gas: BigInt(500_000), }), }); }, diff --git a/src/hooks/usePublish.ts b/src/hooks/usePublish.ts index 955efcdf..db788fed 100644 --- a/src/hooks/usePublish.ts +++ b/src/hooks/usePublish.ts @@ -20,6 +20,7 @@ interface WriteCall { abi: Abi; functionName: string; args: readonly unknown[]; + gas?: bigint; } interface PublishOptions {