Skip to content

Commit

Permalink
Merge pull request #99 from ripple/Int64_to_Base10_update
Browse files Browse the repository at this point in the history
Change UInt64-Base10
  • Loading branch information
DennisDawson authored Oct 16, 2024
2 parents 300639c + 2ed3024 commit c2d3635
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 12 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added docs/.DS_Store
Binary file not shown.
Binary file added docs/xls-33d-multi-purpose-tokens/.DS_Store
Binary file not shown.
4 changes: 0 additions & 4 deletions docs/xls-33d-multi-purpose-tokens/multi-purpose-tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,3 @@ On a technical level, MPTs provide a fundamentally different way to represent fu
On a usage level, MPTs provide a straightforward conceptual model compared to trustlines and rippling. Developers can more easily build web3 applications around `MPToken` and `MPTokenIssuance` objects, with some similarities to the conceptual model of XLS-20 NFTs. It is also simpler for ordinary users to understand what tokens are available, what tokens they have issued, and what they hold in their wallet. For both issuers and holders of MPTs, there will typically be a smaller XRP reserve compared to the equivalent representations with IOU trustlines.

MPTs are intended to be complementary to IOUs. While there might be use cases where either MPTs and IOUs might be suitable, we foresee a need for both over the long term. There will be use cases such as credit lines for lending and borrowing that might be better represented by IOUs long term. As the MPT feature set should evolve in an incremental manner to unlock more common use cases first and deliver other feature support at a later time. During the MPT development period, some cases might still be better represented by an IOU, then later be better supported with MPTs.

## Hexadecimal Values

Several MPT amount fields (which have the internal type of `Uint64`) are stored as string representations of hexadecimal values in JSON (for example, `MaximumAmount`, `OutstandingAmount`, `MPTokenAmount`).
4 changes: 2 additions & 2 deletions docs/xls-33d-multi-purpose-tokens/reference/mpt_holders.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ An `mptoken` object has the following parameters:
|:-----------------------|:--------|:------------------------------------------|
| `account` | string | The account address of the holder who owns the `MPToken`. |
| `flags` | number | The flags assigned to the`MPToken` object. |
| `mpt_amount` | string | Hex-encoded amount of the holder's balance. |
| `locked_amount` | string | Hex-encoded amount of the locked balance. (Can be omitted if the value is 0.) |
| `mpt_amount` | string | Base 10-encoded amount of the holder's balance. |
| `locked_amount` | string | Base 10-encoded amount of the locked balance. (Can be omitted if the value is 0.) |
| `mptoken_index` | string | Key of the `MPToken` object. |

