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
const Web3 = require('web3'); | |
const web3 = new Web3('// your rpc url here'); | |
// connection to smart contract | |
const address = // your contract string | |
const abi = // your contract abi here | |
const contract = new web3.eth.contract(abi, address); // your contract instance | |
contract.getPastEvents( | |
'AllEvents', // you can send any event name like 'transfer' or something |