Problem
StellarWalletContext connects Freighter and stores the public key, but it never checks which Stellar network Freighter is currently set to. If a user has Freighter pointing at Mainnet (PUBLIC) while the app is configured for TESTNET, any deposit or unlock transaction will be built against the wrong network passphrase and either fail with a cryptographic error or — worse — be silently routed to the wrong network.
Expected Behaviour
After a successful Freighter connection (and on every subsequent page focus), the app reads Freighter's active network and compares it against NEXT_PUBLIC_STELLAR_NETWORK. If they differ, a persistent dismissible banner warns the user and all contract-interaction buttons (Deposit, Unlock, Boost) are disabled until the user switches networks inside Freighter.
Acceptance Criteria
Relevant Files
src/context/StellarWalletContext.tsx — add networkName, isNetworkMismatch
src/components/AppShell/AppShell.tsx — render NetworkMismatchBanner
src/app/farm/page.tsx — consume isNetworkMismatch to gate buttons
src/config/index.ts — stellarNetwork for comparison
Problem
StellarWalletContextconnects Freighter and stores the public key, but it never checks which Stellar network Freighter is currently set to. If a user has Freighter pointing at Mainnet (PUBLIC) while the app is configured for TESTNET, any deposit or unlock transaction will be built against the wrong network passphrase and either fail with a cryptographic error or — worse — be silently routed to the wrong network.Expected Behaviour
After a successful Freighter connection (and on every subsequent page focus), the app reads Freighter's active network and compares it against
NEXT_PUBLIC_STELLAR_NETWORK. If they differ, a persistent dismissible banner warns the user and all contract-interaction buttons (Deposit,Unlock,Boost) are disabled until the user switches networks inside Freighter.Acceptance Criteria
StellarWalletContextcallsfreighter.getNetworkDetails()immediately aftergetAddress()succeeds and stores the result asnetworkName: string | nullisNetworkMismatch: booleanis derived and exposed from the context:truewhennetworkName !== NEXT_PUBLIC_STELLAR_NETWORKNetworkMismatchBannercomponent renders a sticky top alert (ChakraAlert status='warning') with the message "Freighter is set to {networkName}. Switch to {expected} to use SmartDrop."document.addEventListener('visibilitychange', ...)re-checks the Freighter network when the tab regains focus so if the user switches network in Freighter and returns, the banner clears automatically within 1 secondisNetworkMismatchfrom context and pass it into theirdisabledpropfreighter.getNetworkDetailsreturning a mismatched network and asserts the banner text is visible and action buttons are disabledRelevant Files
src/context/StellarWalletContext.tsx— addnetworkName,isNetworkMismatchsrc/components/AppShell/AppShell.tsx— renderNetworkMismatchBannersrc/app/farm/page.tsx— consumeisNetworkMismatchto gate buttonssrc/config/index.ts—stellarNetworkfor comparison