ICRC‐7 Dynamic Collections Extension - ava-vs/reputation GitHub Wiki
ICRC | Title | Author | Discussions | Status | Type | Category | Created |
---|---|---|---|---|---|---|---|
7ext | Dynamic Collections | Ilia Agafonov (@ilialor) | -- | Draft | Extension | ICRC-7 | 2023-11-14 |
Abstract
This extension of ICRC-7, termed ICRC-7ext, introduces an advanced interface for dynamic collections management in the realm of non-fungible tokens (NFTs) on the Internet Computer. It extends the basic functionalities of ICRC-7 to include operations for creating, updating, deleting, and managing tokens within collections.
Motivation
As the NFT projects evolves, the need for more complex and dynamic NFT collections arises. The standard ICRC-7 lacks advanced functionalities for managing collections of NFTs. This extension aims to fill this gap by providing a set of methods for comprehensive collections management, enhancing the capabilities of NFT platforms on the Internet Computer.
Contract Interface
The extension introduces the following methods for managing dynamic collections:
Creates a New ICRC-7ext Collection
createCollection : (record {
metadata: record {
collectionName: text;
symbol: text;
logo: opt blob;
description: opt text;
attributes: opt vec record { text; Value };
};
}) -> variant {
Ok: nat; // collectionId
Err: Error; };
Update an Existing ICRC-7ext Collection's Metadata
updateCollection : (record {
collectionId: nat;
newMetadata: record {
collectionName: opt text;
symbol: opt text;
logo: opt blob;
description: opt text;
attributes: opt vec record { text; Value };
};
}) -> variant {
Ok: nat; // collectionId
Err: Error;
};
Delete an ICRC-7ext Collection
deleteCollection : (collectionId: nat) -> variant {
Ok: nat; // collectionId
Err: Error; };
Add Token to Collection
addToCollection: (collectionId: nat, tokenId: nat) -> variant {
Ok: (nat, nat); // collectionId, tokenId
Err: Error; };
Remove Token from Collection
removeFromCollection: (collectionId: nat, tokenId: nat) -> variant {
Ok: (nat, nat); // collectionId, tokenId
Err: Error; };
Rationale
The introduction of these methods enables a more flexible and dynamic approach to NFT collection management, facilitating the growth and diversification of NFT ecosystems on the Internet Computer.
Backward Compatibility
This proposal is designed to be fully backward compatible with ICRC-7.
Security Considerations
Careful consideration should be given to the implementation of these methods to ensure the security and integrity of NFT collections.