Function psyoptions::fees::check_or_create_fee_account [−][src]
pub fn check_or_create_fee_account<'a, 'b>(
funding_account: &AccountInfo<'a>,
spl_associated_token_program_acct: &AccountInfo<'a>,
fee_account: &AccountInfo<'a>,
fee_owner_acct: &AccountInfo<'a>,
asset_mint_acct: &AccountInfo<'a>,
spl_token_program_acct: &AccountInfo<'a>,
sys_program_acct: &AccountInfo<'a>,
sys_rent_acct: &AccountInfo<'a>
) -> Result<(), ProgramError>
Expand description
Given an SPL Token Mint key and associated fee account (the fee account the instruction passed in) validate that the fee_account is correct for the fee mint. If the account is not initialized then call the create instruction.
- Get the derived associated token address
- Check that the address is the same as what was passed in and the owner is correct
- Check if the token address is initialized
- If not initialized, call cross program invocation to
create_associated_token_account
to initialize