Skip to content

Instantly share code, notes, and snippets.

@0xAshish
Created Jul 20, 2019
Embed
What would you like to do?
var Dagger = require("eth-dagger");
var Web3 = require("web3");
var contractJSON = require("./../contracts/SocialBet.json");
let MaticWETHContract =require("./MaticWETHContract.json");
var web3 = new Web3("https://testnet2.matic.network");
var dagger = new Dagger("wss://matic.dagger2.matic.network"); // dagger server
const MaticWETHAddress = '0x31074c34a757a4b9FC45169C58068F43B717b2D0';
const web3MaticWETHContract = new web3.eth.Contract(MaticWETHContract.abi, MaticWETHAddress);
const contract = dagger.contract(web3MaticWETHContract);
var transfer = contract.events.Transfer({ room: "confirmed" });
transfer.watch(function(data, removed) {
// do something
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment