> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# getCreate2Address

```ts theme={null}
function getCreate2Address(
   _from, 
   _salt, 
   _initCodeHash): string
```

Returns the address that would result from a `CREATE2` operation with the given `from`, `salt` and `initCodeHash`.

To compute the `initCodeHash` from a contract's init code, use the [**keccak256**](https://docs.qu.ai/sdk/content/functions/keccak256.md) function.

For a quick overview and example of `CREATE2`, see [Wisps: The Magical World of
Create2](https://blog.ricmoo.com/wisps-the-magical-world-of-create2-5c2177027604).

## Parameters

| Parameter | Type | Description |
| :- | :- | :- |
| `_from` | `string` | The address of the sender. |
| `_salt` | [`BytesLike`](https://docs.qu.ai/sdk/content/type-aliases/BytesLike) | The salt value. |
| `_initCodeHash` | [`BytesLike`](https://docs.qu.ai/sdk/content/type-aliases/BytesLike) | The hash of the init code. |

## Returns

`string`

The computed address.

## Example

```js theme={null}
// The address of the contract
from = '0x8ba1f109551bD432803012645Ac136ddd64DBA72';

// The salt
salt = id('HelloWorld');

// The hash of the initCode
initCode = '0x6394198df16000526103ff60206004601c335afa6040516060f3';
initCodeHash = keccak256(initCode);

getCreate2Address(from, salt, initCodeHash);
```

## Throws

If the salt is not exactly 32 bytes long.

## Throws

If the initCodeHash is not exactly 32 bytes long.

## Source

[address/contract-address.ts:79](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/address/contract-address.ts#L79)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.