@@ -12,8 +12,6 @@ pub struct MultisigCreateArgs {
1212 pub threshold : u16 ,
1313 /// The members of the multisig.
1414 pub members : Vec < Member > ,
15- /// Any key that is used to seed the multisig pda. Used solely as bytes for the seed, doesn't have any other meaning.
16- pub create_key : Pubkey ,
1715 /// Memo isn't used for anything, but is included in `CreatedEvent` that can later be parsed and indexed.
1816 pub memo : Option < String > ,
1917}
@@ -25,11 +23,15 @@ pub struct MultisigCreate<'info> {
2523 init,
2624 payer = creator,
2725 space = Multisig :: size( args. members. len( ) ) ,
28- seeds = [ SEED_PREFIX , args . create_key. as_ref( ) , SEED_MULTISIG ] ,
26+ seeds = [ SEED_PREFIX , create_key. key ( ) . as_ref( ) , SEED_MULTISIG ] ,
2927 bump
3028 ) ]
3129 pub multisig : Account < ' info , Multisig > ,
3230
31+ /// An ephemeral signer that is used as a seed for the Multisig PDA.
32+ /// Must be a signer to prevent the Multisig account from re-initialization by someone else but the original creator.
33+ pub create_key : Signer < ' info > ,
34+
3335 /// The creator of the multisig.
3436 #[ account( mut ) ]
3537 pub creator : Signer < ' info > ,
@@ -71,7 +73,7 @@ impl MultisigCreate<'_> {
7173 multisig. authority_index = 1 ; // Default vault is the first authority.
7274 multisig. transaction_index = 0 ;
7375 multisig. stale_transaction_index = 0 ;
74- multisig. create_key = args . create_key ;
76+ multisig. create_key = ctx . accounts . create_key . to_account_info ( ) . key ( ) ;
7577 multisig. bump = * ctx. bumps . get ( "multisig" ) . unwrap ( ) ;
7678
7779 multisig. invariant ( ) ?;
0 commit comments