pub type EvmForeignAssets = Pallet<Runtime>;

Aliased Type§

struct EvmForeignAssets(/* private fields */);

Implementations

source§

impl<T> Pallet<T>
where T: Config,

source

pub fn account_id() -> H160

The account ID of this pallet

source

pub fn contract_address_from_asset_id(asset_id: u128) -> H160

Compute asset contract address from asset id

source

pub fn register_foreign_asset( asset_id: u128, xcm_location: Location, decimals: u8, symbol: BoundedVec<u8, ConstU32<256>>, name: BoundedVec<u8, ConstU32<256>> ) -> Result<(), DispatchError>

This method only exists for migration purposes and will be deleted once the foreign assets migration is finished.

source

pub fn mint_into( asset_id: u128, beneficiary: <T as Config>::AccountId, amount: U256 ) -> Result<(), EvmError>

Mint an asset into a specific account

source

pub fn approve( asset_id: u128, owner: <T as Config>::AccountId, spender: <T as Config>::AccountId, amount: U256 ) -> Result<(), EvmError>

Aprrove a spender to spend a certain amount of tokens from the owner account

source

pub fn weight_of_erc20_burn() -> Weight

source

pub fn weight_of_erc20_mint() -> Weight

source

pub fn weight_of_erc20_transfer() -> Weight

source§

impl<T> Pallet<T>
where T: Config,

source

pub fn create_foreign_asset( origin: <T as Config>::RuntimeOrigin, asset_id: u128, asset_xcm_location: Location, decimals: u8, symbol: BoundedVec<u8, ConstU32<256>>, name: BoundedVec<u8, ConstU32<256>> ) -> Result<(), DispatchError>

Create new asset with the ForeignAssetCreator

source

pub fn change_xcm_location( origin: <T as Config>::RuntimeOrigin, asset_id: u128, new_xcm_location: Location ) -> Result<(), DispatchError>

Change the xcm type mapping for a given assetId We also change this if the previous units per second where pointing at the old assetType

source

pub fn freeze_foreign_asset( origin: <T as Config>::RuntimeOrigin, asset_id: u128, allow_xcm_deposit: bool ) -> Result<(), DispatchError>

Freeze a given foreign assetId

source

pub fn unfreeze_foreign_asset( origin: <T as Config>::RuntimeOrigin, asset_id: u128 ) -> Result<(), DispatchError>

Unfreeze a given foreign assetId

source§

impl<T> Pallet<T>
where T: Config,

source

pub fn do_create_asset( asset_id: u128, asset_xcm_location: Location, decimals: u8, symbol: BoundedVec<u8, ConstU32<256>>, name: BoundedVec<u8, ConstU32<256>>, deposit_account: Option<<T as Config>::AccountId> ) -> Result<(), DispatchError>

source

pub fn do_change_xcm_location( asset_id: u128, previous_xcm_location: Location, new_xcm_location: Location ) -> Result<(), DispatchError>

source

pub fn do_freeze_asset( asset_id: u128, xcm_location: Location, allow_xcm_deposit: bool ) -> Result<(), DispatchError>

source

pub fn do_unfreeze_asset( asset_id: u128, xcm_location: Location ) -> Result<(), DispatchError>

source§

impl<T> Pallet<T>
where T: Config,

source

pub fn assets_by_id<KArg>(k: KArg) -> Option<Location>
where KArg: EncodeLike<u128>,

An auto-generated getter for AssetsById.

source§

impl<T> Pallet<T>
where T: Config,

source

pub fn assets_by_location<KArg>(k: KArg) -> Option<(u128, AssetStatus)>
where KArg: EncodeLike<Location>,

An auto-generated getter for AssetsByLocation.

source§

impl<T> Pallet<T>
where T: Config,

source

pub fn assets_creation_details<KArg>(k: KArg) -> Option<AssetDepositDetails<T>>
where KArg: EncodeLike<u128>,

An auto-generated getter for AssetsCreationDetails.

Trait Implementations

source§

impl<T> PalletInfoAccess for Pallet<T>
where T: Config,

source§

fn index() -> usize

Index of the pallet as configured in the runtime.
source§

fn name() -> &'static str

Name of the pallet as configured in the runtime.
source§

fn name_hash() -> [u8; 16]

Two128 hash of name.
source§

fn module_name() -> &'static str

Name of the Rust module containing the pallet.
source§

fn crate_version() -> CrateVersion

Version of the crate containing the pallet.
source§

impl<T> Debug for Pallet<T>

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<T> WhitelistedStorageKeys for Pallet<T>
where T: Config,

source§

fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>

Returns a Vec<TrackedStorageKey> indicating the storage keys that should be whitelisted during benchmarking. This means that those keys will be excluded from the benchmarking performance calculation.
source§

impl<T> GetStorageVersion for Pallet<T>
where T: Config,

§

type InCodeStorageVersion = NoStorageVersionSet

This type is generated by the pallet macro. Read more
source§

fn in_code_storage_version( ) -> <Pallet<T> as GetStorageVersion>::InCodeStorageVersion

Returns the in-code storage version as specified in the storage_version attribute, or [NoStorageVersionSet] if the attribute is missing.
source§

