Address
getCreate2Address
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 function.
For a quick overview and example of CREATE2
, see Wisps: The Magical World of
Create2.
Parameters
Parameter | Type | Description |
---|---|---|
_from | string | The address of the sender. |
_salt | BytesLike | The salt value. |
_initCodeHash | BytesLike | The hash of the init code. |
Returns
string
The computed address.
Example
Throws
If the salt is not exactly 32 bytes long.
Throws
If the initCodeHash is not exactly 32 bytes long.