From f534a080462db8249ede61c2decd79a14f776eef Mon Sep 17 00:00:00 2001 From: AGMASO Date: Wed, 8 Jul 2026 21:24:52 +0200 Subject: [PATCH] fix: error stkgho migrator --- .../StkGhoMigrate/StkGhoMigrateActions.tsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/components/transactions/StkGhoMigrate/StkGhoMigrateActions.tsx b/src/components/transactions/StkGhoMigrate/StkGhoMigrateActions.tsx index 1127086c4c..8278c95e18 100644 --- a/src/components/transactions/StkGhoMigrate/StkGhoMigrateActions.tsx +++ b/src/components/transactions/StkGhoMigrate/StkGhoMigrateActions.tsx @@ -86,14 +86,26 @@ export const StkGhoMigrateActions = React.memo( const submittedTxHash = result.value; setMainTxState({ loading: true, txHash: submittedTxHash }); - // Wait for the receipt on the connected chain (works on forks too). + // Confirm the migration actually mined successfully before showing success. try { - await waitForTransactionReceipt(wagmiConfig, { + const receipt = await waitForTransactionReceipt(wagmiConfig, { hash: submittedTxHash as `0x${string}`, chainId: targetChainId, }); + if (receipt.status !== 'success') { + throw new Error('Migration transaction reverted on-chain.'); + } } catch (e) { - console.warn('waitForTransactionReceipt failed', e); + setMainTxState({ loading: false, txHash: submittedTxHash }); + setTxError({ + blocking: true, + actionBlocked: true, + rawError: e as Error, + error: {(e as Error).message}, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + txAction: 0 as any, + }); + return; } // Refresh the sGHO vault cache (new shares) and invalidate the stkGHO