0

The ethers.js documentation suggests here that dapps automatically refresh the page whenever the network changes (e.g., gorli -> mainnet). When building a safe app using safe-apps-react-sdk and safe-apps-provider, is this handled automatically by the safe context?

When I look at the official Gnosis Safe React Apps repo I don't see any code to refresh the page on a network change. I do, however, see a few custom hooks, (e.g. the one in siwe-delegate-manager) to update the web3 provider when the sdk or safe changes, which seem to contain network data.

Can I safely ignore this warning in the ethers.js docs and follow a similar pattern to reactively change providers/signers/networks?

1 Answer 1

0

Safe Wallets are smart contract wallets, this means that your Safe wallet is only available in one chain.

If you are implementing Safe Wallet support in you Dapp, you should prevent network changes if the connected address is a Safe (you can do something like hiding the network selector).

See CowSwap Dapp as an example:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.