Skip to content

Instantly share code, notes, and snippets.

@MichalZalecki
Created April 8, 2018 15:48
Show Gist options
  • Save MichalZalecki/be03c3b9b9a12bc0402ce7eac32688d9 to your computer and use it in GitHub Desktop.
Save MichalZalecki/be03c3b9b9a12bc0402ce7eac32688d9 to your computer and use it in GitHub Desktop.
MetaMask and web3 1.0
import Web3 from "web3";
const web3 = new Web3(Web3.givenProvider);
const web3Events = new Web3(new Web3.providers.WebsocketProvider("wss://mainnet.infura.io/ws"));
const Contract = new web3.eth.Contract(ABI, ADDRESS);
const ContractEvents = new web3Events.eth.Contract(ABI, ADDRESS);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment