Skip to content

MarvinJanssen/clarity-experiments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clarity Experiments

A collection of Clarity smart contract experiments by Marvin Janssen. They run on the Stacks blockchain.

More documentation forthcoming. Until then, take a look at the unit tests on how to use the contracts.

Smart contracts

A basic counter contract.

A multiuser version of the counter contract.

A time-locked vault contract that becomes eligible to claim by the beneficiary after a certain block-height has been reached.

A simplified version of the timelocked-wallet contract that uses top-level defines.

A simple multisig vault that allows members to vote on who should receive the STX contents.

A SIP009-compliant NFT with a mint function.

A SIP010-compliant fungible token with a mint function.

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published