Repository navigation
feat: add atomic swap contract for peer-to-peer key exchanges - #1206
Open
AzahasTech wants to merge 2 commits into
Open
AzahasTech wants to merge 2 commits into
AzahasTech wants to merge 2 commits into
Conversation
AzahasTech
added a commit
to AzahasTech/accesslayer-contracts
that referenced
this pull request
Oct 24, 2026
AzahasTech
added a commit
to AzahasTech/accesslayer-contracts
that referenced
this pull request
Oct 24, 2026
AzahasTech
force-pushed
the
feat/issue-1072-implement-atomic-swap-contract-for-peer-to-peer-r2
branch
from
October 24, 2026 11:29
154107b to
7a809b1
Compare
AzahasTech
force-pushed
the
feat/issue-1072-implement-atomic-swap-contract-for-peer-to-peer-r2
branch
from
October 24, 2026 11:30
7a809b1 to
354d483
Compare
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.
Overview
This PR adds an atomic swap flow to the creator-keys curve subscriptions module, letting two parties exchange creator key allocations peer-to-peer in a single transaction. A proposer locks their offered allocation, a named counterparty can accept (executing both sides atomically), the proposer can cancel to release their lock, and unaccepted proposals expire automatically after 1 hour.
Related Issue
Changes
🔁 Atomic Swap Contract
creator-keys/src/curve_subscriptions_swaps.rspropose_swap(offered_key, offered_amount, requested_key, requested_amount, counterparty)— locks the proposer's offered amount and records a pending proposal.accept_swap(proposal_id)— restricted to the designated counterparty; transfers both legs atomically and emitsSwapExecuted.cancel_swap(proposal_id)— restricted to the proposer; releases locked amounts back to the proposer and emitsSwapCancelled.SwapProposed,SwapExecuted, andSwapCancelledwith proposal and amount data.Verification Results
Not run as part of this description; reviewers should exercise the three entry points and the expiry path directly.
accept_swapcorrectly transfers both sides atomicallyaccept_swapcancel_swapreleases locked amounts to proposercancel_swapaccept_swaprestricted to specified counterpartyaccept_swapSwapProposed,SwapExecuted,SwapCancelledemittedCloses #1072