From 78bbbef75291468724f7bea47dab6d65a04d19a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Brzezin=CC=81ski?= Date: Tue, 9 Sep 2025 16:42:56 +0200 Subject: [PATCH] fix --- .yarnrc | 1 + VoteStakeRegistry/sdk/withCreateNewDeposit.ts | 9 --------- .../Power/Vanilla/useDepositCallback.tsx | 16 ---------------- hooks/useJoinRealm.ts | 11 +---------- 4 files changed, 2 insertions(+), 35 deletions(-) diff --git a/.yarnrc b/.yarnrc index b16a8dd6e..95b0218cf 100644 --- a/.yarnrc +++ b/.yarnrc @@ -1,2 +1,3 @@ --add.exact true ignore-scripts true +--frozen-lockfile true \ No newline at end of file diff --git a/VoteStakeRegistry/sdk/withCreateNewDeposit.ts b/VoteStakeRegistry/sdk/withCreateNewDeposit.ts index 41b5aa831..4f2d079dc 100644 --- a/VoteStakeRegistry/sdk/withCreateNewDeposit.ts +++ b/VoteStakeRegistry/sdk/withCreateNewDeposit.ts @@ -20,8 +20,6 @@ import { getMintCfgIdx, tryGetVoter } from './api' import { getPeriod } from 'VoteStakeRegistry/tools/deposits' import { VsrClient } from './client' import { TOKEN_2022_PROGRAM_ID } from '@solana/spl-token-new' -import { FEE_WALLET } from '@utils/orders' -import { VOTER_ACCOUNT_FEE } from '@tools/constants' export const withCreateNewDeposit = async ({ instructions, @@ -94,13 +92,6 @@ export const withCreateNewDeposit = async ({ communityMintPk, walletPk, ) - instructions.push( - SystemProgram.transfer({ - fromPubkey: walletPk!, - toPubkey: FEE_WALLET, - lamports: VOTER_ACCOUNT_FEE, - }), - ) } if (!existingVoter) { diff --git a/components/GovernancePower/Power/Vanilla/useDepositCallback.tsx b/components/GovernancePower/Power/Vanilla/useDepositCallback.tsx index 37d00a3c7..772d0bd55 100644 --- a/components/GovernancePower/Power/Vanilla/useDepositCallback.tsx +++ b/components/GovernancePower/Power/Vanilla/useDepositCallback.tsx @@ -92,23 +92,7 @@ export const useDepositCallback = ( walletPk, amount, ) - const torKey = await getTokenOwnerRecordAddress( - realm!.owner, - realm!.pubkey, - mint!, - walletPk, - ) - const doesTorExist = await connection.getAccountInfo(torKey) - if (!doesTorExist) { - instructions.push( - SystemProgram.transfer({ - fromPubkey: walletPk, - toPubkey: FEE_WALLET, - lamports: VOTER_ACCOUNT_FEE, - }), - ) - } // instructions required to create voter weight records for any plugins connected to the realm // no need to create the TOR, as it is already created by the deposit. const pluginRegisterInstructions = await handleRegister(false) diff --git a/hooks/useJoinRealm.ts b/hooks/useJoinRealm.ts index bf3340145..8ff647d82 100644 --- a/hooks/useJoinRealm.ts +++ b/hooks/useJoinRealm.ts @@ -5,9 +5,7 @@ import useWalletOnePointOh from '@hooks/useWalletOnePointOh' import useProgramVersion from '@hooks/useProgramVersion' import { useRealmVoterWeightPlugins } from '@hooks/useRealmVoterWeightPlugins' import { useCallback, useEffect, useState } from 'react' -import { SystemProgram, TransactionInstruction } from '@solana/web3.js' -import { FEE_WALLET } from '@utils/orders' -import { VOTER_ACCOUNT_FEE } from '@tools/constants' +import { TransactionInstruction } from '@solana/web3.js' type UseJoinRealmReturnType = { // use this to decide whether the join button should be displayed @@ -61,13 +59,6 @@ export const useJoinRealm = (): UseJoinRealmReturnType => { realm.account.communityMint, wallet.publicKey, ) - onboardUserIxes.push( - SystemProgram.transfer({ - fromPubkey: wallet.publicKey!, - toPubkey: FEE_WALLET, - lamports: VOTER_ACCOUNT_FEE, - }), - ) } const createVoterWeightRecordIxes = await createVoterWeightRecords(