#### Synthetic mpt_issuance_id field
Expand Down
4 changes: 2 additions & 2 deletions docs/xls-33d-multi-purpose-tokens/reference/mptoken.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ The `MPTokenID` is the result of SHA512-Half of the following values, concatenat
| LedgerEntryType | number | UInt16 | The value 0x007F, mapped to the string `MPToken`, indicates that this object describes an individual account's holding of an MPT. |
| `Account` | string | AccountID | The owner of the MPT. |
| `MPTokenIssuanceID` | string | UInt256 | The `MPTokenIssuance` identifier. |
| `MPTAmount` | string | UInt64 | This value specifies a positive amount of tokens currently held by the owner. Valid values for this field are between 0x0 and 0xFFFFFFFFFFFFFFFF. |
| `LockedAmount` | string | UInt64 | (Default) Specifies a positive amount of tokens that are currently held in a token holder's account but that are unavailable to be used by the token holder. Locked tokens might, for example, represent value currently being held in escrow, or value that is otherwise inaccessible to the token holder. The initial value is 0 in order to save space on the ledger for an empty MPT holding. |
| `MPTAmount` | string | UInt64 | This value specifies a non-negative amount of tokens currently held by the owner. Valid values for this field are base 10 integers between 0 and 9,223,372,036,854,775,807. |
| `LockedAmount` | string | UInt64 | (Default) Specifies a non-negative amount of tokens that are currently held in a token holder's account but that are unavailable to be used by the token holder. Locked tokens might, for example, represent value currently being held in escrow, or value that is otherwise inaccessible to the token holder. The initial value is 0 in order to save space on the ledger for an empty MPT holding. The value is expressed as a base 10 integer. |
| `Flags` | number | UInt32 | (Default) See [MPToken Flags](#mptoken-flags) |
| `PreviousTxnID` | string | Hash256 | Transaction ID of the transaction that most recently modified this object. |
| `PreviousTxnLgrSeq` | number | UInt32 | The sequence of the ledger that contains the transaction that most recently modified this object. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ The `MPTokenIssuanceID` is a 192-bit integer, concatenated in order:
| `Flags` | number | UInt32 | See [MPTokenIssuance Flags](#mptokenissuance-flags) |
| `Issuer` | string | AccountID | The address of the account that controls both the issuance amounts and characteristics of a particular fungible token. |
| `AssetScale` | number | UInt8 | An asset scale is the difference, in orders of magnitude, between a standard unit and a corresponding fractional unit. More formally, the asset scale is a non-negative integer (0, 1, 2, …) such that one standard unit equals 10^(-scale) of a corresponding fractional unit. If the fractional unit equals the standard unit, then the asset scale is 0. |
| `MaximumAmount` | string | UInt64 | This value is an unsigned number that specifies the maximum number of MPTs that can be distributed to non-issuing accounts (i.e., minted). For issuances that do not have a maximum limit, this value should be set to 0xFFFFFFFFFFFFFFFF. |
| `OutstandingAmount` | string | UInt64 | Specifies the sum of all token amounts that have been minted to all token holders. This value can be stored on ledger as a default type so that when its value is 0 it takes up less space on ledger. This value is increased whenever an issuer pays MPTs to a non-issuer account, and decreased whenever a non-issuer pays MPTs into the issuing account. |
| `LockedAmount` | string | UInt64 | A positive amount of tokens that are currently held in a token holder's account, but are unavailable to be used by the token holder. Locked tokens might, for example, represent value currently being held in escrow, or value that is otherwise inaccessible to the token holder. This value is stored as a default value such that its initial value is 0, in order to save space on the ledger for an empty MPT holding. |
| `MaximumAmount` | string | UInt64 | This value is an unsigned base 10 number that specifies the maximum number of MPTs that can be distributed to non-issuing accounts (that is, minted). For issuances that do not have a maximum limit, set this value to 9,223,372,036,854,775,807. |
| `OutstandingAmount` | string | UInt64 | Specifies the base 10 sum of all token amounts that have been minted to all token holders. This value can be stored on ledger as a default type so that when its value is 0 it takes up less space on ledger. This value is increased whenever an issuer pays MPTs to a non-issuer account, and decreased whenever a non-issuer pays MPTs into the issuing account. |
| `TransferFee` | number | UInt16 | This value specifies the fee, in tenths of a basis point, charged by the issuer for secondary sales of the token, if such sales are allowed at all. Valid values for this field are between 0 and 50,000 inclusive. A value of 1 is equivalent to 1/10 of a basis point or 0.001%, allowing transfer rates between 0% and 50%. A `TransferFee` of 50,000 corresponds to 50%. The default value for this field is 0. Any decimals in the transfer fee are rounded down. The fee can be rounded down to zero if the payment is small. Issuers should make sure that their MPT's `AssetScale` is large enough. |
| `MPTokenMetadata` | string | Blob | Arbitrary metadata about this issuance, in hex format. The limit for this field is 1024 bytes. |
| `PreviousTxnID` | string | Hash256 | Transaction ID of the transaction that most recently modified this object. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Example MPTokenIssuanceCreate transaction
| `AssetScale` | number | UInt8 | (Optional) An asset scale is the difference, in orders of magnitude, between a standard unit and a corresponding fractional unit. More formally, the asset scale is a non-negative integer (0, 1, 2, …) such that one standard unit equals 10^(-scale) of a corresponding fractional unit. If the fractional unit equals the standard unit, then the asset scale is 0. Note that this value is optional, and will default to 0 if not supplied. |
| `Flags` | number | UInt16 | Specifies the flags for this transaction. See [MPTokenIssuanceCreate Flags](#mptokenissuancecreate-flags). |
| `TransferFee` | number | UInt16 | (Optional) The value specifies the fee to charged by the issuer for secondary sales of the Token, if such sales are allowed. Valid values for this field are between 0 and 50,000 inclusive, allowing transfer rates of between 0.000% and 50.000% in increments of 0.001. The field _must not_ be present if the tfMPTCanTransfer flag is not set. If it is, the transaction should fail and a fee should be claimed. |
| `MaximumAmount` | string | UInt64 | (Optional) The maximum asset amount of this token that should ever be issued, as a hex-encoded string. |
| `MaximumAmount` | string | UInt64 | (Optional) The maximum asset amount of this token that should ever be issued, as a base 10 encoded string. For issuances that do not have a maximum limit, set this value to 9,223,372,036,854,775,807. |
| `MPTokenMetadata` | string | Blob | Arbitrary metadata about this issuance, in hex format. The limit for this field is 1024 bytes. |

## MPTokenIssuanceCreate Flags
Expand Down

0 comments on commit c2d3635

Please sign in to comment.