Skip to content

Commit dca3285

Browse files
authored
fix raydium instructions (#181)
1 parent b0ca145 commit dca3285

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

pages/dao/[symbol]/proposal/components/instructions/Raydium/CollectPoolFees.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ const CollectPoolFees = ({
151151

152152
useEffect(() => {
153153
handleSetInstructions(
154-
{ governedAccount: governedAccount, getInstruction },
154+
{ governedAccount: governedAccount?.governance, getInstruction },
155155
index,
156156
)
157157
// eslint-disable-next-line react-hooks/exhaustive-deps -- TODO please fix, it can cause difficult bugs. You might wanna check out https://bobbyhadz.com/blog/react-hooks-exhaustive-deps for info. -@asktree

pages/dao/[symbol]/proposal/components/instructions/Raydium/CollectVestedTokens.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ const CollectVestedTokens = ({
6161
WSOL_MINT_PK.toBuffer(),
6262
], LAUNCHPAD_PROGRAM_ID)
6363

64-
6564
const vestingAccount = PublicKey.findProgramAddressSync([
6665
Buffer.from("pool_vesting"),
6766
poolId.toBuffer(),
@@ -83,6 +82,10 @@ const CollectVestedTokens = ({
8382
}
8483

8584
const poolInfo = await raydium.launchpad.getRpcPoolInfo({poolId})
85+
86+
if (!poolInfo.creator.equals(governedAccount.pubkey)) {
87+
throw new Error('The DAO does not own the vesting tokens.')
88+
}
8689
const baseVault = poolInfo.vaultA
8790
const walletAta = associatedAddress({mint: mintA,owner: governedAccount.pubkey})
8891

@@ -127,7 +130,7 @@ const CollectVestedTokens = ({
127130

128131
useEffect(() => {
129132
handleSetInstructions(
130-
{ governedAccount: governedAccount, getInstruction },
133+
{ governedAccount: governedAccount?.governance, getInstruction },
131134
index,
132135
)
133136
// eslint-disable-next-line react-hooks/exhaustive-deps -- TODO please fix, it can cause difficult bugs. You might wanna check out https://bobbyhadz.com/blog/react-hooks-exhaustive-deps for info. -@asktree

0 commit comments

Comments
 (0)