Skip to content

claude/fix-subnet-staking-fees-n9lt9#65

Open
BowTiedSwan wants to merge 2 commits intomainfrom
claude/fix-subnet-staking-fees-n9lt9
Open

claude/fix-subnet-staking-fees-n9lt9#65
BowTiedSwan wants to merge 2 commits intomainfrom
claude/fix-subnet-staking-fees-n9lt9

Conversation

@BowTiedSwan
Copy link
Copy Markdown
Contributor

@BowTiedSwan BowTiedSwan commented Jan 20, 2026

Note

Improves staking stability on Base and ensures the UI reflects on-chain updates promptly.

  • Adds explicit gas limits on Base mainnet for approve (100k) and deposit/withdraw/claim (500k) in hooks/useStakingContractInteractions.ts to avoid gas estimation issues
  • Replaces refreshStakingDataRef flag with a ref to refreshStakingEntries in app/builders/[slug]/page.tsx, invoking refresh 3 times from onTxSuccess to reliably update the staking table
  • Minor effect refactor to keep the refresh function stable without expanding dependencies

Written by Cursor Bugbot for commit fb0ce95. This will update automatically on new commits. Configure here.

When gas estimation fails on Base network (e.g., due to RPC issues or
contract state), the wallet falls back to an extremely high gas estimate,
causing unreasonably high L1 fee estimates ($400+ for a simple deposit).

This fix adds explicit gas limits for deposit, withdraw, claim, and approve
operations on Base mainnet, matching the pattern already used in
useSubnetContractInteractions.ts for subnet creation.

Gas limits:
- approve: 100,000 (simple ERC20 operation)
- deposit: 500,000
- withdraw: 500,000
- claim: 500,000
The previous implementation used a ref flag (refreshStakingDataRef) to
trigger a useEffect, but setting a ref value doesn't cause re-renders
or trigger effects. The useEffect only ran when refreshStakingEntries
changed, not when the ref flag was set.

Fix: Call refreshStakingEntries directly in onTxSuccess callback using
a ref to store the function (avoiding useMemo dependency issues).
@vercel
Copy link
Copy Markdown

vercel bot commented Jan 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
dashboard-v2 Ready Ready Preview, Comment Jan 20, 2026 9:43am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants