diff --git a/modules/ismp/pallets/token-gateway/README.md b/modules/ismp/pallets/token-gateway/README.md index 21d6c07f..1aaa4cd1 100644 --- a/modules/ismp/pallets/token-gateway/README.md +++ b/modules/ismp/pallets/token-gateway/README.md @@ -14,15 +14,12 @@ The first step is to implement the pallet config for the runtime. ```rust,ignore use frame_support::parameter_types; -use ismp::Error; -use ismp::host::StateMachine; use ismp::module::IsmpModule; -use ismp::router::{IsmpRouter, Post, Response, Timeout}; +use ismp::router::IsmpRouter; parameter_types! { - // The Native asset Id for the native currency, for parachains this would be the XCM location for the parachain - // For standalone chains, a constant value that can be used to identify the native currency - pub const NativeAssetId: Location = Location::here(); + // A constant that should represent the native asset id + pub const NativeAssetId: u32 = 0; // Set the correct decimals for the native currency pub const Decimals: u8 = 12; } @@ -38,13 +35,14 @@ impl pallet_ismp::Config for Runtime { type Currency = Balances; // The Native asset Id type NativeAssetId = NativeAssetId; - // A type that allows token gateway to create local asset Ids - // An implementation is required to receive asset creation messages from Hyperbridge + // A type that provides a function for creating unique asset ids + // An implementation is required for asset creation calls or messages type CreateAsset = (); // The decimals value of the native asset type Decimals = Decimals; } +// Add the pallet to your ISMP router #[derive(Default)] struct Router; impl IsmpRouter for Router { @@ -69,9 +67,14 @@ The pallet requires some setting up before the teleport function is available fo ## Dispatchable Functions -- `teleport` - This function is used to bridge assets to EVM chains through Hyperbridge. +- `teleport` - This function is used to bridge assets to through Hyperbridge. - `set_token_gateway_addresses` - This call allows the `AdminOrigin` origin to set the token gateway address for EVM chains. - `create_erc6160_asset` - This call dispatches a request to Hyperbridge to create multi chain native assets on token gateway deployments + +## Asset creation +When creating assets, the metadata needs to be set, the account set as the admin is the pallet account, depending on the fungibles implementation, +funding the pallet account might be required for the asset creation to succeed. + ## License This library is licensed under the Apache 2.0 License, Copyright (c) 2024 Polytope Labs. diff --git a/modules/ismp/pallets/token-gateway/src/types.rs b/modules/ismp/pallets/token-gateway/src/types.rs index 72d199ec..aebf31af 100644 --- a/modules/ismp/pallets/token-gateway/src/types.rs +++ b/modules/ismp/pallets/token-gateway/src/types.rs @@ -50,8 +50,7 @@ pub struct TeleportParams { #[derive(Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq, RuntimeDebug)] pub struct AssetMap { /// Local Asset Id if the asset exists already - /// If the asset exists, it's decimal will be updated to 18 - /// other metadata will not be changed + /// If the asset exists, it's metadata will not be changed pub local_id: Option, /// MNT Asset registration details pub reg: ERC6160AssetRegistration, diff --git a/parachain/runtimes/gargantua/src/lib.rs b/parachain/runtimes/gargantua/src/lib.rs index 56e8c91b..ec44dfeb 100644 --- a/parachain/runtimes/gargantua/src/lib.rs +++ b/parachain/runtimes/gargantua/src/lib.rs @@ -572,9 +572,9 @@ impl pallet_utility::Config for Runtime { } parameter_types! { - pub const SpendingPeriod: BlockNumber = 6 * DAYS; + pub const SpendingPeriod: BlockNumber = 24 * DAYS; pub const TreasuryPalletId: PalletId = PalletId(*b"hb/trsry"); - pub const PayoutPeriod: BlockNumber = 14 * DAYS; + pub const PayoutPeriod: BlockNumber = 30 * DAYS; pub const MaxBalance: Balance = Balance::max_value(); pub TreasuryAccount: AccountId = Treasury::account_id(); pub const TechnicalMotionDuration: BlockNumber = 5 * DAYS; diff --git a/parachain/runtimes/nexus/src/lib.rs b/parachain/runtimes/nexus/src/lib.rs index 22c83cc5..d95f71e1 100644 --- a/parachain/runtimes/nexus/src/lib.rs +++ b/parachain/runtimes/nexus/src/lib.rs @@ -582,9 +582,9 @@ impl pallet_mmr::Config for Runtime { } parameter_types! { - pub const SpendingPeriod: BlockNumber = 6 * DAYS; + pub const SpendingPeriod: BlockNumber = 24 * DAYS; pub const TreasuryPalletId: PalletId = PalletId(*b"hb/trsry"); - pub const PayoutPeriod: BlockNumber = 14 * DAYS; + pub const PayoutPeriod: BlockNumber = 30 * DAYS; pub const MaxBalance: Balance = Balance::max_value(); pub TreasuryAccount: AccountId = Treasury::account_id(); pub const TechnicalMotionDuration: BlockNumber = 5 * DAYS;