Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion contracts/escrow-vault/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ impl EscrowVaultContract {
let refund = escrow.locked_amount;

escrow.locked_amount = 0;
escrow.refunded_amount = refund;
escrow.refunded_amount += refund;
escrow.state = EscrowState::Refunded;

let _ttl_key = DataKey::Escrow(escrow_id);
Expand Down
5 changes: 4 additions & 1 deletion contracts/liquidity-pool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,10 @@ impl LiquidityPoolContract {
if total_shares == 0 {
panic!("no shares in pool");
}
let amount = (shares * pool.total_liquidity) / total_shares;
let amount = shares
.checked_mul(pool.total_liquidity)
.expect("share redemption calculation overflows i128")
/ total_shares;
let available = pool.total_liquidity - pool.total_borrowed;

if amount > available {
Expand Down
3 changes: 2 additions & 1 deletion contracts/milestone-tracker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ impl MilestoneTrackerContract {
}

let now = env.ledger().timestamp();
let deadline = now + duration_secs;
let deadline = now.checked_add(duration_secs)
.expect("milestone deadline timestamp overflows u64");

let counter: u64 = env
.storage()
Expand Down