Version: Next

Embedded Michelson

If you have an existing piece of Michelson code that you want to use as-is, LIGO provides the ability to embed Michelson code.

function michelson_add (var n : nat * nat ) : nat is block {
const f : (nat * nat -> nat) =
[%Michelson ({| { UNPAIR; ADD } |} : nat *nat -> nat)];
} with f (n)

Note that the type annotation is required, because the embedded Michelson code is not type checked by LIGO. This assumes that the given type is correct.