Skip to content

Instantly share code, notes, and snippets.

@mr-fool
Created June 17, 2019 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mr-fool/69c8d2723fa052c468b2d76511c845c6 to your computer and use it in GitHub Desktop.
Save mr-fool/69c8d2723fa052c468b2d76511c845c6 to your computer and use it in GitHub Desktop.
import React, { Component } from "react";
import "./App.css";
import contractData from "./voting";
import Web3 from "web3";
const web3 = new Web3(window.web3.currentProvider);
class App extends Component {
state = {
players: [],
normie: 0,
robot: 0
};
async componentDidMount() {
console.log(contractData);
//Metamask address
const accounts = window.ethereum.enable();
console.log(accounts);
const voting = new web3.eth.Contract(
contractData.abi,
contractData.address
);
}
render() {
return (
<div className = "container" >
</div>
);
}
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment