결합된 토큰 프레임워크 체인코드 패키지
결합된 토큰 프레임워크는 Blockchain App Builder에서 지원하는 확장된 ERC-1155 표준을 사용합니다.
NFT Art Collection Marketplace 샘플은 결합된 토큰 일반 프레임워크의 사용을 보여줍니다. 샘플에는 예술 작품과 관련된 NFT(Non-fungible tokens)를 구매하고 판매하기 위한 마켓플레이스를 나타내는 체인코드가 포함되어 있습니다. 이 샘플에서 NFT 플랫폼 제공 업체는 블록 체인 네트워크에서 예술 작품을 위해 NFT를 민트 (생성) 할 수있는 박물관을 온보딩합니다. 그런 다음 소비자는 Eth 동전 또는 ERC-20 동전을 사용하여 박물관에서 NFT를 구입할 수 있습니다. 소비자가 NFT를 구매하면 박물관은 대체 가능한 토큰 계정에 로열티 토큰을 수여합니다. 소비자는 NFT를 판매할 수도 있습니다. 체인코드는 토큰 초기화, 계정 작업, 롤 지정, 민팅, 전송 및 레코딩을 포함하여 토큰 수명 주기를 관리하는 데 필요한 메소드를 구현합니다. 또한 민팅, 전송 및 연소 작업 승인을 위한 공증 계정을 제공하고 일일 한도 및 감사 절차를 통해 규정 준수를 지원합니다. NFT 아트 컬렉션 마켓플레이스 샘플은 TypeScript에서 체인코드 개발을 위해 설계되었습니다.
결합된 토큰 프레임워크는 Oracle Blockchain Platform 콘솔에서 다운로드할 수 있으며 다음 구성요소를 포함합니다.
NFTCollectiblesWithERC1155.zip
- 배치를 위해 패키지화된 체인 코드를 포함하는 아카이브 파일입니다.NFTCollectiblesWithERC1155-TypeScript.yaml
- Blockchain App Builder에서NFTCollectiblesWithERC1155
체인 코드를 스캐폴딩하는 데 사용할 수 있는 사양 파일입니다.NFTCollectiblesWithERC1155_postman_collection.json
- 체인 코드에서 API를 테스트할 수 있는 Postman 모음입니다.README.md
- 체인 코드 작업을 위한 단계별 안내서입니다.
대체 가능한 토큰 프레임워크를 가져오려면 Oracle Blockchain Platform Digital Assets 콘솔에서 디지털 자산 탭을 누른 다음 결합 토큰 프레임워크를 선택합니다.
사양 파일
아트 컬렉션 마켓플레이스 체인코드를 생성하는 데 사용되는 사양 파일에는 events
속성이 포함됩니다. 체인코드 이벤트 함수는 실시간 통지를 사용으로 설정하고 워크플로우를 트리거하기 위해 생성된 체인코드의 이벤트 콜백을 지원합니다. For more information about specification files and the parameters used in specification files, see Input Specification File for Combined Tokens in Using Oracle Blockchain Platform.
#
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
#
# This specification file is an example how to build any whole combined token application that includes fungible and non-fungible tokens together.
# For a combined token application, art collection marketplace with loyalty token has been used as an example.
# Art collection marketplace is a digital marketplace for buying and selling NFT art that rewards users with fungible loyalty tokens for their participation.
assets:
- name: ArtCollection #Asset name
type: token #Asset type
symbol: ART # Token symbol
standard: erc721+ # Token standard
events: true # Supports event code generation for non-GET methods
anatomy:
type: nonfungible # Token type
unit: whole #Token unit
behavior:
- indivisible
- singleton
- mintable:
max_mint_quantity: 20000
- transferable
- 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: float
- name: On_Sale_Flag # Custom asset attribute to maintain non-fungible token selling status in the marketplace
type: boolean
metadata: # To maintain the metadata on-chain, this tag will be used. Users won't be able to update the metadata attribute values after an NFT is minted.
- name: Painting_Name # Custom asset attribute to represent the title given to a piece of artwork.
type: string
- name: Description # Custom asset attribute to represent a detailed explanation or interpretation of the painting's concept, style, or message.
type: string
- name: Painter_Name # Custom asset attribute to represent the name of the artist who created the painting.
type: string
- name: Loyalty #Asset name
type: token #Asset type
standard: erc1155+ # Token standard
events: true # Supports event code generation for non-GET methods
anatomy:
type: fungible # Token type
unit: fractional #Token unit
behavior: # Token behaviors
- divisible:
decimal: 2
- mintable:
max_mint_quantity: 100000
- transferable
- burnable
- roles:
minter_role_name: minter
properties:
- name: Token_Name # Custom attribute to represent the token name.
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
customMethods:
- executeQuery
- "post(token_id: string, selling_price: number)" # Post the non-fungible token for selling in the marketplace
- "buyWithEthCoin(from_org_id: string, from_user_id: string, to_org_id: string, to_user_id: string, nft_id: string[], loyalty_id: string[], eth_qty: number[], loyalty_reward_quantity: number[])" # Buy the non-fungible token after paying the amount using Eth Coin and receive loyalty points in return