權杖分類架構的輸入規格檔案
Blockchain App Builder 初始化命令會讀取輸入規格檔案,並產生具有數個工具的鷹架式專案,以協助鏈碼開發流程。
您可以在相同的規格檔案中,定義以「記號分類架構」為基礎的標準資產和記號資產。您無法根據相同規格檔案中的多個標準來定義變數替代字資產。
如需在規格檔案中包含標準資產的資訊,請參閱輸入規格檔案。
「區塊鏈 App 產生器」套裝程式提供下列易記權杖資產的範例規格檔案:
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
表格 4-1 有趣的記號規格檔案的參數描述和範例
進入 | 描述 | 範例 |
---|---|---|
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。