Skip to main content
Version: 0.67.1

CLI Commands

Contracts written in LIGO can be compiled using the ligo executable.

Compiling a contract

Compile your contract with a specific entry point.

ligo compile contract SOURCE_FILE --entry-point ENTRY_POINT

Example

ligo compile contract examples/counter.mligo --entry-point main

Defining the initial storage

If your contract implements a sophisticated storage, you can compile a LIGO expression into a Michelson value quite easily.

ligo compile storage SOURCE_FILE EXPRESSION --entry-point ENTRY_POINT

Example

ligo compile storage examples/counter.mligo 5 --entry-point main
# Outputs: 5

Invoking the contract with a parameter

ligo compile parameter SOURCE_FILE EXPRESSION --entry-point ENTRY_POINT

Example

ligo compile parameter examples/counter.mligo "Increment(5)" --entry-point main
# Outputs: (Right 5)