Expand description

§Pallet Unified Account

A simple module for managing mappings (both ways) between different address schemes, inspired from Acala’s evm-accounts pallet https://github.com/AcalaNetwork/Acala/tree/master/modules/evm-accounts

§Overview

The Unified Accounts module provide functionality for native account holders to connect their evm address to have a unified experience across the different VMs.

  • Connect evm address you control
  • Connect default evm address

§Interface

  • claim_evm_address: Creates the double mappings for the provided evm address with caller account id given that no prior mapping exists for both and signature provided is valid.
  • claim_default_evm_address: Creates the double mapping with default evm address given that no prior mapping exists.

§Storage Fee

User is also charged a storage fee AccountMappingStorageFee before mappings are created to prevent storage abuse.

WARNINGS:

  • This pallet only handles transfer of native balance only, for the rest of native assets hold by evm address like XC20, DAppStaking unclaimed rewards, etc should be transferred manually beforehand by user himself otherwise FUNDS WILL BE LOST FOREVER.
  • Once mapping is created it cannot be changed.

§Traits

  • UnifiedAddressMapper: Interface to access pallet’s mappings with defaults

§Implementations

  • StaticLookup: Lookup implementations for accepting H160
  • AddressMapping: Wrapper over UnifiedAddressMapper for evm address mapping to account id.
  • KillAccountMapping: OnKilledAccount implementation to remove the mappings from storage after account is reaped.

Re-exports§

Modules§

  • The pallet module in each FRAME pallet hosts the most important items needed to construct this pallet.
  • Autogenerated weights for pallet_unified_accounts

Structs§

  • OnKilledAccount hooks implementation for removing storage mapping for killed accounts