-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
1,657 additions
and
1,097 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,29 +1,78 @@ | ||
|
||
[project] | ||
name = "friedger-smart-contracts" | ||
description = "" | ||
authors = [] | ||
telemetry = false | ||
cache_dir = "./.cache" | ||
requirements = [ | ||
{ contract_id = "SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.nft-trait" }, | ||
{ contract_id = "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard" }, | ||
] | ||
|
||
[contracts.history] | ||
path = "contracts/experiments/history.clar" | ||
depends_on = [] | ||
|
||
[contracts.flip-coin] | ||
path = "contracts/experiments/flip-coin.clar" | ||
depends_on = [] | ||
|
||
[contracts.flip-coin-tax-office] | ||
path = "contracts/experiments/flip-coin-tax-office.clar" | ||
depends_on = [] | ||
|
||
[contracts.flip-coin-delegate] | ||
path = "contracts/experiments/flip-coin-delegate.clar" | ||
depends_on = ["flip-coin"] | ||
|
||
[contracts.flip-coin-jackpot] | ||
path = "contracts/experiments/flip-coin-jackpot.clar" | ||
depends_on = ["flip-coin", "flip-coin-tax-office"] | ||
|
||
[contracts.flip-coin-at-two] | ||
path = "contracts/experiments/flip-coin-at-two.clar" | ||
depends_on = ["flip-coin", "flip-coin-tax-office", "flip-coin-jackpot"] | ||
|
||
[notebooks] | ||
[contracts.perishable-token] | ||
path = "contracts/tokens/perishable-token.clar" | ||
|
||
[contracts.panic] | ||
path = "contracts/experiments/panic.clar" | ||
|
||
[contracts.beeple] | ||
path = "contracts/tokens/beeple.clar" | ||
|
||
[contracts.fungible-token] | ||
path = "contracts/tokens/fungible-token.clar" | ||
|
||
[contracts.trait-conversion] | ||
path = "contracts/experiments/trait-conversion.clar" | ||
clarity_version = 2 | ||
epoch = "2.1" | ||
|
||
[contracts.trait-conversion-router] | ||
path = "contracts/experiments/trait-conversion-router.clar" | ||
clarity_version = 2 | ||
epoch = "2.1" | ||
|
||
|
||
## Test contracts | ||
[contracts.perishable-token_test] | ||
path = "test/perishable-token_test.clar" | ||
clarity_version = 2 | ||
epoch = "2.1" | ||
|
||
[contracts.trait-conversion-router_test] | ||
path = "test/trait-conversion-router_test.clar" | ||
clarity_version = 2 | ||
epoch = "2.1" | ||
|
||
|
||
## REPL | ||
[repl.analysis] | ||
passes = ["check_checker"] | ||
check_checker = { trusted_sender = false, trusted_caller = false, callee_filter = false } | ||
|
||
# Check-checker settings: | ||
# trusted_sender: if true, inputs are trusted after tx_sender has been checked. | ||
# trusted_caller: if true, inputs are trusted after contract-caller has been checked. | ||
# callee_filter: if true, untrusted data may be passed into a private function without a | ||
# warning, if it gets checked inside. This check will also propagate up to the | ||
# caller. | ||
# More informations: https://www.hiro.so/blog/new-safety-checks-in-clarinet |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
;; routes the call with the correct tokens | ||
(define-public (transfer-two (amount uint) (recipient principal)) | ||
(contract-call? .trait-conversion transfer-two | ||
{token: .fungible-token } | ||
{token: .beeple} | ||
amount recipient)) | ||
|
||
(define-constant default-list (list {token: .fungible-token, amount: u1, recipient: (as-contract tx-sender)})) | ||
|
||
(define-public (transfer-many-default) | ||
(if true (contract-call? .trait-conversion transfer-many default-list) (err u1))) |
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,19 @@ | ||
(use-trait nft-trait 'SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.nft-trait.nft-trait) | ||
(use-trait ft-trait 'SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard.sip-010-trait) | ||
|
||
(define-public (transfer-two (ft-contract {token: <ft-trait>}) (nft-contract {token: <nft-trait>}) (amount uint) (recipient principal)) | ||
(let ((ft (get token ft-contract)) | ||
(nft (get token nft-contract))) | ||
(try! (contract-call? ft transfer amount tx-sender recipient none)) | ||
(try! (contract-call? nft transfer amount tx-sender recipient)) | ||
(ok true))) | ||
|
||
(define-public (transfer-many (fts (list 10 {token: <ft-trait>, amount: uint, recipient: principal}))) | ||
(ok (map transfer-many-iter fts))) | ||
|
||
(define-private (transfer-many-iter (transfer {token: <ft-trait>, amount: uint, recipient: principal})) | ||
(let ((ft (get token transfer))) | ||
(contract-call? ft transfer (get amount transfer) tx-sender (get recipient transfer) none))) | ||
|
||
(define-read-only (to-ft-trait (ft <ft-trait>)) | ||
ft) |
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
Oops, something went wrong.