Skip to content
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

Add btc-sbtc swap #6

Open
wants to merge 19 commits into
base: feat/v5
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,16 @@
**/settings/Testnet.toml
**/history.txt
.cache
scraps.txt
cvm/vmstate.db
.DS_Store
nohup.out
# Ignore Node and NPM files. Added by the clarinet-sdk migration.
logs
*.log
npm-debug.log*
coverage
*.info
costs-reports.json
node_modules
**/node_modules
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# clarity-catamaranswaps

Smart contracts for swapping assets on Stacks and Bitcoin

## atomic-stx-ft
## catamaran-sbtc

## atomic-stx-nft
BTC-sBTC swap

## [WIP] catamaran-btc

## catamaran-btc
BTC-STX swap

## atomic-stx-ft

## atomic-stx-nft

## friedger-token

## [WIP] atomic-mia-ft
30 changes: 30 additions & 0 deletions atomic-xbtc/Clarigen.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

# Set to your project's Clarinet config file
clarinet = "./Clarinet.toml"

# Set where you'd like TypeScript types output.
# Comment or remove section to skip TypeScript types
[types]
# `output` should be a path to a single file
output = "tests/clarigen-types.ts"

# You can also specify multiple output paths:
# outputs = [
# "src/clarigen-types.ts",
# "test/clarigen-types.ts"
# ]

# `types.after` - script to run after TypeScript types are generated.
# examples:
# after = "npm run prettier -w ./src/clarigen-types.ts"
# after = "echo 'yay'"

# Set where you'd like generated contract docs
# Generate docs by running `clarigen docs`
[docs]
# `output` should be a folder
output = "docs"

# `docs.after` - script to run after docs are generated.
# examples:
# after = "npm run prettier -w ./docs"
27 changes: 27 additions & 0 deletions atomic-xbtc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Swaps DAO

## Clarigen

Project adds [Clarigen](https://www.clarigen.dev/docs/getting-started) to Friedger swap contracts.

```bash
npm init
npm install --save-dev @clarigen/cli
npm install -g pnpm
npm i @clarigen/test
npm i @clarigen/core
clarigen init
npx clarigen
npx clarigen --watch
```

## Tests

```bash
npm run test
npm run watch
```

## License

MIT license, all good as long as the copyright and permission notice are included.
1 change: 1 addition & 0 deletions atomic-xbtc/contracts/external/Wrapped-Bitcoin.clar
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,4 @@
(ok true)))

(mint-tokens u10000000 tx-sender)
(map-set roles { role: BURNER_ROLE, account: tx-sender } { allowed: true })
290 changes: 290 additions & 0 deletions atomic-xbtc/deployments/default.simnet-plan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,290 @@
---
id: 0
name: "Simulated deployment, used as a default for `clarinet console`, `clarinet test` and `clarinet check`"
network: simnet
genesis:
wallets:
- name: deployer
address: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
balance: "100000000000000"
- name: wallet_1
address: ST1SJ3DTE5DN7X54YDH5D64R3BCB6A2AG2ZQ8YPD5
balance: "100000000000000"
- name: wallet_2
address: ST2CY5V39NHDPWSXMW9QDT3HC3GD6Q6XX4CFRK9AG
balance: "100000000000000"
- name: wallet_3
address: ST2JHG361ZXG51QTKY2NQCVBPPRRE2KZB1HR05NNC
balance: "100000000000000"
- name: wallet_4
address: ST2NEB84ASENDXKYGJPQW86YXQCEFEX2ZQPG87ND
balance: "100000000000000"
- name: wallet_5
address: ST2REHHS5J3CERCRBEPMGH7921Q6PYKAADT7JP2VB
balance: "100000000000000"
- name: wallet_6
address: ST3AM1A56AK2C1XAFJ4115ZSV26EB49BVQ10MGCS0
balance: "100000000000000"
- name: wallet_7
address: ST3PF13W7Z0RRM42A8VZRVFQ75SV1K26RXEP8YGKJ
balance: "100000000000000"
- name: wallet_8
address: ST3NBRSFKX28FQ2ZJ1MAKX58HKHSDGNV5N7R21XCP
balance: "100000000000000"
- name: wallet_9
address: STNHKEPYEPJ8ET55ZZ0M5A34J0R3N5FM2CMMMAZ6
balance: "100000000000000"
contracts:
- costs
- pox
- pox-2
- pox-3
- pox-4
- lockup
- costs-2
- costs-3
- cost-voting
- bns
plan:
batches:
- id: 0
transactions: []
epoch: "2.05"
- id: 1
transactions:
- emulated-contract-publish:
contract-name: Wrapped-Bitcoin
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
path: contracts/external/Wrapped-Bitcoin.clar
clarity-version: 1
- emulated-contract-publish:
contract-name: fixed-fees
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
path: contracts/fixed-fees.clar
clarity-version: 1
- emulated-contract-publish:
contract-name: ft-trait
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
path: contracts/external/ft-trait.clar
clarity-version: 1
- emulated-contract-publish:
contract-name: fun-nft
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
path: contracts/external/fun-nft.clar
clarity-version: 1
- emulated-contract-publish:
contract-name: fun-token
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
path: contracts/external/fun-token.clar
clarity-version: 1
- emulated-contract-publish:
contract-name: nft-trait
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
path: contracts/external/nft-trait.clar
clarity-version: 1
- emulated-contract-publish:
contract-name: xbtc-ft-swap
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
path: contracts/xbtc-ft-swap.clar
clarity-version: 1
- emulated-contract-publish:
contract-name: xbtc-nft-swap
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
path: contracts/xbtc-nft-swap.clar
clarity-version: 1
epoch: "2.1"
- id: 2
transactions: []
epoch: "2.1"
- id: 3
transactions: []
epoch: "2.1"
- id: 4
transactions: []
epoch: "2.1"
Comment on lines +96 to +104

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i need to work on this bug that adds many empty deployment batches 😬
It ony happens under certain conditions, you can manually edit the file to remove it (or delete the file completely and let clarient re-generate it)

