View Source Hyperliquid.Api.Exchange.FinalizeEvmContract (hyperliquid v0.3.0)
Link a HyperCore token to its deployed HyperEVM contract.
The verification method must match how the contract was deployed:
finalize_with_create/3— contract deployed from an EOA; the EVM user signs with the nonce used for the deploymentfinalize_with_first_storage_slot/2— the finalizer address is stored at the contract's first storage slotfinalize_with_custom_storage_slot/2— the finalizer address is stored at slotkeccak256("HyperCore deployer")
See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/hyperevm/interacting-with-hypercore
Usage
{:ok, result} = FinalizeEvmContract.finalize_with_create(42, 7)
Summary
Functions
Finalize a contract deployed from an EOA using its deployment nonce.
Finalize a contract that stores the finalizer address at
keccak256("HyperCore deployer").
Finalize a contract that stores the finalizer address in its first storage slot.
Functions
@spec finalize_with_create(non_neg_integer(), non_neg_integer(), keyword()) :: {:ok, map()} | {:error, term()}
Finalize a contract deployed from an EOA using its deployment nonce.
Parameters
token: Token identifier to linkdeploy_nonce: Nonce used to deploy the EVM contractopts: Optional parameters
Returns
{:ok, response}/{:error, term()}
Examples
{:ok, result} = FinalizeEvmContract.finalize_with_create(42, 7)
@spec finalize_with_custom_storage_slot( non_neg_integer(), keyword() ) :: {:ok, map()} | {:error, term()}
Finalize a contract that stores the finalizer address at
keccak256("HyperCore deployer").
Parameters
token: Token identifier to linkopts: Optional parameters
Returns
{:ok, response}/{:error, term()}
@spec finalize_with_first_storage_slot( non_neg_integer(), keyword() ) :: {:ok, map()} | {:error, term()}
Finalize a contract that stores the finalizer address in its first storage slot.
Parameters
token: Token identifier to linkopts: Optional parameters
Returns
{:ok, response}/{:error, term()}