@@ -24,7 +24,7 @@ The Token Program's source is available on
24
24
25
25
The on-chain Token Program is written in Rust and available on crates.io as
26
26
[ spl-token] ( https://docs.rs/spl-token ) . The program's [ instruction interface
27
- documentation] ( https://docs.rs/spl-token/1 .0.2 /spl_token/instruction/enum.TokenInstruction.html )
27
+ documentation] ( https://docs.rs/spl-token/2 .0.1 /spl_token/instruction/enum.TokenInstruction.html )
28
28
can also be found there.
29
29
30
30
Auto-generated C bindings are also available for the on-chain Token Program and
@@ -33,7 +33,7 @@ available
33
33
34
34
[ Javascript
35
35
bindings] ( https://github.com/solana-labs/solana-program-library/blob/master/token/js/client/token.js )
36
- are available that support loading the Token Program on to a chain and issuing
36
+ are available that support loading the Token Program on to a chain and issue
37
37
instructions.
38
38
39
39
## Command-line Utility
@@ -159,24 +159,27 @@ CqAxDdBRnawzx9q4PYM3wrybLHBhDZ4P6BTV13WsRJYJ AQoKYV7tYpTrFZN6P5oUufbQKAUr9mNYGe1
159
159
### Creating a new token type
160
160
161
161
A new token type can be created by initializing a new Mint with the
162
- ` InitializeMint ` instruction. The Mint is used to create or "Mint " new tokens,
162
+ ` InitializeMint ` instruction. The Mint is used to create or "mint " new tokens,
163
163
and these tokens are stored in Accounts. A Mint is associated with each
164
164
Account, which means that the total supply of a particular token type is equal
165
165
to the balances of all the associated Accounts.
166
166
167
- A Mint can either be configured with a fixed-supply or non-fixed supply. The
168
- total supply of a fixed-supply Mint is determined during initialization and
169
- deposited into a provided destination account. A non-fixed-supply Mint also has
170
- an owner associated with it who has the authority to create new tokens in the
171
- future with the ` MintTo ` instruction. Both types of Mints can ` Burn ` tokens to
172
- decrease supply.ß
173
-
174
167
It's important to note that the ` InitializeMint ` instruction does not require
175
168
the Solana account being initialized also be a signer. The ` InitializeMint `
176
169
instruction should be atomically processed with the system instruction that
177
170
creates the Solana account by including both instructions in the same
178
171
transaction.
179
172
173
+ Once a Mint is initialized, the ` mint_authority ` can create new tokens using the
174
+ ` MintTo ` instruction. As long as a Mint contains a valid ` mint_authority ` , the
175
+ Mint is considered to have a non-fixed supply, and the ` mint_authority ` can
176
+ create new tokens with the ` MintTo ` instruction at any time. The ` SetAuthority `
177
+ instruction can be used to irreversibly set the Mint's authority to ` None ` ,
178
+ rendering the Mint's supply fixed. No further tokens can ever be Minted.
179
+
180
+ Token supply can be reduced at any time by issuing a ` Burn ` instruction which
181
+ removes and discards tokens from an Account.
182
+
180
183
### Creating accounts
181
184
182
185
Accounts hold token balances and are created using the ` InitializeAccount `
@@ -205,13 +208,13 @@ to another Account, effectively removing the token from circulation permanently.
205
208
206
209
Account owners may delegate authority over some or all of their token balance
207
210
using the ` Approve ` instruction. Delegated authorities may transfer or burn up
208
- to the amount they've been delegated. Authority delegation may be revoked by
209
- the Account's owner via the ` Revoke ` instruction.
211
+ to the amount they've been delegated. Authority delegation may be revoked by the
212
+ Account's owner via the ` Revoke ` instruction.
210
213
211
214
### Multisignatures
212
215
213
- M of N multisignatures are supported and can be used in place of Mint owners, or
214
- Account owners or delegates. Multisignature owners or delegates must be
216
+ M of N multisignatures are supported and can be used in place of Mint
217
+ authorities or Account owners or delegates. Multisignature authorities must be
215
218
initialized with the ` InitializeMultisig ` instruction. Initialization specifies
216
219
the set of N public keys that are valid and the number M of those N that must be
217
220
present as instruction signers for the authority to be legitimate.
@@ -222,6 +225,15 @@ require the Solana account being initialized also be a signer. The
222
225
instruction that creates the Solana account by including both instructions in
223
226
the same transaction.
224
227
228
+ ### Freezing accounts
229
+
230
+ The Mint may also contain a ` freeze_authority ` can be used to issue
231
+ ` FreezeAccount ` instructions that will render an Account unusable. Token
232
+ instructions that include a frozen account will fail until the Account is thawed
233
+ using the ` ThawAccount ` instruction. The ` SetAuthority ` instruction can be used
234
+ to change a Mint's ` freeze_authority ` . If a Mint's ` freeze_authority ` is set to
235
+ ` None ` then account freezing is permanently disabled
236
+
225
237
### Wrapping SOL
226
238
227
239
The Token Program can be used to wrap native SOL. Doing so allows native SOL to
@@ -242,9 +254,16 @@ These accounts have a few unique behaviors
242
254
- Burning is not supported
243
255
- When closing an Account the balance may be non-zero.
244
256
257
+ ### Rent-exemption
258
+
259
+ To ensure a reliable calculation of supply, a consistency valid Mint, and
260
+ consistently valid Multisig accounts all Solana accounts holding a Account,
261
+ Mint, or Multisig must contain enough SOL to be considered (rent
262
+ exempt)[ https://docs.solana.com/implemented-proposals/rent ]
263
+
245
264
### Closing accounts
246
265
247
266
An account may be closed using the ` CloseAccount ` instruction. When closing an
248
267
Account, all remaining SOL will be transferred to another Solana account
249
- (doesn't have to be associated with the Token Program). Non-native accounts
250
- must have a balance of zero to be closed.
268
+ (doesn't have to be associated with the Token Program). Non-native Accounts must
269
+ have a balance of zero to be closed.
0 commit comments