From 9696d03573d713e3dbf255fff7eeef530f7e3a78 Mon Sep 17 00:00:00 2001 From: Asten <0xasten@gmail.com> Date: Fri, 13 Sep 2024 18:09:11 +0800 Subject: [PATCH 1/3] Fix Transfer amount for 1 token in token-2022.md --- docs/src/token-2022.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/token-2022.md b/docs/src/token-2022.md index fee446e6be0..ea261a10b00 100644 --- a/docs/src/token-2022.md +++ b/docs/src/token-2022.md @@ -43,7 +43,7 @@ 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, +byte. For example, if you want to transfer 1 tokens on a mint with 2 decimals, you create a `TransferChecked` instruction, with this byte-represented data: ``` From ed7132878ade14ff7ccd615bfc79f8e0d9eb552a Mon Sep 17 00:00:00 2001 From: Asten <0xasten@gmail.com> Date: Fri, 13 Sep 2024 19:38:35 +0800 Subject: [PATCH 2/3] Change the token number to 0.75 for clarity Co-authored-by: Jon C --- docs/src/token-2022.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/src/token-2022.md b/docs/src/token-2022.md index ea261a10b00..84709493d15 100644 --- a/docs/src/token-2022.md +++ b/docs/src/token-2022.md @@ -43,8 +43,9 @@ 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 1 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] From c27f5134c99cc357fdcbb7ce418400a7f39a7087 Mon Sep 17 00:00:00 2001 From: Asten <0xasten@gmail.com> Date: Fri, 13 Sep 2024 19:41:02 +0800 Subject: [PATCH 3/3] Update the byte-represented data --- docs/src/token-2022.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/token-2022.md b/docs/src/token-2022.md index 84709493d15..21fb3d866b2 100644 --- a/docs/src/token-2022.md +++ b/docs/src/token-2022.md @@ -48,9 +48,9 @@ then the transfer amount is 75 tokens. You create a `TransferChecked` instructio 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 ```