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

# AbiConstructor.decode

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

ABI-decodes the provided constructor input (`inputs`).

## Imports

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

## Examples

```ts twoslash
// @noErrors
import { AbiConstructor } from 'viem/utils'

const constructor = AbiConstructor.from(
  'constructor(address, uint256)'
)

const bytecode = '0x...'

const data = AbiConstructor.encode(constructor, {
  bytecode,
  args: ['0xd8da6bf26964af9d7eed9e03e53415d37aa96045', 123n]
})

const decoded = AbiConstructor.decode(constructor, {
  // [!code focus]
  bytecode, // [!code focus]
  data // [!code focus]
}) // [!code focus]
```

### ABI-shorthand

You can also specify an entire ABI object as a parameter to `AbiConstructor.decode`.

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

const abi = Abi.from([...])

const data = AbiConstructor.encode(abi, {
  bytecode: '0x...',
  args: ['0xd8da6bf26964af9d7eed9e03e53415d37aa96045', 123n],
})

const decoded = AbiConstructor.decode(abi, { // [!code focus]
  bytecode: '0x...', // [!code focus]
  data, // [!code focus]
}) // [!code focus]
```

## Definition

```ts
function decode<abi, abiConstructor>(
  abi: abi | Abi.Abi | readonly unknown[],
  options: decode.Options,
): decode.ReturnType<abiConstructor>
```

## Parameters

### abi

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

### options

* **Type:** `decode.Options`

Decoding options.

## Return Type

The decoded constructor inputs.

`decode.ReturnType<abiConstructor>`
