Hi Hani,

The game was made for browser using Web3.js, so to access the event logs you just call getPastEvents on your contract instance.

A tip for saving on load time is to use the block you deployed your contract as the fromBlock value. Something else I wish I’d done is record the block number when situations are submitted and use that as fromBlock depending on the situation, because as is, the load time is going to continue to grow the longer the Ethereum main chain gets.

Actual code from the game is below:

You can find that on line 11392 of this file on GitHub.




Codeslinger. Melbourne based Solidity developer for hire.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store