# AbiEvent.decodeLog

Extracts an [`AbiEvent.AbiEvent`](/api/AbiEvent/types#abievent) from an [`Abi.Abi`](/api/Abi/types#abi) and decodes its arguments from a Log.

## Imports

:::code-group
```ts [Named]
import { AbiEvent } from 'ox'
```

```ts [Entrypoint]
import * as AbiEvent from 'ox/AbiEvent'
```
:::

## Examples

```ts twoslash
import { Abi, AbiEvent } from 'ox'

const abi = Abi.from([
  'event Transfer(address indexed from, address indexed to, uint256 value)'
])

const decoded = AbiEvent.decodeLog(abi, {
  data: '0x0000000000000000000000000000000000000000000000000000000000000001',
  topics: [
    '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
    '0x000000000000000000000000a5cc3c03994db5b0d9a5eedd10cabab0813678ac',
    '0x000000000000000000000000a5cc3c03994db5b0d9a5eedd10cabab0813678ac'
  ]
})
// @log: {
// @log:   event: { name: 'Transfer', type: 'event', ... },
// @log:   args: {
// @log:     from: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
// @log:     to: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
// @log:     value: 1n,
// @log:   },
// @log: }
```

## Definition

```ts
function decodeLog<abi>(
  abi: abi | Abi.Abi | readonly unknown[],
  log: decodeLog.Log,
  options?: decodeLog.Options,
): decodeLog.ReturnType<decodeLog.ExtractEvent<abi>>
```

**Source:** [src/core/AbiEvent.ts](https://github.com/wevm/ox/blob/main/src/core/AbiEvent.ts#L1981)

## Parameters

### abi

* **Type:** `abi | Abi.Abi | readonly unknown[]`

The ABI to extract an event from.

### log

* **Type:** `decodeLog.Log`

`topics` & `data` to decode.

### options

* **Type:** `decodeLog.Options`
* **Optional**

Decoding options.

## Return Type

The decoded event and arguments.

`decodeLog.ReturnType<decodeLog.ExtractEvent<abi>>`
