Skip to content

Commit

Permalink
Add checks for zero values in addresses in protect_position
Browse files Browse the repository at this point in the history
  • Loading branch information
CBoYXD committed Dec 17, 2024
1 parent 21896c7 commit dd1cebf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/vault.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ mod Vault {
let caller = get_caller_address();
let vault_owner = self.ownable.owner();
let current_amount = self.amounts.entry(caller).read();


assert(deposit_contract.is_non_zero(), 'Deposit contract is zero');
assert(user.is_non_zero(), 'User address is zero');
assert(vault_owner == caller || user == caller, 'Caller must be owner or user');
assert(current_amount >= amount, 'Insufficient balance');

Expand Down

0 comments on commit dd1cebf

Please sign in to comment.