Skip to content

Commit

Permalink
Merge pull request #9 from strike-finance/fix/one-side-deposit-vul
Browse files Browse the repository at this point in the history
add check no side has deposited asset
  • Loading branch information
shan501 authored Nov 3, 2024
2 parents 5283d64 + ec3fed6 commit 3eeaf82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Binary file modified .DS_Store
Binary file not shown.
5 changes: 4 additions & 1 deletion validators/collateral.ak
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ fn one_side_deposit_agreement(

let ref_script_empty = ref_script_empty(output_to_validator)

let no_side_has_deposited_asset: Bool =
!datum.issuer_has_deposited_asset && !datum.obligee_has_deposited_asset

expect
stake_credential_is_valid && only_one_validator_input && only_one_validator_output && updated_datum_correct && deadline_not_passed && ref_script_empty
stake_credential_is_valid && only_one_validator_input && only_one_validator_output && updated_datum_correct && deadline_not_passed && ref_script_empty && no_side_has_deposited_asset

let strike_is_used_as_collateral: Bool =
datum.each_party_strike_collateral_asset_amount > 0
Expand Down

0 comments on commit 3eeaf82

Please sign in to comment.