0

I've developed a faucet for testnet: https://tezos-testnet-faucet.netlify.app, using Taquito and Beacon Wallet.

And I have a strange, and dangerous, behaviour with it. I tested only with Temple wallet, but maybe it can be reproduced with other wallets.

The scenario:

  1. Go to faucet at https://tezos-testnet-faucet.netlify.app/ and connect wallet. In the code, I explicitely connect wallet to Ithacanet.

  2. Click on "Send 1 xtz to faucet". The Temple popup displays the tx details, it'on Ithacanet.

  3. Go to a mainnet dapp on another browser tab, (for example https://mooncakes.fun) and connect wallet. It will be connected to mainnet.

  4. Go back to faucet tab and click "Send 1 xtz to faucet" again. Now be careful, tx is going to be on mainnet as displayed on Temple popup. (And I tried to be sure, I effectively sent 1 xtz on mainnet).

It seems that the mainnet connection has impacted my Ithacanet connection, although they are on different tabs.

How can I check that my wallet is still on testnet when creating my transaction? Or how can I be sure that my instance of BeaconWallet will not be impacted by other browser tabs connection ?

How I create my wallet:

const wallet = new BeaconWallet({
name: "application name,
preferredNetwork: NetworkType.ITHACANET,
disableDefaultEvents: false,
eventHandlers: {
    [BeaconEvent.PAIR_INIT]: {
        handler: defaultEventCallbacks.PAIR_INIT
    },
    [BeaconEvent.PAIR_SUCCESS]: {
        handler: data => console.log(data.publicKey)
    }
}
});

How I connect:

tezos.wallet.requestPermissions({
network: {
    type: NetworkType.ITHACANET,
    rpcUrl: "https://ithacanet.smartpy.io"
}
});

Thanks.

PS: I created my faucet account with a ithacanet account got from https://teztnets.xyz/. When I use the same seed phrase on mainnet, I don't get the same account. So I sacrified 1 xtz to test the scenario above, and I'm not able to take control of the faucet account on mainnet to get it back.

So if some people have the same problem, I won't be able to send their xtz back either.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.