Skip to content

Commit

Permalink
Third3 Deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Ratnesh4193 committed Oct 29, 2023
1 parent dd2223a commit ab0258a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
};
Expand Down
1 change: 0 additions & 1 deletion src/ethereum/factory.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion src/ethereum/web3.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down

0 comments on commit ab0258a

Please sign in to comment.