diff --git a/crates/aiken/src/cmd/tx/simulate.rs b/crates/aiken/src/cmd/tx/simulate.rs index 0751e6d9..c0760ec9 100644 --- a/crates/aiken/src/cmd/tx/simulate.rs +++ b/crates/aiken/src/cmd/tx/simulate.rs @@ -9,7 +9,7 @@ use std::{fmt, fs, path::PathBuf, process}; use uplc::{ machine::cost_model::ExBudget, tx::{ - self, + self, redeemer_tag_to_string, script_context::{ResolvedInput, SlotConfig}, }, }; @@ -110,11 +110,11 @@ pub fn exec( let with_redeemer = |redeemer: &Redeemer| { eprintln!( - "{} {:?}[{}]", + "{} {}[{}]", " Evaluating" .if_supports_color(Stderr, |s| s.purple()) .if_supports_color(Stderr, |s| s.bold()), - redeemer.tag, + redeemer_tag_to_string(&redeemer.tag), redeemer.index ) }; diff --git a/crates/uplc/src/lib.rs b/crates/uplc/src/lib.rs index 364cd7c4..798d680a 100644 --- a/crates/uplc/src/lib.rs +++ b/crates/uplc/src/lib.rs @@ -16,6 +16,7 @@ pub use pallas_primitives::{ babbage::{PostAlonzoTransactionOutput, TransactionInput, TransactionOutput, Value}, Error, Fragment, }; +pub use tx::redeemer_tag_to_string; pub fn plutus_data(bytes: &[u8]) -> Result { PlutusData::decode_fragment(bytes) diff --git a/crates/uplc/src/machine/error.rs b/crates/uplc/src/machine/error.rs index 57698a34..d4255ccf 100644 --- a/crates/uplc/src/machine/error.rs +++ b/crates/uplc/src/machine/error.rs @@ -13,9 +13,19 @@ pub enum Error { OpenTermEvaluated(Term), #[error("The validator crashed / exited prematurely")] EvaluationFailure, - #[error("Attempted to instantiate a non-polymorphic term:\n\n{0:#?}")] + #[error( + "Attempted to instantiate a non-polymorphic term\n{:>13} {}", + "Term", + indent(redacted(format!("{:#?}", .0), 10)), + )] NonPolymorphicInstantiation(Value), - #[error("Attempted to apply a non-function:\n\n{0:#?} to argument:\n\n{1:#?}")] + #[error( + "Attempted to apply an argument to a non-function\n{:>13} {}\n{:>13} {}", + "Thing", + indent(redacted(format!("{:#?}", .0), 5)), + "Argument", + indent(redacted(format!("{:#?}", .1), 5)), + )] NonFunctionalApplication(Value, Value), #[error("Attempted to case a non-const:\n\n{0:#?}")] NonConstrScrutinized(Value), @@ -61,7 +71,10 @@ pub enum Error { UnexpectedEd25519PublicKeyLength(usize), #[error("Ed25519S Signature should be 64 bytes but it was {0}")] UnexpectedEd25519SignatureLength(usize), - #[error("Failed to deserialise PlutusData using {0}:\n\n{1:#?}")] + #[error( + "Failed to deserialise PlutusData using {0}:\n\n{}", + redacted(format!("{:#?}", .1), 10), + )] DeserialisationError(String, Value), #[error("Integer overflow")] OverflowError, @@ -83,3 +96,21 @@ impl From for Error { Error::K256Error(format!("K256 error: {}", error)) } } + +/// Print only the first n lines of possibly long output, and redact the rest if longer. +fn redacted(s: String, max_rows: usize) -> String { + let rows = s.lines(); + + if rows.count() > max_rows { + let last_line = s.lines().last().unwrap(); + let mut s = s.lines().take(max_rows).collect::>().join("\n"); + s.push_str(&format!("\n ...redacted...\n{last_line}")); + s + } else { + s + } +} + +fn indent(s: String) -> String { + s.lines().collect::>().join(&format!("\n{:>14}", "")) +} diff --git a/crates/uplc/src/tx.rs b/crates/uplc/src/tx.rs index b6086d9a..b01e9963 100644 --- a/crates/uplc/src/tx.rs +++ b/crates/uplc/src/tx.rs @@ -9,7 +9,7 @@ use pallas_primitives::{ Fragment, }; use pallas_traverse::{Era, MultiEraTx}; -pub use phase_one::eval_phase_one; +pub use phase_one::{eval_phase_one, redeemer_tag_to_string}; pub use script_context::{DataLookupTable, ResolvedInput, SlotConfig}; pub mod error; diff --git a/crates/uplc/src/tx/error.rs b/crates/uplc/src/tx/error.rs index 48590354..c7803e45 100644 --- a/crates/uplc/src/tx/error.rs +++ b/crates/uplc/src/tx/error.rs @@ -99,4 +99,6 @@ pub enum Error { MissingScriptForRedeemer, #[error("failed to apply parameters to Plutus script")] ApplyParamsError, + #[error("validity start or end too far in the past")] + SlotTooFarInThePast { oldest_allowed: u64 }, } diff --git a/crates/uplc/src/tx/eval.rs b/crates/uplc/src/tx/eval.rs index c82f892f..fecc78a4 100644 --- a/crates/uplc/src/tx/eval.rs +++ b/crates/uplc/src/tx/eval.rs @@ -4,15 +4,16 @@ use super::{ Error, }; use crate::{ - ast::{Data, FakeNamedDeBruijn, NamedDeBruijn, Program}, + ast::{FakeNamedDeBruijn, NamedDeBruijn, Program}, machine::cost_model::ExBudget, - tx::script_context::{DataLookupTable, ScriptVersion, TxInfoV1, TxInfoV2, TxInfoV3}, + tx::{ + phase_one::redeemer_tag_to_string, + script_context::{DataLookupTable, ScriptVersion, TxInfoV1, TxInfoV2, TxInfoV3}, + }, PlutusData, }; use pallas_codec::utils::Bytes; -use pallas_primitives::conway::{ - CostMdls, CostModel, ExUnits, Language, MintedTx, Redeemer, RedeemerTag, -}; +use pallas_primitives::conway::{CostMdls, CostModel, ExUnits, Language, MintedTx, Redeemer}; pub fn eval_redeemer( tx: &MintedTx, @@ -44,21 +45,16 @@ pub fn eval_redeemer( } .apply_data(redeemer.data.clone()) .apply_data(script_context.to_plutus_data()), - ScriptContext::V3 { .. } if datum.is_some() => { + + // FIXME: Temporary, but needed until https://github.com/aiken-lang/aiken/pull/977 + // is implemented. + ScriptContext::V3 { .. } => if let Some(datum) = datum { + program.apply_data(datum) + } else { program - // FIXME: Temporary, but needed until https://github.com/aiken-lang/aiken/pull/977 - // is implemented. - .apply_data(Data::constr(0, vec![])) - .apply_data(Data::constr(0, vec![])) - .apply_data(script_context.to_plutus_data()) - } - ScriptContext::V3 { .. } => { - program - // FIXME: Temporary, but needed until https://github.com/aiken-lang/aiken/pull/977 - // is implemented. - .apply_data(Data::constr(0, vec![])) - .apply_data(script_context.to_plutus_data()) } + .apply_data(redeemer.data.clone()) + .apply_data(script_context.to_plutus_data()), }; let mut eval_result = if let Some(costs) = cost_mdl_opt { @@ -154,15 +150,3 @@ pub fn eval_redeemer( err: Box::new(err), }) } - -fn redeemer_tag_to_string(redeemer_tag: &RedeemerTag) -> String { - match redeemer_tag { - RedeemerTag::Spend => "Spend", - RedeemerTag::Mint => "Mint", - RedeemerTag::Reward => "Withdraw", - RedeemerTag::Cert => "Publish", - RedeemerTag::Propose => "Propose", - RedeemerTag::Vote => "Vote", - } - .to_string() -} diff --git a/crates/uplc/src/tx/phase_one.rs b/crates/uplc/src/tx/phase_one.rs index b64305be..2f0282bd 100644 --- a/crates/uplc/src/tx/phase_one.rs +++ b/crates/uplc/src/tx/phase_one.rs @@ -2,6 +2,7 @@ use super::{ error::Error, script_context::{sort_voters, DataLookupTable, ResolvedInput, ScriptPurpose, ScriptVersion}, }; +use crate::tx::script_context::sort_reward_accounts; use itertools::Itertools; use pallas_addresses::{Address, ScriptHash, ShelleyPaymentPart, StakePayload}; use pallas_codec::utils::Nullable; @@ -234,13 +235,20 @@ pub fn has_exact_set_of_redeemers( let missing: Vec<_> = redeemers_needed .into_iter() .filter(|x| !wits_redeemer_keys.contains(&&x.0)) - .map(|x| format!("{:?}[{:?}] -> {}", x.0.tag, x.0.index, x.2)) + .map(|x| { + format!( + "{}[{:?}] -> {}", + redeemer_tag_to_string(&x.0.tag), + x.0.index, + x.2 + ) + }) .collect(); let extra: Vec<_> = wits_redeemer_keys .into_iter() .filter(|x| !needed_redeemer_keys.contains(x)) - .map(|x| format!("{:?}[{:?}]", x.tag, x.index)) + .map(|x| format!("{}[{:?}]", redeemer_tag_to_string(&x.tag), x.index)) .collect(); if !missing.is_empty() || !extra.is_empty() { @@ -306,7 +314,7 @@ fn build_redeemer_key( .map(|m| m.iter().map(|(acnt, _)| acnt).collect()) .unwrap_or_default(); - reward_accounts.sort(); + reward_accounts.sort_by(|acnt_a, acnt_b| sort_reward_accounts(acnt_a, acnt_b)); let mut redeemer_key = None; @@ -377,3 +385,15 @@ fn build_redeemer_key( } } } + +pub fn redeemer_tag_to_string(redeemer_tag: &RedeemerTag) -> String { + match redeemer_tag { + RedeemerTag::Spend => "Spend", + RedeemerTag::Mint => "Mint", + RedeemerTag::Reward => "Withdraw", + RedeemerTag::Cert => "Publish", + RedeemerTag::Propose => "Propose", + RedeemerTag::Vote => "Vote", + } + .to_string() +} diff --git a/crates/uplc/src/tx/script_context.rs b/crates/uplc/src/tx/script_context.rs index 5a7792fa..992b86e2 100644 --- a/crates/uplc/src/tx/script_context.rs +++ b/crates/uplc/src/tx/script_context.rs @@ -1,8 +1,8 @@ use super::{to_plutus_data::MintValue, Error}; use itertools::Itertools; -use pallas_addresses::{Address, StakePayload}; +use pallas_addresses::{Address, Network, StakePayload}; use pallas_codec::utils::{ - KeyValuePairs, NonEmptyKeyValuePairs, NonEmptySet, Nullable, PositiveCoin, + Bytes, KeyValuePairs, NonEmptyKeyValuePairs, NonEmptySet, Nullable, PositiveCoin, }; use pallas_crypto::hash::Hash; use pallas_primitives::{ @@ -217,7 +217,7 @@ impl TxInfoV1 { let inputs = get_tx_in_info_v1(&tx.transaction_body.inputs, utxos)?; let certificates = get_certificates_info(&tx.transaction_body.certificates); let withdrawals = - KeyValuePairs::from(get_withdrawal_info(&tx.transaction_body.withdrawals)); + KeyValuePairs::from(get_withdrawals_info(&tx.transaction_body.withdrawals)); let mint = get_mint_info(&tx.transaction_body.mint); let redeemers = get_redeemers_info( @@ -232,7 +232,7 @@ impl TxInfoV1 { mint, certificates, withdrawals: withdrawals.into(), - valid_range: get_validity_range_info(&tx.transaction_body, slot_config), + valid_range: get_validity_range_info(&tx.transaction_body, slot_config)?, signatories: get_signatories_info(&tx.transaction_body.required_signers), data: get_data_info(&tx.transaction_witness_set), redeemers, @@ -266,7 +266,7 @@ impl TxInfoV2 { let inputs = get_tx_in_info_v2(&tx.transaction_body.inputs, utxos)?; let certificates = get_certificates_info(&tx.transaction_body.certificates); let withdrawals = - KeyValuePairs::from(get_withdrawal_info(&tx.transaction_body.withdrawals)); + KeyValuePairs::from(get_withdrawals_info(&tx.transaction_body.withdrawals)); let mint = get_mint_info(&tx.transaction_body.mint); let redeemers = get_redeemers_info( @@ -290,7 +290,7 @@ impl TxInfoV2 { mint, certificates, withdrawals, - valid_range: get_validity_range_info(&tx.transaction_body, slot_config), + valid_range: get_validity_range_info(&tx.transaction_body, slot_config)?, signatories: get_signatories_info(&tx.transaction_body.required_signers), data: KeyValuePairs::from(get_data_info(&tx.transaction_witness_set)), redeemers, @@ -330,7 +330,7 @@ impl TxInfoV3 { let certificates = get_certificates_info(&tx.transaction_body.certificates); let withdrawals = - KeyValuePairs::from(get_withdrawal_info(&tx.transaction_body.withdrawals)); + KeyValuePairs::from(get_withdrawals_info(&tx.transaction_body.withdrawals)); let mint = get_mint_info(&tx.transaction_body.mint); @@ -367,7 +367,7 @@ impl TxInfoV3 { mint, certificates, withdrawals, - valid_range: get_validity_range_info(&tx.transaction_body, slot_config), + valid_range: get_validity_range_info(&tx.transaction_body, slot_config)?, signatories: get_signatories_info(&tx.transaction_body.required_signers), data: KeyValuePairs::from(get_data_info(&tx.transaction_witness_set)), redeemers, @@ -626,14 +626,14 @@ pub fn get_proposal_procedures_info( .unwrap_or_default() } -pub fn get_withdrawal_info( +pub fn get_withdrawals_info( withdrawals: &Option>, ) -> Vec<(Address, Coin)> { withdrawals .clone() .map(|w| { w.into_iter() - .sorted() + .sorted_by(|(accnt_a, _), (accnt_b, _)| sort_reward_accounts(accnt_a, accnt_b)) .map(|(reward_account, coin)| (Address::from_bytes(&reward_account).unwrap(), coin)) .collect() }) @@ -643,21 +643,31 @@ pub fn get_withdrawal_info( pub fn get_validity_range_info( body: &MintedTransactionBody, slot_config: &SlotConfig, -) -> TimeRange { - fn slot_to_begin_posix_time(slot: u64, sc: &SlotConfig) -> u64 { +) -> Result { + fn slot_to_begin_posix_time(slot: u64, sc: &SlotConfig) -> Result { + if slot < sc.zero_slot { + return Err(Error::SlotTooFarInThePast { + oldest_allowed: sc.zero_slot, + }); + } let ms_after_begin = (slot - sc.zero_slot) * sc.slot_length as u64; - sc.zero_time + ms_after_begin + Ok(sc.zero_time + ms_after_begin) } - fn slot_range_to_posix_time_range(slot_range: TimeRange, sc: &SlotConfig) -> TimeRange { - TimeRange { + fn slot_range_to_posix_time_range( + slot_range: TimeRange, + sc: &SlotConfig, + ) -> Result { + Ok(TimeRange { lower_bound: slot_range .lower_bound - .map(|lower_bound| slot_to_begin_posix_time(lower_bound, sc)), + .map(|lower_bound| slot_to_begin_posix_time(lower_bound, sc)) + .transpose()?, upper_bound: slot_range .upper_bound - .map(|upper_bound| slot_to_begin_posix_time(upper_bound, sc)), - } + .map(|upper_bound| slot_to_begin_posix_time(upper_bound, sc)) + .transpose()?, + }) } slot_range_to_posix_time_range( @@ -841,7 +851,7 @@ pub fn find_script( lookup_script(&hash) }), - RedeemerTag::Reward => get_withdrawal_info(&tx.transaction_body.withdrawals) + RedeemerTag::Reward => get_withdrawals_info(&tx.transaction_body.withdrawals) .get(redeemer.index as usize) .ok_or(Error::MissingScriptForRedeemer) .and_then(|(addr, _)| { @@ -1086,6 +1096,34 @@ fn sort_gov_action_id(a: &GovActionId, b: &GovActionId) -> Ordering { } } +pub fn sort_reward_accounts(a: &Bytes, b: &Bytes) -> Ordering { + let addr_a = Address::from_bytes(a).expect("invalid reward address in withdrawals."); + let addr_b = Address::from_bytes(b).expect("invalid reward address in withdrawals."); + + fn network_tag(network: Network) -> u8 { + match network { + Network::Testnet => 0, + Network::Mainnet => 1, + Network::Other(tag) => tag, + } + } + + if let (Address::Stake(accnt_a), Address::Stake(accnt_b)) = (addr_a, addr_b) { + if accnt_a.network() != accnt_b.network() { + return network_tag(accnt_a.network()).cmp(&network_tag(accnt_b.network())); + } + + match (accnt_a.payload(), accnt_b.payload()) { + (StakePayload::Script(..), StakePayload::Stake(..)) => Ordering::Less, + (StakePayload::Stake(..), StakePayload::Script(..)) => Ordering::Greater, + (StakePayload::Script(hash_a), StakePayload::Script(hash_b)) => hash_a.cmp(hash_b), + (StakePayload::Stake(hash_a), StakePayload::Stake(hash_b)) => hash_a.cmp(hash_b), + } + } else { + unreachable!("invalid reward address in withdrawals."); + } +} + #[cfg(test)] mod tests { use crate::{ @@ -1479,4 +1517,62 @@ mod tests { // from the Haskell ledger / cardano node. insta::assert_debug_snapshot!(script_context.to_plutus_data()); } + + #[test] + fn script_context_withdraw() { + let redeemer = Redeemer { + tag: RedeemerTag::Reward, + index: 0, + data: Data::constr(0, vec![]), + ex_units: ExUnits { + mem: 1000000, + steps: 100000000, + }, + }; + + // NOTE: The transaction also contains treasury donation and current treasury amount + let script_context = fixture_tx_info( + "84a7008182582000000000000000000000000000000000000000000000000000\ + 00000000000000000183a2005839200000000000000000000000000000000000\ + 0000000000000000000000111111111111111111111111111111111111111111\ + 11111111111111011a000f4240a2005823400000000000000000000000000000\ + 00000000000000000000000000008198bd431b03011a000f4240a20058235011\ + 1111111111111111111111111111111111111111111111111111118198bd431b\ + 03011a000f424002182a031a00448e0105a1581df004036eecadc2f19e95f831\ + b4bc08919cde1d1088d74602bd3dcd78a2000e81581c00000000000000000000\ + 0000000000000000000000000000000000001601a10582840000d87a81d87980\ + 821a000f42401a05f5e100840300d87980821a000f42401a05f5e100f5f6", + "8182582000000000000000000000000000000000000000000000000000000000\ + 0000000000", + "81a40058393004036eecadc2f19e95f831b4bc08919cde1d1088d74602bd3dcd\ + 78a204036eecadc2f19e95f831b4bc08919cde1d1088d74602bd3dcd78a2011a\ + 000f4240028201d81843d8798003d818590221820359021c5902190101003232\ + 323232323232322232533333300c00215323330073001300937540062a660109\ + 211c52756e6e696e672032206172672076616c696461746f72206d696e740013\ + 533333300d004153330073001300937540082a66601660146ea8010494ccc021\ + 288a4c2a660129211856616c696461746f722072657475726e65642066616c73\ + 65001365600600600600600600600315330084911d52756e6e696e6720332061\ + 72672076616c696461746f72207370656e640013533333300d00415333007300\ + 1300937540082a66601660146ea8010494cccccc03800454ccc020c008c028dd\ + 50008a99980618059baa0011253330094a22930a998052491856616c69646174\ + 6f722072657475726e65642066616c7365001365600600600600600600600600\ + 6006006006006300c300a37540066e1d20001533007001161533007001161533\ + 00700116153300700116490191496e636f72726563742072656465656d657220\ + 7479706520666f722076616c696461746f72207370656e642e0a202020202020\ + 2020202020202020202020202020446f75626c6520636865636b20796f752068\ + 6176652077726170706564207468652072656465656d65722074797065206173\ + 2073706563696669656420696e20796f757220706c757475732e6a736f6e0015\ + 330034910b5f746d70313a20566f6964001615330024910b5f746d70303a2056\ + 6f696400165734ae7155ceaab9e5573eae855d21", + ) + .into_script_context(&redeemer, None) + .unwrap(); + + // NOTE: The initial snapshot has been generated using the Haskell + // implementation of the ledger library for that same serialized + // transactions. It is meant to control that our construction of the + // script context and its serialization matches exactly those + // from the Haskell ledger / cardano node. + insta::assert_debug_snapshot!(script_context.to_plutus_data()); + } } diff --git a/crates/uplc/src/tx/snapshots/uplc__tx__script_context__tests__script_context_withdraw.snap b/crates/uplc/src/tx/snapshots/uplc__tx__script_context__tests__script_context_withdraw.snap new file mode 100644 index 00000000..28d781a9 --- /dev/null +++ b/crates/uplc/src/tx/snapshots/uplc__tx__script_context__tests__script_context_withdraw.snap @@ -0,0 +1,1236 @@ +--- +source: crates/uplc/src/tx/script_context.rs +expression: script_context.to_plutus_data() +--- +Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + Array( + [ + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + BoundedBytes( + BoundedBytes( + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + ), + ), + BigInt( + Int( + Int( + Int { + neg: false, + val: 0, + }, + ), + ), + ), + ], + }, + ), + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 122, + any_constructor: None, + fields: [ + BoundedBytes( + BoundedBytes( + [ + 4, + 3, + 110, + 236, + 173, + 194, + 241, + 158, + 149, + 248, + 49, + 180, + 188, + 8, + 145, + 156, + 222, + 29, + 16, + 136, + 215, + 70, + 2, + 189, + 61, + 205, + 120, + 162, + ], + ), + ), + ], + }, + ), + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 122, + any_constructor: None, + fields: [ + BoundedBytes( + BoundedBytes( + [ + 4, + 3, + 110, + 236, + 173, + 194, + 241, + 158, + 149, + 248, + 49, + 180, + 188, + 8, + 145, + 156, + 222, + 29, + 16, + 136, + 215, + 70, + 2, + 189, + 61, + 205, + 120, + 162, + ], + ), + ), + ], + }, + ), + ], + }, + ), + ], + }, + ), + ], + }, + ), + Map( + Def( + [ + ( + BoundedBytes( + BoundedBytes( + [], + ), + ), + Map( + Def( + [ + ( + BoundedBytes( + BoundedBytes( + [], + ), + ), + BigInt( + Int( + Int( + Int { + neg: false, + val: 1000000, + }, + ), + ), + ), + ), + ], + ), + ), + ), + ], + ), + ), + Constr( + Constr { + tag: 123, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [], + }, + ), + ], + }, + ), + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + BoundedBytes( + BoundedBytes( + [ + 4, + 3, + 110, + 236, + 173, + 194, + 241, + 158, + 149, + 248, + 49, + 180, + 188, + 8, + 145, + 156, + 222, + 29, + 16, + 136, + 215, + 70, + 2, + 189, + 61, + 205, + 120, + 162, + ], + ), + ), + ], + }, + ), + ], + }, + ), + ], + }, + ), + ], + ), + Array( + [], + ), + Array( + [ + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + BoundedBytes( + BoundedBytes( + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + ), + ), + ], + }, + ), + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 122, + any_constructor: None, + fields: [ + BoundedBytes( + BoundedBytes( + [ + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + ], + ), + ), + ], + }, + ), + ], + }, + ), + ], + }, + ), + ], + }, + ), + Map( + Def( + [ + ( + BoundedBytes( + BoundedBytes( + [], + ), + ), + Map( + Def( + [ + ( + BoundedBytes( + BoundedBytes( + [], + ), + ), + BigInt( + Int( + Int( + Int { + neg: false, + val: 1000000, + }, + ), + ), + ), + ), + ], + ), + ), + ), + ], + ), + ), + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [], + }, + ), + Constr( + Constr { + tag: 122, + any_constructor: None, + fields: [], + }, + ), + ], + }, + ), + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + BoundedBytes( + BoundedBytes( + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + ), + ), + ], + }, + ), + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 122, + any_constructor: None, + fields: [ + BigInt( + Int( + Int( + Int { + neg: false, + val: 2498243, + }, + ), + ), + ), + BigInt( + Int( + Int( + Int { + neg: false, + val: 27, + }, + ), + ), + ), + BigInt( + Int( + Int( + Int { + neg: false, + val: 3, + }, + ), + ), + ), + ], + }, + ), + ], + }, + ), + ], + }, + ), + Map( + Def( + [ + ( + BoundedBytes( + BoundedBytes( + [], + ), + ), + Map( + Def( + [ + ( + BoundedBytes( + BoundedBytes( + [], + ), + ), + BigInt( + Int( + Int( + Int { + neg: false, + val: 1000000, + }, + ), + ), + ), + ), + ], + ), + ), + ), + ], + ), + ), + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [], + }, + ), + Constr( + Constr { + tag: 122, + any_constructor: None, + fields: [], + }, + ), + ], + }, + ), + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 122, + any_constructor: None, + fields: [ + BoundedBytes( + BoundedBytes( + [ + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + ], + ), + ), + ], + }, + ), + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 122, + any_constructor: None, + fields: [ + BigInt( + Int( + Int( + Int { + neg: false, + val: 2498243, + }, + ), + ), + ), + BigInt( + Int( + Int( + Int { + neg: false, + val: 27, + }, + ), + ), + ), + BigInt( + Int( + Int( + Int { + neg: false, + val: 3, + }, + ), + ), + ), + ], + }, + ), + ], + }, + ), + ], + }, + ), + Map( + Def( + [ + ( + BoundedBytes( + BoundedBytes( + [], + ), + ), + Map( + Def( + [ + ( + BoundedBytes( + BoundedBytes( + [], + ), + ), + BigInt( + Int( + Int( + Int { + neg: false, + val: 1000000, + }, + ), + ), + ), + ), + ], + ), + ), + ), + ], + ), + ), + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [], + }, + ), + Constr( + Constr { + tag: 122, + any_constructor: None, + fields: [], + }, + ), + ], + }, + ), + ], + ), + BigInt( + Int( + Int( + Int { + neg: false, + val: 42, + }, + ), + ), + ), + Map( + Def( + [], + ), + ), + Array( + [], + ), + Map( + Def( + [ + ( + Constr( + Constr { + tag: 122, + any_constructor: None, + fields: [ + BoundedBytes( + BoundedBytes( + [ + 4, + 3, + 110, + 236, + 173, + 194, + 241, + 158, + 149, + 248, + 49, + 180, + 188, + 8, + 145, + 156, + 222, + 29, + 16, + 136, + 215, + 70, + 2, + 189, + 61, + 205, + 120, + 162, + ], + ), + ), + ], + }, + ), + BigInt( + Int( + Int( + Int { + neg: false, + val: 0, + }, + ), + ), + ), + ), + ], + ), + ), + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [], + }, + ), + Constr( + Constr { + tag: 122, + any_constructor: None, + fields: [], + }, + ), + ], + }, + ), + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 122, + any_constructor: None, + fields: [ + BigInt( + Int( + Int( + Int { + neg: false, + val: 1596059092000, + }, + ), + ), + ), + ], + }, + ), + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [], + }, + ), + ], + }, + ), + ], + }, + ), + Array( + [ + BoundedBytes( + BoundedBytes( + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + ), + ), + ], + ), + Map( + Def( + [ + ( + Constr( + Constr { + tag: 122, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + BoundedBytes( + BoundedBytes( + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + ), + ), + BigInt( + Int( + Int( + Int { + neg: false, + val: 0, + }, + ), + ), + ), + ], + }, + ), + ], + }, + ), + Constr( + Constr { + tag: 122, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [], + }, + ), + ], + }, + ), + ), + ( + Constr( + Constr { + tag: 123, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 122, + any_constructor: None, + fields: [ + BoundedBytes( + BoundedBytes( + [ + 4, + 3, + 110, + 236, + 173, + 194, + 241, + 158, + 149, + 248, + 49, + 180, + 188, + 8, + 145, + 156, + 222, + 29, + 16, + 136, + 215, + 70, + 2, + 189, + 61, + 205, + 120, + 162, + ], + ), + ), + ], + }, + ), + ], + }, + ), + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [], + }, + ), + ), + ], + ), + ), + Map( + Def( + [], + ), + ), + BoundedBytes( + BoundedBytes( + [ + 64, + 190, + 227, + 178, + 90, + 88, + 90, + 133, + 79, + 231, + 63, + 52, + 72, + 166, + 246, + 180, + 23, + 254, + 102, + 156, + 129, + 58, + 24, + 129, + 230, + 101, + 151, + 31, + 52, + 169, + 233, + 132, + ], + ), + ), + Map( + Def( + [], + ), + ), + Array( + [], + ), + Constr( + Constr { + tag: 122, + any_constructor: None, + fields: [], + }, + ), + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [ + BigInt( + Int( + Int( + Int { + neg: false, + val: 1, + }, + ), + ), + ), + ], + }, + ), + ], + }, + ), + Constr( + Constr { + tag: 121, + any_constructor: None, + fields: [], + }, + ), + Constr( + Constr { + tag: 123, + any_constructor: None, + fields: [ + Constr( + Constr { + tag: 122, + any_constructor: None, + fields: [ + BoundedBytes( + BoundedBytes( + [ + 4, + 3, + 110, + 236, + 173, + 194, + 241, + 158, + 149, + 248, + 49, + 180, + 188, + 8, + 145, + 156, + 222, + 29, + 16, + 136, + 215, + 70, + 2, + 189, + 61, + 205, + 120, + 162, + ], + ), + ), + ], + }, + ), + ], + }, + ), + ], + }, +) diff --git a/crates/uplc/src/tx/to_plutus_data.rs b/crates/uplc/src/tx/to_plutus_data.rs index 52fc6d3f..670f8654 100644 --- a/crates/uplc/src/tx/to_plutus_data.rs +++ b/crates/uplc/src/tx/to_plutus_data.rs @@ -736,127 +736,34 @@ impl ToPlutusData for PlutusData { impl ToPlutusData for TimeRange { fn to_plutus_data(&self) -> PlutusData { - match &self { - TimeRange { - lower_bound: Some(lower_bound), - upper_bound: None, - } => { - wrap_multiple_with_constr( + fn bound(bound: Option, is_lower: bool) -> PlutusData { + match bound { + Some(x) => wrap_multiple_with_constr( 0, vec![ - // LowerBound - wrap_multiple_with_constr( - 0, - vec![ - // Finite - wrap_with_constr(1, lower_bound.to_plutus_data()), - // Closure - true.to_plutus_data(), - ], - ), //UpperBound - wrap_multiple_with_constr( - 0, - vec![ - // PosInf - empty_constr(2), - // Closure - true.to_plutus_data(), - ], - ), + wrap_with_constr(1, x.to_plutus_data()), + // NOTE: Finite lower bounds are always inclusive, unlike upper bounds. + is_lower.to_plutus_data(), ], - ) - } - TimeRange { - lower_bound: None, - upper_bound: Some(upper_bound), - } => { - wrap_multiple_with_constr( + ), + None => wrap_multiple_with_constr( 0, vec![ - // LowerBound - wrap_multiple_with_constr( - 0, - vec![ - // NegInf - empty_constr(0), - // Closure - true.to_plutus_data(), - ], - ), - //UpperBound - wrap_multiple_with_constr( - 0, - vec![ - // Finite - wrap_with_constr(1, upper_bound.to_plutus_data()), - // Closure - true.to_plutus_data(), - ], - ), + empty_constr(if is_lower { 0 } else { 2 }), + // NOTE: Infinite bounds are always exclusive, by convention. + true.to_plutus_data(), ], - ) - } - TimeRange { - lower_bound: Some(lower_bound), - upper_bound: Some(upper_bound), - } => { - wrap_multiple_with_constr( - 0, - vec![ - // LowerBound - wrap_multiple_with_constr( - 0, - vec![ - // Finite - wrap_with_constr(1, lower_bound.to_plutus_data()), - // Closure - true.to_plutus_data(), - ], - ), - //UpperBound - wrap_multiple_with_constr( - 0, - vec![ - // Finite - wrap_with_constr(1, upper_bound.to_plutus_data()), - // Closure - false.to_plutus_data(), - ], - ), - ], - ) - } - TimeRange { - lower_bound: None, - upper_bound: None, - } => { - wrap_multiple_with_constr( - 0, - vec![ - // LowerBound - wrap_multiple_with_constr( - 0, - vec![ - // NegInf - empty_constr(0), - // Closure - true.to_plutus_data(), - ], - ), - //UpperBound - wrap_multiple_with_constr( - 0, - vec![ - // PosInf - empty_constr(2), - // Closure - true.to_plutus_data(), - ], - ), - ], - ) + ), } } + + wrap_multiple_with_constr( + 0, + vec![ + bound(self.lower_bound, true), + bound(self.upper_bound, false), + ], + ) } } diff --git a/examples/acceptance_tests/run-all-script-contexts b/examples/acceptance_tests/run-all-script-contexts index 757180cc..3318d2a6 100755 --- a/examples/acceptance_tests/run-all-script-contexts +++ b/examples/acceptance_tests/run-all-script-contexts @@ -8,23 +8,22 @@ for lang in $(ls script_context); do title=$(basename $interaction) title="${title%.*}" cd script_context/$lang - ./test.sh $title "$AIKEN" & - TESTS+=("$title,$lang,$!") + echo "running $lang/$title..." + ./test.sh $title "$AIKEN" + TESTS+=("$title,$lang,$?") cd - 1>/dev/null done done for args in ${TESTS[@]}; do - IFS=',' read title lang pid <<< "${args}" - wait $pid - code=("$?") + IFS=',' read title lang code <<< "${args}" log="script_context/$lang/$title.log" if [ $code -ne 0 ]; then - echo "=== $title ❌ (code=$code)" + echo "=== $lang/$title ❌ (code=$code)" cat $log && rm -f $log exit $code else - echo "=== $title ✅" + echo "=== $lang/$title ✅" cat $log && rm -f $log fi echo "" diff --git a/examples/acceptance_tests/script_context/v2/aiken.lock b/examples/acceptance_tests/script_context/v2/aiken.lock index bac0b597..92b95b36 100644 --- a/examples/acceptance_tests/script_context/v2/aiken.lock +++ b/examples/acceptance_tests/script_context/v2/aiken.lock @@ -13,4 +13,4 @@ requirements = [] source = "github" [etags] -"aiken-lang/stdlib@main" = [{ secs_since_epoch = 1723324201, nanos_since_epoch = 743234000 }, "5e58899446492a704d0927a43299139856bef746e697b55895ba34206fa28452"] +"aiken-lang/stdlib@main" = [{ secs_since_epoch = 1723583483, nanos_since_epoch = 18378000 }, "5e58899446492a704d0927a43299139856bef746e697b55895ba34206fa28452"] diff --git a/examples/acceptance_tests/script_context/v2/ctx/withdrawals/tx.cbor.template b/examples/acceptance_tests/script_context/v2/ctx/withdrawals/tx.cbor.template index fedf862b..dca960e7 100644 --- a/examples/acceptance_tests/script_context/v2/ctx/withdrawals/tx.cbor.template +++ b/examples/acceptance_tests/script_context/v2/ctx/withdrawals/tx.cbor.template @@ -1 +1 @@ -84A80081825820000000000000000000000000000000000000000000000000000000000000000000018182581D60111111111111111111111111111111111111111111111111111111111A3B9ACA0002182A05A2581DE022222222222222222222222222222222222222222222222222222222182A581DF0AFDDC16C18E7D8DE379FB9AAD39B3D1B5AFD27603E5EBAC818432A720E0B5820FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0D818258200000000000000000000000000000000000000000000000000000000000000000001082581D60000000000000000000000000000000000000000000000000000000001A3B9ACA001101A20582840000D87980821A000F42401A05F5E100840301D87980821A000F42401A05F5E1000682{{ VALIDATOR }}583D583B010000323232323232322253330054A22930B180080091129998030010A4C26600A6002600E0046660060066010004002AE695CDAAB9F5742AE881F5F6 +84A80081825820000000000000000000000000000000000000000000000000000000000000000000018182581D60111111111111111111111111111111111111111111111111111111111A3B9ACA0002182A05A2581DE022222222222222222222222222222222222222222222222222222222182A581DF0AFDDC16C18E7D8DE379FB9AAD39B3D1B5AFD27603E5EBAC818432A720E0B5820FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0D818258200000000000000000000000000000000000000000000000000000000000000000001082581D60000000000000000000000000000000000000000000000000000000001A3B9ACA001101A20582840000D87980821A000F42401A05F5E100840300D87980821A000F42401A05F5E1000682{{ VALIDATOR }}583D583B010000323232323232322253330054A22930B180080091129998030010A4C26600A6002600E0046660060066010004002AE695CDAAB9F5742AE881F5F6 diff --git a/examples/acceptance_tests/script_context/v2/ctx/withdrawals/tx.diag.template b/examples/acceptance_tests/script_context/v2/ctx/withdrawals/tx.diag.template index 133f5d3f..3086656d 100644 --- a/examples/acceptance_tests/script_context/v2/ctx/withdrawals/tx.diag.template +++ b/examples/acceptance_tests/script_context/v2/ctx/withdrawals/tx.diag.template @@ -29,7 +29,7 @@ { 5: [ [0, 0, 121([]), [1000000, 100000000]] - , [3, 1, 121([]), [1000000, 100000000]] + , [3, 0, 121([]), [1000000, 100000000]] ] , 6: [ {{ VALIDATOR }}, h'583b010000323232323232322253330054a22930b180080091129998030010a4c26600a6002600e0046660060066010004002ae695cdaab9f5742ae881' ] diff --git a/examples/acceptance_tests/script_context/v2/plutus.json b/examples/acceptance_tests/script_context/v2/plutus.json index 81fdcbfc..6dae6d6e 100644 --- a/examples/acceptance_tests/script_context/v2/plutus.json +++ b/examples/acceptance_tests/script_context/v2/plutus.json @@ -6,7 +6,7 @@ "plutusVersion": "v2", "compiler": { "name": "Aiken", - "version": "v1.0.31-alpha+81c0152" + "version": "v1.0.31-alpha+fe5c565" }, "license": "Apache-2.0" }, @@ -25,8 +25,8 @@ "$ref": "#/definitions/Void" } }, - "compiledCode": "5903280100003232323232323223232232253330073253330083330083375e601a601c601c601c601c601c601c601c601c601c601c601c60146ea8c004c028dd5001260126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff004a09444c94ccc024c94ccc028cdc3a400460166ea80044c94ccc02ccdd7980218069baa0014c0126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff0013009375a6006601a6ea8004528180798061baa001163001300b375400626464a6660166464a6660200022c2a6660206026002264a66601c66ebcc018c040dd50009ba6300448202a35ae41c54ccc038cdd7980398081baa30073010375400298122d8799f581c11111111111111111111111111111111111111111111111111111111ff001533300e533300e300c300f3754600c60206ea8c01cc040dd50008a5014a22a66601c66ebcc00cc040dd5000a60103d879800013375e600a60206ea800530103d87a800014a029405280a5030120011637586002601c6ea8c014c038dd50031180898091809000899baf3002300d37546008601a6ea8014dd31800a40a8294094ccc02cc02400452f5bded8c0264646600200297adef6c6022533301100113301233760981014000374c00697adef6c60132323232533301233720910100002133016337609801014000374c00e00a2a66602466e3d22100002133016337609801014000374c00e00626602c66ec0dd48011ba600133006006003375660260066eb8c044008c054008c04c004c8cc0040052f5bded8c044a66602000226602266ec13001014000375000697adef6c60132323232533301133720910100002133015337609801014000375000e00a2a66602266e3d22100002133015337609801014000375000e00626602a66ec0dd48011ba800133006006003375a60240066eb8c040008c050008c0480048c03cc040c040c0400045281180718078008a502300d00114984d9594ccc014c00cc018dd50008a99980418039baa001149858594ccc00cc004c010dd50010a99980318029baa00214985858dc3a4000ae6955ceaab9e5573eae815d0aba201", - "hash": "759c4c40f04fe27a816fbe04c522ac00c710762e979ebe09ed276362" + "compiledCode": "5903fb01000032323232323232323232322533333300c00115332330053001300737540042a66601260106ea8008494cccccc03800454ccc018c008c020dd50008a99980518049baa0011253330073253330083330083375e601c601e601e601e601e601e601e601e601e601e601e601e60166ea8c004c02cdd500126126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff004a09444c94ccc024c94ccc028cdc3a400460186ea80044c94ccc02ccdd7980218071baa0014c0126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff0013007375a6006601c6ea8004528180818069baa001153300b4911c73637269707420707572706f73652069736e277420275370656e642700163001300c375400626464a6660166464a6660220022a6601c92011c756e6578706563746564206e756d626572206f66206f7574707574730016153330113014001132533300e3375e600c60226ea8004dd318022410151ad720e2a66601c66ebcc01cc044dd5180398089baa0014c0122d8799f581c11111111111111111111111111111111111111111111111111111111ff001533300e533300e300a30103754600c60226ea8c01cc044dd50008a5014a22a66601c66ebcc00cc044dd5000a60103d879800013375e600a60226ea800530103d87a800014a029405280a503013001153300e4911c756e6578706563746564206e756d626572206f66206f757470757473001637586002601e6ea8c014c03cdd50031180918099809800899baf3002300e37546008601c6ea8014dd31800a40a8294094ccc02cc01c00452f5bded8c0264646600200297adef6c6022533301200113301333760981014000374c00697adef6c60132323232533301233720910100002133017337609801014000374c00e00a2a66602466e3d22100002133017337609801014000374c00e00626602e66ec0dd48011ba600133006006003375660280066eb8c048008c058008c050004c8cc0040052f5bded8c044a66602200226602466ec13001014000375000697adef6c60132323232533301133720910100002133016337609801014000375000e00a2a66602266e3d22100002133016337609801014000375000e00626602c66ec0dd48011ba800133006006003375a60260066eb8c044008c054008c04c0048c040c044c044c0440045281180798080008a502300e001149854cc0212411856616c696461746f722072657475726e65642066616c73650013656004004004004004004004370e90000018018018018018a99801a4810f5f72656465656d65723a20566f6964001615330024910c5f646174756d3a20566f696400165734ae7155ceaab9e5573eae815d0aba257481", + "hash": "1c6c13a9a56cbcb9ed18c312c9e9e9996b0545b7230b7cf81cbe012d" }, { "title": "deploy.spend", @@ -42,8 +42,8 @@ "$ref": "#/definitions/Data" } }, - "compiledCode": "5902520100003232323232323232222533300453330043375e00698103d879800013253330053323223253330093370e900018051baa001132533300a3370e900018059baa001132533300e001161325333333013001161616132533301030130031533300d3375e980106d8799f182aff0000413370e600e00c90020a5016375a0022c602000260186ea800458c038c02cdd50008b1919198008008019129998070008a6103d87a8000132323232533300f3372200e0042a66601e66e3c01c0084cdd2a40006602600297ae014c0103d87a80001330060060033010003375c601c004602400460200026e50dd9a6106d8799f182aff00300100122533300a0011480004cdc02400466004004601a0026eacc028c02cc02cc02cc02cc02cc02cc02cc02cc02cc02cc01cdd5180098039baa00213232533300a00116132533300b00116132533300932533300a3375e600a60186ea800530126d87a9f5820fcaa61fb85676101d9e3398a484674e71c45c3fd41b492682f3b0054f4cf3273ff0013375e601e60206020602060186ea800530122d8799f581ce37db487fbd58c45d059bcbf5cd6b1604d3bec16cf888f1395a4ebc4ff0014a0601c0062a66601266ebcc038c03cc02cdd5180298059baa0014c012ad8799fd8799fd8799f581c66666666666666666666666666666666666666666666666666666666ffffff00153330093370e900218051baa3004300b37540022944585280a50300d001300d0013758600260106ea8c008c020dd500191805980618060008a502300a00114a029309b2b2b9a5573aaae7955cfaba05742ae895d201", - "hash": "d593ff2c1db29ce9a9a392280895f03d00705203dc4a0ea15870a0b1" + "compiledCode": "59039801000032323232323232323232222533300553330053375e00698103d8798000132533300633232232533300a3370e900018061baa00113253333330130011533300b3370e900018069baa001132533301000100b132533333301500100c00c00c132533301230150031533300e3375e980106d8799f182aff0000413370e600e00c90020a5000d375a0020186024002601c6ea8004028028028028028c040c034dd50008a99805a495865787065637420536f6d6528646174756d29203d0a20202020646963742e67657428646174756d732c20626c616b6532625f323536286275696c74696e2e73657269616c6973655f64617461286d795f646174756d292929001632323300100100322533301000114c0103d87a800013232323253330103372200e0042a66602066e3c01c0084cdd2a40006602a00297ae014c0103d87a80001330060060033012003375c6020004602800460240026e50dd9a6106d8799f182aff00300100122533300c0011480004cdc02400466004004601e0026eacc030c034c034c034c034c034c034c034c034c034c034c024dd5180098049baa00213232533300c00115330094901316578706563746564207472616e73616374696f6e20746f206861766520286174206c65617374292032206f7574707574730016132533300d001153300a4901316578706563746564207472616e73616374696f6e20746f206861766520286174206c65617374292032206f7574707574730016132533300a32533300b3375e600a601c6ea800530126d87a9f5820fcaa61fb85676101d9e3398a484674e71c45c3fd41b492682f3b0054f4cf3273ff0013375e6022602460246024601c6ea800530122d8799f581ce37db487fbd58c45d059bcbf5cd6b1604d3bec16cf888f1395a4ebc4ff0014a060200062a66601466ebcc040c044c034dd5180298069baa0014c012ad8799fd8799fd8799f581c66666666666666666666666666666666666666666666666666666666ffffff001533300a3370e900218061baa3004300d3754002294454cc02d24115657870656374656420696e6c696e6520646174756d001614a02940c03c004c03c004dd6180098051baa3002300a37540064601a601c601c00229408c0300045280a4c2a6600c92011856616c696461746f722072657475726e65642066616c73650013656153300249011d65787065637420646174756d3a204d79446174756d203d20646174756d00165734ae7155ceaab9e5573eae815d0aba257481", + "hash": "66a5272eb58aed0097083185588ef1e8b3888a3bc2e03c061f09c898" }, { "title": "mint.mint", @@ -53,8 +53,8 @@ "$ref": "#/definitions/Data" } }, - "compiledCode": "590300010000323232323232322253330033232323232533233009323232533300f3012002132533300d3005300e3754002266e3c008dd7180918079baa001163008300e37540142c6eb8c040004cc004004cc010c00cdd5980298061baa3007300c37540109110022533300e00114bd70099807980618080009980100118088008a999191980599912999806980298071baa002132533300e3005300f37540022c266e1cdd6980998081baa001483c850c8cc004004c94ccc03cc018c040dd50008a5eb7bdb1804dd5980a18089baa00132323300100130093756601660246ea8010894ccc0500045300103d87a800013232323253330153372200e0042a66602a66e3c01c0084c02ccc064dd3000a5eb80530103d87a80001330060060033756602c0066eb8c050008c060008c058004dd7180998081baa00322533301200114c103d87a800013232323253330133372291103666f6f00002153330133371e910103666f6f000021300933017375000297ae014c0103d87a8000133006006003375a60280066eb8c048008c058008c05000458c01cc034dd5004980418069baa009132323232533300f3007301037540022a66601e66ebc038c044c8cdd8180a800980a980b0009bac3014301137540022600c60046eacc010c044dd5180618089baa00d14a02c64660020026eacc010c044dd5180618089baa00d22533301300114c103d87a80001323253330123375e6026004601c60286ea80404c020cc058dd39980b18098011980b180a00125eb812f5c0266008008002602e004602a002600200244a66602200229000099b8048008cc008008c0500048c044c048c048c048c048c048c048c048c048c048004dd2a40006e1d200214a06e1d200014a046600400291010022323300100100322533300d00114bd6f7b630099191919299980719b910070021533300e3371e00e0042006200a26602466ec0dd48011ba6001330060060033756601e0066eb8c034008c044008c03c0048c02cc030c030c030c0300048c028c02c0048c024004526136565734aae7555cf2ab9f5740ae855d101", - "hash": "f557530d177449d0609a60cbe4f48b221c04a6ca7f9f235fcdc8c741" + "compiledCode": "590496010000323232323232323232225333004323232323253323300a3232533301000100b13253330113014002132533300e300530103754002266e3c008dd7180a18089baa001153300f49124657870656374204d696e7428706f6c6963795f696429203d206374782e707572706f736500163008301037540140186eb8c048004cc004004cc010c00cdd5980298071baa3007300e375401091010022533301000114bd70099808980718090009980100118098008a999191980619912999807180298081baa002132533300f3005301137540022a6602092010f746f6b656e206e6f7420666f756e64001613370e6eb4c054c048dd5000a41e428646600200264a666020600c60246ea800452f5bded8c026eacc058c04cdd500099191980080098049bab300b3014375400844a66602c002298103d87a800013232323253330163372200e0042a66602c66e3c01c0084c02ccc06cdd3000a5eb80530103d87a8000133006006003375660300066eb8c058008c068008c060004dd7180a98091baa00322533301400114c103d87a800013232323253330143372291103666f6f00002153330143371e910103666f6f000021300933019375000297ae014c0103d87a8000133006006003375a602c0066eb8c050008c060008c05800454cc03d24120657870656374204d696e7428706f6c6963795f696429203d20707572706f736500163007300f37540126010601e6ea80244c8c8c8c94ccc040c01cc048dd50008a99980819baf00e30133233760602e002602e60300026eb0c058c04cdd50008980318011bab300430133754601860266ea80345280a99808a496b65787065637420536f6d652850616972285f2c2072656465656d65722929203d0a202020206c6973742e66696e64286374782e7472616e73616374696f6e2e72656465656d6572732c20666e286b7629207b206b762e317374203d3d206374782e707572706f7365207d29001632330010013756600860266ea8c030c04cdd500691299980a8008a6103d87a80001323253330133375e602a004601c602c6ea80404c020cc060dd39980c180a8011980c180b00125eb812f5c02660080080026032004602e002600200244a66602600229000099b8048008cc008008c0580048c04cc050c050c050c050c050c050c050c050c050004dd2a40006e1d200214a06e1d200014a046600400291010022323300100100322533300f00114bd6f7b630099191919299980799b910070021533300f3371e00e0042006200a26602866ec0dd48011ba600133006006003375660220066eb8c03c008c04c008c0440048c034c038c038c038c0380048c030c0340048c02c00452615330054911856616c696461746f722072657475726e65642066616c736500136561533002490189657870656374205b6d795f706f6c6963795f69645d203d0a202020206374782e7472616e73616374696f6e2e6d696e740a2020202020207c3e2076616c75652e66726f6d5f6d696e7465645f76616c75650a2020202020207c3e2076616c75652e776974686f75745f6c6f76656c6163650a2020202020207c3e2076616c75652e706f6c696369657300165734ae7155ceaab9e5573eae815d0aba21", + "hash": "8372367de2b0391b1bec0489dc72cb65de1a791f4e9712b9149d6392" }, { "title": "withdrawals.spend", @@ -70,8 +70,8 @@ "$ref": "#/definitions/Void" } }, - "compiledCode": "5902300100003232323232323223223225333006323232533300932533300a3370e900118059baa0011613370e6eb4c030c8cdd81808000980818088009bac300f300c3754002902a198009bab3002300b3754600660166ea80108cdd79805800a6126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff001533300932533300a3370e900118059baa0011613370e6eb4c030c8cdd81808000980818088009bac300f300c3754002900e198009bab3002300b3754600660166ea80108cdd79805800a60126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff0013375e6e9cc8cc004004dd5980198061baa3004300c375400a44a66601c002297ae013300f300c3010001330020023011001374e6601a98126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff003300d4c126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff004bd700a5014a044646600200200644a66601e002298103d87a800013232533300e300500213374a9000198091ba733012300f0023301230100024bd7025eb804cc010010004c04c008c0440048c034c038c038c038c038c038c0380048c0300045261365653330043370e900018029baa00115333007300637540022930b0b299980119b8748000c00cdd50008a99980298021baa001149858595cd2ab9d5573caae7d5d02ba157441", - "hash": "06f1f9df4be68a65cd55a921e3e7ec1eb4104906c53e0e564c726faa" + "compiledCode": "5902de01000032323232323232323232322533333300c001153330043370e900018031baa001153330083007375400224a66666601a0022a66600a66e1d2000300737540022a66601260106ea8004494ccc018c8c8c94ccc024c94ccc028cdc3a400460186ea800454cc02d2411c616c6963652773207769746864726177616c206e6f7420666f756e64001613370e6eb4c034c8cdd81808800980898090009bac3010300d3754002902a198009bab3002300c3754600660186ea80108cdd79806000a6126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff001533300932533300a3370e900118061baa001153300b49011a626f622773207769746864726177616c206e6f7420666f756e64001613370e6eb4c034c8cdd81808800980898090009bac3010300d3754002900e198009bab3002300c3754600660186ea80108cdd79806000a6126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff0013375e6e9cc8cc004004dd5980198069baa3004300d375400a44a66601e002297ae0133010300d3011001330020023012001374e6601c98126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff003300e4c126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff004bd700a5014a044646600200200644a666020002298103d87a800013232533300e300500213374a9000198099ba73301330100023301330110024bd7025eb804cc010010004c050008c0480048c038c03cc03cc03cc03cc03cc03c0048c03400452615330074911856616c696461746f722072657475726e65642066616c73650013656003003003003003003003003003003003003153300349010f5f72656465656d65723a20566f6964001615330024910c5f646174756d3a20566f696400165734ae7155ceaab9e5573eae815d0aba257481", + "hash": "4f44caf93e36ee884b6d03b1e1c93bf8cda516fd39f7113823508571" } ], "definitions": { diff --git a/examples/acceptance_tests/script_context/v2/test.sh b/examples/acceptance_tests/script_context/v2/test.sh index 95b7053e..43fb59c8 100755 --- a/examples/acceptance_tests/script_context/v2/test.sh +++ b/examples/acceptance_tests/script_context/v2/test.sh @@ -26,7 +26,7 @@ then exit 1 fi -$AIKEN build 2>/dev/null +$AIKEN build --filter-traces all -t verbose if [ $? -ne 0 ]; then exit $? fi @@ -41,4 +41,7 @@ cp ctx/$TITLE/inputs.cbor.template ctx/$TITLE/inputs.cbor sed "s/{{ VALIDATOR_HASH }}/$VALIDATOR_HASH/" ctx/$TITLE/outputs.cbor.template > ctx/$TITLE/outputs.cbor sed "s/{{ VALIDATOR }}/$VALIDATOR/" ctx/$TITLE/tx.cbor.template | sed "s/{{ VALIDATOR_HASH }}/$VALIDATOR_HASH/" > ctx/$TITLE/tx.cbor -$AIKEN tx simulate 1>$TITLE.log 2>&1 ctx/$TITLE/tx.cbor ctx/$TITLE/inputs.cbor ctx/$TITLE/outputs.cbor +$AIKEN tx simulate 1>$TITLE.log 2>&1 \ + ctx/$TITLE/tx.cbor \ + ctx/$TITLE/inputs.cbor \ + ctx/$TITLE/outputs.cbor diff --git a/examples/acceptance_tests/script_context/v2/validators/withdrawals.ak b/examples/acceptance_tests/script_context/v2/validators/withdrawals.ak index c2931005..a307f114 100644 --- a/examples/acceptance_tests/script_context/v2/validators/withdrawals.ak +++ b/examples/acceptance_tests/script_context/v2/validators/withdrawals.ak @@ -31,7 +31,7 @@ validator { None -> fail @"bob's withdrawal not found" Some(value) -> value.2nd == 14 }, - list.map(ctx.transaction.withdrawals, fn(kv) { kv.1st }) == [alice, bob], + list.map(ctx.transaction.withdrawals, fn(kv) { kv.1st }) == [bob, alice], } } } diff --git a/examples/acceptance_tests/script_context/v3/README.md b/examples/acceptance_tests/script_context/v3/README.md index 49eea575..802979f6 100644 --- a/examples/acceptance_tests/script_context/v3/README.md +++ b/examples/acceptance_tests/script_context/v3/README.md @@ -44,7 +44,7 @@ for convenience. The test still assumes a few things. For any - Purpose - [x] spend - [x] mint - - [ ] withdraw + - [x] withdraw - [x] publish - [x] voting - [x] proposing @@ -79,11 +79,11 @@ for convenience. The test still assumes a few things. For any - [x] Retire CC - withdrawals - [x] none - - [ ] some - - [ ] validity range + - [x] some + - [x] validity range - extra signatories - [x] none - - [ ] some + - [x] some - [x] redeemers - [x] datums - votes @@ -102,10 +102,10 @@ for convenience. The test still assumes a few things. For any - Address - [x] type-0 (key | key) - [x] type-1 (script | key) - - [ ] type-2 (key | script) - - [ ] type-3 (script | script) - - [ ] type-4 (key | ptr) - - [ ] type-5 (script | ptr) + - [x] type-2 (key | script) + - [x] type-3 (script | script) + - [x] type-4 (key | ptr) + - [x] type-5 (script | ptr) - [x] type-6 (key | ø) - [x] type-7 (key | ø) @@ -205,5 +205,5 @@ for convenience. The test still assumes a few things. For any - [x] no confidence - Boundary - - [ ] closed - - [ ] open + - [x] closed + - [x] open diff --git a/examples/acceptance_tests/script_context/v3/aiken.lock b/examples/acceptance_tests/script_context/v3/aiken.lock index ee267ffe..c90f4933 100644 --- a/examples/acceptance_tests/script_context/v3/aiken.lock +++ b/examples/acceptance_tests/script_context/v3/aiken.lock @@ -2,15 +2,15 @@ # You typically do not need to edit this file [[requirements]] -name = "logicalmechanism/stdlib" -version = "plutus-v3" +name = "aiken-lang/stdlib" +version = "v2" source = "github" [[packages]] -name = "logicalmechanism/stdlib" -version = "plutus-v3" +name = "aiken-lang/stdlib" +version = "v2" requirements = [] source = "github" [etags] -"logicalmechanism/stdlib@plutus-v3" = [{ secs_since_epoch = 1723394635, nanos_since_epoch = 36770000 }, "097396ab7dedd5e38c558f35b2fb34a2d0f058bb0da0635949f5fcbb36f1310e"] +"aiken-lang/stdlib@v2" = [{ secs_since_epoch = 1723583491, nanos_since_epoch = 208977000 }, "cdbbce58b61deb385e7ea787a2e0fc2dc8fe94db9999e0e6275bc9c70e5796be"] diff --git a/examples/acceptance_tests/script_context/v3/aiken.toml b/examples/acceptance_tests/script_context/v3/aiken.toml index ffa0549f..0a73bc08 100644 --- a/examples/acceptance_tests/script_context/v3/aiken.toml +++ b/examples/acceptance_tests/script_context/v3/aiken.toml @@ -3,9 +3,9 @@ version = "0.0.0" compiler = "v1.0.31-alpha" plutus = "v3" license = "Apache-2.0" -description = "Aiken contracts for project 'script_context/v3'" +description = "End-to-end testing of standard lib script context, for Plutus v3" [[dependencies]] -name = "logicalmechanism/stdlib" -version = "plutus-v3" +name = "aiken-lang/stdlib" +version = "v2" source = "github" diff --git a/examples/acceptance_tests/script_context/v3/ctx/withdraw/resolved_inputs.template b/examples/acceptance_tests/script_context/v3/ctx/withdraw/resolved_inputs.template new file mode 100644 index 00000000..6516f2d1 --- /dev/null +++ b/examples/acceptance_tests/script_context/v3/ctx/withdraw/resolved_inputs.template @@ -0,0 +1,7 @@ +[ + { 0: h'30{{ withdraw.spend.hash }}{{ withdraw.spend.hash }}' + , 1: 1000000 + , 2: [1, 24(h'd87980')] + , 3: 24(h'8203{{ withdraw.spend.cbor }}') + } +] diff --git a/examples/acceptance_tests/script_context/v3/ctx/withdraw/tx.template b/examples/acceptance_tests/script_context/v3/ctx/withdraw/tx.template new file mode 100644 index 00000000..2d6f7c3e --- /dev/null +++ b/examples/acceptance_tests/script_context/v3/ctx/withdraw/tx.template @@ -0,0 +1,42 @@ +[ + { 0: + [ [h'0000000000000000000000000000000000000000000000000000000000000000', 0] + ] + + , 1: + [ { 0: h'200000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111' + , 1: 1000000 + } + + , { 0: h'40000000000000000000000000000000000000000000000000000000008198bd431b03' + , 1: 1000000 + } + + , { 0: h'50111111111111111111111111111111111111111111111111111111118198bd431b03' + , 1: 1000000 + } + ] + + , 2: 42 + + , 3: 4492801 + + , 5: + { h'E000000000000000000000000000000000000000000000000000000000': 14 + , h'F0{{ withdraw.withdraw.hash }}': 0 + } + + , 14: + [ h'00000000000000000000000000000000000000000000000000000000' + ] + }, + + { 5: [ [0, 0, 122([121([])]), [1000000, 100000000]] + , [3, 0, 121([]), [1000000, 100000000]] + ] + }, + + true, + + null +] diff --git a/examples/acceptance_tests/script_context/v3/plutus.json b/examples/acceptance_tests/script_context/v3/plutus.json index e186715d..53e4b874 100644 --- a/examples/acceptance_tests/script_context/v3/plutus.json +++ b/examples/acceptance_tests/script_context/v3/plutus.json @@ -1,12 +1,12 @@ { "preamble": { "title": "script_context/v3", - "description": "Aiken contracts for project 'script_context/v3'", + "description": "End-to-end testing of standard lib script context, for Plutus v3", "version": "0.0.0", "plutusVersion": "v3", "compiler": { "name": "Aiken", - "version": "v1.0.31-alpha+bfc93bf" + "version": "v1.0.31-alpha+fe5c565" }, "license": "Apache-2.0" }, @@ -27,11 +27,11 @@ "redeemer": { "title": "_tmp2", "schema": { - "$ref": "#/definitions/Void" + "$ref": "#/definitions/Data" } }, - "compiledCode": "5910180101003232323232323232323232322533333300d00115332330063001300837540042a66601460126ea8008494ccc01cc8c8c8c8c8c8c8c8c8c8c928a99980899baf374c6602c66ec1301225820923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec004c0103d87980004bd6f7b630180b980c180c180c180c180c180c180c180c180c180c180a1baa3008301437540162930a9980924937657870656374205b5061697228766f69645f686173682c20766f6964295d203d3d20646963742e746f5f706169727328646174756d7329001653330103375e6e9ccc054c014cc055300127d8799f5820000000000000000000000000000000000000000000000000000000000000000000ff0033015300533015300448811c000000000000000000000000000000000000000000000000000000000033015374c6006904044bd1980aa60103d8798000330154c103d87a80004bd7025eb812f5c0602c602e60266ea8c01cc04cdd50050a4c2a66022921ff6578706563740a202020205b0a202020202020496e707574207b0a20202020202020206f75747075745f7265666572656e63653a204f75747075745265666572656e6365207b0a202020202020202020207472616e73616374696f6e5f69643a206e756c6c33322c0a202020202020202020206f75747075745f696e6465783a20302c0a20202020202020207d2c0a20202020202020206f75747075743a204f7574707574207b0a20202020202020202020616464726573733a2063726564656e7469616c2e66726f6d5f766572696669636174696f6e5f6b6579286e756c6c3238292c0a2020202020202020202076616c75653a206173736574732e6672776f6d5f6c6f76656c61636528315f3030305f303030292c0a20202020202020202020646174756d3a204e6f446174756d2c0a202020202020202020207265666572656e63655f7363726970743a204e6f6e652c0a20202020202020207d2c0a2020202020207d2c0a202020205d203d3d20696e707574730016533300f3375e6e9ccc050dd39980a1ba9005330144c1064561696b656e00330144c1012d004bd701980a1ba733014375200a66028981084763617264616e6f00330144c10101004bd701980a1ba733014375200e66028981054474756e6100330144c1091b00005af3107a4000004bd7025eb80dd399198008009bab3016301730173017301730133754600e60266ea8028894ccc05400452f5c0264666444646600200200644a66603600220062646603a6e9ccc074dd48031980e980d0009980e980d800a5eb80cc00c00cc07c008c074004dd7180a0009bab30150013300300330190023017001149854cc0412401a86578706563740a202020205b0a202020202020286f746865725f706f6c6963795f69642c202261696b656e222c202d3134292c0a202020202020286f746865725f706f6c6963795f69642c202263617264616e6f222c2031292c0a202020202020286f75725f706f6c6963795f69642c202274756e61222c20313030303030303030303030303030292c0a202020205d203d3d206173736574732e666c617474656e286d696e7429001633232323232323232253330173370e600c00290030a99980b99baf300c3301c300c3301c300b48811c00000000000000000000000000000000000000000000000000000000003301c374c6014904044bd1980e260126d87a9f5820923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ecff003301c4c103d87a80004bd7025eb80cc0100052000153330173375e6018660386018660386600660169111c000000000000000000000000000000000000000000000000000000000048811c00000000000000000000000000000000000000000000000000000000003301c374c666600466660046014904044bd007a4410474756e610048202034a1f8af0b403522010561696b656e0048150cc071300103d87980003301c4c103d87a80004bd7025eb80cc0100052002153330173375e6018660386018660386600660186603866e9520023301c4c011e581c00000000000000000000000000000000000000000000000000000000004bd701980e260103d87a80004bd702451c00000000000000000000000000000000000000000000000000000000003301c374c66660046014904044bd006a450763617264616e6f0048008cc071300103d87980003301c4c122d8799f581c68ad54b3a8124d9fe5caaaf2011a85d72096e696a2fb3d7f86c41717ff004bd7025eb80cc0100052004149854cc0612401ff6578706563740a20202020536f6d65280a2020202020204f7574707574207b0a2020202020202020616464726573733a2063726564656e7469616c2e66726f6d5f736372697074286e756c6c3238290a202020202020202020207c3e2063726564656e7469616c2e776974685f64656c65676174696f6e5f6b6579286e756c6c3238292c0a202020202020202076616c75653a206173736574732e66726f6d5f6c6f76656c61636528315f3030305f303030290a202020202020202020207c3e206173736574732e616464286f746865725f706f6c6963795f69642c202263617264616e6f222c2031292c0a2020202020202020646174756d3a204e6f44619c74756d2c0a20202020202020207265666572656e63655f7363726970743a20536f6d65280a2020202020202020202023223638616435346233613831323464396665356361616166323031316138356437323039366536393661326662336437663836633431373137222c0a2020202020202020292c0a2020202020207d2c0a2020202029203d3d206c6973742e6174286f7574707574732c20322900161533018491ff6578706563740a20202020536f6d65280a2020202020204f7574707574207b0a2020202020202020616464726573733a2063726564656e7469616c2e66726f6d5f766572696669636174696f6e5f6b6579286e756c6c3238290a202020202020202020207c3e2063726564656e7469616c2e776974685f64656c65676174696f6e5f6b6579286e756c6c3238292c0a202020202020202076616c75653a206173736574732e66726f6d5f6c6f76656c61636528315f3030305f303030290a202020202020202020207c3e206173736574732e616464286f75725f706f6c6963795f69642c202274756e61222c20313030303030303030303030303030290a20932020202020202020207c3e206173736574732e616464286f746865725f706f6c6963795f69642c202261696b656e222c203432292c0a2020202020202020646174756d3a204e6f446174756d2c0a20202020202020207265666572656e63655f7363726970743a204e6f6e652c0a2020202020207d2c0a2020202029203d3d206c6973742e6174286f7574707574732c20312900161533018491f56578706563740a20202020536f6d65280a2020202020204f7574707574207b0a2020202020202020616464726573733a2063726564656e7469616c2e66726f6d5f766572696669636174696f6e5f6b6579286e756c6c3238292c0a202020202020202076616c75653a206173736574732e66726f6d5f6c6f76656c61636528315f3030305f303030292c0a2020202020202020646174756d3a20446174756d4861736828766f69645f68617368292c0a20202020202020207265666572656e63655f7363726970743a204e6f6e652c0a2020202020207d2c0a2020202029203d3d206c6973742e6174286f7574707574732c2030290016153301849120657870656374206c6973742e6c656e677468286f75747075747329203d3d2033001622225333019301400110041323233001001006225333020001133021337606ea4018dd3001a5eb7bdb1804c8c8c8c94ccc080cdc800500109981299bb037520146e9801c01454ccc080cdc78050010992999810980e18119baa001133026337606ea402cc09cc090dd50008020802192999810a9998128008a5114a0298103d87a80001301633026374c00297ae03233001001002225333026001133027337606ea402cdd400525eb7bdb1804c8c8c8c94ccc098cdc800780109981599bb0375201e6ea003801454ccc098cdc78078010992999813981118149baa00113302c337606ea4040c0b4c0a8dd5000802080219299981398110008a6103d87a80001301c3302c375000297ae03370000201c26605666ec0dd48011ba800133006006003375a60500066eb8c098008c0a8008c0a00044cc094cdd81ba9002374c0026600c00c0066eacc08800cdd7181000118120011811000991900118058009980f19bb037520046ea00052f5bded8c044601666036601a60326ea8008cc06cc02ccc06cc02ccc06cc02ccc06cdd4800a5eb812f5c097ae04bd701800800911299980c8010a60103d87a800013232533301730120031300c3301c0024bd70099980280280099b8000348004c07400cc06c008c004004894ccc05800452000133700900119801001180c800980080091299980a0008a4c264a66602a00229309919299980999b90375c602a60320086eb8c0540084cc014014cc06000800454cc051241326b65797320696e206173736f63696174697665206c697374206172656e277420696e20617363656e64696e67206f7264657200163019002301700130170013758600e60226ea8c014c044dd50041299980718048008a5eb7bdb1804c8c8cc0040052f5bded8c044a66602a00226602c66ec13001014000374c00697adef6c6013232323253330153372091010000213301a337609801014000374c00e00a2a66602a66e3d2210000213301a337609801014000374c00e00626603466ec0dd48011ba6001330060060033756602e0066eb8c054008c064008c05c004c8cc0040052f5bded8c044a66602800226602a66ec13001014000375000697adef6c60132323232533301433720910100002133019337609801014000375000e00a2a66602866e3d22100002133019337609801014000375000e00626603266ec0dd48011ba800133006006003375a602c0066eb8c050008c060008c0580048c008cc048c008cc048dd4800a5eb80cc04930103d87a80004bd701ba548000c94ccc03c0040244c8c94ccc04400402c54ccc044c0500044c8c94ccc03cc028c044dd5001099299999980c0010a999808180598091baa0021533301430133754004200201e01e01e01e01e01e6eb8c054c048dd500100698088019807801005980980118088009bab3010301130113011301130113011301130113011300d37546002601a6ea80108c040004c94ccc024c010c02cdd500089bae300f300c37540022a6601492120657870656374204d696e74696e6728706f6c6963795f696429203d20696e666f00163001300b37540044601c601e601e0022930a998042491856616c696461746f722072657475726e65642066616c73650013656003370e90000010010010010010a9980224810b5f746d70323a20566f69640016153300349139657870656374205b50616972284d696e74286f746865725f706f6c6963795f6964292c2064617461292c205f5d203d2072656465656d657273001615330024911265787065637420566f6964203d206461746100165734ae7155ceaab9e5573eae815d0aba257481", - "hash": "a6e56bab571e0c73d25e4186338c488eb92ba9290027d2b8d9097aab" + "compiledCode": "590fe001010032323232323232323232322253330053232323232323232323232324a2a66602066ebcdd31980a99bb04c1225820923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec004c0103d87980004bd6f7b630180b180b980b980b980b980b980b980b980b980b980b98099baa3008301337540182930a99808a4937657870656374205b5061697228766f69645f686173682c20766f6964295d203d3d20646963742e746f5f706169727328646174756d73290016533300f3375e6e9ccc050c014cc051300127d8799f5820000000000000000000000000000000000000000000000000000000000000000000ff0033014300533014300448811c000000000000000000000000000000000000000000000000000000000033014374c6006904044bd1980a260103d8798000330144c103d87a80004bd7025eb812f5c0602a602c60246ea8c01cc048dd50058a4c2a66020921ff6578706563740a202020205b0a202020202020496e707574207b0a20202020202020206f75747075745f7265666572656e63653a204f75747075745265666572656e6365207b0a202020202020202020207472616e73616374696f6e5f69643a206e756c6c33322c0a202020202020202020206f75747075745f696e6465783a20302c0a20202020202020207d2c0a20202020202020206f75747075743a204f7574707574207b0a20202020202020202020616464726573733a2063726564656e7469616c2e66726f6d5f766572696669636174696f6e5f6b6579286e756c6c3238292c0a2020202020202020202076616c75653a206173736574732e6672776f6d5f6c6f76656c61636528315f3030305f303030292c0a20202020202020202020646174756d3a204e6f446174756d2c0a202020202020202020207265666572656e63655f7363726970743a204e6f6e652c0a20202020202020207d2c0a2020202020207d2c0a202020205d203d3d20696e707574730016533300e3375e6e9ccc04cdd3998099ba9005330134c1064561696b656e00330134c1012d004bd70198099ba733013375200a66026981084763617264616e6f00330134c10101004bd70198099ba733013375200e66026981054474756e6100330134c1091b00005af3107a4000004bd7025eb80dd399198008009bab3015301630163016301630123754600e60246ea802c894ccc05000452f5c0264666444646600200200644a6660340022006264660386e9ccc070dd48031980e180c8009980e180d000a5eb80cc00c00cc078008c070004dd718098009bab30140013300300330180023016001149854cc03d2401a86578706563740a202020205b0a202020202020286f746865725f706f6c6963795f69642c202261696b656e222c202d3134292c0a202020202020286f746865725f706f6c6963795f69642c202263617264616e6f222c2031292c0a202020202020286f75725f706f6c6963795f69642c202274756e61222c20313030303030303030303030303030292c0a202020205d203d3d206173736574732e666c617474656e286d696e7429001633232323232323232253330163370e600c00290030a99980b19baf300c3301b300c3301b300b48811c00000000000000000000000000000000000000000000000000000000003301b374c6014904044bd1980da60126d87a9f5820923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ecff003301b4c103d87a80004bd7025eb80cc0100052000153330163375e6018660366018660366600660169111c000000000000000000000000000000000000000000000000000000000048811c00000000000000000000000000000000000000000000000000000000003301b374c666600466660046014904044bd007a4410474756e610048202034a1f8af0b403522010561696b656e0048150cc06d300103d87980003301b4c103d87a80004bd7025eb80cc0100052002153330163375e6018660366018660366600660186603666e9520023301b4c011e581c00000000000000000000000000000000000000000000000000000000004bd701980da60103d87a80004bd702451c00000000000000000000000000000000000000000000000000000000003301b374c66660046014904044bd006a450763617264616e6f0048008cc06d300103d87980003301b4c122d8799f581c68ad54b3a8124d9fe5caaaf2011a85d72096e696a2fb3d7f86c41717ff004bd7025eb80cc0100052004149854cc05d2401ff6578706563740a20202020536f6d65280a2020202020204f7574707574207b0a2020202020202020616464726573733a2063726564656e7469616c2e66726f6d5f736372697074286e756c6c3238290a202020202020202020207c3e2063726564656e7469616c2e776974685f64656c65676174696f6e5f6b6579286e756c6c3238292c0a202020202020202076616c75653a206173736574732e66726f6d5f6c6f76656c61636528315f3030305f303030290a202020202020202020207c3e206173736574732e616464286f746865725f706f6c6963795f69642c202263617264616e6f222c2031292c0a2020202020202020646174756d3a204e6f44619c74756d2c0a20202020202020207265666572656e63655f7363726970743a20536f6d65280a2020202020202020202023223638616435346233613831323464396665356361616166323031316138356437323039366536393661326662336437663836633431373137222c0a2020202020202020292c0a2020202020207d2c0a2020202029203d3d206c6973742e6174286f7574707574732c20322900161533017491ff6578706563740a20202020536f6d65280a2020202020204f7574707574207b0a2020202020202020616464726573733a2063726564656e7469616c2e66726f6d5f766572696669636174696f6e5f6b6579286e756c6c3238290a202020202020202020207c3e2063726564656e7469616c2e776974685f64656c65676174696f6e5f6b6579286e756c6c3238292c0a202020202020202076616c75653a206173736574732e66726f6d5f6c6f76656c61636528315f3030305f303030290a202020202020202020207c3e206173736574732e616464286f75725f706f6c6963795f69642c202274756e61222c20313030303030303030303030303030290a20932020202020202020207c3e206173736574732e616464286f746865725f706f6c6963795f69642c202261696b656e222c203432292c0a2020202020202020646174756d3a204e6f446174756d2c0a20202020202020207265666572656e63655f7363726970743a204e6f6e652c0a2020202020207d2c0a2020202029203d3d206c6973742e6174286f7574707574732c20312900161533017491f56578706563740a20202020536f6d65280a2020202020204f7574707574207b0a2020202020202020616464726573733a2063726564656e7469616c2e66726f6d5f766572696669636174696f6e5f6b6579286e756c6c3238292c0a202020202020202076616c75653a206173736574732e66726f6d5f6c6f76656c61636528315f3030305f303030292c0a2020202020202020646174756d3a20446174756d4861736828766f69645f68617368292c0a20202020202020207265666572656e63655f7363726970743a204e6f6e652c0a2020202020207d2c0a2020202029203d3d206c6973742e6174286f7574707574732c2030290016153301749120657870656374206c6973742e6c656e677468286f75747075747329203d3d203300162222533301830120011004132323300100100622533301f001133020337606ea4018dd3001a5eb7bdb1804c8c8c8c94ccc07ccdc800500109981219bb037520146e9801c01454ccc07ccdc78050010992999810180d18111baa001133025337606ea402cc098c08cdd5000802080219299981029998120008a5114a0298103d87a80001301633025374c00297ae03233001001002225333025001133026337606ea402cdd400525eb7bdb1804c8c8c8c94ccc094cdc800780109981519bb0375201e6ea003801454ccc094cdc78078010992999813181018141baa00113302b337606ea4040c0b0c0a4dd5000802080219299981318100008a6103d87a80001301c3302b375000297ae03370000201c26605466ec0dd48011ba800133006006003375a604e0066eb8c094008c0a4008c09c0044cc090cdd81ba9002374c0026600c00c0066eacc08400cdd7180f80118118011810800991900118058009980e99bb037520046ea00052f5bded8c044601666034601a60306ea8008cc068c02ccc068c02ccc068c02ccc068dd4800a5eb812f5c097ae04bd701800800911299980c0010a60103d87a800013232533301630100031300c3301b0024bd70099980280280099b8000348004c07000cc068008c004004894ccc05400452000133700900119801001180c00098008009129998098008a4c264a66602800229309919299980919b90375c602860300086eb8c0500084cc014014cc05c00800454cc04d241326b65797320696e206173736f63696174697665206c697374206172656e277420696e20617363656e64696e67206f7264657200163018002301600130160013758601060206ea8c014c040dd50049299980698038008a5eb7bdb1804c8c8cc0040052f5bded8c044a66602800226602a66ec13001014000374c00697adef6c60132323232533301433720910100002133019337609801014000374c00e00a2a66602866e3d22100002133019337609801014000374c00e00626603266ec0dd48011ba6001330060060033756602c0066eb8c050008c060008c058004c8cc0040052f5bded8c044a66602600226602866ec13001014000375000697adef6c60132323232533301333720910100002133018337609801014000375000e00a2a66602666e3d22100002133018337609801014000375000e00626603066ec0dd48011ba800133006006003375a602a0066eb8c04c008c05c008c0540048c008cc044c008cc044dd4800a5eb80cc04530103d87a80004bd701ba548000c94ccc0380040204c8c94ccc04000402854ccc040c04c0044c8c94ccc038c020c040dd5001099299999980b8010a999807980498089baa0021533301330123754004200201c01c01c01c01c01c6eb8c050c044dd500100618080019807001005180900118080009bab300f301030103010301030103010301030103010300c3754600260186ea80148c03c004c94ccc020c008c028dd500089bae300e300b37540022a6601292120657870656374204d696e74696e6728706f6c6963795f696429203d20696e666f00163002300a37540066e1d20002300c300d300d001149854cc01924011856616c696461746f722072657475726e65642066616c736500136561533003490139657870656374205b50616972284d696e74286f746865725f706f6c6963795f6964292c2064617461292c205f5d203d2072656465656d657273001615330024911265787065637420566f6964203d206461746100165734ae7155ceaab9e5573eae815d0aba257481", + "hash": "28f948cbe411a7132eb0c1b5f65fb141aa65d8d3a948ec35a07dae38" }, { "title": "mint.mint_2", @@ -52,8 +52,8 @@ "$ref": "#/definitions/Void" } }, - "compiledCode": "590c780101003232323232323232323232323232322533333301000115332330093001300b37540042a66601a60186ea8008494ccc028c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c92899299980e980a980f9baa001132533301e3012375a602860426ea800454ccc078cdd7980698109baa0014c122d8799f581c00000000000000000000000000000000000000000000000000000000ff001533301e3375e601860426ea8005300103d87f8000149854cc07d2412e6578706563742070726f6365647572652e676f7665726e616e63655f616374696f6e203d3d204e696365506f6c6c0016153301f4913a6578706563742070726f6365647572652e72657475726e5f61646472657373203d3d20566572696669636174696f6e4b6579286e756c6c323829001601d30233020375400203666018022900819804198058082401c4a66603866ebd30012dd87e9fd87a80d8799fd8799f581c00000000000000000000000000000000000000000000000000000000ffffff00001149854cc0752401996578706563740a202020202020202020204e6577436f6e737469747574696f6e207b0a202020202020202020202020616e636573746f723a204e6f6e652c0a202020202020202020202020636f6e737469747574696f6e3a20436f6e737469747574696f6e207b2067756172647261696c733a20536f6d65286e756c6c323829207d2c0a202020202020202020207d203d3d20616374696f6e0016330073300a00f4803094ccc06ccdd7a6010ed87e9fd87a80d8799fd87a80ffff00001149854cc0712401916578706563740a202020202020202020204e6577436f6e737469747574696f6e207b0a202020202020202020202020616e636573746f723a204e6f6e652c0a202020202020202020202020636f6e737469747574696f6e3a20436f6e737469747574696f6e207b2067756172647261696c733a204e6f6e65207d2c0a202020202020202020207d203d3d20616374696f6e0016330063300900e480288c94ccc06cc04cc074dd50008a99980d99baf3374a90041981026103d87a8000330204c1249fd8799f581c00000000000000000000000000000000000000000000000000000000ffff00330204c126a1d8799f581c00000000000000000000000000000000000000000000000000000000ff1901f400330203021301e375400297ae0002149854cc071241e96578706563740a20202020202020202020436f6e737469747574696f6e616c436f6d6d6974746565207b0a202020202020202020202020616e636573746f723a204e6f6e652c0a202020202020202020202020657669637465645f6d656d626572733a205b566572696669636174696f6e4b6579286e756c6c3238295d2c0a20202020202020202020202061646465645f6d656d626572733a205b5061697228566572696669636174696f6e4b6579286e756c6c3238292c20353030295d2c0a20202020202020202020202071756f72756d2c0a202020202020202020207d203d3d20616374696f6e0016153301c4912865787065637420536f6d652871756f72756d29203d20726174696f6e616c2e6e657728312c2032290016533301a4a0298103d87a80001533301a4a0260186603e60186603e6ea120013301f37509001a5eb812f5c0260186603e60186603e9810101003301f4c10102004bd7025eb80cc014cc0200352008253330193375e98107d87c9fd87a80ff00001149854cc069240130657870656374204e6f436f6e666964656e6365207b20616e636573746f723a204e6f6e65207d203d3d20616374696f6e0016330043300700c4801894ccc060cdc3a400860346ea800454ccc060c040c068dd5180f180f980d9baa0011498048048cc00ccc01802d2004253330173375e98012fd87b9fa1d8799f581c11111111111111111111111111111111111111111111111111111111ff1a000f4240d87a80ff00001149854cc0612401ff6578706563740a2020202020202020202054726561737572795769746864726177616c207b0a20202020202020202020202062656e656669636961726965733a205b0a20202020202020202020202020205061697228566572696669636174696f6e4b6579280a2020202020202020202020202020202023223131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131222c0a2020202020202020202020202020292c0a2020202020202020202020202020315f3030305f303030292c0a2020202020202020202020205d2c0a2020202020202020202020206775617264227261696c733a204e6f6e652c0a202020202020202020207d203d3d20616374696f6e0016330023300500a4800894ccc058cdd7a60135d87a9fd8799fd8799f5820000000000000000000000000000000000000000000000000000000000000000000ffffd8799f0b00ffff00001149854cc05d24019d6578706563740a2020202020202020202048617264466f726b207b0a202020202020202020202020616e636573746f723a20536f6d6528476f7665726e616e6365416374696f6e4964286e756c6c33322c203029292c0a2020202020202020202020206e65775f76657273696f6e3a2050726f746f636f6c56657273696f6e2831312c2030292c0a202020202020202020207d203d3d20616374696f6e001633001330040094800094ccc054cdd7a6010dd87a9fd87a80d8799f0a00ffff00001149854cc05924015b6578706563740a2020202020202020202048617264466f726b207b20616e636573746f723a204e6f6e652c206e65775f76657273696f6e3a2050726f746f636f6c56657273696f6e2831302c203029207d203d3d20616374696f6e0016225333015300d30173754004264a66602c60146eb4c030c064dd50008a99980b19baf300530193754002980122d87a9f581c00000000000000000000000000000000000000000000000000000000ff00130023004301937540022a6602e921316578706563742070726f6365647572652e72657475726e5f61646472657373203d3d20536372697074286e756c6c3238290016015301b3018375400402646032603460340024603060320026002002444a66602c0042980103d87a8000132325333014300c00313006330190024bd70099980280280099b8000348004c06800cc060008dd2a400064a666024002014264a666026602c00426464a66602266e1d200a3013375400426464a66602666e1d2006375a6032004264646464a66602e60166eb4c07401054ccc05ccdd780126122d87a9f581c00000000000000000000000000000000000000000000000000000000ff00153330173370e9002180c9baa0011533333301f00715333017300f3019375400e2a66603660346ea801c52601401401401401401415330184901346578706563742054726561737572795769746864726177616c207b202e2e207d203d20676f7665726e616e63655f616374696f6e00161533018491276578706563742072657475726e5f61646472657373203d3d20536372697074286e756c6c323829001615330184911b657870656374206465706f736974203d3d20325f3030305f3030300016301c301d002301b001301b0013016375400201e6030603200260286ea8008034c04c008c04400402cc050004dd59809980a180a180a180a180a180a180a180a180a18081baa3003301037540086e1d208092f401375860226024602460246024602460246024602460246024602460246024601c6ea8c004c038dd5001118088008a4c2a660169211856616c696461746f722072657475726e65642066616c73650013656004370e90000018018018018018a99803a4813f6578706563742054726561737572795769746864726177616c207b2067756172647261696c733a20536f6d65282e2e292c202e2e207d203d20616374696f6e001615330064910b5f746d70313a20566f6964001615330054918d657870656374205b0a20202020506169722850726f706f7365280a202020202020332c0a20202020202050726f706f73616c50726f636564757265207b206465706f7369742c2072657475726e5f616464726573732c20676f7665726e616e63655f616374696f6e207d2c0a20202020292c0a2020202064617461292c0a20205d203d2072656465656d657273001615330044911265787065637420566f6964203d2064617461001615330034912265787065637420536f6d652870726f63656475726529203d2070726f63656475726500161533002491256578706563742070726f6365647572652e6465706f736974203d3d20325f3030305f30303000165734ae7155ceaab9e5573eae815d0aba257481", - "hash": "d872106af67d97ca63c64e40f676cfd2c525877e33af0ff416fc4123" + "compiledCode": "590c9f0101003232323232323232323232323232322533333301000115332330093001300b37540042a66601a60186ea8008494ccc028c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c92899299980e980a980f9baa001132533301e3012375a602860426ea800454ccc078cdd7980698109baa0014c122d8799f581c00000000000000000000000000000000000000000000000000000000ff001533301e3375e601860426ea8005300103d87f8000149854cc07d2412e6578706563742070726f6365647572652e676f7665726e616e63655f616374696f6e203d3d204e696365506f6c6c0016153301f4913a6578706563742070726f6365647572652e72657475726e5f61646472657373203d3d20566572696669636174696f6e4b6579286e756c6c323829001601d30233020375400203666018022900819804198058082401c4a66603866ebd30012dd87e9fd87a80d8799fd8799f581c00000000000000000000000000000000000000000000000000000000ffffff00001149854cc0752401996578706563740a202020202020202020204e6577436f6e737469747574696f6e207b0a202020202020202020202020616e636573746f723a204e6f6e652c0a202020202020202020202020636f6e737469747574696f6e3a20436f6e737469747574696f6e207b2067756172647261696c733a20536f6d65286e756c6c323829207d2c0a202020202020202020207d203d3d20616374696f6e0016330073300a00f4803094ccc06ccdd7a6010ed87e9fd87a80d8799fd87a80ffff00001149854cc0712401916578706563740a202020202020202020204e6577436f6e737469747574696f6e207b0a202020202020202020202020616e636573746f723a204e6f6e652c0a202020202020202020202020636f6e737469747574696f6e3a20436f6e737469747574696f6e207b2067756172647261696c733a204e6f6e65207d2c0a202020202020202020207d203d3d20616374696f6e0016330063300900e480288c94ccc06cc04cc074dd50008a99980d99baf3374a90041981026103d87a8000330204c1249fd8799f581c00000000000000000000000000000000000000000000000000000000ffff00330204c126a1d8799f581c00000000000000000000000000000000000000000000000000000000ff1901f400330203021301e375400297ae0002149854cc071241e96578706563740a20202020202020202020436f6e737469747574696f6e616c436f6d6d6974746565207b0a202020202020202020202020616e636573746f723a204e6f6e652c0a202020202020202020202020657669637465645f6d656d626572733a205b566572696669636174696f6e4b6579286e756c6c3238295d2c0a20202020202020202020202061646465645f6d656d626572733a205b5061697228566572696669636174696f6e4b6579286e756c6c3238292c20353030295d2c0a20202020202020202020202071756f72756d2c0a202020202020202020207d203d3d20616374696f6e0016153301c4912865787065637420536f6d652871756f72756d29203d20726174696f6e616c2e6e657728312c2032290016533301a4a0298103d87a80001533301a4a0260186603e60186603e6ea120013301f37509001a5eb812f5c0260186603e60186603e9810101003301f4c10102004bd7025eb80cc014cc0200352008253330193375e98107d87c9fd87a80ff00001149854cc069240130657870656374204e6f436f6e666964656e6365207b20616e636573746f723a204e6f6e65207d203d3d20616374696f6e0016330043300700c4801894ccc060cdc3a400860346ea800454ccc060c040c068dd5180f180f980d9baa0011498048048cc00ccc01802d2004253330173375e98012fd87b9fa1d8799f581c11111111111111111111111111111111111111111111111111111111ff1a000f4240d87a80ff00001149854cc0612401ff6578706563740a2020202020202020202054726561737572795769746864726177616c207b0a20202020202020202020202062656e656669636961726965733a205b0a202020202020202020202020202050616972280a20202020202020202020202020202020566572696669636174696f6e4b6579280a20202020202020202020202020202020202023223131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131222c0a20202020202020202020202020202020292c0a20202020202020202020202020202020315f3030305f3030302c0a202020202020202020204920202020292c0a2020202020202020202020205d2c0a20202020202020202020202067756172647261696c733a204e6f6e652c0a202020202020202020207d203d3d20616374696f6e0016330023300500a4800894ccc058cdd7a60135d87a9fd8799fd8799f5820000000000000000000000000000000000000000000000000000000000000000000ffffd8799f0b00ffff00001149854cc05d24019d6578706563740a2020202020202020202048617264466f726b207b0a202020202020202020202020616e636573746f723a20536f6d6528476f7665726e616e6365416374696f6e4964286e756c6c33322c203029292c0a2020202020202020202020206e65775f76657273696f6e3a2050726f746f636f6c56657273696f6e2831312c2030292c0a202020202020202020207d203d3d20616374696f6e001633001330040094800094ccc054cdd7a6010dd87a9fd87a80d8799f0a00ffff00001149854cc05924015b6578706563740a2020202020202020202048617264466f726b207b20616e636573746f723a204e6f6e652c206e65775f76657273696f6e3a2050726f746f636f6c56657273696f6e2831302c203029207d203d3d20616374696f6e0016225333015300d30173754004264a66602c60146eb4c030c064dd50008a99980b19baf300530193754002980122d87a9f581c00000000000000000000000000000000000000000000000000000000ff00130023004301937540022a6602e921316578706563742070726f6365647572652e72657475726e5f61646472657373203d3d20536372697074286e756c6c3238290016015301b3018375400402646032603460340024603060320026002002444a66602c0042980103d87a8000132325333014300c00313006330190024bd70099980280280099b8000348004c06800cc060008dd2a400064a666024002014264a666026602c00426464a66602266e1d200a3013375400426464a66602666e1d2006375a6032004264646464a66602e60166eb4c07401054ccc05ccdd780126122d87a9f581c00000000000000000000000000000000000000000000000000000000ff00153330173370e9002180c9baa0011533333301f00715333017300f3019375400e2a66603660346ea801c52601401401401401401415330184901346578706563742054726561737572795769746864726177616c207b202e2e207d203d20676f7665726e616e63655f616374696f6e00161533018491276578706563742072657475726e5f61646472657373203d3d20536372697074286e756c6c323829001615330184911b657870656374206465706f736974203d3d20325f3030305f3030300016301c301d002301b001301b0013016375400201e6030603200260286ea8008034c04c008c04400402cc050004dd59809980a180a180a180a180a180a180a180a180a18081baa3003301037540086e1d208092f401375860226024602460246024602460246024602460246024602460246024601c6ea8c004c038dd5001118088008a4c2a660169211856616c696461746f722072657475726e65642066616c73650013656004370e90000018018018018018a99803a4813f6578706563742054726561737572795769746864726177616c207b2067756172647261696c733a20536f6d65282e2e292c202e2e207d203d20616374696f6e001615330064910b5f746d70313a20566f6964001615330054918d657870656374205b0a20202020506169722850726f706f7365280a202020202020332c0a20202020202050726f706f73616c50726f636564757265207b206465706f7369742c2072657475726e5f616464726573732c20676f7665726e616e63655f616374696f6e207d2c0a20202020292c0a2020202064617461292c0a20205d203d2072656465656d657273001615330044911265787065637420566f6964203d2064617461001615330034912265787065637420536f6d652870726f63656475726529203d2070726f63656475726500161533002491256578706563742070726f6365647572652e6465706f736974203d3d20325f3030305f30303000165734ae7155ceaab9e5573eae815d0aba257481", + "hash": "60f0f27c1b8abf91b947b4eec7a9ae1741cc7065ad778c2bfb4ec44d" }, { "title": "proposing_pparams.guardrails", @@ -80,22 +80,69 @@ "$ref": "#/definitions/Void" } }, - "compiledCode": "59099f010100323232323232323232323232322533333300e00115332330073001300937540042a66601660146ea8008494cccccc04000454ccc020c008c028dd50008a99980618059baa001125333009323232323253330123758600660226ea8c014c044dd50030a9998091bac3014301530113754600a60226ea801854ccc048dd6180a180a980a980a980a980a980a980a980a98089baa30053011375400c2a66601c66e1d2054375a6028602a602a602a60226ea8c014c044dd5003099299980799baf4c101a0003015301630163016301630163016301630163016301630123754600c60246ea801c5288a9980824932657870656374205b5d203d3d20646963742e746f5f7061697273286374782e7472616e73616374696f6e2e646174756d73290016533300e3375e98012fa1d87a9fd8799f5820000000000000000000000000000000000000000000000000000000000000000000ffffd8798000301430153015301530153015301530153015301530113754600a60226ea8018526153300f491e86578706563740a202020205b0a20202020202050616972285370656e64280a20202020202020204f75747075745265666572656e6365207b0a202020202020202020207472616e73616374696f6e5f69643a20232230303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030222c0a202020202020202020206f75747075745f696e6465783a20302c0a20202020202020207d2c0a202020202020292c0a202020202020766f69642829292c0a202020205d203d3d2072656465656d6572730016153300f49120657870656374203432203d3d206374782e7472616e73616374696f6e2e6665650016153300f4912d657870656374205b5d203d206374782e7472616e73616374696f6e2e65787472615f7369676e61746f726965730016153300f4912c657870656374205b5d203d206374782e7472616e73616374696f6e2e7265666572656e63655f696e707574730016153300f49123657870656374205b5d203d206374782e7472616e73616374696f6e2e6f757470757473001632533301200100c132533301330160021323232325333013300d375a603260340042646464646464a66603266e1d2004301b3754603e0042a66466034600260386ea800854ccc068cdc7804245200000000000000000000000000000000000000000000000000000000000000000001533301a3375e6e98010dd3299980d25014bd6f7b6300991919800800a5eb7bdb180894ccc0840044cc088cdd82601014000374c00697adef6c60132323232533302133720910100002133026337609801014000374c00e00a2a66604266e3d22100002133026337609801014000374c00e00626604c66ec0dd48011ba600133006006003375660460066eb8c084008c094008c08c004c8cc0040052f5bded8c044a66604000226604266ec130010140004c01051a3b9aca00004bd6f7b630099191919299981019b90489000021330253376098010140004c01051a3b9aca0000005153330203371e9101000021330253376098010140004c01051a3b9aca0000003133025337606ea4008dd4000998030030019bad3022003375c60400046048004604400226464a6660386006603c6ea8c08800854ccc070c00cc078dd50008a4c03603660426044002603a6ea801854cc06d24013f657870656374207265736f6c7665645f696e7075745f76616c7565203d3d206173736574732e66726f6d5f6c6f76656c6163652831303030303030303030290016153301b491606578706563740a202020207472616e73616374696f6e5f6964203d3d20232230303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030220016370e900100b80b980f180f800980f0011bab301c001301c002301a001301637540060226eb8c060004c050dd5180b801180b180b80098091baa00100d30140013758600860206ea8c010c040dd5002a99980619baf4c0132d87a9fd8799f5820000000000000000000000000000000000000000000000000000000000000000000ffd8799fd87980ffff003001300f37540082930a99806a49cd6578706563740a202020205370656e64696e67280a2020202020204f75747075745265666572656e6365207b0a20202020202020207472616e73616374696f6e5f69643a20232230303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030222c0a20202020202020206f75747075745f696e6465783a20302c0a2020202020207d2c0a202020202020536f6d6528766f69642829292c0a2020202029203d3d20696e666f00162301230133013001533300a3371e910120c6fbd346681a8f8337f6b3e51e6ec973f1509367eabc3a44c849af58a1d8471b00375c602060226022602260226022602260226022602260226022601a6ea8c004c034dd50010a4c2a66016921546578706563740a2020202023226336666264333436363831613866383333376636623365353165366563393733663135303933363765616263336134346338343961663538613164383437316222203d3d206964001623010001149854cc0292411856616c696461746f722072657475726e65642066616c73650013656004004004004004004004370e90000018018018018018a99802a4810b5f746d70323a20566f6964001615330044910b5f746d70313a20566f696400161533003491ff657870656374205b0a20202020496e707574207b0a2020202020206f75747075745f7265666572656e63653a204f75747075745265666572656e6365207b207472616e73616374696f6e5f69642c206f75747075745f696e6465783a2030207d2c0a2020202020206f75747075743a204f7574707574207b0a2020202020202020616464726573732c0a202020202020202076616c75653a207265736f6c7665645f696e7075745f76616c75652c0a2020202020202020646174756d3a20496e6c696e65446174756d285f292c0a20202020202020207265666572656e63655f7363726970743a204e6f6e652c0a2020202020207d2c0a202020207d2c0a200b205d203d20696e7075747300161533002491566578706563742041646472657373207b207061796d656e745f63726564656e7469616c3a20536372697074285f292c207374616b655f63726564656e7469616c3a204e6f6e65207d203d0a202020206164647265737300165734ae7155ceaab9e5573eae815d0aba257481", - "hash": "cef0769e42ca13a9ffcd71a6ed03e3e03adb72f4cdf81bb28137c55a" + "compiledCode": "5909bd010100323232323232323232323232322533333300e00115332330073001300937540042a66601660146ea8008494cccccc04000454ccc020c008c028dd50008a99980618059baa001125333009323232323253330123758600660226ea8c014c044dd50030a9998091bac3014301530113754600a60226ea801854ccc048dd6180a180a980a980a980a980a980a980a980a98089baa30053011375400c2a66601c66e1d2054375a6028602a602a602a60226ea8c014c044dd5003099299980799baf4c101a0003015301630163016301630163016301630163016301630123754600c60246ea801c5288a9980824932657870656374205b5d203d3d20646963742e746f5f7061697273286374782e7472616e73616374696f6e2e646174756d73290016533300e3375e98012fa1d87a9fd8799f5820000000000000000000000000000000000000000000000000000000000000000000ffffd8798000301430153015301530153015301530153015301530113754600a60226ea8018526153300f491ff6578706563740a202020205b0a20202020202050616972280a20202020202020205370656e64280a202020202020202020204f75747075745265666572656e6365207b0a2020202020202020202020207472616e73616374696f6e5f69643a20232230303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030222c0a2020202020202020202020206f75747075745f696e6465783a20302c0a202020202020202020207d2c0a2020202020202020292c0a2020202020202020766f696428292c0a202020202020292c0a202020205d203d3d207265640665656d6572730016153300f49120657870656374203432203d3d206374782e7472616e73616374696f6e2e6665650016153300f4912d657870656374205b5d203d206374782e7472616e73616374696f6e2e65787472615f7369676e61746f726965730016153300f4912c657870656374205b5d203d206374782e7472616e73616374696f6e2e7265666572656e63655f696e707574730016153300f49123657870656374205b5d203d206374782e7472616e73616374696f6e2e6f757470757473001632533301200100c132533301330160021323232325333013300d375a603260340042646464646464a66603266e1d2004301b3754603e0042a66466034600260386ea800854ccc068cdc7804245200000000000000000000000000000000000000000000000000000000000000000001533301a3375e6e98010dd3299980d25014bd6f7b6300991919800800a5eb7bdb180894ccc0840044cc088cdd82601014000374c00697adef6c60132323232533302133720910100002133026337609801014000374c00e00a2a66604266e3d22100002133026337609801014000374c00e00626604c66ec0dd48011ba600133006006003375660460066eb8c084008c094008c08c004c8cc0040052f5bded8c044a66604000226604266ec130010140004c01051a3b9aca00004bd6f7b630099191919299981019b90489000021330253376098010140004c01051a3b9aca0000005153330203371e9101000021330253376098010140004c01051a3b9aca0000003133025337606ea4008dd4000998030030019bad3022003375c60400046048004604400226464a6660386006603c6ea8c08800854ccc070c00cc078dd50008a4c03603660426044002603a6ea801854cc06d24013f657870656374207265736f6c7665645f696e7075745f76616c7565203d3d206173736574732e66726f6d5f6c6f76656c6163652831303030303030303030290016153301b491606578706563740a202020207472616e73616374696f6e5f6964203d3d20232230303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030220016370e900100b80b980f180f800980f0011bab301c001301c002301a001301637540060226eb8c060004c050dd5180b801180b180b80098091baa00100d30140013758600860206ea8c010c040dd5002a99980619baf4c0132d87a9fd8799f5820000000000000000000000000000000000000000000000000000000000000000000ffd8799fd87980ffff003001300f37540082930a99806a49cd6578706563740a202020205370656e64696e67280a2020202020204f75747075745265666572656e6365207b0a20202020202020207472616e73616374696f6e5f69643a20232230303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030222c0a20202020202020206f75747075745f696e6465783a20302c0a2020202020207d2c0a202020202020536f6d6528766f69642829292c0a2020202029203d3d20696e666f00162301230133013001533300a3371e910120c6fbd346681a8f8337f6b3e51e6ec973f1509367eabc3a44c849af58a1d8471b00375c602060226022602260226022602260226022602260226022601a6ea8c004c034dd50010a4c2a66016921546578706563740a2020202023226336666264333436363831613866383333376636623365353165366563393733663135303933363765616263336134346338343961663538613164383437316222203d3d206964001623010001149854cc0292411856616c696461746f722072657475726e65642066616c73650013656004004004004004004004370e90000018018018018018a99802a4810b5f746d70323a20566f6964001615330044910b5f746d70313a20566f696400161533003491ff657870656374205b0a20202020496e707574207b0a2020202020206f75747075745f7265666572656e63653a204f75747075745265666572656e6365207b207472616e73616374696f6e5f69642c206f75747075745f696e6465783a2030207d2c0a2020202020206f75747075743a204f7574707574207b0a2020202020202020616464726573732c0a202020202020202076616c75653a207265736f6c7665645f696e7075745f76616c75652c0a2020202020202020646174756d3a20496e6c696e65446174756d285f292c0a20202020202020207265666572656e63655f7363726970743a204e6f6e652c0a2020202020207d2c0a202020207d2c0a200b205d203d20696e7075747300161533002491566578706563742041646472657373207b207061796d656e745f63726564656e7469616c3a20536372697074285f292c207374616b655f63726564656e7469616c3a204e6f6e65207d203d0a202020206164647265737300165734ae7155ceaab9e5573eae815d0aba257481", + "hash": "795cd91c67f5028dbe15907cdc13c12c9bf9059ed6939e34c2b3db15" }, { "title": "voting.script", "redeemer": { + "title": "_tmp0", + "schema": { + "$ref": "#/definitions/Data" + } + }, + "compiledCode": "590b6501010032323232323232323232323222533300632323232323232533300d3006300f37540022646464a666020601260246ea800854cc8cc044c004c04cdd5180b980a1baa0031533301500200e13253330163019003132323253330153005375a603660380042a66602a600a602e6ea800c54ccc054cdc7800a44120999999999999999999999999999999999999999999999999999999999999999900153330153375e98158d8799f9fd8799fd8799f581c00000000000000000000000000000000000000000000000000000000ffffa1d8799f582099999999999999999999999999999999999999999999999999999999999999991898ffd87980ffff003300a00c480084c94ccc058c03cc060dd50008991919299980c9804980d9baa002153330193009301b3754603e60386ea800854ccc07400405c54ccc064cdd7a61abd8799f9fd87a9fd8799f581c00000000000000000000000000000000000000000000000000000000ffffa3d8799f5820777777777777777777777777777777777777777777777777777777777777777702ffd87b80d8799f5820888888888888888888888888888888888888888888888888888888888888888801ffd87b80d8799f5820999999999999999999999999999999999999999999999999999999999999999900ffd87b80ffff003300e010480184c94ccc068c04cc070dd50008991919299980e99b8748010c07cdd5001099299981100100e8a99980f19b8f0014891c000000000000000000000000000000000000000000000000000000000014a22a6603e9211865787065637420706f6f6c5f6964203d3d206f6e6c7930730016375c604660406ea8008070dd5980f801180e8009919bb030210013021302200137586040603a6ea8004064cc0380412008153301a491ff6578706563740a202020202020536f6d65280a2020202020202020506169722844656c6567617465526570726573656e74617469766528566572696669636174696f6e4b6579286f6e6c79307329292c0a20202020202020205b0a202020202020202020205061697228476f7665726e616e6365416374696f6e4964207b207472616e73616374696f6e3a206f6e6c7937732c2070726f706f73616c5f70726f6365647572653a2032207d2c0a202020202020202020204162737461696e292c0a202020202020202020205061697228476f7665726e616e6365416374696f6e4964207b207472616e73616374696f6e3a206f6e6c7938732c2070726f706fb673616c5f70726f6365647572653a2031207d2c0a202020202020202020204162737461696e292c0a202020202020202020205061697228476f7665726e616e6365416374696f6e4964207b207472616e73616374696f6e3a206f6e6c7939732c2070726f706f73616c5f70726f6365647572653a2030207d2c0a202020202020202020204162737461696e292c0a20202020202020205d292c0a20202020202029203d3d206c6973742e617428766f7465732c20332900160170173756603600460320026466ec0c074004c074c078004dd6180e180c9baa0010143300a00c4801054cc0592401ff6578706563740a202020202020536f6d65280a20202020202020205061697228436f6e737469747574696f6e616c436f6d6d69747465654d656d62657228566572696669636174696f6e4b6579286f6e6c79307329292c0a20202020202020205b0a202020202020202020205061697228476f7665726e616e6365416374696f6e4964207b0a2020202020202020202020207472616e73616374696f6e3a206f6e6c7939732c0a20202020202020202020202070726f706f73616c5f70726f6365647572653a203135322c0a202020202020202020207d2c0a202020202020202020204e6f292c0a20202020202020205d292c0a20202020202029203d3d20116c6973742e617428766f7465732c203129001615330164911c657870656374207472616e73616374696f6e203d3d206f6e6c7939730016012012375c6034002602c6ea8c054008c05400403cc05c008dc3a400401a01a6eacc048008c040004c8cdd8180a000980a180a8009bac301330103754002014660020069000180080091129998088010a60103d87a800013232533300f300800313374a90001980a1ba73301430110023301430120024bd7025eb804ccc014014004c02400cc05400cc04c008dd5980798081808180818081808180818081808180818081808180818061baa300f300c375400866464646464644a66601e64a6666660300042a666020601260246ea80084c94ccc0540040084c94cccccc06800400c00c00c4c94ccc05cc06800c54ccc04ccdc3a40a80022a660286e64cc0180152210014a20080086eb400400cc05c004c04cdd5001000800800800800899299999980c0010a999808180498091baa00215333014301337540042a660226e64cc00d300103d879800048810014a20020020020020020022940526153301049010f6578706563742069735f76616c69640016300100122253332333301800313232323232323300c0020013371491010128000025333014337100069007099b80483c80400c54ccc050cdc4001a410004266e00cdc0241002800690068b299980b800899b8a4881035b5d2900005133714911035b5f2000333300800133714911025d2900005223330090090023006001223330090090020013758602a0046eb4c04c004c8cdd81ba83013001374e60280026ea800c4c94ccc0540044cdc52441027b7d00003133714911037b5f2000323233001001003225333018001100315333018301b0011323330090093017001337149101023a20003330090093018001004301a0011323330090093017001337149101023a20003330090093018001300633003003301c002301a0013371491102207d000033756006264a66602a002266e29221025b5d00003133714911035b5f2000333300600133714911015d000032233300700700230040012233300700700200137580066e292201022c2000133005375a0040022646466e2922010268270000132333001001300b371a00466e292201012700003222533301333710004900008008991919199803003180800299b8b33700004a66602c66e2000920141481805206e3371666e000054ccc058cdc4000a4028290300a40dc00866e18009202033706002901019b8e004002375c0044444646600200200a44a66602a002200a2a66602a6030002266006602e00200a266008602e00266004004603000244646600200200644a66601c600e002266e2922010130000031533300e337100029000099b8a489012d003300200233702900000089980299b8400148050cdc599b803370a002900a240c00066002002444a66601666e2400920001001133300300333708004900a19b8b3370066e14009201448180004c038c03cc02cdd50019b8748000dc0240022930a99803a4811856616c696461746f722072657475726e65642066616c7365001365615330044901ab65787065637420536f6d65280a2020202020205061697228436f6e737469747574696f6e616c436f6d6d69747465654d656d62657228536372697074282e2e29292c0a2020202020205b5061697228476f7665726e616e6365416374696f6e4964207b207472616e73616374696f6e2c2070726f706f73616c5f70726f6365647572653a2031207d2c20596573295d292c0a2020202029203d206c6973742e617428766f7465732c203029001615330034915865787065637420536f6d6528506169722844656c6567617465526570726573656e74617469766528536372697074282e2e29292c205b5f2c202e2e5d2929203d0a2020202020206c6973742e617428766f7465732c203229001615330024914265787065637420536f6d652850616972285374616b65506f6f6c28706f6f6c5f6964292c205b5f2c202e2e5d2929203d206c6973742e617428766f7465732c20342900165734ae7155ceaab9e5573eae815d0aba257481", + "hash": "1282253bfd18df713e867324c09c7cb9c2dea6d11e3fb9c1cfdb7057" + }, + { + "title": "withdraw.spend", + "datum": { "title": "_tmp0", "schema": { "$ref": "#/definitions/Void" } }, - "compiledCode": "5908e2010100323232323232323232323232322533333300e00115332330073001300937540042a66601660146ea8008494ccc020c8c8c8c8c94ccc034c01cc03cdd500089919192999808180518091baa0021533233011300130133754602e60286ea800c54ccc0540080344c94ccc058c06400c4c8c8c94ccc054c014dd6980d980e0010a99980a9802980b9baa003153330153371e002910120999999999999999999999999999999999999999999999999999999999999999900153330153375e98158d8799f9fd8799fd8799f581c00000000000000000000000000000000000000000000000000000000ffffa1d8799f582099999999999999999999999999999999999999999999999999999999999999991898ffd87980ffff003300a00c480084c94ccc058c040c060dd50008991919299980c9804980d9baa002153330193009301b3754603e60386ea800854ccc07400405854ccc064cdd7a61abd8799f9fd87a9fd8799f581c00000000000000000000000000000000000000000000000000000000ffffa3d8799f5820777777777777777777777777777777777777777777777777777777777777777702ffd87b80d8799f5820888888888888888888888888888888888888888888888888888888888888888801ffd87b80d8799f5820999999999999999999999999999999999999999999999999999999999999999900ffd87b80ffff003300e010480184c94ccc068c050c070dd50008991919299980e99b8748010c07cdd5001099299981100100e0a99980f19b8f0014891c000000000000000000000000000000000000000000000000000000000014a22a6603e9211865787065637420706f6f6c5f6964203d3d206f6e6c7930730016375c604660406ea800806cdd5980f801180e8009919bb030210013021302200137586040603a6ea8004060cc0380412008153301a491ff6578706563740a202020202020536f6d65280a2020202020202020506169722844656c6567617465526570726573656e74617469766528566572696669636174696f6e4b6579286f6e6c79307329292c0a20202020202020205b0a202020202020202020205061697228476f7665726e616e6365416374696f6e4964207b207472616e73616374696f6e3a206f6e6c7937732c2070726f706f73616c5f70726f6365647572653a2032207d2c0a202020202020202020204162737461696e292c0a202020202020202020205061697228476f7665726e616e6365416374696f6e4964207b207472616e73616374696f6e3a206f6e6c7938732c2070726f706fb673616c5f70726f6365647572653a2031207d2c0a202020202020202020204162737461696e292c0a202020202020202020205061697228476f7665726e616e6365416374696f6e4964207b207472616e73616374696f6e3a206f6e6c7939732c2070726f706f73616c5f70726f6365647572653a2030207d2c0a202020202020202020204162737461696e292c0a20202020202020205d292c0a20202020202029203d3d206c6973742e617428766f7465732c20332900160160163756603600460320026466ec0c074004c074c078004dd6180e180c9baa0010133300a00c4801054cc0592401ff6578706563740a202020202020536f6d65280a20202020202020205061697228436f6e737469747574696f6e616c436f6d6d69747465654d656d62657228566572696669636174696f6e4b6579286f6e6c79307329292c0a20202020202020205b0a202020202020202020205061697228476f7665726e616e6365416374696f6e4964207b0a2020202020202020202020207472616e73616374696f6e3a206f6e6c7939732c0a20202020202020202020202070726f706f73616c5f70726f6365647572653a203135322c0a202020202020202020207d2c0a202020202020202020204e6f292c0a20202020202020205d292c0a20202020202029203d3d20116c6973742e617428766f7465732c203129001615330164911c657870656374207472616e73616374696f6e203d3d206f6e6c7939730016011011375c6034002602c6ea8c054008c054004038c05c008dc3a40040180186eacc048008c040004c8cdd8180a000980a180a8009bac301330103754002012660020069000180080091129998088010a60103d87a800013232533300f300900313374a90001980a1ba73301430110023301430120024bd7025eb804ccc014014004cdc0001a4002602a00660260046eacc03cc040c040c040c040c040c040c040c040c040c040c040c040c030dd5180798061baa0023253330093253333330120021533300a3004300c3754004264a66601e002004264a666666028002006006006264a66602260280062a66601a66e1d205400114a20080086eb400400cc044004c034dd500100080080080080089929999998090010a999805180218061baa0021533300e300d375400429440040040040040040045280a4c2a660149210f6578706563742069735f76616c69640016300e300f300b37540022930a99804a491856616c696461746f722072657475726e65642066616c73650013656006370e90000028028028028028a99802a481ab65787065637420536f6d65280a2020202020205061697228436f6e737469747574696f6e616c436f6d6d69747465654d656d62657228536372697074282e2e29292c0a2020202020205b5061697228476f7665726e616e6365416374696f6e4964207b207472616e73616374696f6e2c2070726f706f73616c5f70726f6365647572653a2031207d2c20596573295d292c0a2020202029203d206c6973742e617428766f7465732c203029001615330044915865787065637420536f6d6528506169722844656c6567617465526570726573656e74617469766528536372697074282e2e29292c205b5f2c202e2e5d2929203d0a2020202020206c6973742e617428766f7465732c203229001615330034914265787065637420536f6d652850616972285374616b65506f6f6c28706f6f6c5f6964292c205b5f2c202e2e5d2929203d206c6973742e617428766f7465732c203429001615330024910b5f746d70303a20566f696400165734ae7155ceaab9e5573eae815d0aba257481", - "hash": "849324b02de5c5d1cbf2226bd321e7ca5200de4a4c314864dbc24813" + "redeemer": { + "title": "_tmp1", + "schema": { + "$ref": "#/definitions/RedeemerWrapper$Void" + } + }, + "compiledCode": "5908150101003232323232323232323232322232533333300f00215323330083001300a37540062a660129212052756e6e696e672032206172672076616c696461746f7220776974686472617700135333333010004153330083001300a37540082a66601860166ea8010494ccc024c8c94ccc02ccdc3a4008601a6ea80044c94ccc030cdc3a4004601c6ea80044c8c94cc8cc03ccdd798009980a26010ad8799fd87980d87a80ff00330143001330143374a90011980a2601091b000001739c890420004bd701980a199807a504c103d87a80004c0103d87980004bd7025eb80c054c058c058c058c058c058c058c058c048dd5180118091baa007132323253330123375e980154d8799fd8799fd8799f581c00000000000000000000000000000000000000000000000000000000ffd8799fd8799fd87a9f581c11111111111111111111111111111111111111111111111111111111ffffffffff00330010034800054ccc048cdd7a613ad8799fd8799fd8799f581c00000000000000000000000000000000000000000000000000000000ffd8799fd87a9f1a00261ec3181b03ffffffff00330010034800854ccc048cdd7a613ad8799fd8799fd87a9f581c11111111111111111111111111111111111111111111111111111111ffd8799fd87a9f1a00261ec3181b03ffffffff00330010034801054ccc048cdd79ba6330173376066e95200233017375200c97ae04c1010000330174bded8c0122d8799f581c00000000000000000000000000000000000000000000000000000000ff0001010e004bd6f7b630180c180c980c980c980c980c980c980a9baa300530153754014294454cc04d2401706578706563740a2020202020205b5061697228536372697074286d795f7363726970745f68617368292c2030292c205061697228566572696669636174696f6e4b6579286f6e6c793073292c203134295d203d3d206374782e7472616e73616374696f6e2e7769746864726177616c7300161533013491b96578706563740a202020202020536f6d65280a202020202020202041646472657373207b0a202020202020202020207061796d656e745f63726564656e7469616c3a20536372697074286f6e6c793173292c0a202020202020202020207374616b655f63726564656e7469616c3a20536f6d6528506f696e74657228323439383234332c2032372c203329292c0a20202020202020207d2c0a20202020202029203d3d206c6973742e6174286164647265737365732c20322900161533013491c26578706563740a202020202020536f6d65280a202020202020202041646472657373207b0a202020202020202020207061796d656e745f63726564656e7469616c3a20566572696669636174696f6e4b6579286f6e6c793073292c0a202020202020202020207374616b655f63726564656e7469616c3a20536f6d6528506f696e74657228323439383234332c2032372c203329292c0a20202020202020207d2c0a20202020202029203d3d206c6973742e6174286164647265737365732c20312900161533013491c16578706563740a202020202020536f6d65280a202020202020202041646472657373207b0a202020202020202020207061796d656e745f63726564656e7469616c3a20566572696669636174696f6e4b6579286f6e6c793073292c0a202020202020202020207374616b655f63726564656e7469616c3a20536f6d6528496e6c696e6528536372697074286f6e6c7931732929292c0a20202020202020207d2c0a20202020202029203d3d206c6973742e6174286164647265737365732c20302900163001001222533301700214c103d87a8000132325333015300e003130073301a0024bd70099980280280099b8000348004c06c00cc064008c8cc004004dd6180398099baa30033013375401044a66602a002297ae0133016300430143754602e0026600400460300026e952000153300f4901566578706563740a202020202020696e74657276616c2e656e746972656c795f6265666f7265283135393630353930393230303029203d3d206374782e7472616e73616374696f6e2e76616c69646974795f72616e6765001623014001375c6024601e6ea800402cc044c038dd5000805180098069baa0022301030113011001149854cc0292411856616c696461746f722072657475726e65642066616c7365001365600600600600600600600315330094911d52756e6e696e672033206172672076616c696461746f72207370656e6400135333333010004153330083001300a37540082a66601860166ea8010494cccccc04400454ccc024c008c02cdd50008a99980698061baa00112533300a4a22930a99805a491856616c696461746f722072657475726e65642066616c73650013656006006006006006006006006006006006006300e300b37540066e1d2000153300800116153300800116153300800116153300800116490191496e636f72726563742072656465656d6572207479706520666f722076616c696461746f72207370656e642e0a2020202020202020202020202020202020202020446f75626c6520636865636b20796f7520686176652077726170706564207468652072656465656d657220747970652061732073706563696669656420696e20796f757220706c757475732e6a736f6e0015330044910b5f746d70313a20566f6964001615330034910b5f746d70303a20566f69640016153300249135657870656374205769746864726177696e6728536372697074286d795f7363726970745f686173682929203d206374782e696e666f00165734ae7155ceaab9e5573eae815d0aba257481", + "hash": "21fac9728b25964132635f0eb1931afea5e21572e2fd3766a05a648d" + }, + { + "title": "withdraw.withdraw", + "redeemer": { + "title": "_tmp0", + "schema": { + "$ref": "#/definitions/Void" + } + }, + "compiledCode": "5908150101003232323232323232323232322232533333300f00215323330083001300a37540062a660129212052756e6e696e672032206172672076616c696461746f7220776974686472617700135333333010004153330083001300a37540082a66601860166ea8010494ccc024c8c94ccc02ccdc3a4008601a6ea80044c94ccc030cdc3a4004601c6ea80044c8c94cc8cc03ccdd798009980a26010ad8799fd87980d87a80ff00330143001330143374a90011980a2601091b000001739c890420004bd701980a199807a504c103d87a80004c0103d87980004bd7025eb80c054c058c058c058c058c058c058c058c048dd5180118091baa007132323253330123375e980154d8799fd8799fd8799f581c00000000000000000000000000000000000000000000000000000000ffd8799fd8799fd87a9f581c11111111111111111111111111111111111111111111111111111111ffffffffff00330010034800054ccc048cdd7a613ad8799fd8799fd8799f581c00000000000000000000000000000000000000000000000000000000ffd8799fd87a9f1a00261ec3181b03ffffffff00330010034800854ccc048cdd7a613ad8799fd8799fd87a9f581c11111111111111111111111111111111111111111111111111111111ffd8799fd87a9f1a00261ec3181b03ffffffff00330010034801054ccc048cdd79ba6330173376066e95200233017375200c97ae04c1010000330174bded8c0122d8799f581c00000000000000000000000000000000000000000000000000000000ff0001010e004bd6f7b630180c180c980c980c980c980c980c980a9baa300530153754014294454cc04d2401706578706563740a2020202020205b5061697228536372697074286d795f7363726970745f68617368292c2030292c205061697228566572696669636174696f6e4b6579286f6e6c793073292c203134295d203d3d206374782e7472616e73616374696f6e2e7769746864726177616c7300161533013491b96578706563740a202020202020536f6d65280a202020202020202041646472657373207b0a202020202020202020207061796d656e745f63726564656e7469616c3a20536372697074286f6e6c793173292c0a202020202020202020207374616b655f63726564656e7469616c3a20536f6d6528506f696e74657228323439383234332c2032372c203329292c0a20202020202020207d2c0a20202020202029203d3d206c6973742e6174286164647265737365732c20322900161533013491c26578706563740a202020202020536f6d65280a202020202020202041646472657373207b0a202020202020202020207061796d656e745f63726564656e7469616c3a20566572696669636174696f6e4b6579286f6e6c793073292c0a202020202020202020207374616b655f63726564656e7469616c3a20536f6d6528506f696e74657228323439383234332c2032372c203329292c0a20202020202020207d2c0a20202020202029203d3d206c6973742e6174286164647265737365732c20312900161533013491c16578706563740a202020202020536f6d65280a202020202020202041646472657373207b0a202020202020202020207061796d656e745f63726564656e7469616c3a20566572696669636174696f6e4b6579286f6e6c793073292c0a202020202020202020207374616b655f63726564656e7469616c3a20536f6d6528496e6c696e6528536372697074286f6e6c7931732929292c0a20202020202020207d2c0a20202020202029203d3d206c6973742e6174286164647265737365732c20302900163001001222533301700214c103d87a8000132325333015300e003130073301a0024bd70099980280280099b8000348004c06c00cc064008c8cc004004dd6180398099baa30033013375401044a66602a002297ae0133016300430143754602e0026600400460300026e952000153300f4901566578706563740a202020202020696e74657276616c2e656e746972656c795f6265666f7265283135393630353930393230303029203d3d206374782e7472616e73616374696f6e2e76616c69646974795f72616e6765001623014001375c6024601e6ea800402cc044c038dd5000805180098069baa0022301030113011001149854cc0292411856616c696461746f722072657475726e65642066616c7365001365600600600600600600600315330094911d52756e6e696e672033206172672076616c696461746f72207370656e6400135333333010004153330083001300a37540082a66601860166ea8010494cccccc04400454ccc024c008c02cdd50008a99980698061baa00112533300a4a22930a99805a491856616c696461746f722072657475726e65642066616c73650013656006006006006006006006006006006006006300e300b37540066e1d2000153300800116153300800116153300800116153300800116490191496e636f72726563742072656465656d6572207479706520666f722076616c696461746f72207370656e642e0a2020202020202020202020202020202020202020446f75626c6520636865636b20796f7520686176652077726170706564207468652072656465656d657220747970652061732073706563696669656420696e20796f757220706c757475732e6a736f6e0015330044910b5f746d70313a20566f6964001615330034910b5f746d70303a20566f69640016153300249135657870656374205769746864726177696e6728536372697074286d795f7363726970745f686173682929203d206374782e696e666f00165734ae7155ceaab9e5573eae815d0aba257481", + "hash": "21fac9728b25964132635f0eb1931afea5e21572e2fd3766a05a648d" } ], "definitions": { + "Data": { + "title": "Data", + "description": "Any Plutus data." + }, + "RedeemerWrapper$Void": { + "title": "Wrapped Redeemer", + "description": "A redeemer wrapped in an extra constructor to make multi-validator detection possible on-chain.", + "anyOf": [ + { + "dataType": "constructor", + "index": 1, + "fields": [ + { + "$ref": "#/definitions/Void" + } + ] + } + ] + }, "Void": { "title": "Unit", "description": "The nullary constructor.", diff --git a/examples/acceptance_tests/script_context/v3/test.sh b/examples/acceptance_tests/script_context/v3/test.sh index cdd30e57..d46bf1af 100755 --- a/examples/acceptance_tests/script_context/v3/test.sh +++ b/examples/acceptance_tests/script_context/v3/test.sh @@ -45,9 +45,10 @@ for ITEM in ${VALIDATORS[@]}; do VALIDATOR_NAME=$(echo $ITEM | jq -r .title) VALIDATOR_HASH=$(echo $ITEM | jq -r .hash) VALIDATOR=$(echo $ITEM | jq -r .compiledCode) + VALIDATOR_CBOR=$(echo "h'$VALIDATOR'" | cbor-diag --to hex --from diag) RESOLVED_INPUTS=$(echo $RESOLVED_INPUTS \ - | sed "s/{{ $VALIDATOR_NAME.cbor }}/$VALIDATOR/g" \ + | sed "s/{{ $VALIDATOR_NAME.cbor }}/$VALIDATOR_CBOR/g" \ | sed "s/{{ $VALIDATOR_NAME.hash }}/$VALIDATOR_HASH/g") TRANSACTION=$(echo $TRANSACTION \ @@ -59,9 +60,7 @@ echo $RESOLVED_INPUTS | cbor-diag --to hex --from diag > ctx/$TITLE/resolved_inp echo $TRANSACTION | cbor-diag --to hex --from diag > ctx/$TITLE/tx.cbor -# ogmios inspect transaction $(cat ctx/$TITLE/tx.cbor) | jq ".votes" - -$AIKEN tx simulate \ +$AIKEN tx simulate 1>$TITLE.log 2>&1 \ ctx/$TITLE/tx.cbor \ ctx/inputs.cbor \ ctx/$TITLE/resolved_inputs.cbor diff --git a/examples/acceptance_tests/script_context/v3/validators/mint.ak b/examples/acceptance_tests/script_context/v3/validators/mint.ak index 5b555007..51b1d80f 100644 --- a/examples/acceptance_tests/script_context/v3/validators/mint.ak +++ b/examples/acceptance_tests/script_context/v3/validators/mint.ak @@ -16,7 +16,7 @@ const void_hash = #"923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec" validator { - fn mint_1(_tmp2: Void, ctx: ScriptContext) { + fn mint_1(_tmp2: Data, ctx: ScriptContext) { let our_policy_id = assert_script_info(ctx.info) let other_policy_id = assert_redeemers(ctx.transaction.redeemers) assert_outputs(ctx.transaction.outputs, our_policy_id, other_policy_id) diff --git a/examples/acceptance_tests/script_context/v3/validators/voting.ak b/examples/acceptance_tests/script_context/v3/validators/voting.ak index 1c14ed9e..cce7c58f 100644 --- a/examples/acceptance_tests/script_context/v3/validators/voting.ak +++ b/examples/acceptance_tests/script_context/v3/validators/voting.ak @@ -22,7 +22,7 @@ const only9s = #"9999999999999999999999999999999999999999999999999999999999999999" validator { - fn script(_tmp0: Void, ctx: ScriptContext) { + fn script(_tmp0: Data, ctx: ScriptContext) { assert_redeemer(ctx.redeemer) let votes = ctx.transaction.votes @@ -35,18 +35,14 @@ validator { expect Some( - Pair( - ConstitutionalCommitteeMember(VerificationKey(only0s)), - [ - Pair( - GovernanceActionId { - transaction: only9s, - proposal_procedure: 152, - }, - No, - ), - ], - ), + Pair(ConstitutionalCommitteeMember(VerificationKey(only0s)), + [ + Pair(GovernanceActionId { + transaction: only9s, + proposal_procedure: 152, + }, + No), + ]), ) == list.at(votes, 1) expect Some(Pair(DelegateRepresentative(Script(..)), [_, ..])) = @@ -54,23 +50,15 @@ validator { expect Some( - Pair( - DelegateRepresentative(VerificationKey(only0s)), - [ - Pair( - GovernanceActionId { transaction: only7s, proposal_procedure: 2 }, - Abstain, - ), - Pair( - GovernanceActionId { transaction: only8s, proposal_procedure: 1 }, - Abstain, - ), - Pair( - GovernanceActionId { transaction: only9s, proposal_procedure: 0 }, - Abstain, - ), - ], - ), + Pair(DelegateRepresentative(VerificationKey(only0s)), + [ + Pair(GovernanceActionId { transaction: only7s, proposal_procedure: 2 }, + Abstain), + Pair(GovernanceActionId { transaction: only8s, proposal_procedure: 1 }, + Abstain), + Pair(GovernanceActionId { transaction: only9s, proposal_procedure: 0 }, + Abstain), + ]), ) == list.at(votes, 3) expect Some(Pair(StakePool(pool_id), [_, ..])) = list.at(votes, 4) @@ -83,8 +71,10 @@ validator { fn assert_redeemer(data: Data) { let is_valid = if data is Foo(42): Foo { + trace data True } else if data is Void { + trace data True } else { False diff --git a/examples/acceptance_tests/script_context/v3/validators/withdraw.ak b/examples/acceptance_tests/script_context/v3/validators/withdraw.ak new file mode 100644 index 00000000..211f774b --- /dev/null +++ b/examples/acceptance_tests/script_context/v3/validators/withdraw.ak @@ -0,0 +1,52 @@ +use aiken/collection/list +use aiken/interval +use cardano/credential.{Address, Inline, Pointer, Script, VerificationKey} +use cardano/transaction.{ScriptContext, Withdrawing} + +const only0s = #"00000000000000000000000000000000000000000000000000000000" + +const only1s = #"11111111111111111111111111111111111111111111111111111111" + +validator { + fn spend(_tmp0: Void, _tmp1: Void, _ctx: Data) { + True + } + + fn withdraw(_tmp0: Void, ctx: ScriptContext) { + expect Withdrawing(Script(my_script_hash)) = ctx.info + + expect + interval.entirely_before(1596059092000) == ctx.transaction.validity_range + + let addresses = list.map(ctx.transaction.outputs, fn(out) { out.address }) + + expect + Some( + Address { + payment_credential: VerificationKey(only0s), + stake_credential: Some(Inline(Script(only1s))), + }, + ) == list.at(addresses, 0) + + expect + Some( + Address { + payment_credential: VerificationKey(only0s), + stake_credential: Some(Pointer(2498243, 27, 3)), + }, + ) == list.at(addresses, 1) + + expect + Some( + Address { + payment_credential: Script(only1s), + stake_credential: Some(Pointer(2498243, 27, 3)), + }, + ) == list.at(addresses, 2) + + expect + [Pair(Script(my_script_hash), 0), Pair(VerificationKey(only0s), 14)] == ctx.transaction.withdrawals + + True + } +}