HIP-796: Add Lockable Fractional Amounts of Fungible Tokens on Hedera #797
Replies: 7 comments 2 replies
-
This proposed HIP - for a very interesting and important feature - has a lot of moving parts and though the wording seems clear I can’t help but think it would be more solid if it included some diagrams and/or pseudocode to make things especially concrete. There’s a lot of room for implementation fuzziness to sneak in to a big pile of words. At least if there were diagrams and/or pseudocode a contradiction between the two could be noticed and addressed - it might be either the words or the diagram/code - whereas as it stands things might slip though the implementation. And not just contradictions, but also holes. In the same way, additional tables would be useful, e.g., which combination of parameters to APIs are valid and which are not? E.g., some of these APIs have 4 "buckets" on 2-dimensions: fungible vs non-fungible, and token-definition-id vs partition-id. It's not clear that all parameters of some of these APIs are acceptable to all 4 buckets. (And I'm not talking about the difference between "amount" and "serial#", that's clear enough.) |
Beta Was this translation helpful? Give feedback.
-
(here) The first |
Beta Was this translation helpful? Give feedback.
-
(here) What is the purpose of |
Beta Was this translation helpful? Give feedback.
-
(here) I believe the first line of this table should read |
Beta Was this translation helpful? Give feedback.
-
Suggestions for missing content
|
Beta Was this translation helpful? Give feedback.
-
Updated Smart Contract section struct TokenPartitionInput {
/**
* The memo associated with the partition (UTF-8 encoding max 100 bytes)
*/
string memo;
/**
* The publicly visible name of the partition. The partition name is specified as a Unicode
* string. Its UTF-8 encoding cannot exceed 100 bytes, and cannot contain the 0 byte (NUL).
* This name is not unique within the ledger.
*/
string name;
/**
* The token (either FUNGIBLE_COMMON or NON_FUNGIBLE_UNIQUE) that this partition is a part of.
*/
address parentToken;
}
struct TokenPartitionInfo {
/**
* The creation time of the partition
*/
int64 creationTime;
/**
* The memo associated with the partition (UTF-8 encoding max 100 bytes)
*/
string memo;
/**
* The publicly visible name of the partition. The partition name is specified as a Unicode
* string. Its UTF-8 encoding cannot exceed 100 bytes, and cannot contain the 0 byte (NUL).
* This name is not unique within the ledger.
*/
string name;
/**
* The token (either FUNGIBLE_COMMON or NON_FUNGIBLE_UNIQUE) that this partition is a part of.
*/
address parentToken;
/**
* The address of the token partition
*/
address partition;
}
struct HederaToken {
...
// list of token partitions on this token
TokenPartitionInfo[] partitions;
}
struct TokenKey {
// bit field representing the key type. Keys of all types that have corresponding bits set to 1
// will be created for the token.
// ...
// 7th bit: lockKey
// 8th bit: partitionKey
// 9th bit: partitionMoveKey
// 10th bit: ignored
uint keyType;
// the value that will be set to the key type
KeyValue key;
}
struct TokenCreateResponse {
address partition;
}
struct TokenAmount {
int64 amount;
int64[] serialNumbers;
}
interface IHederaTokenService {
...
// new versions of existing functions
function createFungibleToken(HederaToken memory token, int64 initialTotalSupply, int32 decimals) external payable returns (int64 responseCode, address tokenAddress, TokenCreateResponse memory tokenCreateResponse);
function createFungibleTokenWithCustomFees(HederaToken memory token, int64 initialTotalSupply, int32 decimals, FixedFee[] memory fixedFees, FractionalFee[] memory fractionalFees) external payable returns (int64 responseCode, address tokenAddress, TokenCreateResponse memory tokenCreateResponse);
function createNonFungibleToken(HederaToken memory token) external payable returns (int64 responseCode, address tokenAddress, TokenCreateResponse memory tokenCreateResponse);
function createNonFungibleTokenWithCustomFees(HederaToken memory token, FixedFee[] memory fixedFees, RoyaltyFee[] memory royaltyFees) external payable returns (int64 responseCode, address tokenAddress, TokenCreateResponse memory tokenCreateResponse);
// new functions
function createTokenPartition(TokenPartitionInput memory tokenPartitionInput) external returns (uint256 responseCode, address tokenPartition);
function deleteTokenPartition(address tokenPartition) external returns (uint256 responseCode);
function getLockedTokenAmount(address token, address account) external returns (int64 responseCode, TokenAmount memory tokenAmount);
function getTokenPartitionInfo(address token) external returns (int64 responseCode, TokenPartitionInfo memory tokenPartitionInfo);
function isLocked(address token, address account, int64[] memory serialNumbers) external returns (int64 responseCode, bool locked);
function lockToken(address token, address account, int64 amount, int64[] memory serialNumbers) external returns (uint256 responseCode);
function unlockToken(address token, address account, int64 amount, int64[] memory serialNumbers) external returns (uint256 responseCode);
function updateTokenPartition(address tokenPartition, TokenPartitionInfo memory tokenPartitionInfo) external returns (uint256 responseCode);
}
Along with the update hashes and signatures
|
Beta Was this translation helpful? Give feedback.
-
PROPOSAL FOR PLANNING THE SEGMENTATION AND NUMBER OF CHARACTERS FOR WALLET CODES RELATED TO IDENTITY Hedera's wallet token ID has a structure that is far superior to wallet codes on all other platforms
Based on these advantages, I would like to propose a proposal for the allocation of numbers according to the structure of the wallet code hedera .. . as follows As I observe at the present time, with typical examples such as IKAD learning certificate nfts, or for example Topic Messages Please share and interact, send this suggestions and ideas to hedera developers |
Beta Was this translation helpful? Give feedback.
-
Opening up discussion for:
#796
Adds the ability to partition fungible and non-fungible tokens held by an account, and to lock a subset of tokens in an account or account partition, preventing those locked tokens from being transferred.
Beta Was this translation helpful? Give feedback.
All reactions