Your Docusaurus site did not load properly.

A very common reason is a wrong site baseUrl configuration.

Current configured baseUrl = / (default value)

We suggest trying baseUrl =

A friendly Smart Contract Language for Tezos

Smart contracts were never so easy

type storage = int;
type parameter =
| ["Increment", int]
| ["Decrement", int]
| ["Reset"];
type return_ = [list <operation>, storage];
/* Two entrypoints */
const add = ([store, delta] : [storage, int]) : storage => store + delta;
const sub = ([store, delta] : [storage, int]) : storage => store - delta;
/* Main access point that dispatches to the entrypoints according to
the smart contract parameter. */
const main = ([action, store] : [parameter, storage]) : return_ => {
return [
(list([]) as list <operation>), // No operations
(match (action, {
Increment: (n: int) => add ([store, n]),
Decrement: (n: int) => sub ([store, n]),
Reset: () => 0}))
]
};
/* Tests for main access point */
const _test_initial_storage = () : unit => {
let initial_storage = 42 as int;
let [taddr, _, _] = Test.originate(main, initial_storage, 0 as tez);
return assert(Test.get_storage(taddr) == initial_storage);
};
const test_initial_storage = _test_initial_storage();
const _test_increment = () : unit => {
let initial_storage = 42 as int;
let [taddr, _, _] = Test.originate(main, initial_storage, 0 as tez);
let contr = Test.to_contract(taddr);
let _ = Test.transfer_to_contract_exn(contr, (Increment (1)), 1 as mutez);
return assert(Test.get_storage(taddr) == initial_storage + 1);
}
const test_increment = _test_increment();

Strong, Static Type System

Write types, then code. Benefit from the safety of type systems.

Polyglot

Code in your language. Write PascaLIGO, CameLIGO, ReasonLIGO, JsLIGO or add your own syntax.

Easy Integration

You can use LIGO as a Node.js library with Truffle.

Our Partners