Open
Conversation
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).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Note
Improves staking stability on Base and ensures the UI reflects on-chain updates promptly.
approve(100k) anddeposit/withdraw/claim(500k) inhooks/useStakingContractInteractions.tsto avoid gas estimation issuesrefreshStakingDataRefflag with a ref torefreshStakingEntriesinapp/builders/[slug]/page.tsx, invoking refresh 3 times fromonTxSuccessto reliably update the staking tableWritten by Cursor Bugbot for commit fb0ce95. This will update automatically on new commits. Configure here.