From 50db958d0672abacbebd67e37071ce2e332cecf6 Mon Sep 17 00:00:00 2001 From: Kasey White Date: Mon, 20 Mar 2023 02:31:51 -0400 Subject: [PATCH] update codegen to use more streamlined uplc building methods --- crates/aiken-lang/src/uplc.rs | 1441 ++++------------- crates/uplc/src/ast/builder.rs | 47 +- examples/acceptance_tests/036/plutus.json | 8 +- examples/acceptance_tests/071/plutus.json | 4 +- examples/acceptance_tests/077/plutus.json | 4 +- .../script_context/plutus.json | 64 +- 6 files changed, 437 insertions(+), 1131 deletions(-) diff --git a/crates/aiken-lang/src/uplc.rs b/crates/aiken-lang/src/uplc.rs index b01fea5c..c49b4638 100644 --- a/crates/aiken-lang/src/uplc.rs +++ b/crates/aiken-lang/src/uplc.rs @@ -5,9 +5,8 @@ use itertools::Itertools; use uplc::{ ast::{ builder::{ - self, apply_wrap, assert_on_list, choose_list, constr_index_exposer, - delayed_choose_list, delayed_if_else, final_wrapper, if_else, repeat_tail_list, - ASSERT_ON_LIST, CONSTR_FIELDS_EXPOSER, CONSTR_GET_FIELD, + self, apply_wrap, assert_on_list, constr_index_exposer, final_wrapper, + repeat_tail_list, ASSERT_ON_LIST, CONSTR_FIELDS_EXPOSER, CONSTR_GET_FIELD, }, Constant as UplcConstant, Name, NamedDeBruijn, Program, Term, Type as UplcType, }, @@ -4053,9 +4052,7 @@ impl<'a> CodeGenerator<'a> { name: constr_name, .. } => { if constructor.tipo.is_bool() { - arg_stack.push(Term::Constant( - UplcConstant::Bool(constr_name == "True").into(), - )); + arg_stack.push(Term::bool(constr_name == "True")); } else if constructor.tipo.is_void() { arg_stack.push(Term::Constant(UplcConstant::Unit.into())); } else { @@ -4072,9 +4069,7 @@ impl<'a> CodeGenerator<'a> { .find(|(_, x)| x.name == *constr_name) .unwrap(); - let fields = Term::Constant( - UplcConstant::ProtoList(UplcType::Data, vec![]).into(), - ); + let fields = Term::empty_list(); let term = Term::constr_data() .apply(Term::integer(constr_index.try_into().unwrap())) @@ -4085,9 +4080,7 @@ impl<'a> CodeGenerator<'a> { } }; } - Air::Void { .. } => { - arg_stack.push(Term::Constant(UplcConstant::Unit.into())); - } + Air::Void { .. } => arg_stack.push(Term::Constant(UplcConstant::Unit.into())), Air::List { count, tipo, tail, .. } => { @@ -4156,15 +4149,9 @@ impl<'a> CodeGenerator<'a> { let mut term = if tail { arg_stack.pop().unwrap() } else if tipo.is_map() { - Term::Constant( - UplcConstant::ProtoList( - UplcType::Pair(UplcType::Data.into(), UplcType::Data.into()), - vec![], - ) - .into(), - ) + Term::empty_map() } else { - Term::Constant(UplcConstant::ProtoList(UplcType::Data, vec![]).into()) + Term::empty_list() }; for arg in args.into_iter().rev() { @@ -4173,10 +4160,7 @@ impl<'a> CodeGenerator<'a> { } else { convert_type_to_data(arg, &list_type) }; - term = apply_wrap( - apply_wrap(Term::Builtin(DefaultFunction::MkCons).force(), list_item), - term, - ); + term = Term::mk_cons().apply(list_item).apply(term); } arg_stack.push(term); } @@ -4337,7 +4321,7 @@ impl<'a> CodeGenerator<'a> { } else { arg }; - term = apply_wrap(term, arg.clone()); + term = term.apply(arg.clone()); } match func { @@ -4428,218 +4412,138 @@ impl<'a> CodeGenerator<'a> { Term::equals_data() }; - let term = match name { - BinOp::And => left.delayed_if_else(right, Term::bool(false)), - BinOp::Or => left.delayed_if_else(Term::bool(true), right), - BinOp::Eq => { - if tipo.is_bool() { - let term = left.delayed_if_else( - right.clone(), - right.if_else(Term::bool(false), Term::bool(true)), - ); - - arg_stack.push(term); - return; - } else if tipo.is_map() { - let term = builtin - .apply(Term::map_data().apply(left)) - .apply(Term::map_data().apply(right)); - - arg_stack.push(term); - return; - } else if tipo.is_tuple() - && matches!(tipo.get_uplc_type(), UplcType::Pair(_, _)) - { - let term = builtin - .apply( - Term::map_data().apply( - Term::mk_cons().apply(left).apply(Term::Constant( - UplcConstant::ProtoList( - UplcType::Pair( - UplcType::Data.into(), - UplcType::Data.into(), - ), - vec![], - ) - .into(), - )), - ), - ) - .apply( - Term::map_data().apply( - Term::mk_cons().apply(right).apply(Term::Constant( - UplcConstant::ProtoList( - UplcType::Pair( - UplcType::Data.into(), - UplcType::Data.into(), - ), - vec![], - ) - .into(), - )), - ), + let term = + match name { + BinOp::And => left.delayed_if_else(right, Term::bool(false)), + BinOp::Or => left.delayed_if_else(Term::bool(true), right), + BinOp::Eq => { + if tipo.is_bool() { + let term = left.delayed_if_else( + right.clone(), + right.if_else(Term::bool(false), Term::bool(true)), ); - arg_stack.push(term); - return; - } else if tipo.is_list() || tipo.is_tuple() { - let term = builtin - .apply(Term::list_data().apply(left)) - .apply(Term::list_data().apply(right)); + arg_stack.push(term); + return; + } else if tipo.is_map() { + let term = builtin + .apply(Term::map_data().apply(left)) + .apply(Term::map_data().apply(right)); - arg_stack.push(term); - return; - } else if tipo.is_void() { - arg_stack.push(Term::bool(true)); - return; + arg_stack.push(term); + return; + } else if tipo.is_tuple() + && matches!(tipo.get_uplc_type(), UplcType::Pair(_, _)) + { + let term = builtin + .apply(Term::map_data().apply( + Term::mk_cons().apply(left).apply(Term::empty_map()), + )) + .apply(Term::map_data().apply( + Term::mk_cons().apply(right).apply(Term::empty_map()), + )); + + arg_stack.push(term); + return; + } else if tipo.is_list() || tipo.is_tuple() { + let term = builtin + .apply(Term::list_data().apply(left)) + .apply(Term::list_data().apply(right)); + + arg_stack.push(term); + return; + } else if tipo.is_void() { + arg_stack.push(Term::bool(true)); + return; + } + + builtin.apply(left).apply(right) } + BinOp::NotEq => { + if tipo.is_bool() { + let term = left.delayed_if_else( + right.clone().if_else(Term::bool(false), Term::bool(true)), + right, + ); - builtin.apply(left).apply(right) - } - BinOp::NotEq => { - if tipo.is_bool() { - let term = delayed_if_else( - left, - if_else( - right.clone(), - Term::Constant(UplcConstant::Bool(false).into()), - Term::Constant(UplcConstant::Bool(true).into()), - ), - right, - ); - arg_stack.push(term); - return; - } else if tipo.is_map() { - let term = if_else( - apply_wrap( - apply_wrap( - builtin, - apply_wrap(DefaultFunction::MapData.into(), left), - ), - apply_wrap(DefaultFunction::MapData.into(), right), - ), - Term::Constant(UplcConstant::Bool(false).into()), - Term::Constant(UplcConstant::Bool(true).into()), - ); + arg_stack.push(term); + return; + } else if tipo.is_map() { + let term = builtin + .apply(Term::map_data().apply(left)) + .apply(Term::map_data().apply(right)) + .if_else(Term::bool(false), Term::bool(true)); - arg_stack.push(term); - return; - } else if tipo.is_tuple() - && matches!(tipo.get_uplc_type(), UplcType::Pair(_, _)) - { - let mut term = apply_wrap( - apply_wrap( - builtin, - apply_wrap( - DefaultFunction::MapData.into(), - apply_wrap( - apply_wrap( - Term::Builtin(DefaultFunction::MkCons).force(), - left, - ), - Term::Constant( - UplcConstant::ProtoList( - UplcType::Pair( - UplcType::Data.into(), - UplcType::Data.into(), - ), - vec![], - ) - .into(), - ), - ), - ), - ), - apply_wrap( - DefaultFunction::MapData.into(), - apply_wrap( - apply_wrap( - Term::Builtin(DefaultFunction::MkCons).force(), - right, - ), - Term::Constant( - UplcConstant::ProtoList( - UplcType::Pair( - UplcType::Data.into(), - UplcType::Data.into(), - ), - vec![], - ) - .into(), - ), - ), - ), - ); + arg_stack.push(term); + return; + } else if tipo.is_tuple() + && matches!(tipo.get_uplc_type(), UplcType::Pair(_, _)) + { + let term = builtin + .apply(Term::map_data().apply( + Term::mk_cons().apply(left).apply(Term::empty_map()), + )) + .apply(Term::map_data().apply( + Term::mk_cons().apply(right).apply(Term::empty_map()), + )) + .if_else(Term::bool(false), Term::bool(true)); - term = if_else( - term, - Term::Constant(UplcConstant::Bool(false).into()), - Term::Constant(UplcConstant::Bool(true).into()), - ); - arg_stack.push(term); - return; - } else if tipo.is_list() || tipo.is_tuple() { - let term = if_else( - apply_wrap( - apply_wrap( - builtin, - apply_wrap(DefaultFunction::ListData.into(), left), - ), - apply_wrap(DefaultFunction::ListData.into(), right), - ), - Term::Constant(UplcConstant::Bool(false).into()), - Term::Constant(UplcConstant::Bool(true).into()), - ); + arg_stack.push(term); + return; + } else if tipo.is_list() || tipo.is_tuple() { + let term = builtin + .apply(Term::list_data().apply(left)) + .apply(Term::list_data().apply(right)) + .if_else(Term::bool(false), Term::bool(true)); - arg_stack.push(term); - return; - } else if tipo.is_void() { - arg_stack.push(Term::Constant(UplcConstant::Bool(false).into())); - return; + arg_stack.push(term); + return; + } else if tipo.is_void() { + arg_stack.push(Term::bool(false)); + return; + } + + builtin + .apply(left) + .apply(right) + .if_else(Term::bool(false), Term::bool(true)) } + BinOp::LtInt => apply_wrap( + apply_wrap(DefaultFunction::LessThanInteger.into(), left), + right, + ), - if_else( - apply_wrap(apply_wrap(builtin, left), right), - Term::Constant(UplcConstant::Bool(false).into()), - Term::Constant(UplcConstant::Bool(true).into()), - ) - } - BinOp::LtInt => apply_wrap( - apply_wrap(DefaultFunction::LessThanInteger.into(), left), - right, - ), - - BinOp::LtEqInt => apply_wrap( - apply_wrap(DefaultFunction::LessThanEqualsInteger.into(), left), - right, - ), - BinOp::GtEqInt => apply_wrap( - apply_wrap(DefaultFunction::LessThanEqualsInteger.into(), right), - left, - ), - BinOp::GtInt => apply_wrap( - apply_wrap(DefaultFunction::LessThanInteger.into(), right), - left, - ), - BinOp::AddInt => { - apply_wrap(apply_wrap(DefaultFunction::AddInteger.into(), left), right) - } - BinOp::SubInt => apply_wrap( - apply_wrap(DefaultFunction::SubtractInteger.into(), left), - right, - ), - BinOp::MultInt => apply_wrap( - apply_wrap(DefaultFunction::MultiplyInteger.into(), left), - right, - ), - BinOp::DivInt => apply_wrap( - apply_wrap(DefaultFunction::DivideInteger.into(), left), - right, - ), - BinOp::ModInt => { - apply_wrap(apply_wrap(DefaultFunction::ModInteger.into(), left), right) - } - }; + BinOp::LtEqInt => apply_wrap( + apply_wrap(DefaultFunction::LessThanEqualsInteger.into(), left), + right, + ), + BinOp::GtEqInt => apply_wrap( + apply_wrap(DefaultFunction::LessThanEqualsInteger.into(), right), + left, + ), + BinOp::GtInt => apply_wrap( + apply_wrap(DefaultFunction::LessThanInteger.into(), right), + left, + ), + BinOp::AddInt => { + apply_wrap(apply_wrap(DefaultFunction::AddInteger.into(), left), right) + } + BinOp::SubInt => apply_wrap( + apply_wrap(DefaultFunction::SubtractInteger.into(), left), + right, + ), + BinOp::MultInt => apply_wrap( + apply_wrap(DefaultFunction::MultiplyInteger.into(), left), + right, + ), + BinOp::DivInt => apply_wrap( + apply_wrap(DefaultFunction::DivideInteger.into(), left), + right, + ), + BinOp::ModInt => { + apply_wrap(apply_wrap(DefaultFunction::ModInteger.into(), left), right) + } + }; arg_stack.push(term); } Air::DefineFunc { @@ -4660,77 +4564,21 @@ impl<'a> CodeGenerator<'a> { let mut term = arg_stack.pop().unwrap(); for param in params.iter().rev() { - func_body = Term::Lambda { - parameter_name: Name { - text: param.clone(), - unique: 0.into(), - } - .into(), - body: func_body.into(), - }; + func_body = func_body.lambda(param.clone()); } if !recursive { - term = apply_wrap( - Term::Lambda { - parameter_name: Name { - text: func_name, - unique: 0.into(), - } - .into(), - body: term.into(), - }, - func_body, - ); + term = term.lambda(func_name).apply(func_body); arg_stack.push(term); } else { - func_body = Term::Lambda { - parameter_name: Name { - text: func_name.clone(), - unique: 0.into(), - } - .into(), - body: func_body.into(), - }; + func_body = func_body.lambda(func_name.clone()); - term = apply_wrap( - Term::Lambda { - parameter_name: Name { - text: func_name.clone(), - unique: 0.into(), - } - .into(), - body: apply_wrap( - Term::Lambda { - parameter_name: Name { - text: func_name.clone(), - unique: 0.into(), - } - .into(), - body: term.into(), - }, - apply_wrap( - Term::Var( - Name { - text: func_name.clone(), - unique: 0.into(), - } - .into(), - ), - Term::Var( - Name { - text: func_name, - unique: 0.into(), - } - .into(), - ), - ), - ) - .into(), - }, - func_body, - ); + term = term + .lambda(func_name.clone()) + .apply(Term::var(func_name.clone()).apply(Term::var(func_name.clone()))) + .lambda(func_name) + .apply(func_body); arg_stack.push(term); } @@ -4740,17 +4588,7 @@ impl<'a> CodeGenerator<'a> { let mut term = arg_stack.pop().unwrap(); - term = apply_wrap( - Term::Lambda { - parameter_name: Name { - text: name, - unique: 0.into(), - } - .into(), - body: term.into(), - }, - arg, - ); + term = term.lambda(name).apply(arg); arg_stack.push(term); } @@ -4773,31 +4611,13 @@ impl<'a> CodeGenerator<'a> { let mut term = arg_stack.pop().unwrap(); - let error_term = apply_wrap( - apply_wrap( - Term::Builtin(DefaultFunction::Trace).force(), - Term::Constant( - UplcConstant::String( - "Expected on incorrect constructor variant.".to_string(), - ) - .into(), - ), - ), - Term::Delay(Term::Error.into()), - ) - .force(); + let error_term = + Term::Error.trace("Expected on incorrect constructor variant.".to_string()); - term = delayed_if_else( - apply_wrap( - apply_wrap( - DefaultFunction::EqualsInteger.into(), - Term::Constant(UplcConstant::Integer(constr_index.into()).into()), - ), - constr_index_exposer(constr), - ), - term, - error_term, - ); + term = Term::equals_integer() + .apply(Term::integer(constr_index.into())) + .apply(constr_index_exposer(constr)) + .delayed_if_else(term, error_term); arg_stack.push(term); } @@ -4805,24 +4625,13 @@ impl<'a> CodeGenerator<'a> { let value = arg_stack.pop().unwrap(); let mut term = arg_stack.pop().unwrap(); - let error_term = apply_wrap( - apply_wrap( - Term::Builtin(DefaultFunction::Trace).force(), - Term::Constant( - UplcConstant::String( - "Expected on incorrect boolean variant.".to_string(), - ) - .into(), - ), - ), - Term::Delay(Term::Error.into()), - ) - .force(); + let error_term = + Term::Error.trace("Expected on incorrect boolean variant".to_string()); if is_true { - term = delayed_if_else(value, term, error_term); + term = value.delayed_if_else(term, error_term) } else { - term = delayed_if_else(value, error_term, term); + term = value.delayed_if_else(error_term, term) } arg_stack.push(term); } @@ -4831,40 +4640,22 @@ impl<'a> CodeGenerator<'a> { } => { let subject = arg_stack.pop().unwrap(); - let mut term = arg_stack.pop().unwrap(); - - term = if tipo.is_int() + let subject = if tipo.is_int() || tipo.is_bytearray() || tipo.is_string() || tipo.is_list() || tipo.is_tuple() || tipo.is_bool() { - apply_wrap( - Term::Lambda { - parameter_name: Name { - text: subject_name, - unique: 0.into(), - } - .into(), - body: term.into(), - }, - subject, - ) + subject } else { - apply_wrap( - Term::Lambda { - parameter_name: Name { - text: subject_name, - unique: 0.into(), - } - .into(), - body: term.into(), - }, - constr_index_exposer(subject), - ) + constr_index_exposer(subject) }; + let mut term = arg_stack.pop().unwrap(); + + term = term.lambda(subject_name).apply(subject); + arg_stack.push(term); } Air::Clause { @@ -4877,167 +4668,66 @@ impl<'a> CodeGenerator<'a> { let clause = arg_stack.pop().unwrap(); // the body to be run if the clause matches - let body = arg_stack.pop().unwrap(); + let mut body = arg_stack.pop().unwrap(); // the next branch in the when expression let mut term = arg_stack.pop().unwrap(); if tipo.is_bool() { - if complex_clause { - let other_clauses = term; - if matches!(clause, Term::Constant(boolean ) if matches!(boolean.as_ref(), UplcConstant::Bool(true))) - { - term = if_else( - Term::Var( - Name { - text: subject_name, - unique: 0.into(), - } - .into(), - ), - Term::Delay(body.into()), - Term::Var( - Name { - text: "__other_clauses_delayed".to_string(), - unique: 0.into(), - } - .into(), - ), - ) - .force(); - } else { - term = if_else( - Term::Var( - Name { - text: subject_name, - unique: 0.into(), - } - .into(), - ), - Term::Var( - Name { - text: "__other_clauses_delayed".to_string(), - unique: 0.into(), - } - .into(), - ), - Term::Delay(body.into()), - ) - .force(); - } - - term = apply_wrap( - Term::Lambda { - parameter_name: Name { - text: "__other_clauses_delayed".to_string(), - unique: 0.into(), - } - .into(), - body: term.into(), - }, - Term::Delay(other_clauses.into()), - ); - } else if matches!(clause, Term::Constant(boolean) if matches!(boolean.as_ref(), UplcConstant::Bool(true))) - { - term = delayed_if_else( - Term::Var( - Name { - text: subject_name, - unique: 0.into(), - } - .into(), - ), - body, - term, - ); + let other_clauses = if complex_clause { + Term::var("__other_clauses_delayed".to_string()) } else { - term = delayed_if_else( - Term::Var( - Name { - text: subject_name, - unique: 0.into(), - } - .into(), - ), - term, - body, - ); + term.clone() + }; + + if matches!(clause, Term::Constant(boolean) if matches!(boolean.as_ref(), UplcConstant::Bool(true))) + { + body = Term::var(subject_name) + .if_else(body.delay(), other_clauses) + .force(); + } else { + body = Term::var(subject_name) + .if_else(other_clauses, body.delay()) + .force(); + } + + if complex_clause { + term = body + .lambda("__other_clauses_delayed".to_string()) + .apply(term.delay()); } } else { - let checker = if tipo.is_int() { - apply_wrap( - DefaultFunction::EqualsInteger.into(), - Term::Var( - Name { - text: subject_name, - unique: 0.into(), - } - .into(), - ), - ) + let condition = if tipo.is_int() { + Term::equals_integer() + .apply(clause) + .apply(Term::var(subject_name)) } else if tipo.is_bytearray() { - apply_wrap( - DefaultFunction::EqualsByteString.into(), - Term::Var( - Name { - text: subject_name, - unique: 0.into(), - } - .into(), - ), - ) + Term::equals_bytestring() + .apply(clause) + .apply(Term::var(subject_name)) } else if tipo.is_string() { - apply_wrap( - DefaultFunction::EqualsString.into(), - Term::Var( - Name { - text: subject_name, - unique: 0.into(), - } - .into(), - ), - ) + Term::equals_string() + .apply(clause) + .apply(Term::var(subject_name)) } else if tipo.is_list() || tipo.is_tuple() { unreachable!("{:#?}", tipo) } else { - apply_wrap( - DefaultFunction::EqualsInteger.into(), - Term::Var( - Name { - text: subject_name, - unique: 0.into(), - } - .into(), - ), - ) + Term::equals_integer() + .apply(clause) + .apply(Term::var(subject_name)) }; if complex_clause { - term = apply_wrap( - Term::Lambda { - parameter_name: Name { - text: "__other_clauses_delayed".to_string(), - unique: 0.into(), - } - .into(), - body: if_else( - apply_wrap(checker, clause), - Term::Delay(body.into()), - Term::Var( - Name { - text: "__other_clauses_delayed".to_string(), - unique: 0.into(), - } - .into(), - ), - ) - .force() - .into(), - }, - Term::Delay(term.into()), - ); + term = condition + .if_else( + body.delay(), + Term::var("__other_clauses_delayed".to_string()), + ) + .force() + .lambda("__other_clauses_delayed".to_string()) + .apply(term.delay()); } else { - term = delayed_if_else(apply_wrap(checker, clause), body, term); + term = condition.delayed_if_else(body, term); } } @@ -5056,73 +4746,23 @@ impl<'a> CodeGenerator<'a> { let mut term = arg_stack.pop().unwrap(); let arg = if let Some(next_tail_name) = next_tail_name { - apply_wrap( - Term::Lambda { - parameter_name: Name { - text: next_tail_name, - unique: 0.into(), - } - .into(), - body: term.into(), - }, - apply_wrap( - Term::Builtin(DefaultFunction::TailList).force(), - Term::Var( - Name { - text: tail_name.clone(), - unique: 0.into(), - } - .into(), - ), - ), - ) + term.lambda(next_tail_name) + .apply(Term::tail_list().apply(Term::var(tail_name.clone()))) } else { term }; if complex_clause { - term = choose_list( - Term::Var( - Name { - text: tail_name, - unique: 0.into(), - } - .into(), - ), - Term::Delay(body.into()), - Term::Var( - Name { - text: "__other_clauses_delayed".to_string(), - unique: 0.into(), - } - .into(), - ), - ) - .force(); - - term = apply_wrap( - Term::Lambda { - parameter_name: Name { - text: "__other_clauses_delayed".into(), - unique: 0.into(), - } - .into(), - body: term.into(), - }, - Term::Delay(arg.into()), - ); + term = Term::var(tail_name) + .choose_list( + body.delay(), + Term::var("__other_clauses_delayed".to_string()), + ) + .force() + .lambda("__other_clauses_delayed".to_string()) + .apply(arg.delay()); } else { - term = delayed_choose_list( - Term::Var( - Name { - text: tail_name, - unique: 0.into(), - } - .into(), - ), - body, - arg, - ); + term = Term::var(tail_name).delayed_choose_list(body, arg); } arg_stack.push(term); @@ -5133,124 +4773,55 @@ impl<'a> CodeGenerator<'a> { let mut term = arg_stack.pop().unwrap(); let arg = arg_stack.pop().unwrap(); - term = apply_wrap( - Term::Lambda { - parameter_name: Name { - text: "__other_clauses_delayed".into(), - unique: 0.into(), - } - .into(), - body: term.into(), - }, - Term::Delay(arg.into()), - ); + term = term + .lambda("__other_clauses_delayed".to_string()) + .apply(arg.delay()); + arg_stack.push(term); } Air::ClauseGuard { subject_name, tipo, .. } => { - let condition = arg_stack.pop().unwrap(); + let checker = arg_stack.pop().unwrap(); let then = arg_stack.pop().unwrap(); if tipo.is_bool() { - let mut term = Term::Var( - Name { - text: "__other_clauses_delayed".to_string(), - unique: 0.into(), - } - .into(), - ); - if matches!(condition, Term::Constant(boolean) if matches!(boolean.as_ref(), UplcConstant::Bool(true))) + let mut term = Term::var("__other_clauses_delayed".to_string()); + if matches!(checker, Term::Constant(boolean) if matches!(boolean.as_ref(), UplcConstant::Bool(true))) { - term = if_else( - Term::Var( - Name { - text: subject_name, - unique: 0.into(), - } - .into(), - ), - Term::Delay(then.into()), - term, - ) - .force(); + term = Term::var(subject_name).if_else(then.delay(), term).force(); } else { - term = if_else( - Term::Var( - Name { - text: subject_name, - unique: 0.into(), - } - .into(), - ), - term, - Term::Delay(then.into()), - ) - .force(); + term = Term::var(subject_name).if_else(term, then.delay()).force(); } arg_stack.push(term); } else { - let checker = if tipo.is_int() { - apply_wrap( - DefaultFunction::EqualsInteger.into(), - Term::Var( - Name { - text: subject_name, - unique: 0.into(), - } - .into(), - ), - ) + let condition = if tipo.is_int() { + Term::equals_integer() + .apply(checker) + .apply(Term::var(subject_name)) } else if tipo.is_bytearray() { - apply_wrap( - DefaultFunction::EqualsByteString.into(), - Term::Var( - Name { - text: subject_name, - unique: 0.into(), - } - .into(), - ), - ) + Term::equals_bytestring() + .apply(checker) + .apply(Term::var(subject_name)) } else if tipo.is_string() { - apply_wrap( - DefaultFunction::EqualsString.into(), - Term::Var( - Name { - text: subject_name, - unique: 0.into(), - } - .into(), - ), - ) + Term::equals_string() + .apply(checker) + .apply(Term::var(subject_name)) } else if tipo.is_list() || tipo.is_tuple() { unreachable!() } else { - apply_wrap( - DefaultFunction::EqualsInteger.into(), - constr_index_exposer(Term::Var( - Name { - text: subject_name, - unique: 0.into(), - } - .into(), - )), - ) + Term::equals_integer() + .apply(checker) + .apply(constr_index_exposer(Term::var(subject_name))) }; - let term = if_else( - apply_wrap(checker, condition), - Term::Delay(then.into()), - Term::Var( - Name { - text: "__other_clauses_delayed".to_string(), - unique: 0.into(), - } - .into(), - ), - ) - .force(); + let term = condition + .if_else( + then.delay(), + Term::var("__other_clauses_delayed".to_string()), + ) + .force(); arg_stack.push(term); } } @@ -5268,68 +4839,26 @@ impl<'a> CodeGenerator<'a> { let mut term = arg_stack.pop().unwrap(); term = if let Some(next_tail_name) = next_tail_name { - apply_wrap( - Term::Lambda { - parameter_name: Name { - text: next_tail_name, - unique: 0.into(), - } - .into(), - body: term.into(), - }, - apply_wrap( - Term::Builtin(DefaultFunction::TailList).force(), - Term::Var( - Name { - text: tail_name.clone(), - unique: 0.into(), - } - .into(), - ), - ), - ) + term.lambda(next_tail_name) + .apply(Term::tail_list().apply(Term::var(tail_name.clone()))) } else { term }; if !inverse { - term = choose_list( - Term::Var( - Name { - text: tail_name, - unique: 0.into(), - } - .into(), - ), - Term::Delay(term.into()), - Term::Var( - Name { - text: "__other_clauses_delayed".to_string(), - unique: 0.into(), - } - .into(), - ), - ) - .force(); + term = Term::var(tail_name) + .choose_list( + term.delay(), + Term::var("__other_clauses_delayed".to_string()), + ) + .force(); } else { - term = choose_list( - Term::Var( - Name { - text: tail_name, - unique: 0.into(), - } - .into(), - ), - Term::Var( - Name { - text: "__other_clauses_delayed".to_string(), - unique: 0.into(), - } - .into(), - ), - Term::Delay(term.into()), - ) - .force(); + term = Term::var(tail_name) + .choose_list( + Term::var("__other_clauses_delayed".to_string()), + term.delay(), + ) + .force(); } arg_stack.push(term); @@ -5342,7 +4871,7 @@ impl<'a> CodeGenerator<'a> { let then = arg_stack.pop().unwrap(); let mut term = arg_stack.pop().unwrap(); - term = delayed_if_else(condition, then, term); + term = condition.delayed_if_else(then, term); arg_stack.push(term); } @@ -5356,27 +4885,20 @@ impl<'a> CodeGenerator<'a> { for _ in 0..count { arg_vec.push(arg_stack.pop().unwrap()); } - - let mut term = - Term::Constant(UplcConstant::ProtoList(UplcType::Data, vec![]).into()); + let mut term = Term::empty_list(); for (index, arg) in arg_vec.iter().enumerate().rev() { - term = apply_wrap( - apply_wrap( - Term::Builtin(DefaultFunction::MkCons).force(), - convert_type_to_data(arg.clone(), &tipo.arg_types().unwrap()[index]), - ), - term, - ); + term = Term::mk_cons() + .apply(convert_type_to_data( + arg.clone(), + &tipo.arg_types().unwrap()[index], + )) + .apply(term); } - term = apply_wrap( - apply_wrap( - DefaultFunction::ConstrData.into(), - Term::Constant(UplcConstant::Integer(constr_index.into()).into()), - ), - term, - ); + term = Term::constr_data() + .apply(Term::integer(constr_index.into())) + .apply(term); if arg_vec.iter().all(|item| matches!(item, Term::Constant(_))) { let mut program: Program = Program { @@ -5400,30 +4922,12 @@ impl<'a> CodeGenerator<'a> { Air::RecordAccess { record_index, tipo, .. } => { + self.needs_field_access = true; let constr = arg_stack.pop().unwrap(); - let mut term = apply_wrap( - apply_wrap( - Term::Var( - Name { - text: CONSTR_GET_FIELD.to_string(), - unique: 0.into(), - } - .into(), - ), - apply_wrap( - Term::Var( - Name { - text: CONSTR_FIELDS_EXPOSER.to_string(), - unique: 0.into(), - } - .into(), - ), - constr, - ), - ), - Term::Constant(UplcConstant::Integer(record_index.into()).into()), - ); + let mut term = Term::var(CONSTR_GET_FIELD.to_string()) + .apply(Term::var(CONSTR_FIELDS_EXPOSER.to_string()).apply(constr)) + .apply(Term::integer(record_index.into())); term = convert_data_to_type(term, &tipo); @@ -5466,19 +4970,9 @@ impl<'a> CodeGenerator<'a> { term }; - term = apply_wrap( - term, - apply_wrap( - Term::Var( - Name { - text: CONSTR_FIELDS_EXPOSER.to_string(), - unique: 0.into(), - } - .into(), - ), - value, - ), - ); + term = term + .apply(Term::var(CONSTR_FIELDS_EXPOSER.to_string())) + .apply(value); arg_stack.push(term); } @@ -5519,25 +5013,17 @@ impl<'a> CodeGenerator<'a> { arg_stack.push(term); } } else if count == 2 { - let term = apply_wrap( - apply_wrap( - DefaultFunction::MkPairData.into(), - convert_type_to_data(args[0].clone(), &tuple_sub_types[0]), - ), - convert_type_to_data(args[1].clone(), &tuple_sub_types[1]), - ); + let term = Term::mk_pair_data() + .apply(convert_type_to_data(args[0].clone(), &tuple_sub_types[0])) + .apply(convert_type_to_data(args[1].clone(), &tuple_sub_types[1])); + arg_stack.push(term); } else { - let mut term = - Term::Constant(UplcConstant::ProtoList(UplcType::Data, vec![]).into()); + let mut term = Term::empty_list(); for (arg, tipo) in args.into_iter().zip(tuple_sub_types.into_iter()).rev() { - term = apply_wrap( - apply_wrap( - Term::Builtin(DefaultFunction::MkCons).force(), - convert_type_to_data(arg, &tipo), - ), - term, - ); + term = Term::mk_cons() + .apply(convert_type_to_data(arg, &tipo)) + .apply(term); } arg_stack.push(term); } @@ -5570,55 +5056,26 @@ impl<'a> CodeGenerator<'a> { unchanged_field_indices.reverse(); - let mut term = apply_wrap( - Term::Builtin(DefaultFunction::TailList).force(), - Term::Var( - Name { - text: format!("{tail_name_prefix}_{highest_index}"), - unique: 0.into(), - } - .into(), - ), - ); + let mut term = Term::tail_list() + .apply(Term::var(format!("{tail_name_prefix}_{highest_index}"))); for current_index in (0..(highest_index + 1)).rev() { let tail_name = format!("{tail_name_prefix}_{current_index}"); if let Some((tipo, arg)) = args.get(¤t_index) { - term = apply_wrap( - apply_wrap( - Term::Builtin(DefaultFunction::MkCons).force(), - convert_type_to_data(arg.clone(), tipo), - ), - term, - ); + term = Term::mk_cons() + .apply(convert_type_to_data(arg.clone(), tipo)) + .apply(term); } else { - term = apply_wrap( - apply_wrap( - Term::Builtin(DefaultFunction::MkCons).force(), - apply_wrap( - Term::Builtin(DefaultFunction::HeadList).force(), - Term::Var( - Name { - text: tail_name, - unique: 0.into(), - } - .into(), - ), - ), - ), - term, - ) + term = Term::mk_cons() + .apply(Term::head_list().apply(Term::var(tail_name))) + .apply(term); } } - term = apply_wrap( - apply_wrap( - Term::Builtin(DefaultFunction::ConstrData), - Term::Constant(UplcConstant::Integer(0.into()).into()), - ), - term, - ); + term = Term::constr_data() + .apply(Term::integer(0.into())) + .apply(term); if !unchanged_field_indices.is_empty() { prev_index = highest_index; @@ -5626,33 +5083,14 @@ impl<'a> CodeGenerator<'a> { let tail_name = format!("{tail_name_prefix}_{prev_index}"); let prev_tail_name = format!("{tail_name_prefix}_{index}"); - let mut tail_list = Term::Var( - Name { - text: prev_tail_name, - unique: 0.into(), - } - .into(), - ); + let mut tail_list = Term::var(prev_tail_name); if index < prev_index { for _ in index..prev_index { - tail_list = apply_wrap( - Term::Builtin(DefaultFunction::TailList).force(), - tail_list, - ); + tail_list = Term::tail_list().apply(tail_list); } - term = apply_wrap( - Term::Lambda { - parameter_name: Name { - text: tail_name, - unique: 0.into(), - } - .into(), - body: term.into(), - }, - tail_list, - ); + term = term.lambda(tail_name).apply(tail_list); } prev_index = index; } @@ -5660,71 +5098,30 @@ impl<'a> CodeGenerator<'a> { let tail_name = format!("{tail_name_prefix}_{prev_index}"); let prev_tail_name = format!("{tail_name_prefix}_0"); - let mut tail_list = Term::Var( - Name { - text: prev_tail_name.clone(), - unique: 0.into(), - } - .into(), - ); + let mut tail_list = Term::var(prev_tail_name.clone()); for _ in 0..prev_index { - tail_list = - apply_wrap(Term::Builtin(DefaultFunction::TailList).force(), tail_list); + tail_list = Term::tail_list().apply(tail_list); } if prev_index != 0 { - term = apply_wrap( - Term::Lambda { - parameter_name: Name { - text: tail_name, - unique: 0.into(), - } - .into(), - body: term.into(), - }, - tail_list, - ); + term = term.lambda(tail_name).apply(tail_list); } self.needs_field_access = true; - term = apply_wrap( - Term::Lambda { - parameter_name: Name { - text: prev_tail_name, - unique: 0.into(), - } - .into(), - body: term.into(), - }, - apply_wrap( - Term::Var( - Name { - text: CONSTR_FIELDS_EXPOSER.to_string(), - unique: 0.into(), - } - .into(), - ), - record, - ), - ); + term = term + .lambda(prev_tail_name) + .apply(Term::var(CONSTR_FIELDS_EXPOSER.to_string()).apply(record)); + arg_stack.push(term); } Air::UnOp { op, .. } => { let value = arg_stack.pop().unwrap(); let term = match op { - UnOp::Not => if_else( - value, - Term::Constant(UplcConstant::Bool(false).into()), - Term::Constant(UplcConstant::Bool(true).into()), - ), - UnOp::Negate => apply_wrap( - apply_wrap( - DefaultFunction::SubtractInteger.into(), - Term::Constant(UplcConstant::Integer(0.into()).into()), - ), - value, - ), + UnOp::Not => value.if_else(Term::bool(false), Term::bool(true)), + UnOp::Negate => Term::sub_integer() + .apply(Term::integer(0.into())) + .apply(value), }; arg_stack.push(term); @@ -5737,37 +5134,21 @@ impl<'a> CodeGenerator<'a> { if matches!(tipo.get_uplc_type(), UplcType::Pair(_, _)) { if tuple_index == 0 { term = convert_data_to_type( - apply_wrap( - Term::Builtin(DefaultFunction::FstPair).force().force(), - term, - ), + Term::fst_pair().apply(term), &tipo.get_inner_types()[0], ); } else { term = convert_data_to_type( - apply_wrap( - Term::Builtin(DefaultFunction::SndPair).force().force(), - term, - ), + Term::snd_pair().apply(term), &tipo.get_inner_types()[1], ); } } else { self.needs_field_access = true; term = convert_data_to_type( - apply_wrap( - apply_wrap( - Term::Var( - Name { - text: CONSTR_GET_FIELD.to_string(), - unique: 0.into(), - } - .into(), - ), - term, - ), - Term::Constant(UplcConstant::Integer(tuple_index.into()).into()), - ), + Term::var(CONSTR_GET_FIELD.to_string()) + .apply(term) + .apply(Term::integer(tuple_index.into())), &tipo.get_inner_types()[tuple_index], ); } @@ -5786,65 +5167,19 @@ impl<'a> CodeGenerator<'a> { let list_id = self.id_gen.next(); if names.len() == 2 { - term = apply_wrap( - Term::Lambda { - parameter_name: Name { - text: format!("__tuple_{list_id}"), - unique: 0.into(), - } - .into(), - body: apply_wrap( - Term::Lambda { - parameter_name: Name { - text: names[0].clone(), - unique: 0.into(), - } - .into(), - body: apply_wrap( - Term::Lambda { - parameter_name: Name { - text: names[1].clone(), - unique: 0.into(), - } - .into(), - body: term.into(), - }, - convert_data_to_type( - apply_wrap( - Term::Builtin(DefaultFunction::SndPair) - .force() - .force(), - Term::Var( - Name { - text: format!("__tuple_{list_id}"), - unique: 0.into(), - } - .into(), - ), - ), - &inner_types[1], - ), - ) - .into(), - }, - convert_data_to_type( - apply_wrap( - Term::Builtin(DefaultFunction::FstPair).force().force(), - Term::Var( - Name { - text: format!("__tuple_{list_id}"), - unique: 0.into(), - } - .into(), - ), - ), - &inner_types[0], - ), - ) - .into(), - }, - value, - ); + term = term + .lambda(names[1].clone()) + .apply(convert_data_to_type( + Term::snd_pair().apply(Term::var(format!("__tuple_{list_id}"))), + &inner_types[1], + )) + .lambda(names[0].clone()) + .apply(convert_data_to_type( + Term::fst_pair().apply(Term::var(format!("__tuple_{list_id}"))), + &inner_types[0], + )) + .lambda(format!("__tuple_{list_id}")) + .apply(value); } else { let mut id_list = vec![]; id_list.push(list_id); @@ -5853,19 +5188,17 @@ impl<'a> CodeGenerator<'a> { id_list.push(self.id_gen.next()); } - term = apply_wrap( - list_access_to_uplc( - &names, - &id_list, - false, - 0, - term, - tipo.get_inner_types(), - check_last_item, - false, - ), - value, - ); + term = list_access_to_uplc( + &names, + &id_list, + false, + 0, + term, + tipo.get_inner_types(), + check_last_item, + false, + ) + .apply(value); } arg_stack.push(term); @@ -5875,11 +5208,7 @@ impl<'a> CodeGenerator<'a> { let term = arg_stack.pop().unwrap(); - let term = apply_wrap( - apply_wrap(Term::Builtin(DefaultFunction::Trace).force(), text), - Term::Delay(term.into()), - ) - .force(); + let term = term.trace(text.to_string()); arg_stack.push(term); } @@ -5898,99 +5227,31 @@ impl<'a> CodeGenerator<'a> { if complex_clause { let next_clause = arg_stack.pop().unwrap(); - term = apply_wrap( - Term::Lambda { - parameter_name: Name { - text: "__other_clauses_delayed".to_string(), - unique: 0.into(), - } - .into(), - body: term.into(), - }, - Term::Delay(next_clause.into()), - ) + term = term + .lambda("__other_clauses_delayed".to_string()) + .apply(next_clause.delay()); } if tuple_types.len() == 2 { for (index, name) in indices.iter() { - if *index == 0 { - term = apply_wrap( - Term::Lambda { - parameter_name: Name { - text: name.clone(), - unique: 0.into(), - } - .into(), - body: term.into(), - }, - convert_data_to_type( - apply_wrap( - Term::Builtin(DefaultFunction::FstPair).force().force(), - Term::Var( - Name { - text: subject_name.clone(), - unique: 0.into(), - } - .into(), - ), - ), - &tuple_types[*index].clone(), - ), - ); + let builtin = if *index == 0 { + Term::fst_pair() } else { - term = apply_wrap( - Term::Lambda { - parameter_name: Name { - text: name.clone(), - unique: 0.into(), - } - .into(), - body: term.into(), - }, - convert_data_to_type( - apply_wrap( - Term::Builtin(DefaultFunction::SndPair).force().force(), - Term::Var( - Name { - text: subject_name.clone(), - unique: 0.into(), - } - .into(), - ), - ), - &tuple_types[*index].clone(), - ), - ); - } + Term::snd_pair() + }; + + term = term.lambda(name).apply(convert_data_to_type( + builtin.apply(Term::var(subject_name.clone())), + &tuple_types[*index].clone(), + )); } } else { for (index, name) in indices.iter() { - term = apply_wrap( - Term::Lambda { - parameter_name: Name { - text: name.clone(), - unique: 0.into(), - } - .into(), - body: term.into(), - }, - convert_data_to_type( - apply_wrap( - Term::Builtin(DefaultFunction::HeadList).force(), - repeat_tail_list( - Term::Var( - Name { - text: subject_name.clone(), - unique: 0.into(), - } - .into(), - ), - *index, - ), - ), - &tuple_types[*index].clone(), - ), - ); + term = term.lambda(name.clone()).apply(convert_data_to_type( + Term::head_list() + .apply(repeat_tail_list(Term::var(subject_name.clone()), *index)), + &tuple_types[*index].clone(), + )); } } arg_stack.push(term); diff --git a/crates/uplc/src/ast/builder.rs b/crates/uplc/src/ast/builder.rs index 28db6ed7..27f858e2 100644 --- a/crates/uplc/src/ast/builder.rs +++ b/crates/uplc/src/ast/builder.rs @@ -1,6 +1,6 @@ use crate::builtins::DefaultFunction; -use super::{Constant, Name, Term}; +use super::{Constant, Name, Term, Type}; pub const CONSTR_FIELDS_EXPOSER: &str = "__constr_fields_exposer"; pub const CONSTR_INDEX_EXPOSER: &str = "__constr_index_exposer"; @@ -50,6 +50,16 @@ impl Term { Term::Constant(Constant::Bool(b).into()) } + pub fn empty_list() -> Self { + Term::Constant(Constant::ProtoList(Type::Data, vec![]).into()) + } + + pub fn empty_map() -> Self { + Term::Constant( + Constant::ProtoList(Type::Pair(Type::Data.into(), Type::Data.into()), vec![]).into(), + ) + } + pub fn constr_data() -> Self { Term::Builtin(DefaultFunction::ConstrData) } @@ -86,6 +96,14 @@ impl Term { Term::Builtin(DefaultFunction::EqualsData) } + pub fn add_integer() -> Self { + Term::Builtin(DefaultFunction::AddInteger) + } + + pub fn sub_integer() -> Self { + Term::Builtin(DefaultFunction::SubtractInteger) + } + pub fn head_list() -> Self { Term::Builtin(DefaultFunction::HeadList).force() } @@ -118,6 +136,15 @@ impl Term { .apply(else_term) } + pub fn choose_list(self, then_term: Self, else_term: Self) -> Self { + Term::Builtin(DefaultFunction::ChooseList) + .force() + .force() + .apply(self) + .apply(then_term) + .apply(else_term) + } + pub fn delayed_if_else(self, then_term: Self, else_term: Self) -> Self { Term::Builtin(DefaultFunction::IfThenElse) .force() @@ -126,6 +153,24 @@ impl Term { .apply(else_term.delay()) .force() } + + pub fn delayed_choose_list(self, then_term: Self, else_term: Self) -> Self { + Term::Builtin(DefaultFunction::ChooseList) + .force() + .force() + .apply(self) + .apply(then_term.delay()) + .apply(else_term.delay()) + .force() + } + + pub fn trace(self, msg: String) -> Self { + Term::Builtin(DefaultFunction::Trace) + .force() + .apply(Term::string(msg)) + .apply(self.delay()) + .force() + } } pub fn apply_wrap(function: Term, arg: Term) -> Term { diff --git a/examples/acceptance_tests/036/plutus.json b/examples/acceptance_tests/036/plutus.json index b00af3a8..0779011c 100644 --- a/examples/acceptance_tests/036/plutus.json +++ b/examples/acceptance_tests/036/plutus.json @@ -21,8 +21,8 @@ } } ], - "compiledCode": "58e301000032323232323232323232222533300632323232533300a3370e0029000099251300400214a060166ea8004c8c8cc004dd6198019802198019802002a40009000119baf33004300500148000020c0040048894ccc03c0084cdd2a400497ae013232533300d300300213374a90001980900125eb804ccc01401400400cc04c00cc04400888c8ccc0040052000003222333300c3370e008004024466600800866e0000d200230140010012300a37540022930b180080091129998040010a4c26600a600260140046660060066016004002ae695cdaab9d5573caae7d5d02ba157441", - "hash": "5a5aef5525783c007ee817dd5869ee67000ae5fd730815af7d87ec97" + "compiledCode": "58e301000032323232323232323232222533300632323232533300a3370e9000000899251300400214a060166ea8004c8c8cc004dd6198019802198019802002a40009000119baf33004300500148000020c0040048894ccc03c0084cdd2a400497ae013232533300d300300213374a90001980900125eb804ccc01401400400cc04c00cc04400888c8ccc0040052000003222333300c3370e008004024466600800866e0000d200230140010012300a37540022930b180080091129998040010a4c26600a600260140046660060066016004002ae695cdaab9d5573caae7d5d02ba157441", + "hash": "bc602ee0cfd14a415cdd83dd746ae6260507ffec1827cf1bddc77893" }, { "title": "spend.spend", @@ -38,8 +38,8 @@ "$ref": "#/definitions/Data" } }, - "compiledCode": "59015f010000323232323232323232322225333006323232323233001003232323322323232323330140014a0944004c94ccc05c0045288a5000133223233223253330173370e00290010801099190009bab301e00130110033018375400400297adef6c6033223300800200100200100100237566601260140049001001a441050000000000003001001222533301300213374a900125eb804c8c8c8c94ccc04ccdc7802800899ba548000cc060dd300125eb804ccc01c01c00c014dd7180a0019bab3014002301700330150023001001222533301000214a026464a66601c600600429444ccc01401400400cc05000cc048008dd6198009801198009801001a400090021119199800800a4000006444666601866e1c0100080488ccc010010cdc0001a40046028002002460146ea8004526163001001222533300800214984cc014c004c028008ccc00c00cc02c0080055cd2b9b5573aaae7955cfaba05742ae89", - "hash": "3f46b921ead33594e1da4afa1f1ba31807c0d8deca029f96fe9fe394" + "compiledCode": "59015f010000323232323232323232322225333006323232323233001003232323322323232323330140014a0944004c94ccc05c0045288a5000133223233223253330173370e90010008801099190009bab301e00130110033018375400400297adef6c6033223300800200100200100100237566601260140049001001a441050000000000003001001222533301300213374a900125eb804c8c8c8c94ccc04ccdc7802800899ba548000cc060dd300125eb804ccc01c01c00c014dd7180a0019bab3014002301700330150023001001222533301000214a026464a66601c600600429444ccc01401400400cc05000cc048008dd6198009801198009801001a400090021119199800800a4000006444666601866e1c0100080488ccc010010cdc0001a40046028002002460146ea8004526163001001222533300800214984cc014c004c028008ccc00c00cc02c0080055cd2b9b5573aaae7955cfaba05742ae89", + "hash": "6eeaf674bce0a9f818f396839364850e4b4bfb36efc13b61456ff630" } ], "definitions": { diff --git a/examples/acceptance_tests/071/plutus.json b/examples/acceptance_tests/071/plutus.json index fc96b33e..6a614b8b 100644 --- a/examples/acceptance_tests/071/plutus.json +++ b/examples/acceptance_tests/071/plutus.json @@ -19,8 +19,8 @@ "$ref": "#/definitions/spend~1PoolRedeemer" } }, - "compiledCode": "59030501000032323232323232323232322225333006323232323232323232533300f3370e002900009925130090021533300f3370e0029001099191919299980999b87001480084c8c8cccc8888c8c8c8c8c9289812000980b19299980e99b8748000c080dd500088008a9980fa492a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e0016330120070033022001301432533301b3370e9000180f1baa0011001153301d49012a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e00163300f005001300d48901ff00010001012005301b001300d00214a0602a6ea8004cc028c02c03120023017001300900213232323253330133370e0029001099191999911119191919192513024001301632533301d3370e900018101baa0011001153301f49012a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e0016330120070033022001301432533301b3370e9000180f1baa0011001153301d49012a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e00163300f005001300d48901ff00010001012005301b001300d00214a0602a6ea8004cc028c02c031200230170013009002301137540026600c600e0129000119ba548000cc04ccdd2a4004660266ea40052f5c06602666e9520024bd7025eb8088cc010dd6198031803998031803801240009002119baf3300730080014800000888cc00cdd6198029803198029803001240009000119baf3300630073300630070014800920000023001001222533301000213374a900125eb804c8c94ccc034c00c0084cdd2a40006602600497ae013330050050010033014003301200222323330010014800000c888cccc030cdc3802001009919980200219b8000348008c0540040048c02cdd50008a4c2c6002002444a666012004293099802980098058011998018019806001000ab9a5736ae7155ceaab9e5573eae815d0aba201", - "hash": "b79dffa847f2b9a55cb6cee2bd6057251f45e6a252587c7f6f3545d0" + "compiledCode": "59030501000032323232323232323232322225333006323232323232323232533300f3370e900000089925130090021533300f3370e9001000899191919299980999b87480080044c8c8cccc8888c8c8c8c8c9289812000980b19299980e99b8748000c080dd500088008a9980fa492a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e0016330120070033022001301432533301b3370e9000180f1baa0011001153301d49012a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e00163300f005001300d48901ff00010001012005301b001300d00214a0602a6ea8004cc028c02c03120023017001300900213232323253330133370e9001000899191999911119191919192513024001301632533301d3370e900018101baa0011001153301f49012a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e0016330120070033022001301432533301b3370e9000180f1baa0011001153301d49012a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e00163300f005001300d48901ff00010001012005301b001300d00214a0602a6ea8004cc028c02c031200230170013009002301137540026600c600e0129000119ba548000cc04ccdd2a4004660266ea40052f5c06602666e9520024bd7025eb8088cc010dd6198031803998031803801240009002119baf3300730080014800000888cc00cdd6198029803198029803001240009000119baf3300630073300630070014800920000023001001222533301000213374a900125eb804c8c94ccc034c00c0084cdd2a40006602600497ae013330050050010033014003301200222323330010014800000c888cccc030cdc3802001009919980200219b8000348008c0540040048c02cdd50008a4c2c6002002444a666012004293099802980098058011998018019806001000ab9a5736ae7155ceaab9e5573eae815d0aba201", + "hash": "5ed31a0590509ea818c80fdb4a1cc25a72e7b24a5c28115739ec38d3" } ], "definitions": { diff --git a/examples/acceptance_tests/077/plutus.json b/examples/acceptance_tests/077/plutus.json index 2454a18e..6cca144b 100644 --- a/examples/acceptance_tests/077/plutus.json +++ b/examples/acceptance_tests/077/plutus.json @@ -19,8 +19,8 @@ "$ref": "#/definitions/Void" } }, - "compiledCode": "5904a1010000323232323232323232323222253330063232323232323232323232323232323232323232323232323375e6e98008dd300099980a1bac33016301733016301701848001200422533301f3375e66030603200490000020998061bab3301830190024800800440052f5bded8c06660266eb0cc054c058cc054c05805d200048000894ccc078cdd79980b980c1980b980c0012400490000018998059bab33017301833017301800248009200200110014bd6f7b6301980a180a800a4000604200260420026024002603c002602064a66602e66e1d2000301a375400220022a660329212a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e00163232330013758660226024660226024026900024000466ebccc048c04c00520000043001001222533301e00213374a900125eb804c8c94ccc06cc00c0084cdd2a40006604200497ae0133300500500100330220033020002301c001300e3253330153370e9001180c1baa001100115330174912a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e00163300d300e00f4800888c8004cccc8888cccc03001000c008004008004888c94ccc064c94ccc07c0045288a5000113374a900125eb804cdd2a40006603e6e980052f5c066664444666601600800600400200400244464a66603866e1c005200013374a900125eb804cdd2a4000660446ea00052f5c066e0000800401800c894ccc050cdc8001000899ba5480012f5c02a66602866e3c0080044cdd2a400497ae013374a900225eb80c004004888894ccc068010400c4c8c8c8c8ccccc02402400cccccc02801c004008018014018014dd7180d8019bad301b002301e005301c0043001001222222533301900513301a337606ea4010dd4001a5eb7bdb1804c8c8c8c94ccc060cdd79980280400099ba5480012f5c026603c66ec0dd48041ba8007009153330183371e01000226464a66603466e1c00520001323233022337606ea4030dd40008039bad302200130140021005301c375400266600c01000e00426603c66ec0dd48009ba800233333300a00a003008007006005375c60340066eb4c068008c074018c06c014c004004888894ccc058010400c4c8c8c8c8ccccc02402400cccccc02801c004008018014018014dd7180b8019bab3017002301a005301800430010012222225333015005133016337606ea4010dd3001a5eb7bdb1804c8c8c8c94ccc050cdd79980280400099ba5480012f5c026603466ec0dd48041ba6007009153330143371e01000226464a66602c66e1c0052000132323301e337606ea4030dd30008039bab301e001301000210053018375400266600c01000e00426603466ec0dd48009ba600233333300a00a003008007006005375c602c0066eacc058008c064018c05c014c00400488894ccc04400c40044c8c8cc010008cccc01801800401000cc054010c04c00c88c8ccc0040052000003222333300c3370e008004026466600800866e0000d200230150010012300b37540022930b180080091129998048010a4c26600a600260160046660060066018004002ae695cdab9c5573aaae7955cfaba05742ae881", - "hash": "f6448fb18db20c4da7590f743682d806a7e1ab9cccee75848885b22a" + "compiledCode": "5904a1010000323232323232323232323222253330063232323232323232323232323232323232323232323232323375e6e98008dd300099980a1bac33016301733016301701848001200422533301f3375e66030603200490000020998061bab3301830190024800800440052f5bded8c06660266eb0cc054c058cc054c05805d200048000894ccc078cdd79980b980c1980b980c0012400490000018998059bab33017301833017301800248009200200110014bd6f7b6301980a180a800a4000604200260420026024002603c002602064a66602e66e1d2000301a375400220022a660329212a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e00163232330013758660226024660226024026900024000466ebccc048c04c00520000043001001222533301e00213374a900125eb804c8c94ccc06cc00c0084cdd2a40006604200497ae0133300500500100330220033020002301c001300e3253330153370e9001180c1baa001100115330174912a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e00163300d300e00f4800888c8004cccc8888cccc03001000c008004008004888c94ccc064c94ccc07c0045288a5000113374a900125eb804cdd2a40006603e6e980052f5c066664444666601600800600400200400244464a66603866e1c005200013374a900125eb804cdd2a4000660446ea00052f5c066e0000800401800c894ccc050cdc8001000899ba5480012f5c02a66602866e3c0080044cdd2a400497ae013374a900225eb80c004004888894ccc068010400c4c8c8c8c8ccccc02402400cccccc02801c004008018014018014dd7180d8019bad301b002301e005301c0043001001222222533301900513301a337606ea4010dd4001a5eb7bdb1804c8c8c8c94ccc060cdd79980280400099ba5480012f5c026603c66ec0dd48041ba8007009153330183371e01000226464a66603466e1d20000011323233022337606ea4030dd40008039bad302200130140021005301c375400266600c01000e00426603c66ec0dd48009ba800233333300a00a003008007006005375c60340066eb4c068008c074018c06c014c004004888894ccc058010400c4c8c8c8c8ccccc02402400cccccc02801c004008018014018014dd7180b8019bab3017002301a005301800430010012222225333015005133016337606ea4010dd3001a5eb7bdb1804c8c8c8c94ccc050cdd79980280400099ba5480012f5c026603466ec0dd48041ba6007009153330143371e01000226464a66602c66e1d2000001132323301e337606ea4030dd30008039bab301e001301000210053018375400266600c01000e00426603466ec0dd48009ba600233333300a00a003008007006005375c602c0066eacc058008c064018c05c014c00400488894ccc04400c40044c8c8cc010008cccc01801800401000cc054010c04c00c88c8ccc0040052000003222333300c3370e008004026466600800866e0000d200230150010012300b37540022930b180080091129998048010a4c26600a600260160046660060066018004002ae695cdab9c5573aaae7955cfaba05742ae881", + "hash": "df1c2d58a2a6a0002c4f4d3d9be395b5bb39290a62b70959970e06c3" }, { "title": "spend2.backtrace", diff --git a/examples/acceptance_tests/script_context/plutus.json b/examples/acceptance_tests/script_context/plutus.json index ad83746e..5fc7d062 100644 --- a/examples/acceptance_tests/script_context/plutus.json +++ b/examples/acceptance_tests/script_context/plutus.json @@ -19,36 +19,8 @@ "$ref": "#/definitions/Void" } }, - "compiledCode": "5904600100003232323232323232323222253330063232323232300200132323232323233015333010323330113375e660146016002900b26126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff004a0944cc024c02802d20004c0103d87a80004c0103d879800033015333010323253330123370e002900109919299980a19baf3300d300e00148001300126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff0013370e6eb4cc034c038005200248000528180c80098060010b18099baa00133009300a00b48009300103d87a80004c0103d8798000330153330103232533301600116132533301700113232300c001330193330143375e6e98dd5998069807000a40046e98c0152080a8d6b9074c0103d87a80004c0103d8798000330193330143375e6601a601c6601a601c002900024000980122d8799f581c11111111111111111111111111111111111111111111111111111111ff004c0103d87a80004c0103d879800033019333014323253330163370e0029000099250301000214a2602e6ea8004cc034c038cc034c038005200048009300103d87a80004c0103d8798000330193330143375e6601a601c002900219ba5480012f5c098103d87a80004c0103d8798000330193330143375e6601a601c002900319ba5480092f5c098103d87a80004c0103d87980004bd70180c8010b180c8009bac3300a300b00148010cc024c02802d20004c0103d87a80004c0103d879800033015333010323375e6e98dd5998051805800a400c6e98c009205433009300a00b4800130103d87a80004c0103d87980004bd7011999111919000999991111999805002001801000a5eb7bdb180010004020cccc8888cccc03001000c0080052f5bded8c000400200e9101004881000013001001222225333016004133017337606ea400cdd300125eb7bdb1804c8c8c8c94ccc058cdd79980280380099ba5480012f5c026603666ec0dd48039ba6006008153330163371e00e00226603666ec0dd48039ba600600313301b337606ea4004dd3001199998048048018038030029bae30170033756602e004603400a603000844a66601c66e400080044cdd2a400097ae01533300e3371e004002266e9520024bd70099ba5480112f5c0600200244444a66602600826602866ec0dd48019ba80024bd6f7b630099191919299980999baf330050070013374a900025eb804cc060cdd81ba9007375000c0102a66602666e3c01c0044cc060cdd81ba9007375000c00626603066ec0dd48009ba800233333009009003007006005375c60280066eb4c050008c05c014c054010c004004894ccc0380045288991929998060010998020020008a5030120023370e900118061baa301000122323330010014800000c888cccc030cdc3802001009119980200219b8000348008c0500040048c028dd50008a4c2c6002002444a666010004293099802980098050011998018019805801000ab9a5736aae7555cf2ab9f5740ae855d101", - "hash": "42428cc55092a182161081f528491b8ec1fbd908c40eca9069c4d1be" - }, - { - "title": "mint.mint", - "redeemer": { - "title": "redeemer", - "schema": { - "$ref": "#/definitions/Data" - } - }, - "compiledCode": "590488010000323232323232323232323222533300532323232323001003300100122533300f00114a226464a6660180042660080080022940c04c008cdc3a4004601a6ea8c044004cc034ccc01cc8c8c8c8c8c8c94ccc04cc0580084c8c8cdc78018009bae3016001300932533300f3370e900018091baa0011001153301149012a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e00163300830090034800854cc0412401364c6973742f5475706c652f436f6e73747220636f6e7461696e73206d6f7265206974656d73207468616e2069742065787065637465640016375c602800264646464600c00200200264640026644660100040020029110000137566600c600e6600c600e00290002401000e600200244a666020002297ae01323232323301537520026600c00c0066eb8c04400cdd59808801180a0011809000980080091129998078010a5eb7bdb1804c8c8c8c94ccc038cdc7802800880189980a19bb037520026e98008ccc01c01c00c014dd718080019bab3010002301300330110024c103d87a80004c0103d87980003300d333007323232323322323232323253330123370e00290010b0991919b87001483c850dd6980d0009806801180a1baa001332233008002001001488103666f6f0033223233223253330153370e00290010801099190009bab301d00130100033017375400400297adef6c6033223300b002001002001375666012601400690040009bae30150013008533300d3370e900018081baa0021002153300f49012a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e001633005300600748008cc014c01801d20003001001222533301100213374a900125eb804c8c8c8c94ccc040cdc7802800899ba548000cc058dd400125eb804ccc01c01c00c014dd718090019bad3012002301500330130023001001222533300f00213374a900125eb804c8c8c8c94ccc038cdc7802800899ba548000cc050dd300125eb804ccc01c01c00c014dd718080019bab3010002301300330110024c103d87a80004c0103d87980003300d3330073232323233223232533300f3375e006002266e1cc8c018004dd5998049805198049805002240009009240042940c054004c020c94ccc038cdc3a400060226ea8004400454cc0412412a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e001633223300700200137566600e60106600e60100049000240246600e6010004900100380418008009129998080008a400026466e0120023300300300130130013001001222533300f00213374a900125eb804c8c8c8c94ccc038cdd7802800899ba548000cc0500092f5c0266600e00e00600a6020006602000460260066022004980103d87a80004c0103d87980004bd701119199800800a4000006444666601666e1c0100080488ccc010010cdc0001a40046028002002460146ea8004526163001001222533300900214984cc014c004c02c008ccc00c00cc0300080055cd2b9b5738aae7555cf2ab9f5740ae855d11", - "hash": "4621310698e9ee7830df98d79551eb5672cdee04247e28c8e1c1d494" - }, - { - "title": "withdrawals.spend", - "datum": { - "title": "_datum", - "schema": { - "$ref": "#/definitions/Void" - } - }, - "redeemer": { - "title": "_redeemer", - "schema": { - "$ref": "#/definitions/Void" - } - }, - "compiledCode": "59029101000032323232323232323232222533300632323232323001003300100122533300f00114a226464a66601a0042660080080022940c04c008cdc3a4004601a6ea8c044004c8c8c8cc040ccc02cc8c94ccc034cdc3800a40042c2646466e1c0052054375a6028002600e004601c6ea8004cc004dd5998021802998021802803240009006260126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff004c0103d87a80004c0103d87980003301033300b3232533300d3370e00290010b0991919b8700148070dd6980a000980380118071baa00133001375666008600a66008600a00c90002401898126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff004c0103d87a80004c0103d87980003301033300b3375e6e9cc8c8c8c008004dd599803180399803180380424000900618008009129998088008a5eb804c8c8c8c8cc058004cc01801800cc04800cdd69809001180a80118098009ba7330104c0126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff00330104c126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff004bd7026103d87a80004c0103d87980004bd70111980180100098008009112999807801099ba5480092f5c0264646464a66601e66ebc0140044cdd2a4000660286ea00092f5c0266600e00e00600a60200066eb4c040008c04c00cc04400888c8ccc0040052000003222333300c3370e008004024466600800866e0000d200230140010012300a37540022930b180080091129998040010a4c26600a600260140046660060066016004002ae695cdaab9d5573caae7d5d02ba15745", - "hash": "6917ce2313801b854e38507b68d2c61afd70fca721804235e4760056" + "compiledCode": "59046f0100003232323232323232323222253330063232323232300200132323232323233015333010323330113375e660146016002900b26126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff004a0944cc024c02802d20004c0103d87a80004c0103d879800033015333010323253330123370e900100089919299980a19baf3300d300e00148001300126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff0013370e6eb4cc034c038005200248000528180c80098060010b18099baa00133009300a00b48009300103d87a80004c0103d8798000330153330103232533301600116132533301700113232300c001330193330143375e6e98dd5998069807000a40046e98c0152080a8d6b9074c0103d87a80004c0103d8798000330193330143375e6601a601c6601a601c002900024000980122d8799f581c11111111111111111111111111111111111111111111111111111111ff004c0103d87a80004c0103d879800033019333014323253330163370e9000000899250301000214a2602e6ea8004cc034c038cc034c038005200048009300103d87a80004c0103d8798000330193330143375e6601a601c002900219ba5480012f5c098103d87a80004c0103d8798000330193330143375e6601a601c002900319ba5480092f5c098103d87a80004c0103d87980004bd70180c8010b180c8009bac3300a300b00148010cc024c02802d20004c0103d87a80004c0103d879800033015333010323375e6e98dd5998051805800a400c6e98c009205433009300a00b4800130103d87a80004c0103d87980004bd701199911299980999b870014800052f5bded8c02646400266664444666601400800600400297adef6c6000400100833332222333300c0040030020014bd6f7b630001000803a45004881000013001001222225333016004133017337606ea400cdd300125eb7bdb1804c8c8c8c94ccc058cdd79980280380099ba5480012f5c026603666ec0dd48039ba6006008153330163371e00e00226603666ec0dd48039ba600600313301b337606ea4004dd3001199998048048018038030029bae30170033756602e004603400a603000844a66601c66e400080044cdd2a400097ae01533300e3371e004002266e9520024bd70099ba5480112f5c0600200244444a66602600826602866ec0dd48019ba80024bd6f7b630099191919299980999baf330050070013374a900025eb804cc060cdd81ba9007375000c0102a66602666e3c01c0044cc060cdd81ba9007375000c00626603066ec0dd48009ba800233333009009003007006005375c60280066eb4c050008c05c014c054010c004004894ccc0380045288991929998060010998020020008a5030120023370e900118061baa301000122323330010014800000c888cccc030cdc3802001009119980200219b8000348008c0500040048c028dd50008a4c2c6002002444a666010004293099802980098050011998018019805801000ab9a5736aae7555cf2ab9f5740ae855d101", + "hash": "1b19d9e3de3e442bfc49be1d4465f9e86268bd085d3b12d926cf5368" }, { "title": "deploy.spend", @@ -64,8 +36,36 @@ "$ref": "#/definitions/Data" } }, - "compiledCode": "5903e101000032323232323232323232322225333006323232323230020013301033300a32323375e0040026601893260103d87980000074c103d87a80004c0103d87980003301033300a32323232323232330123253330123370e002900009919299980c980e0010a4c2a6602c921364c6973742f5475706c652f436f6e73747220636f6e7461696e73206d6f7265206974656d73207468616e2069742065787065637465640016375a603400260180042a660289212b436f6e73747220696e64657820646964206e6f74206d6174636820616e7920747970652076617269616e74001630143754002a66602266ebd30106d8799f182aff0000113370e64600a00200690020a50301700130093253330103370e900018099baa0011001153301249012a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e00163322330060020010013237280026ecd30106d8799f182aff0037566600e60106600e6010012900024028600200244a6660260022900009919b8048008cc00c00c004c058004c0040048894ccc0480084cdd2a400497ae013232323253330113371e00a002266e952000330170024bd7009998038038018029bae30130033013002301600330140024c0103d87a80004c0103d87980003301033300a32533301000116132533301100116132323232533301032323009001330173330113375e660146016002900226126d87a9f5820fcaa61fb85676101d9e3398a484674e71c45c3fd41b492682f3b0054f4cf3273ff004c0103d87a80004c0103d8798000330173330113375e6601460160029003260122d8799f581ce37db487fbd58c45d059bcbf5cd6b1604d3bec16cf888f1395a4ebc4ff004c0103d87a80004c0103d87980004bd700010991918048009980b99980899baf3300a300b3300a300b0014800120024c012ad8799fd8799fd8799f581c66666666666666666666666666666666666666666666666666666666ffffff004c0103d87a80004c0103d879800033017333011323253330133370e0029002099251300d00216301537540026601460160029002260103d87a80004c0103d87980004bd700008a50301600430150041630140013013001375866006600866006600800a900024008980103d87a80004c0103d87980004bd7018008009129998078008a5113232533300c00213300400400114a0602600466e1d2002300d3754602200244646660020029000001911199980619b870040020132333004004337000069001180a800800918059baa001149858c0040048894ccc0240085261330053001300b002333003003300c0020015734ae6d5ce2ab9d5573caae7d5d02ba15745", - "hash": "3326c651fce284b443e23da9cc6f5864a1e496f2fc7774799fb897f9" + "compiledCode": "5903f001000032323232323232323232322225333006323232323230020013301033300a32323375e0040026601893260103d87980000074c103d87a80004c0103d87980003301033300a32323232323232330123253330123370e900000089919299980c980e0010a4c2a6602c921364c6973742f5475706c652f436f6e73747220636f6e7461696e73206d6f7265206974656d73207468616e2069742065787065637465640016375a603400260180042a660289213a28636f6e20737472696e672022436f6e73747220696e64657820646964206e6f74206d6174636820616e7920747970652076617269616e742229001630143754002a66602266ebd30106d8799f182aff0000113370e64600a00200690020a50301700130093253330103370e900018099baa0011001153301249012a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e00163322330060020010013237280026ecd30106d8799f182aff0037566600e60106600e6010012900024028600200244a6660260022900009919b8048008cc00c00c004c058004c0040048894ccc0480084cdd2a400497ae013232323253330113371e00a002266e952000330170024bd7009998038038018029bae30130033013002301600330140024c0103d87a80004c0103d87980003301033300a32533301000116132533301100116132323232533301032323009001330173330113375e660146016002900226126d87a9f5820fcaa61fb85676101d9e3398a484674e71c45c3fd41b492682f3b0054f4cf3273ff004c0103d87a80004c0103d8798000330173330113375e6601460160029003260122d8799f581ce37db487fbd58c45d059bcbf5cd6b1604d3bec16cf888f1395a4ebc4ff004c0103d87a80004c0103d87980004bd700010991918048009980b99980899baf3300a300b3300a300b0014800120024c012ad8799fd8799fd8799f581c66666666666666666666666666666666666666666666666666666666ffffff004c0103d87a80004c0103d879800033017333011323253330133370e9002000899251300d00216301537540026601460160029002260103d87a80004c0103d87980004bd700008a50301600430150041630140013013001375866006600866006600800a900024008980103d87a80004c0103d87980004bd7018008009129998078008a5113232533300c00213300400400114a0602600466e1d2002300d3754602200244646660020029000001911199980619b870040020132333004004337000069001180a800800918059baa001149858c0040048894ccc0240085261330053001300b002333003003300c0020015734ae6d5ce2ab9d5573caae7d5d02ba15745", + "hash": "918ab345c2babf62b5fc5c319d41b4bd72648bdbeb73dcd17f17db63" + }, + { + "title": "mint.mint", + "redeemer": { + "title": "redeemer", + "schema": { + "$ref": "#/definitions/Data" + } + }, + "compiledCode": "590488010000323232323232323232323222533300532323232323001003300100122533300f00114a226464a6660180042660080080022940c04c008cdc3a4004601a6ea8c044004cc034ccc01cc8c8c8c8c8c8c94ccc04cc0580084c8c8cdc78018009bae3016001300932533300f3370e900018091baa0011001153301149012a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e00163300830090034800854cc0412401364c6973742f5475706c652f436f6e73747220636f6e7461696e73206d6f7265206974656d73207468616e2069742065787065637465640016375c602800264646464600c00200200264640026644660100040020029110000137566600c600e6600c600e00290002401000e600200244a666020002297ae01323232323301537520026600c00c0066eb8c04400cdd59808801180a0011809000980080091129998078010a5eb7bdb1804c8c8c8c94ccc038cdc7802800880189980a19bb037520026e98008ccc01c01c00c014dd718080019bab3010002301300330110024c103d87a80004c0103d87980003300d333007323232323322323232323253330123370e90010008b0991919b87001483c850dd6980d0009806801180a1baa001332233008002001001488103666f6f0033223233223253330153370e90010008801099190009bab301d00130100033017375400400297adef6c6033223300b002001002001375666012601400690040009bae30150013008533300d3370e900018081baa0021002153300f49012a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e001633005300600748008cc014c01801d20003001001222533301100213374a900125eb804c8c8c8c94ccc040cdc7802800899ba548000cc058dd400125eb804ccc01c01c00c014dd718090019bad3012002301500330130023001001222533300f00213374a900125eb804c8c8c8c94ccc038cdc7802800899ba548000cc050dd300125eb804ccc01c01c00c014dd718080019bab3010002301300330110024c103d87a80004c0103d87980003300d3330073232323233223232533300f3375e006002266e1cc8c018004dd5998049805198049805002240009009240042940c054004c020c94ccc038cdc3a400060226ea8004400454cc0412412a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e001633223300700200137566600e60106600e60100049000240246600e6010004900100380418008009129998080008a400026466e0120023300300300130130013001001222533300f00213374a900125eb804c8c8c8c94ccc038cdd7802800899ba548000cc0500092f5c0266600e00e00600a6020006602000460260066022004980103d87a80004c0103d87980004bd701119199800800a4000006444666601666e1c0100080488ccc010010cdc0001a40046028002002460146ea8004526163001001222533300900214984cc014c004c02c008ccc00c00cc0300080055cd2b9b5738aae7555cf2ab9f5740ae855d11", + "hash": "4713fb6d48ba86a228f79b958ae5ef137cdb08e02a9c2f72052bf5e5" + }, + { + "title": "withdrawals.spend", + "datum": { + "title": "_datum", + "schema": { + "$ref": "#/definitions/Void" + } + }, + "redeemer": { + "title": "_redeemer", + "schema": { + "$ref": "#/definitions/Void" + } + }, + "compiledCode": "59029101000032323232323232323232222533300632323232323001003300100122533300f00114a226464a66601a0042660080080022940c04c008cdc3a4004601a6ea8c044004c8c8c8cc040ccc02cc8c94ccc034cdc3a40040022c2646466e1c0052054375a6028002600e004601c6ea8004cc004dd5998021802998021802803240009006260126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff004c0103d87a80004c0103d87980003301033300b3232533300d3370e90010008b0991919b8700148070dd6980a000980380118071baa00133001375666008600a66008600a00c90002401898126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff004c0103d87a80004c0103d87980003301033300b3375e6e9cc8c8c8c008004dd599803180399803180380424000900618008009129998088008a5eb804c8c8c8c8cc058004cc01801800cc04800cdd69809001180a80118098009ba7330104c0126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff00330104c126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff004bd7026103d87a80004c0103d87980004bd70111980180100098008009112999807801099ba5480092f5c0264646464a66601e66ebc0140044cdd2a4000660286ea00092f5c0266600e00e00600a60200066eb4c040008c04c00cc04400888c8ccc0040052000003222333300c3370e008004024466600800866e0000d200230140010012300a37540022930b180080091129998040010a4c26600a600260140046660060066016004002ae695cdaab9d5573caae7d5d02ba15745", + "hash": "8926bce06966e878646861478d817460794aeaddb9d7440446b07e0f" } ], "definitions": {