diff --git a/solana/programs/staking/src/contexts/cancel_vesting.rs b/solana/programs/staking/src/contexts/cancel_vesting.rs index fb9cba44..49cfef0f 100644 --- a/solana/programs/staking/src/contexts/cancel_vesting.rs +++ b/solana/programs/staking/src/contexts/cancel_vesting.rs @@ -1,7 +1,6 @@ use anchor_lang::prelude::*; use anchor_spl::associated_token::AssociatedToken; -use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; - +use anchor_spl::token::{Mint, Token, TokenAccount}; use crate::context::{VESTING_BALANCE_SEED, VESTING_CONFIG_SEED, VEST_SEED, CONFIG_SEED}; use crate::error::VestingError; use crate::state::{Vesting, VestingBalance, VestingConfig}; @@ -15,13 +14,13 @@ pub struct CancelVesting<'info> { @ VestingError::InvalidVestingAdmin )] admin: Signer<'info>, - mint: InterfaceAccount<'info, Mint>, + mint: Account<'info, Mint>, #[account( associated_token::mint = mint, associated_token::authority = vester_ta.owner, associated_token::token_program = token_program )] - vester_ta: InterfaceAccount<'info, TokenAccount>, + vester_ta: Account<'info, TokenAccount>, #[account( mut, constraint = !config.finalized @ VestingError::VestingFinalized, // Vesting cannot be cancelled after vest is finalized @@ -51,7 +50,7 @@ pub struct CancelVesting<'info> { )] pub global_config: Box>, associated_token_program: Program<'info, AssociatedToken>, - token_program: Interface<'info, TokenInterface>, + token_program: Program<'info, Token>, system_program: Program<'info, System>, } diff --git a/solana/programs/staking/src/contexts/claim_vesting.rs b/solana/programs/staking/src/contexts/claim_vesting.rs index ae70ff37..1ae7b01b 100644 --- a/solana/programs/staking/src/contexts/claim_vesting.rs +++ b/solana/programs/staking/src/contexts/claim_vesting.rs @@ -8,9 +8,7 @@ use crate::{ }; use anchor_lang::prelude::*; use anchor_spl::associated_token::AssociatedToken; -use anchor_spl::token_interface::{ - transfer_checked, Mint, TokenAccount, TokenInterface, TransferChecked, -}; +use anchor_spl::token::{Mint, Token, TokenAccount, transfer_checked, TransferChecked}; use std::convert::TryInto; #[event_cpi] @@ -18,21 +16,21 @@ use std::convert::TryInto; pub struct ClaimVesting<'info> { #[account(mut)] vester: Signer<'info>, - mint: InterfaceAccount<'info, Mint>, + mint: Account<'info, Mint>, #[account( mut, associated_token::mint = mint, associated_token::authority = config, associated_token::token_program = token_program )] - vault: InterfaceAccount<'info, TokenAccount>, + vault: Account<'info, TokenAccount>, #[account( mut, associated_token::mint = mint, associated_token::authority = vester, associated_token::token_program = token_program )] - vester_ta: InterfaceAccount<'info, TokenAccount>, + vester_ta: Account<'info, TokenAccount>, #[account( mut, constraint = config.finalized @ VestingError::VestingUnfinalized, @@ -77,7 +75,7 @@ pub struct ClaimVesting<'info> { )] admin: AccountInfo<'info>, associated_token_program: Program<'info, AssociatedToken>, - token_program: Interface<'info, TokenInterface>, + token_program: Program<'info, Token>, system_program: Program<'info, System>, } diff --git a/solana/programs/staking/src/contexts/create_vesting.rs b/solana/programs/staking/src/contexts/create_vesting.rs index 65c6b4b7..8e7f7719 100644 --- a/solana/programs/staking/src/contexts/create_vesting.rs +++ b/solana/programs/staking/src/contexts/create_vesting.rs @@ -1,7 +1,6 @@ use anchor_lang::prelude::*; use anchor_spl::associated_token::AssociatedToken; -use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; - +use anchor_spl::token::{Mint, Token, TokenAccount}; use crate::context::{CONFIG_SEED, VESTING_BALANCE_SEED, VESTING_CONFIG_SEED, VEST_SEED}; use crate::error::VestingError; use crate::state::global_config::GlobalConfig; @@ -16,13 +15,13 @@ pub struct CreateVesting<'info> { @ VestingError::InvalidVestingAdmin )] admin: Signer<'info>, - mint: InterfaceAccount<'info, Mint>, + mint: Account<'info, Mint>, #[account( associated_token::mint = mint, associated_token::authority = vester_ta.owner, associated_token::token_program = token_program )] - vester_ta: InterfaceAccount<'info, TokenAccount>, + vester_ta: Account<'info, TokenAccount>, #[account( mut, constraint = !config.finalized @ VestingError::VestingFinalized, // A vest can only be created before a vest is finalized @@ -51,7 +50,7 @@ pub struct CreateVesting<'info> { )] pub global_config: Box>, associated_token_program: Program<'info, AssociatedToken>, - token_program: Interface<'info, TokenInterface>, + token_program: Program<'info, Token>, system_program: Program<'info, System>, } diff --git a/solana/programs/staking/src/contexts/create_vesting_balance.rs b/solana/programs/staking/src/contexts/create_vesting_balance.rs index 098f0d6e..38901739 100644 --- a/solana/programs/staking/src/contexts/create_vesting_balance.rs +++ b/solana/programs/staking/src/contexts/create_vesting_balance.rs @@ -4,7 +4,7 @@ use crate::state::global_config::GlobalConfig; use crate::state::{VestingBalance, VestingConfig}; use anchor_lang::prelude::*; use anchor_spl::associated_token::AssociatedToken; -use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; +use anchor_spl::token::{Mint, Token, TokenAccount}; #[derive(Accounts)] #[instruction()] @@ -15,7 +15,7 @@ pub struct CreateVestingBalance<'info> { @ VestingError::InvalidVestingAdmin )] admin: Signer<'info>, - mint: InterfaceAccount<'info, Mint>, + mint: Account<'info, Mint>, #[account( mut, seeds = [VESTING_CONFIG_SEED.as_bytes(), mint.key().as_ref(), config.seed.to_le_bytes().as_ref()], @@ -35,14 +35,14 @@ pub struct CreateVestingBalance<'info> { associated_token::authority = vester_ta.owner, associated_token::token_program = token_program )] - vester_ta: InterfaceAccount<'info, TokenAccount>, + vester_ta: Account<'info, TokenAccount>, #[account( seeds = [CONFIG_SEED.as_bytes()], bump = global_config.bump, )] pub global_config: Box>, associated_token_program: Program<'info, AssociatedToken>, - token_program: Interface<'info, TokenInterface>, + token_program: Program<'info, Token>, system_program: Program<'info, System>, } diff --git a/solana/programs/staking/src/contexts/finalize.rs b/solana/programs/staking/src/contexts/finalize.rs index 84ae620e..398fc53d 100644 --- a/solana/programs/staking/src/contexts/finalize.rs +++ b/solana/programs/staking/src/contexts/finalize.rs @@ -2,7 +2,7 @@ use crate::context::{VESTING_CONFIG_SEED, CONFIG_SEED}; use crate::error::VestingError; use crate::state::VestingConfig; use anchor_lang::prelude::*; -use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; +use anchor_spl::token::{Mint, Token, TokenAccount}; use crate::state::global_config::GlobalConfig; #[derive(Accounts)] @@ -13,14 +13,14 @@ pub struct Finalize<'info> { @ VestingError::InvalidVestingAdmin )] pub admin: Signer<'info>, - pub mint: InterfaceAccount<'info, Mint>, + pub mint: Account<'info, Mint>, #[account( mut, associated_token::mint = mint, associated_token::authority = config, associated_token::token_program = token_program )] - vault: InterfaceAccount<'info, TokenAccount>, + vault: Account<'info, TokenAccount>, #[account( mut, constraint = !config.finalized @ VestingError::VestingFinalized, @@ -33,7 +33,7 @@ pub struct Finalize<'info> { bump = global_config.bump, )] pub global_config: Box>, - token_program: Interface<'info, TokenInterface>, + token_program: Program<'info, Token>, } impl<'info> Finalize<'info> { diff --git a/solana/programs/staking/src/contexts/initialize.rs b/solana/programs/staking/src/contexts/initialize.rs index 995cfa15..ec89f823 100644 --- a/solana/programs/staking/src/contexts/initialize.rs +++ b/solana/programs/staking/src/contexts/initialize.rs @@ -4,7 +4,7 @@ use crate::state::global_config::GlobalConfig; use crate::state::VestingConfig; use anchor_lang::prelude::*; use anchor_spl::associated_token::AssociatedToken; -use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; +use anchor_spl::token::{Mint, Token, TokenAccount}; #[derive(Accounts)] #[instruction(seed: u64)] @@ -12,7 +12,7 @@ pub struct Initialize<'info> { #[account(mut)] admin: Signer<'info>, #[account(address = global_config.voting_token_mint)] - mint: InterfaceAccount<'info, Mint>, + mint: Account<'info, Mint>, // Initialize a vault for us to store our money in escrow for vesting #[account( init, @@ -21,13 +21,13 @@ pub struct Initialize<'info> { associated_token::authority = config, associated_token::token_program = token_program )] - vault: InterfaceAccount<'info, TokenAccount>, + vault: Account<'info, TokenAccount>, // Set a recovery address for recovering surplus funds from the contract #[account( token::mint = mint, token::token_program = token_program )] - recovery: InterfaceAccount<'info, TokenAccount>, + recovery: Account<'info, TokenAccount>, // Initialize a vesting config for a specific admin, mint and seed #[account( init, @@ -46,7 +46,7 @@ pub struct Initialize<'info> { global_config: Box>, associated_token_program: Program<'info, AssociatedToken>, - token_program: Interface<'info, TokenInterface>, + token_program: Program<'info, Token>, system_program: Program<'info, System>, } diff --git a/solana/programs/staking/src/contexts/transfer_vesting.rs b/solana/programs/staking/src/contexts/transfer_vesting.rs index f28a8c18..dfd833e7 100644 --- a/solana/programs/staking/src/contexts/transfer_vesting.rs +++ b/solana/programs/staking/src/contexts/transfer_vesting.rs @@ -9,28 +9,28 @@ use crate::state::{Vesting, VestingBalance, VestingConfig}; use crate::{error::ErrorCode, error::VestingError}; use anchor_lang::prelude::*; use anchor_spl::associated_token::AssociatedToken; -use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; +use anchor_spl::token::{Mint, Token, TokenAccount}; #[event_cpi] #[derive(Accounts)] pub struct TransferVesting<'info> { #[account(mut)] vester: Signer<'info>, - mint: Box>, + mint: Box>, #[account( mut, associated_token::mint = mint, associated_token::authority = vester_ta.owner, associated_token::token_program = token_program )] - vester_ta: Box>, + vester_ta: Box>, #[account( mut, associated_token::mint = mint, associated_token::authority = new_vester_ta.owner, associated_token::token_program = token_program )] - new_vester_ta: Box>, + new_vester_ta: Box>, #[account( mut, constraint = config.finalized @ VestingError::VestingUnfinalized, @@ -88,7 +88,7 @@ pub struct TransferVesting<'info> { pub new_stake_account_metadata: Option>>, associated_token_program: Program<'info, AssociatedToken>, - token_program: Interface<'info, TokenInterface>, + token_program: Program<'info, Token>, system_program: Program<'info, System>, } diff --git a/solana/programs/staking/src/contexts/withdraw_surplus.rs b/solana/programs/staking/src/contexts/withdraw_surplus.rs index b5af67c7..52d6fc2c 100644 --- a/solana/programs/staking/src/contexts/withdraw_surplus.rs +++ b/solana/programs/staking/src/contexts/withdraw_surplus.rs @@ -3,9 +3,7 @@ use crate::error::VestingError; use crate::state::VestingConfig; use anchor_lang::prelude::*; use anchor_spl::associated_token::AssociatedToken; -use anchor_spl::token_interface::{ - transfer_checked, Mint, TokenAccount, TokenInterface, TransferChecked, -}; +use anchor_spl::token::{Mint, Token, TokenAccount, transfer_checked, TransferChecked}; use crate::state::global_config::GlobalConfig; #[derive(Accounts)] @@ -21,15 +19,15 @@ pub struct WithdrawSurplus<'info> { token::mint = mint, token::token_program = token_program )] - recovery: InterfaceAccount<'info, TokenAccount>, - mint: InterfaceAccount<'info, Mint>, + recovery: Account<'info, TokenAccount>, + mint: Account<'info, Mint>, #[account( mut, associated_token::mint = mint, associated_token::authority = config, associated_token::token_program = token_program )] - vault: InterfaceAccount<'info, TokenAccount>, + vault: Account<'info, TokenAccount>, #[account( mut, constraint = vault.amount > config.vested @ VestingError::NotInSurplus, @@ -44,7 +42,7 @@ pub struct WithdrawSurplus<'info> { )] pub global_config: Box>, associated_token_program: Program<'info, AssociatedToken>, - token_program: Interface<'info, TokenInterface>, + token_program: Program<'info, Token>, system_program: Program<'info, System>, }