Links

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.

Step 1: Select the Trigger

From the "Choose a Trigger event" dropdown, select the "Smart contract events emitted" Trigger.
Click the "Set Trigger conditions" button.
Using Esprezzo Dispatch web app to select an automation or alert trigger event
Selecting a Web3 alert or automation trigger

Step 2: Set the Trigger conditions

This step will vary depending on which Trigger you selected.

Choose the network

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.
Using the Esprezzo Dispatch web app to select a blockchain network to monitor smart contract activity on
Selecting the network to monitor smart contract activity on

Add a new contract

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 events and functions 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.
Using the Esprezzo Dispatch web app to select smart contract events and functions to use as triggers for automation or alerts
Selecting smart contract events and functions to use as automation or alert triggers

Step 3: Select the Action

Click the Application dropdown to select where you want the smart contract events, functions & related data to go.
We'll search for "webhook":

Step 4: Set the Action details

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.
Note: You can test all Actions except for Dispatch Monitor, which logs events directly in Dispatch.

Step 5 (optional): Confirm Patch name

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 🚀