From c2b0c67be98be74ef51026059e9716963b80065f Mon Sep 17 00:00:00 2001 From: silverpill Date: Wed, 25 May 2022 22:14:15 +0000 Subject: [PATCH] Prevent subscription recipient from connecting to unverified web3 account --- src/views/Subscription.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/views/Subscription.vue b/src/views/Subscription.vue index 36451f6..bd8345b 100644 --- a/src/views/Subscription.vue +++ b/src/views/Subscription.vue @@ -130,6 +130,12 @@ async function connectWallet() { if (!signer) { return } + const walletAddress = await signer.getAddress() + if (isCurrentUser() && !ethereumAddressMatch(walletAddress, profileEthereumAddress)) { + // Recipient must use verified account + disconnectWallet() + return + } const walletChainId = await web3Provider.send("eth_chainId", []) console.info("chain ID:", walletChainId) web3Provider.provider.on("chainChanged", (chainId: string) => {