You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Description
In order to **teleport Frequency tokens to AssetHub**, we need a way to
pay the execution fee on **AssetHub otherwise it will reject the
request** and treat the tokens as **trapped assets**.
Since **AssetHub does not accept Frequency** as payment for execution
fees, we must also include DOT in the message to cover those fees.
To support this, Frequency must be able to handle DOT as an asset — both
to receive DOT from AssetHub and to **send DOT back out**.
## Acceptance Criteria
- [ ] Add the ability to send and receive DOT on Frequency
- [ ] Store DOT as a Multilocation on Frequency
- [ ] Decide who should be allowed to create assets on Frequency
- [x] Generate Weights
- [x] Feature Flag `frequency-bridging`
Implementation suggestions
- User Pallet Assets
- Config
```
pallet-assets = { workspace = true, default-features = false }
```
```
parameter_types! {
pub const AssetDeposit: Balance = 0;
pub const AssetAccountDeposit: Balance = 0;
pub const ApprovalDeposit: Balance = 0;
pub const AssetsStringLimit: u32 = 50;
pub const MetadataDepositBase: Balance = 0;
pub const MetadataDepositPerByte: Balance = 0;
}
parameter_types! {
// we just reuse the same deposits
pub const ForeignAssetsAssetDeposit: Balance = AssetDeposit::get();
pub const ForeignAssetsAssetAccountDeposit: Balance = AssetAccountDeposit::get();
pub const ForeignAssetsApprovalDeposit: Balance = ApprovalDeposit::get();
pub const ForeignAssetsAssetsStringLimit: u32 = AssetsStringLimit::get();
pub const ForeignAssetsMetadataDepositBase: Balance = MetadataDepositBase::get();
pub const ForeignAssetsMetadataDepositPerByte: Balance = MetadataDepositPerByte::get();
}
```
```
use xcm_config::{RelayLocation, XcmOriginToTransactDispatchOrigin, ForeignAssetsAssetId};
impl pallet_assets::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Balance = Balance;
////
type AssetId = ForeignAssetsAssetId;
type AssetIdParameter = ForeignAssetsAssetId;
type Currency = Balances;
// This is to allow any other remote location to create foreign assets. Used in tests, not
// recommended on real chains.
type **CreateOrigin** =
**ForeignCreators**<Everything, LocationToAccountId, AccountId, xcm::latest::Location>;
type ForceOrigin = EnsureRoot<AccountId>;
type AssetDeposit = ForeignAssetsAssetDeposit;
type MetadataDepositBase = ForeignAssetsMetadataDepositBase;
type MetadataDepositPerByte = ForeignAssetsMetadataDepositPerByte;
type ApprovalDeposit = ForeignAssetsApprovalDeposit;
type StringLimit = ForeignAssetsAssetsStringLimit;
type Freezer = ();
type Extra = ();
type WeightInfo = pallet_assets::weights::SubstrateWeight<Runtime>;
type CallbackHandle = ();
type AssetAccountDeposit = ForeignAssetsAssetAccountDeposit;
type RemoveItemsLimit = frame_support::traits::ConstU32<1000>;
#[cfg(feature = "runtime-benchmarks")]
type BenchmarkHelper = xcm_config::XcmBenchmarkHelper;
type Holder = ();
}
```
# Checklist
- [ ] Updated Pallet Readme?
- [ ] Updated js/api-augment for Custom RPC APIs?
- [ ] Design doc(s) updated?
- [ ] Unit Tests added?
- [ ] e2e Tests added?
- [ ] Benchmarks added?
- [x] Spec version incremented?
0 commit comments