# Create Patches from smart contracts

Once you've added at least one smart contract to Dispatch, you can

1. Get real-time alerts for specific contract events and functions
2. Visualize trends in contract activity
   1. See which events and functions are being emitted or called most over time
   2. Spot spikes in activity
   3. See which addresses are interacting most with contracts

In addition to event emissions, Dispatch currently supports functions that modify a contract's state. In other words, we do NOT support alerting for functions with `stateMutability` types of `pure` or `view`.

To get alerts or visualize smart contract activity, you will need to create at least one Patch that listens for the activity you're interested in.

### 1: Navigate to the [Contracts](https://dispatch.esprezzo.io/contracts/overview) page.

Find the contract you want to get alerts, or see data visualization for.

At the right end of the row for the selected contract, click on the ••• button and select the "+ Create Patch" option.

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2F5xkg5Q0JHhqw8R50yd16%2FCreate%20alert%20or%20automation%20from%20a%20smart%20contract%20using%20Esprezzo%20Dispatch.gif?alt=media&#x26;token=6d77f2f2-23e4-42d9-b18c-27a2cbfa4372" alt=""><figcaption></figcaption></figure>

This should take you to Patch Builder, step 2: Trigger conditions.

### 2: Select the contract events and/or functions

Select the events and/or functions you want to use to trigger alerts or workflows by clicking the checkboxes next to them:

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2Fz7WrX1YLK2ElnOkP6wrN%2F4%20-%20Select%20EventClaim%20event%20from%20Galxe%20Space%20Station%203%20contract%20on%20Esprezzo%20Dispatch.gif?alt=media&#x26;token=8a58be4a-9465-4f08-af7f-5260abb31827" alt=""><figcaption></figcaption></figure>

Click the "Continue" button.

### 3: Select the Action

Select the **Action** (where you want the event & event data to go).

{% hint style="info" %}
If you're not interested in real-time alerts and just want to see charts for contract activity, select **Dispatch Monitor** as the Action in your Patches.
{% endhint %}

### 4: Set the Action details

The details will vary depending on the Action you've selected.

### 5: Test the Action (optional)

All Actions except for Dispatch Monitor provide an option for you to run a test to make sure Dispatch can deliver messages to your selected output.

[Dispatch Monitor](https://dispatch.esprezzo.io/monitor) logs events to Dispatch only.

### 6: Name the Patch (optional)

Customizing the Patch name is optional; Dispatch adds a default Patch name for you to save time.

Now's the perfect opportunity to double check your Trigger and Action details.

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

If all looks right, press the "Turn Patch on" button.
