# EVM Event Emitted

EVM Event Emitted is used to trigger a midpoint whenever an on-chain event is emitted. Unlike startpoint sources, EVM Event Emitted sources can be used for existing production contracts - without contract modification.&#x20;

When configuring an EVM Event Emitted source, specify the event signature through `arguments` along with any filters to apply to indexed topics. EVM Event Emitted can be usd when creating alerts, notifications, and listeners.

**Definition**

```graphql
chainId: string # required
contractAddress: string # required
eventName: string # required
arguments: [
    {
        name: string
        datatype: string
        indexed: boolean
        value: string
    }
]
extracts: [
    {
        name: string
        from: string
    }
]
excludeLogs: [string]
```

**`chainId`: String.** The Chain ID of the chain to listen for an event from. For a complete list of Chain Ids that we currently support, take a look at [Chain IDs](/midpoint-documentation/more-reading/chain-ids.md).

**`contractAddress`: String.** The address of the contract that the event is emitted from.

**`eventName`: String.** This is name of the event that you are listening for.&#x20;

**`arguments`:** This specifies the signature of the event, and the data that is picked out from your event to be used in later tasks.

**`arguments.name`: String.** This is the name of an argument that the event emits. This is a human-readable name that you set: for clarity, it might be best to set this name to the name of the parameter you are calling.&#x20;

**`arguments.datatype`: String.** This defines the solidity datatype of the value that is emitted from the on-chain event. This datatype must match the datatype of your on-chain event exactly, in the same order as they are defined in the on-chain event.

**`arguments.indexed`: Boolean.** This determines whether or not your particular argument is indexed, or not. An indexed parameter can be further filtered by specifying the value below.

**`arguments.value`: String** This is the value of the indexed parameter. This is not necessary to define if the particular argument is or is not indexed. You only need to define a value for this argument if you only want to listen to events that emit a particular indexed value, for example, a contract address.&#x20;

**`extracts`: See** [**extracts**](/midpoint-documentation/core-concepts/midpoints/source-and-task-definitions/extracts.md)**.** Legal values:

* **`Timestamp`** Unixtime of execution.

**`excludeLogs`: See** [**exclude logs**](/midpoint-documentation/core-concepts/midpoints/source-and-task-definitions/exclude-logs.md)**.** Legal values:

* **`TaskDefinition`** The complete definition of this task at runtime.
* **`TaskOutputData`** The complete set of returned values from this task

## Returned Values

The EVM Event Emitted source returns each of the arguments listed under the `arguments` field for use in future tasks - in addition to each field specified in `extracts`.

## **Examples**

Let's say you want to listen to a particular event.

```solidity
// Sample Event
event ReturnValue(address indexed _from, int256 _value);
```

A correctly configured Evm Event Emitted source would be:

```json
{
    "evmEventEmittedSource": {
        "chainId": "1",
        "contractAddress": "0x5B39558897Bb0047803F9E498D238fB5811E6050",
        "eventName": "ReturnValue",
        "arguments": [
            {
                "name": "_from",
                "datatype": "address",
                "indexed": true,
                "value": "0xC05f817a17bC0c505E48AC9CC52b5cb556F7B296"
            },
            {
                "name": "_value",
                "datatype": "int256",
                "indexed": false
            }
        ]
    }
}
```

The above EVM Event Emitted Source would listen for events emitted from the contract `0x5B39558897Bb0047803F9E498D238fB5811E6050` on Ethereum mainnet. It will only pick out events that emit a value of `0xC05f817a17bC0c505E48AC9CC52b5cb556F7B296` for the \_from parameter.

## Tips on Using EVM Event Emitted

This section is incomplete.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.midpointapi.com/midpoint-documentation/sources/evm-event-emitted.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
