Skip to content

Commit

Permalink
Fix Transfer amount for 1 token in token-2022.md (#7271)
Browse files Browse the repository at this point in the history
* Fix Transfer amount for 1 token in token-2022.md

* Change the token number to 0.75 for clarity

Co-authored-by: Jon C <[email protected]>

* Update the byte-represented data

---------

Co-authored-by: Jon C <[email protected]>
  • Loading branch information
0xAsten and joncinque authored Sep 13, 2024
1 parent 3567838 commit 992c299
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions docs/src/token-2022.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ Token-2022 are a strict superset of Token.
### Instructions

Token-2022 supports the exact same instruction layouts as Token, byte for
byte. For example, if you want to transfer 100 tokens on a mint with 2 decimals,
you create a `TransferChecked` instruction, with this byte-represented data:
byte. For example, if you want to transfer 0.75 tokens in UI amount, on a mint with 2 decimals,
then the transfer amount is 75 tokens. You create a `TransferChecked` instruction, with
this byte-represented data:

```
[12, 100, 0, 0, 0, 0, 0, 0, 0, 2]
[12, 75, 0, 0, 0, 0, 0, 0, 0, 2]
^^ TransferChecked enum
^^^^^^^^^^^^^^^^^^^^^^^^ 100, as a little-endian 64-bit unsigned integer
^^^^^^^^^^^^^^^^^^^^^^^^ 75, as a little-endian 64-bit unsigned integer
^ 2, as a byte
```

Expand Down

0 comments on commit 992c299

Please sign in to comment.