Closed moshthepitt closed 3 years ago
Looks like this is how to do this:
// Fund the subscription account with the minimum balance to be rent exempt
invoke(
&system_instruction::transfer(
&signer_info.key,
subscription_info.key,
Rent::default().minimum_balance(account_size),
),
&[
signer_info.clone(),
subscription_info.clone(),
system_program_info.clone(),
],
)?;
// Allocate space for the subscription account
invoke_signed(
&system_instruction::allocate(subscription_info.key, account_size as u64),
&[subscription_info.clone(), system_program_info.clone()],
&[&signer_seeds],
)?;
// Assign the subscription account to the SolPayments program
invoke_signed(
&system_instruction::assign(subscription_info.key, &program_id),
&[subscription_info.clone(), system_program_info.clone()],
&[&signer_seeds],
)?;
Would be nice if this works