diff --git a/packages/helium-admin-cli/src/migrate-to-hip-138.ts b/packages/helium-admin-cli/src/migrate-to-hip-138.ts index 95ffcfa0c..88425cdcb 100644 --- a/packages/helium-admin-cli/src/migrate-to-hip-138.ts +++ b/packages/helium-admin-cli/src/migrate-to-hip-138.ts @@ -1,31 +1,29 @@ import * as anchor from "@coral-xyz/anchor"; -import { init as initLazy } from "@helium/lazy-distributor-sdk"; +import { ThresholdType } from "@helium/circuit-breaker-sdk"; import { daoKey, delegatorRewardsPercent, - init as initHsd, - subDaoKey, + init as initHsd } from "@helium/helium-sub-daos-sdk"; +import { init as initLazy, lazyDistributorKey } from "@helium/lazy-distributor-sdk"; +import { organizationKey } from "@helium/organization-sdk"; +import { oracleSignerKey } from "@helium/rewards-oracle-sdk"; import { batchParallelInstructionsWithPriorityFee, HNT_MINT, IOT_MINT, MOBILE_MINT, } from "@helium/spl-utils"; +import { getAssociatedTokenAddressSync } from "@solana/spl-token"; import { PublicKey, TransactionInstruction } from "@solana/web3.js"; import Squads from "@sqds/sdk"; import os from "os"; -import { organizationKey } from "@helium/organization-sdk"; import yargs from "yargs/yargs"; import { loadKeypair, parseEmissionsSchedule, sendInstructionsOrSquads, } from "./utils"; -import { lazyDistributorKey } from "@helium/lazy-distributor-sdk"; -import { ThresholdType } from "@helium/circuit-breaker-sdk"; -import { oracleSignerKey } from "@helium/rewards-oracle-sdk"; -import { getAssociatedTokenAddressSync } from "@solana/spl-token"; export async function run(args: any = process.argv) { const yarg = yargs(args).options({ @@ -100,8 +98,6 @@ export async function run(args: any = process.argv) { const instructions: TransactionInstruction[] = []; - const iotMint = new PublicKey(argv.iotMint); - const mobileMint = new PublicKey(argv.mobileMint); const hntMint = new PublicKey(argv.hntMint); const dao = daoKey(hntMint)[0]; @@ -138,7 +134,6 @@ export async function run(args: any = process.argv) { ); const ld = lazyDistributorKey(hntMint)[0]; - const rewardsEscrow = getAssociatedTokenAddressSync(hntMint, ld, true); const ldAcc = await lazyDistProgram.account.lazyDistributorV0.fetchNullable( ld ); diff --git a/programs/helium-sub-daos/src/instructions/temp_resize_account.rs b/programs/helium-sub-daos/src/instructions/temp_resize_account.rs index 791a3ae8a..2c426f43b 100644 --- a/programs/helium-sub-daos/src/instructions/temp_resize_account.rs +++ b/programs/helium-sub-daos/src/instructions/temp_resize_account.rs @@ -23,7 +23,11 @@ pub struct TempResizeAccount<'info> { pub fn handler(ctx: Context) -> Result<()> { let account = &mut ctx.accounts.account; - let new_size = account.data_len() + std::mem::size_of::() * 4; + let mut new_size = account.data_len() + std::mem::size_of::() * 4; + // This is the dao account. + if account.key() == Pubkey::from_str("BQ3MCuTT5zVBhNfQ4SjMh3NPVhFy73MPV8rjfq5d1zie").unwrap() { + new_size += 104; // Add space for rewards_escrow, delegator_pool, delegator_rewards_percent, proposal_namespace + } let rent = Rent::get()?; let new_minimum_balance = rent.minimum_balance(new_size); let lamports_diff = new_minimum_balance.saturating_sub(account.to_account_info().lamports());