Skip to content

Instantly share code, notes, and snippets.

View rapina's full-sized avatar

HyunJin Yoo rapina

View GitHub Profile
const checkNetwork = async () => {
try {
if (window.ethereum.networkVersion !== '4') {
alert("Please connect to Rinkeby!")
}
} catch(error) {
console.log(error)
}
}
import React, {useEffect, useState} from "react";
import { ethers } from "ethers";
import './App.css';
export default function App() {
const [currentAccount, setCurrentAccount] = useState("");
const checkIfWalletIsConnected = async () => {