[#244] Fix MetaMask gas estimation for createStoryline and chainPlot#245
Merged
realproject7 merged 1 commit intomainfrom Mar 17, 2026
Merged
[#244] Fix MetaMask gas estimation for createStoryline and chainPlot#245realproject7 merged 1 commit intomainfrom
realproject7 merged 1 commit intomainfrom
Conversation
- 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) <noreply@anthropic.com>
project7-interns
approved these changes
Mar 17, 2026
Collaborator
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The shared WriteCall type now supports an optional gas override, and both createStoryline and chainPlot supply explicit gas limits that are forwarded through writeContractAsync.
Findings
- None. The gas override wiring is consistent with the existing write flow and covers both paths called out in issue #244.
Decision
Approving because the transaction requests now carry explicit gas limits for the two affected StoryFactory writes. CI was still pending at the time of review.
project7-interns
approved these changes
Mar 17, 2026
Collaborator
project7-interns
left a comment
There was a problem hiding this comment.
APPROVE
Reviewed the full diff, usePublish.ts pass-through mechanism, and existing gas patterns in DonateWidget (150K) and TradingWidget (2M).
gas?: bigintonWriteCallis correctly optional and type-safe — no breaking changes to existing callers- Pass-through works:
usePublishpasses thewriteCallobject directly to wagmi'swriteContractAsync, which acceptsgasas a top-level property - Gas values are reasonable: 5M for
createStoryline(factory + bonding curve token deployment), 500K forchainPlot(lighter storage write) - Follows established codebase patterns; unused gas is refunded so generous limits are safe
Minor note (non-blocking): RatingWidget may also benefit from an explicit gas limit if it hits the same estimation issue.
2 tasks
realproject7
added a commit
that referenced
this pull request
Mar 17, 2026
500-step bonding curve creation requires ~14.4M gas. The 5M limit from PR #245 caused OutOfGas reverts. 16M provides safe headroom. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
realproject7
added a commit
that referenced
this pull request
Mar 22, 2026
#245: Rewrite lib/zap.ts for ZapPlotLinkV2 multi-token ABI: - New ABI: mint(fromToken, storylineToken, ...), mintReverse(...), estimateMint(...), estimateMintReverse(...) - getZapQuote calls contract estimates via simulateContract (non-view) - buildZapMintTx handles ETH (payable) vs ERC-20 (approval) paths - Removed V4 Quoter calls — contract handles full path internally - 3% slippage buffer on bonding curve execution Update constants.ts: - ZAP_PLOTLINK mainnet: 0xEF6a8640c836b16Eb8cCD8016Ead4C8517aC3033 - Added USDC, HUNT, ETH_ADDRESS constants - Added SUPPORTED_ZAP_TOKENS list for frontend selector #244: Multi-token selector on TradingWidget buy tab: - 4 options: ETH, USDC, HUNT, PLOT (default: ETH) - ETH: payable zap tx, no approval, balance via useBalance - USDC/HUNT: approve to ZAP_PLOTLINK → zap tx, balance via balanceOf - PLOT: existing direct MCV2_Bond.mint flow unchanged - USDC handled as 6 decimals for balance display - Sell tab: unchanged - Trade indexing fires for all modes - isZapAvailable hides selector when zap address is zero Fixes #244, Fixes #245 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8 tasks
realproject7
added a commit
that referenced
this pull request
Mar 22, 2026
…2 ABI Set testnet ZAP_PLOTLINK to zero address until a V2 contract is deployed to Base Sepolia. This prevents the V2 frontend from calling V2 ABI functions against the old V1 Sepolia deployment. The isZapAvailable check in TradingWidget already hides the token selector when ZAP_PLOTLINK is zero, so testnet users fall back to direct PLOT mode only. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gas?: biginttoWriteCallinterface inusePublish.tscreateStoryline: explicit gas limit of 5M (deploys 500-step bonding curve token via MCV2_Bond)chainPlot: explicit gas limit of 500K (lighter write operation)Test plan
Fixes #244
🤖 Generated with Claude Code