ERC-1155 입력 사양 파일
Blockchain App Builder 초기화 명령은 입력 사양 파일을 읽고 체인 코드 개발 프로세스를 지원하는 몇 가지 도구를 사용하여 비계 프로젝트를 생성합니다.
동일한 사양 파일에서 ERC-1155 표준을 기반으로 하는 표준 자산과 대체 가능 및 비정확 토큰 자산을 모두 정의할 수 있습니다. 동일한 사양 파일에서 둘 이상의 표준을 기반으로 토큰 자산을 정의할 수 없습니다.
사양 파일에 표준 자산을 포함하는 방법에 대한 자세한 내용은 입력 사양 파일을 참조하십시오.
NFTArtCollectionMarketplacewithERC1155-TypeScript.yml
FractionalNFTinRealEstate-TypeScript.yml
표준 등록 정보 및 섹션 외에도 토큰 자산은 사양 파일에서 behavior
및 anatomy
섹션을 지원합니다. 또한 사용할 수 없는 토큰 자산은 metadata
섹션을 지원합니다. 다음 예에서는 두 개의 ERC-1155 토큰 자산에 대한 사양 파일 구조, 전체 비정지 토큰 및 소수 대체 가능 토큰을 보여 줍니다.
assets:
- name: ArtCollection #Asset name
type: token #Asset type
standard: erc1155+ # Token standard
anatomy:
type: nonfungible # Token type
unit: whole #Token unit
behavior:
- indivisible
- mintable:
max_mint_quantity: 20000
- transferable
- burnable
- lockable
- roles:
minter_role_name: minter
properties: # Custom asset attributes for non-fungible token
- name: price # Custom asset attribute to set the price of a non-fungible token in the marketplace
type: number
- name: on_sale_flag # Custom asset attribute maintains non-fungible token selling status in the marketplace
type: boolean
metadata: # Use this section to maintain the metadata on the blockchain. Only the user creating the non-fungible token can assign metadata attribute values, which cannot be updated later.
- name: painting_name
type: string
- name: description
type: string
- name: image
type: string
- name: painter_name
type: string
- name: Loyalty # Asset name
type: token # Asset type
standard: erc1155+ # Token standard
anatomy:
type: fungible # Token type
unit: fractional # Token unit
behavior: # Token behaviors
- divisible:
decimal: 2
- mintable:
max_mint_quantity: 10000
- transferable
- burnable
- roles:
minter_role_name: minter
properties:
- name: currency_name # Custom attribute to represent the token in a specific currency.
type: string
- name: token_to_currency_ratio # Custom attribute to specify the token to currency ratio.
type: number
다음 예에서는 소수 자릿수가 아닌 토큰에 대한 사양 파일의 구조를 보여 줍니다.
- name: RealEstateProperty #Asset name
type: token #Asset type
standard: erc1155+ # Token standard
anatomy:
type: nonfungible # Token type
unit: fractional #Token unit
behavior:
- divisible:
- mintable:
- transferable
- roles:
minter_role_name: minter
properties: # Custom asset attributes for non-fungible token.
- name: propertySellingPrice # Custom asset attribute to set the real estate property selling price
type: number
- name: propertyRentingPrice # Custom asset attribute maintains the renting amount for the real estate property
type: number
metadata: # To maintain the metadata on-chain, this tag will be used. Users won't be able to update the metadata attribute values.
- name: propertyType
type: string
- name: propertyName
type: string
- name: propertyAddress
type: string
- name: propertyImage
type: string
표 7-7 ERC-1155 토큰 사양 파일에 대한 매개변수 설명 및 예
항목 | 설명 | 예 |
---|---|---|
type: |
|
|
standard: |
ERC-1155 토큰의 경우 standard 속성은 필수입니다. 체인코드 생성 중 따라야 할 토큰 표준을 나타냅니다.
|
|
anatomy: |
anatomy 섹션에는 두 개의 필수 매개변수가 있습니다.
|
|
behavior: |
이 절에서는 토큰의 기능 및 제한 사항에 대해 설명합니다. 모든 토큰에 대해 mintable , transferable 동작은 필수입니다. indivisible 동작은 완전히 사용할 수 없는 토큰에 대해 필수입니다.
|
|
metadata: |
예제에서 |
|
제한
Blockchain App Builder는 ERC-1155 표준을 부분적으로 지원합니다. 현재 다음의 ERC-1155 이벤트 및 메서드는 지원되지 않습니다.
TransferSingle
TransferBatch
ApprovalForAll
URI
safeTransferFrom
balanceOf
setApprovalForAll
isApprovedForAll