How to be sure your Ligo code compiles to the Michelson code you want

Image for post
Image for post
Michelson code

Ligo is a fantastic tool that makes working with Tezos smart contracts a lot easier. However, its ease of use means that the compiler takes care of the heavy lifting for you and may compile your code down to a format you may not want. This becomes particularly important with TZIP standards: these standards establish fixed Michelson structures that could make your code useless if you don’t respect them. Here is a very simple example:

Imagine you have a record in Ligo like this one:

let my_record = {
owner: "tz1...";
balance: 100n;
name: "John Smith"…


Claude Barde

Traveler, translator and self-taught programmer; writing about the Tezos blockchain

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store