Skip to content

Commit

Permalink
fix(external-execute): enforce member execute, no external
Browse files Browse the repository at this point in the history
  • Loading branch information
ogmedia committed Jan 27, 2023
1 parent 1e6effe commit 17f5047
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions programs/squads-mpl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ pub mod squads_mpl {
ctx.accounts.multisig.add_authority()
}

// deprecated! constraint has been removed in favor of the roles program
// instruction to change the external execute setting, which allows
// non-members or programs to execute a transaction.
pub fn set_external_execute(ctx: Context<MsAuth>, setting: bool) -> Result<()> {
Expand Down Expand Up @@ -794,8 +795,8 @@ pub struct ExecuteTransaction<'info> {
b"multisig"
],
bump = multisig.bump,
// only members can execute unless specified by the allow_external_execute setting
constraint = multisig.is_member(member.key()).is_some() || multisig.allow_external_execute @MsError::KeyNotInMultisig,
// only members can execute
constraint = multisig.is_member(member.key()).is_some() @MsError::KeyNotInMultisig,
)]
pub multisig: Box<Account<'info, Ms>>,

Expand Down Expand Up @@ -829,7 +830,7 @@ pub struct ExecuteInstruction<'info> {
b"multisig"
],
bump = multisig.bump,
constraint = multisig.is_member(member.key()).is_some() || multisig.allow_external_execute @MsError::KeyNotInMultisig,
constraint = multisig.is_member(member.key()).is_some() @MsError::KeyNotInMultisig,
)]
pub multisig: Box<Account<'info, Ms>>,

Expand Down

0 comments on commit 17f5047

Please # to comment.