Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change UInt64-Base10 #99

Merged
merged 7 commits into from
Oct 16, 2024
Merged

Change UInt64-Base10 #99

merged 7 commits into from
Oct 16, 2024

Conversation

DennisDawson
Copy link
Contributor

Update docs to reflect change from UInt64 values to Base10, per https://ripplelabs.atlassian.net/jira/software/projects/DEFI/issues/DEFI-247

Update docs to reflect change from UInt64 values to Base10
OwnerNode should remain UInt64. I was overzealous.
Copy link
Contributor

@mDuo13 mDuo13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on my understanding of the change on the rippled side, I think these edits miss the mark slightly. The internal representation (the canonical binary format) is the same, but for some reason rippled's APIs would return these values as hexadecimal strings instead of base-10 number strings, e.g. the number ten was previous returned as "a" and it'll now be returned as "10".

So in both cases the internal format is UInt64 and the JSON format is string, but the format of the string is now a base-10 instead of base-16 representation.

docs/xls-33d-multi-purpose-tokens/reference/mptoken.md Outdated Show resolved Hide resolved
docs/xls-33d-multi-purpose-tokens/reference/mptoken.md Outdated Show resolved Hide resolved
| `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 | Base10 | 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 18,446,744,073,709,551,615. |
| `OutstandingAmount` | string | Base10 | 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 | Base10 | 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. |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `LockedAmount` | string | Base10 | 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. |
| `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. |

should also say that its base 10 in the description

| `LockedAmount` | string | Base10 | 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. |
| `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 base 10 value such that its initial value is 0, in order to save space on the ledger for an empty MPT holding. |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LockedAmount has been removed everywhere. Haven't updated the spec yet, but might be convenient to remove this field in the PR while we are at it.

Copy link

@shawnxie999 shawnxie999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor comment that is unrelated to the PR and could be address later. looks good overall

Copy link
Collaborator

@oeggert oeggert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Left a question about terminology regarding base-10 vs decimal. Also I think the .DS_Store files were pushed by accident?

@@ -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. |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker, but should we be saying base 10-encoded or decimal/hexadecimal? I don't have strong opinion either way, but I want to standardize the language we use in this instance.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're going to say "hex" elsewhere, then I think it makes more sense to say "decimal" here.

Per Shawn Xie.
Copy link

@shawnxie999 shawnxie999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

Copy link
Contributor

@mDuo13 mDuo13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming the .DS_Store files are removed, looks OK to me

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should be removed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't add .DS_Store files to the repo (they're some sort of Mac OS caching thing)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one too

@DennisDawson DennisDawson merged commit c2d3635 into main Oct 16, 2024
2 of 4 checks passed
@DennisDawson DennisDawson deleted the Int64_to_Base10_update branch October 16, 2024 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants