0

I have a contract with the following event (using 0.4.24):

event UpdateProgress(bool _gameInProgress);

I am registering the contract like this:

import Web3 from 'web3';
import address from './address';

const web3 = new Web3(window.web3.currentProvider);
const abi = [{...}}


// Access to our contract that exists on the blockchain.
export default new web3.eth.Contract(abi, address);

When I call the events object in my JS:

// Contract
import leaderboard from './leaderboard';


console.log(leaderboard.events.allEvents());

All events is empty. What am I doing incorrect here?

0

Please find documentation on it.

There is pretty good example how to use it. E.g:

var events = leaderboard.allEvents({fromBlock: 0, toBlock: 'latest'});
events.get(function(error, logs){ /* handle events here... */ });
  • Appreciate the comment. Not fully the issue though. ABI issues. – Tulun Nov 20 '18 at 23:25
0

Just need to update my ABI. Figured this out ages ago. Derp.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.