On January 14th, the Stacks 2.0 blockchain was officially launched and marked a huge milestone on the journey to building Web 3.0 on Bitcoin. To celebrate the launch of mainnet, we wanted to give developers an immediate opportunity to dive into Stacks tech with the Stacks 2.0 Mainnet Smart Contract Challenge!
The testnet training wheels came off, and hackers had an entire month to sharpen their Clarity skills and crank out some truly substantial smart contracts. In order to keep the challenge accessible to all technical skill levels, there were also two categories of contract difficulty (Basic & Advanced). Excitingly, this is also one of the first bounties that will be paid out in the native STX token! Our rockstar panel of community judges combed the projects with a fine-tooth comb, and are excited to share details from some of their favorites.
Category: Advanced
Author: Philip De Smedt
ArkadikoDAO is a DAO inspired by Ethereum’s MakerDAO and implements a stablecoin called Arkadiko ($DIKO) and a governance token called Somos ($ARE). In order to mint $DIKO, you need to over-collateralise Stacks ($STX) tokens into the Arkadiko Stacks Reserve. The collateralisation ratio will be defined by a risk parameter decided upon by the community.
We’re beginning to see exceptionally robust decentralized finance (DeFi) applications be built on Stacks, and the connection to the Bitcoin network gives developers even more power in the platforms they create. There are also two ground-breaking innovations implemented in ArkadikoDAO: a stablecoin, and market-making. Stablecoins are absolutely paramount in crypto as a creative way to mitigate risk and volatility of crypto assets. Establishing stablecoin standards on Stacks will only grow the ecosystem and encourage stability. Additionally, having the ability for STX holders to market make, and put their crypto to work, provides even more opportunities for value creation and passive income.
If anything signals the Stacks developer ecosystem is leveling-up, it’s production-grade smart contracts like ArkadikoDAO. We’re transitioning away from lil’ code snippets demonstrating the power of Clarity, to complex contract suites enabling entire use cases like CDPs or price-stable assets.
→ View on Github
Category: Basic
Author: Daniel Zhou
For all you superstitious blockchainers out there, this brand new Clarity magic 8-ball contract is sure to answer all your burning questions! Inspired by a traditional coin-flip mechanism, this submission will randomly return one of eight responses depending on the blockchain height. This developer defined buffers for each of the options, and used the core Stacks protocol to inject randomness.
→ View on Github
Category: Basic
Author: Daniel Zhou
A turnstile might evoke an image of a crowded, dirty subway station in NYC, with throngs of people streaming through the shiny, metal bottleneck. Regardless of its use in the most uncomfortable of public places, a turnstile is actually an extremely important, functional mechanism for flow control.
One hacker took the turnstile out of the subway, and into the blockchain. Clarity Turnstile is a contract for a coin-based turnstile finite state machine (FSM). A simple but elegant implementation, this contract will 'lock' or 'unlock' based on if a coin has been 'inserted' into the program. It's always intriguing to see real-world utilities converted into blockchain software! Not even the most skilled turnstile-jumpers can avoid this fare…
→ View on Github
Clarity Prediction Market
Author: Zafer Ozsoy
Prediction markets have gained significant traction in the blockchain space, as they’re perfect demonstrations of how crowdsourcing knowledge can the most reliable method of collection. Markets are opened on anything and everything, from the results of an election to the price of Bitcoin at a particular date & time. Using decentralized infrastructure to facilitate prediction markets is an ideal utilization of its privacy, security, and immutability.
The Clarity Prediction Market uses a map to store data on the market’s question, balance, total votes, and the owner of the market. There are also maps to store the number of ‘yes’ and ‘no’ votes. By simply calling the createMarket method, a user can submit a market of their choosing to the platform for others to join.
→ View on Github
Check out some of the other Clarity smart contracts submitted to the challenge:
Author: Zafer Ozsoy
Category: Basic
Simple faucet that can be funded by anyone and will pay out only once to each STX address.
→ View on Github
Author: Zafer Ozsoy
Category: Basic
A higher or lower guessing game. User calls the contract with a number and "higher” or ”lower". It's compared to a pre-calculated value and if they are right, they win half of the smart contract balance.
→ View on Github
Author: Daniel Zhou
Category: Basic
A smart contract for determining the winner between two players in a game of rock paper scissors.
→ View on Github
Clarity Agreement
Author: Daniel Zhou
Category: Basic
A contract for determining if two parties are in agreement. Only the principal of each party can change the decision or change the party principal to another address.
→ View on Github
Author: Daniel Zhou
Category: Basic
A Clarity smart contract for calculating compound interest.
→ View on Github
Author: Lyle Davids
Category: Basic
A Clarity smart contract for calculating BMI (Body Mass Index).
→ View on Github
Get important updates about Stacks technology, projects, events, and more to your inbox.