From fcd4619b48ad974ab06d05b2e36c77cc306ef12f Mon Sep 17 00:00:00 2001 From: ndkazu Date: Fri, 23 Sep 2022 01:40:59 -0700 Subject: [PATCH 1/2] Added Ownership_Token metadata --- pallets/share_distributor/src/functions.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pallets/share_distributor/src/functions.rs b/pallets/share_distributor/src/functions.rs index 420da92d..fdca3ef4 100644 --- a/pallets/share_distributor/src/functions.rs +++ b/pallets/share_distributor/src/functions.rs @@ -101,6 +101,10 @@ pub fn create_tokens(origin: OriginFor,collection_id: T::NftCollectionId, ite debug_assert!(res.is_ok()); //Set class metadata + let token_name = format!("FairOwner_nbr{:?}",token_id.clone()).as_bytes().to_vec().try_into().unwrap(); + let token_symbol = format!("FO{:?}",token_id.clone()).as_bytes().to_vec().try_into().unwrap(); + let decimals = 18; + Assets::Pallet::::force_set_metadata(origin.clone(),token_id.clone().into(),token_name,token_symbol,decimals,false); //mint 100 tokens let res0 = Assets::Pallet::::mint(RawOrigin::Signed(account.clone()).into(),token_id.clone().into(),to,Self::u32_to_balance_option(100).unwrap()); From fdf36cbcd20430eda9edac6565d06b104d9be195 Mon Sep 17 00:00:00 2001 From: ndkazu Date: Fri, 23 Sep 2022 01:44:06 -0700 Subject: [PATCH 2/2] Merge with main and removed warning --- pallets/share_distributor/src/functions.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/share_distributor/src/functions.rs b/pallets/share_distributor/src/functions.rs index fdca3ef4..685cc816 100644 --- a/pallets/share_distributor/src/functions.rs +++ b/pallets/share_distributor/src/functions.rs @@ -104,7 +104,7 @@ pub fn create_tokens(origin: OriginFor,collection_id: T::NftCollectionId, ite let token_name = format!("FairOwner_nbr{:?}",token_id.clone()).as_bytes().to_vec().try_into().unwrap(); let token_symbol = format!("FO{:?}",token_id.clone()).as_bytes().to_vec().try_into().unwrap(); let decimals = 18; - Assets::Pallet::::force_set_metadata(origin.clone(),token_id.clone().into(),token_name,token_symbol,decimals,false); + Assets::Pallet::::force_set_metadata(origin.clone(),token_id.clone().into(),token_name,token_symbol,decimals,false).ok(); //mint 100 tokens let res0 = Assets::Pallet::::mint(RawOrigin::Signed(account.clone()).into(),token_id.clone().into(),to,Self::u32_to_balance_option(100).unwrap());