# Contract activity monitor example

Getting specific, relevant smart contract activity to power your apps and dApps is easy and fast using the Dispatch UI.

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](https://polygonscan.com/address/0xf6d1b85af155229acd7b523601148585a1ff67c6) 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:

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2Fbwj49CIG2wgrMuUNeFzJ%2FEsprezzo%20Dispatch%20navbar.jpg?alt=media&#x26;token=348d2f08-e0b4-4a79-898b-5ecb4e7bca19" alt=""><figcaption></figcaption></figure>

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.

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FIL0SagU0Auom3ryxpUkl%2FDispatch-selecting-automation-or-alert-trigger.gif?alt=media&#x26;token=45bd4606-2922-4a7a-a741-6b13e36ab1ba" alt="Using Esprezzo Dispatch web app to select an automation or alert trigger event" width="563"><figcaption><p>Selecting a Web3 alert or automation trigger</p></figcaption></figure>

### 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.

{% hint style="info" %}
**Time saving tip**

Dispatch comes loaded with some contracts for popular tokens, NFTs, and projects.&#x20;

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.
{% endhint %}

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FhHcQEcvqJYv6b40cJdWL%2FDispatch-selecting-blockchain-network-to-monitor-activity-on.gif?alt=media&#x26;token=2bab1f89-e950-4c8e-9f06-51c16dac1fe2" alt="Using the Esprezzo Dispatch web app to select a blockchain network to monitor smart contract activity on" width="563"><figcaption><p>Selecting the network to monitor smart contract activity on</p></figcaption></figure>

#### 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:

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FSc1vD7DCwZMu7ZoVJXwT%2F3%20-%20Add%20Galxe%20Space%20Station%203%20smart%20contract%20on%20Polygon%20to%20Esprezzo%20Dispatch.gif?alt=media&#x26;token=39b53f0f-7dd4-4b33-a369-4e9c20d1f026" alt=""><figcaption><p>Adding a smart contract to monitor</p></figcaption></figure>

#### 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.

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FP5lFwQ9hmD3MuTZxhzo1%2FDispatch-selecting-smart-contract-functions-and-events-to-monitor.gif?alt=media&#x26;token=250d450b-cf1f-4348-a2fa-2f1af96fc3de" alt="Using the Esprezzo Dispatch web app to select smart contract events and functions to use as triggers for automation or alerts" width="563"><figcaption><p>Selecting smart contract events and functions to use as automation or alert triggers</p></figcaption></figure>

### 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":

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FRJFS0dqp3jGJrr2QBdCi%2F5%20-%20Select%20webhook%20as%20destination%20for%20smart%20contract%20alerts%20on%20Esprezzo%20Dispatch%20-%20Galxe%20Space%20Station%203_cropped.gif?alt=media&#x26;token=e631e25b-7887-4612-bce9-d3af7cd923fa" alt=""><figcaption></figcaption></figure>

### Step 4: Set the Action details

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

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FkeLxAGvjebfQYjyqrXMk%2F6%20-%20Select%20team%20dashboard%20webhook%20for%20smart%20contract%20alerts%20on%20Esprezzo%20Dispatch%20-%20Galxe%20Space%20Station%203.gif?alt=media&#x26;token=3001d67f-ebab-43f6-be7b-670500eb44bb" alt=""><figcaption></figcaption></figure>

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](https://dispatch.esprezzo.io/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.

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FAxQffRkBUtLjGakI7o3T%2F8%20-%20Esprezzo%20Dispatch%20webhook%20test%20turn%20on_optimized.gif?alt=media&#x26;token=cbb67bcf-1295-4d13-b735-8edaad32f04a" alt=""><figcaption></figcaption></figure>

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 🚀
