Comment on page
Contract activity monitor example
Automatically send smart contract event emissions and function calls to your app database
Smart contract activity monitoring is fast and easy using the Dispatch UI. You can use it to create alerts and automations when certain events are emitted by contracts, or when certain functions are called.
In this example, we'll walk through creating a Patch that will send new
EventClaim
events & associated event data from the Galxe Space Station 3 smart contract on Polygon to a webhook URL.- Trigger: Smart contract event emissions
- Action: Send a JSON payload to a webhook URL
From anywhere in Dispatch, click the "Create" button in the top navigation bar:

This takes you to the Patch Creator.
From the "Choose a Trigger event" dropdown, select the "Smart contract events emitted" Trigger.
Click the "Set Trigger conditions" button.

Selecting a Web3 alert or automation trigger
This step will vary depending on which Trigger you selected.
For the smart contract event monitor Trigger, start by selecting the network your smart contract is on.
Time saving tip
Dispatch comes loaded with some contracts for popular tokens, NFTs, and projects.
Depending on your use case, you might be able to save some time by searching for the contract you want to monitor and see if it's already in Dispatch.

Selecting the network to monitor smart contract activity on
Click "Add a smart contract" to add the smart contract you want to get activity from.
In the Contract address field, paste the address of the contract you want to monitor.
Add a nickname for the contract.
Sometimes contracts have names that aren't easy to distinguish from others, like "TransparentProxy" or "ERC1155", so it's helpful to add a descriptive name to make your life easier later.
Press the "Find events" button:

Adding a smart contract to monitor
Select the events and/or functions you want to get alerts & data for or use to trigger workflows with by checking the boxes next to the event names.
Press the "Continue" button.

Selecting smart contract events and functions to use as automation or alert triggers
Click the Application dropdown to select where you want the smart contract events, functions & related data to go.
We'll search for "webhook":

Choose the webhook you want to receive the selected smart contract events, functions & associated data.

Optionally, you can send a test JSON payload to your selected webhook by selecting the "Send a test JSON payload" button.
Customizing the Patch name is optional; Dispatch adds a default Patch name for you to save time.
Here's you chance to double check your Trigger and Action details. If all looks right...
Press the "Turn Patch on" button.

At this point, you can either create another Patch, or press the "View Patches" button to see your newly created Patch in the Patches Overview page, and wait for events to come in 🚀
Last modified 4d ago