Normally we create minter / token on program, thereafter, the program owns the mint authority, for example:
#[derive(Accounts)]
#[instruction(symbol: String, decimals: u8)]
pub struct AddToken<'info> {
#[account(
mut,
constraint = admin.key() == ADMIN_ACCOUNT,
)]
pub admin: Signer<'info>,
// The PDA is both the address of the mint account and the mint authority
#[account(
init_if_needed,
seeds = [symbol.as_bytes()],
bump,
payer = admin,
mint::decimals = decimals,
mint::authority = mapping_token_mint,
)]
pub mapping_token_mint: Account<'info, Mint>,
// ...
pub token_program: Program<'info, Token>,
pub system_program: Program<'info, System>,
}
What if there is a minter created by cli and it mint authority is a wallet?
How can I transfer all authority to contract program ? Are Update Authority, Mint Authority the complete authority list to tranfer to program?
I want the minter is fully transfer to program without any right remain in wallet account.
Can anybody show my how to or provide some source link?
//Edit1: @Jimii provide a JS approach. But later on, I found I need rust contract method to archive this, because I need to register the minter and check if the supply is zero.
Thanks