Feature/arbitration timelock#486
Open
dami-005 wants to merge 2 commits into
Open
Conversation
- Add DataKey::UserReputation(Address) storing score 0-100 - Add DataKey::ReputationMultiplier(u64) for per-swap min buyer rep - Implement get_reputation(env, address) -> u32 (default 50) - Implement set_reputation_multiplier(env, swap_id, min_reputation) - Update reputation on swap completion: +5 seller & buyer - Update reputation on cancel_swap: -10 canceller - Update reputation on cancel_expired_swap: -10 seller (defaulted) - Enforce min reputation in accept_swap (InsufficientReputation error) - Add ContractError::InsufficientReputation = 40 - Add reputation_tests.rs with 7 tests covering all behaviours
- Add arbitration_timeout_seconds to ProtocolConfig (default 14 days) - Add DataKey::ArbitrationTimestamp(u64) to track request time - Add ContractError::ArbitrationNotTimedOut = 41 - Update request_arbitration to record timestamp on first call (subsequent calls are no-ops for the timestamp — first wins) - Add auto_refund_on_arbitration_timeout(env, swap_id): anyone can call after timeout elapses; refunds buyer and cancels swap - Add arbitration_timeout_tests.rs with 7 tests covering: timestamp recording, early rejection, timeout success, no-request rejection, idempotency, third-party trigger, and timestamp immutability on second request
|
@dami-005 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.
closes #409
contracts/atomic_swap/src/lib.rs:
the clock)
buyer, cancels swap, emits arb_tout event
contracts/atomic_swap/src/arbitration_timeout_tests.rs — 7 tests: