# ContractAddress.from

Computes Contract Address generated by the [CREATE](https://ethereum.stackexchange.com/questions/68943/create-opcode-what-does-it-really-do/68945#68945) or [CREATE2](https://eips.ethereum.org/EIPS/eip-1014) opcode.

## Imports

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

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

## Examples

### CREATE

Computes via the [CREATE](https://ethereum.stackexchange.com/questions/68943/create-opcode-what-does-it-really-do/68945#68945) opcode. Shorthand for [`ContractAddress.fromCreate`](/api/ContractAddress/fromCreate).

```ts twoslash
import { ContractAddress } from 'ox'
ContractAddress.from({
  from: '0x1a1e021a302c237453d3d45c7b82b19ceeb7e2e6',
  nonce: 0n
})
// @log: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2'
```

### CREATE2

Computes via the [CREATE2](https://eips.ethereum.org/EIPS/eip-1014) opcode. Shorthand for [`ContractAddress.fromCreate2`](/api/ContractAddress/fromCreate2).

```ts twoslash
import { ContractAddress, Hex } from 'ox'
ContractAddress.from({
  from: '0x1a1e021a302c237453d3d45c7b82b19ceeb7e2e6',
  bytecode:
    '0x6394198df16000526103ff60206004601c335afa6040516060f3',
  salt: Hex.fromString('hello world')
})
// @log: '0x59fbB593ABe27Cb193b6ee5C5DC7bbde312290aB'
```

## Definition

```ts
function from(
  options: from.Options,
): Address.Address
```

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

## Parameters

### options

* **Type:** `from.Options`

Options.

#### options.bytecode

* **Type:** `0x${string} | Uint8Array`

#### options.bytecodeHash

* **Type:** `0x${string} | Uint8Array`

#### options.from

* **Type:** `abitype_Address`

#### options.nonce

* **Type:** `bigint`

The nonce of the transaction which deployed the contract.

#### options.salt

* **Type:** `0x${string} | Uint8Array`

## Return Type

Contract Address.

`Address.Address`
