jpcaulfi 2 роки тому
батько
коміт
78e67c92a1

+ 46 - 8
tokens/create-token/README.md

@@ -2,11 +2,49 @@
 
 This example demonstrates how to create an SPL Token on Solana with some metadata such as a token symbol and icon.
 
-### :key: Keys:
-
-- SPL Tokens by default have **9 decimals**, and **NFTs have 0 decimals**. "Decimals" here means the number of decimal; ie. a token with 3 decimals will be tracked in increments of 0.001.   
-- You can use [Metaplex's Token Metadata Program](https://docs.metaplex.com/) to create metadata for your token.
-- Steps:
-    1. Create an account for the Mint.
-    2. Initialize that account as a Mint Account.
-    3. Create a metadata account associated with that Mint Account.
+---
+All tokens - including Non-Fungible Tokens (NFTs) are SPL Tokens on Solana.   
+   
+They follow the SPL Token standard (similar to ERC-20).   
+   
+```text
+Default SPL Tokens  :   9 decimals
+NFTs                :   0 decimals
+```
+### How Decimals Work
+```text
+Consider token JOE with 9 decimals:
+
+    1 JOE = quantity * 10 ^ (-1 * decimals) = 1 * 10 ^ (-1 * 9) = 0.000000001
+```
+### Mint & Metadata
+SPL Tokens on Solana are referred to as a Mint.   
+   
+A Mint is defined by a specific type of account on Solana that describes information about a token:
+```TypeScript
+{
+    isInitialized,
+    supply,             // The current supply of this token mint on Solana
+    decimals,           // The number of decimals this mint breaks down to
+    mintAuthority,      // The account who can authorize minting of new tokens
+    freezeAuthority,    // The account who can authorize freezing of tokens
+}
+```
+Any metadata about this Mint - such as a nickname, symbol, or image - is stored in a **separate** account called a Metadata Account:
+```TypeScript
+{
+    title,
+    symbol,
+    uri,                // The URI to the hosted image
+}
+```
+
+
+> Project Metaplex is the standard for SPL Token metadata on Solana   
+> You can use [Metaplex's Token Metadata Program](https://docs.metaplex.com/) to create metadata for your token.
+
+
+### Steps to Create an SPL Token
+1. Create an account for the Mint.
+2. Initialize that account as a Mint Account.
+3. Create a metadata account associated with that Mint Account.

+ 0 - 1
tokens/mint-freeze-authorities/README.md

@@ -1 +0,0 @@
-# Mint & Freeze Authorities

+ 27 - 1
tokens/nft-minter/README.md

@@ -1 +1,27 @@
-# NFT Minter
+# NFT Minter
+
+Minting NFTs is exactly the same as [minting any SPL Token on Solana](../spl-token-minter/), except for immediately after the actual minting has occurred.   
+   
+What does this mean? Well, when you mint SPL Tokens, you can attach a fixed supply, but in most cases you can continue to mint new tokens at will - increasing the supply of that token.   
+   
+With an NFT, you're supposed to only have **one**.   
+   
+So, how do we ensure only one single token can be minted for any NFT?
+
+---
+
+We have to disable minting by changing the Mint Authority on the Mint.   
+   
+> The Mint Authority is the account that is permitted to mint new tokens into supply.
+   
+If we remove this authority - effectively setting it to `null` - we can disable minting of new tokens for this Mint.   
+   
+> By design, **this is irreversible**.   
+   
+---
+
+Although we can set this authority to `null` manually, we can also make use of Metaplex again, this time to mark our NFT as Limited Edition.   
+   
+When we use an Edition - such as a Master Edition - for our NFT, we get some extra metadata associated with our NFT and we also get our Mint Authority deactivated by delegating this authority to the Master Edition account.   
+   
+This will effectively disable future minting, but make sure you understand the ramifications of having the Master Edition account be the Mint Authority - rather than setting it permanently to `null`.

+ 23 - 1
tokens/spl-token-minter/README.md

@@ -1 +1,23 @@
-# SPL Token Minter
+# SPL Token Minter
+
+Minting SPL Tokens is a conceptually straightforward process.   
+   
+The only tricky part is understanding how Solana tracks users' balance of SPL Tokens.   
+   
+---
+
+After all, we know every account on Solana by default tracks that account's balance of SOL (the native token), but how could every account on Solana possibly track it's own balance of *any possible* SPL Token on the Solana network?   
+   
+TL/DR it's impossible. Instead, we have to use separate accounts that are specifically configured per SPL Token. These are called **Associated Token Accounts**.   
+   
+---
+For example, if I create the JOE token, and I want to know what someone's balance of JOE is, I would need to do the following:
+```text
+1. Create the JOE token
+2. Create an Associated Token Account for this user's wallet to track his/her balance of JOE
+3. Mint or transfer JOE token to their JOE Associated Token Account
+```
+
+---
+
+Thus, you can think of Associated Token Accounts as simple counters, which point to a Mint and a Wallet. They simply say "here's the balance of this particular Mint for this particular person's Wallet".

+ 7 - 1
tokens/transfer-tokens/README.md

@@ -1 +1,7 @@
-# Transfer Tokens
+# Transfer Tokens
+
+Just like with minting, transfers of SPL Tokens are conducted between Associated Token Accounts.   
+   
+You can use the `transfer()` function provided by the SPL Token Program to conduct a transfer of any SPL Token with the appropriate permissions.   
+   
+Check out [SPL Token Minter](../spl-token-minter) or [NFT Minter](../nft-minter) to learn more about Associated Token Accounts.