Skip to main content

Michelson Code Inlining

See reference Inline Michelson template.



Inline arbitrary Michelson code.

types_in and types_out are lists of types, and code is some Michelson code using the micheline syntax.

Currently, in practice, only singleton types_out are supported.

sp.michelson(code, types_in, types_out)

​ = sp.michelson("ADD;", [sp.TInt, sp.TInt], [sp.TInt])(15, 16)
​ = sp.michelson("DUP; DIG 2; ADD; MUL;", [sp.TInt, sp.TInt], [sp.TInt])(15, 16)


A special case of sp.michelson where the code represents a lambda.

sp.lambda_michelson(code, source = None, target = None)

It is of type sp.TLambda(type_in, type_out) = sp.lambda_michelson("DUP; PUSH int 2; ADD; MUL;", sp.TNat, sp.TInt)