Skip to content

Commit 1bdf9ae

Browse files
wphanharsh4786
authored andcommitted
program: disallow builder to be escrow authority (drift-labs#1930)
1 parent ab14e91 commit 1bdf9ae

File tree

1 file changed

+6
-0
lines changed
  • programs/drift/src/instructions

1 file changed

+6
-0
lines changed

programs/drift/src/instructions/user.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,12 @@ pub fn handle_change_approved_builder<'c: 'info, 'info>(
582582
max_fee_tenth_bps: u16,
583583
add: bool,
584584
) -> Result<()> {
585+
validate!(
586+
ctx.accounts.escrow.authority != builder,
587+
ErrorCode::DefaultError,
588+
"Builder cannot be the same as the escrow authority"
589+
)?;
590+
585591
let existing_builder_index = ctx
586592
.accounts
587593
.escrow

0 commit comments

Comments
 (0)