Skip to content

Commit

Permalink
VLT-230 adjusting to follow token-2022-support
Browse files Browse the repository at this point in the history
  • Loading branch information
codinghistorian committed Dec 10, 2024
1 parent ccd2a44 commit eaeebae
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions programs/strategy/src/instructions/deposit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ pub fn handle_deposit<'info>(
let deploy_funds = DeployFunds {
strategy: ctx.accounts.strategy.clone(),
underlying_token_account: ctx.accounts.underlying_token_account.clone(),
underlying_mint: ctx.accounts.underlying_mint.clone(),
signer: ctx.accounts.signer.clone(),
token_program: ctx.accounts.token_program.clone(),
};
Expand Down
2 changes: 2 additions & 0 deletions programs/strategy/src/state/orca_strategy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ impl Strategy for OrcaStrategy {
&mut Report {
strategy: accounts.strategy.clone(),
underlying_token_account: accounts.underlying_token_account.clone(),
underlying_mint: accounts.underlying_mint.clone(),
token_program: accounts.token_program.clone(),
signer: accounts.signer.clone(),
},
Expand All @@ -148,6 +149,7 @@ impl Strategy for OrcaStrategy {
&mut Report {
strategy: accounts.strategy.clone(),
underlying_token_account: accounts.underlying_token_account.clone(),
underlying_mint: accounts.underlying_mint.clone(),
token_program: accounts.token_program.clone(),
signer: accounts.signer.clone(),
},
Expand Down
6 changes: 5 additions & 1 deletion scripts/orca/0_init_orca_strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { Strategy } from "../../target/types/strategy";
import { OrcaStrategyConfig, OrcaStrategyConfigSchema } from "../../tests/utils/schemas";
import { BN } from "@coral-xyz/anchor";
import * as token from "@solana/spl-token";
import { TOKEN_PROGRAM_ID } from "@solana/spl-token";

import * as borsh from 'borsh';
import * as fs from 'fs';
import * as path from 'path';
Expand Down Expand Up @@ -205,7 +207,8 @@ async function main() {
await vaultProgram.methods.initVault(vaultConfig)
.accounts({
underlyingMint,
signer: admin.publicKey
signer: admin.publicKey,
tokenProgram: TOKEN_PROGRAM_ID,
})
.signers([admin])
.rpc();
Expand Down Expand Up @@ -294,6 +297,7 @@ async function main() {
underlyingMint,
vault,
signer: admin.publicKey,
tokenProgram: TOKEN_PROGRAM_ID,
})
.signers([admin])
.rpc();
Expand Down
5 changes: 5 additions & 0 deletions scripts/orca/10_report_profit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ const TMAC_MINT = new PublicKey(
"Afn8YB1p4NsoZeS5XJBZ18LTfEy5NFPwN46wapZcBQr6"
);

const USDC_MINT = new PublicKey("BRjpCHtyQLNCo8gqRUr8jtdAj5AjPYQaoqbvcZiHok1k");


function deserializeOrcaStrategy(data: Buffer) {
// Skip 8 byte discriminator
let offset = 8;
Expand Down Expand Up @@ -171,6 +174,8 @@ async function main() {
.accounts({
strategy,
signer: admin.publicKey,
tokenProgram: TOKEN_PROGRAM_ID,
underlyingMint: USDC_MINT,
})
.remainingAccounts([
{
Expand Down
1 change: 1 addition & 0 deletions scripts/orca/3_4_5_direct_deposit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ async function main() {
userSharesAccount: userSharesATA.address,
strategy: strategy,
user: admin.publicKey,
underlyingMint: USDC_MINT,
})
.remainingAccounts(combinedRemainingAccounts)
.preInstructions([computeUnitIx, computePriceIx])
Expand Down
1 change: 1 addition & 0 deletions scripts/orca/5_deploy_funds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ async function main() {
.deployFunds(amount)
.accounts({
strategy: strategy,
underlyingMint: USDC_MINT,
signer: admin.publicKey,
})
.remainingAccounts(combinedRemainingAccounts)
Expand Down
2 changes: 2 additions & 0 deletions scripts/orca/7_free_funds_with_vault_redeem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,8 @@ async function main() {
userTokenAccount: userUsdcATA,
userSharesAccount: userSharesATA,
user: admin.publicKey,
underlyingMint: USDC_MINT,
tokenProgram: TOKEN_PROGRAM_ID,
})
.remainingAccounts(combinedRemainingAccounts)
.instruction();
Expand Down
2 changes: 2 additions & 0 deletions scripts/orca/8_free_funds_directly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ async function main() {
.accounts({
strategy: strategy,
signer: admin.publicKey,
underlyingMint: USDC_MINT,
tokenProgram: TOKEN_PROGRAM_ID,
})
.remainingAccounts(remainingAccounts)
.signers([admin])
Expand Down

0 comments on commit eaeebae

Please sign in to comment.