# AbiConstructor.decode

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

## Imports

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

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

## Examples

```ts twoslash
import { AbiConstructor } from 'ox'

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

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

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

## Parameters

### abi

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

### options

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

Decoding options.

## Return Type

The decoded constructor inputs.

`decode.ReturnType<abiConstructor>`
