diff --git a/packages/proposals/src/actions/registerProgramGovernance.ts b/packages/proposals/src/actions/registerProgramGovernance.ts index c2aff3a..1a45a11 100644 --- a/packages/proposals/src/actions/registerProgramGovernance.ts +++ b/packages/proposals/src/actions/registerProgramGovernance.ts @@ -127,10 +127,17 @@ export const registerProgramGovernance = async ( PROGRAM_IDS.timelock.programId, ); + const [programDataAccount] = await PublicKey.findProgramAddress( + [uninitializedTimelockConfig.program.toBuffer()], + PROGRAM_IDS.bpf_upgrade_loader, + ); + instructions.push( createEmptyTimelockConfigInstruction( timelockConfigKey, uninitializedTimelockConfig.program, + programDataAccount, + wallet.publicKey, uninitializedTimelockConfig.governanceMint, wallet.publicKey, uninitializedTimelockConfig.councilMint, diff --git a/packages/proposals/src/models/createEmptyTimelockConfig.ts b/packages/proposals/src/models/createEmptyTimelockConfig.ts index 4e3f56a..5a88700 100644 --- a/packages/proposals/src/models/createEmptyTimelockConfig.ts +++ b/packages/proposals/src/models/createEmptyTimelockConfig.ts @@ -20,6 +20,8 @@ import * as Layout from '../utils/layout'; export const createEmptyTimelockConfigInstruction = ( timelockConfigAccount: PublicKey, programAccount: PublicKey, + programDataAccount: PublicKey, + programUpgradeAuthority: PublicKey, governanceMint: PublicKey, payer: PublicKey, councilMint?: PublicKey, @@ -40,15 +42,16 @@ export const createEmptyTimelockConfigInstruction = ( const keys = [ { pubkey: timelockConfigAccount, isSigner: false, isWritable: false }, { pubkey: programAccount, isSigner: false, isWritable: false }, + { pubkey: programDataAccount, isSigner: false, isWritable: true }, + { pubkey: programUpgradeAuthority, isSigner: true, isWritable: false }, { pubkey: governanceMint, isSigner: false, isWritable: false }, { pubkey: payer, isSigner: true, isWritable: false }, - + { pubkey: PROGRAM_IDS.system, isSigner: false, isWritable: false }, { - pubkey: PROGRAM_IDS.timelock.programId, + pubkey: PROGRAM_IDS.bpf_upgrade_loader, isSigner: false, isWritable: false, }, - { pubkey: PROGRAM_IDS.system, isSigner: false, isWritable: false }, ]; if (councilMint) {