You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now there is only one method for transferring admin where the signing capability of the new admin is not verified. Though it doesnt pose a security risk in terms of funds, transferring admin capability to an address of which you dont have the signing capability can be risky.
So the solution for this would be having 2 methods with one setting an admin proposal and the other method where the new admin signs it. This makes sure that you always have the signing capability of the new admin.
The other solution could be where you have a method with 2 signers which wouldnt require the storing the new admin proposal and also make sure that you have the signing capability.
The text was updated successfully, but these errors were encountered:
fntransfer_admin_proposal(ctx:Context<TransferAdminProposal>,new_admin:Pubkey) -> Result<()>{
...Ok(())}fnaccept_admin_proposal(ctx:Context<AcceptAdminProposal>) -> Result<()>{// verify if signer is the one proposed in the state.Ok(())}pubstructTransferAdminProposal<'info>{#[account(mut)]pubstruct admin:Signer<'info>,#[account(mut, has_one = admin)]pub struct common_state:Account<'info,CommonState>,// state where the admin info is stored.}pubstructAcceptAdminProposal<'info>{#[account(mut)]pub struct new_admin:Signer<'info>,#[account(mut)]pub struct common_state:Account<'info,CommonState>,// state where the admin info is stored.}
or another interface could be where you have a single method with 2 signers. This would be better since you would not need to store it in the state.
fntransfer_admin(ctx:Context<TransferAdmin>) -> Result<()>{
...Ok(())}pubstructAcceptAdminProposal<'info>{#[account(mut)]pubstruct admin:Signer<'info>,#[account(mut)]pub struct new_admin:Signer<'info>,#[account(mut, has_one = admin)]pub struct common_state:Account<'info,CommonState>,// state where the admin info is stored.}
Right now there is only one method for transferring admin where the signing capability of the new admin is not verified. Though it doesnt pose a security risk in terms of funds, transferring admin capability to an address of which you dont have the signing capability can be risky.
So the solution for this would be having 2 methods with one setting an admin proposal and the other method where the new admin signs it. This makes sure that you always have the signing capability of the new admin.
The other solution could be where you have a method with 2 signers which wouldnt require the storing the new admin proposal and also make sure that you have the signing capability.
The text was updated successfully, but these errors were encountered: