Skip to content

Issue 369#608

Merged
soomtochukwu merged 3 commits into
DXmakers:mainfrom
sochima2:issue-369
May 28, 2026
Merged

Issue 369#608
soomtochukwu merged 3 commits into
DXmakers:mainfrom
sochima2:issue-369

Conversation

@sochima2
Copy link
Copy Markdown
Contributor

close #369

Description
Added funded_ledger_seq: u32 to EscrowJob to record the ledger sequence at deposit time and persisted it in contracts/escrow/src/lib.rs during deposit by setting job.funded_ledger_seq = env.ledger().sequence();.
Implemented fn assert_not_same_ledger_as_funding(env: &Env, job: &EscrowJob) -> Result<(), EscrowError> and integrated this guard into funding-followup flows by calling it from release_milestone, release_funds, open_dispute, raise_dispute, and refund to block same-ledger state changes.
Require admin authentication during initialize via admin.require_auth() to ensure initialization is a strictly authenticated state-modifying action.
Replace naive timestamp arithmetic in create_job with checked operations (checked_mul / checked_add) to prevent overflow when computing expires_at and return an appropriate EscrowError::ArithmeticOverflow on failure.
Added public getters: get_funding_settlement_ledgers, get_remaining_balance, and get_active_escrow_params to expose live escrow parameters and remaining balances for off-chain consumers and indexers.
Kept existing checked arithmetic in milestone summation and release flows (checked_add) and retained reentrancy guards; adjusted small logging call formatting for consistency.

Testing
Ran formatting with cargo fmt --all which completed successfully.
Ran unit tests with cargo test -p escrow and all tests passed: 46 passed; 0 failed (test suite completed successfully).
The modified contract builds and the escrow test binary executed successfully in the test profile during CI-local validation.

@sochima2 sochima2 requested a review from soomtochukwu as a code owner May 27, 2026 20:18
@vercel
Copy link
Copy Markdown

vercel Bot commented May 27, 2026

@sochima2 is attempting to deploy a commit to the mAzI's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

@sochima2 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Copy link
Copy Markdown
Contributor

@soomtochukwu soomtochukwu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix merge conflict

@soomtochukwu soomtochukwu merged commit 79ea0e5 into DXmakers:main May 28, 2026
1 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SC-ESC-015] Escrow System Optimization and Validation Checkpoint - Step 15

2 participants