Skip to content

Comparing similar functionality expressed in two different smart contract programming languages: Clarity and Solidity

Notifications You must be signed in to change notification settings

mefrem/clarity-vs-solidity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Clarity vs. Solidity

Clarity is the programming language for creating smart contracts and dApps in the Bitcoin Web3 ecosystem, published to the Stacks blockchain. It's an interpreted, decidable programmiung language, designed to make the handling of assets on a blockchain as safe, secure, and predictable as possible.

It was created 6 years after Solidity, the first-ever smart contract programming language for blockchain programs that run on the Ethereum Virtual Machine. Solidity is a compiled, Turing-complete language that is the most widely used programming language in Web3.

This repo

This repo contains a few contracts and scripts that demonstrate similar functionality—say, incrementing a counter, or withdrawing a user's balance from another contract—and compares their implementation in the two languages.

Contained within is the Clarity vs. Solidity Workshop PDF document shared on in September 2022.

"Counter" contract comparison.

Why should we care about { Clarity | Solidity }?

Rekt keeps a leaderboard of smart contract hacks—it's not pretty. There have been multiple half billion or more hacks in 2022 alone. These are largely Solidity-based dApps and bridges connecting EVM-compatible chains.

Clarity is the answer to the question: What would a predictable, secure smart contract programming language look like that incorporates the painful lessons of the first generation of decentralized finance and NFTs?

Learn More

"Withdraw balance" script functionality, highlighting reentrancy vulnerability in Solidity. The latter image highlights a "reentrancy vulnerability", a kind of exploit not possible in Clarity but which was responsible for the infamous "The DAO Hack" in 2015.

About

Comparing similar functionality expressed in two different smart contract programming languages: Clarity and Solidity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published