Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marvinjanssen/clarity-experiments
https://github.com/marvinjanssen/clarity-experiments
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/marvinjanssen/clarity-experiments
- Owner: MarvinJanssen
- License: mit
- Created: 2021-05-28T04:27:52.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-06-28T16:44:50.000Z (over 3 years ago)
- Last Synced: 2024-05-01T18:04:04.132Z (7 months ago)
- Language: TypeScript
- Size: 27.3 KB
- Stars: 8
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Clarity Experiments
A collection of [Clarity](https://clarity-lang.org) smart contract experiments
by [Marvin Janssen](https://twitter.com/MarvinJanssen). They run on the
[Stacks blockchain](https://stacks.co).More documentation forthcoming. Until then, take a look at the
[unit tests](tests/) on how to use the contracts.## Smart contracts
### [Counter](contracts/counter.clar)
A basic counter contract.
### [Counter (multi-user)](contracts/counter-multi-user.clar)
A multiuser version of the counter contract.
### [Timelocked Wallet](contracts/timelocked-wallet.clar)
A time-locked vault contract that becomes eligible to claim by the beneficiary
after a certain block-height has been reached.### [Timelocked Wallet (simplified)](contracts/timelocked-wallet-simplified.clar)
A simplified version of the timelocked-wallet contract that uses top-level
defines.### [Multisig Vault](contracts/multisig-vault.clar)
A simple multisig vault that allows members to vote on who should receive the
STX contents.### [SIP009 NFT](contracts/sip009-nft.clar)
A SIP009-compliant NFT with a mint function.
### [SIP010 Fungible Token](contracts/sip010-token.clar)
A SIP010-compliant fungible token with a mint function.
### [Tiny Market](contracts/tiny-market.clar)
A tiny NFT marketplace (<100 lines of code!) that allows users to list NFTs for
sale for a fixed price. Users request payment in either STX or a
SIP010-compliant fungible token.The maker can specify the following when listing:
- The NFT token to sell.
- Listing expiry in block height.
- The payment asset, either STX or a SIP010 fungible token.
- The NFT price in said payment asset.
- An optional intended taker. If set, only that principal will be able to
fulfill the listing. (Useful if you want to trustlessly sell an NFT to someone
specific.)NFTs are transferred to the market contract when listed. The maker can get it
back at any time by cancelling the listing. If the listing expires, the maker
can likewise retrieve the NFT by cancelling.When the taker fulfills the listing, the payment asset is transferred to the
maker directly. If all goes well, the NFT is released to the taker.