Introduction to Helios
Helios is a DSL (Domain Specific Language) for writing smart contracts for the Cardano blockchain.
The Helios library is written in Javascript and has an API for:
- compiling Helios sources into Plutus-Core
- building and submitting transactions to the Cardano blockchain
Code sample
// all Helios programs begin with a script purpose
spending always_true
// the 'main' function contains the core validator logic
// returns true if a given UTxO is allowed to be spent
func main(_, _, _) -> Bool {
// Helios is an expression based language
true
}
// Note: the datum, redeemer, and scriptcontext are ignored by the underscores
Structure of this book
Before starting to use Helios to create smart contracts and build DApps it is important to understand Cardano's eUTxO model very well. If you don't yet, we recommend you read the Understanding eUTxOs preface first.
Chapter 1 covers the language itself, including a complete reference of the Helios builtins.
Chapter 2 covers setting up the Helios library, compiling smart contracts, and building and submitting smart contract transactions, using only Javascript.
Chapter 3 covers how to use Helios smart contracts with cardano-cli.
Chapter 4 covers minting policies, exploits to be aware of, some more complex scripts, and some recommendations for building DApps.