權杖分類架構的輸入規格檔案
Blockchain App Builder 初始化命令會讀取輸入規格檔案,並使用多種工具產生結構化專案,以協助鏈碼開發程序。
您可以在相同的規格檔案中,定義以「記號分類架構」為基礎的標準資產和記號資產。您無法根據相同規格檔案中的多個標準來定義權杖資產。
如需有關在規格檔案中包含標準資產的資訊,請參閱輸入規格檔案。
Blockchain App Builder 套裝程式中提供下列有趣的權杖資產範例規格檔案:
FiatMoneyToken.yml
LoyaltyToken-Go.yml
除了標準特性和區段之外,有趣的記號資產還支援規格檔案中的 behavior
和 anatomy
區段。有趣的記號資產也支援 standard
特性。下列範例顯示以「記號分類架構」為基礎之有趣記號資產的規格檔案結構:
assets:
- name: OBPTOK # Asset name
type: token # Asset type
anatomy:
type: fungible # Token type
unit: fractional # Token unit
behavior: # Token behaviors
- divisible:
decimal: 2
- mintable:
max_mint_quantity: 1000
- transferable
- burnable
- roles:
minter_role_name: minter
properties:
- name: currency_name # Custom attribute to represent the token in certain currency. This attribute is helpful for exchanging the tokens with fiat currency.
type: string
- name: token_to_currency_ratio # Custom attribute to specify the token to currency ratio. This attribute is helpful for exchanging the tokens with fiat currency.
type: number
表格 7-5 有趣記號規格檔案的參數描述和範例
進入 | 描述 | 範例 |
---|---|---|
type: |
您必須在 |
|
standard: |
standard 特性代表產生鏈碼時要遵循的記號標準。有趣的記號只支援 ttf+ 值。如果未為有趣的記號指定 standard 特性,則會遵循「記號分類架構 (TTF)」標準。
|
|
anatomy: |
anatomy 區段有兩種可供有趣記號使用的必要參數:
|
|
behavior: |
本節說明記號的功能與限制。有趣的記號必須要有 mintable 和 transferable 行為。
|
|
若要建立多個使用不同 max_mint_quantity
參數的有趣記號 ID,請為規格檔案中的每個記號 ID 建立個別的記號資產,並在記號資產與記號 ID 之間建立 1:1 關係。
若要建立多個使用相同 max_mint_quantity
參數或沒有 max_mint_quantity
參數的有趣記號 ID,請在規格檔案中建立要用於所有記號 ID 的單一記號資產。