Skip to content

Support global constants when compiling parameter/expression

Hi, I have contract which stores lambda functions which we configure through compile parameter. I would like to move some common parts of lambdas into global constants, but I am not able to right now with ligo@38+ due to type checks.

Getting errors like:

  (constant "expruzqKrP2zWnWyaBDBmqnxjRZ5L55nmf18NuBJirVwVEWbvuoALG")
is invalid for type lambda (pair (pair bytes int) int) int.
At (unshown) location 12, unexpected primitive, only a sequence
can be used here.

The issue is that I am not able to specify --constants or --file-constants under compile expression/compile parameter. Technically I could precompile constant load into contract with compile contract ... but that would cause lose of flexibility we can get if it is entirely dependent on stored lambda.