File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 2121
2222import uplc
2323import uplc .ast
24+ import uplc .flat_encoder
25+ from uplc .ast import Program
2426from uplc .cost_model import PlutusVersion
2527
2628from . import (
@@ -377,12 +379,23 @@ def perform_command(args):
377379 return
378380 code = pluthon .compile (code , config = compiler_config )
379381
382+ # Add a marker for OpShin/version
383+ code = uplc .ast .Program (
384+ code .version ,
385+ uplc .ast .Apply (
386+ uplc .ast .Lambda ("_" , code .term ),
387+ uplc .ast .BuiltinByteString (
388+ bytes ([ord ("o" ), * (int (x ) for x in __version__ .split ("." ))])
389+ ),
390+ ),
391+ )
392+
380393 # apply parameters from the command line to the contract (instantiates parameterized contract!)
381394 code = code .term
382395 # UPLC lambdas may only take one argument at a time, so we evaluate by repeatedly applying
383396 for d in uplc_params :
384397 code = uplc .ast .Apply (code , d )
385- code = uplc .ast .Program ((1 , 0 , 0 ), code )
398+ code = uplc .ast .Program ((1 , 1 , 0 ), code )
386399
387400 if command == Command .compile :
388401 print (code .dumps ())
You can’t perform that action at this time.
0 commit comments