Created
June 17, 2019 00:00
-
-
Save mr-fool/69c8d2723fa052c468b2d76511c845c6 to your computer and use it in GitHub Desktop.
This file contains 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, { 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