From ab0258a52db314d7ee4044526f6876f3b0f12d94 Mon Sep 17 00:00:00 2001 From: Ratnesh Date: Mon, 30 Oct 2023 01:19:32 +0530 Subject: [PATCH] Third3 Deployment --- src/components/Header.js | 3 +++ src/ethereum/factory.js | 1 - src/ethereum/web3.js | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Header.js b/src/components/Header.js index e972903..40ddf37 100644 --- a/src/components/Header.js +++ b/src/components/Header.js @@ -8,8 +8,11 @@ const Header = () => { const [userInfo, setUserInfo] = useState(""); useEffect(() => { const loadData = async () => { + console.log("Header.js window.web3", window.web3); if (window.web3 != undefined) { const accounts = await web3.eth.getAccounts(); + console.log("Header.js accounts", accounts); + setUserInfo(accounts[0]); } }; diff --git a/src/ethereum/factory.js b/src/ethereum/factory.js index f40cc58..410ec7a 100644 --- a/src/ethereum/factory.js +++ b/src/ethereum/factory.js @@ -1,6 +1,5 @@ import web3 from "./web3"; import ProjectFactory from "./build/ProjectFactory.json"; -console.log("FACTORY.JS Window.web3", window.web3); const instance = new web3.eth.Contract( ProjectFactory.abi, process.env.REACT_APP_DEPLOYED_FACTORY_ADDRESS diff --git a/src/ethereum/web3.js b/src/ethereum/web3.js index 63c548f..465617e 100644 --- a/src/ethereum/web3.js +++ b/src/ethereum/web3.js @@ -1,6 +1,5 @@ import Web3 from "web3"; let web3; -console.log("WEB3.JS window.web3", window.web3); if (window.web3 !== undefined) { web3 = new Web3(window.web3.currentProvider); } else {