토큰 분류법 프레임워크에 대한 입력 사양 파일
Blockchain App Builder 초기화 명령은 입력 사양 파일을 읽고 체인 코드 개발 프로세스를 지원하는 여러 가지 도구를 사용하여 스캐폴드 프로젝트를 생성합니다.
동일한 사양 파일에서 토큰 분류법 프레임워크를 기반으로 하는 표준 자산 및 토큰 자산을 정의할 수 있습니다. 동일한 사양 파일에서 둘 이상의 표준을 기반으로 토큰 자산을 정의할 수 없습니다.
사양 파일에 표준 자산을 포함하는 방법에 대한 자세한 내용은 입력 사양 파일을 참조하십시오.
FiatMoneyToken.yml
LoyaltyToken-Go.yml
표준 등록 정보 및 섹션 외에도 대체 가능한 토큰 자산은 사양 파일에서 behavior
및 anatomy
섹션을 지원합니다. Fungible 토큰 자산은 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 Fungible Token Specification 파일에 대한 매개변수 설명 및 예
항목 | 설명 | 예 |
---|---|---|
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에 사용할 사양 파일에 단일 토큰 자산을 생성합니다.