Skip to content

Fix createStoryline gas limit: increase to 16M for 500-step bonding curve #251

@realproject7

Description

@realproject7

Problem

createStoryline() reverts with OutOfGas. The 500-step bonding curve creation on MCV2_Bond requires ~14.4M gas, but the explicit gas limit is set to 5_000_000 (from PR #245).

Trace evidence:

  • TX 0x5fecc8... used 4,946,987 / 5,000,000 → OutOfGas
  • TX 0x8ef626... used 6,915,737 / 7,000,000 → OutOfGas
  • cast estimate on both old and new contracts: ~14.4M gas

Root cause: PR #245 added gas: BigInt(5_000_000) to fix a MetaMask gas estimation UX issue, but 5M is only ~1/3 of the actual gas needed. The old contract worked because it had no explicit gas cap — the wallet auto-estimated correctly at ~14.4M.

Fix

In src/app/create/page.tsx, change the gas parameter in the buildWriteCall:

// Before (line 120)
gas: BigInt(5_000_000),

// After
gas: BigInt(16_000_000),

16M provides safe headroom over the ~14.4M estimate. chainPlot gas at 500_000 in src/hooks/useChainPlot.ts is fine — it doesn't create a bonding curve.

Files

  • src/app/create/page.tsx — line 120: change BigInt(5_000_000) to BigInt(16_000_000)

Acceptance criteria

  • gas: BigInt(16_000_000) in createStoryline buildWriteCall
  • npm run typecheck passes

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions