Skip to content

jummy123/contract-event-listener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example contract event listener

A sample contract and brownie script to listen for events emitted by a contract.

The two parts to this repo are the example contract which contains a single function which emits an event and the pyton listener script which deploys the contracts and simulates some transactions being sent to it, it also includes a simple listener for printing the events it listens to.

Setup

Intall the python dependencies with pip pip install -r requirements.txt (it is recommended to use a virtual environment for this).

For my testing I also used the hardhat network which can be install with npm npm install hardhat.

Running

To run the script and see the messages printed to the console use

brownie run scripts/listener.py --network hardhat.

Questions

You can ask me questions in the Avax build guild #dev channel, my handle is jumbo.

About

An example of how to listen to a contracts events

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published