-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert "lock" example to a "swap" example
Performs an atomic swap leveraging Zeto, Noto, and Pente together. Signed-off-by: Andrew Richardson <[email protected]>
- Loading branch information
Showing
18 changed files
with
502 additions
and
150 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Example: Atomic Swap | ||
|
||
This example demonstrates an atomic swap scenario on Paladin. It performs a swap between: | ||
|
||
- a cash token implemented with Zeto | ||
- an asset token implemented with Noto, with private hooks implemented on Pente | ||
|
||
## Pre-requisites | ||
|
||
Requires a local 3-node Paladin cluster running on `localhost:31548`, `localhost:31648`, and `localhost:31748`. | ||
|
||
## Run standalone | ||
|
||
Compile [Solidity contracts](../../solidity): | ||
|
||
```shell | ||
cd ../../solidity | ||
npm install | ||
npm run compile | ||
``` | ||
|
||
Build [TypeScript SDK](../../sdk/typescript): | ||
|
||
```shell | ||
cd ../../sdk/typescript | ||
npm install | ||
npm run abi | ||
npm run build | ||
``` | ||
|
||
Run example: | ||
|
||
```shell | ||
npm install | ||
npm run abi | ||
npm run start | ||
``` | ||
|
||
## Run with Gradle | ||
|
||
The following will perform all pre-requisites and then run the example: | ||
|
||
```shell | ||
../../gradlew build | ||
npm run start | ||
``` |
File renamed without changes.
98 changes: 95 additions & 3 deletions
98
example/lock/package-lock.json → example/swap/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { copyFile } from "copy-file"; | ||
|
||
await copyFile( | ||
"../../solidity/artifacts/contracts/private/NotoTrackerERC20.sol/NotoTrackerERC20.json", | ||
"src/abis/NotoTrackerERC20.json" | ||
); | ||
|
||
await copyFile( | ||
"../../solidity/artifacts/contracts/shared/Atom.sol/AtomFactory.json", | ||
"src/abis/AtomFactory.json" | ||
); | ||
|
||
await copyFile( | ||
"../../solidity/artifacts/contracts/shared/Atom.sol/Atom.json", | ||
"src/abis/Atom.json" | ||
); |
Oops, something went wrong.