Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions programs/casier/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ pub mod casier {
Some(i) => {
if locker.amounts[i] != before_amount {
return Err(error!(ErrorCode::InvalidBeforeState));
} else if withdraw_amount > ctx.accounts.vault_ta.amount {
return Err(error!(ErrorCode::InvalidWithdrawAmount));
// if final amount is lower than the amounts of tokens that will be left, we should call withdraw_and_burn
} else if (final_amount)
< ctx.accounts.vault_ta.amount - withdraw_amount
Expand Down Expand Up @@ -377,4 +379,6 @@ pub enum ErrorCode {
BurnNotRequired,
#[msg("BurnRequired")]
BurnRequired,
#[msg("InvalidWithdrawAmount")]
InvalidWithdrawAmount,
}