> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# AbiEvent.decodeLog

:::info
`AbiEvent.decodeLog` is a re-export of ox's [`AbiEvent.decodeLog`](https://oxlib.sh/api/AbiEvent/decodeLog). Refer to the ox documentation for the full reference.
:::

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

## Imports

```ts
import { AbiEvent } from 'viem/utils'
```

## Examples

```ts twoslash
// @noErrors
import { Abi, AbiEvent } from 'viem/utils'

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

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