Type Alias moonbeam_runtime::EvmForeignAssets
source · pub type EvmForeignAssets = Pallet<Runtime>;
Aliased Type§
struct EvmForeignAssets(/* private fields */);
Implementations
source§impl<T> Pallet<T>where
T: Config,
impl<T> Pallet<T>where
T: Config,
sourcepub fn account_id() -> H160
pub fn account_id() -> H160
The account ID of this pallet
sourcepub fn contract_address_from_asset_id(asset_id: u128) -> H160
pub fn contract_address_from_asset_id(asset_id: u128) -> H160
Compute asset contract address from asset id
sourcepub fn register_foreign_asset(
asset_id: u128,
xcm_location: Location,
decimals: u8,
symbol: BoundedVec<u8, ConstU32<256>>,
name: BoundedVec<u8, ConstU32<256>>
) -> Result<(), DispatchError>
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.
sourcepub fn mint_into(
asset_id: u128,
beneficiary: <T as Config>::AccountId,
amount: U256
) -> Result<(), EvmError>
pub fn mint_into( asset_id: u128, beneficiary: <T as Config>::AccountId, amount: U256 ) -> Result<(), EvmError>
Mint an asset into a specific account
sourcepub fn approve(
asset_id: u128,
owner: <T as Config>::AccountId,
spender: <T as Config>::AccountId,
amount: U256
) -> Result<(), EvmError>
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
pub fn weight_of_erc20_burn() -> Weight
pub fn weight_of_erc20_mint() -> Weight
pub fn weight_of_erc20_transfer() -> Weight
source§impl<T> Pallet<T>where
T: Config,
impl<T> Pallet<T>where
T: Config,
sourcepub 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>
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
sourcepub fn change_xcm_location(
origin: <T as Config>::RuntimeOrigin,
asset_id: u128,
new_xcm_location: Location
) -> Result<(), DispatchError>
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
sourcepub fn freeze_foreign_asset(
origin: <T as Config>::RuntimeOrigin,
asset_id: u128,
allow_xcm_deposit: bool
) -> Result<(), DispatchError>
pub fn freeze_foreign_asset( origin: <T as Config>::RuntimeOrigin, asset_id: u128, allow_xcm_deposit: bool ) -> Result<(), DispatchError>
Freeze a given foreign assetId
sourcepub fn unfreeze_foreign_asset(
origin: <T as Config>::RuntimeOrigin,
asset_id: u128
) -> Result<(), DispatchError>
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,
impl<T> Pallet<T>where
T: Config,
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>
pub fn do_change_xcm_location( asset_id: u128, previous_xcm_location: Location, new_xcm_location: Location ) -> Result<(), DispatchError>
pub fn do_freeze_asset( asset_id: u128, xcm_location: Location, allow_xcm_deposit: bool ) -> Result<(), DispatchError>
pub fn do_unfreeze_asset( asset_id: u128, xcm_location: Location ) -> Result<(), DispatchError>
source§impl<T> Pallet<T>where
T: Config,
impl<T> Pallet<T>where
T: Config,
sourcepub fn assets_by_id<KArg>(k: KArg) -> Option<Location>where
KArg: EncodeLike<u128>,
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,
impl<T> Pallet<T>where
T: Config,
sourcepub fn assets_by_location<KArg>(k: KArg) -> Option<(u128, AssetStatus)>where
KArg: EncodeLike<Location>,
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,
impl<T> Pallet<T>where
T: Config,
sourcepub fn assets_creation_details<KArg>(k: KArg) -> Option<AssetDepositDetails<T>>where
KArg: EncodeLike<u128>,
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,
impl<T> PalletInfoAccess for Pallet<T>where
T: Config,
source§fn module_name() -> &'static str
fn module_name() -> &'static str
Name of the Rust module containing the pallet.
source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
Version of the crate containing the pallet.
source§impl<T> WhitelistedStorageKeys for Pallet<T>where
T: Config,
impl<T> WhitelistedStorageKeys for Pallet<T>where
T: Config,
source§fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
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,
impl<T> GetStorageVersion for Pallet<T>where
T: Config,
§type InCodeStorageVersion = NoStorageVersionSet
type InCodeStorageVersion = NoStorageVersionSet
source§fn in_code_storage_version(
) -> <Pallet<T> as GetStorageVersion>::InCodeStorageVersion
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
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
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 moresource§impl<T> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
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
)
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,
impl<T> OnRuntimeUpgrade for Pallet<T>where
T: Config,
source§fn on_runtime_upgrade() -> Weight
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,
impl<T> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
source§impl<T> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
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
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)
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
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)
fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
A hook to run logic after inherent application. Read more
§fn on_runtime_upgrade() -> Weight
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)
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()
fn integrity_test()
Check the integrity of this pallet’s configuration. Read more
source§impl<T> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
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
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,
impl<T> TransactAsset for Pallet<T>where
T: Config,
source§fn deposit_asset(
what: &Asset,
who: &Location,
_context: Option<&XcmContext>
) -> Result<(), Error>
fn deposit_asset( what: &Asset, who: &Location, _context: Option<&XcmContext> ) -> Result<(), Error>
source§fn internal_transfer_asset(
asset: &Asset,
from: &Location,
to: &Location,
_context: &XcmContext
) -> Result<AssetsInHolding, Error>
fn internal_transfer_asset( asset: &Asset, from: &Location, to: &Location, _context: &XcmContext ) -> Result<AssetsInHolding, Error>
source§fn withdraw_asset(
what: &Asset,
who: &Location,
_context: Option<&XcmContext>
) -> Result<AssetsInHolding, Error>
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>
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)
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>
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)
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>
fn transfer_asset( asset: &Asset, from: &Location, to: &Location, context: &XcmContext ) -> Result<AssetsInHolding, Error>
source§impl<T> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
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
)
fn on_finalize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number )
See [
Hooks::on_finalize
].source§impl<T> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
source§impl<T> OnGenesis for Pallet<T>where
T: Config,
impl<T> OnGenesis for Pallet<T>where
T: Config,
source§fn on_genesis()
fn on_genesis()
Something that should happen at genesis.