In this chapter, we will dissect some hello world programs and learn the basics of Clarity and its functional programming syntax. We will learn how to define a function and the fundamental control flow functions.
In this chapter, we will gradually learn about the data types powering Clarity, from the most basic ones, to the most sophisticated. This chapter will gives us the fundamental keys to approach the next chapters.
In this chapter, we will be introducing two primitives for storing, updating and retrieving stateful data in Clarity programs, along with their associated functions.
In this chapter, we will learn about all the arithmetic and logic functions available natively in Clarity.
In this chapter, we will have a closer look at a family of types, the sequences (list, buffer and strings), and see how the functions map / reduce can be combined and leveraged for solving problems.
In this chapter, we will introduce another type of data storage primitive, designed to simplify the structure and reduce the amount of code of programs manipulating Fungible and Non Fungible Tokens.
In this chapter, we will learn about the handful of native cryptographic functions available natively with Clarity, along with some of the very unique functions that can be used for exploring the state of the chain, past and present.
In this chapter, we will learn how contracts can safely dispatch inter contract calls and exchange data with other programs, statically and dynamically through the use of traits.
In this chapter, we will learn about smart contracts best practices. We will be suggesting design patterns and recommandations aiming at maximizing security.
In this notebook, we will generate some randomness, using the VRF of the current block
The first step is to ensure that you have Rust and the support software installed.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Then you need to install Jupyter, using your favourite package manager:
brew install jupyter
And install Clarity for Jupyter:
cargo install clarity-jupyter-kernel
clarity-jupyter-kernel --install
From there, you can clone this repository:
git clone https://github.com/lgalabru/clarity-notebook.git
cd clarity-notebook
Then start Jupyter:
jupyter-notebook
Happy hacking / learning!
- Chapter 1 - drafted
- Chapter 2 - drafted
- Chapter 3 - drafted
- Chapter 4 - drafted
- Chapter 5
- Chapter 6
- Chapter 7
- Chapter 8
- Chapter 9