fix: update anchor to 0.30.1 and fix breaking changes
- anchor-lang: 0.29.0 -> 0.30.1 - anchor-spl: 0.29.0 -> 0.30.1 - solana-program: 1.16.20 -> 2.x (inferred from anchor-spl) - Fix token_prog -> token_program naming - Fix ctx.bumps access for Anchor 0.30.x API - Update declare_id! with new vanity address Build now passes successfully.
This commit is contained in:
Generated
+241
-1091
File diff suppressed because it is too large
Load Diff
@@ -16,6 +16,5 @@ cpi = ["no-entrypoint"]
|
|||||||
default = []
|
default = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anchor-lang = { version = "0.29.0", features = ["init-if-needed"] }
|
anchor-lang = { version = "0.30.1", features = ["init-if-needed"] }
|
||||||
anchor-spl = { version = "0.29.0", features = ["metadata"] }
|
anchor-spl = { version = "0.30.1", features = ["metadata"] }
|
||||||
solana-program = "=1.16.20"
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use anchor_lang::prelude::*;
|
use anchor_lang::prelude::*;
|
||||||
use anchor_spl::token::{self, Burn, Mint, MintTo, Token, TokenAccount};
|
use anchor_spl::token::{self, Burn, Mint, MintTo, Token, TokenAccount};
|
||||||
|
|
||||||
declare_id!("CoopCredits111111111111111111111111111111111");
|
declare_id!("CoopYdmSCUXqtcPPknkEHn4nSFXAiYQFMsH6orLz1XBM");
|
||||||
|
|
||||||
pub const DECIMALS: u8 = 6;
|
pub const DECIMALS: u8 = 6;
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ pub mod coop_credits {
|
|||||||
ErrorCode::Unauthorized
|
ErrorCode::Unauthorized
|
||||||
);
|
);
|
||||||
|
|
||||||
let seeds = &[b"mint_auth", &[ctx.bumps.mint_auth]];
|
let seeds = &[b"mint_auth", std::slice::from_ref(&ctx.bumps.mint_auth)];
|
||||||
let signer = &[&seeds[..]];
|
let signer = &[&seeds[..]];
|
||||||
|
|
||||||
let cpi = MintTo {
|
let cpi = MintTo {
|
||||||
@@ -44,7 +44,7 @@ pub mod coop_credits {
|
|||||||
};
|
};
|
||||||
|
|
||||||
token::mint_to(
|
token::mint_to(
|
||||||
CpiContext::new_with_signer(ctx.accounts.token_prog.to_account_info(), cpi, signer),
|
CpiContext::new_with_signer(ctx.accounts.token_program.to_account_info(), cpi, signer),
|
||||||
amount,
|
amount,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ pub mod coop_credits {
|
|||||||
};
|
};
|
||||||
|
|
||||||
token::burn(
|
token::burn(
|
||||||
CpiContext::new(ctx.accounts.token_prog.to_account_info(), cpi),
|
CpiContext::new(ctx.accounts.token_program.to_account_info(), cpi),
|
||||||
amount,
|
amount,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ pub struct Initialize<'info> {
|
|||||||
pub authority: Signer<'info>,
|
pub authority: Signer<'info>,
|
||||||
|
|
||||||
pub system_program: Program<'info, System>,
|
pub system_program: Program<'info, System>,
|
||||||
pub token_prog: Program<'info, Token>,
|
pub token_program: Program<'info, Token>,
|
||||||
pub rent: Sysvar<'info, Rent>,
|
pub rent: Sysvar<'info, Rent>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ pub struct MintToUser<'info> {
|
|||||||
pub authority: Signer<'info>,
|
pub authority: Signer<'info>,
|
||||||
|
|
||||||
pub system_program: Program<'info, System>,
|
pub system_program: Program<'info, System>,
|
||||||
pub token_prog: Program<'info, Token>,
|
pub token_program: Program<'info, Token>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Accounts)]
|
#[derive(Accounts)]
|
||||||
@@ -196,7 +196,7 @@ pub struct BurnFromUser<'info> {
|
|||||||
pub user: Signer<'info>,
|
pub user: Signer<'info>,
|
||||||
|
|
||||||
pub system_program: Program<'info, System>,
|
pub system_program: Program<'info, System>,
|
||||||
pub token_prog: Program<'info, Token>,
|
pub token_program: Program<'info, Token>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Accounts)]
|
#[derive(Accounts)]
|
||||||
|
|||||||
Reference in New Issue
Block a user