Introduce High-Value FT (HVFT) Support — Create, Transfer & Burn Enhancements#405
Draft
Allen-Cherian wants to merge 22 commits intodevelopmentfrom
Draft
Introduce High-Value FT (HVFT) Support — Create, Transfer & Burn Enhancements#405Allen-Cherian wants to merge 22 commits intodevelopmentfrom
Allen-Cherian wants to merge 22 commits intodevelopmentfrom
Conversation
…will be created so that the FTNumber is tracked properly and the FTs are created according ti the number read from the FtIndex table
…oesn't exist then the count of the FTs is fetched from the FTTokenTable and is updated in the FTIndex table
… is reead from ftindex table,if not read from the provided flag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces High-Value Fungible Tokens (HVFT) functionality across the entire FT lifecycle, including creation, transfer, and burn operations. The changes encompass new API request parameters, updated RBT locking logic, and corresponding database schema modifications to support this new token type.
Key Features Added
1. High-Value FT Creation (
/api/create-ft)Added support for creating High-Value FTs via the following new request parameters:
is_high_value: A boolean flag to identify the token as a High-Value FT.from_rbt: Indicates if RBT is used for the FT creation.ft_value: Defines the per-token value for HVFTs.RBT Lock Calculation Change
The RBT count to be locked is now dynamically calculated for HVFTs using the formula:
RBTs locked = ft_count * ft_value`
New DB Enhancements:
is_high_value_fttoFTTableto identify high-value token sets.rbt_lock_statustoFTTokenTableto track the RBT lock state per token.FTIndexTableto maintain the latest index at which a High-Value FT was created.2. FT Transfer Enhancements (
/api/transfer-ft)The existing transfer API has been extended to support High-Value FTs. The request body has been updated to include:
is_high_valueft_valuefrom_rbt(if applicable)This ensures correct validation and transfer logic for HVFTs, maintaining consistency with the new database schema.
3. FT Burn Implementation (
/api/burn-ft)Introduced new burn functionality for both standard and high-value FTs. The burn logic now correctly identifies and handles high-value tokens with the new
high_value_ftflag.Request Body Example:
{ "did": "bafybmiguvjk5nqxjmrdhfna42dzpgloy47d7r3vncsax6nxe3irir4vkdy", "from_rbt": false, "ft_count": 1, "ft_name": "HVFT", "high_value_ft": true }