Comment generated code in Indigo example
Clarification and motivation
On Indigo website we have a sample Indigo contract
exampleContract :: IndigoContract Integer Integer
exampleContract param = defContract do
a <- new$ 1 int
storageVar =: param + a
and a button to view its Michelson version. This is how it looks like
parameter int;
storage int;
code { NIL operation;
SWAP;
DUP;
CAR;
DIP { CDR };
PUSH int 1;
DUP;
DIP 2
{ DUP };
DIG 2;
ADD;
DIP 3
{ DROP };
DUG 2;
DROP;
DROP;
SWAP;
PAIR };
I think we can better demonstrate how Indigo compilation works by adding some comments to this Michelson code. Something like
# We put an empty list of operations at the beginning and remember its position,
# it is updated when a new operation is made.
NIL operation;
SWAP;
# Then we unpair the parameter and storage…
Acceptance criteria
Michelson code in the small example on Indigo website contains comments clarifying how compilation behaves.