Skip to content

Latest commit

 

History

History
102 lines (58 loc) · 2 KB

File metadata and controls

102 lines (58 loc) · 2 KB

EVMAccounts

Acala Developers

EVMAccounts Predeploy Contract

You can use this predeploy contract to call evm-accounts pallet

This contracts will interact with evm-accounts pallet

Methods

claimDefaultEvmAddress

function claimDefaultEvmAddress(bytes32 accountId) external nonpayable returns (bool)

Claim account mapping between AccountId and a generated EvmAddress based off of the AccountId.

It'll emit an {ClaimAccount} event.

Parameters

Name Type Description
accountId bytes32 The substrate account.

Returns

Name Type Description
_0 bool Returns a boolean value indicating whether the operation succeeded.

getAccountId

function getAccountId(address evmAddress) external view returns (bytes32)

Get the AccountId used to generate the given EvmAddress.

Parameters

Name Type Description
evmAddress address The EVM address.

Returns

Name Type Description
_0 bytes32 Returns (accountId).

getEvmAddress

function getEvmAddress(bytes32 accountId) external view returns (address)

Get the EvmAddress associated with a given AccountId or the underlying EvmAddress of the AccountId.

Parameters

Name Type Description
accountId bytes32 The substrate account.

Returns

Name Type Description
_0 address Returns (evmAddress). Return address(0x0) if the AccountId is not mapped.

Events

ClaimAccount

event ClaimAccount(address indexed sender, bytes32 indexed accountId, address indexed evmAddress)

Mapping between Substrate accounts and EVM accounts claim account event.

Parameters

Name Type Description
sender indexed address The sender of the transaction.
accountId indexed bytes32 The substrate account.
evmAddress indexed address The mapped EVM accounts.