- id: 5
transactions: []
epoch: "2.1"
- id: 6
transactions: []
epoch: "2.1"
- id: 7
transactions: []
epoch: "2.1"
- id: 8
transactions: []
epoch: "2.1"
- id: 9
transactions: []
epoch: "2.1"
- id: 10
transactions: []
epoch: "2.1"
- id: 11
transactions: []
epoch: "2.1"
- id: 12
transactions: []
epoch: "2.1"
- id: 13
transactions: []
epoch: "2.1"
- id: 14
transactions: []
epoch: "2.1"
- id: 15
transactions: []
epoch: "2.1"
- id: 16
transactions: []
epoch: "2.1"
- id: 17
transactions: []
epoch: "2.1"
- id: 18
transactions: []
epoch: "2.1"
- id: 19
transactions: []
epoch: "2.1"
- id: 20
transactions: []
epoch: "2.1"
- id: 21
transactions: []
epoch: "2.1"
- id: 22
transactions: []
epoch: "2.1"
- id: 23
transactions: []
epoch: "2.1"
- id: 24
transactions: []
epoch: "2.1"
- id: 25
transactions: []
epoch: "2.1"
- id: 26
transactions: []
epoch: "2.1"
- id: 27
transactions: []
epoch: "2.1"
- id: 28
transactions: []
epoch: "2.1"
- id: 29
transactions: []
epoch: "2.1"
- id: 30
transactions: []
epoch: "2.1"
- id: 31
transactions: []
epoch: "2.1"
- id: 32
transactions: []
epoch: "2.1"
- id: 33
transactions: []
epoch: "2.1"
- id: 34
transactions: []
epoch: "2.1"
- id: 35
transactions: []
epoch: "2.1"
- id: 36
transactions: []
epoch: "2.1"
- id: 37
transactions: []
epoch: "2.1"
- id: 38
transactions: []
epoch: "2.1"
- id: 39
transactions: []
epoch: "2.1"
- id: 40
transactions: []
epoch: "2.1"
- id: 41
transactions: []
epoch: "2.1"
- id: 42
transactions: []
epoch: "2.1"
- id: 43
transactions: []
epoch: "2.1"
- id: 44
transactions: []
epoch: "2.1"
- id: 45
transactions: []
epoch: "2.1"
- id: 46
transactions: []
epoch: "2.1"
- id: 47
transactions: []
epoch: "2.1"
- id: 48
transactions: []
epoch: "2.1"
- id: 49
transactions: []
epoch: "2.1"
- id: 50
transactions: []
epoch: "2.1"
- id: 51
transactions: []
epoch: "2.1"
- id: 52
transactions: []
epoch: "2.1"
- id: 53
transactions: []
epoch: "2.1"
- id: 54
transactions: []
epoch: "2.1"
- id: 55
transactions: []
epoch: "2.1"
- id: 56
transactions: []
epoch: "2.1"
- id: 57
transactions: []
epoch: "2.1"
- id: 58
transactions: []
epoch: "2.1"
- id: 59
transactions: []
epoch: "2.1"
- id: 60
transactions: []
epoch: "2.1"
- id: 61
transactions: []
epoch: "2.1"
- id: 62
transactions: []
epoch: "2.1"
- id: 63
transactions: []
epoch: "2.1"
- id: 64
transactions: []
epoch: "2.1"
- id: 65
transactions: []
epoch: "2.1"
- id: 66
transactions: []
epoch: "2.1"
Loading