Skip to content

Commit

Permalink
Merge pull request #31 from multiversx/add_tag_to_name
Browse files Browse the repository at this point in the history
add nft tag to name
  • Loading branch information
alyn509 authored Jun 30, 2023
2 parents 53b402e + 1331324 commit 2f87453
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nft-minter/src/nft_minting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,12 @@ pub trait NftMintingModule:
let attributes =
self.build_nft_attributes(&brand_info.collection_hash, brand_id, nft_id);
let nft_amount = BigUint::from(NFT_AMOUNT);
let nft_name =
self.get_nft_name_with_tag(brand_info.token_display_name.clone(), nft_id);
let nft_nonce = self.send().esdt_nft_create(
&nft_token_id,
&nft_amount,
&brand_info.token_display_name,
&nft_name,
&brand_info.royalties,
&ManagedBuffer::new(),
&attributes,
Expand All @@ -186,4 +188,10 @@ pub trait NftMintingModule:

nft_output_payments
}

fn get_nft_name_with_tag(&self, name: ManagedBuffer, tag: usize) -> ManagedBuffer {
let mut nft_name = name;
nft_name.append(&sc_format!("#{}", tag));
nft_name
}
}

0 comments on commit 2f87453

Please sign in to comment.