Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit b2b2044

Browse files
Tyera Eulbergmvines
authored andcommitted
Require valid Mint for InitializeAccount
1 parent 0b71752 commit b2b2044

File tree

3 files changed

+155
-109
lines changed

3 files changed

+155
-109
lines changed

token/program/src/error.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ pub enum TokenError {
1313
/// Insufficient funds for the operation requested.
1414
#[error("Insufficient funds")]
1515
InsufficientFunds,
16+
/// Invalid Mint.
17+
#[error("Invalid Mint")]
18+
InvalidMint,
1619
/// Account not associated with this Mint.
1720
#[error("Account not associated with this Mint")]
1821
MintMismatch,

token/program/src/instruction.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ pub enum TokenInstruction {
3737
/// The freeze authority/multisignature of the mint.
3838
freeze_authority: COption<Pubkey>,
3939
},
40-
/// Initializes a new account to hold tokens. If this account is associated with the native mint
41-
/// then the token balance of the initialized account will be equal to the amount of SOL in the account.
40+
/// Initializes a new account to hold tokens. If this account is associated with the native
41+
/// mint then the token balance of the initialized account will be equal to the amount of SOL
42+
/// in the account. If this account is associated with another mint, that mint must be
43+
/// initialized before this command can succeed.
4244
///
4345
/// The `InitializeAccount` instruction requires no signers and MUST be included within
4446
/// the same Transaction as the system program's `CreateInstruction` that creates the account

0 commit comments

Comments
 (0)