Skip to content
Merged

fix #228

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
--add.exact true
ignore-scripts true
--frozen-lockfile true
9 changes: 0 additions & 9 deletions VoteStakeRegistry/sdk/withCreateNewDeposit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand Down
16 changes: 0 additions & 16 deletions components/GovernancePower/Power/Vanilla/useDepositCallback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 1 addition & 10 deletions hooks/useJoinRealm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
Loading