Skip to content

Commit

Permalink
check-effect-interaction to prevent potential re-entrancy issue
Browse files Browse the repository at this point in the history
  • Loading branch information
brewmaster012 committed Sep 12, 2024
1 parent bc2a7ca commit a8034dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions programs/protocol-contracts-solana/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,12 @@ pub mod gateway {
},
signer_seeds,
);
transfer(xfer_ctx, amount)?;
msg!("withdraw spl token successfully");

pda.nonce += 1;

transfer(xfer_ctx, amount)?;
msg!("withdraw spl token successfully");

Ok(())
}
}
Expand Down

0 comments on commit a8034dc

Please sign in to comment.