Hey, I had one more question, I am a bit unfamiliar with Sway syntax and want to understand what does the process of creating your own token look like. I tried going through the contract but couldn’t find the answer to this:
Where will i get the Asset_ID from?
Do I have to add the Token Details in here, and if yes how do i add supply in StorageMap?
storage {
/// The total number of unique assets minted by this contract.
total_assets: u64 = 0,
/// The total number of coins minted for a particular asset.
total_supply: StorageMap<AssetId, u64> = StorageMap {},
/// The name associated with a particular asset.
name: StorageMap<AssetId, StorageString> = StorageMap {},
/// The symbol associated with a particular asset.
symbol: StorageMap<AssetId, StorageString> = StorageMap {},
/// The decimals associated with a particular asset.
decimals: StorageMap<AssetId, u8> = StorageMap {},
}```
asset_id is derived form sha256((contract_id, sub_id)). Where contract id is the contract address and sub id is the unique id of one of the tokens within that contract since contracts can have multiple tokens derived from it.
You can read more here in the standard library
The same way you would set symbols for multiple assets like so or using configurable like you would with single assets.
a. tests
b. functions
c. single asset