feat(contract): session storage, lock_funds, dispute window & upgrade#613
Open
authenticeasy-sys wants to merge 1 commit into
Open
Conversation
- Add Session struct (Bytes32 key, Status enum, all fields) and get_session/save_session helpers — closes MentoNest#525 - Add lock_funds(session_id, buyer, seller, amount, token_id) with FundsLocked event, duplicate-session guard, amount > 0 check — closes MentoNest#523 - Add set_dispute_window/get_dispute_window (default 1000 ledgers) with DisputeWindowUpdated event, admin-only — closes MentoNest#521 - Add upgrade(new_wasm_hash) admin-only with ContractUpgraded event — closes MentoNest#522 - Add CI workflow (.github/workflows/contract-ci.yml) for contract build (wasm32) and test on every PR/push touching contract/
|
@authenticeasy-sys 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements four open issues for the Soroban escrow contract.
Changes
#525 — Session struct storage mapping
Statusenum:Locked | Completed | Approved | Refunded | Disputed | ResolvedSessionDatastruct:buyer, seller, amount, status, created_at, completed_at, dispute_resolved_atSkillSyncKey::Session(Bytes32)using persistent storageget_session(id)andsave_session(id, session)(save is admin-gated)#523 — Lock funds function
lock_funds(session_id, buyer, seller, amount, token_id)require_auth+ token transfer to contractamount > 0, duplicate session ID rejectedFundsLockedevent#521 — Dispute window configuration
set_dispute_window(window_ledgers: u32)— admin-onlyget_dispute_window()— returns stored value or default 1000 ledgersDisputeWindowUpdatedevent#522 — Upgradeability pattern
upgrade(new_wasm_hash: BytesN<32>)— admin-onlyenv.deployer().update_current_contract_wasm()ContractUpgradedeventCI workflow
.github/workflows/contract-ci.yml— builds WASM target and runscargo teston every push/PR touchingcontract/Tests
New test module
test_skillsync_escrowcovers all acceptance criteria: session storage, token transfer, event emission, zero-amount revert, duplicate-session revert, default dispute window, and window update event.Closes #521
Closes #522
Closes #523
Closes #525