-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Noto/Zeto atomic swap example #498
Open
awrichar
wants to merge
60
commits into
main
Choose a base branch
from
swap-example
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
24 tasks
awrichar
force-pushed
the
swap-example
branch
2 times, most recently
from
January 8, 2025 13:20
6a7febe
to
43f14d7
Compare
awrichar
force-pushed
the
swap-example
branch
6 times, most recently
from
January 16, 2025 20:50
99b3fbf
to
12d4d53
Compare
Allows a domain to directly trigger a new transaction, such as in response to an event. Signed-off-by: Andrew Richardson <[email protected]>
Change Noto to ensure notary name is fully qualified during deploy, and to check on contract init if the current node is the notary. Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Allows a domain to look up specific states, regardless of whether they've been spent or not. Signed-off-by: Andrew Richardson <[email protected]>
awrichar
force-pushed
the
swap-example
branch
2 times, most recently
from
January 17, 2025 16:58
4c12bcc
to
e84f743
Compare
Signed-off-by: Andrew Richardson <[email protected]>
This variant isn't fully proved out, and may begin causing confusion. We can bring it back at the time we're able to work through all of the flows in detail. Signed-off-by: Andrew Richardson <[email protected]>
Allows an owner to "lock" some portion of value such that it cannot be spent except when specific conditions are met. Signed-off-by: Andrew Richardson <[email protected]>
Currently you can only unlock to return the value to yourself (additional work needed to allow specifying and executing a transfer). Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Also gather two separate sender signatures for transfer + lock, so that they can be emitted separately in the two blockchain events. Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Use shorter names "restrictMint" and "allowBurn". Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Rather than storing all input/outputs states on the smart contract, store an EIP-712 hash of the prepared unlock. Allow extracting the input/output states from the state receipt (as info/read states) so that they can be passed in to the final "unlockWithApproval" transaction. Signed-off-by: Andrew Richardson <[email protected]>
Get states by ID, regardless of whether they are available. Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
This helper is actually making the code more confusing. Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
This makes it easier to separate locked/unlocked states. Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Loading status checks…
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Signed-off-by: Andrew Richardson <[email protected]>
Performs an atomic swap leveraging Zeto, Noto, and Pente together. Signed-off-by: Andrew Richardson <[email protected]>
awrichar
force-pushed
the
swap-example
branch
from
January 17, 2025 17:33
e84f743
to
d9f15d4
Compare
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.
In a chain with #483
This example shows how to perform an atomic swap between Zeto and Noto (with Pente notary hooks), with full counterparty protection. It leverages locking functionality on both tokens to set aside the value for the swap, then approve a single base ledger
Atom
contract to finalize the swap. This ensures neither party can receive the other's tokens unless the full swap is executed.Some caveats: