ERC-1155の入力仕様ファイル
ブロックチェーン・アプリケーション・ビルダー初期化コマンドは、入力仕様ファイルを読み取り、チェーンコード開発プロセスを支援する複数のツールを使用してスキャフォールディング済プロジェクトを生成します。
標準資産、およびERC-1155標準に基づく真菌可能トークン資産と非真菌可能トークン資産の両方を同じ仕様ファイルに定義できます。同じ仕様ファイルの複数の標準に基づいてトークン・アセットを定義することはできません。
仕様ファイルに標準アセットを含める方法の詳細は、「入力仕様ファイル」を参照してください。
NFTArtCollectionMarketplacewithERC1155-TypeScript.yml
FractionalNFTinRealEstate-TypeScript.yml
標準プロパティおよびセクションに加えて、トークン・アセットは仕様ファイルのbehavior
およびanatomy
セクションをサポートします。また、fungible以外のトークン・アセットは、metadata
セクションをサポートしています。次の例は、2つの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: |
standard プロパティは、ERC-1155トークンに必須です。これは、チェーンコード生成時に従うトークン標準を表します。
|
|
anatomy: |
anatomy セクションには、2つの必須パラメータがあります。
|
|
behavior: |
この項では、トークンの機能および制限について説明します。mintable 、transferable の動作は、すべてのトークンで必須です。indivisible の動作は、完全ではないトークンに対して必須です。
|
|
metadata: |
この例では、 |
|
制限事項
ブロックチェーン・アプリケーション・ビルダーは、ERC-1155標準を部分的にサポートします。現在、次のERC-1155イベントおよびメソッドはサポートされていません。
TransferSingle
TransferBatch
ApprovalForAll
URI
safeTransferFrom
balanceOf
setApprovalForAll
isApprovedForAll