From 59cfa209d7a2dda325fb83939e4b0dc98370c782 Mon Sep 17 00:00:00 2001 From: microproofs Date: Thu, 23 May 2024 15:04:59 -0400 Subject: [PATCH] change uplc version number based on plutus version --- crates/aiken-lang/src/gen_uplc.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/aiken-lang/src/gen_uplc.rs b/crates/aiken-lang/src/gen_uplc.rs index f6ee5c03..27f66104 100644 --- a/crates/aiken-lang/src/gen_uplc.rs +++ b/crates/aiken-lang/src/gen_uplc.rs @@ -217,12 +217,13 @@ impl<'a> CodeGenerator<'a> { fn finalize(&mut self, mut term: Term) -> Program { term = self.special_functions.apply_used_functions(term); - // TODO: Once SOP is implemented on mainnet, new version is 1.1.0 - let mut program = Program { - version: (1, 0, 0), - term, + let version = match self.plutus_version { + PlutusVersion::V1 | PlutusVersion::V2 => (1, 0, 0), + PlutusVersion::V3 => (1, 1, 0), }; + let mut program = Program { version, term }; + program = aiken_optimize_and_intern(program); // This is very important to call here.