Advanced Clarity Smart Contract Examples

Hey there, Everyone!

Happy Friday! Just wanted to share a little curated smart contract list I assembled today. They are what I would consider the most robust, substantive Clarity smart contracts that have been developed for Stacks 2.0 so far. These should act as sterling examples of the potential of the language, and I would recommend any beginners comb through some code to begin grasping advanced usage.


An automated token exchange modeled after Uniswap in Clarity for Stacks 2.0.


A reimplementation of the Ampleforth Token, Oracle and Geyser.


A conversion of Ethereum’s Moloch DAO in Clarity.

SRC-20 Token Standard Trait

A token standard in Clarity similar to Ethereum’s ERC-20

Composable Token

A composable NFT token that can be attached to, or detached from, any NFT token.

NFT Marketplace

Clarity smart contract for a marketplace of tradable assets.


A Clarity smart contract for crowdfunding on the STX blockchain.

Non-Fungible Token

An implementation of non-fungible tokens in Clarity.

Margin Trading Failsafe

This smart contract helps facilitate a margin-trading account with built-in checking for available balance above a margin limit before authorizing new spending.

Key-Value Store

A key-value storage map in Clarity.

uint256 Library

A library for converting values into 256-bits.

Lightning Swaps

Fraud-proof swaps using Lightning.

Election Voting

A basic voting election for candidates in Clarity.


A collection of Clarity contracts that implement a De-Fi ecosystem of exchanges.


Wrapping and minting tokens.

And don’t forget! You can find a spreadsheet of each and every Clarity smart contract that was developed during testnet HERE.


This is awesome!!! Thanks for sharing, Joe. Amazing work by community builders :clap:t3::rocket:. Can’t wait to see how this list evolves and these contracts get used now that Stacks 2 is live!