fn on_chain_storage_version() -> StorageVersion

Returns the storage version of the pallet as last set in the actual on-chain storage.
§

fn current_storage_version() -> Self::InCodeStorageVersion

👎Deprecated: This method has been renamed to in_code_storage_version and will be removed after March 2024.
DEPRECATED: Use [Self::current_storage_version] instead. Read more
source§

impl<T> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

source§

fn offchain_worker( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number )

This function is being called after every block import (when fully synced). Read more
source§

impl<T> OnRuntimeUpgrade for Pallet<T>
where T: Config,

source§

fn on_runtime_upgrade() -> Weight

See [Hooks::on_runtime_upgrade].
source§

impl<T> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

source§

fn on_idle( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, remaining_weight: Weight ) -> Weight

See [Hooks::on_idle].
source§

impl<T> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

§

fn on_initialize(_n: BlockNumber) -> Weight

Block initialization hook. This is called at the very beginning of block execution. Read more
§

fn on_finalize(_n: BlockNumber)

Block finalization hook. This is called at the very end of block execution. Read more
§

fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight

Hook to consume a block’s idle time. This will run when the block is being finalized (before [Hooks::on_finalize]). Read more
§

fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)

A hook to run logic after inherent application. Read more
§

fn on_runtime_upgrade() -> Weight

Hook executed when a code change (aka. a “runtime upgrade”) is detected by the FRAME Executive pallet. Read more
§

fn offchain_worker(_n: BlockNumber)

Implementing this function on a pallet allows you to perform long-running tasks that are dispatched as separate threads, and entirely independent of the main blockchain execution. Read more
§

fn integrity_test()

Check the integrity of this pallet’s configuration. Read more
source§

impl<T> PalletsInfoAccess for Pallet<T>
where T: Config,

source§

fn count() -> usize

The number of pallets’ information that this type represents. Read more
source§

fn infos() -> Vec<PalletInfoData>

All of the pallets’ information that this type represents.
source§

impl<T> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

source§

fn on_initialize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number ) -> Weight

See [Hooks::on_initialize].
source§

impl<T> TransactAsset for Pallet<T>
where T: Config,

source§

fn deposit_asset( what: &Asset, who: &Location, _context: Option<&XcmContext> ) -> Result<(), Error>

Deposit the what asset into the account of who. Read more
source§

fn internal_transfer_asset( asset: &Asset, from: &Location, to: &Location, _context: &XcmContext ) -> Result<AssetsInHolding, Error>

Move an asset from one location in to another location. Read more
source§

fn withdraw_asset( what: &Asset, who: &Location, _context: Option<&XcmContext> ) -> Result<AssetsInHolding, Error>

Withdraw the given asset from the consensus system. Return the actual asset(s) withdrawn, which should always be equal to _what. Read more
§

fn can_check_in( _origin: &Location, _what: &Asset, _context: &XcmContext ) -> Result<(), Error>

Ensure that check_in will do as expected. Read more
§

fn check_in(_origin: &Location, _what: &Asset, _context: &XcmContext)

An asset has been teleported in from the given origin. This should do whatever housekeeping is needed. Read more
§

fn can_check_out( _dest: &Location, _what: &Asset, _context: &XcmContext ) -> Result<(), Error>

Ensure that check_out will do as expected. Read more
§

fn check_out(_dest: &Location, _what: &Asset, _context: &XcmContext)

An asset has been teleported out to the given destination. This should do whatever housekeeping is needed. Read more
§

fn transfer_asset( asset: &Asset, from: &Location, to: &Location, context: &XcmContext ) -> Result<AssetsInHolding, Error>

Move an asset from one location in to another location. Read more
source§

impl<T> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

source§

fn on_finalize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number )

See [Hooks::on_finalize].
source§

impl<T> Callable<T> for Pallet<T>
where T: Config,

source§

impl<T> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

source§

fn on_poll( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, weight: &mut WeightMeter )

Code to execute every now and then at the beginning of the block after inherent application. Read more
source§

impl<T> MaybeEquivalence<Location, u128> for Pallet<T>
where T: Config,

source§

fn convert(location: &Location) -> Option<u128>

Attempt to convert reference of A into value of B, returning None if not possible.
source§

fn convert_back(asset_id: &u128) -> Option<Location>

Attempt to convert reference of B into value of A, returning None if not possible.
source§

impl<T> OnGenesis for Pallet<T>
where T: Config,

source§

fn on_genesis()

Something that should happen at genesis.
source§

impl<T> PartialEq for Pallet<T>

source§

fn eq(&self, other: &Pallet<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> Eq for Pallet<T>

source§

impl<T> StorageInfoTrait for Pallet<T>
where T: Config,

source§

fn storage_info() -> Vec<StorageInfo>

source§

impl<T> Clone for Pallet<T>

source§

fn clone(&self) -> Pallet<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> IntegrityTest for Pallet<T>
where T: Config,

source§

fn integrity_test()

See [Hooks::integrity_test].
source§

impl<T> BeforeAllRuntimeMigrations for Pallet<T>
where T: Config,

source§

fn before_all_runtime_migrations() -> Weight

Something that should happen before runtime migrations are executed.