@@ -39,6 +39,7 @@ pub mod multisig {
39
39
multisig. owners = owners;
40
40
multisig. threshold = threshold;
41
41
multisig. nonce = nonce;
42
+ multisig. owner_set_seqno = 0 ;
42
43
Ok ( ( ) )
43
44
}
44
45
@@ -69,6 +70,7 @@ pub mod multisig {
69
70
tx. signers = signers;
70
71
tx. multisig = * ctx. accounts . multisig . to_account_info ( ) . key ;
71
72
tx. did_execute = false ;
73
+ tx. owner_set_seqno = ctx. accounts . multisig . owner_set_seqno ;
72
74
73
75
Ok ( ( ) )
74
76
}
@@ -98,6 +100,8 @@ pub mod multisig {
98
100
}
99
101
100
102
multisig. owners = owners;
103
+ multisig. owner_set_seqno += 1 ;
104
+
101
105
Ok ( ( ) )
102
106
}
103
107
@@ -184,6 +188,7 @@ pub struct CreateTransaction<'info> {
184
188
185
189
#[ derive( Accounts ) ]
186
190
pub struct Approve < ' info > {
191
+ #[ account( "multisig.owner_set_seqno == transaction.owner_set_seqno" ) ]
187
192
multisig : ProgramAccount < ' info , Multisig > ,
188
193
#[ account( mut , belongs_to = multisig) ]
189
194
transaction : ProgramAccount < ' info , Transaction > ,
@@ -205,6 +210,7 @@ pub struct Auth<'info> {
205
210
206
211
#[ derive( Accounts ) ]
207
212
pub struct ExecuteTransaction < ' info > {
213
+ #[ account( "multisig.owner_set_seqno == transaction.owner_set_seqno" ) ]
208
214
multisig : ProgramAccount < ' info , Multisig > ,
209
215
#[ account( seeds = [
210
216
multisig. to_account_info( ) . key. as_ref( ) ,
@@ -220,6 +226,7 @@ pub struct Multisig {
220
226
owners : Vec < Pubkey > ,
221
227
threshold : u64 ,
222
228
nonce : u8 ,
229
+ owner_set_seqno : u32 ,
223
230
}
224
231
225
232
#[ account]
@@ -236,6 +243,8 @@ pub struct Transaction {
236
243
signers : Vec < bool > ,
237
244
// Boolean ensuring one time execution.
238
245
did_execute : bool ,
246
+ // Owner set sequence number.
247
+ owner_set_seqno : u32 ,
239
248
}
240
249
241
250
impl From < & Transaction > for Instruction {
0 commit comments