This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const checkNetwork = async () => { | |
| try { | |
| if (window.ethereum.networkVersion !== '4') { | |
| alert("Please connect to Rinkeby!") | |
| } | |
| } catch(error) { | |
| console.log(error) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, {useEffect, useState} from "react"; | |
| import { ethers } from "ethers"; | |
| import './App.css'; | |
| export default function App() { | |
| const [currentAccount, setCurrentAccount] = useState(""); | |
| const checkIfWalletIsConnected = async () => { |