From 5f093f79c0f135f8481793f98be0f150c4540d4d Mon Sep 17 00:00:00 2001 From: Grant Wuerker Date: Tue, 5 May 2026 09:40:10 -0600 Subject: [PATCH 1/3] mir(contracts): binary-search runtime selector dispatch --- crates/mir/src/runtime/synthetic.rs | 64 +++++++- crates/mir/src/verify/package.rs | 220 ++++++++++++++++++++-------- 2 files changed, 222 insertions(+), 62 deletions(-) diff --git a/crates/mir/src/runtime/synthetic.rs b/crates/mir/src/runtime/synthetic.rs index 1af4172309..fe697c7422 100644 --- a/crates/mir/src/runtime/synthetic.rs +++ b/crates/mir/src/runtime/synthetic.rs @@ -795,11 +795,51 @@ impl<'db> SyntheticBodyBuilder<'db> { then_bb: default_bb, else_bb: selector_bb, }; - self.blocks[selector_bb.index()].terminator = RTerminator::SwitchScalar { - discr: selector, - cases: cases.into_boxed_slice(), - default: default_bb, + self.emit_dispatch_tree(selector, selector_bb, &cases, default_bb); + } + + fn emit_dispatch_tree( + &mut self, + selector: RLocalId, + into_block: RBlockId, + arms: &[(ConstScalar, RBlockId)], + default_block: RBlockId, + ) { + let terminator = match arms.len() { + 0 => RTerminator::Goto(default_block), + 1 => { + let selector_match = self.push_selector_const(into_block, arms[0].0.clone()); + let cond = + self.push_bool_binary(into_block, CompBinOp::Eq, selector, selector_match); + RTerminator::Branch { + cond, + then_bb: arms[0].1, + else_bb: default_block, + } + } + _ => { + let pivot_idx = (arms.len() - 1) / 2; + let pivot = arms[pivot_idx].0.clone(); + let left_block = self.new_block(); + let right_block = self.new_block(); + let pivot_value = self.push_selector_const(into_block, pivot); + let cond = + self.push_bool_binary(into_block, CompBinOp::LtEq, selector, pivot_value); + self.emit_dispatch_tree(selector, left_block, &arms[..=pivot_idx], default_block); + self.emit_dispatch_tree( + selector, + right_block, + &arms[pivot_idx + 1..], + default_block, + ); + RTerminator::Branch { + cond, + then_bb: left_block, + else_bb: right_block, + } + } }; + self.blocks[into_block.index()].terminator = terminator; } fn emit_nonpayable_guard(&mut self, zero: RLocalId) -> RBlockId { @@ -1313,6 +1353,22 @@ impl<'db> SyntheticBodyBuilder<'db> { ) } + fn push_selector_const(&mut self, bb: RBlockId, value: ConstScalar) -> RLocalId { + let dst = self.push_local( + TyId::u256(self.db), + RuntimeCarrier::Value(RuntimeClass::Scalar(selector_scalar_class())), + RuntimeLocalRoot::None, + ); + self.push_stmt( + bb, + RStmt::Assign { + dst, + expr: RExpr::ConstScalar(value), + }, + ); + dst + } + fn push_const_scalar(&mut self, bb: RBlockId, value: ConstScalar) -> RLocalId { let dst = self.push_local( TyId::u256(self.db), diff --git a/crates/mir/src/verify/package.rs b/crates/mir/src/verify/package.rs index ef34fe0fe9..49244acae2 100644 --- a/crates/mir/src/verify/package.rs +++ b/crates/mir/src/verify/package.rs @@ -3,9 +3,9 @@ use rustc_hash::FxHashSet; use crate::{ db::MirDb, runtime::{ - DispatchDefault, RExpr, RStmt, RTerminator, ResolvedCodeRegion, RuntimeCodeRegion, - RuntimeFunctionOwner, RuntimeObject, RuntimePackage, RuntimeProgramView, - RuntimeSyntheticSpec, + DispatchArm, DispatchDefault, RBlockId, RExpr, RStmt, RTerminator, ResolvedCodeRegion, + RuntimeBody, RuntimeCodeRegion, RuntimeFunctionOwner, RuntimeObject, RuntimePackage, + RuntimeProgramView, RuntimeSyntheticSpec, code_region::{code_region_runtime_entry, code_region_section_name, code_region_symbol}, }, verify::{VerifyError, verify_runtime_body}, @@ -137,61 +137,7 @@ fn verify_synthetic_function<'db>( RuntimeFunctionOwner::Synthetic(spec) => match spec { RuntimeSyntheticSpec::ContractRuntimeRoot { dispatch, default, .. - } => { - let Some(entry) = body.blocks.first() else { - return Err(VerifyError::InvalidReturnClass); - }; - let (cases, default_bb) = match &entry.terminator { - RTerminator::SwitchScalar { cases, default, .. } => (cases, default), - RTerminator::Branch { - then_bb, else_bb, .. - } => { - let Some(selector_block) = body.block(*else_bb) else { - return Err(VerifyError::MissingRuntimeBlock(*else_bb)); - }; - let RTerminator::SwitchScalar { - cases, - default: default_bb, - .. - } = &selector_block.terminator - else { - return Err(VerifyError::InvalidReturnClass); - }; - if then_bb != default_bb { - return Err(VerifyError::InvalidReturnClass); - } - (cases, default_bb) - } - _ => return Err(VerifyError::InvalidReturnClass), - }; - if cases.len() != dispatch.len() { - return Err(VerifyError::InvalidReturnClass); - } - for ((_, block), arm) in cases.iter().zip(dispatch.iter()) { - let Some(target) = body.block(*block) else { - return Err(VerifyError::MissingRuntimeBlock(*block)); - }; - let RTerminator::TerminalCall { callee, args } = &target.terminator else { - return Err(VerifyError::InvalidReturnClass); - }; - if *callee != arm.wrapper || !args.is_empty() { - return Err(VerifyError::InvalidReturnClass); - } - } - - let Some(default_target) = body.block(*default_bb) else { - return Err(VerifyError::MissingRuntimeBlock(*default_bb)); - }; - match (default, &default_target.terminator) { - (DispatchDefault::RevertEmpty, RTerminator::Revert { .. }) => {} - ( - DispatchDefault::Call { wrapper }, - RTerminator::TerminalCall { callee, args }, - ) if *callee == wrapper && args.is_empty() => {} - _ => return Err(VerifyError::InvalidReturnClass), - } - Ok(()) - } + } => verify_contract_runtime_dispatch(body, &dispatch, default), RuntimeSyntheticSpec::ContractInitRoot { .. } => { verify_has_terminator(body, |term| matches!(term, RTerminator::ReturnData { .. })) } @@ -210,6 +156,164 @@ fn verify_synthetic_function<'db>( } } +fn verify_contract_runtime_dispatch<'db>( + body: &RuntimeBody<'db>, + dispatch: &[DispatchArm<'db>], + default: DispatchDefault<'db>, +) -> Result<(), VerifyError<'db>> { + let Some(entry) = body.blocks.first() else { + return Err(VerifyError::InvalidReturnClass); + }; + + if let RTerminator::SwitchScalar { + cases, + default: default_bb, + .. + } = &entry.terminator + { + return verify_contract_runtime_switch(body, dispatch, default, cases, *default_bb); + } + + let mut seen_blocks = FxHashSet::default(); + let mut seen_arms = vec![false; dispatch.len()]; + let mut saw_default = false; + verify_contract_runtime_dispatch_block( + body, + RBlockId::from_u32(0), + dispatch, + default, + &mut seen_arms, + &mut saw_default, + &mut seen_blocks, + )?; + + if saw_default && seen_arms.into_iter().all(|seen| seen) { + Ok(()) + } else { + Err(VerifyError::InvalidReturnClass) + } +} + +fn verify_contract_runtime_switch<'db>( + body: &RuntimeBody<'db>, + dispatch: &[DispatchArm<'db>], + default: DispatchDefault<'db>, + cases: &[(crate::runtime::ConstScalar, RBlockId)], + default_bb: RBlockId, +) -> Result<(), VerifyError<'db>> { + if cases.len() != dispatch.len() { + return Err(VerifyError::InvalidReturnClass); + } + for ((_, block), arm) in cases.iter().zip(dispatch.iter()) { + verify_contract_runtime_arm_target(body, *block, arm)?; + } + + verify_contract_runtime_default_target(body, default_bb, default) +} + +fn verify_contract_runtime_dispatch_block<'db>( + body: &RuntimeBody<'db>, + block: RBlockId, + dispatch: &[DispatchArm<'db>], + default: DispatchDefault<'db>, + seen_arms: &mut [bool], + saw_default: &mut bool, + seen_blocks: &mut FxHashSet, +) -> Result<(), VerifyError<'db>> { + if !seen_blocks.insert(block) { + return Ok(()); + } + + let Some(target) = body.block(block) else { + return Err(VerifyError::MissingRuntimeBlock(block)); + }; + match &target.terminator { + RTerminator::Goto(target) => verify_contract_runtime_dispatch_block( + body, + *target, + dispatch, + default, + seen_arms, + saw_default, + seen_blocks, + ), + RTerminator::Branch { + then_bb, else_bb, .. + } => { + verify_contract_runtime_dispatch_block( + body, + *then_bb, + dispatch, + default, + seen_arms, + saw_default, + seen_blocks, + )?; + verify_contract_runtime_dispatch_block( + body, + *else_bb, + dispatch, + default, + seen_arms, + saw_default, + seen_blocks, + ) + } + RTerminator::TerminalCall { callee, args } if args.is_empty() => { + if let Some(idx) = dispatch.iter().position(|arm| arm.wrapper == *callee) { + seen_arms[idx] = true; + Ok(()) + } else if matches!(default, DispatchDefault::Call { wrapper } if wrapper == *callee) { + *saw_default = true; + Ok(()) + } else { + Err(VerifyError::InvalidReturnClass) + } + } + RTerminator::Revert { .. } if matches!(default, DispatchDefault::RevertEmpty) => { + *saw_default = true; + Ok(()) + } + _ => Err(VerifyError::InvalidReturnClass), + } +} + +fn verify_contract_runtime_arm_target<'db>( + body: &RuntimeBody<'db>, + block: RBlockId, + arm: &DispatchArm<'db>, +) -> Result<(), VerifyError<'db>> { + let Some(target) = body.block(block) else { + return Err(VerifyError::MissingRuntimeBlock(block)); + }; + let RTerminator::TerminalCall { callee, args } = &target.terminator else { + return Err(VerifyError::InvalidReturnClass); + }; + if *callee != arm.wrapper || !args.is_empty() { + return Err(VerifyError::InvalidReturnClass); + } + Ok(()) +} + +fn verify_contract_runtime_default_target<'db>( + body: &RuntimeBody<'db>, + block: RBlockId, + default: DispatchDefault<'db>, +) -> Result<(), VerifyError<'db>> { + let Some(target) = body.block(block) else { + return Err(VerifyError::MissingRuntimeBlock(block)); + }; + match (default, &target.terminator) { + (DispatchDefault::RevertEmpty, RTerminator::Revert { .. }) => Ok(()), + (DispatchDefault::Call { wrapper }, RTerminator::TerminalCall { callee, args }) + if *callee == wrapper && args.is_empty() => + { + Ok(()) + } + _ => Err(VerifyError::InvalidReturnClass), + } +} + fn verify_has_terminator<'db>( body: &crate::runtime::RuntimeBody<'db>, pred: impl Fn(&RTerminator<'db>) -> bool, From 18df0e539996667ab58f71d499cca524611d25c1 Mon Sep 17 00:00:00 2001 From: Grant Wuerker Date: Tue, 5 May 2026 09:40:38 -0600 Subject: [PATCH 2/3] mir(runtime): avoid malloc in ABI passthrough arms --- crates/mir/src/runtime/ir.rs | 1 + crates/mir/src/runtime/package.rs | 80 +++++++++++++++- crates/mir/src/runtime/synthetic.rs | 144 +++++++++++++++++++++++++++- 3 files changed, 223 insertions(+), 2 deletions(-) diff --git a/crates/mir/src/runtime/ir.rs b/crates/mir/src/runtime/ir.rs index e10a918734..817418427b 100644 --- a/crates/mir/src/runtime/ir.rs +++ b/crates/mir/src/runtime/ir.rs @@ -867,6 +867,7 @@ pub struct ContractRecvAbiPlan<'db> { pub contract: Contract<'db>, pub selector: Option, pub payable: bool, + pub passthrough: bool, pub user_recv: RuntimeInstance<'db>, pub entry_effect_args: Box<[EntryEffectArgPlan<'db>]>, pub input: RuntimeInputPlan<'db>, diff --git a/crates/mir/src/runtime/package.rs b/crates/mir/src/runtime/package.rs index 34c34cf9a7..4f185aedee 100644 --- a/crates/mir/src/runtime/package.rs +++ b/crates/mir/src/runtime/package.rs @@ -16,7 +16,10 @@ use hir::{ ty_def::{TyData, TyId}, }, }, - hir_def::{Contract, Func, IdentId, InlineHint, ItemKind, ManualContractRootAttr, TopLevelMod}, + hir_def::{ + Contract, Expr, ExprId, Func, IdentId, InlineHint, ItemKind, ManualContractRootAttr, + Partial, Stmt, TopLevelMod, + }, }; use rustc_hash::{FxHashMap, FxHashSet}; @@ -879,6 +882,9 @@ fn contract_recv_wrapper<'db>( } else { RuntimeReturnPlan::Unit }; + let passthrough = abi_info.ret_ty.is_some_and(|ret_ty| { + recv_arm_is_trivial_passthrough(db, semantic, arm, abi_info.args_ty, ret_ty) + }); let wrapper = synthetic_instance( db, RuntimeSyntheticSpec::ContractRecvAbi { @@ -889,6 +895,7 @@ fn contract_recv_wrapper<'db>( Some(recv_arm) => recv_arm.is_payable(db), None => false, }, + passthrough, user_recv, entry_effect_args: entry_effect_args.into_boxed_slice(), input, @@ -1794,6 +1801,77 @@ fn visible_recv_arg_fields<'db>( .into_boxed_slice() } +fn recv_arm_is_trivial_passthrough<'db>( + db: &'db dyn MirDb, + semantic: SemanticInstance<'db>, + arm: RecvArmView<'db>, + args_ty: TyId<'db>, + ret_ty: TyId<'db>, +) -> bool { + if ret_ty == TyId::unit(db) || ret_ty.is_never(db) { + return false; + } + + let arg_bindings = arm.arg_bindings(db); + if arg_bindings.len() != 1 { + return false; + } + + let arg_binding = &arg_bindings[0]; + if arg_binding.tuple_index != 0 { + return false; + } + + let typed_body = semantic.key(db).typed_body(db); + let Some(pat_binding) = typed_body.pat_binding(arg_binding.pat) else { + return false; + }; + if semantic.binding_ty(db, pat_binding) != ret_ty { + return false; + } + + let encoded_fields = args_ty + .field_types(db) + .into_iter() + .filter(|ty| *ty != TyId::unit(db)) + .collect::>(); + if encoded_fields.len() != 1 || encoded_fields[0] != ret_ty { + return false; + } + + let Some(body) = semantic.key(db).owner(db).body(db) else { + return false; + }; + let Some(tail_expr) = single_stmt_block_tail_expr(db, body, body.expr(db)) else { + return false; + }; + + typed_body.expr_binding(tail_expr) == Some(pat_binding) +} + +fn single_stmt_block_tail_expr<'db>( + db: &'db dyn MirDb, + body: hir::hir_def::Body<'db>, + root: ExprId, +) -> Option { + match root.data(db, body) { + Partial::Present(Expr::Block(stmts)) => { + if stmts.len() != 1 { + return None; + } + let stmt = stmts[0]; + match stmt.data(db, body) { + Partial::Present(Stmt::Expr(expr)) | Partial::Present(Stmt::Return(Some(expr))) => { + Some(*expr) + } + _ => None, + } + } + Partial::Present(Expr::Path(_)) => Some(root), + _ => None, + } +} + fn memory_bytes_ty<'db>( db: &'db dyn MirDb, scope: hir::hir_def::scope_graph::ScopeId<'db>, diff --git a/crates/mir/src/runtime/synthetic.rs b/crates/mir/src/runtime/synthetic.rs index fe697c7422..db05268d4a 100644 --- a/crates/mir/src/runtime/synthetic.rs +++ b/crates/mir/src/runtime/synthetic.rs @@ -6,7 +6,9 @@ use hir::{ ty::{ corelib::{resolve_core_trait, resolve_lib_func_path, resolve_lib_type_path}, trait_def::{TraitInstId, resolve_trait_method_instance}, - trait_resolution::{PredicateListId, TraitSolveCx}, + trait_resolution::{ + GoalSatisfiability, PredicateListId, TraitSolveCx, is_goal_satisfiable, + }, ty_check::BodyOwner, ty_def::{InvalidCause, TyId}, }, @@ -515,6 +517,19 @@ impl<'db> SyntheticBodyBuilder<'db> { self.emit_nonpayable_guard(zero) }; + let scope = plan.contract.scope(); + if plan.passthrough + && let RuntimeReturnPlan::Value { ty: ret_ty } = plan.ret + && let RuntimeInputPlan::DecodeHostPayload { .. } = &plan.input + && let Some(input_ty) = calldata_ty(self.db, scope) + && let Some(field_end) = + resolve_abi_field_end_with_input_len(self.db, scope, ret_ty, input_ty) + { + let four = self.push_const_word(cont_bb, 4); + self.build_contract_recv_passthrough(scope, field_end, cont_bb, zero, four); + return; + } + let mut call_args = Vec::new(); if let RuntimeInputPlan::DecodeHostPayload { msg_ty, @@ -573,6 +588,41 @@ impl<'db> SyntheticBodyBuilder<'db> { } } + fn build_contract_recv_passthrough( + &mut self, + scope: hir::hir_def::scope_graph::ScopeId<'db>, + field_end: RuntimeInstance<'db>, + cont_bb: RBlockId, + zero: RLocalId, + four: RLocalId, + ) { + let input = self.push_calldata_value(cont_bb, scope, zero); + let input_len = self.push_builtin_value( + cont_bb, + TyId::u256(self.db), + RuntimeClass::Scalar(word_scalar_class()), + RuntimeBuiltin::CallDataSize, + ); + let payload_end = self.push_call_result( + cont_bb, + field_end, + vec![input, four, four, input_len], + ); + let payload_len = self.push_binary_word(cont_bb, ArithBinOp::Sub, payload_end, four); + self.push_side_effect_builtin( + cont_bb, + RuntimeBuiltin::CallDataCopy { + dst: zero, + offset: four, + len: payload_len, + }, + ); + self.blocks[cont_bb.index()].terminator = RTerminator::ReturnData { + offset: zero, + len: payload_len, + }; + } + fn build_contract_init_root( &mut self, contract: Contract<'db>, @@ -1459,6 +1509,45 @@ impl<'db> SyntheticBodyBuilder<'db> { local } + fn push_calldata_value( + &mut self, + bb: RBlockId, + scope: hir::hir_def::scope_graph::ScopeId<'db>, + base: RLocalId, + ) -> RLocalId { + let ty = calldata_ty(self.db, scope).expect("CallData"); + let class = top_level_class_for_ty_in_env( + self.db, + self.runtime_type_env(scope), + ty, + AddressSpaceKind::Memory, + ) + .expect("calldata runtime class"); + let root = match &class { + RuntimeClass::Ref { .. } => RuntimeLocalRoot::Ref(class.clone()), + _ => RuntimeLocalRoot::Slot(class.clone()), + }; + let local = self.push_local(ty, RuntimeCarrier::Value(class.clone()), root); + let root = match class { + RuntimeClass::Ref { .. } => PlaceRoot::Ref(local), + RuntimeClass::Scalar(_) + | RuntimeClass::RawAddr { .. } + | RuntimeClass::AggregateValue { .. } => PlaceRoot::Slot(local), + }; + self.push_stmt( + bb, + RStmt::Store { + dst: RuntimePlace { + root, + path: vec![PlaceElem::Field(hir::analysis::semantic::FieldIndex(0))] + .into_boxed_slice(), + }, + src: base, + }, + ); + local + } + fn push_synthetic_default_value( &mut self, bb: RBlockId, @@ -1710,6 +1799,51 @@ fn u32_scalar(value: u32) -> ConstScalar { } } +fn resolve_abi_field_end_with_input_len<'db>( + db: &'db dyn MirDb, + scope: hir::hir_def::scope_graph::ScopeId<'db>, + ty: TyId<'db>, + input_ty: TyId<'db>, +) -> Option> { + if !has_abi_span(db, scope, ty) { + return None; + } + let assumptions = PredicateListId::empty_list(db); + let func = resolve_lib_func_path(db, scope, "core::abi::abi_field_end_with_input_len")?; + let abi_ty = sol_abi_ty(db, scope)?; + let key = SemanticInstanceKey::new( + db, + BodyOwner::Func(func), + GenericSubst::new(db, vec![abi_ty, ty, input_ty]), + hir::analysis::semantic::EffectProviderSubst::empty(db), + ImplEnv::new(db, scope, assumptions, vec![]), + ); + Some(runtime_instance_for_semantic( + db, + get_or_build_semantic_instance(db, key), + )) +} + +fn has_abi_span<'db>( + db: &'db dyn MirDb, + scope: hir::hir_def::scope_graph::ScopeId<'db>, + ty: TyId<'db>, +) -> bool { + let Some(abi_ty) = sol_abi_ty(db, scope) else { + return false; + }; + let Some(span_trait) = resolve_core_trait(db, scope, &["abi", "AbiSpan"]) else { + return false; + }; + let assumptions = PredicateListId::empty_list(db); + let inst = TraitInstId::new_simple(db, span_trait, vec![ty, abi_ty]); + let solve_cx = TraitSolveCx::new(db, scope).with_assumptions(assumptions); + matches!( + is_goal_satisfiable(db, solve_cx, inst), + GoalSatisfiability::Satisfied(_) + ) +} + fn resolve_sol_decoder_new<'db>( db: &'db dyn MirDb, scope: hir::hir_def::scope_graph::ScopeId<'db>, @@ -1778,6 +1912,14 @@ fn sol_abi_ty<'db>( resolve_lib_type_path(db, scope, "std::abi::Sol") } +fn calldata_ty<'db>( + db: &'db dyn MirDb, + scope: hir::hir_def::scope_graph::ScopeId<'db>, +) -> Option> { + resolve_lib_type_path(db, scope, "std::evm::calldata::CallData") + .or_else(|| resolve_lib_type_path(db, scope, "std::evm::CallData")) +} + fn memory_bytes_ty<'db>( db: &'db dyn MirDb, scope: hir::hir_def::scope_graph::ScopeId<'db>, From 7008838dcf43539733594b224018759a7bf2609a Mon Sep 17 00:00:00 2001 From: Grant Wuerker Date: Tue, 5 May 2026 09:43:11 -0600 Subject: [PATCH 3/3] test/bench/docs: add ABI optimization artifacts --- Makefile | 115 + PR_OPTIMIZATIONS_TABLE.md | 21 + benchmarks/foundry-abi/.gitignore | 6 + benchmarks/foundry-abi/README.md | 351 +++ benchmarks/foundry-abi/fe/AbiRoundtrip.fe | 676 ++++ benchmarks/foundry-abi/fe/BytesSuite.fe | 14 + benchmarks/foundry-abi/fe/DeepDynamicSuite.fe | 63 + benchmarks/foundry-abi/fe/DynArraySuite.fe | 33 + .../foundry-abi/fe/FixedArrayCeilingSuite.fe | 32 + benchmarks/foundry-abi/fe/FixedArraySuite.fe | 87 + benchmarks/foundry-abi/fe/NestedTupleSuite.fe | 51 + benchmarks/foundry-abi/foundry.toml | 6 + .../foundry-abi/reports/bytes-suite-gas.md | 31 + .../reports/deep-dynamic-suite-gas.md | 56 + .../reports/dyn-array-suite-gas.md | 42 + .../reports/fixed-array-ceiling-suite-gas.md | 51 + .../reports/fixed-array-suite-gas.md | 69 + benchmarks/foundry-abi/reports/gas-deltas.csv | 112 + .../foundry-abi/reports/gas-diagnosis.md | 219 ++ .../reports/gas-optimization-estimates.md | 206 ++ benchmarks/foundry-abi/reports/gas-report.txt | 2730 +++++++++++++++++ benchmarks/foundry-abi/reports/gas-summary.md | 81 + .../reports/hevm-equivalence-status.md | 125 + .../foundry-abi/reports/parity-status.md | 315 ++ .../foundry-abi/scripts/generate_matrix.py | 1356 ++++++++ .../foundry-abi/scripts/run_gas_report.py | 275 ++ .../scripts/run_hevm_curated_matrix.sh | 295 ++ .../scripts/run_hevm_equivalence.sh | 96 + .../foundry-abi/src/AbiRoundtripSol.sol | 1493 +++++++++ benchmarks/foundry-abi/src/BytesSuiteSol.sol | 36 + .../foundry-abi/src/DeepDynamicSuiteSol.sol | 226 ++ .../src/FixedArrayCeilingSuiteSol.sol | 75 + .../foundry-abi/src/FixedArraySuiteSol.sol | 241 ++ .../foundry-abi/src/NestedTupleSuiteSol.sol | 185 ++ .../test/AbiRoundtripEquivalence.t.sol | 157 + .../test/BytesSuiteEquivalence.t.sol | 149 + .../test/DeepDynamicSuiteEquivalence.t.sol | 565 ++++ .../test/DynArraySuiteEquivalence.t.sol | 221 ++ .../FixedArrayCeilingSuiteEquivalence.t.sol | 226 ++ .../test/FixedArraySuiteEquivalence.t.sol | 458 +++ .../test/NestedTupleSuiteEquivalence.t.sol | 298 ++ .../bench/AbiAddressArray4Bench.t.sol | 14 + .../generated/bench/AbiAddressBench.t.sol | 12 + .../bench/AbiAddressMatrix2x2Bench.t.sol | 14 + .../bench/AbiBoolAddressPairArrayBench.t.sol | 17 + .../generated/bench/AbiBoolArray4Bench.t.sol | 14 + .../test/generated/bench/AbiBoolBench.t.sol | 12 + .../bench/AbiBoolMatrix2x2Bench.t.sol | 14 + .../test/generated/bench/AbiInt104Bench.t.sol | 12 + .../test/generated/bench/AbiInt112Bench.t.sol | 12 + .../test/generated/bench/AbiInt120Bench.t.sol | 12 + .../bench/AbiInt128Array4Bench.t.sol | 14 + .../test/generated/bench/AbiInt128Bench.t.sol | 12 + .../test/generated/bench/AbiInt136Bench.t.sol | 12 + .../test/generated/bench/AbiInt144Bench.t.sol | 12 + .../test/generated/bench/AbiInt152Bench.t.sol | 12 + .../bench/AbiInt160Array4Bench.t.sol | 14 + .../test/generated/bench/AbiInt160Bench.t.sol | 12 + .../test/generated/bench/AbiInt168Bench.t.sol | 12 + .../generated/bench/AbiInt16Array4Bench.t.sol | 14 + .../test/generated/bench/AbiInt16Bench.t.sol | 12 + .../test/generated/bench/AbiInt176Bench.t.sol | 12 + .../test/generated/bench/AbiInt184Bench.t.sol | 12 + .../test/generated/bench/AbiInt192Bench.t.sol | 12 + .../test/generated/bench/AbiInt200Bench.t.sol | 12 + .../test/generated/bench/AbiInt208Bench.t.sol | 12 + .../test/generated/bench/AbiInt216Bench.t.sol | 12 + .../test/generated/bench/AbiInt224Bench.t.sol | 12 + .../test/generated/bench/AbiInt232Bench.t.sol | 12 + .../test/generated/bench/AbiInt240Bench.t.sol | 12 + .../bench/AbiInt248Array4Bench.t.sol | 14 + .../test/generated/bench/AbiInt248Bench.t.sol | 12 + .../generated/bench/AbiInt24Array4Bench.t.sol | 14 + .../test/generated/bench/AbiInt24Bench.t.sol | 12 + .../bench/AbiInt256Array4Bench.t.sol | 14 + .../test/generated/bench/AbiInt256Bench.t.sol | 12 + .../bench/AbiInt256Matrix2x2Bench.t.sol | 14 + .../generated/bench/AbiInt32Array4Bench.t.sol | 14 + .../test/generated/bench/AbiInt32Bench.t.sol | 12 + .../generated/bench/AbiInt40Array4Bench.t.sol | 14 + .../test/generated/bench/AbiInt40Bench.t.sol | 12 + .../bench/AbiInt40Matrix2x2Bench.t.sol | 14 + .../test/generated/bench/AbiInt48Bench.t.sol | 12 + .../test/generated/bench/AbiInt56Bench.t.sol | 12 + .../generated/bench/AbiInt64Array4Bench.t.sol | 14 + .../test/generated/bench/AbiInt64Bench.t.sol | 12 + .../test/generated/bench/AbiInt72Bench.t.sol | 12 + .../test/generated/bench/AbiInt80Bench.t.sol | 12 + .../test/generated/bench/AbiInt88Bench.t.sol | 12 + .../generated/bench/AbiInt8Array4Bench.t.sol | 14 + .../test/generated/bench/AbiInt8Bench.t.sol | 12 + .../generated/bench/AbiInt96Array4Bench.t.sol | 14 + .../test/generated/bench/AbiInt96Bench.t.sol | 12 + .../bench/AbiPairBoolAddressArray4Bench.t.sol | 15 + .../bench/AbiPairBoolAddressBench.t.sol | 15 + .../bench/AbiPairStringU64Bench.t.sol | 16 + .../bench/AbiPairUint24Int40Array4Bench.t.sol | 15 + .../bench/AbiPairUint24Int40Bench.t.sol | 15 + .../bench/AbiStringArray2Bench.t.sol | 16 + .../generated/bench/AbiStringArrayBench.t.sol | 19 + .../test/generated/bench/AbiStringBench.t.sol | 15 + .../bench/AbiStringU64PairArray2Bench.t.sol | 17 + .../bench/AbiStringU64PairArrayBench.t.sol | 20 + .../AbiTripleBoolAddressU256Array4Bench.t.sol | 15 + .../bench/AbiTripleBoolAddressU256Bench.t.sol | 15 + .../bench/AbiTripleStringBoolU64Bench.t.sol | 16 + .../generated/bench/AbiUint104Bench.t.sol | 12 + .../generated/bench/AbiUint112Bench.t.sol | 12 + .../generated/bench/AbiUint120Bench.t.sol | 12 + .../bench/AbiUint128Array4Bench.t.sol | 14 + .../generated/bench/AbiUint128Bench.t.sol | 12 + .../generated/bench/AbiUint136Bench.t.sol | 12 + .../generated/bench/AbiUint144Bench.t.sol | 12 + .../generated/bench/AbiUint152Bench.t.sol | 12 + .../bench/AbiUint160Array4Bench.t.sol | 14 + .../generated/bench/AbiUint160Bench.t.sol | 12 + .../generated/bench/AbiUint168Bench.t.sol | 12 + .../bench/AbiUint16Array4Bench.t.sol | 14 + .../test/generated/bench/AbiUint16Bench.t.sol | 12 + .../generated/bench/AbiUint176Bench.t.sol | 12 + .../generated/bench/AbiUint184Bench.t.sol | 12 + .../generated/bench/AbiUint192Bench.t.sol | 12 + .../generated/bench/AbiUint200Bench.t.sol | 12 + .../generated/bench/AbiUint208Bench.t.sol | 12 + .../generated/bench/AbiUint216Bench.t.sol | 12 + .../generated/bench/AbiUint224Bench.t.sol | 12 + .../generated/bench/AbiUint232Bench.t.sol | 12 + .../generated/bench/AbiUint240Bench.t.sol | 12 + .../bench/AbiUint248Array4Bench.t.sol | 14 + .../generated/bench/AbiUint248Bench.t.sol | 12 + .../bench/AbiUint24Array4Bench.t.sol | 14 + .../test/generated/bench/AbiUint24Bench.t.sol | 12 + .../bench/AbiUint24Matrix2x2Bench.t.sol | 14 + .../bench/AbiUint256Array4Bench.t.sol | 14 + .../generated/bench/AbiUint256Bench.t.sol | 12 + .../bench/AbiUint256Matrix2x2Bench.t.sol | 14 + .../bench/AbiUint32Array4Bench.t.sol | 14 + .../test/generated/bench/AbiUint32Bench.t.sol | 12 + .../bench/AbiUint40Array4Bench.t.sol | 14 + .../test/generated/bench/AbiUint40Bench.t.sol | 12 + .../test/generated/bench/AbiUint48Bench.t.sol | 12 + .../test/generated/bench/AbiUint56Bench.t.sol | 12 + .../bench/AbiUint64Array4Bench.t.sol | 14 + .../test/generated/bench/AbiUint64Bench.t.sol | 12 + .../test/generated/bench/AbiUint72Bench.t.sol | 12 + .../test/generated/bench/AbiUint80Bench.t.sol | 12 + .../test/generated/bench/AbiUint88Bench.t.sol | 12 + .../generated/bench/AbiUint8Array4Bench.t.sol | 14 + .../test/generated/bench/AbiUint8Bench.t.sol | 12 + .../bench/AbiUint96Array4Bench.t.sol | 14 + .../test/generated/bench/AbiUint96Bench.t.sol | 12 + .../generated/bench/AbiUintArrayBench.t.sol | 17 + .../AbiAddressArray4Deterministic.t.sol | 19 + .../AbiAddressDeterministic.t.sol | 25 + .../AbiAddressMatrix2x2Deterministic.t.sol | 19 + ...AbiBoolAddressPairArrayDeterministic.t.sol | 21 + .../AbiBoolArray4Deterministic.t.sol | 19 + .../deterministic/AbiBoolDeterministic.t.sol | 19 + .../AbiBoolMatrix2x2Deterministic.t.sol | 19 + .../AbiInt104Deterministic.t.sol | 31 + .../AbiInt112Deterministic.t.sol | 31 + .../AbiInt120Deterministic.t.sol | 31 + .../AbiInt128Array4Deterministic.t.sol | 19 + .../AbiInt128Deterministic.t.sol | 31 + .../AbiInt136Deterministic.t.sol | 31 + .../AbiInt144Deterministic.t.sol | 31 + .../AbiInt152Deterministic.t.sol | 31 + .../AbiInt160Array4Deterministic.t.sol | 19 + .../AbiInt160Deterministic.t.sol | 31 + .../AbiInt168Deterministic.t.sol | 31 + .../AbiInt16Array4Deterministic.t.sol | 19 + .../deterministic/AbiInt16Deterministic.t.sol | 31 + .../AbiInt176Deterministic.t.sol | 31 + .../AbiInt184Deterministic.t.sol | 31 + .../AbiInt192Deterministic.t.sol | 31 + .../AbiInt200Deterministic.t.sol | 31 + .../AbiInt208Deterministic.t.sol | 31 + .../AbiInt216Deterministic.t.sol | 31 + .../AbiInt224Deterministic.t.sol | 31 + .../AbiInt232Deterministic.t.sol | 31 + .../AbiInt240Deterministic.t.sol | 31 + .../AbiInt248Array4Deterministic.t.sol | 19 + .../AbiInt248Deterministic.t.sol | 31 + .../AbiInt24Array4Deterministic.t.sol | 19 + .../deterministic/AbiInt24Deterministic.t.sol | 31 + .../AbiInt256Array4Deterministic.t.sol | 19 + .../AbiInt256Deterministic.t.sol | 31 + .../AbiInt256Matrix2x2Deterministic.t.sol | 19 + .../AbiInt32Array4Deterministic.t.sol | 19 + .../deterministic/AbiInt32Deterministic.t.sol | 31 + .../AbiInt40Array4Deterministic.t.sol | 19 + .../deterministic/AbiInt40Deterministic.t.sol | 31 + .../AbiInt40Matrix2x2Deterministic.t.sol | 19 + .../deterministic/AbiInt48Deterministic.t.sol | 31 + .../deterministic/AbiInt56Deterministic.t.sol | 31 + .../AbiInt64Array4Deterministic.t.sol | 19 + .../deterministic/AbiInt64Deterministic.t.sol | 31 + .../deterministic/AbiInt72Deterministic.t.sol | 31 + .../deterministic/AbiInt80Deterministic.t.sol | 31 + .../deterministic/AbiInt88Deterministic.t.sol | 31 + .../AbiInt8Array4Deterministic.t.sol | 19 + .../deterministic/AbiInt8Deterministic.t.sol | 31 + .../AbiInt96Array4Deterministic.t.sol | 19 + .../deterministic/AbiInt96Deterministic.t.sol | 31 + ...biPairBoolAddressArray4Deterministic.t.sol | 19 + .../AbiPairBoolAddressDeterministic.t.sol | 19 + .../AbiPairStringU64Deterministic.t.sol | 19 + ...biPairUint24Int40Array4Deterministic.t.sol | 19 + .../AbiPairUint24Int40Deterministic.t.sol | 19 + .../AbiStringArray2Deterministic.t.sol | 19 + .../AbiStringArrayDeterministic.t.sol | 29 + .../AbiStringDeterministic.t.sol | 25 + .../AbiStringU64PairArray2Deterministic.t.sol | 19 + .../AbiStringU64PairArrayDeterministic.t.sol | 29 + ...leBoolAddressU256Array4Deterministic.t.sol | 19 + ...biTripleBoolAddressU256Deterministic.t.sol | 19 + .../AbiTripleStringBoolU64Deterministic.t.sol | 19 + .../AbiUint104Deterministic.t.sol | 25 + .../AbiUint112Deterministic.t.sol | 25 + .../AbiUint120Deterministic.t.sol | 25 + .../AbiUint128Array4Deterministic.t.sol | 19 + .../AbiUint128Deterministic.t.sol | 25 + .../AbiUint136Deterministic.t.sol | 25 + .../AbiUint144Deterministic.t.sol | 25 + .../AbiUint152Deterministic.t.sol | 25 + .../AbiUint160Array4Deterministic.t.sol | 19 + .../AbiUint160Deterministic.t.sol | 25 + .../AbiUint168Deterministic.t.sol | 25 + .../AbiUint16Array4Deterministic.t.sol | 19 + .../AbiUint16Deterministic.t.sol | 25 + .../AbiUint176Deterministic.t.sol | 25 + .../AbiUint184Deterministic.t.sol | 25 + .../AbiUint192Deterministic.t.sol | 25 + .../AbiUint200Deterministic.t.sol | 25 + .../AbiUint208Deterministic.t.sol | 25 + .../AbiUint216Deterministic.t.sol | 25 + .../AbiUint224Deterministic.t.sol | 25 + .../AbiUint232Deterministic.t.sol | 25 + .../AbiUint240Deterministic.t.sol | 25 + .../AbiUint248Array4Deterministic.t.sol | 19 + .../AbiUint248Deterministic.t.sol | 25 + .../AbiUint24Array4Deterministic.t.sol | 19 + .../AbiUint24Deterministic.t.sol | 25 + .../AbiUint24Matrix2x2Deterministic.t.sol | 19 + .../AbiUint256Array4Deterministic.t.sol | 19 + .../AbiUint256Deterministic.t.sol | 25 + .../AbiUint256Matrix2x2Deterministic.t.sol | 19 + .../AbiUint32Array4Deterministic.t.sol | 19 + .../AbiUint32Deterministic.t.sol | 25 + .../AbiUint40Array4Deterministic.t.sol | 19 + .../AbiUint40Deterministic.t.sol | 25 + .../AbiUint48Deterministic.t.sol | 25 + .../AbiUint56Deterministic.t.sol | 25 + .../AbiUint64Array4Deterministic.t.sol | 19 + .../AbiUint64Deterministic.t.sol | 25 + .../AbiUint72Deterministic.t.sol | 25 + .../AbiUint80Deterministic.t.sol | 25 + .../AbiUint88Deterministic.t.sol | 25 + .../AbiUint8Array4Deterministic.t.sol | 19 + .../deterministic/AbiUint8Deterministic.t.sol | 25 + .../AbiUint96Array4Deterministic.t.sol | 19 + .../AbiUint96Deterministic.t.sol | 25 + .../AbiUintArrayDeterministic.t.sol | 22 + .../generated/fuzz/AbiAddressArray4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiAddressFuzz.t.sol | 12 + .../fuzz/AbiAddressMatrix2x2Fuzz.t.sol | 12 + .../fuzz/AbiBoolAddressPairArrayFuzz.t.sol | 13 + .../generated/fuzz/AbiBoolArray4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiBoolFuzz.t.sol | 12 + .../generated/fuzz/AbiBoolMatrix2x2Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt104Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt112Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt120Fuzz.t.sol | 12 + .../generated/fuzz/AbiInt128Array4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt128Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt136Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt144Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt152Fuzz.t.sol | 12 + .../generated/fuzz/AbiInt160Array4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt160Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt168Fuzz.t.sol | 12 + .../generated/fuzz/AbiInt16Array4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt16Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt176Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt184Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt192Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt200Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt208Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt216Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt224Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt232Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt240Fuzz.t.sol | 12 + .../generated/fuzz/AbiInt248Array4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt248Fuzz.t.sol | 12 + .../generated/fuzz/AbiInt24Array4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt24Fuzz.t.sol | 12 + .../generated/fuzz/AbiInt256Array4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt256Fuzz.t.sol | 12 + .../fuzz/AbiInt256Matrix2x2Fuzz.t.sol | 12 + .../generated/fuzz/AbiInt32Array4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt32Fuzz.t.sol | 12 + .../generated/fuzz/AbiInt40Array4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt40Fuzz.t.sol | 12 + .../fuzz/AbiInt40Matrix2x2Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt48Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt56Fuzz.t.sol | 12 + .../generated/fuzz/AbiInt64Array4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt64Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt72Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt80Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt88Fuzz.t.sol | 12 + .../generated/fuzz/AbiInt8Array4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt8Fuzz.t.sol | 12 + .../generated/fuzz/AbiInt96Array4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiInt96Fuzz.t.sol | 12 + .../fuzz/AbiPairBoolAddressArray4Fuzz.t.sol | 12 + .../fuzz/AbiPairBoolAddressFuzz.t.sol | 13 + .../generated/fuzz/AbiPairStringU64Fuzz.t.sol | 14 + .../fuzz/AbiPairUint24Int40Array4Fuzz.t.sol | 12 + .../fuzz/AbiPairUint24Int40Fuzz.t.sol | 13 + .../generated/fuzz/AbiStringArray2Fuzz.t.sol | 14 + .../generated/fuzz/AbiStringArrayFuzz.t.sol | 16 + .../test/generated/fuzz/AbiStringFuzz.t.sol | 13 + .../fuzz/AbiStringU64PairArray2Fuzz.t.sol | 14 + .../fuzz/AbiStringU64PairArrayFuzz.t.sol | 16 + .../AbiTripleBoolAddressU256Array4Fuzz.t.sol | 12 + .../fuzz/AbiTripleBoolAddressU256Fuzz.t.sol | 13 + .../fuzz/AbiTripleStringBoolU64Fuzz.t.sol | 14 + .../test/generated/fuzz/AbiUint104Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint112Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint120Fuzz.t.sol | 12 + .../generated/fuzz/AbiUint128Array4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint128Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint136Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint144Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint152Fuzz.t.sol | 12 + .../generated/fuzz/AbiUint160Array4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint160Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint168Fuzz.t.sol | 12 + .../generated/fuzz/AbiUint16Array4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint16Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint176Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint184Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint192Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint200Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint208Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint216Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint224Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint232Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint240Fuzz.t.sol | 12 + .../generated/fuzz/AbiUint248Array4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint248Fuzz.t.sol | 12 + .../generated/fuzz/AbiUint24Array4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint24Fuzz.t.sol | 12 + .../fuzz/AbiUint24Matrix2x2Fuzz.t.sol | 12 + .../generated/fuzz/AbiUint256Array4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint256Fuzz.t.sol | 12 + .../fuzz/AbiUint256Matrix2x2Fuzz.t.sol | 12 + .../generated/fuzz/AbiUint32Array4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint32Fuzz.t.sol | 12 + .../generated/fuzz/AbiUint40Array4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint40Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint48Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint56Fuzz.t.sol | 12 + .../generated/fuzz/AbiUint64Array4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint64Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint72Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint80Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint88Fuzz.t.sol | 12 + .../generated/fuzz/AbiUint8Array4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint8Fuzz.t.sol | 12 + .../generated/fuzz/AbiUint96Array4Fuzz.t.sol | 12 + .../test/generated/fuzz/AbiUint96Fuzz.t.sol | 12 + .../generated/fuzz/AbiUintArrayFuzz.t.sol | 13 + .../generated/support/AbiRoundtripBase.sol | 100 + .../by_ref_trait_provider_storage_bug.snap | 3 +- .../fixtures/sonatina_ir/create_contract.snap | 14 +- .../effect_handle_field_deref.snap | 21 +- .../tests/fixtures/sonatina_ir/erc20.snap | 120 +- .../sonatina_ir/high_level_contract.snap | 632 ++-- .../immutable_contract_field_init_set.snap | 4 +- .../sonatina_ir/init_args_with_child_dep.snap | 4 +- .../newtype_storage_byplace_effect_arg.snap | 3 +- ...newtype_storage_field_mut_method_call.snap | 4 +- .../fixtures/sonatina_ir/storage_map.snap | 3 +- .../sonatina_ir/storage_packed_array.snap | 3 +- .../sonatina_ir/tstor_ptr_contract.snap | 3 +- .../sonatina_ir/tuple_return_contract.snap | 3 +- crates/hir/tests/runtime_builtin_func_kind.rs | 6 + 389 files changed, 17858 insertions(+), 440 deletions(-) create mode 100644 PR_OPTIMIZATIONS_TABLE.md create mode 100644 benchmarks/foundry-abi/.gitignore create mode 100644 benchmarks/foundry-abi/README.md create mode 100644 benchmarks/foundry-abi/fe/AbiRoundtrip.fe create mode 100644 benchmarks/foundry-abi/fe/BytesSuite.fe create mode 100644 benchmarks/foundry-abi/fe/DeepDynamicSuite.fe create mode 100644 benchmarks/foundry-abi/fe/DynArraySuite.fe create mode 100644 benchmarks/foundry-abi/fe/FixedArrayCeilingSuite.fe create mode 100644 benchmarks/foundry-abi/fe/FixedArraySuite.fe create mode 100644 benchmarks/foundry-abi/fe/NestedTupleSuite.fe create mode 100644 benchmarks/foundry-abi/foundry.toml create mode 100644 benchmarks/foundry-abi/reports/bytes-suite-gas.md create mode 100644 benchmarks/foundry-abi/reports/deep-dynamic-suite-gas.md create mode 100644 benchmarks/foundry-abi/reports/dyn-array-suite-gas.md create mode 100644 benchmarks/foundry-abi/reports/fixed-array-ceiling-suite-gas.md create mode 100644 benchmarks/foundry-abi/reports/fixed-array-suite-gas.md create mode 100644 benchmarks/foundry-abi/reports/gas-deltas.csv create mode 100644 benchmarks/foundry-abi/reports/gas-diagnosis.md create mode 100644 benchmarks/foundry-abi/reports/gas-optimization-estimates.md create mode 100644 benchmarks/foundry-abi/reports/gas-report.txt create mode 100644 benchmarks/foundry-abi/reports/gas-summary.md create mode 100644 benchmarks/foundry-abi/reports/hevm-equivalence-status.md create mode 100644 benchmarks/foundry-abi/reports/parity-status.md create mode 100644 benchmarks/foundry-abi/scripts/generate_matrix.py create mode 100644 benchmarks/foundry-abi/scripts/run_gas_report.py create mode 100755 benchmarks/foundry-abi/scripts/run_hevm_curated_matrix.sh create mode 100755 benchmarks/foundry-abi/scripts/run_hevm_equivalence.sh create mode 100644 benchmarks/foundry-abi/src/AbiRoundtripSol.sol create mode 100644 benchmarks/foundry-abi/src/BytesSuiteSol.sol create mode 100644 benchmarks/foundry-abi/src/DeepDynamicSuiteSol.sol create mode 100644 benchmarks/foundry-abi/src/FixedArrayCeilingSuiteSol.sol create mode 100644 benchmarks/foundry-abi/src/FixedArraySuiteSol.sol create mode 100644 benchmarks/foundry-abi/src/NestedTupleSuiteSol.sol create mode 100644 benchmarks/foundry-abi/test/AbiRoundtripEquivalence.t.sol create mode 100644 benchmarks/foundry-abi/test/BytesSuiteEquivalence.t.sol create mode 100644 benchmarks/foundry-abi/test/DeepDynamicSuiteEquivalence.t.sol create mode 100644 benchmarks/foundry-abi/test/DynArraySuiteEquivalence.t.sol create mode 100644 benchmarks/foundry-abi/test/FixedArrayCeilingSuiteEquivalence.t.sol create mode 100644 benchmarks/foundry-abi/test/FixedArraySuiteEquivalence.t.sol create mode 100644 benchmarks/foundry-abi/test/NestedTupleSuiteEquivalence.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiAddressArray4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiAddressBench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiAddressMatrix2x2Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiBoolAddressPairArrayBench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiBoolArray4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiBoolBench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiBoolMatrix2x2Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt104Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt112Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt120Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt128Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt128Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt136Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt144Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt152Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt160Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt160Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt168Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt16Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt16Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt176Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt184Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt192Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt200Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt208Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt216Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt224Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt232Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt240Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt248Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt248Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt24Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt24Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt256Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt256Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt256Matrix2x2Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt32Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt32Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt40Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt40Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt40Matrix2x2Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt48Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt56Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt64Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt64Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt72Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt80Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt88Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt8Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt8Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt96Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiInt96Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiPairBoolAddressArray4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiPairBoolAddressBench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiPairStringU64Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiPairUint24Int40Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiPairUint24Int40Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiStringArray2Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiStringArrayBench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiStringBench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiStringU64PairArray2Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiStringU64PairArrayBench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiTripleBoolAddressU256Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiTripleBoolAddressU256Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiTripleStringBoolU64Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint104Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint112Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint120Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint128Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint128Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint136Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint144Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint152Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint160Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint160Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint168Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint16Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint16Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint176Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint184Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint192Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint200Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint208Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint216Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint224Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint232Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint240Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint248Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint248Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint24Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint24Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint24Matrix2x2Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint256Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint256Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint256Matrix2x2Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint32Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint32Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint40Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint40Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint48Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint56Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint64Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint64Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint72Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint80Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint88Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint8Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint8Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint96Array4Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUint96Bench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/bench/AbiUintArrayBench.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiAddressArray4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiAddressDeterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiAddressMatrix2x2Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiBoolAddressPairArrayDeterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiBoolArray4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiBoolDeterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiBoolMatrix2x2Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt104Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt112Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt120Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt128Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt128Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt136Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt144Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt152Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt160Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt160Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt168Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt16Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt16Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt176Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt184Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt192Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt200Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt208Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt216Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt224Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt232Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt240Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt248Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt248Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt24Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt24Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt256Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt256Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt256Matrix2x2Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt32Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt32Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt40Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt40Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt40Matrix2x2Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt48Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt56Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt64Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt64Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt72Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt80Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt88Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt8Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt8Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt96Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiInt96Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiPairBoolAddressArray4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiPairBoolAddressDeterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiPairStringU64Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiPairUint24Int40Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiPairUint24Int40Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiStringArray2Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiStringArrayDeterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiStringDeterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiStringU64PairArray2Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiStringU64PairArrayDeterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiTripleBoolAddressU256Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiTripleBoolAddressU256Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiTripleStringBoolU64Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint104Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint112Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint120Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint128Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint128Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint136Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint144Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint152Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint160Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint160Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint168Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint16Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint16Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint176Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint184Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint192Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint200Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint208Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint216Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint224Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint232Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint240Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint248Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint248Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint24Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint24Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint24Matrix2x2Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint256Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint256Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint256Matrix2x2Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint32Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint32Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint40Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint40Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint48Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint56Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint64Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint64Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint72Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint80Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint88Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint8Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint8Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint96Array4Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUint96Deterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/deterministic/AbiUintArrayDeterministic.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiAddressArray4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiAddressFuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiAddressMatrix2x2Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiBoolAddressPairArrayFuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiBoolArray4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiBoolFuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiBoolMatrix2x2Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt104Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt112Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt120Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt128Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt128Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt136Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt144Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt152Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt160Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt160Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt168Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt16Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt16Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt176Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt184Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt192Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt200Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt208Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt216Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt224Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt232Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt240Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt248Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt248Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt24Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt24Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt256Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt256Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt256Matrix2x2Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt32Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt32Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt40Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt40Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt40Matrix2x2Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt48Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt56Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt64Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt64Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt72Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt80Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt88Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt8Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt8Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt96Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiInt96Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiPairBoolAddressArray4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiPairBoolAddressFuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiPairStringU64Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiPairUint24Int40Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiPairUint24Int40Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiStringArray2Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiStringArrayFuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiStringFuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiStringU64PairArray2Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiStringU64PairArrayFuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiTripleBoolAddressU256Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiTripleBoolAddressU256Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiTripleStringBoolU64Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint104Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint112Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint120Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint128Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint128Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint136Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint144Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint152Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint160Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint160Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint168Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint16Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint16Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint176Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint184Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint192Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint200Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint208Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint216Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint224Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint232Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint240Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint248Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint248Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint24Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint24Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint24Matrix2x2Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint256Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint256Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint256Matrix2x2Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint32Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint32Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint40Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint40Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint48Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint56Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint64Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint64Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint72Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint80Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint88Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint8Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint8Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint96Array4Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUint96Fuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/fuzz/AbiUintArrayFuzz.t.sol create mode 100644 benchmarks/foundry-abi/test/generated/support/AbiRoundtripBase.sol diff --git a/Makefile b/Makefile index 1a45c86ac5..ddb9fe6ef0 100644 --- a/Makefile +++ b/Makefile @@ -66,6 +66,121 @@ lint: rustfmt clippy build-docs: cargo doc --no-deps --workspace +.PHONY: foundry-abi-generate +foundry-abi-generate: + python3 benchmarks/foundry-abi/scripts/generate_matrix.py + +.PHONY: foundry-abi-build-fe +foundry-abi-build-fe: foundry-abi-generate + cargo run --release -q -p fe -- build --backend sonatina --contract AbiRoundtripFe --out-dir benchmarks/foundry-abi/fe-out benchmarks/foundry-abi/fe/AbiRoundtrip.fe + +.PHONY: foundry-abi-test +foundry-abi-test: foundry-abi-build-fe-all + forge test --root benchmarks/foundry-abi --offline + +.PHONY: foundry-abi-gas +foundry-abi-gas: foundry-abi-build-fe-all + python3 benchmarks/foundry-abi/scripts/run_gas_report.py + +.PHONY: foundry-abi-build-fe-all +foundry-abi-build-fe-all: foundry-abi-build-fe foundry-abi-build-fe-dyn foundry-abi-build-fe-bytes foundry-abi-build-fe-deep foundry-abi-build-fe-fixed foundry-abi-build-fe-ceiling foundry-abi-build-fe-nested + +.PHONY: foundry-abi-build-fe-dyn +foundry-abi-build-fe-dyn: + cargo run --release -q -p fe -- build --backend sonatina --contract DynArraySuite --out-dir benchmarks/foundry-abi/fe-out benchmarks/foundry-abi/fe/DynArraySuite.fe + +.PHONY: foundry-abi-test-dyn +foundry-abi-test-dyn: foundry-abi-build-fe-dyn + forge test --root benchmarks/foundry-abi --offline --match-path test/DynArraySuiteEquivalence.t.sol + +.PHONY: foundry-abi-gas-dyn +foundry-abi-gas-dyn: foundry-abi-build-fe-dyn + forge test --root benchmarks/foundry-abi --offline --match-path test/DynArraySuiteEquivalence.t.sol --gas-report + +.PHONY: foundry-abi-build-fe-bytes +foundry-abi-build-fe-bytes: + cargo run --release -q -p fe -- build --backend sonatina --contract BytesSuite --out-dir benchmarks/foundry-abi/fe-out benchmarks/foundry-abi/fe/BytesSuite.fe + +.PHONY: foundry-abi-test-bytes +foundry-abi-test-bytes: foundry-abi-build-fe-bytes + forge test --root benchmarks/foundry-abi --offline --match-path test/BytesSuiteEquivalence.t.sol + +.PHONY: foundry-abi-gas-bytes +foundry-abi-gas-bytes: foundry-abi-build-fe-bytes + forge test --root benchmarks/foundry-abi --offline --match-path test/BytesSuiteEquivalence.t.sol --gas-report + +.PHONY: foundry-abi-build-fe-deep +foundry-abi-build-fe-deep: + cargo run --release -q -p fe -- build --backend sonatina --contract DeepDynamicSuite --out-dir benchmarks/foundry-abi/fe-out benchmarks/foundry-abi/fe/DeepDynamicSuite.fe + +.PHONY: foundry-abi-build-fe-fixed +foundry-abi-build-fe-fixed: + cargo run --release -q -p fe -- build --backend sonatina --contract FixedArraySuite --out-dir benchmarks/foundry-abi/fe-out benchmarks/foundry-abi/fe/FixedArraySuite.fe + +.PHONY: foundry-abi-build-fe-ceiling +foundry-abi-build-fe-ceiling: + cargo run --release -q -p fe -- build --backend sonatina --contract FixedArrayCeilingSuite --out-dir benchmarks/foundry-abi/fe-out benchmarks/foundry-abi/fe/FixedArrayCeilingSuite.fe + +.PHONY: foundry-abi-build-fe-nested +foundry-abi-build-fe-nested: + cargo run --release -q -p fe -- build --backend sonatina --contract NestedTupleSuite --out-dir benchmarks/foundry-abi/fe-out benchmarks/foundry-abi/fe/NestedTupleSuite.fe + +.PHONY: foundry-abi-test-deep +foundry-abi-test-deep: foundry-abi-build-fe-deep + forge test --root benchmarks/foundry-abi --offline --match-path test/DeepDynamicSuiteEquivalence.t.sol + +.PHONY: foundry-abi-test-fixed +foundry-abi-test-fixed: foundry-abi-build-fe-fixed + forge test --root benchmarks/foundry-abi --offline --match-path test/FixedArraySuiteEquivalence.t.sol + +.PHONY: foundry-abi-test-ceiling +foundry-abi-test-ceiling: foundry-abi-build-fe-ceiling + forge test --root benchmarks/foundry-abi --offline --match-path test/FixedArrayCeilingSuiteEquivalence.t.sol + +.PHONY: foundry-abi-test-nested +foundry-abi-test-nested: foundry-abi-build-fe-nested + forge test --root benchmarks/foundry-abi --offline --match-path test/NestedTupleSuiteEquivalence.t.sol + +.PHONY: foundry-abi-gas-deep +foundry-abi-gas-deep: foundry-abi-build-fe-deep + forge test --root benchmarks/foundry-abi --offline --match-path test/DeepDynamicSuiteEquivalence.t.sol --gas-report + +.PHONY: foundry-abi-gas-fixed +foundry-abi-gas-fixed: foundry-abi-build-fe-fixed + forge test --root benchmarks/foundry-abi --offline --match-path test/FixedArraySuiteEquivalence.t.sol --gas-report + +.PHONY: foundry-abi-gas-ceiling +foundry-abi-gas-ceiling: foundry-abi-build-fe-ceiling + forge test --root benchmarks/foundry-abi --offline --match-path test/FixedArrayCeilingSuiteEquivalence.t.sol --gas-report + +.PHONY: foundry-abi-gas-nested +foundry-abi-gas-nested: foundry-abi-build-fe-nested + forge test --root benchmarks/foundry-abi --offline --match-path test/NestedTupleSuiteEquivalence.t.sol --gas-report + +.PHONY: foundry-abi-stress-dyn +foundry-abi-stress-dyn: foundry-abi-build-fe-dyn + forge test --root benchmarks/foundry-abi --offline --threads 0 --fuzz-runs $${FUZZ_RUNS:-20000} --match-path test/DynArraySuiteEquivalence.t.sol + +.PHONY: foundry-abi-stress-bytes +foundry-abi-stress-bytes: foundry-abi-build-fe-bytes + forge test --root benchmarks/foundry-abi --offline --threads 0 --fuzz-runs $${FUZZ_RUNS:-20000} --match-path test/BytesSuiteEquivalence.t.sol + +.PHONY: foundry-abi-stress-deep +foundry-abi-stress-deep: foundry-abi-build-fe-deep + forge test --root benchmarks/foundry-abi --offline --threads 0 --fuzz-runs $${FUZZ_RUNS:-20000} --match-path test/DeepDynamicSuiteEquivalence.t.sol + +.PHONY: foundry-abi-stress-fixed +foundry-abi-stress-fixed: foundry-abi-build-fe-fixed + forge test --root benchmarks/foundry-abi --offline --threads 0 --fuzz-runs $${FUZZ_RUNS:-5000} --match-path test/FixedArraySuiteEquivalence.t.sol + +.PHONY: foundry-abi-stress-ceiling +foundry-abi-stress-ceiling: foundry-abi-build-fe-ceiling + forge test --root benchmarks/foundry-abi --offline --threads 0 --fuzz-runs $${FUZZ_RUNS:-2000} --match-path test/FixedArrayCeilingSuiteEquivalence.t.sol + +.PHONY: foundry-abi-stress-nested +foundry-abi-stress-nested: foundry-abi-build-fe-nested + forge test --root benchmarks/foundry-abi --offline --threads 0 --fuzz-runs $${FUZZ_RUNS:-5000} --match-path test/NestedTupleSuiteEquivalence.t.sol + README.md: src/main.rs cargo readme --no-title --no-indent-headings > README.md diff --git a/PR_OPTIMIZATIONS_TABLE.md b/PR_OPTIMIZATIONS_TABLE.md new file mode 100644 index 0000000000..34c78b4fe9 --- /dev/null +++ b/PR_OPTIMIZATIONS_TABLE.md @@ -0,0 +1,21 @@ +# ABI Optimization PR Table + +| Metric | Before (parity snapshot) | After (this series) | Delta | +| --- | ---: | ---: | ---: | +| Mean gas delta (Fe avg - Solidity avg) | +1588.82 | -579.71 | -2168.53 | +| Median gas delta (Fe avg - Solidity avg) | +1534.00 | -33.00 | -1567.00 | +| Best single-case delta | -1078 (`benchEchoBoolAddressPairArray`) | -6865 (-12.95%) (`benchEchoStringU64PairArray`) | n/a | +| Worst single-case delta | +5203 (`benchEchoStringU64PairArray2`) | +34 (+0.13%) (`benchEchoInt56`) | n/a | + +| Commit | Area | Change | +| --- | --- | --- | +| [`9e0167d0f`](https://github.com/argotorg/fe/commit/9e0167d0f2ef086d3faec726cee984e4167f35e5) | ABI dynamic payloads | Bulk-copy dynamic ABI payloads and tighten dynamic-span calculations. | +| [`ee68df1e0`](https://github.com/argotorg/fe/commit/ee68df1e08fc313520b9356642f3be7c0394561f) | Solidity ABI custom integers | Cheaper custom-width canonical checks; `signextend`-based signed checks; tighten runtime lowering. | +| [`804fb842f`](https://github.com/argotorg/fe/commit/804fb842f04b0a10fcb6e62f3dd3d0c657e31e12) | ABI copy lowering | Lower core `mcopy` as an intrinsic across MIR/Yul/Sonatina. | +| [`59ba5430a`](https://github.com/argotorg/fe/commit/59ba5430ac8eece96bd4b4e7da167427b233ff0f) | ABI encode | Fast-path `DIRECT_ENCODE` `encode_to_ptr`. | +| [`96c078014`](https://github.com/argotorg/fe/commit/96c07801457ff83dcfc24f839117bf582530917c) | ABI passthrough validation | Add calldata passthrough validation fast paths across lowering/validation. | +| [`205555dd3`](https://github.com/argotorg/fe/commit/205555dd354677e457162777508c127789df0494) | Tuple/fixed-array validation | Optimize tuple + fixed-array `AbiValidate` and inline hot checks. | +| [`aa158ec69`](https://github.com/argotorg/fe/commit/aa158ec69dcc72d4b7d5d943b642fab15bc6f690) | Runtime selector dispatch | Replace linear selector dispatch with binary search. | +| [`4120cbccf`](https://github.com/argotorg/fe/commit/4120cbccf6e260f4438a49f8bdce0a7773dea03b) | ABI passthrough runtime | Avoid malloc in ABI passthrough arms by constructing calldata views directly. | +| [`9f8000eda`](https://github.com/argotorg/fe/commit/9f8000eda025cacc8d89b6ad44d753343896f374) | Calldata validation arithmetic | Avoid checked arithmetic in calldata view validation where bounds are established. | +| [`4a5777d33`](https://github.com/argotorg/fe/commit/4a5777d33909dc8fab8db298c9c9de6581379263) | Scalar/static ABI decode | Optimize scalar word decode + static ABI decode/validation; final source checkpoint used by the reports. | diff --git a/benchmarks/foundry-abi/.gitignore b/benchmarks/foundry-abi/.gitignore new file mode 100644 index 0000000000..aeb05cf3db --- /dev/null +++ b/benchmarks/foundry-abi/.gitignore @@ -0,0 +1,6 @@ +cache/ +out/ +broadcast/ +fe-out/ +__pycache__/ +*.pyc diff --git a/benchmarks/foundry-abi/README.md b/benchmarks/foundry-abi/README.md new file mode 100644 index 0000000000..20c2793899 --- /dev/null +++ b/benchmarks/foundry-abi/README.md @@ -0,0 +1,351 @@ +# Foundry ABI Roundtrip Harness + +This subproject compares matching Solidity and Fe contracts that only decode +ABI input and re-encode the same value on return. + +It exists for three jobs: + +1. Equivalence: verify that Solidity and Fe produce the same raw return bytes + for the same calldata. +2. Fuzzing: run broad randomized input coverage over the same Fe/Solidity ABI + surface. +3. Benchmarking: run gas-reportable wrapper calls so Solidity and Fe paths can + be compared function-by-function. + +For the current rebased-branch parity status, including the focused fixed-array, +fixed-array-ceiling, and deep-dynamic suites plus the remaining compiler +limits, see +`benchmarks/foundry-abi/reports/parity-status.md`. +For the current gas-regression diagnosis, see +`benchmarks/foundry-abi/reports/gas-diagnosis.md`. +For the current formal `hevm` equivalence snapshot, see +`benchmarks/foundry-abi/reports/hevm-equivalence-status.md`. + +## Generation Model + +Most of the harness is generated from +`benchmarks/foundry-abi/scripts/generate_matrix.py`. + +That script rewrites: + +- `fe/AbiRoundtrip.fe` +- `src/AbiRoundtripSol.sol` +- `test/generated/` + +Current generated size: + +- 111 ABI cases +- 333 generated Foundry test files +- deterministic, fuzz, and benchmark coverage for every generated case + +## Covered Shapes + +Current generated coverage includes: + +- native scalars: `bool`, `address`, `string`, `bytes` +- native integers: `uint8/16/32/64/128/256` and `int8/16/32/64/128/256` +- custom-width Solidity integers backed by `std::abi::sol` wrappers: + `uint24/40/48/56/72/80/88/96/104/112/120/136/144/152/160/168/176/184/192/200/208/216/224/232/240/248` + and the matching signed widths +- fixed arrays for: + native scalars and integers + representative custom widths: + `uint24/40/96/160/248` and `int24/40/96/160/248` +- representative nested fixed arrays (`2x2`) for: + `bool`, `address`, `uint256`, `int256`, `uint24`, `int40` +- tuple-shaped inputs/returns covering mixed static/dynamic layouts: + `(string,uint64)`, `(bool,address)`, `(uint24,int40)`, + `(bool,address,uint256)`, `(string,bool,uint64)` +- nested tuples (tuple-of-tuples) covering wrapper-required inner tuples: + `((bool,address),uint256)`, `(bool,(address,uint256))`, `((string,uint64),bool)`, + `((string,uint64),(bytes,bool))` +- static tuple arrays for: + `(bool,address)[4]`, `(uint24,int40)[4]`, `(bool,address,uint256)[4]` +- fixed arrays with dynamic elements for: + `string[2]`, `(string,uint64)[2]` +- variable-length arrays (`T[]`) for: + `uint256[]`, `(bool,address)[]`, `string[]`, `(string,uint64)[]` +- focused deeper dynamic cases for: + `uint24[]`, `bytes[]`, `bytes[][]`, `uint256[][]`, `string[][]`, + `(string,uint64)[][]`, `(bytes,uint64)`, `(bytes,uint64)[]`, + `(bytes,uint64)[][]` +- focused larger fixed-array cases for: + `bool[5]`, `uint256[8]`, `uint256[16]`, `string[5]`, `bytes[5]`, + `(bool,address)[8]`, `(string,uint64)[5]`, `(bytes,uint64)[5]`, + `uint256[5][2]` +- focused fixed-array ceiling cases for: + `bool[17]`, `uint256[32]`, `string[17]`, `bytes[17]` + +Notes: + +- Generated and focused string cases now use `std::abi::DynString`, and their + deterministic / fuzz payloads intentionally cross the old single-word + boundary so the harness measures real dynamic Solidity `string` behavior. +- String literals now coerce directly in `DynString`-typed contexts, and + unannotated local bindings can still infer to `DynString` from later use + sites, so contract/message returns and args can materialize real + long-payload ABI strings without a manual bridge helper. +- The standard prelude now re-exports `std::abi::Text` as a friendlier alias + for `DynString` and `std::abi::Vec` as a friendlier alias for + `DynArray`. Composite ABI lowering now treats those aliases as dynamic + too, so `(Text, u64)`, `[Text; N]` fixed-array element shapes, and + the focused suite contracts keep the correct Solidity head/tail behavior. +- `Text.view()` and `Text.as_bytes()` are both exercised through + `fe-contract-harness`, so the friendlier string surface now covers both + plain roundtrips and direct payload inspection. +- The general language default still infers fixed-capacity `String` when no + `DynString` context is present, so default language-level string inference is + still not fully migrated. +- The fixed-array ABI path in `ingots/core/src/abi.fe` is const-generic again. + Contract/message ABI roundtrips are covered in `crates/contract-harness` + through `bool[65]`, `string[65]`, and `bytes[65]`, and the merged + `FixedArraySuite` / `FixedArrayCeilingSuite` both pass under the default + optimized Sonatina pipeline. +- Generated fuzz suites live under `test/generated/fuzz/` and run under + Foundry's fuzz engine. The default `forge test` path exercises them all. +- Custom-width integer wrappers now participate in array and tuple-array + coverage because they implement the value-type `Copy` behavior needed by the + generic Fe ABI array encoder. +- Dynamic tuple returns now use the same single-output Solidity struct/tuple ABI + shape as Solidity itself. The harness compares the raw encoded return bytes + directly instead of relying on flattened return-value workarounds. +- Variable-length arrays are currently verified through the focused + `DynArraySuite` smoke suite and gas report. The generated all-cases + `AbiRoundtripFe` contract currently hits a compile-scale wall once the `T[]` + cases are included, so dynamic-array validation is split out instead of + relying on the single monolithic generated contract. +- First-class dynamic `bytes` are verified through the focused `BytesSuite` + smoke suite and gas report. +- Gas reporting is done through `SolBenchCaller` and `FeBenchCaller`. +- `make foundry-abi-gas` writes raw and summarized reports under + `benchmarks/foundry-abi/reports/`. +- The generated matrix targets are not concurrency-safe: `make foundry-abi-test` + and `make foundry-abi-gas` both rewrite `test/generated/`, so they should be + run serially rather than in parallel. + +## Verification Snapshot + +Latest verified full generated-harness status in this worktree on +`2026-03-27`: + +- `cargo test --release -p fe-contract-harness dynamic_string_ -- --nocapture` +- `cargo test --release -p fe-contract-harness dynamic_tuple_ -- --nocapture` +- `cargo test --release -p fe-contract-harness fixed_array_contract_ -- --nocapture` +- `python3 benchmarks/foundry-abi/scripts/generate_matrix.py` +- `cargo run --release -q -p fe -- build --backend sonatina --contract AbiRoundtripFe --out-dir benchmarks/foundry-abi/fe-out benchmarks/foundry-abi/fe/AbiRoundtrip.fe` +- `forge test --root benchmarks/foundry-abi --offline` +- `339` suites +- `615` tests passed +- `0` failed +- `0` skipped + +Latest focused dynamic-array run: + +- `make foundry-abi-test-dyn` +- 8 tests passed +- 0 failed +- includes deterministic and Foundry fuzz coverage for: + `uint256[]`, `(bool,address)[]`, `string[]`, `(string,uint64)[]` + +Latest focused bytes run: + +- `make foundry-abi-test-bytes` +- 4 tests passed +- 0 failed +- includes deterministic coverage for short, multi-word, and `31/32/33`-byte + boundary payloads plus Foundry fuzzing over `bytes` + +Deep-dynamic focused suite: + +- harness files: + `benchmarks/foundry-abi/fe/DeepDynamicSuite.fe` + `benchmarks/foundry-abi/src/DeepDynamicSuiteSol.sol` + `benchmarks/foundry-abi/test/DeepDynamicSuiteEquivalence.t.sol` +- dedicated make targets: + `make foundry-abi-build-fe-deep` + `make foundry-abi-test-deep` + `make foundry-abi-gas-deep` +- dedicated stress target: + `make foundry-abi-stress-deep` +- currently covers 18 tests including `bytes[][]` and `(bytes,uint64)[][]` +- current detailed status is recorded in + `benchmarks/foundry-abi/reports/parity-status.md` +- gas deltas are recorded in + `benchmarks/foundry-abi/reports/deep-dynamic-suite-gas.md` + +Fixed-array focused suite: + +- harness files: + `benchmarks/foundry-abi/fe/FixedArraySuite.fe` + `benchmarks/foundry-abi/src/FixedArraySuiteSol.sol` + `benchmarks/foundry-abi/test/FixedArraySuiteEquivalence.t.sol` +- dedicated make targets: + `make foundry-abi-build-fe-fixed` + `make foundry-abi-test-fixed` + `make foundry-abi-gas-fixed` +- dedicated stress target: + `make foundry-abi-stress-fixed` +- currently covers 26 tests across larger fixed-array shapes, including + `bool[17]`, `uint256[32]`, nested `uint256[5][2]`, and dynamic-element cases + like `bytes[5]`, `(bytes,uint64)[5]`, `string[17]`, and `bytes[17]` +- gas deltas are recorded in + `benchmarks/foundry-abi/reports/fixed-array-suite-gas.md` + +Fixed-array ceiling suite: + +- harness files: + `benchmarks/foundry-abi/fe/FixedArrayCeilingSuite.fe` + `benchmarks/foundry-abi/src/FixedArrayCeilingSuiteSol.sol` + `benchmarks/foundry-abi/test/FixedArrayCeilingSuiteEquivalence.t.sol` +- dedicated make targets: + `make foundry-abi-build-fe-ceiling` + `make foundry-abi-test-ceiling` + `make foundry-abi-gas-ceiling` +- dedicated stress target: + `make foundry-abi-stress-ceiling` +- currently covers 8 tests across the new fixed-array ceiling shapes: + `bool[17]`, `uint256[32]`, `string[17]`, `bytes[17]` +- this suite remains useful even though the merged `FixedArraySuite` now builds + and passes; it isolates the larger `[17]` / `[32]` cases for faster + regressions and separate gas reporting +- gas deltas are recorded in + `benchmarks/foundry-abi/reports/fixed-array-ceiling-suite-gas.md` + +Latest focused stress snapshot on the rebased branch: + +- `forge test --root benchmarks/foundry-abi --offline --threads 0 --fuzz-runs 20000 --match-path test/BytesSuiteEquivalence.t.sol` +- `forge test --root benchmarks/foundry-abi --offline --threads 0 --fuzz-runs 10000 --match-path test/DynArraySuiteEquivalence.t.sol` +- `forge test --root benchmarks/foundry-abi --offline --threads 0 --fuzz-runs 256 --match-path test/DeepDynamicSuiteEquivalence.t.sol` +- `forge test --root benchmarks/foundry-abi --offline --threads 0 --fuzz-runs 5000 --match-path test/FixedArraySuiteEquivalence.t.sol` +- `forge test --root benchmarks/foundry-abi --offline --threads 0 --fuzz-runs 2000 --match-path test/FixedArrayCeilingSuiteEquivalence.t.sol` + +Those all passed. The detailed timings and current parity notes are tracked in +`benchmarks/foundry-abi/reports/parity-status.md`. + +Latest gas summary: + +- compared bench functions: `111` +- mean Fe minus Solidity delta: `+1594.33` gas +- median Fe minus Solidity delta: `+1419.00` gas +- worst category by mean delta: + fixed arrays of dynamic tuples (`+6322.50` gas) +- best category by mean delta: scalar address (`-118.00` gas) + +Representative gas findings: + +- worst single regression: `benchEchoStringU64PairArray` `+6656` gas +- next worst: `benchEchoStringArray2` `+6063` gas +- outright improvements: `benchEchoAddress` `-118` gas and `benchEchoBool` `-10` gas +- closest remaining positive delta: `benchEchoBoolAddressPairArray4` `+63` gas + +Focused dynamic-array gas snapshot: + +- `make foundry-abi-gas-dyn` +- report: `benchmarks/foundry-abi/reports/dyn-array-suite-gas.md` +- wrapper deltas: + `benchEchoUintArray` `+3102` + `benchEchoBoolAddressPairArray` `+1532` + `benchEchoStringArray` `+4553` + `benchEchoStringU64PairArray` `+6621` + +Focused bytes gas snapshot: + +- `make foundry-abi-gas-bytes` +- report: `benchmarks/foundry-abi/reports/bytes-suite-gas.md` +- wrapper delta: + `benchEchoBytes` `+1718` + +Focused deep-dynamic gas snapshot: + +- `make foundry-abi-gas-deep` +- report: `benchmarks/foundry-abi/reports/deep-dynamic-suite-gas.md` +- representative wrapper deltas: + `benchEchoBytesU64Pair` `+2339` + `benchEchoNestedUintArray` `+3906` + `benchEchoNestedBytesArray` `+10241` + `benchEchoNestedBytesU64PairArray` `+15022` + +Focused fixed-array gas snapshot: + +- `make foundry-abi-gas-fixed` +- report: `benchmarks/foundry-abi/reports/fixed-array-suite-gas.md` +- representative wrapper deltas: + `benchEchoBoolAddressPairArray8` `-4817` + `benchEchoUintArray32` `+3069` + `benchEchoBytesArray17` `+23596` + `benchEchoStringArray17` `+24071` + +Focused fixed-array ceiling gas snapshot: + +- `make foundry-abi-gas-ceiling` +- report: `benchmarks/foundry-abi/reports/fixed-array-ceiling-suite-gas.md` +- representative wrapper deltas: + `benchEchoBoolArray17` `+2916` + `benchEchoUintArray32` `+2874` + `benchEchoBytesArray17` `+23359` + `benchEchoStringArray17` `+23667` + +## Commands + +From repo root: + +- `make foundry-abi-generate` +- `make foundry-abi-build-fe` +- `make foundry-abi-test` +- `make foundry-abi-gas` +- `make foundry-abi-build-fe-dyn` +- `make foundry-abi-test-dyn` +- `make foundry-abi-gas-dyn` +- `make foundry-abi-build-fe-bytes` +- `make foundry-abi-test-bytes` +- `make foundry-abi-gas-bytes` +- `make foundry-abi-build-fe-deep` +- `make foundry-abi-test-deep` +- `make foundry-abi-gas-deep` +- `make foundry-abi-build-fe-fixed` +- `make foundry-abi-test-fixed` +- `make foundry-abi-gas-fixed` +- `make foundry-abi-build-fe-ceiling` +- `make foundry-abi-test-ceiling` +- `make foundry-abi-gas-ceiling` +- `make foundry-abi-stress-bytes` +- `make foundry-abi-stress-dyn` +- `make foundry-abi-stress-deep` +- `make foundry-abi-stress-fixed` +- `make foundry-abi-stress-ceiling` +- `forge test --root benchmarks/foundry-abi --offline --match-path 'test/generated/fuzz/*'` + to run only the generated fuzz suites +- `forge test --root benchmarks/foundry-abi --offline --match-path test/DynArraySuiteEquivalence.t.sol` + to run only the focused variable-length-array suite +- `forge test --root benchmarks/foundry-abi --offline --match-path test/BytesSuiteEquivalence.t.sol` + to run only the focused `bytes` suite +- `forge test --root benchmarks/foundry-abi --offline --match-path test/DeepDynamicSuiteEquivalence.t.sol` + to run only the focused deep-dynamic suite +- `forge test --root benchmarks/foundry-abi --offline --match-path test/FixedArraySuiteEquivalence.t.sol` + to run only the focused larger fixed-array suite + +## Known Gaps + +This is a large ABI expansion, not full Solidity ABI parity yet. + +Not yet covered here: + +- automatic migration of the default language-level string surface to dynamic + owned strings; arbitrary-length ABI parity is available today through + explicit `std::abi::DynString` + +- exhaustive coverage across all fixed-array lengths and tuple/array shape + combinations, even though the const-generic fixed-array ABI path now + roundtrips beyond the old `[64]` ceiling +- broader variable-length-array coverage beyond the focused representative set: + custom-width integers, deeper tuple nesting, nested dynamic arrays +- deeper nested tuple/array combinations beyond the generated representative set +- broader dynamic-element fixed-array coverage beyond the representative + generated `string[2]` / `(string,uint64)[2]` cases and the focused + `string[5]` / `bytes[5]` / `(string,uint64)[5]` / `(bytes,uint64)[5]` / + `string[17]` / `bytes[17]` cases +- gas parity still lags most for dynamic-element fixed arrays and nested + deep-dynamic wrappers, even after the refreshed post-Sonatina rerun +- current rebased-branch parity investigation notes, including the remaining + coverage and gas hot spots, are tracked in + `benchmarks/foundry-abi/reports/parity-status.md` diff --git a/benchmarks/foundry-abi/fe/AbiRoundtrip.fe b/benchmarks/foundry-abi/fe/AbiRoundtrip.fe new file mode 100644 index 0000000000..27c940b5ca --- /dev/null +++ b/benchmarks/foundry-abi/fe/AbiRoundtrip.fe @@ -0,0 +1,676 @@ +use std::abi::{sol, DynArray, DynString} +use std::abi::sol::{Int104, Int112, Int120, Int136, Int144, Int152, Int160, Int168, Int176, Int184, Int192, Int200, Int208, Int216, Int224, Int232, Int24, Int240, Int248, Int40, Int48, Int56, Int72, Int80, Int88, Int96, Uint104, Uint112, Uint120, Uint136, Uint144, Uint152, Uint160, Uint168, Uint176, Uint184, Uint192, Uint200, Uint208, Uint216, Uint224, Uint232, Uint24, Uint240, Uint248, Uint40, Uint48, Uint56, Uint72, Uint80, Uint88, Uint96} +use std::evm::Address + +msg AbiRoundtripMsg { + #[selector = sol("echoBool(bool)")] + EchoBool { value: bool } -> bool, + #[selector = sol("echoAddress(address)")] + EchoAddress { value: Address } -> Address, + #[selector = sol("echoString(string)")] + EchoString { value: DynString } -> DynString, + #[selector = sol("echoUint8(uint8)")] + EchoUint8 { value: u8 } -> u8, + #[selector = sol("echoUint16(uint16)")] + EchoUint16 { value: u16 } -> u16, + #[selector = sol("echoUint32(uint32)")] + EchoUint32 { value: u32 } -> u32, + #[selector = sol("echoUint64(uint64)")] + EchoUint64 { value: u64 } -> u64, + #[selector = sol("echoUint128(uint128)")] + EchoUint128 { value: u128 } -> u128, + #[selector = sol("echoUint(uint256)")] + EchoUint { value: u256 } -> u256, + #[selector = sol("echoInt8(int8)")] + EchoInt8 { value: i8 } -> i8, + #[selector = sol("echoInt16(int16)")] + EchoInt16 { value: i16 } -> i16, + #[selector = sol("echoInt32(int32)")] + EchoInt32 { value: i32 } -> i32, + #[selector = sol("echoInt64(int64)")] + EchoInt64 { value: i64 } -> i64, + #[selector = sol("echoInt128(int128)")] + EchoInt128 { value: i128 } -> i128, + #[selector = sol("echoInt256(int256)")] + EchoInt256 { value: i256 } -> i256, + #[selector = sol("echoUint24(uint24)")] + EchoUint24 { value: Uint24 } -> Uint24, + #[selector = sol("echoUint40(uint40)")] + EchoUint40 { value: Uint40 } -> Uint40, + #[selector = sol("echoUint48(uint48)")] + EchoUint48 { value: Uint48 } -> Uint48, + #[selector = sol("echoUint56(uint56)")] + EchoUint56 { value: Uint56 } -> Uint56, + #[selector = sol("echoUint72(uint72)")] + EchoUint72 { value: Uint72 } -> Uint72, + #[selector = sol("echoUint80(uint80)")] + EchoUint80 { value: Uint80 } -> Uint80, + #[selector = sol("echoUint88(uint88)")] + EchoUint88 { value: Uint88 } -> Uint88, + #[selector = sol("echoUint96(uint96)")] + EchoUint96 { value: Uint96 } -> Uint96, + #[selector = sol("echoUint104(uint104)")] + EchoUint104 { value: Uint104 } -> Uint104, + #[selector = sol("echoUint112(uint112)")] + EchoUint112 { value: Uint112 } -> Uint112, + #[selector = sol("echoUint120(uint120)")] + EchoUint120 { value: Uint120 } -> Uint120, + #[selector = sol("echoUint136(uint136)")] + EchoUint136 { value: Uint136 } -> Uint136, + #[selector = sol("echoUint144(uint144)")] + EchoUint144 { value: Uint144 } -> Uint144, + #[selector = sol("echoUint152(uint152)")] + EchoUint152 { value: Uint152 } -> Uint152, + #[selector = sol("echoUint160(uint160)")] + EchoUint160 { value: Uint160 } -> Uint160, + #[selector = sol("echoUint168(uint168)")] + EchoUint168 { value: Uint168 } -> Uint168, + #[selector = sol("echoUint176(uint176)")] + EchoUint176 { value: Uint176 } -> Uint176, + #[selector = sol("echoUint184(uint184)")] + EchoUint184 { value: Uint184 } -> Uint184, + #[selector = sol("echoUint192(uint192)")] + EchoUint192 { value: Uint192 } -> Uint192, + #[selector = sol("echoUint200(uint200)")] + EchoUint200 { value: Uint200 } -> Uint200, + #[selector = sol("echoUint208(uint208)")] + EchoUint208 { value: Uint208 } -> Uint208, + #[selector = sol("echoUint216(uint216)")] + EchoUint216 { value: Uint216 } -> Uint216, + #[selector = sol("echoUint224(uint224)")] + EchoUint224 { value: Uint224 } -> Uint224, + #[selector = sol("echoUint232(uint232)")] + EchoUint232 { value: Uint232 } -> Uint232, + #[selector = sol("echoUint240(uint240)")] + EchoUint240 { value: Uint240 } -> Uint240, + #[selector = sol("echoUint248(uint248)")] + EchoUint248 { value: Uint248 } -> Uint248, + #[selector = sol("echoInt24(int24)")] + EchoInt24 { value: Int24 } -> Int24, + #[selector = sol("echoInt40(int40)")] + EchoInt40 { value: Int40 } -> Int40, + #[selector = sol("echoInt48(int48)")] + EchoInt48 { value: Int48 } -> Int48, + #[selector = sol("echoInt56(int56)")] + EchoInt56 { value: Int56 } -> Int56, + #[selector = sol("echoInt72(int72)")] + EchoInt72 { value: Int72 } -> Int72, + #[selector = sol("echoInt80(int80)")] + EchoInt80 { value: Int80 } -> Int80, + #[selector = sol("echoInt88(int88)")] + EchoInt88 { value: Int88 } -> Int88, + #[selector = sol("echoInt96(int96)")] + EchoInt96 { value: Int96 } -> Int96, + #[selector = sol("echoInt104(int104)")] + EchoInt104 { value: Int104 } -> Int104, + #[selector = sol("echoInt112(int112)")] + EchoInt112 { value: Int112 } -> Int112, + #[selector = sol("echoInt120(int120)")] + EchoInt120 { value: Int120 } -> Int120, + #[selector = sol("echoInt136(int136)")] + EchoInt136 { value: Int136 } -> Int136, + #[selector = sol("echoInt144(int144)")] + EchoInt144 { value: Int144 } -> Int144, + #[selector = sol("echoInt152(int152)")] + EchoInt152 { value: Int152 } -> Int152, + #[selector = sol("echoInt160(int160)")] + EchoInt160 { value: Int160 } -> Int160, + #[selector = sol("echoInt168(int168)")] + EchoInt168 { value: Int168 } -> Int168, + #[selector = sol("echoInt176(int176)")] + EchoInt176 { value: Int176 } -> Int176, + #[selector = sol("echoInt184(int184)")] + EchoInt184 { value: Int184 } -> Int184, + #[selector = sol("echoInt192(int192)")] + EchoInt192 { value: Int192 } -> Int192, + #[selector = sol("echoInt200(int200)")] + EchoInt200 { value: Int200 } -> Int200, + #[selector = sol("echoInt208(int208)")] + EchoInt208 { value: Int208 } -> Int208, + #[selector = sol("echoInt216(int216)")] + EchoInt216 { value: Int216 } -> Int216, + #[selector = sol("echoInt224(int224)")] + EchoInt224 { value: Int224 } -> Int224, + #[selector = sol("echoInt232(int232)")] + EchoInt232 { value: Int232 } -> Int232, + #[selector = sol("echoInt240(int240)")] + EchoInt240 { value: Int240 } -> Int240, + #[selector = sol("echoInt248(int248)")] + EchoInt248 { value: Int248 } -> Int248, + #[selector = sol("echoBoolArray4(bool[4])")] + EchoBoolArray4 { value: [bool; 4] } -> [bool; 4], + #[selector = sol("echoAddressArray4(address[4])")] + EchoAddressArray4 { value: [Address; 4] } -> [Address; 4], + #[selector = sol("echoUint8Array4(uint8[4])")] + EchoUint8Array4 { value: [u8; 4] } -> [u8; 4], + #[selector = sol("echoUint16Array4(uint16[4])")] + EchoUint16Array4 { value: [u16; 4] } -> [u16; 4], + #[selector = sol("echoUint32Array4(uint32[4])")] + EchoUint32Array4 { value: [u32; 4] } -> [u32; 4], + #[selector = sol("echoUint64Array4(uint64[4])")] + EchoUint64Array4 { value: [u64; 4] } -> [u64; 4], + #[selector = sol("echoUint128Array4(uint128[4])")] + EchoUint128Array4 { value: [u128; 4] } -> [u128; 4], + #[selector = sol("echoUintArray4(uint256[4])")] + EchoUintArray4 { value: [u256; 4] } -> [u256; 4], + #[selector = sol("echoInt8Array4(int8[4])")] + EchoInt8Array4 { value: [i8; 4] } -> [i8; 4], + #[selector = sol("echoInt16Array4(int16[4])")] + EchoInt16Array4 { value: [i16; 4] } -> [i16; 4], + #[selector = sol("echoInt32Array4(int32[4])")] + EchoInt32Array4 { value: [i32; 4] } -> [i32; 4], + #[selector = sol("echoInt64Array4(int64[4])")] + EchoInt64Array4 { value: [i64; 4] } -> [i64; 4], + #[selector = sol("echoInt128Array4(int128[4])")] + EchoInt128Array4 { value: [i128; 4] } -> [i128; 4], + #[selector = sol("echoInt256Array4(int256[4])")] + EchoInt256Array4 { value: [i256; 4] } -> [i256; 4], + #[selector = sol("echoUint24Array4(uint24[4])")] + EchoUint24Array4 { value: [Uint24; 4] } -> [Uint24; 4], + #[selector = sol("echoUint40Array4(uint40[4])")] + EchoUint40Array4 { value: [Uint40; 4] } -> [Uint40; 4], + #[selector = sol("echoUint96Array4(uint96[4])")] + EchoUint96Array4 { value: [Uint96; 4] } -> [Uint96; 4], + #[selector = sol("echoUint160Array4(uint160[4])")] + EchoUint160Array4 { value: [Uint160; 4] } -> [Uint160; 4], + #[selector = sol("echoUint248Array4(uint248[4])")] + EchoUint248Array4 { value: [Uint248; 4] } -> [Uint248; 4], + #[selector = sol("echoInt24Array4(int24[4])")] + EchoInt24Array4 { value: [Int24; 4] } -> [Int24; 4], + #[selector = sol("echoInt40Array4(int40[4])")] + EchoInt40Array4 { value: [Int40; 4] } -> [Int40; 4], + #[selector = sol("echoInt96Array4(int96[4])")] + EchoInt96Array4 { value: [Int96; 4] } -> [Int96; 4], + #[selector = sol("echoInt160Array4(int160[4])")] + EchoInt160Array4 { value: [Int160; 4] } -> [Int160; 4], + #[selector = sol("echoInt248Array4(int248[4])")] + EchoInt248Array4 { value: [Int248; 4] } -> [Int248; 4], + #[selector = sol("echoBoolMatrix2x2(bool[2][2])")] + EchoBoolMatrix2x2 { value: [[bool; 2]; 2] } -> [[bool; 2]; 2], + #[selector = sol("echoAddressMatrix2x2(address[2][2])")] + EchoAddressMatrix2x2 { value: [[Address; 2]; 2] } -> [[Address; 2]; 2], + #[selector = sol("echoUintMatrix2x2(uint256[2][2])")] + EchoUintMatrix2x2 { value: [[u256; 2]; 2] } -> [[u256; 2]; 2], + #[selector = sol("echoInt256Matrix2x2(int256[2][2])")] + EchoInt256Matrix2x2 { value: [[i256; 2]; 2] } -> [[i256; 2]; 2], + #[selector = sol("echoUint24Matrix2x2(uint24[2][2])")] + EchoUint24Matrix2x2 { value: [[Uint24; 2]; 2] } -> [[Uint24; 2]; 2], + #[selector = sol("echoInt40Matrix2x2(int40[2][2])")] + EchoInt40Matrix2x2 { value: [[Int40; 2]; 2] } -> [[Int40; 2]; 2], + #[selector = sol("echoBoolAddressPairArray4((bool,address)[4])")] + EchoBoolAddressPairArray4 { value: [(bool, Address); 4] } -> [(bool, Address); 4], + #[selector = sol("echoUint24Int40PairArray4((uint24,int40)[4])")] + EchoUint24Int40PairArray4 { value: [(Uint24, Int40); 4] } -> [(Uint24, Int40); 4], + #[selector = sol("echoBoolAddressU256TripleArray4((bool,address,uint256)[4])")] + EchoBoolAddressU256TripleArray4 { value: [(bool, Address, u256); 4] } -> [(bool, Address, u256); 4], + #[selector = sol("echoStringArray2(string[2])")] + EchoStringArray2 { value: [DynString; 2] } -> [DynString; 2], + #[selector = sol("echoStringU64PairArray2((string,uint64)[2])")] + EchoStringU64PairArray2 { value: [(DynString, u64); 2] } -> [(DynString, u64); 2], + #[selector = sol("echoUintArray(uint256[])")] + EchoUintArray { value: DynArray } -> DynArray, + #[selector = sol("echoBoolAddressPairArray((bool,address)[])")] + EchoBoolAddressPairArray { value: DynArray<(bool, Address)> } -> DynArray<(bool, Address)>, + #[selector = sol("echoStringArray(string[])")] + EchoStringArray { value: DynArray } -> DynArray, + #[selector = sol("echoStringU64PairArray((string,uint64)[])")] + EchoStringU64PairArray { value: DynArray<(DynString, u64)> } -> DynArray<(DynString, u64)>, + #[selector = sol("echoPair((string,uint64))")] + EchoPair { value: (DynString, u64) } -> (DynString, u64), + #[selector = sol("echoBoolAddressPair((bool,address))")] + EchoBoolAddressPair { value: (bool, Address) } -> (bool, Address), + #[selector = sol("echoUint24Int40Pair((uint24,int40))")] + EchoUint24Int40Pair { value: (Uint24, Int40) } -> (Uint24, Int40), + #[selector = sol("echoBoolAddressU256Triple((bool,address,uint256))")] + EchoBoolAddressU256Triple { value: (bool, Address, u256) } -> (bool, Address, u256), + #[selector = sol("echoStringBoolU64Triple((string,bool,uint64))")] + EchoStringBoolU64Triple { value: (DynString, bool, u64) } -> (DynString, bool, u64), +} + +pub contract AbiRoundtripFe { + recv AbiRoundtripMsg { + EchoBool { value } -> bool { + value + } + + EchoAddress { value } -> Address { + value + } + + EchoString { value } -> DynString { + value + } + + EchoUint8 { value } -> u8 { + value + } + + EchoUint16 { value } -> u16 { + value + } + + EchoUint32 { value } -> u32 { + value + } + + EchoUint64 { value } -> u64 { + value + } + + EchoUint128 { value } -> u128 { + value + } + + EchoUint { value } -> u256 { + value + } + + EchoInt8 { value } -> i8 { + value + } + + EchoInt16 { value } -> i16 { + value + } + + EchoInt32 { value } -> i32 { + value + } + + EchoInt64 { value } -> i64 { + value + } + + EchoInt128 { value } -> i128 { + value + } + + EchoInt256 { value } -> i256 { + value + } + + EchoUint24 { value } -> Uint24 { + value + } + + EchoUint40 { value } -> Uint40 { + value + } + + EchoUint48 { value } -> Uint48 { + value + } + + EchoUint56 { value } -> Uint56 { + value + } + + EchoUint72 { value } -> Uint72 { + value + } + + EchoUint80 { value } -> Uint80 { + value + } + + EchoUint88 { value } -> Uint88 { + value + } + + EchoUint96 { value } -> Uint96 { + value + } + + EchoUint104 { value } -> Uint104 { + value + } + + EchoUint112 { value } -> Uint112 { + value + } + + EchoUint120 { value } -> Uint120 { + value + } + + EchoUint136 { value } -> Uint136 { + value + } + + EchoUint144 { value } -> Uint144 { + value + } + + EchoUint152 { value } -> Uint152 { + value + } + + EchoUint160 { value } -> Uint160 { + value + } + + EchoUint168 { value } -> Uint168 { + value + } + + EchoUint176 { value } -> Uint176 { + value + } + + EchoUint184 { value } -> Uint184 { + value + } + + EchoUint192 { value } -> Uint192 { + value + } + + EchoUint200 { value } -> Uint200 { + value + } + + EchoUint208 { value } -> Uint208 { + value + } + + EchoUint216 { value } -> Uint216 { + value + } + + EchoUint224 { value } -> Uint224 { + value + } + + EchoUint232 { value } -> Uint232 { + value + } + + EchoUint240 { value } -> Uint240 { + value + } + + EchoUint248 { value } -> Uint248 { + value + } + + EchoInt24 { value } -> Int24 { + value + } + + EchoInt40 { value } -> Int40 { + value + } + + EchoInt48 { value } -> Int48 { + value + } + + EchoInt56 { value } -> Int56 { + value + } + + EchoInt72 { value } -> Int72 { + value + } + + EchoInt80 { value } -> Int80 { + value + } + + EchoInt88 { value } -> Int88 { + value + } + + EchoInt96 { value } -> Int96 { + value + } + + EchoInt104 { value } -> Int104 { + value + } + + EchoInt112 { value } -> Int112 { + value + } + + EchoInt120 { value } -> Int120 { + value + } + + EchoInt136 { value } -> Int136 { + value + } + + EchoInt144 { value } -> Int144 { + value + } + + EchoInt152 { value } -> Int152 { + value + } + + EchoInt160 { value } -> Int160 { + value + } + + EchoInt168 { value } -> Int168 { + value + } + + EchoInt176 { value } -> Int176 { + value + } + + EchoInt184 { value } -> Int184 { + value + } + + EchoInt192 { value } -> Int192 { + value + } + + EchoInt200 { value } -> Int200 { + value + } + + EchoInt208 { value } -> Int208 { + value + } + + EchoInt216 { value } -> Int216 { + value + } + + EchoInt224 { value } -> Int224 { + value + } + + EchoInt232 { value } -> Int232 { + value + } + + EchoInt240 { value } -> Int240 { + value + } + + EchoInt248 { value } -> Int248 { + value + } + + EchoBoolArray4 { value } -> [bool; 4] { + value + } + + EchoAddressArray4 { value } -> [Address; 4] { + value + } + + EchoUint8Array4 { value } -> [u8; 4] { + value + } + + EchoUint16Array4 { value } -> [u16; 4] { + value + } + + EchoUint32Array4 { value } -> [u32; 4] { + value + } + + EchoUint64Array4 { value } -> [u64; 4] { + value + } + + EchoUint128Array4 { value } -> [u128; 4] { + value + } + + EchoUintArray4 { value } -> [u256; 4] { + value + } + + EchoInt8Array4 { value } -> [i8; 4] { + value + } + + EchoInt16Array4 { value } -> [i16; 4] { + value + } + + EchoInt32Array4 { value } -> [i32; 4] { + value + } + + EchoInt64Array4 { value } -> [i64; 4] { + value + } + + EchoInt128Array4 { value } -> [i128; 4] { + value + } + + EchoInt256Array4 { value } -> [i256; 4] { + value + } + + EchoUint24Array4 { value } -> [Uint24; 4] { + value + } + + EchoUint40Array4 { value } -> [Uint40; 4] { + value + } + + EchoUint96Array4 { value } -> [Uint96; 4] { + value + } + + EchoUint160Array4 { value } -> [Uint160; 4] { + value + } + + EchoUint248Array4 { value } -> [Uint248; 4] { + value + } + + EchoInt24Array4 { value } -> [Int24; 4] { + value + } + + EchoInt40Array4 { value } -> [Int40; 4] { + value + } + + EchoInt96Array4 { value } -> [Int96; 4] { + value + } + + EchoInt160Array4 { value } -> [Int160; 4] { + value + } + + EchoInt248Array4 { value } -> [Int248; 4] { + value + } + + EchoBoolMatrix2x2 { value } -> [[bool; 2]; 2] { + value + } + + EchoAddressMatrix2x2 { value } -> [[Address; 2]; 2] { + value + } + + EchoUintMatrix2x2 { value } -> [[u256; 2]; 2] { + value + } + + EchoInt256Matrix2x2 { value } -> [[i256; 2]; 2] { + value + } + + EchoUint24Matrix2x2 { value } -> [[Uint24; 2]; 2] { + value + } + + EchoInt40Matrix2x2 { value } -> [[Int40; 2]; 2] { + value + } + + EchoBoolAddressPairArray4 { value } -> [(bool, Address); 4] { + value + } + + EchoUint24Int40PairArray4 { value } -> [(Uint24, Int40); 4] { + value + } + + EchoBoolAddressU256TripleArray4 { value } -> [(bool, Address, u256); 4] { + value + } + + EchoStringArray2 { value } -> [DynString; 2] { + value + } + + EchoStringU64PairArray2 { value } -> [(DynString, u64); 2] { + value + } + + EchoUintArray { value } -> DynArray { + value + } + + EchoBoolAddressPairArray { value } -> DynArray<(bool, Address)> { + value + } + + EchoStringArray { value } -> DynArray { + value + } + + EchoStringU64PairArray { value } -> DynArray<(DynString, u64)> { + value + } + + EchoPair { value } -> (DynString, u64) { + value + } + + EchoBoolAddressPair { value } -> (bool, Address) { + value + } + + EchoUint24Int40Pair { value } -> (Uint24, Int40) { + value + } + + EchoBoolAddressU256Triple { value } -> (bool, Address, u256) { + value + } + + EchoStringBoolU64Triple { value } -> (DynString, bool, u64) { + value + } + } +} diff --git a/benchmarks/foundry-abi/fe/BytesSuite.fe b/benchmarks/foundry-abi/fe/BytesSuite.fe new file mode 100644 index 0000000000..1bda054251 --- /dev/null +++ b/benchmarks/foundry-abi/fe/BytesSuite.fe @@ -0,0 +1,14 @@ +use std::abi::{sol, Bytes} + +msg BytesSuiteMsg { + #[selector = sol("echoBytes(bytes)")] + EchoBytes { value: Bytes } -> Bytes, +} + +pub contract BytesSuite { + recv BytesSuiteMsg { + EchoBytes { value } -> Bytes { + value + } + } +} diff --git a/benchmarks/foundry-abi/fe/DeepDynamicSuite.fe b/benchmarks/foundry-abi/fe/DeepDynamicSuite.fe new file mode 100644 index 0000000000..1f799b8fed --- /dev/null +++ b/benchmarks/foundry-abi/fe/DeepDynamicSuite.fe @@ -0,0 +1,63 @@ +use std::abi::{Bytes, DynArray, DynString, sol} +use std::abi::sol::Uint24 + +msg DeepDynamicSuiteMsg { + #[selector = sol("echoUint24Array(uint24[])")] + EchoUint24Array { value: DynArray } -> DynArray, + #[selector = sol("echoBytesArray(bytes[])")] + EchoBytesArray { value: DynArray } -> DynArray, + #[selector = sol("echoNestedBytesArray(bytes[][])")] + EchoNestedBytesArray { value: DynArray> } -> DynArray>, + #[selector = sol("echoNestedUintArray(uint256[][])")] + EchoNestedUintArray { value: DynArray> } -> DynArray>, + #[selector = sol("echoNestedStringArray(string[][])")] + EchoNestedStringArray { value: DynArray> } -> DynArray>, + #[selector = sol("echoNestedStringU64PairArray((string,uint64)[][])")] + EchoNestedStringU64PairArray { value: DynArray> } -> DynArray>, + #[selector = sol("echoBytesU64Pair((bytes,uint64))")] + EchoBytesU64Pair { value: (Bytes, u64) } -> (Bytes, u64), + #[selector = sol("echoBytesU64PairArray((bytes,uint64)[])")] + EchoBytesU64PairArray { value: DynArray<(Bytes, u64)> } -> DynArray<(Bytes, u64)>, + #[selector = sol("echoNestedBytesU64PairArray((bytes,uint64)[][])")] + EchoNestedBytesU64PairArray { value: DynArray> } -> DynArray>, +} + +pub contract DeepDynamicSuite { + recv DeepDynamicSuiteMsg { + EchoUint24Array { value } -> DynArray { + value + } + + EchoBytesArray { value } -> DynArray { + value + } + + EchoNestedBytesArray { value } -> DynArray> { + value + } + + EchoNestedUintArray { value } -> DynArray> { + value + } + + EchoNestedStringArray { value } -> DynArray> { + value + } + + EchoNestedStringU64PairArray { value } -> DynArray> { + value + } + + EchoBytesU64Pair { value } -> (Bytes, u64) { + value + } + + EchoBytesU64PairArray { value } -> DynArray<(Bytes, u64)> { + value + } + + EchoNestedBytesU64PairArray { value } -> DynArray> { + value + } + } +} diff --git a/benchmarks/foundry-abi/fe/DynArraySuite.fe b/benchmarks/foundry-abi/fe/DynArraySuite.fe new file mode 100644 index 0000000000..c896b4b04a --- /dev/null +++ b/benchmarks/foundry-abi/fe/DynArraySuite.fe @@ -0,0 +1,33 @@ +use std::abi::{DynArray, DynString, sol} +use std::evm::Address + +msg DynArraySuiteMsg { + #[selector = sol("echoUintArray(uint256[])")] + EchoUintArray { value: DynArray } -> DynArray, + #[selector = sol("echoBoolAddressPairArray((bool,address)[])")] + EchoBoolAddressPairArray { value: DynArray<(bool, Address)> } -> DynArray<(bool, Address)>, + #[selector = sol("echoStringArray(string[])")] + EchoStringArray { value: DynArray } -> DynArray, + #[selector = sol("echoStringU64PairArray((string,uint64)[])")] + EchoStringU64PairArray { value: DynArray<(DynString, u64)> } -> DynArray<(DynString, u64)>, +} + +pub contract DynArraySuite { + recv DynArraySuiteMsg { + EchoUintArray { value } -> DynArray { + value + } + + EchoBoolAddressPairArray { value } -> DynArray<(bool, Address)> { + value + } + + EchoStringArray { value } -> DynArray { + value + } + + EchoStringU64PairArray { value } -> DynArray<(DynString, u64)> { + value + } + } +} diff --git a/benchmarks/foundry-abi/fe/FixedArrayCeilingSuite.fe b/benchmarks/foundry-abi/fe/FixedArrayCeilingSuite.fe new file mode 100644 index 0000000000..ec2f2c6b9a --- /dev/null +++ b/benchmarks/foundry-abi/fe/FixedArrayCeilingSuite.fe @@ -0,0 +1,32 @@ +use std::abi::{sol, Bytes, DynString} + +msg FixedArrayCeilingSuiteMsg { + #[selector = sol("echoBoolArray17(bool[17])")] + EchoBoolArray17 { value: [bool; 17] } -> [bool; 17], + #[selector = sol("echoUintArray32(uint256[32])")] + EchoUintArray32 { value: [u256; 32] } -> [u256; 32], + #[selector = sol("echoStringArray17(string[17])")] + EchoStringArray17 { value: [DynString; 17] } -> [DynString; 17], + #[selector = sol("echoBytesArray17(bytes[17])")] + EchoBytesArray17 { value: [Bytes; 17] } -> [Bytes; 17], +} + +pub contract FixedArrayCeilingSuite { + recv FixedArrayCeilingSuiteMsg { + EchoBoolArray17 { value } -> [bool; 17] { + value + } + + EchoUintArray32 { value } -> [u256; 32] { + value + } + + EchoStringArray17 { value } -> [DynString; 17] { + value + } + + EchoBytesArray17 { value } -> [Bytes; 17] { + value + } + } +} diff --git a/benchmarks/foundry-abi/fe/FixedArraySuite.fe b/benchmarks/foundry-abi/fe/FixedArraySuite.fe new file mode 100644 index 0000000000..0dbf1ccf18 --- /dev/null +++ b/benchmarks/foundry-abi/fe/FixedArraySuite.fe @@ -0,0 +1,87 @@ +use std::abi::{sol, Bytes, DynString} +use std::evm::Address + +msg FixedArraySuiteMsg { + #[selector = sol("echoBoolArray5(bool[5])")] + EchoBoolArray5 { value: [bool; 5] } -> [bool; 5], + #[selector = sol("echoBoolArray17(bool[17])")] + EchoBoolArray17 { value: [bool; 17] } -> [bool; 17], + #[selector = sol("echoUintArray8(uint256[8])")] + EchoUintArray8 { value: [u256; 8] } -> [u256; 8], + #[selector = sol("echoUintArray16(uint256[16])")] + EchoUintArray16 { value: [u256; 16] } -> [u256; 16], + #[selector = sol("echoUintArray32(uint256[32])")] + EchoUintArray32 { value: [u256; 32] } -> [u256; 32], + #[selector = sol("echoStringArray5(string[5])")] + EchoStringArray5 { value: [DynString; 5] } -> [DynString; 5], + #[selector = sol("echoStringArray17(string[17])")] + EchoStringArray17 { value: [DynString; 17] } -> [DynString; 17], + #[selector = sol("echoBytesArray5(bytes[5])")] + EchoBytesArray5 { value: [Bytes; 5] } -> [Bytes; 5], + #[selector = sol("echoBytesArray17(bytes[17])")] + EchoBytesArray17 { value: [Bytes; 17] } -> [Bytes; 17], + #[selector = sol("echoBoolAddressPairArray8((bool,address)[8])")] + EchoBoolAddressPairArray8 { value: [(bool, Address); 8] } -> [(bool, Address); 8], + #[selector = sol("echoStringU64PairArray5((string,uint64)[5])")] + EchoStringU64PairArray5 { value: [(DynString, u64); 5] } -> [(DynString, u64); 5], + #[selector = sol("echoBytesU64PairArray5((bytes,uint64)[5])")] + EchoBytesU64PairArray5 { value: [(Bytes, u64); 5] } -> [(Bytes, u64); 5], + #[selector = sol("echoNestedUintArray2x5(uint256[5][2])")] + EchoNestedUintArray2x5 { value: [[u256; 5]; 2] } -> [[u256; 5]; 2], +} + +pub contract FixedArraySuite { + recv FixedArraySuiteMsg { + EchoBoolArray5 { value } -> [bool; 5] { + value + } + + EchoBoolArray17 { value } -> [bool; 17] { + value + } + + EchoUintArray8 { value } -> [u256; 8] { + value + } + + EchoUintArray16 { value } -> [u256; 16] { + value + } + + EchoUintArray32 { value } -> [u256; 32] { + value + } + + EchoStringArray5 { value } -> [DynString; 5] { + value + } + + EchoStringArray17 { value } -> [DynString; 17] { + value + } + + EchoBytesArray5 { value } -> [Bytes; 5] { + value + } + + EchoBytesArray17 { value } -> [Bytes; 17] { + value + } + + EchoBoolAddressPairArray8 { value } -> [(bool, Address); 8] { + value + } + + EchoStringU64PairArray5 { value } -> [(DynString, u64); 5] { + value + } + + EchoBytesU64PairArray5 { value } -> [(Bytes, u64); 5] { + value + } + + EchoNestedUintArray2x5 { value } -> [[u256; 5]; 2] { + value + } + } +} diff --git a/benchmarks/foundry-abi/fe/NestedTupleSuite.fe b/benchmarks/foundry-abi/fe/NestedTupleSuite.fe new file mode 100644 index 0000000000..ad935e0878 --- /dev/null +++ b/benchmarks/foundry-abi/fe/NestedTupleSuite.fe @@ -0,0 +1,51 @@ +use std::abi::{Bytes, DynArray, DynString, sol} +use std::evm::Address + +msg NestedTupleSuiteMsg { + // Purely-static nested tuples. + #[selector = sol("echoNestedStatic(((bool,address),uint256))")] + EchoNestedStatic { value: ((bool, Address), u256) } -> ((bool, Address), u256), + #[selector = sol("echoNestedStaticFlipped((bool,(address,uint256)))")] + EchoNestedStaticFlipped { value: (bool, (Address, u256)) } -> (bool, (Address, u256)), + + // Nested tuples with dynamic components (wrapper-required inner tuples). + #[selector = sol("echoNestedDynamic(((string,uint64),bool))")] + EchoNestedDynamic { value: ((DynString, u64), bool) } -> ((DynString, u64), bool), + #[selector = sol("echoNestedDynamicBoth(((string,uint64),(bytes,bool)))")] + EchoNestedDynamicBoth { value: ((DynString, u64), (Bytes, bool)) } -> ((DynString, u64), (Bytes, bool)), + + // Arrays of nested tuples. + #[selector = sol("echoNestedStaticArray(((bool,address),uint256)[4])")] + EchoNestedStaticArray { value: [((bool, Address), u256); 4] } -> [((bool, Address), u256); 4], + #[selector = sol("echoNestedStaticDynArray(((bool,address),uint256)[])")] + EchoNestedStaticDynArray { value: DynArray<((bool, Address), u256)> } -> DynArray<((bool, Address), u256)>, +} + +pub contract NestedTupleSuite { + recv NestedTupleSuiteMsg { + EchoNestedStatic { value } -> ((bool, Address), u256) { + value + } + + EchoNestedStaticFlipped { value } -> (bool, (Address, u256)) { + value + } + + EchoNestedDynamic { value } -> ((DynString, u64), bool) { + value + } + + EchoNestedDynamicBoth { value } -> ((DynString, u64), (Bytes, bool)) { + value + } + + EchoNestedStaticArray { value } -> [((bool, Address), u256); 4] { + value + } + + EchoNestedStaticDynArray { value } -> DynArray<((bool, Address), u256)> { + value + } + } +} + diff --git a/benchmarks/foundry-abi/foundry.toml b/benchmarks/foundry-abi/foundry.toml new file mode 100644 index 0000000000..af47b4a12b --- /dev/null +++ b/benchmarks/foundry-abi/foundry.toml @@ -0,0 +1,6 @@ +[profile.default] +src = "src" +test = "test" +solc = "/usr/bin/solc" +auto_detect_solc = false +fs_permissions = [{ access = "read", path = "./fe-out" }] diff --git a/benchmarks/foundry-abi/reports/bytes-suite-gas.md b/benchmarks/foundry-abi/reports/bytes-suite-gas.md new file mode 100644 index 0000000000..fe3d6dc530 --- /dev/null +++ b/benchmarks/foundry-abi/reports/bytes-suite-gas.md @@ -0,0 +1,31 @@ +# Bytes Suite Gas Snapshot + +Generated: 2026-03-27 + +Command: + +- `forge test --root benchmarks/foundry-abi --offline --match-path test/BytesSuiteEquivalence.t.sol --gas-report` + +Test result: + +- `4` tests passed +- `0` failed + +Wrapper-call gas (`BytesSolBenchCaller` vs `BytesFeBenchCaller`): + +| Function | Solidity Avg | Fe Avg | Delta | +| --- | ---: | ---: | ---: | +| `benchEchoBytes` | 27792 | 29510 | 1718 | + +Underlying Solidity target call average from the same run: + +| Function | Avg gas | +| --- | ---: | +| `echoBytes` | 23426 | + +Notes: + +- The wrapper average above comes from the full gas-report sample (`261` + calls), which includes both deterministic coverage and the fuzz path. +- The focused `bytes` suite covers both sub-word and multi-word payloads plus + Foundry fuzzing over arbitrary byte strings up to 96 bytes. diff --git a/benchmarks/foundry-abi/reports/deep-dynamic-suite-gas.md b/benchmarks/foundry-abi/reports/deep-dynamic-suite-gas.md new file mode 100644 index 0000000000..c4f2fe0a71 --- /dev/null +++ b/benchmarks/foundry-abi/reports/deep-dynamic-suite-gas.md @@ -0,0 +1,56 @@ +# Deep Dynamic Suite Gas Report + +Generated: 2026-03-27 + +Suite summary: + +- `18` tests passed +- `0` failed +- gas tables gathered from + `forge test --root benchmarks/foundry-abi --offline --match-path test/DeepDynamicSuiteEquivalence.t.sol --gas-report` + +Overall deep-suite wrapper deltas (`DeepDynamicFeBenchCaller` avg minus +`DeepDynamicSolBenchCaller` avg): + +- mean delta: `+7634.11` gas +- median delta: `+5814` gas +- best delta: `benchEchoBytesU64Pair` `+2339` +- worst delta: `benchEchoNestedBytesU64PairArray` `+15022` + +Per-function wrapper deltas: + +| Function | Solidity Avg | Fe Avg | Delta | +| --- | ---: | ---: | ---: | +| `benchEchoBytesArray` | 39796 | 43923 | 4127 | +| `benchEchoBytesU64Pair` | 30830 | 33169 | 2339 | +| `benchEchoBytesU64PairArray` | 46732 | 52546 | 5814 | +| `benchEchoNestedBytesArray` | 73495 | 83736 | 10241 | +| `benchEchoNestedBytesU64PairArray` | 93431 | 108453 | 15022 | +| `benchEchoNestedStringArray` | 73554 | 83416 | 9862 | +| `benchEchoNestedStringU64PairArray` | 94050 | 108780 | 14730 | +| `benchEchoNestedUintArray` | 48288 | 52194 | 3906 | +| `benchEchoUint24Array` | 31284 | 33950 | 2666 | + +Underlying Solidity target call averages from the same run: + +| Function | Avg gas | +| --- | ---: | +| `echoBytesArray` | 29668 | +| `echoBytesU64Pair` | 24780 | +| `echoBytesU64PairArray` | 32531 | +| `echoNestedBytesArray` | 46637 | +| `echoNestedBytesU64PairArray` | 55139 | +| `echoNestedStringArray` | 46026 | +| `echoNestedStringU64PairArray` | 55311 | +| `echoNestedUintArray` | 33768 | +| `echoUint24Array` | 24117 | + +Notes: + +- Nested dynamic regressions still dominate this suite; the heaviest wrappers + are the nested `bytes` / tuple-array cases. +- `benchEchoUint24Array` is still based on a single bench-call observation in + this gas report (`# Calls = 1`), so treat that line as directional rather + than directly comparable to the `257`-call rows. +- The wrapper averages above otherwise come from the full gas-report sample and + reflect the benchmark harness rather than a single deterministic invocation. diff --git a/benchmarks/foundry-abi/reports/dyn-array-suite-gas.md b/benchmarks/foundry-abi/reports/dyn-array-suite-gas.md new file mode 100644 index 0000000000..6dacbdc995 --- /dev/null +++ b/benchmarks/foundry-abi/reports/dyn-array-suite-gas.md @@ -0,0 +1,42 @@ +# Dynamic Array Suite Gas Snapshot + +Generated: 2026-03-27 + +Command: + +- `forge test --root benchmarks/foundry-abi --offline --match-path test/DynArraySuiteEquivalence.t.sol --gas-report` + +Test result: + +- `8` tests passed +- `0` failed + +Wrapper-call gas (`SolBenchCaller` vs `FeBenchCaller`): + +| Function | Solidity | Fe | Delta | +| --- | ---: | ---: | ---: | +| `benchEchoUintArray` | 31382 | 34484 | 3102 | +| `benchEchoBoolAddressPairArray` | 43433 | 44965 | 1532 | +| `benchEchoStringArray` | 43961 | 48514 | 4553 | +| `benchEchoStringU64PairArray` | 53264 | 59885 | 6621 | + +Underlying Solidity target call averages from the same run: + +| Function | Avg gas | +| --- | ---: | +| `echoUintArray` | 24793 | +| `echoBoolAddressPairArray` | 29677 | +| `echoStringArray` | 31426 | +| `echoStringU64PairArray` | 35590 | + +Notes: + +- The wrapper averages above come from the full gas-report sample (`257` calls + per bench function), not a single deterministic invocation. +- The largest delta in this focused suite is still `(string,uint64)[]`, + followed by `string[]`. +- This focused suite verifies real variable-length ABI arrays (`T[]`) for the + currently-supported representative element shapes: `uint256`, `(bool,address)`, + `string`, and `(string,uint64)`. +- The string cases now run through `std::abi::DynString` with payloads that + intentionally exceed the old single-word string ceiling. diff --git a/benchmarks/foundry-abi/reports/fixed-array-ceiling-suite-gas.md b/benchmarks/foundry-abi/reports/fixed-array-ceiling-suite-gas.md new file mode 100644 index 0000000000..df26e638e8 --- /dev/null +++ b/benchmarks/foundry-abi/reports/fixed-array-ceiling-suite-gas.md @@ -0,0 +1,51 @@ +# Fixed Array Ceiling Suite Gas Report + +Generated: 2026-03-27 + +Suite summary: + +- `8` tests passed +- `0` failed +- gas tables gathered from + `forge test --root benchmarks/foundry-abi --offline --match-path test/FixedArrayCeilingSuiteEquivalence.t.sol --gas-report` + +Overall ceiling-suite wrapper deltas (`FixedArrayCeilingFeBenchCaller` avg +minus `FixedArrayCeilingSolBenchCaller` avg): + +- mean delta: `+13204.00` gas +- median delta: `+13137.50` gas +- best delta: `benchEchoUintArray32` `+2874` +- worst delta: `benchEchoStringArray17` `+23667` + +Per-function wrapper deltas: + +| Function | Solidity Avg | Fe Avg | Delta | +| --- | ---: | ---: | ---: | +| `benchEchoBoolArray17` | 50070 | 52986 | 2916 | +| `benchEchoBytesArray17` | 97603 | 120962 | 23359 | +| `benchEchoStringArray17` | 98072 | 121739 | 23667 | +| `benchEchoUintArray32` | 59306 | 62180 | 2874 | + +Underlying Solidity target call averages from the same run: + +| Function | Avg gas | +| --- | ---: | +| `echoBoolArray17` | 29020 | +| `echoBytesArray17` | 60620 | +| `echoStringArray17` | 59493 | +| `echoUintArray32` | 42318 | + +Notes: + +- This suite still exists because the `17` / `32` fixed-array cases compile and + roundtrip cleanly; it remains useful as a faster regression and gas-isolation + suite even though the merged `FixedArraySuite` also passes. +- The dynamic-element ceiling regressions are still materially larger than the + smaller `[5]` fixed-array cases, especially for `string[17]`. +- The string ceiling case now measures explicit `DynString` roundtrips with + payloads beyond the old single-word string limit. +- The fixed-array ABI path is const-generic again, with contract/message ABI + roundtrips additionally verified through `bool[65]`, `string[65]`, and + `bytes[65]` outside this focused gas suite. +- The wrapper averages above come from the full gas-report sample (`257` + calls per bench function). diff --git a/benchmarks/foundry-abi/reports/fixed-array-suite-gas.md b/benchmarks/foundry-abi/reports/fixed-array-suite-gas.md new file mode 100644 index 0000000000..aba4b2a336 --- /dev/null +++ b/benchmarks/foundry-abi/reports/fixed-array-suite-gas.md @@ -0,0 +1,69 @@ +# Fixed Array Suite Gas Report + +Generated: 2026-03-27 + +Suite summary: + +- `26` tests passed +- `0` failed +- gas tables gathered from + `forge test --root benchmarks/foundry-abi --offline --match-path test/FixedArraySuiteEquivalence.t.sol --gas-report` + +Overall fixed-suite wrapper deltas (`FeBenchCaller` avg minus +`FixedArraySolBenchCaller` avg): + +- mean delta: `+6558.85` gas +- median delta: `+3593` gas +- best delta: `benchEchoBoolAddressPairArray8` `-4817` +- worst delta: `benchEchoStringArray17` `+24071` + +Per-function wrapper deltas: + +| Function | Solidity Avg | Fe Avg | Delta | +| --- | ---: | ---: | ---: | +| `benchEchoBoolAddressPairArray8` | 61007 | 56190 | -4817 | +| `benchEchoBoolArray17` | 50162 | 53755 | 3593 | +| `benchEchoBoolArray5` | 33397 | 34109 | 712 | +| `benchEchoBytesArray17` | 97535 | 121131 | 23596 | +| `benchEchoBytesArray5` | 47772 | 54924 | 7152 | +| `benchEchoBytesU64PairArray5` | 60328 | 69600 | 9272 | +| `benchEchoNestedUintArray2x5` | 41176 | 41336 | 160 | +| `benchEchoStringArray17` | 98386 | 122457 | 24071 | +| `benchEchoStringArray5` | 48054 | 55388 | 7334 | +| `benchEchoStringU64PairArray5` | 60730 | 70214 | 9484 | +| `benchEchoUintArray16` | 42819 | 44067 | 1248 | +| `benchEchoUintArray32` | 59346 | 62415 | 3069 | +| `benchEchoUintArray8` | 34578 | 34969 | 391 | + +Underlying Solidity target call averages from the same run: + +| Function | Avg gas | +| --- | ---: | +| `echoBoolAddressPairArray8` | 37445 | +| `echoBoolArray17` | 29044 | +| `echoBoolArray5` | 24068 | +| `echoBytesArray17` | 60420 | +| `echoBytesArray5` | 33370 | +| `echoBytesU64PairArray5` | 38838 | +| `echoNestedUintArray2x5` | 28890 | +| `echoStringArray17` | 59790 | +| `echoStringArray5` | 33436 | +| `echoStringU64PairArray5` | 39249 | +| `echoUintArray16` | 31858 | +| `echoUintArray32` | 42450 | +| `echoUintArray8` | 26590 | + +Notes: + +- The merged fixed-array suite still includes the former ceiling cases + (`bool[17]`, `uint256[32]`, `string[17]`, `bytes[17]`), so the suite-wide + mean delta remains materially higher than the older `[5]`-only snapshot. +- The strongest fixed-array win is still `(bool,address)[8]`, where the Fe + wrapper remains materially cheaper than the Solidity wrapper. +- The worst regressions are fixed arrays with dynamic elements, led by + `string[17]`, `bytes[17]`, and `(string,uint64)[5]`. +- The string cases now measure explicit `DynString` roundtrips with payloads + beyond the old single-word limit rather than the earlier capped-string path. +- The raw Forge gas tables that produced these deltas are in the command output + from the focused fixed-array gas run; this markdown records the extracted + wrapper averages across the full `257`-call gas-report sample. diff --git a/benchmarks/foundry-abi/reports/gas-deltas.csv b/benchmarks/foundry-abi/reports/gas-deltas.csv new file mode 100644 index 0000000000..ebee9c5420 --- /dev/null +++ b/benchmarks/foundry-abi/reports/gas-deltas.csv @@ -0,0 +1,112 @@ +function,category,sol_avg,fe_avg,delta,delta_pct +benchEchoAddress,scalar-address,26076,26020,-56,-0.21475686454977758 +benchEchoAddressArray4,fixed-array,33262,32648,-614,-1.8459503337141483 +benchEchoAddressMatrix2x2,nested-fixed-array,37848,36340,-1508,-3.9843584865778907 +benchEchoBool,scalar-bool,25792,25796,4,0.015508684863523574 +benchEchoBoolAddressPair,tuple-static,28453,27660,-793,-2.787052331915791 +benchEchoBoolAddressPairArray,tuple-fixed-array,43346,39312,-4034,-9.306510404650949 +benchEchoBoolAddressPairArray4,tuple-fixed-array,43300,38978,-4322,-9.981524249422632 +benchEchoBoolAddressU256Triple,tuple-static,29527,28534,-993,-3.3630236732482137 +benchEchoBoolAddressU256TripleArray4,tuple-fixed-array,47891,42770,-5121,-10.693032093712807 +benchEchoBoolArray4,fixed-array,32170,31642,-528,-1.6412806963009015 +benchEchoBoolMatrix2x2,nested-fixed-array,36819,35338,-1481,-4.022379749585812 +benchEchoInt104,custom-signed,26200,26206,6,0.022900763358778626 +benchEchoInt112,custom-signed,26197,26187,-10,-0.03817230980646639 +benchEchoInt120,custom-signed,26196,26209,13,0.049625897083524204 +benchEchoInt128,native-signed,26155,26167,12,0.04588032880902313 +benchEchoInt128Array4,fixed-array,33146,32592,-554,-1.671393229952332 +benchEchoInt136,custom-signed,26134,26144,10,0.038264329991581844 +benchEchoInt144,custom-signed,26219,26186,-33,-0.12586292383386094 +benchEchoInt152,custom-signed,26198,26163,-35,-0.1335979845789755 +benchEchoInt16,native-signed,26198,26205,7,0.0267195969157951 +benchEchoInt160,custom-signed,26196,26165,-31,-0.11833867766071157 +benchEchoInt160Array4,fixed-array,33132,32530,-602,-1.816974526137873 +benchEchoInt168,custom-signed,26174,26185,11,0.042026438450370594 +benchEchoInt16Array4,fixed-array,33333,32758,-575,-1.7250172501725016 +benchEchoInt176,custom-signed,26198,26206,8,0.030536682189480115 +benchEchoInt184,custom-signed,26174,26163,-11,-0.042026438450370594 +benchEchoInt192,custom-signed,26198,26186,-12,-0.04580502328422017 +benchEchoInt200,custom-signed,26174,26184,10,0.038205853136700545 +benchEchoInt208,custom-signed,26131,26163,32,0.12245991351268609 +benchEchoInt216,custom-signed,26198,26209,11,0.04198793801053516 +benchEchoInt224,custom-signed,26176,26187,11,0.04202322738386308 +benchEchoInt232,custom-signed,26198,26209,11,0.04198793801053516 +benchEchoInt24,custom-signed,26177,26186,9,0.034381327119226805 +benchEchoInt240,custom-signed,26134,26162,28,0.10714012397642918 +benchEchoInt248,custom-signed,26221,26207,-14,-0.05339231913351894 +benchEchoInt248Array4,fixed-array,33012,32451,-561,-1.6993820428934931 +benchEchoInt24Array4,fixed-array,33323,32741,-582,-1.7465414278426312 +benchEchoInt256,native-signed,26127,26033,-94,-0.35978106939181687 +benchEchoInt256Array4,fixed-array,32815,32086,-729,-2.2215450251409417 +benchEchoInt256Matrix2x2,nested-fixed-array,37379,35684,-1695,-4.534631745097514 +benchEchoInt32,native-signed,26243,26229,-14,-0.05334755934915977 +benchEchoInt32Array4,fixed-array,33335,32778,-557,-1.670916454177291 +benchEchoInt40,custom-signed,26176,26137,-39,-0.1489914425427873 +benchEchoInt40Array4,fixed-array,33322,32740,-582,-1.7465938419062483 +benchEchoInt40Matrix2x2,nested-fixed-array,37841,36397,-1444,-3.815966808488148 +benchEchoInt48,custom-signed,26179,26164,-15,-0.05729783414186943 +benchEchoInt56,custom-signed,26174,26208,34,0.12989990066478185 +benchEchoInt64,native-signed,26173,26164,-9,-0.034386581591716654 +benchEchoInt64Array4,fixed-array,33309,32731,-578,-1.7352667447236483 +benchEchoInt72,custom-signed,26200,26189,-11,-0.04198473282442748 +benchEchoInt8,native-signed,26237,26208,-29,-0.11053092960323208 +benchEchoInt80,custom-signed,26196,26184,-12,-0.04580852038479157 +benchEchoInt88,custom-signed,26174,26187,13,0.0496676090777107 +benchEchoInt8Array4,fixed-array,33372,32491,-881,-2.6399376723001318 +benchEchoInt96,custom-signed,26175,26186,11,0.04202483285577841 +benchEchoInt96Array4,fixed-array,33236,32636,-600,-1.8052713924660007 +benchEchoPair,tuple-dynamic,30558,29653,-905,-2.9615812553177565 +benchEchoString,dynamic-string,28051,27961,-90,-0.3208441766781933 +benchEchoStringArray,dynamic-fixed-array,43795,39587,-4208,-9.608402785706131 +benchEchoStringArray2,dynamic-fixed-array,35984,33936,-2048,-5.691418408181414 +benchEchoStringBoolU64Triple,tuple-dynamic,31781,30476,-1305,-4.106226990969447 +benchEchoStringU64PairArray,tuple-fixed-array-dynamic,52992,46127,-6865,-12.954785628019325 +benchEchoStringU64PairArray2,tuple-fixed-array-dynamic,40469,37642,-2827,-6.985593911388964 +benchEchoUint,native-unsigned,25758,25462,-296,-1.1491575432875223 +benchEchoUint104,custom-unsigned,25813,25773,-40,-0.15496067872777283 +benchEchoUint112,custom-unsigned,25768,25771,3,0.011642347097174792 +benchEchoUint120,custom-unsigned,25816,25817,1,0.0038735667802912922 +benchEchoUint128,native-unsigned,25748,25774,26,0.10097871679353736 +benchEchoUint128Array4,fixed-array,32330,31759,-571,-1.766161459944324 +benchEchoUint136,custom-unsigned,25859,25814,-45,-0.17402065045052012 +benchEchoUint144,custom-unsigned,25794,25793,-1,-0.0038768705900597035 +benchEchoUint152,custom-unsigned,25814,25817,3,0.011621600681800574 +benchEchoUint16,native-unsigned,25836,25838,2,0.007741136398823347 +benchEchoUint160,custom-unsigned,25792,25771,-21,-0.08142059553349876 +benchEchoUint160Array4,fixed-array,32353,31496,-857,-2.6489042747195004 +benchEchoUint168,custom-unsigned,25812,25837,25,0.09685417635208429 +benchEchoUint16Array4,fixed-array,32159,31570,-589,-1.831524612083709 +benchEchoUint176,custom-unsigned,25749,25753,4,0.015534583867334655 +benchEchoUint184,custom-unsigned,25860,25818,-42,-0.16241299303944315 +benchEchoUint192,custom-unsigned,25835,25795,-40,-0.154828720727695 +benchEchoUint200,custom-unsigned,25771,25773,2,0.00776066120833495 +benchEchoUint208,custom-unsigned,25813,25818,5,0.019370084840971604 +benchEchoUint216,custom-unsigned,25816,25794,-22,-0.08521846916640843 +benchEchoUint224,custom-unsigned,25814,25815,1,0.0038738668939335245 +benchEchoUint232,custom-unsigned,25814,25794,-20,-0.07747733787867049 +benchEchoUint24,custom-unsigned,25811,25818,7,0.027120220061214208 +benchEchoUint240,custom-unsigned,25836,25840,4,0.015482272797646694 +benchEchoUint248,custom-unsigned,25833,25814,-19,-0.07354933612046607 +benchEchoUint248Array4,fixed-array,32527,31954,-573,-1.7616134288437297 +benchEchoUint24Array4,fixed-array,32217,31622,-595,-1.8468510413756714 +benchEchoUint24Int40Pair,tuple-static,28666,27873,-793,-2.766343403334961 +benchEchoUint24Int40PairArray4,tuple-fixed-array,43434,39064,-4370,-10.061242344706912 +benchEchoUint24Matrix2x2,nested-fixed-array,36803,35296,-1507,-4.094774882482406 +benchEchoUint32,native-unsigned,25791,25798,7,0.02714125082393083 +benchEchoUint32Array4,fixed-array,32207,31638,-569,-1.766696680845779 +benchEchoUint40,custom-unsigned,25811,25817,6,0.02324590290961218 +benchEchoUint40Array4,fixed-array,32218,31624,-594,-1.8436898628096097 +benchEchoUint48,custom-unsigned,25793,25773,-20,-0.07754041794285271 +benchEchoUint56,custom-unsigned,25812,25839,27,0.10460251046025104 +benchEchoUint64,native-unsigned,25749,25752,3,0.01165093790050099 +benchEchoUint64Array4,fixed-array,32295,31687,-608,-1.882644372193838 +benchEchoUint72,custom-unsigned,25856,25838,-18,-0.06961633663366336 +benchEchoUint8,native-unsigned,25881,25842,-39,-0.1506896951431552 +benchEchoUint80,custom-unsigned,25770,25793,23,0.0892510671323244 +benchEchoUint88,custom-unsigned,25813,25809,-4,-0.015496067872777282 +benchEchoUint8Array4,fixed-array,32215,31599,-616,-1.9121527238863882 +benchEchoUint96,custom-unsigned,25838,25837,-1,-0.003870268596640607 +benchEchoUint96Array4,fixed-array,32367,31750,-617,-1.9062625513640437 +benchEchoUintArray,fixed-array,31380,30522,-858,-2.7342256214149137 +benchEchoUintArray4,fixed-array,30505,29774,-731,-2.3963284707425014 +benchEchoUintMatrix2x2,nested-fixed-array,34953,33298,-1655,-4.734929762824365 diff --git a/benchmarks/foundry-abi/reports/gas-diagnosis.md b/benchmarks/foundry-abi/reports/gas-diagnosis.md new file mode 100644 index 0000000000..f5f68e0be7 --- /dev/null +++ b/benchmarks/foundry-abi/reports/gas-diagnosis.md @@ -0,0 +1,219 @@ +# ABI Gas Diagnosis + +Last updated: 2026-03-30 + +This note records the current working diagnosis for why Fe still trails +Solidity on ABI gas in the Foundry parity harness. + +It is based on the latest regenerated reports in: + +- `benchmarks/foundry-abi/reports/gas-summary.md` +- `benchmarks/foundry-abi/reports/dyn-array-suite-gas.md` +- `benchmarks/foundry-abi/reports/deep-dynamic-suite-gas.md` +- `benchmarks/foundry-abi/reports/fixed-array-suite-gas.md` +- `benchmarks/foundry-abi/reports/fixed-array-ceiling-suite-gas.md` + +## High-Level Conclusion + +The remaining gas gap is mostly ABI marshalling overhead inside the Fe callee, +not extra work in the benchmark wrappers themselves. + +The Solidity and Fe bench caller contracts are intentionally symmetric in: + +- `benchmarks/foundry-abi/src/AbiRoundtripSol.sol` +- `benchmarks/foundry-abi/src/BytesSuiteSol.sol` +- `benchmarks/foundry-abi/src/DeepDynamicSuiteSol.sol` +- `benchmarks/foundry-abi/src/FixedArraySuiteSol.sol` +- `benchmarks/foundry-abi/src/FixedArrayCeilingSuiteSol.sol` + +So the meaningful delta is in Fe decode / owned-value handling / re-encode. + +## What The Current Reports Say + +From `gas-summary.md`: + +- worst category by mean delta is `tuple-dynamic` +- next worst categories are `fixed-array`, `tuple-static`, + `tuple-fixed-array-dynamic`, and `dynamic-fixed-array` +- plain native scalars are close to parity +- `address` and `bool` are slightly better than Solidity in the current run + +From the focused suites: + +- deep-dynamic regressions are still dominated by nested `bytes` and nested + tuple-array shapes +- fixed-array regressions are dominated by dynamic-element arrays such as + `string[17]`, `bytes[17]`, and `(string,uint64)[5]` + +That shape strongly suggests the cost is in dynamic ABI machinery rather than +generic call overhead. + +## Main Gas Drivers + +### 1. Owned dynamic decode copies payloads into memory + +`Bytes` decode in `ingots/core/src/abi.fe` reads the dynamic tail, allocates a +new buffer, and copies the payload word-by-word into owned memory. + +The same pattern exists for `DynArray` decode. + +Relevant code: + +- `impl Decode for Bytes` +- `impl Decode for DynArray` + +Why it hurts: + +- Solidity can often stay closer to calldata-oriented handling for simple echo + paths +- Fe currently materializes owned dynamic values first, even when the contract + body just returns the value unchanged +- nested dynamic values multiply this copy cost + +### 2. Dynamic arrays do a recursive span walk before copying + +`DynArray` decode does not only copy the tail. It first computes the end of +the full payload with `dyn_array_payload_end`, which walks element heads and, +for dynamic elements, recursively asks for each field end. + +Relevant code: + +- `dyn_array_payload_end` +- `impl AbiSpan for DynArray` +- `abi_field_end` + +Why it hurts: + +- one pass determines dynamic extent +- another pass copies the payload into owned memory +- encode then copies the owned payload back out again +- nested dynamic arrays and arrays of tuples magnify all three passes + +This matches the current deep-dynamic hot spots: + +- `bytes[][]` +- `(bytes,uint64)[][]` +- `(string,uint64)[][]` + +## 3. Dynamic-element fixed arrays pay per-element head/tail costs + +Fixed arrays are cheap when their element type is static. They get expensive +when the element type is dynamic. + +In `ingots/core/src/abi.fe`, `[T; N]` is treated as dynamic whenever `T` is +dynamic: + +- `impl AbiSize for [T; N]` + +The array encode/decode path then loops over every element and routes each one +through `decode_field` / `encode_field`, which handle parent wrappers and tail +offsets. + +Relevant code: + +- `decode_field` +- `encode_field` +- `impl Decode for [T; N]` +- `impl Encode for [T; N]` +- `impl AbiSpan for [T; N]` + +Why it hurts: + +- every `string` / `bytes` / dynamic tuple element contributes its own offset + bookkeeping +- larger fixed arrays repeat that machinery many times +- arrays of dynamic tuples combine both tuple head/tail logic and array head/tail + logic + +This matches the current worst fixed-array regressions: + +- `string[17]` +- `bytes[17]` +- `(string,uint64)[5]` + +### 4. `string` is still a dynamic ABI type, and the benches now measure it through `DynString` + +The parity harness no longer hides behind the old `String<32>` ceiling for +string coverage. Generated and focused string cases now use +`std::abi::DynString`, and the deterministic / fuzz payloads intentionally +cross the old single-word boundary. + +Relevant code: + +- `impl AbiSize for DynString` +- `impl Decode for DynString` +- `impl Encode for DynString` +- `impl SolCompat for DynString` + +Why it hurts: + +- every string still uses dynamic head/tail handling +- string arrays and string-containing tuples inherit the same dynamic costs +- the current string deltas now reflect real owned dynamic-string ABI work + rather than an artificially capped `String<32>` subset + +That is why: + +- top-level `string` is still expensive +- `string[]`, `string[17]`, `(string,uint64)[]`, and `(string,uint64)[5]` are + much worse +- the current reports are more representative of true Solidity `string` + parity costs than the older capped-string snapshot + +### 5. The current parity benches mostly measure owned paths, not zero-copy views + +There are zero-copy-ish view helpers available: + +- `decode_bytes_view_at` in `ingots/std/src/abi/sol.fe` +- `decode_string_view_at` in `ingots/std/src/abi/sol.fe` +- `encode_bytes_return_view` in `ingots/std/src/evm/storage_bytes.fe` + +But the current parity contracts largely exercise owned values: + +- `benchmarks/foundry-abi/fe/AbiRoundtrip.fe` +- `benchmarks/foundry-abi/fe/DynArraySuite.fe` +- `benchmarks/foundry-abi/fe/BytesSuite.fe` +- `benchmarks/foundry-abi/fe/DeepDynamicSuite.fe` +- `benchmarks/foundry-abi/fe/FixedArraySuite.fe` +- `benchmarks/foundry-abi/fe/FixedArrayCeilingSuite.fe` + +Why it matters: + +- the existing gas reports are mainly measuring decode-to-owned plus + encode-from-owned +- they are not yet measuring an optimized view-based echo fast path + +## What Does Not Look Like The Main Problem + +These do not look like the primary gas issue in the current data: + +- benchmark-wrapper asymmetry between Solidity and Fe +- plain scalar ABI encode/decode +- basic static tuple handling +- plain fixed arrays of static elements + +Those shapes are already near parity, and a few are slightly better than +Solidity in the current run. + +## Current Working Summary + +If reduced to one sentence: + +Fe is still paying too much for dynamic ABI ownership. + +More concretely: + +- decode walks dynamic structure to find bounds +- decode allocates and copies into owned memory +- encode copies the owned payload back out +- nested dynamic and dynamic-element fixed-array shapes amplify that overhead + +## Best Follow-On Optimization Targets + +The highest-value places to look next are: + +1. avoid unnecessary owned materialization for pure echo-like dynamic paths +2. reduce repeated head/tail scanning for nested dynamic arrays +3. trim per-element wrapper overhead for fixed arrays of dynamic elements +4. use view-based fast paths where the contract only forwards or returns the + ABI payload unchanged diff --git a/benchmarks/foundry-abi/reports/gas-optimization-estimates.md b/benchmarks/foundry-abi/reports/gas-optimization-estimates.md new file mode 100644 index 0000000000..c046afc538 --- /dev/null +++ b/benchmarks/foundry-abi/reports/gas-optimization-estimates.md @@ -0,0 +1,206 @@ +# ABI Gas Optimization Estimates + +Last updated: 2026-03-30 + +This note records the current rough estimate for how much ABI gas we could +still recover relative to Solidity, based on the latest reports in: + +- `benchmarks/foundry-abi/reports/gas-summary.md` +- `benchmarks/foundry-abi/reports/gas-diagnosis.md` +- `benchmarks/foundry-abi/reports/dyn-array-suite-gas.md` +- `benchmarks/foundry-abi/reports/bytes-suite-gas.md` +- `benchmarks/foundry-abi/reports/deep-dynamic-suite-gas.md` +- `benchmarks/foundry-abi/reports/fixed-array-suite-gas.md` + +These are estimates, not measured post-optimization results. + +## Current Baseline + +From `gas-summary.md`: + +- benchmarked functions: `111` +- mean Fe minus Solidity delta: `+1588.82` gas +- median Fe minus Solidity delta: `+1534.00` gas +- worst single regression: `benchEchoStringU64PairArray2 = +5203` + +## Where The Gap Currently Comes From + +Using the category means in `gas-summary.md`, the current total excess gas is +about `176,359` across the `111` benchmark functions. + +### Array-shaped ABI work + +The following categories are all array-dominated: + +- `fixed-array` +- `nested-fixed-array` +- `dynamic-fixed-array` +- `tuple-fixed-array` +- `tuple-fixed-array-dynamic` + +Together they account for about `91,987` total excess gas, which is about +`829` gas of the current overall mean by themselves. + +### Custom-width integer wrappers + +The scalar custom-width categories: + +- `custom-signed` +- `custom-unsigned` + +Together they account for about `64,402` total excess gas, which is about +`580` gas of the current overall mean. + +### Combined + +Arrays plus custom-width scalars together account for about: + +- `156,389` total excess gas +- about `1409` gas of the current mean +- about `89%` of the current overall gap + +That leaves only about `180` gas of mean gap in everything else combined. + +## What Different Optimization Outcomes Could Achieve + +### 1. Conservative, review-friendly ABI cleanup + +Focus: + +- static word arrays +- custom-width scalar wrappers +- obvious scalar encode/decode cleanup + +Expected gain: + +- about `400-700` gas off the overall mean + +Expected new mean: + +- roughly `+900` to `+1200` + +Why this seems realistic: + +- static-element arrays are already much closer than dynamic-element arrays +- custom-width scalars are numerous and consistently positive deltas +- this path does not require changing ownership semantics + +### 2. Strong practical parity pass + +Focus: + +- everything in the conservative pass +- one-pass dynamic array/span handling +- better fixed-array handling for dynamic elements +- lower wrapper overhead for nested static+dynamic composites + +Expected gain: + +- about `700-1100` gas off the overall mean + +Expected new mean: + +- roughly `+500` to `+900` + +Why this seems realistic: + +- the current reports show arrays dominate the gas problem +- fixed arrays with dynamic elements and nested dynamic arrays are still the + biggest regressions in the focused suites + +### 3. Benchmark-maximal ABI fast paths + +Focus: + +- everything in the strong parity pass +- view/forward fast paths for unchanged dynamic values +- especially `bytes`, `string`, `T[]`, and dynamic tuples in echo-like paths + +Expected gain: + +- another `250-500` gas on top of the strong parity pass + +Expected new mean: + +- roughly `+250` to `+650` + +Why this seems realistic: + +- the current parity harness mostly measures decode-to-owned followed by + encode-from-owned +- many benchmark shapes are pure pass-through +- top-level `bytes` is only `+1718`, which feels attackable with a good + zero-copy or borrowed fast path + +### 4. Aggressive runtime redesign + +Focus: + +- keep dynamic ABI values borrowed or lazy by default +- materialize owned values only on mutation or storage escape +- make ownership the slower path rather than the default path + +Expected gain: + +- potentially enough to push the mean into roughly `+150` to `+400` + +Why this seems plausible: + +- `gas-diagnosis.md` strongly suggests the main cost is decode span walk, + allocate, copy into owned memory, then copy back out +- removing that default ownership tax would attack the central cost model + +Why this is riskier: + +- this is a real runtime and semantics redesign, not just encoder cleanup +- correctness and ergonomics risk are much higher than the earlier options + +## Per-Shape Upside + +The overall mean hides how large the remaining opportunity still is on the +hardest shapes. + +From the focused reports: + +- top-level `bytes`: `+1718` +- `string[]`: `+4553` +- `(string,uint64)[]`: `+6621` +- `string[17]`: `+24071` +- `bytes[17]`: `+23596` +- `(string,uint64)[5]`: `+9484` +- nested `bytes` / `string` array cases: roughly `+10k` to `+15k` + +So even if the overall mean only falls by hundreds of gas, the hardest ABI +families still have room for very large absolute wins. + +## Practical Read + +If the goal is engineering return on time spent: + +1. attack array handling first +2. attack custom-width scalar paths second +3. only then decide how aggressive to be about borrowed/value-forward ABI paths + +If the goal is the safest reviewable optimization pass: + +1. static arrays +2. custom widths +3. defer ownership redesign + +If the goal is the largest benchmark drop: + +1. view/forward fast paths for unchanged dynamic values +2. reduce repeated span walks for nested dynamic arrays +3. trim per-element wrapper overhead for dynamic-element fixed arrays + +## Bottom Line + +The current data suggests: + +- cutting the ABI gas gap roughly in half looks realistic without doing + anything too radical +- cutting it by roughly two-thirds to three-quarters looks plausible if we are + willing to change how dynamic ABI values flow through the runtime +- getting very close to Solidity on the current benchmark set looks more + realistic than it did before the current parity work, because the remaining + gap is now concentrated in a relatively clear set of dynamic ABI costs diff --git a/benchmarks/foundry-abi/reports/gas-report.txt b/benchmarks/foundry-abi/reports/gas-report.txt new file mode 100644 index 0000000000..300087bf33 --- /dev/null +++ b/benchmarks/foundry-abi/reports/gas-report.txt @@ -0,0 +1,2730 @@ +No files changed, compilation skipped + +Ran 1 test for test/generated/bench/AbiInt184Bench.t.sol:AbiInt184BenchTest +[PASS] testBenchEchoInt184() (gas: 63160) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 616.28ms (121.94µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt240Deterministic.t.sol:AbiInt240DeterministicTest +[PASS] testEchoInt240Deterministic0() (gas: 54955) +[PASS] testEchoInt240Deterministic1() (gas: 55978) +[PASS] testEchoInt240Deterministic2() (gas: 55006) +[PASS] testEchoInt240Deterministic3() (gas: 55814) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 620.29ms (233.14µs CPU time) + +Ran 1 test for test/generated/bench/AbiAddressArray4Bench.t.sol:AbiAddressArray4BenchTest +[PASS] testBenchEchoAddressArray4() (gas: 89121) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 621.09ms (305.21µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt104Bench.t.sol:AbiInt104BenchTest +[PASS] testBenchEchoInt104() (gas: 63229) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 622.41ms (99.50µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiAddressMatrix2x2Deterministic.t.sol:AbiAddressMatrix2x2DeterministicTest +[PASS] testEchoAddressMatrix2x2Deterministic0() (gas: 63193) +[PASS] testEchoAddressMatrix2x2Deterministic1() (gas: 63264) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 623.40ms (231.78µs CPU time) + +Ran 1 test for test/generated/bench/AbiBoolAddressPairArrayBench.t.sol:AbiBoolAddressPairArrayBenchTest +[PASS] testBenchEchoBoolAddressPairArray() (gas: 92289) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 628.58ms (324.31µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt152Bench.t.sol:AbiInt152BenchTest +[PASS] testBenchEchoInt152() (gas: 63184) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 629.51ms (96.86µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt168Deterministic.t.sol:AbiInt168DeterministicTest +[PASS] testEchoInt168Deterministic0() (gas: 54910) +[PASS] testEchoInt168Deterministic1() (gas: 55940) +[PASS] testEchoInt168Deterministic2() (gas: 55177) +[PASS] testEchoInt168Deterministic3() (gas: 55459) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 630.05ms (266.45µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiBoolAddressPairArrayDeterministic.t.sol:AbiBoolAddressPairArrayDeterministicTest +[PASS] testEchoBoolAddressPairArrayDeterministic0() (gas: 56382) +[PASS] testEchoBoolAddressPairArrayDeterministic1() (gas: 62942) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 643.97ms (217.33µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiAddressArray4Deterministic.t.sol:AbiAddressArray4DeterministicTest +[PASS] testEchoAddressArray4Deterministic0() (gas: 60381) +[PASS] testEchoAddressArray4Deterministic1() (gas: 60408) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 604.38ms (206.43µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt104Deterministic.t.sol:AbiInt104DeterministicTest +[PASS] testEchoInt104Deterministic0() (gas: 54889) +[PASS] testEchoInt104Deterministic1() (gas: 56022) +[PASS] testEchoInt104Deterministic2() (gas: 55414) +[PASS] testEchoInt104Deterministic3() (gas: 55268) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 606.66ms (259.44µs CPU time) + +Ran 1 test for test/generated/bench/AbiStringArrayBench.t.sol:AbiStringArrayBenchTest +[PASS] testBenchEchoStringArray() (gas: 98414) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 603.55ms (354.76µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiInt128Array4Deterministic.t.sol:AbiInt128Array4DeterministicTest +[PASS] testEchoInt128Array4Deterministic0() (gas: 61425) +[PASS] testEchoInt128Array4Deterministic1() (gas: 61447) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 611.33ms (190.27µs CPU time) + +Ran 1 test for test/generated/bench/AbiAddressMatrix2x2Bench.t.sol:AbiAddressMatrix2x2BenchTest +[PASS] testBenchEchoAddressMatrix2x2() (gas: 104614) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 623.16ms (424.41µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt152Deterministic.t.sol:AbiInt152DeterministicTest +[PASS] testEchoInt152Deterministic0() (gas: 55000) +[PASS] testEchoInt152Deterministic1() (gas: 55978) +[PASS] testEchoInt152Deterministic2() (gas: 55271) +[PASS] testEchoInt152Deterministic3() (gas: 55479) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 617.76ms (229.62µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt184Deterministic.t.sol:AbiInt184DeterministicTest +[PASS] testEchoInt184Deterministic0() (gas: 54956) +[PASS] testEchoInt184Deterministic1() (gas: 56022) +[PASS] testEchoInt184Deterministic2() (gas: 55219) +[PASS] testEchoInt184Deterministic3() (gas: 55465) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 651.67ms (257.15µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiAddressMatrix2x2Fuzz.t.sol:AbiAddressMatrix2x2FuzzTest +[PASS] testEchoAddressMatrix2x2Fuzz(address[2][2]) (runs: 256, μ: 66785, ~: 67367) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.27s (656.00ms CPU time) + +Ran 1 test for test/generated/bench/AbiInt136Bench.t.sol:AbiInt136BenchTest +[PASS] testBenchEchoInt136() (gas: 63101) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 640.07ms (97.39µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt16Array4Bench.t.sol:AbiInt16Array4BenchTest +[PASS] testBenchEchoInt16Array4() (gas: 88038) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 599.58ms (313.58µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt56Deterministic.t.sol:AbiInt56DeterministicTest +[PASS] testEchoInt56Deterministic0() (gas: 54889) +[PASS] testEchoInt56Deterministic1() (gas: 55978) +[PASS] testEchoInt56Deterministic2() (gas: 55640) +[PASS] testEchoInt56Deterministic3() (gas: 55124) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 610.25ms (291.18µs CPU time) + +Ran 1 test for test/generated/bench/AbiBoolArray4Bench.t.sol:AbiBoolArray4BenchTest +[PASS] testBenchEchoBoolArray4() (gas: 85679) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 639.32ms (272.60µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt136Deterministic.t.sol:AbiInt136DeterministicTest +[PASS] testEchoInt136Deterministic0() (gas: 54893) +[PASS] testEchoInt136Deterministic1() (gas: 55956) +[PASS] testEchoInt136Deterministic2() (gas: 55322) +[PASS] testEchoInt136Deterministic3() (gas: 55324) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 649.96ms (237.19µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt160Bench.t.sol:AbiInt160BenchTest +[PASS] testBenchEchoInt160() (gas: 63184) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 721.07ms (106.26µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt160Array4Fuzz.t.sol:AbiInt160Array4FuzzTest +[PASS] testEchoInt160Array4Fuzz(int160[4]) (runs: 256, μ: 62751, ~: 62601) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.36s (748.47ms CPU time) + +Ran 3 tests for test/generated/deterministic/AbiStringArrayDeterministic.t.sol:AbiStringArrayDeterministicTest +[PASS] testEchoStringArrayDeterministic0() (gas: 56806) +[PASS] testEchoStringArrayDeterministic1() (gas: 64694) +[PASS] testEchoStringArrayDeterministic2() (gas: 66406) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 762.32ms (310.24µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt248Array4Bench.t.sol:AbiInt248Array4BenchTest +[PASS] testBenchEchoInt248Array4() (gas: 87410) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 796.16ms (279.48µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiInt16Array4Deterministic.t.sol:AbiInt16Array4DeterministicTest +[PASS] testEchoInt16Array4Deterministic0() (gas: 61446) +[PASS] testEchoInt16Array4Deterministic1() (gas: 61468) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 608.24ms (193.16µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt112Bench.t.sol:AbiInt112BenchTest +[PASS] testBenchEchoInt112() (gas: 63207) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 603.99ms (105.37µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint224Fuzz.t.sol:AbiUint224FuzzTest +[PASS] testEchoUint224Fuzz(uint224) (runs: 256, μ: 55372, ~: 55195) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 639.98ms (17.06ms CPU time) + +Ran 1 test for test/generated/bench/AbiInt160Array4Bench.t.sol:AbiInt160Array4BenchTest +[PASS] testBenchEchoInt160Array4() (gas: 87609) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 644.78ms (268.63µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt136Fuzz.t.sol:AbiInt136FuzzTest +[PASS] testEchoInt136Fuzz(int136) (runs: 256, μ: 55522, ~: 55234) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 614.78ms (16.31ms CPU time) + +Ran 1 test for test/generated/bench/AbiInt128Bench.t.sol:AbiInt128BenchTest +[PASS] testBenchEchoInt128() (gas: 63145) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 713.47ms (143.53µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiBoolArray4Deterministic.t.sol:AbiBoolArray4DeterministicTest +[PASS] testEchoBoolArray4Deterministic0() (gas: 59419) +[PASS] testEchoBoolArray4Deterministic1() (gas: 59397) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 649.82ms (191.11µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiInt248Array4Deterministic.t.sol:AbiInt248Array4DeterministicTest +[PASS] testEchoInt248Array4Deterministic0() (gas: 61426) +[PASS] testEchoInt248Array4Deterministic1() (gas: 61448) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 610.27ms (197.43µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt160Deterministic.t.sol:AbiInt160DeterministicTest +[PASS] testEchoInt160Deterministic0() (gas: 55000) +[PASS] testEchoInt160Deterministic1() (gas: 55978) +[PASS] testEchoInt160Deterministic2() (gas: 55335) +[PASS] testEchoInt160Deterministic3() (gas: 55437) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 674.87ms (225.69µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt192Bench.t.sol:AbiInt192BenchTest +[PASS] testBenchEchoInt192() (gas: 63207) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 898.09ms (108.01µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt112Deterministic.t.sol:AbiInt112DeterministicTest +[PASS] testEchoInt112Deterministic0() (gas: 54977) +[PASS] testEchoInt112Deterministic1() (gas: 55934) +[PASS] testEchoInt112Deterministic2() (gas: 55456) +[PASS] testEchoInt112Deterministic3() (gas: 55292) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 608.81ms (225.75µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt104Fuzz.t.sol:AbiInt104FuzzTest +[PASS] testEchoInt104Fuzz(int104) (runs: 256, μ: 55485, ~: 55262) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.83s (1.23s CPU time) + +Ran 1 test for test/generated/bench/AbiUint232Bench.t.sol:AbiUint232BenchTest +[PASS] testBenchEchoUint232() (gas: 62415) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 613.64ms (113.06µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt16Array4Fuzz.t.sol:AbiInt16Array4FuzzTest +[PASS] testEchoInt16Array4Fuzz(int16[4]) (runs: 256, μ: 62982, ~: 62935) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 661.81ms (30.23ms CPU time) + +Ran 1 test for test/generated/bench/AbiInt64Array4Bench.t.sol:AbiInt64Array4BenchTest +[PASS] testBenchEchoInt64Array4() (gas: 87987) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 610.52ms (269.98µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt168Fuzz.t.sol:AbiInt168FuzzTest +[PASS] testEchoInt168Fuzz(int168) (runs: 256, μ: 55560, ~: 55359) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 2.48s (1.88s CPU time) + +Ran 2 tests for test/generated/deterministic/AbiInt160Array4Deterministic.t.sol:AbiInt160Array4DeterministicTest +[PASS] testEchoInt160Array4Deterministic0() (gas: 61469) +[PASS] testEchoInt160Array4Deterministic1() (gas: 61491) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 611.86ms (177.31µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt152Fuzz.t.sol:AbiInt152FuzzTest +[PASS] testEchoInt152Fuzz(int152) (runs: 256, μ: 55558, ~: 55307) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.88s (1.27s CPU time) + +Ran 1 test for test/generated/fuzz/AbiBoolArray4Fuzz.t.sol:AbiBoolArray4FuzzTest +[PASS] testEchoBoolArray4Fuzz(bool[4]) (runs: 256, μ: 60810, ~: 60811) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 653.45ms (24.25ms CPU time) + +Ran 1 test for test/generated/bench/AbiInt144Bench.t.sol:AbiInt144BenchTest +[PASS] testBenchEchoInt144() (gas: 63228) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 747.68ms (99.23µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt128Deterministic.t.sol:AbiInt128DeterministicTest +[PASS] testEchoInt128Deterministic0() (gas: 54937) +[PASS] testEchoInt128Deterministic1() (gas: 55978) +[PASS] testEchoInt128Deterministic2() (gas: 55324) +[PASS] testEchoInt128Deterministic3() (gas: 55256) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 763.00ms (306.07µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt160Fuzz.t.sol:AbiInt160FuzzTest +[PASS] testEchoInt160Fuzz(int160) (runs: 256, μ: 55590, ~: 55379) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 680.34ms (16.29ms CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt248Array4Fuzz.t.sol:AbiInt248Array4FuzzTest +[PASS] testEchoInt248Array4Fuzz(int248[4]) (runs: 256, μ: 62971, ~: 62789) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 786.83ms (25.36ms CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt240Fuzz.t.sol:AbiInt240FuzzTest +[PASS] testEchoInt240Fuzz(int240) (runs: 256, μ: 55580, ~: 55312) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 2.82s (2.21s CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt192Deterministic.t.sol:AbiInt192DeterministicTest +[PASS] testEchoInt192Deterministic0() (gas: 54933) +[PASS] testEchoInt192Deterministic1() (gas: 56022) +[PASS] testEchoInt192Deterministic2() (gas: 55194) +[PASS] testEchoInt192Deterministic3() (gas: 55532) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 669.76ms (238.48µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt184Fuzz.t.sol:AbiInt184FuzzTest +[PASS] testEchoInt184Fuzz(int184) (runs: 256, μ: 55581, ~: 55381) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 2.20s (1.58s CPU time) + +Ran 2 tests for test/generated/deterministic/AbiInt64Array4Deterministic.t.sol:AbiInt64Array4DeterministicTest +[PASS] testEchoInt64Array4Deterministic0() (gas: 61470) +[PASS] testEchoInt64Array4Deterministic1() (gas: 61448) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 612.94ms (278.47µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint232Deterministic.t.sol:AbiUint232DeterministicTest +[PASS] testEchoUint232Deterministic0() (gas: 54961) +[PASS] testEchoUint232Deterministic1() (gas: 54942) +[PASS] testEchoUint232Deterministic2() (gas: 55796) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 628.89ms (185.29µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt16Bench.t.sol:AbiInt16BenchTest +[PASS] testBenchEchoInt16() (gas: 63226) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 613.44ms (159.11µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt168Bench.t.sol:AbiInt168BenchTest +[PASS] testBenchEchoInt168() (gas: 63182) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 595.27ms (101.14µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt128Fuzz.t.sol:AbiInt128FuzzTest +[PASS] testEchoInt128Fuzz(int128) (runs: 256, μ: 55760, ~: 56210) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 686.39ms (22.88ms CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt120Deterministic.t.sol:AbiInt120DeterministicTest +[PASS] testEchoInt120Deterministic0() (gas: 54934) +[PASS] testEchoInt120Deterministic1() (gas: 56000) +[PASS] testEchoInt120Deterministic2() (gas: 55323) +[PASS] testEchoInt120Deterministic3() (gas: 55339) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 883.43ms (209.88µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt128Array4Fuzz.t.sol:AbiInt128Array4FuzzTest +[PASS] testEchoInt128Array4Fuzz(int128[4]) (runs: 256, μ: 63524, ~: 63061) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 2.80s (2.19s CPU time) + +Ran 1 test for test/generated/bench/AbiInt248Bench.t.sol:AbiInt248BenchTest +[PASS] testBenchEchoInt248() (gas: 63251) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 598.00ms (96.77µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt144Deterministic.t.sol:AbiInt144DeterministicTest +[PASS] testEchoInt144Deterministic0() (gas: 55022) +[PASS] testEchoInt144Deterministic1() (gas: 55956) +[PASS] testEchoInt144Deterministic2() (gas: 55339) +[PASS] testEchoInt144Deterministic3() (gas: 55433) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 854.60ms (214.09µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt120Bench.t.sol:AbiInt120BenchTest +[PASS] testBenchEchoInt120() (gas: 63228) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 603.75ms (103.93µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt112Fuzz.t.sol:AbiInt112FuzzTest +[PASS] testEchoInt112Fuzz(int112) (runs: 256, μ: 55550, ~: 55284) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.27s (619.64ms CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint232Fuzz.t.sol:AbiUint232FuzzTest +[PASS] testEchoUint232Fuzz(uint232) (runs: 256, μ: 55437, ~: 55314) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 620.92ms (15.96ms CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt64Array4Fuzz.t.sol:AbiInt64Array4FuzzTest +[PASS] testEchoInt64Array4Fuzz(int64[4]) (runs: 256, μ: 63112, ~: 62979) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 635.53ms (25.94ms CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt16Deterministic.t.sol:AbiInt16DeterministicTest +[PASS] testEchoInt16Deterministic0() (gas: 54912) +[PASS] testEchoInt16Deterministic1() (gas: 56022) +[PASS] testEchoInt16Deterministic2() (gas: 55940) +[PASS] testEchoInt16Deterministic3() (gas: 54983) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 632.41ms (246.96µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt56Fuzz.t.sol:AbiInt56FuzzTest +[PASS] testEchoInt56Fuzz(int56) (runs: 256, μ: 55504, ~: 55216) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 2.49s (1.88s CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint136Deterministic.t.sol:AbiUint136DeterministicTest +[PASS] testEchoUint136Deterministic0() (gas: 54982) +[PASS] testEchoUint136Deterministic1() (gas: 54985) +[PASS] testEchoUint136Deterministic2() (gas: 55347) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 593.35ms (174.91µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt248Deterministic.t.sol:AbiInt248DeterministicTest +[PASS] testEchoInt248Deterministic0() (gas: 54999) +[PASS] testEchoInt248Deterministic1() (gas: 55956) +[PASS] testEchoInt248Deterministic2() (gas: 54960) +[PASS] testEchoInt248Deterministic3() (gas: 55940) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 650.95ms (231.99µs CPU time) + +Ran 1 test for test/generated/bench/AbiBoolBench.t.sol:AbiBoolBenchTest +[PASS] testBenchEchoBool() (gas: 62395) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 745.86ms (96.39µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt144Fuzz.t.sol:AbiInt144FuzzTest +[PASS] testEchoInt144Fuzz(int144) (runs: 256, μ: 55522, ~: 55307) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 692.82ms (16.98ms CPU time) + +Ran 1 test for test/generated/fuzz/AbiAddressFuzz.t.sol:AbiAddressFuzzTest +[PASS] testEchoAddressFuzz(address) (runs: 256, μ: 55602, ~: 55774) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 4.87s (4.22s CPU time) + +Ran 1 test for test/generated/bench/AbiUint240Bench.t.sol:AbiUint240BenchTest +[PASS] testBenchEchoUint240() (gas: 62483) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 607.65ms (93.73µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt64Bench.t.sol:AbiInt64BenchTest +[PASS] testBenchEchoInt64() (gas: 63160) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 615.54ms (95.16µs CPU time) + +Ran 1 test for test/generated/bench/AbiBoolMatrix2x2Bench.t.sol:AbiBoolMatrix2x2BenchTest +[PASS] testBenchEchoBoolMatrix2x2() (gas: 101239) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 683.38ms (378.91µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt200Bench.t.sol:AbiInt200BenchTest +[PASS] testBenchEchoInt200() (gas: 63181) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 831.21ms (129.14µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt128Array4Bench.t.sol:AbiInt128Array4BenchTest +[PASS] testBenchEchoInt128Array4() (gas: 87685) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 620.60ms (260.75µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt120Fuzz.t.sol:AbiInt120FuzzTest +[PASS] testEchoInt120Fuzz(int120) (runs: 256, μ: 55517, ~: 55263) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.34s (637.59ms CPU time) + +Ran 2 tests for test/generated/deterministic/AbiBoolDeterministic.t.sol:AbiBoolDeterministicTest +[PASS] testEchoBoolDeterministic0() (gas: 54921) +[PASS] testEchoBoolDeterministic1() (gas: 54984) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 613.17ms (134.86µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint240Deterministic.t.sol:AbiUint240DeterministicTest +[PASS] testEchoUint240Deterministic0() (gas: 54917) +[PASS] testEchoUint240Deterministic1() (gas: 54920) +[PASS] testEchoUint240Deterministic2() (gas: 55878) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 633.24ms (169.00µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt64Deterministic.t.sol:AbiInt64DeterministicTest +[PASS] testEchoInt64Deterministic0() (gas: 54978) +[PASS] testEchoInt64Deterministic1() (gas: 55956) +[PASS] testEchoInt64Deterministic2() (gas: 55606) +[PASS] testEchoInt64Deterministic3() (gas: 55149) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 615.29ms (223.96µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt176Bench.t.sol:AbiInt176BenchTest +[PASS] testBenchEchoInt176() (gas: 63227) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 634.17ms (92.93µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiBoolMatrix2x2Deterministic.t.sol:AbiBoolMatrix2x2DeterministicTest +[PASS] testEchoBoolMatrix2x2Deterministic0() (gas: 62322) +[PASS] testEchoBoolMatrix2x2Deterministic1() (gas: 62300) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 611.42ms (216.19µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiBoolFuzz.t.sol:AbiBoolFuzzTest +[PASS] testEchoBoolFuzz(bool) (runs: 256, μ: 55192, ~: 55174) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 839.53ms (15.34ms CPU time) + +Ran 1 test for test/generated/bench/AbiUint144Bench.t.sol:AbiUint144BenchTest +[PASS] testBenchEchoUint144() (gas: 62394) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 610.82ms (105.25µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt8Deterministic.t.sol:AbiInt8DeterministicTest +[PASS] testEchoInt8Deterministic0() (gas: 54997) +[PASS] testEchoInt8Deterministic1() (gas: 55933) +[PASS] testEchoInt8Deterministic2() (gas: 56021) +[PASS] testEchoInt8Deterministic3() (gas: 55000) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 613.70ms (386.79µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt24Array4Fuzz.t.sol:AbiInt24Array4FuzzTest +[PASS] testEchoInt24Array4Fuzz(int24[4]) (runs: 256, μ: 62219, ~: 61749) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 693.56ms (56.04ms CPU time) + +Ran 2 tests for test/generated/deterministic/AbiTripleBoolAddressU256Deterministic.t.sol:AbiTripleBoolAddressU256DeterministicTest +[PASS] testEchoBoolAddressU256TripleDeterministic0() (gas: 57544) +[PASS] testEchoBoolAddressU256TripleDeterministic1() (gas: 58629) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 654.10ms (158.92µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt200Deterministic.t.sol:AbiInt200DeterministicTest +[PASS] testEchoInt200Deterministic0() (gas: 54911) +[PASS] testEchoInt200Deterministic1() (gas: 56022) +[PASS] testEchoInt200Deterministic2() (gas: 55126) +[PASS] testEchoInt200Deterministic3() (gas: 55580) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 870.72ms (229.38µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt192Fuzz.t.sol:AbiInt192FuzzTest +[PASS] testEchoInt192Fuzz(int192) (runs: 256, μ: 55601, ~: 55392) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 2.68s (1.72s CPU time) + +Ran 1 test for test/generated/fuzz/AbiBoolMatrix2x2Fuzz.t.sol:AbiBoolMatrix2x2FuzzTest +[PASS] testEchoBoolMatrix2x2Fuzz(bool[2][2]) (runs: 256, μ: 64843, ~: 64846) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 637.06ms (30.46ms CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt176Deterministic.t.sol:AbiInt176DeterministicTest +[PASS] testEchoInt176Deterministic0() (gas: 54955) +[PASS] testEchoInt176Deterministic1() (gas: 56022) +[PASS] testEchoInt176Deterministic2() (gas: 55198) +[PASS] testEchoInt176Deterministic3() (gas: 55440) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 646.94ms (238.76µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint144Deterministic.t.sol:AbiUint144DeterministicTest +[PASS] testEchoUint144Deterministic0() (gas: 54894) +[PASS] testEchoUint144Deterministic1() (gas: 54941) +[PASS] testEchoUint144Deterministic2() (gas: 55371) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 608.65ms (181.79µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint240Fuzz.t.sol:AbiUint240FuzzTest +[PASS] testEchoUint240Fuzz(uint240) (runs: 256, μ: 55393, ~: 55232) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 854.46ms (31.41ms CPU time) + +Ran 1 test for test/generated/bench/AbiInt24Bench.t.sol:AbiInt24BenchTest +[PASS] testBenchEchoInt24() (gas: 63186) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 773.05ms (88.13µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt72Bench.t.sol:AbiInt72BenchTest +[PASS] testBenchEchoInt72() (gas: 63212) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 617.85ms (91.14µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint144Fuzz.t.sol:AbiUint144FuzzTest +[PASS] testEchoUint144Fuzz(uint144) (runs: 256, μ: 55316, ~: 55243) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 636.41ms (17.01ms CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint136Fuzz.t.sol:AbiUint136FuzzTest +[PASS] testEchoUint136Fuzz(uint136) (runs: 256, μ: 55353, ~: 55287) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 2.46s (1.87s CPU time) + +Ran 1 test for test/generated/bench/AbiUint248Array4Bench.t.sol:AbiUint248Array4BenchTest +[PASS] testBenchEchoUint248Array4() (gas: 86348) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 655.36ms (275.87µs CPU time) + +Ran 1 test for test/generated/bench/AbiStringU64PairArray2Bench.t.sol:AbiStringU64PairArray2BenchTest +[PASS] testBenchEchoStringU64PairArray2() (gas: 110167) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 698.98ms (433.13µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt176Fuzz.t.sol:AbiInt176FuzzTest +[PASS] testEchoInt176Fuzz(int176) (runs: 256, μ: 55546, ~: 55310) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 870.52ms (16.83ms CPU time) + +Ran 1 test for test/generated/fuzz/AbiStringFuzz.t.sol:AbiStringFuzzTest +[PASS] testEchoStringFuzz(string) (runs: 256, μ: 61972, ~: 61460) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.44s (723.59ms CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt16Fuzz.t.sol:AbiInt16FuzzTest +[PASS] testEchoInt16Fuzz(int16) (runs: 256, μ: 55710, ~: 56210) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 2.80s (2.17s CPU time) + +Ran 1 test for test/generated/bench/AbiTripleStringBoolU64Bench.t.sol:AbiTripleStringBoolU64BenchTest +[PASS] testBenchEchoStringBoolU64Triple() (gas: 83375) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 641.83ms (238.11µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt208Bench.t.sol:AbiInt208BenchTest +[PASS] testBenchEchoInt208() (gas: 63117) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 605.05ms (93.06µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt72Deterministic.t.sol:AbiInt72DeterministicTest +[PASS] testEchoInt72Deterministic0() (gas: 54978) +[PASS] testEchoInt72Deterministic1() (gas: 56022) +[PASS] testEchoInt72Deterministic2() (gas: 55511) +[PASS] testEchoInt72Deterministic3() (gas: 55173) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 615.85ms (266.93µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt64Fuzz.t.sol:AbiInt64FuzzTest +[PASS] testEchoInt64Fuzz(int64) (runs: 256, μ: 55675, ~: 55357) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.87s (1.25s CPU time) + +Ran 1 test for test/generated/bench/AbiInt96Array4Bench.t.sol:AbiInt96Array4BenchTest +[PASS] testBenchEchoInt96Array4() (gas: 87819) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 774.92ms (266.98µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt80Bench.t.sol:AbiInt80BenchTest +[PASS] testBenchEchoInt80() (gas: 63203) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 648.91ms (91.38µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt72Fuzz.t.sol:AbiInt72FuzzTest +[PASS] testEchoInt72Fuzz(int72) (runs: 256, μ: 55527, ~: 55261) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.28s (662.83ms CPU time) + +Ran 1 test for test/generated/bench/AbiUint152Bench.t.sol:AbiUint152BenchTest +[PASS] testBenchEchoUint152() (gas: 62438) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 694.92ms (100.83µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiUint248Array4Deterministic.t.sol:AbiUint248Array4DeterministicTest +[PASS] testEchoUint248Array4Deterministic0() (gas: 60112) +[PASS] testEchoUint248Array4Deterministic1() (gas: 60115) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 603.45ms (279.46µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiStringU64PairArray2Deterministic.t.sol:AbiStringU64PairArray2DeterministicTest +[PASS] testEchoStringU64PairArray2Deterministic0() (gas: 67675) +[PASS] testEchoStringU64PairArray2Deterministic1() (gas: 70202) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 616.82ms (297.66µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt24Deterministic.t.sol:AbiInt24DeterministicTest +[PASS] testEchoInt24Deterministic0() (gas: 54870) +[PASS] testEchoInt24Deterministic1() (gas: 55978) +[PASS] testEchoInt24Deterministic2() (gas: 55880) +[PASS] testEchoInt24Deterministic3() (gas: 55009) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 1.01s (223.07µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint16Deterministic.t.sol:AbiUint16DeterministicTest +[PASS] testEchoUint16Deterministic0() (gas: 54917) +[PASS] testEchoUint16Deterministic1() (gas: 54920) +[PASS] testEchoUint16Deterministic2() (gas: 54988) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 656.27ms (209.22µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt208Deterministic.t.sol:AbiInt208DeterministicTest +[PASS] testEchoInt208Deterministic0() (gas: 54933) +[PASS] testEchoInt208Deterministic1() (gas: 56022) +[PASS] testEchoInt208Deterministic2() (gas: 55080) +[PASS] testEchoInt208Deterministic3() (gas: 55596) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 605.52ms (280.18µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt200Fuzz.t.sol:AbiInt200FuzzTest +[PASS] testEchoInt200Fuzz(int200) (runs: 256, μ: 55602, ~: 55406) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.83s (1.23s CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt80Deterministic.t.sol:AbiInt80DeterministicTest +[PASS] testEchoInt80Deterministic0() (gas: 54977) +[PASS] testEchoInt80Deterministic1() (gas: 55956) +[PASS] testEchoInt80Deterministic2() (gas: 55552) +[PASS] testEchoInt80Deterministic3() (gas: 55196) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 653.05ms (231.51µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiTripleStringBoolU64Deterministic.t.sol:AbiTripleStringBoolU64DeterministicTest +[PASS] testEchoStringBoolU64TripleDeterministic0() (gas: 60079) +[PASS] testEchoStringBoolU64TripleDeterministic1() (gas: 61509) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 922.14ms (220.60µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiInt96Array4Deterministic.t.sol:AbiInt96Array4DeterministicTest +[PASS] testEchoInt96Array4Deterministic0() (gas: 61490) +[PASS] testEchoInt96Array4Deterministic1() (gas: 61468) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 781.62ms (187.51µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint152Deterministic.t.sol:AbiUint152DeterministicTest +[PASS] testEchoUint152Deterministic0() (gas: 54916) +[PASS] testEchoUint152Deterministic1() (gas: 54919) +[PASS] testEchoUint152Deterministic2() (gas: 55395) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 609.56ms (189.86µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint248Array4Fuzz.t.sol:AbiUint248Array4FuzzTest +[PASS] testEchoUint248Array4Fuzz(uint248[4]) (runs: 256, μ: 62039, ~: 61839) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 627.90ms (26.67ms CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt24Fuzz.t.sol:AbiInt24FuzzTest +[PASS] testEchoInt24Fuzz(int24) (runs: 256, μ: 55431, ~: 55173) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 637.88ms (17.28ms CPU time) + +Ran 1 test for test/generated/bench/AbiUint160Bench.t.sol:AbiUint160BenchTest +[PASS] testBenchEchoUint160() (gas: 62370) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 617.14ms (97.12µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint160Array4Fuzz.t.sol:AbiUint160Array4FuzzTest +[PASS] testEchoUint160Array4Fuzz(uint160[4]) (runs: 256, μ: 61269, ~: 61126) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.26s (641.73ms CPU time) + +Ran 1 test for test/generated/bench/AbiUint248Bench.t.sol:AbiUint248BenchTest +[PASS] testBenchEchoUint248() (gas: 62454) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 642.26ms (98.76µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt96Array4Fuzz.t.sol:AbiInt96Array4FuzzTest +[PASS] testEchoInt96Array4Fuzz(int96[4]) (runs: 256, μ: 62708, ~: 62453) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 706.67ms (26.40ms CPU time) + +Ran 1 test for test/generated/fuzz/AbiTripleStringBoolU64Fuzz.t.sol:AbiTripleStringBoolU64FuzzTest +[PASS] testEchoStringBoolU64TripleFuzz(string,bool,uint64) (runs: 256, μ: 65643, ~: 65347) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 738.57ms (61.30ms CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt8Fuzz.t.sol:AbiInt8FuzzTest +[PASS] testEchoInt8Fuzz(int8) (runs: 256, μ: 55588, ~: 55231) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 3.01s (2.28s CPU time) + +Ran 1 test for test/generated/fuzz/AbiTripleBoolAddressU256Fuzz.t.sol:AbiTripleBoolAddressU256FuzzTest +[PASS] testEchoBoolAddressU256TripleFuzz(bool,address,uint256) (runs: 256, μ: 58968, ~: 58837) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 2.96s (2.34s CPU time) + +Ran 1 test for test/generated/bench/AbiStringU64PairArrayBench.t.sol:AbiStringU64PairArrayBenchTest +[PASS] testBenchEchoStringU64PairArray() (gas: 110761) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 641.11ms (438.15µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt256Array4Bench.t.sol:AbiInt256Array4BenchTest +[PASS] testBenchEchoInt256Array4() (gas: 86528) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 704.74ms (269.77µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiStringU64PairArray2Fuzz.t.sol:AbiStringU64PairArray2FuzzTest +[PASS] testEchoStringU64PairArray2Fuzz((string,uint64)[2]) (runs: 256, μ: 76417, ~: 76364) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.38s (692.14ms CPU time) + +Ran 1 test for test/generated/bench/AbiUint176Bench.t.sol:AbiUint176BenchTest +[PASS] testBenchEchoUint176() (gas: 62309) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 655.06ms (100.74µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt216Bench.t.sol:AbiInt216BenchTest +[PASS] testBenchEchoInt216() (gas: 63230) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 622.52ms (98.71µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt208Fuzz.t.sol:AbiInt208FuzzTest +[PASS] testEchoInt208Fuzz(int208) (runs: 256, μ: 55561, ~: 55288) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.33s (637.27ms CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint160Deterministic.t.sol:AbiUint160DeterministicTest +[PASS] testEchoUint160Deterministic0() (gas: 54916) +[PASS] testEchoUint160Deterministic1() (gas: 54985) +[PASS] testEchoUint160Deterministic2() (gas: 55419) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 607.93ms (180.25µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt96Bench.t.sol:AbiInt96BenchTest +[PASS] testBenchEchoInt96() (gas: 63162) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 623.87ms (101.60µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint248Deterministic.t.sol:AbiUint248DeterministicTest +[PASS] testEchoUint248Deterministic0() (gas: 54916) +[PASS] testEchoUint248Deterministic1() (gas: 54963) +[PASS] testEchoUint248Deterministic2() (gas: 55938) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 640.10ms (174.39µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt88Bench.t.sol:AbiInt88BenchTest +[PASS] testBenchEchoInt88() (gas: 63184) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 819.79ms (101.74µs CPU time) + +Ran 1 test for test/generated/bench/AbiUint104Bench.t.sol:AbiUint104BenchTest +[PASS] testBenchEchoUint104() (gas: 62393) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 669.05ms (95.03µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt80Fuzz.t.sol:AbiInt80FuzzTest +[PASS] testEchoInt80Fuzz(int80) (runs: 256, μ: 55544, ~: 55284) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.48s (834.88ms CPU time) + +Ran 1 test for test/generated/bench/AbiUint160Array4Bench.t.sol:AbiUint160Array4BenchTest +[PASS] testBenchEchoUint160Array4() (gas: 85716) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 675.36ms (270.31µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiStringU64PairArrayDeterministic.t.sol:AbiStringU64PairArrayDeterministicTest +[PASS] testEchoStringU64PairArrayDeterministic0() (gas: 56917) +[PASS] testEchoStringU64PairArrayDeterministic1() (gas: 68198) +[PASS] testEchoStringU64PairArrayDeterministic2() (gas: 71077) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 695.39ms (349.98µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiInt256Array4Deterministic.t.sol:AbiInt256Array4DeterministicTest +[PASS] testEchoInt256Array4Deterministic0() (gas: 61276) +[PASS] testEchoInt256Array4Deterministic1() (gas: 61298) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 722.91ms (165.44µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint176Deterministic.t.sol:AbiUint176DeterministicTest +[PASS] testEchoUint176Deterministic0() (gas: 54851) +[PASS] testEchoUint176Deterministic1() (gas: 54898) +[PASS] testEchoUint176Deterministic2() (gas: 55424) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 721.32ms (167.81µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt216Deterministic.t.sol:AbiInt216DeterministicTest +[PASS] testEchoInt216Deterministic0() (gas: 54956) +[PASS] testEchoInt216Deterministic1() (gas: 56022) +[PASS] testEchoInt216Deterministic2() (gas: 55057) +[PASS] testEchoInt216Deterministic3() (gas: 55678) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 764.52ms (228.87µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint248Fuzz.t.sol:AbiUint248FuzzTest +[PASS] testEchoUint248Fuzz(uint248) (runs: 256, μ: 55451, ~: 55265) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 650.97ms (17.25ms CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt96Deterministic.t.sol:AbiInt96DeterministicTest +[PASS] testEchoInt96Deterministic0() (gas: 54956) +[PASS] testEchoInt96Deterministic1() (gas: 55978) +[PASS] testEchoInt96Deterministic2() (gas: 55483) +[PASS] testEchoInt96Deterministic3() (gas: 55201) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 704.88ms (234.68µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiUint160Array4Deterministic.t.sol:AbiUint160Array4DeterministicTest +[PASS] testEchoUint160Array4Deterministic0() (gas: 59524) +[PASS] testEchoUint160Array4Deterministic1() (gas: 59523) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 645.91ms (179.08µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt88Deterministic.t.sol:AbiInt88DeterministicTest +[PASS] testEchoInt88Deterministic0() (gas: 54978) +[PASS] testEchoInt88Deterministic1() (gas: 55978) +[PASS] testEchoInt88Deterministic2() (gas: 55419) +[PASS] testEchoInt88Deterministic3() (gas: 55221) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 649.14ms (232.20µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint152Fuzz.t.sol:AbiUint152FuzzTest +[PASS] testEchoUint152Fuzz(uint152) (runs: 256, μ: 55295, ~: 55219) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 2.04s (1.34s CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint104Deterministic.t.sol:AbiUint104DeterministicTest +[PASS] testEchoUint104Deterministic0() (gas: 54983) +[PASS] testEchoUint104Deterministic1() (gas: 54986) +[PASS] testEchoUint104Deterministic2() (gas: 55252) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 679.17ms (167.63µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt256Array4Fuzz.t.sol:AbiInt256Array4FuzzTest +[PASS] testEchoInt256Array4Fuzz(int256[4]) (runs: 256, μ: 63859, ~: 64001) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 636.90ms (25.59ms CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint176Fuzz.t.sol:AbiUint176FuzzTest +[PASS] testEchoUint176Fuzz(uint176) (runs: 256, μ: 55288, ~: 55200) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 681.68ms (16.87ms CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint16Fuzz.t.sol:AbiUint16FuzzTest +[PASS] testEchoUint16Fuzz(uint16) (runs: 256, μ: 55182, ~: 55196) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 2.85s (2.07s CPU time) + +Ran 1 test for test/generated/bench/AbiUint168Bench.t.sol:AbiUint168BenchTest +[PASS] testBenchEchoUint168() (gas: 62456) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 711.33ms (90.54µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint160Fuzz.t.sol:AbiUint160FuzzTest +[PASS] testEchoUint160Fuzz(uint160) (runs: 256, μ: 55334, ~: 55241) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.55s (738.46ms CPU time) + +Ran 1 test for test/generated/bench/AbiUint24Array4Bench.t.sol:AbiUint24Array4BenchTest +[PASS] testBenchEchoUint24Array4() (gas: 85706) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 649.26ms (327.82µs CPU time) + +Ran 1 test for test/generated/bench/AbiUint200Bench.t.sol:AbiUint200BenchTest +[PASS] testBenchEchoUint200() (gas: 62351) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 655.59ms (95.87µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt256Bench.t.sol:AbiInt256BenchTest +[PASS] testBenchEchoInt256() (gas: 62919) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 646.58ms (101.76µs CPU time) + +Ran 1 test for test/generated/bench/AbiUint184Bench.t.sol:AbiUint184BenchTest +[PASS] testBenchEchoUint184() (gas: 62463) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 650.46ms (107.25µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt224Bench.t.sol:AbiInt224BenchTest +[PASS] testBenchEchoInt224() (gas: 63186) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 612.81ms (99.98µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt216Fuzz.t.sol:AbiInt216FuzzTest +[PASS] testEchoInt216Fuzz(int216) (runs: 256, μ: 55563, ~: 55311) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.42s (627.19ms CPU time) + +Ran 2 tests for test/generated/deterministic/AbiUint24Array4Deterministic.t.sol:AbiUint24Array4DeterministicTest +[PASS] testEchoUint24Array4Deterministic0() (gas: 59418) +[PASS] testEchoUint24Array4Deterministic1() (gas: 59487) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 625.90ms (186.30µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint168Deterministic.t.sol:AbiUint168DeterministicTest +[PASS] testEchoUint168Deterministic0() (gas: 54894) +[PASS] testEchoUint168Deterministic1() (gas: 54875) +[PASS] testEchoUint168Deterministic2() (gas: 55421) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 697.78ms (193.59µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt8Array4Bench.t.sol:AbiInt8Array4BenchTest +[PASS] testBenchEchoInt8Array4() (gas: 87770) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 612.24ms (275.99µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt88Fuzz.t.sol:AbiInt88FuzzTest +[PASS] testEchoInt88Fuzz(int88) (runs: 256, μ: 55552, ~: 55239) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.30s (626.24ms CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint200Deterministic.t.sol:AbiUint200DeterministicTest +[PASS] testEchoUint200Deterministic0() (gas: 54917) +[PASS] testEchoUint200Deterministic1() (gas: 54964) +[PASS] testEchoUint200Deterministic2() (gas: 55534) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 647.88ms (166.20µs CPU time) + +Ran 1 test for test/generated/bench/AbiUint112Bench.t.sol:AbiUint112BenchTest +[PASS] testBenchEchoUint112() (gas: 62346) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 765.82ms (98.01µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt256Deterministic.t.sol:AbiInt256DeterministicTest +[PASS] testEchoInt256Deterministic0() (gas: 54855) +[PASS] testEchoInt256Deterministic1() (gas: 55970) +[PASS] testEchoInt256Deterministic2() (gas: 54902) +[PASS] testEchoInt256Deterministic3() (gas: 55948) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 662.65ms (216.70µs CPU time) + +Ran 1 test for test/generated/bench/AbiPairBoolAddressArray4Bench.t.sol:AbiPairBoolAddressArray4BenchTest +[PASS] testBenchEchoBoolAddressPairArray4() (gas: 114161) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 681.13ms (489.69µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint184Deterministic.t.sol:AbiUint184DeterministicTest +[PASS] testEchoUint184Deterministic0() (gas: 54939) +[PASS] testEchoUint184Deterministic1() (gas: 54986) +[PASS] testEchoUint184Deterministic2() (gas: 55536) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 665.16ms (282.65µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt224Deterministic.t.sol:AbiInt224DeterministicTest +[PASS] testEchoInt224Deterministic0() (gas: 54956) +[PASS] testEchoInt224Deterministic1() (gas: 55978) +[PASS] testEchoInt224Deterministic2() (gas: 55033) +[PASS] testEchoInt224Deterministic3() (gas: 55782) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 684.27ms (237.89µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint24Array4Fuzz.t.sol:AbiUint24Array4FuzzTest +[PASS] testEchoUint24Array4Fuzz(uint24[4]) (runs: 256, μ: 60942, ~: 60950) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 688.35ms (52.45ms CPU time) + +Ran 2 tests for test/generated/deterministic/AbiInt8Array4Deterministic.t.sol:AbiInt8Array4DeterministicTest +[PASS] testEchoInt8Array4Deterministic0() (gas: 61455) +[PASS] testEchoInt8Array4Deterministic1() (gas: 61433) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 666.92ms (190.07µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint112Deterministic.t.sol:AbiUint112DeterministicTest +[PASS] testEchoUint112Deterministic0() (gas: 54938) +[PASS] testEchoUint112Deterministic1() (gas: 54941) +[PASS] testEchoUint112Deterministic2() (gas: 55231) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 625.23ms (183.94µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint104Fuzz.t.sol:AbiUint104FuzzTest +[PASS] testEchoUint104Fuzz(uint104) (runs: 256, μ: 55309, ~: 55240) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 2.06s (1.41s CPU time) + +Ran 2 tests for test/generated/deterministic/AbiPairBoolAddressArray4Deterministic.t.sol:AbiPairBoolAddressArray4DeterministicTest +[PASS] testEchoBoolAddressPairArray4Deterministic0() (gas: 67793) +[PASS] testEchoBoolAddressPairArray4Deterministic1() (gas: 67815) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 647.18ms (311.33µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt256Fuzz.t.sol:AbiInt256FuzzTest +[PASS] testEchoInt256Fuzz(int256) (runs: 256, μ: 55840, ~: 56194) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 691.42ms (16.90ms CPU time) + +Ran 1 test for test/generated/bench/AbiUint24Bench.t.sol:AbiUint24BenchTest +[PASS] testBenchEchoUint24() (gas: 62414) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 645.12ms (117.14µs CPU time) + +Ran 1 test for test/generated/bench/AbiUint208Bench.t.sol:AbiUint208BenchTest +[PASS] testBenchEchoUint208() (gas: 62438) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 625.20ms (87.85µs CPU time) + +Ran 1 test for test/generated/bench/AbiUint16Array4Bench.t.sol:AbiUint16Array4BenchTest +[PASS] testBenchEchoUint16Array4() (gas: 85596) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 753.25ms (269.71µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt256Matrix2x2Bench.t.sol:AbiInt256Matrix2x2BenchTest +[PASS] testBenchEchoInt256Matrix2x2() (gas: 101905) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 651.48ms (379.10µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint168Fuzz.t.sol:AbiUint168FuzzTest +[PASS] testEchoUint168Fuzz(uint168) (runs: 256, μ: 55307, ~: 55245) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.58s (767.27ms CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt248Fuzz.t.sol:AbiInt248FuzzTest +[PASS] testEchoInt248Fuzz(int248) (runs: 256, μ: 55668, ~: 55536) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 8.47s (7.85s CPU time) + +Ran 1 test for test/generated/fuzz/AbiPairBoolAddressArray4Fuzz.t.sol:AbiPairBoolAddressArray4FuzzTest +[PASS] testEchoBoolAddressPairArray4Fuzz((bool,address)[4]) (runs: 256, μ: 72617, ~: 73354) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 784.22ms (47.72ms CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt96Fuzz.t.sol:AbiInt96FuzzTest +[PASS] testEchoInt96Fuzz(int96) (runs: 256, μ: 55530, ~: 55263) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 2.97s (2.13s CPU time) + +Ran 1 test for test/generated/bench/AbiUint192Bench.t.sol:AbiUint192BenchTest +[PASS] testBenchEchoUint192() (gas: 62437) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 654.34ms (100.35µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt232Bench.t.sol:AbiInt232BenchTest +[PASS] testBenchEchoInt232() (gas: 63230) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 613.47ms (95.17µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt224Fuzz.t.sol:AbiInt224FuzzTest +[PASS] testEchoInt224Fuzz(int224) (runs: 256, μ: 55605, ~: 55371) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.24s (627.71ms CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint24Deterministic.t.sol:AbiUint24DeterministicTest +[PASS] testEchoUint24Deterministic0() (gas: 54938) +[PASS] testEchoUint24Deterministic1() (gas: 54941) +[PASS] testEchoUint24Deterministic2() (gas: 54967) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 632.96ms (204.53µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt8Bench.t.sol:AbiInt8BenchTest +[PASS] testBenchEchoInt8() (gas: 63260) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 616.81ms (114.32µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt8Array4Fuzz.t.sol:AbiInt8Array4FuzzTest +[PASS] testEchoInt8Array4Fuzz(int8[4]) (runs: 256, μ: 62444, ~: 62800) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.26s (643.89ms CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint208Deterministic.t.sol:AbiUint208DeterministicTest +[PASS] testEchoUint208Deterministic0() (gas: 54894) +[PASS] testEchoUint208Deterministic1() (gas: 54963) +[PASS] testEchoUint208Deterministic2() (gas: 55616) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 691.44ms (178.18µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint200Fuzz.t.sol:AbiUint200FuzzTest +[PASS] testEchoUint200Fuzz(uint200) (runs: 256, μ: 55339, ~: 55196) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.99s (1.33s CPU time) + +Ran 2 tests for test/generated/deterministic/AbiUint16Array4Deterministic.t.sol:AbiUint16Array4DeterministicTest +[PASS] testEchoUint16Array4Deterministic0() (gas: 59400) +[PASS] testEchoUint16Array4Deterministic1() (gas: 59403) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 668.79ms (203.94µs CPU time) + +Ran 1 test for test/generated/bench/AbiPairBoolAddressBench.t.sol:AbiPairBoolAddressBenchTest +[PASS] testBenchEchoBoolAddressPair() (gas: 70459) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 642.09ms (165.57µs CPU time) + +Ran 1 test for test/generated/bench/AbiUint120Bench.t.sol:AbiUint120BenchTest +[PASS] testBenchEchoUint120() (gas: 62418) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 750.48ms (100.51µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint112Fuzz.t.sol:AbiUint112FuzzTest +[PASS] testEchoUint112Fuzz(uint112) (runs: 256, μ: 55277, ~: 55219) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.61s (765.51ms CPU time) + +Ran 1 test for test/generated/bench/AbiInt24Array4Bench.t.sol:AbiInt24Array4BenchTest +[PASS] testBenchEchoInt24Array4() (gas: 88011) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 893.46ms (3.30ms CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt232Deterministic.t.sol:AbiInt232DeterministicTest +[PASS] testEchoInt232Deterministic0() (gas: 54912) +[PASS] testEchoInt232Deterministic1() (gas: 55978) +[PASS] testEchoInt232Deterministic2() (gas: 55031) +[PASS] testEchoInt232Deterministic3() (gas: 55776) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 655.64ms (231.44µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint192Deterministic.t.sol:AbiUint192DeterministicTest +[PASS] testEchoUint192Deterministic0() (gas: 54939) +[PASS] testEchoUint192Deterministic1() (gas: 55008) +[PASS] testEchoUint192Deterministic2() (gas: 55538) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 754.25ms (165.07µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint24Fuzz.t.sol:AbiUint24FuzzTest +[PASS] testEchoUint24Fuzz(uint24) (runs: 256, μ: 55191, ~: 55195) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 645.33ms (17.06ms CPU time) + +Ran 2 tests for test/generated/deterministic/AbiPairBoolAddressDeterministic.t.sol:AbiPairBoolAddressDeterministicTest +[PASS] testEchoBoolAddressPairDeterministic0() (gas: 56781) +[PASS] testEchoBoolAddressPairDeterministic1() (gas: 56849) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 655.27ms (158.46µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint120Deterministic.t.sol:AbiUint120DeterministicTest +[PASS] testEchoUint120Deterministic0() (gas: 54938) +[PASS] testEchoUint120Deterministic1() (gas: 54941) +[PASS] testEchoUint120Deterministic2() (gas: 55255) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 662.01ms (175.61µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint192Fuzz.t.sol:AbiUint192FuzzTest +[PASS] testEchoUint192Fuzz(uint192) (runs: 256, μ: 55395, ~: 55312) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 691.40ms (16.49ms CPU time) + +Ran 1 test for test/generated/bench/AbiUint24Matrix2x2Bench.t.sol:AbiUint24Matrix2x2BenchTest +[PASS] testBenchEchoUint24Matrix2x2() (gas: 101181) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 639.80ms (393.72µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint184Fuzz.t.sol:AbiUint184FuzzTest +[PASS] testEchoUint184Fuzz(uint184) (runs: 256, μ: 55389, ~: 55312) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 2.81s (2.12s CPU time) + +Ran 2 tests for test/generated/deterministic/AbiInt24Array4Deterministic.t.sol:AbiInt24Array4DeterministicTest +[PASS] testEchoInt24Array4Deterministic0() (gas: 61448) +[PASS] testEchoInt24Array4Deterministic1() (gas: 61470) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 787.85ms (186.07µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiBoolAddressPairArrayFuzz.t.sol:AbiBoolAddressPairArrayFuzzTest +[PASS] testEchoBoolAddressPairArrayFuzz((bool,address)[]) (runs: 256, μ: 68001, ~: 68223) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 14.23s (13.58s CPU time) + +Ran 1 test for test/generated/bench/AbiUint48Bench.t.sol:AbiUint48BenchTest +[PASS] testBenchEchoUint48() (gas: 62373) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 729.95ms (98.40µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint40Fuzz.t.sol:AbiUint40FuzzTest +[PASS] testEchoUint40Fuzz(uint40) (runs: 256, μ: 55206, ~: 55196) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.38s (745.94ms CPU time) + +Ran 1 test for test/generated/bench/AbiUint216Bench.t.sol:AbiUint216BenchTest +[PASS] testBenchEchoUint216() (gas: 62417) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 697.57ms (114.67µs CPU time) + +Ran 1 test for test/generated/bench/AbiUint16Bench.t.sol:AbiUint16BenchTest +[PASS] testBenchEchoUint16() (gas: 62481) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 628.48ms (269.65µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint16Array4Fuzz.t.sol:AbiUint16Array4FuzzTest +[PASS] testEchoUint16Array4Fuzz(uint16[4]) (runs: 256, μ: 60853, ~: 60864) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.28s (652.10ms CPU time) + +Ran 2 tests for test/generated/deterministic/AbiUint24Matrix2x2Deterministic.t.sol:AbiUint24Matrix2x2DeterministicTest +[PASS] testEchoUint24Matrix2x2Deterministic0() (gas: 62322) +[PASS] testEchoUint24Matrix2x2Deterministic1() (gas: 62325) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 629.37ms (232.94µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt240Bench.t.sol:AbiInt240BenchTest +[PASS] testBenchEchoInt240() (gas: 63119) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 608.43ms (144.14µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt232Fuzz.t.sol:AbiInt232FuzzTest +[PASS] testEchoInt232Fuzz(int232) (runs: 256, μ: 55557, ~: 55291) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.46s (623.12ms CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint216Deterministic.t.sol:AbiUint216DeterministicTest +[PASS] testEchoUint216Deterministic0() (gas: 54939) +[PASS] testEchoUint216Deterministic1() (gas: 54986) +[PASS] testEchoUint216Deterministic2() (gas: 55654) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 612.75ms (176.66µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint208Fuzz.t.sol:AbiUint208FuzzTest +[PASS] testEchoUint208Fuzz(uint208) (runs: 256, μ: 55391, ~: 55303) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.94s (1.32s CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint48Deterministic.t.sol:AbiUint48DeterministicTest +[PASS] testEchoUint48Deterministic0() (gas: 54939) +[PASS] testEchoUint48Deterministic1() (gas: 54942) +[PASS] testEchoUint48Deterministic2() (gas: 55106) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 640.51ms (174.36µs CPU time) + +Ran 1 test for test/generated/bench/AbiUint224Bench.t.sol:AbiUint224BenchTest +[PASS] testBenchEchoUint224() (gas: 62436) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 746.64ms (110.44µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiInt256Matrix2x2Deterministic.t.sol:AbiInt256Matrix2x2DeterministicTest +[PASS] testEchoInt256Matrix2x2Deterministic0() (gas: 63611) +[PASS] testEchoInt256Matrix2x2Deterministic1() (gas: 63633) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 927.90ms (3.25ms CPU time) + +Ran 1 test for test/generated/bench/AbiPairStringU64Bench.t.sol:AbiPairStringU64BenchTest +[PASS] testBenchEchoPair() (gas: 80231) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 641.69ms (212.33µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiInt40Matrix2x2Deterministic.t.sol:AbiInt40Matrix2x2DeterministicTest +[PASS] testEchoInt40Matrix2x2Deterministic0() (gas: 63796) +[PASS] testEchoInt40Matrix2x2Deterministic1() (gas: 63774) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 613.24ms (219.63µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt40Array4Fuzz.t.sol:AbiInt40Array4FuzzTest +[PASS] testEchoInt40Array4Fuzz(int40[4]) (runs: 256, μ: 62249, ~: 61761) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 652.69ms (27.22ms CPU time) + +Ran 1 test for test/generated/bench/AbiUint128Array4Bench.t.sol:AbiUint128Array4BenchTest +[PASS] testBenchEchoUint128Array4() (gas: 85934) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 687.36ms (270.10µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint120Fuzz.t.sol:AbiUint120FuzzTest +[PASS] testEchoUint120Fuzz(uint120) (runs: 256, μ: 55271, ~: 55219) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.39s (704.77ms CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt40Deterministic.t.sol:AbiInt40DeterministicTest +[PASS] testEchoInt40Deterministic0() (gas: 54950) +[PASS] testEchoInt40Deterministic1() (gas: 55978) +[PASS] testEchoInt40Deterministic2() (gas: 55716) +[PASS] testEchoInt40Deterministic3() (gas: 55093) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 639.55ms (251.51µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint224Deterministic.t.sol:AbiUint224DeterministicTest +[PASS] testEchoUint224Deterministic0() (gas: 54916) +[PASS] testEchoUint224Deterministic1() (gas: 54963) +[PASS] testEchoUint224Deterministic2() (gas: 55714) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 612.59ms (201.94µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt40Bench.t.sol:AbiInt40BenchTest +[PASS] testBenchEchoInt40() (gas: 63136) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 709.14ms (100.47µs CPU time) + +Ran 1 test for test/generated/bench/AbiUint256Array4Bench.t.sol:AbiUint256Array4BenchTest +[PASS] testBenchEchoUintArray4() (gas: 81884) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 610.77ms (237.02µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint24Matrix2x2Fuzz.t.sol:AbiUint24Matrix2x2FuzzTest +[PASS] testEchoUint24Matrix2x2Fuzz(uint24[2][2]) (runs: 256, μ: 64931, ~: 64942) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.26s (646.27ms CPU time) + +Ran 2 tests for test/generated/deterministic/AbiPairStringU64Deterministic.t.sol:AbiPairStringU64DeterministicTest +[PASS] testEchoPairDeterministic0() (gas: 59518) +[PASS] testEchoPairDeterministic1() (gas: 60490) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 666.23ms (183.05µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiPairBoolAddressFuzz.t.sol:AbiPairBoolAddressFuzzTest +[PASS] testEchoBoolAddressPairFuzz(bool,address) (runs: 256, μ: 57573, ~: 57723) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 2.01s (1.33s CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt40Matrix2x2Fuzz.t.sol:AbiInt40Matrix2x2FuzzTest +[PASS] testEchoInt40Matrix2x2Fuzz(int40[2][2]) (runs: 256, μ: 65835, ~: 65627) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 647.59ms (34.68ms CPU time) + +Ran 1 test for test/generated/bench/AbiStringBench.t.sol:AbiStringBenchTest +[PASS] testBenchEchoString() (gas: 72345) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 657.34ms (148.98µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiUint128Array4Deterministic.t.sol:AbiUint128Array4DeterministicTest +[PASS] testEchoUint128Array4Deterministic0() (gas: 59734) +[PASS] testEchoUint128Array4Deterministic1() (gas: 59781) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 643.14ms (188.25µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint56Deterministic.t.sol:AbiUint56DeterministicTest +[PASS] testEchoUint56Deterministic0() (gas: 54916) +[PASS] testEchoUint56Deterministic1() (gas: 54919) +[PASS] testEchoUint56Deterministic2() (gas: 55041) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 631.81ms (172.30µs CPU time) + +Ran 1 test for test/generated/bench/AbiUint32Array4Bench.t.sol:AbiUint32Array4BenchTest +[PASS] testBenchEchoUint32Array4() (gas: 85712) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 783.86ms (262.19µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiUint256Array4Deterministic.t.sol:AbiUint256Array4DeterministicTest +[PASS] testEchoUintArray4Deterministic0() (gas: 59954) +[PASS] testEchoUintArray4Deterministic1() (gas: 59975) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 799.61ms (181.51µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt48Bench.t.sol:AbiInt48BenchTest +[PASS] testBenchEchoInt48() (gas: 63166) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 638.30ms (96.63µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt32Array4Bench.t.sol:AbiInt32Array4BenchTest +[PASS] testBenchEchoInt32Array4() (gas: 88060) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 777.90ms (268.54µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiStringDeterministic.t.sol:AbiStringDeterministicTest +[PASS] testEchoStringDeterministic0() (gas: 56214) +[PASS] testEchoStringDeterministic1() (gas: 57039) +[PASS] testEchoStringDeterministic2() (gas: 60240) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 723.46ms (204.93µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint56Fuzz.t.sol:AbiUint56FuzzTest +[PASS] testEchoUint56Fuzz(uint56) (runs: 256, μ: 55196, ~: 55173) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 632.89ms (16.58ms CPU time) + +Ran 2 tests for test/generated/deterministic/AbiUint32Array4Deterministic.t.sol:AbiUint32Array4DeterministicTest +[PASS] testEchoUint32Array4Deterministic0() (gas: 59446) +[PASS] testEchoUint32Array4Deterministic1() (gas: 59493) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 639.89ms (184.69µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt40Matrix2x2Bench.t.sol:AbiInt40Matrix2x2BenchTest +[PASS] testBenchEchoInt40Matrix2x2() (gas: 103400) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 708.45ms (411.95µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt40Fuzz.t.sol:AbiInt40FuzzTest +[PASS] testEchoInt40Fuzz(int40) (runs: 256, μ: 55483, ~: 55209) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.46s (725.56ms CPU time) + +Ran 1 test for test/generated/bench/AbiUint8Array4Bench.t.sol:AbiUint8Array4BenchTest +[PASS] testBenchEchoUint8Array4() (gas: 85681) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 777.36ms (272.99µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint88Fuzz.t.sol:AbiUint88FuzzTest +[PASS] testEchoUint88Fuzz(uint88) (runs: 256, μ: 55192, ~: 55146) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.54s (791.63ms CPU time) + +Ran 1 test for test/generated/bench/AbiPairUint24Int40Array4Bench.t.sol:AbiPairUint24Int40Array4BenchTest +[PASS] testBenchEchoUint24Int40PairArray4() (gas: 113109) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 633.69ms (458.96µs CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt48Deterministic.t.sol:AbiInt48DeterministicTest +[PASS] testEchoInt48Deterministic0() (gas: 54934) +[PASS] testEchoInt48Deterministic1() (gas: 56022) +[PASS] testEchoInt48Deterministic2() (gas: 55678) +[PASS] testEchoInt48Deterministic3() (gas: 55123) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 693.28ms (436.70µs CPU time) + +Ran 1 test for test/generated/bench/AbiUint128Bench.t.sol:AbiUint128BenchTest +[PASS] testBenchEchoUint128() (gas: 62329) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 675.21ms (84.47µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiInt32Array4Deterministic.t.sol:AbiInt32Array4DeterministicTest +[PASS] testEchoInt32Array4Deterministic0() (gas: 61426) +[PASS] testEchoInt32Array4Deterministic1() (gas: 61448) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 656.71ms (175.97µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint128Array4Fuzz.t.sol:AbiUint128Array4FuzzTest +[PASS] testEchoUint128Array4Fuzz(uint128[4]) (runs: 256, μ: 61305, ~: 61280) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.32s (699.30ms CPU time) + +Ran 1 test for test/generated/bench/AbiUint64Array4Bench.t.sol:AbiUint64Array4BenchTest +[PASS] testBenchEchoUint64Array4() (gas: 85849) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 610.47ms (269.81µs CPU time) + +Ran 1 test for test/generated/bench/AbiUint64Bench.t.sol:AbiUint64BenchTest +[PASS] testBenchEchoUint64() (gas: 62308) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 645.03ms (87.13µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiTripleBoolAddressU256Array4Deterministic.t.sol:AbiTripleBoolAddressU256Array4DeterministicTest +[PASS] testEchoBoolAddressU256TripleArray4Deterministic0() (gas: 73121) +[PASS] testEchoBoolAddressU256TripleArray4Deterministic1() (gas: 73143) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 787.04ms (334.49µs CPU time) + +Ran 1 test for test/generated/bench/AbiUint256Bench.t.sol:AbiUint256BenchTest +[PASS] testBenchEchoUint() (gas: 61979) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 670.46ms (231.78µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiPairUint24Int40Array4Deterministic.t.sol:AbiPairUint24Int40Array4DeterministicTest +[PASS] testEchoUint24Int40PairArray4Deterministic0() (gas: 68710) +[PASS] testEchoUint24Int40PairArray4Deterministic1() (gas: 68688) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 633.23ms (296.49µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint256Array4Fuzz.t.sol:AbiUint256Array4FuzzTest +[PASS] testEchoUintArray4Fuzz(uint256[4]) (runs: 256, μ: 61995, ~: 61748) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.41s (696.81ms CPU time) + +Ran 2 tests for test/generated/deterministic/AbiUint8Array4Deterministic.t.sol:AbiUint8Array4DeterministicTest +[PASS] testEchoUint8Array4Deterministic0() (gas: 59419) +[PASS] testEchoUint8Array4Deterministic1() (gas: 59466) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 720.40ms (188.46µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiPairStringU64Fuzz.t.sol:AbiPairStringU64FuzzTest +[PASS] testEchoPairFuzz(string,uint64) (runs: 256, μ: 64502, ~: 64134) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 2.01s (1.30s CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt48Fuzz.t.sol:AbiInt48FuzzTest +[PASS] testEchoInt48Fuzz(int48) (runs: 256, μ: 55526, ~: 55237) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 661.84ms (35.32ms CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint128Deterministic.t.sol:AbiUint128DeterministicTest +[PASS] testEchoUint128Deterministic0() (gas: 54895) +[PASS] testEchoUint128Deterministic1() (gas: 54898) +[PASS] testEchoUint128Deterministic2() (gas: 55302) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 643.27ms (191.41µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt32Array4Fuzz.t.sol:AbiInt32Array4FuzzTest +[PASS] testEchoInt32Array4Fuzz(int32[4]) (runs: 256, μ: 63027, ~: 62957) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 680.80ms (26.84ms CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt256Matrix2x2Fuzz.t.sol:AbiInt256Matrix2x2FuzzTest +[PASS] testEchoInt256Matrix2x2Fuzz(int256[2][2]) (runs: 256, μ: 67129, ~: 67419) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 2.97s (2.15s CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint64Deterministic.t.sol:AbiUint64DeterministicTest +[PASS] testEchoUint64Deterministic0() (gas: 54896) +[PASS] testEchoUint64Deterministic1() (gas: 54899) +[PASS] testEchoUint64Deterministic2() (gas: 55045) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 694.57ms (190.61µs CPU time) + +Ran 1 test for test/generated/bench/AbiUint32Bench.t.sol:AbiUint32BenchTest +[PASS] testBenchEchoUint32() (gas: 62396) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 617.82ms (102.06µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiUint64Array4Deterministic.t.sol:AbiUint64Array4DeterministicTest +[PASS] testEchoUint64Array4Deterministic0() (gas: 59587) +[PASS] testEchoUint64Array4Deterministic1() (gas: 59634) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 915.55ms (188.37µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint256Deterministic.t.sol:AbiUint256DeterministicTest +[PASS] testEchoUintDeterministic0() (gas: 54523) +[PASS] testEchoUintDeterministic1() (gas: 54570) +[PASS] testEchoUintDeterministic2() (gas: 55992) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 620.79ms (195.45µs CPU time) + +Ran 1 test for test/generated/bench/AbiInt56Bench.t.sol:AbiInt56BenchTest +[PASS] testBenchEchoInt56() (gas: 63205) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 664.59ms (96.70µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint216Fuzz.t.sol:AbiUint216FuzzTest +[PASS] testEchoUint216Fuzz(uint216) (runs: 256, μ: 55389, ~: 55266) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 4.57s (3.93s CPU time) + +Ran 1 test for test/generated/bench/AbiInt32Bench.t.sol:AbiInt32BenchTest +[PASS] testBenchEchoInt32() (gas: 63295) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 651.38ms (95.40µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint64Fuzz.t.sol:AbiUint64FuzzTest +[PASS] testEchoUint64Fuzz(uint64) (runs: 256, μ: 55167, ~: 55131) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 636.28ms (16.71ms CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint32Deterministic.t.sol:AbiUint32DeterministicTest +[PASS] testEchoUint32Deterministic0() (gas: 54918) +[PASS] testEchoUint32Deterministic1() (gas: 54921) +[PASS] testEchoUint32Deterministic2() (gas: 55037) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 609.64ms (179.02µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint32Array4Fuzz.t.sol:AbiUint32Array4FuzzTest +[PASS] testEchoUint32Array4Fuzz(uint32[4]) (runs: 256, μ: 60941, ~: 60932) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.91s (1.25s CPU time) + +Ran 1 test for test/generated/bench/AbiTripleBoolAddressU256Bench.t.sol:AbiTripleBoolAddressU256BenchTest +[PASS] testBenchEchoBoolAddressU256Triple() (gas: 73444) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 700.26ms (199.62µs CPU time) + +Ran 1 test for test/generated/bench/AbiUint8Bench.t.sol:AbiUint8BenchTest +[PASS] testBenchEchoUint8() (gas: 62530) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 618.50ms (90.18µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint64Array4Fuzz.t.sol:AbiUint64Array4FuzzTest +[PASS] testEchoUint64Array4Fuzz(uint64[4]) (runs: 256, μ: 61114, ~: 61097) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 825.65ms (25.91ms CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint48Fuzz.t.sol:AbiUint48FuzzTest +[PASS] testEchoUint48Fuzz(uint48) (runs: 256, μ: 55213, ~: 55196) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 4.25s (3.63s CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint8Array4Fuzz.t.sol:AbiUint8Array4FuzzTest +[PASS] testEchoUint8Array4Fuzz(uint8[4]) (runs: 256, μ: 60866, ~: 60881) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.26s (642.30ms CPU time) + +Ran 1 test for test/generated/fuzz/AbiTripleBoolAddressU256Array4Fuzz.t.sol:AbiTripleBoolAddressU256Array4FuzzTest +[PASS] testEchoBoolAddressU256TripleArray4Fuzz((bool,address,uint256)[4]) (runs: 256, μ: 78211, ~: 79267) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.48s (799.36ms CPU time) + +Ran 1 test for test/generated/bench/AbiPairUint24Int40Bench.t.sol:AbiPairUint24Int40BenchTest +[PASS] testBenchEchoUint24Int40Pair() (gas: 70567) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 677.94ms (160.98µs CPU time) + +Ran 1 test for test/generated/bench/AbiUint72Bench.t.sol:AbiUint72BenchTest +[PASS] testBenchEchoUint72() (gas: 62501) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 631.80ms (105.61µs CPU time) + +Ran 1 test for test/generated/bench/AbiUint136Bench.t.sol:AbiUint136BenchTest +[PASS] testBenchEchoUint136() (gas: 62480) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 675.92ms (92.51µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint128Fuzz.t.sol:AbiUint128FuzzTest +[PASS] testEchoUint128Fuzz(uint128) (runs: 256, μ: 55249, ~: 55174) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.38s (691.97ms CPU time) + +Ran 4 tests for test/generated/deterministic/AbiInt32Deterministic.t.sol:AbiInt32DeterministicTest +[PASS] testEchoInt32Deterministic0() (gas: 54913) +[PASS] testEchoInt32Deterministic1() (gas: 56022) +[PASS] testEchoInt32Deterministic2() (gas: 55820) +[PASS] testEchoInt32Deterministic3() (gas: 55054) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 670.48ms (215.72µs CPU time) + +Ran 4 tests for test/BytesSuiteEquivalence.t.sol:BytesSuiteEquivalenceTest +[PASS] testEchoBytesDeterministicLong() (gas: 128140) +[PASS] testEchoBytesDeterministicShort() (gas: 123875) +[PASS] testEchoBytesDeterministicWordBoundaries() (gas: 340022) +[PASS] testEchoBytesFuzz(bytes) (runs: 256, μ: 134252, ~: 130063) +Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 67.43ms (58.48ms CPU time) + +Ran 1 test for test/generated/bench/AbiUint256Matrix2x2Bench.t.sol:AbiUint256Matrix2x2BenchTest +[PASS] testBenchEchoUintMatrix2x2() (gas: 97093) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 786.42ms (371.15µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint96Deterministic.t.sol:AbiUint96DeterministicTest +[PASS] testEchoUint96Deterministic0() (gas: 54916) +[PASS] testEchoUint96Deterministic1() (gas: 54919) +[PASS] testEchoUint96Deterministic2() (gas: 55227) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 614.72ms (173.21µs CPU time) + +Ran 1 test for test/generated/bench/AbiUint56Bench.t.sol:AbiUint56BenchTest +[PASS] testBenchEchoUint56() (gas: 62458) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 608.62ms (95.60µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint8Deterministic.t.sol:AbiUint8DeterministicTest +[PASS] testEchoUint8Deterministic0() (gas: 54984) +[PASS] testEchoUint8Deterministic1() (gas: 54965) +[PASS] testEchoUint8Deterministic2() (gas: 54987) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 615.41ms (183.41µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiPairUint24Int40Deterministic.t.sol:AbiPairUint24Int40DeterministicTest +[PASS] testEchoUint24Int40PairDeterministic0() (gas: 56737) +[PASS] testEchoUint24Int40PairDeterministic1() (gas: 57532) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 672.53ms (148.54µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiPairUint24Int40Array4Fuzz.t.sol:AbiPairUint24Int40Array4FuzzTest +[PASS] testEchoUint24Int40PairArray4Fuzz((uint24,int40)[4]) (runs: 256, μ: 71581, ~: 71146) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 2.05s (1.39s CPU time) + +Ran 2 tests for test/generated/deterministic/AbiUint256Matrix2x2Deterministic.t.sol:AbiUint256Matrix2x2DeterministicTest +[PASS] testEchoUintMatrix2x2Deterministic0() (gas: 62640) +[PASS] testEchoUintMatrix2x2Deterministic1() (gas: 62687) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 747.26ms (237.44µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint72Deterministic.t.sol:AbiUint72DeterministicTest +[PASS] testEchoUint72Deterministic0() (gas: 54917) +[PASS] testEchoUint72Deterministic1() (gas: 54986) +[PASS] testEchoUint72Deterministic2() (gas: 55156) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 779.10ms (184.70µs CPU time) + +Ran 1 test for test/generated/bench/AbiUint40Array4Bench.t.sol:AbiUint40Array4BenchTest +[PASS] testBenchEchoUint40Array4() (gas: 85709) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 747.07ms (266.41µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint96Fuzz.t.sol:AbiUint96FuzzTest +[PASS] testEchoUint96Fuzz(uint96) (runs: 256, μ: 55267, ~: 55243) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 640.02ms (16.18ms CPU time) + +Ran 1 test for test/generated/bench/AbiUint88Bench.t.sol:AbiUint88BenchTest +[PASS] testBenchEchoUint88() (gas: 62429) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 657.53ms (99.35µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint88Deterministic.t.sol:AbiUint88DeterministicTest +[PASS] testEchoUint88Deterministic0() (gas: 54889) +[PASS] testEchoUint88Deterministic1() (gas: 54870) +[PASS] testEchoUint88Deterministic2() (gas: 55132) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 614.78ms (176.71µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiUint40Array4Deterministic.t.sol:AbiUint40Array4DeterministicTest +[PASS] testEchoUint40Array4Deterministic0() (gas: 59423) +[PASS] testEchoUint40Array4Deterministic1() (gas: 59492) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 657.39ms (189.30µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint256Matrix2x2Fuzz.t.sol:AbiUint256Matrix2x2FuzzTest +[PASS] testEchoUintMatrix2x2Fuzz(uint256[2][2]) (runs: 256, μ: 65470, ~: 65426) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.46s (689.79ms CPU time) + +Ran 1 test for test/generated/bench/AbiUintArrayBench.t.sol:AbiUintArrayBenchTest +[PASS] testBenchEchoUintArray() (gas: 79950) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 596.28ms (234.93µs CPU time) + +Ran 1 test for test/generated/bench/AbiUint40Bench.t.sol:AbiUint40BenchTest +[PASS] testBenchEchoUint40() (gas: 62435) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 635.11ms (102.04µs CPU time) + +Ran 1 test for test/generated/bench/AbiUint96Array4Bench.t.sol:AbiUint96Array4BenchTest +[PASS] testBenchEchoUint96Array4() (gas: 85984) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 597.50ms (262.61µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint8Fuzz.t.sol:AbiUint8FuzzTest +[PASS] testEchoUint8Fuzz(uint8) (runs: 256, μ: 55213, ~: 55217) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.28s (612.36ms CPU time) + +Ran 1 test for test/generated/bench/AbiTripleBoolAddressU256Array4Bench.t.sol:AbiTripleBoolAddressU256Array4BenchTest +[PASS] testBenchEchoBoolAddressU256TripleArray4() (gas: 126703) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 619.45ms (572.49µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint80Fuzz.t.sol:AbiUint80FuzzTest +[PASS] testEchoUint80Fuzz(uint80) (runs: 256, μ: 55221, ~: 55173) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.26s (634.58ms CPU time) + +Ran 1 test for test/generated/bench/AbiUint80Bench.t.sol:AbiUint80BenchTest +[PASS] testBenchEchoUint80() (gas: 62370) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.07s (93.36µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiUintArrayDeterministic.t.sol:AbiUintArrayDeterministicTest +[PASS] testEchoUintArrayDeterministic0() (gas: 56286) +[PASS] testEchoUintArrayDeterministic1() (gas: 60502) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 602.62ms (352.16µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiUint96Array4Deterministic.t.sol:AbiUint96Array4DeterministicTest +[PASS] testEchoUint96Array4Deterministic0() (gas: 59700) +[PASS] testEchoUint96Array4Deterministic1() (gas: 59703) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 688.00ms (185.97µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint40Deterministic.t.sol:AbiUint40DeterministicTest +[PASS] testEchoUint40Deterministic0() (gas: 54895) +[PASS] testEchoUint40Deterministic1() (gas: 54942) +[PASS] testEchoUint40Deterministic2() (gas: 55060) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 679.73ms (177.70µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint72Fuzz.t.sol:AbiUint72FuzzTest +[PASS] testEchoUint72Fuzz(uint72) (runs: 256, μ: 55270, ~: 55242) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.93s (1.33s CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint40Array4Fuzz.t.sol:AbiUint40Array4FuzzTest +[PASS] testEchoUint40Array4Fuzz(uint40[4]) (runs: 256, μ: 60957, ~: 60931) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 2.01s (1.18s CPU time) + +Ran 3 tests for test/generated/deterministic/AbiUint80Deterministic.t.sol:AbiUint80DeterministicTest +[PASS] testEchoUint80Deterministic0() (gas: 54872) +[PASS] testEchoUint80Deterministic1() (gas: 54941) +[PASS] testEchoUint80Deterministic2() (gas: 55135) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 743.26ms (185.15µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint32Fuzz.t.sol:AbiUint32FuzzTest +[PASS] testEchoUint32Fuzz(uint32) (runs: 256, μ: 55194, ~: 55197) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 3.25s (2.58s CPU time) + +Ran 1 test for test/generated/bench/AbiUint96Bench.t.sol:AbiUint96BenchTest +[PASS] testBenchEchoUint96() (gas: 62460) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 676.45ms (98.64µs CPU time) + +Ran 8 tests for test/FixedArrayCeilingSuiteEquivalence.t.sol:FixedArrayCeilingSuiteEquivalenceTest +[PASS] testEchoBoolArray17Deterministic() (gas: 214153) +[PASS] testEchoBoolArray17Fuzz(bool[17]) (runs: 256, μ: 213087, ~: 213120) +[PASS] testEchoBytesArray17Deterministic() (gas: 346403) +[PASS] testEchoBytesArray17Fuzz(bytes[17]) (runs: 256, μ: 540251, ~: 555967) +[PASS] testEchoStringArray17Deterministic() (gas: 361757) +[PASS] testEchoStringArray17Fuzz(string[17]) (runs: 256, μ: 516187, ~: 515856) +[PASS] testEchoUintArray32Deterministic() (gas: 266943) +[PASS] testEchoUintArray32Fuzz(uint256[32]) (runs: 256, μ: 286131, ~: 296046) +Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 1.66s (2.10s CPU time) + +Ran 11 tests for test/NestedTupleSuiteEquivalence.t.sol:NestedTupleSuiteEquivalenceTest +[PASS] testEchoNestedDynamicBothDeterministic() (gas: 165545) +[PASS] testEchoNestedDynamicBothFuzz(string,uint64,bytes,bool) (runs: 256, μ: 81336, ~: 79171) +[PASS] testEchoNestedDynamicDeterministic() (gas: 147104) +[PASS] testEchoNestedDynamicFuzz(string,uint64,bool) (runs: 256, μ: 66962, ~: 67139) +[PASS] testEchoNestedStaticArrayDeterministic() (gas: 204902) +[PASS] testEchoNestedStaticDeterministic() (gas: 132358) +[PASS] testEchoNestedStaticDynArrayDeterministic() (gas: 185069) +[PASS] testEchoNestedStaticDynArrayFuzz(((bool,address),uint256)[]) (runs: 256, μ: 242557, ~: 248182) +[PASS] testEchoNestedStaticFlippedDeterministic() (gas: 133584) +[PASS] testEchoNestedStaticFlippedFuzz(bool,address,uint256) (runs: 256, μ: 59298, ~: 59397) +[PASS] testEchoNestedStaticFuzz(bool,address,uint256) (runs: 256, μ: 59463, ~: 59377) +Suite result: ok. 11 passed; 0 failed; 0 skipped; finished in 599.04ms (610.95ms CPU time) + +Ran 26 tests for test/FixedArraySuiteEquivalence.t.sol:FixedArraySuiteEquivalenceTest +[PASS] testEchoBoolAddressPairArray8Deterministic() (gas: 233064) +[PASS] testEchoBoolAddressPairArray8Fuzz((bool,address)[8]) (runs: 256, μ: 243068, ~: 246817) +[PASS] testEchoBoolArray17Deterministic() (gas: 214400) +[PASS] testEchoBoolArray17Fuzz(bool[17]) (runs: 256, μ: 213328, ~: 213367) +[PASS] testEchoBoolArray5Deterministic() (gas: 146075) +[PASS] testEchoBoolArray5Fuzz(bool[5]) (runs: 256, μ: 147676, ~: 147711) +[PASS] testEchoBytesArray17Deterministic() (gas: 346662) +[PASS] testEchoBytesArray17Fuzz(bytes[17]) (runs: 256, μ: 539349, ~: 553150) +[PASS] testEchoBytesArray5Deterministic() (gas: 192564) +[PASS] testEchoBytesArray5Fuzz(bytes[5]) (runs: 256, μ: 245025, ~: 241962) +[PASS] testEchoBytesU64PairArray5Deterministic() (gas: 236101) +[PASS] testEchoBytesU64PairArray5Fuzz((bytes,uint64)[5]) (runs: 256, μ: 291641, ~: 288266) +[PASS] testEchoNestedUintArray2x5Deterministic() (gas: 179473) +[PASS] testEchoNestedUintArray2x5Fuzz(uint256[5][2]) (runs: 256, μ: 188652, ~: 189983) +[PASS] testEchoStringArray17Deterministic() (gas: 362046) +[PASS] testEchoStringArray17Fuzz(string[17]) (runs: 256, μ: 519574, ~: 518875) +[PASS] testEchoStringArray5Deterministic() (gas: 209704) +[PASS] testEchoStringArray5Fuzz(string[5]) (runs: 256, μ: 239084, ~: 237668) +[PASS] testEchoStringU64PairArray5Deterministic() (gas: 255233) +[PASS] testEchoStringU64PairArray5Fuzz((string,uint64)[5]) (runs: 256, μ: 287055, ~: 286654) +[PASS] testEchoUintArray16Deterministic() (gas: 190670) +[PASS] testEchoUintArray16Fuzz(uint256[16]) (runs: 256, μ: 204530, ~: 208009) +[PASS] testEchoUintArray32Deterministic() (gas: 269170) +[PASS] testEchoUintArray32Fuzz(uint256[32]) (runs: 256, μ: 288438, ~: 298636) +[PASS] testEchoUintArray8Deterministic() (gas: 156052) +[PASS] testEchoUintArray8Fuzz(uint256[8]) (runs: 256, μ: 161919, ~: 162618) +Suite result: ok. 26 passed; 0 failed; 0 skipped; finished in 2.48s (4.32s CPU time) + +Ran 1 test for test/generated/fuzz/AbiInt32Fuzz.t.sol:AbiInt32FuzzTest +[PASS] testEchoInt32Fuzz(int32) (runs: 256, μ: 55679, ~: 55286) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 3.87s (3.22s CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint96Array4Fuzz.t.sol:AbiUint96Array4FuzzTest +[PASS] testEchoUint96Array4Fuzz(uint96[4]) (runs: 256, μ: 61230, ~: 61224) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.66s (990.68ms CPU time) + +Ran 1 test for test/generated/bench/AbiInt40Array4Bench.t.sol:AbiInt40Array4BenchTest +[PASS] testBenchEchoInt40Array4() (gas: 87987) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 436.95ms (193.74µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiInt40Array4Deterministic.t.sol:AbiInt40Array4DeterministicTest +[PASS] testEchoInt40Array4Deterministic0() (gas: 61470) +[PASS] testEchoInt40Array4Deterministic1() (gas: 61448) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 423.22ms (372.87µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiUintArrayFuzz.t.sol:AbiUintArrayFuzzTest +[PASS] testEchoUintArrayFuzz(uint256[]) (runs: 256, μ: 63031, ~: 62753) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 3.44s (2.78s CPU time) + +Ran 8 tests for test/DynArraySuiteEquivalence.t.sol:DynArraySuiteEquivalenceTest +[PASS] testEchoBoolAddressPairArrayDeterministic() (gas: 150859) +[PASS] testEchoBoolAddressPairArrayFuzz((bool,address)[]) (runs: 256, μ: 283241, ~: 281216) +[PASS] testEchoStringArrayDeterministic() (gas: 173149) +[PASS] testEchoStringArrayFuzz(string[]) (runs: 256, μ: 312223, ~: 317344) +[PASS] testEchoStringU64PairArrayDeterministic() (gas: 175868) +[PASS] testEchoStringU64PairArrayFuzz((string,uint64)[]) (runs: 256, μ: 426456, ~: 424756) +[PASS] testEchoUintArrayDeterministic() (gas: 138079) +[PASS] testEchoUintArrayFuzz(uint256[]) (runs: 256, μ: 174030, ~: 175992) +Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 9.07s (3.40s CPU time) + +Ran 1 test for test/generated/fuzz/AbiStringArrayFuzz.t.sol:AbiStringArrayFuzzTest +[PASS] testEchoStringArrayFuzz(string[]) (runs: 256, μ: 72879, ~: 72585) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 30.09s (29.46s CPU time) + +Ran 1 test for test/generated/fuzz/AbiPairUint24Int40Fuzz.t.sol:AbiPairUint24Int40FuzzTest +[PASS] testEchoUint24Int40PairFuzz(uint24,int40) (runs: 256, μ: 57497, ~: 57255) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 32.09s (31.47s CPU time) + +Ran 7 tests for test/AbiRoundtripEquivalence.t.sol:AbiRoundtripEquivalenceTest +[PASS] testBenchEchoPair() (gas: 77191) +[PASS] testBenchEchoString() (gas: 68022) +[PASS] testBenchEchoUint() (gas: 62024) +[PASS] testEchoPairEquivalence() (gas: 59584) +[PASS] testEchoStringBoundaryEquivalence() (gas: 57758) +[PASS] testEchoStringEquivalence() (gas: 57049) +[PASS] testEchoUintEquivalence() (gas: 54815) +Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 433.91ms (1.47ms CPU time) + +Ran 1 test for test/generated/bench/AbiStringArray2Bench.t.sol:AbiStringArray2BenchTest +[PASS] testBenchEchoStringArray2() (gas: 97107) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 434.13ms (229.32µs CPU time) + +Ran 2 tests for test/generated/deterministic/AbiStringArray2Deterministic.t.sol:AbiStringArray2DeterministicTest +[PASS] testEchoStringArray2Deterministic0() (gas: 62447) +[PASS] testEchoStringArray2Deterministic1() (gas: 65742) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 435.17ms (292.41µs CPU time) + +Ran 1 test for test/generated/fuzz/AbiStringArray2Fuzz.t.sol:AbiStringArray2FuzzTest +[PASS] testEchoStringArray2Fuzz(string[2]) (runs: 256, μ: 70978, ~: 70930) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 453.04ms (28.63ms CPU time) + +Ran 1 test for test/generated/fuzz/AbiStringU64PairArrayFuzz.t.sol:AbiStringU64PairArrayFuzzTest +[PASS] testEchoStringU64PairArrayFuzz((string,uint64)[]) (runs: 256, μ: 78499, ~: 77912) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 29.95s (29.29s CPU time) + +Ran 18 tests for test/DeepDynamicSuiteEquivalence.t.sol:DeepDynamicSuiteEquivalenceTest +[PASS] testEchoBytesArrayDeterministic() (gas: 165431) +[PASS] testEchoBytesArrayFuzz(bytes[]) (runs: 256, μ: 297671, ~: 294006) +[PASS] testEchoBytesU64PairArrayDeterministic() (gas: 169457) +[PASS] testEchoBytesU64PairArrayFuzz((bytes,uint64)[]) (runs: 256, μ: 379297, ~: 367772) +[PASS] testEchoBytesU64PairDeterministic() (gas: 134987) +[PASS] testEchoBytesU64PairFuzz(bytes,uint64) (runs: 256, μ: 144908, ~: 140948) +[PASS] testEchoNestedBytesArrayDeterministic() (gas: 216899) +[PASS] testEchoNestedBytesArrayFuzz(bytes[][]) (runs: 256, μ: 24613764, ~: 23234986) +[PASS] testEchoNestedBytesU64PairArrayDeterministic() (gas: 250294) +[PASS] testEchoNestedBytesU64PairArrayFuzz((bytes,uint64)[][]) (runs: 256, μ: 41369953, ~: 32710273) +[PASS] testEchoNestedStringArrayDeterministic() (gas: 210455) +[PASS] testEchoNestedStringArrayFuzz(string[][]) (runs: 256, μ: 23977034, ~: 22676985) +[PASS] testEchoNestedStringU64PairArrayDeterministic() (gas: 225122) +[PASS] testEchoNestedStringU64PairArrayFuzz((string,uint64)[][]) (runs: 256, μ: 43916652, ~: 37653037) +[PASS] testEchoNestedUintArrayDeterministic() (gas: 175946) +[PASS] testEchoNestedUintArrayFuzz(uint256[][]) (runs: 256, μ: 6846400, ~: 6604402) +[PASS] testEchoUint24ArrayDeterministic() (gas: 139637) +[PASS] testEchoUint24ArrayFuzz(uint24[]) (runs: 256, μ: 90391, ~: 89985) +Suite result: ok. 18 passed; 0 failed; 0 skipped; finished in 77.26s (231.96s CPU time) + +Ran 1 test for test/generated/fuzz/AbiUint256Fuzz.t.sol:AbiUint256FuzzTest +[PASS] testEchoUintFuzz(uint256) (runs: 256, μ: 55124, ~: 54842) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 78.21s (77.58s CPU time) + +Ran 1 test for test/generated/fuzz/AbiAddressArray4Fuzz.t.sol:AbiAddressArray4FuzzTest +[PASS] testEchoAddressArray4Fuzz(address[4]) (runs: 256, μ: 63149, ~: 63899) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 96.20s (95.59s CPU time) + +Ran 1 test for test/generated/bench/AbiAddressBench.t.sol:AbiAddressBenchTest +[PASS] testBenchEchoAddress() (gas: 63071) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 410.54ms (161.34µs CPU time) + +Ran 3 tests for test/generated/deterministic/AbiAddressDeterministic.t.sol:AbiAddressDeterministicTest +[PASS] testEchoAddressDeterministic0() (gas: 55043) +[PASS] testEchoAddressDeterministic1() (gas: 55048) +[PASS] testEchoAddressDeterministic2() (gas: 55502) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 408.35ms (295.54µs CPU time) + +╭--------------------------------------------------+-----------------+-------+--------+-------+---------╮ +| src/AbiRoundtripSol.sol:AbiRoundtripSol Contract | | | | | | ++=======================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| 7996789 | 36751 | | | | | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoAddress | 21970 | 22123 | 22210 | 22210 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoAddressArray4 | 23970 | 24555 | 24834 | 24846 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoAddressMatrix2x2 | 25404 | 25999 | 26280 | 26280 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoBool | 21930 | 21935 | 21930 | 21942 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoBoolAddressPair | 23091 | 23251 | 23331 | 23343 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoBoolAddressPairArray | 22474 | 27841 | 29199 | 30087 | 515 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoBoolAddressPairArray4 | 29209 | 29788 | 30097 | 30145 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoBoolAddressU256Triple | 23495 | 23795 | 23789 | 24131 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoBoolAddressU256TripleArray4 | 30998 | 31941 | 32276 | 33158 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoBoolArray4 | 23694 | 23717 | 23718 | 23742 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoBoolMatrix2x2 | 25192 | 25215 | 25216 | 25240 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt104 | 21915 | 22076 | 21963 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt112 | 21934 | 22114 | 21982 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt120 | 21912 | 22089 | 21960 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt128 | 21892 | 22211 | 22440 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt128Array4 | 23821 | 24856 | 24565 | 26280 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt136 | 21893 | 22093 | 21953 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt144 | 21957 | 22110 | 22005 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt152 | 21958 | 22127 | 22006 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt16 | 21915 | 22188 | 22425 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt160 | 21956 | 22142 | 22046 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt160Array4 | 23841 | 24554 | 24483 | 26280 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt168 | 21901 | 22111 | 22009 | 22410 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt16Array4 | 23746 | 24646 | 24544 | 26280 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt176 | 21914 | 22105 | 21992 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt184 | 21935 | 22130 | 22031 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt192 | 21935 | 22140 | 22043 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt200 | 21913 | 22132 | 22033 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt208 | 21891 | 22105 | 21969 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt216 | 21913 | 22113 | 21985 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt224 | 21913 | 22134 | 22015 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt232 | 21891 | 22111 | 21975 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt24 | 21893 | 22049 | 21917 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt240 | 21893 | 22116 | 21977 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt248 | 21936 | 22173 | 22110 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt248Array4 | 23810 | 24647 | 24500 | 26280 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt24Array4 | 23772 | 24337 | 24204 | 26280 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt256 | 21919 | 22276 | 22440 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt256Array4 | 23768 | 25033 | 25050 | 26280 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt256Matrix2x2 | 25243 | 26180 | 26275 | 26683 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt32 | 21937 | 22178 | 21985 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt32Array4 | 23774 | 24653 | 24542 | 26280 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt40 | 21935 | 22091 | 21959 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt40Array4 | 23772 | 24345 | 24204 | 26280 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt40Matrix2x2 | 25206 | 25626 | 25578 | 26670 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt48 | 21937 | 22104 | 21961 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt56 | 21890 | 22076 | 21926 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt64 | 21934 | 22174 | 22018 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt64Array4 | 23832 | 24693 | 24564 | 26280 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt72 | 21935 | 22103 | 21971 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt8 | 21954 | 22140 | 21966 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt80 | 21935 | 22112 | 21983 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt88 | 21912 | 22107 | 21954 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt8Array4 | 23745 | 24463 | 24513 | 26280 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt96 | 21913 | 22096 | 21961 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoInt96Array4 | 23852 | 24539 | 24428 | 26280 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoPair | 24033 | 24668 | 24569 | 25740 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoString | 22505 | 23397 | 23140 | 25010 | 261 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoStringArray | 22852 | 29258 | 30721 | 34740 | 516 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoStringArray2 | 25953 | 26935 | 26929 | 28380 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoStringBoolU64Triple | 24534 | 25165 | 25082 | 26450 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoStringU64PairArray | 22918 | 32483 | 35013 | 38050 | 516 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoStringU64PairArray2 | 28313 | 29268 | 29266 | 30422 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint | 21876 | 22007 | 21912 | 22440 | 260 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint104 | 21953 | 22011 | 21977 | 22109 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint112 | 21909 | 21974 | 21945 | 22077 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint120 | 21910 | 21972 | 21946 | 22090 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint128 | 21887 | 21948 | 21911 | 22079 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint128Array4 | 23732 | 23965 | 23960 | 24392 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint136 | 21955 | 22036 | 22003 | 22159 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint144 | 21911 | 21995 | 21959 | 22127 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint152 | 21909 | 21983 | 21945 | 22137 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint16 | 21910 | 21927 | 21934 | 21934 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint160 | 21932 | 22014 | 21968 | 22172 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint160Array4 | 23747 | 24000 | 23987 | 24455 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint168 | 21887 | 21978 | 21947 | 22139 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint16Array4 | 23719 | 23761 | 23767 | 23791 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint176 | 21887 | 21979 | 21935 | 22151 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint184 | 21954 | 22052 | 22014 | 22230 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint192 | 21953 | 22054 | 22013 | 22241 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint200 | 21910 | 22005 | 21934 | 22230 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint208 | 21908 | 22030 | 21980 | 22260 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint216 | 21933 | 22042 | 21981 | 22290 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint224 | 21910 | 22023 | 21934 | 22320 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint232 | 21932 | 22064 | 22004 | 22350 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint24 | 21907 | 21929 | 21931 | 21943 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint240 | 21909 | 22032 | 21945 | 22380 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint248 | 21931 | 22070 | 21979 | 22410 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint248Array4 | 23779 | 24240 | 24199 | 25710 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint24Array4 | 23741 | 23809 | 23813 | 23849 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint24Int40Pair | 23080 | 23232 | 23128 | 23500 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint24Int40PairArray4 | 28923 | 29388 | 29319 | 30471 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint24Matrix2x2 | 25197 | 25263 | 25269 | 25317 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint32 | 21908 | 21930 | 21932 | 21956 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint32Array4 | 23743 | 23795 | 23791 | 23887 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint40 | 21908 | 21937 | 21932 | 21968 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint40Array4 | 23731 | 23815 | 23803 | 23911 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint48 | 21932 | 21964 | 21956 | 22004 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint56 | 21886 | 21921 | 21910 | 21970 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint64 | 21888 | 21930 | 21912 | 21984 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint64Array4 | 23773 | 23901 | 23893 | 24097 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint72 | 21931 | 21981 | 21967 | 22039 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint8 | 21953 | 21963 | 21965 | 21965 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint80 | 21888 | 21936 | 21912 | 22008 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint88 | 21888 | 21935 | 21912 | 22020 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint8Array4 | 23741 | 23781 | 23789 | 23789 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint96 | 21911 | 21970 | 21959 | 22055 | 259 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint96Array4 | 23811 | 23963 | 23955 | 24255 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUintArray | 22521 | 24230 | 24209 | 26740 | 515 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUintArray4 | 23721 | 24264 | 24177 | 26130 | 258 | +|--------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUintMatrix2x2 | 25153 | 25573 | 25609 | 26533 | 258 | +╰--------------------------------------------------+-----------------+-------+--------+-------+---------╯ + +╭------------------------------------------------+-----------------+-------+--------+-------+---------╮ +| src/AbiRoundtripSol.sol:FeBenchCaller Contract | | | | | | ++=====================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| 17156590 | 80516 | | | | | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoAddress | 26020 | 26020 | 26020 | 26020 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoAddressArray4 | 32648 | 32648 | 32648 | 32648 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoAddressMatrix2x2 | 36340 | 36340 | 36340 | 36340 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBool | 25796 | 25796 | 25796 | 25796 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBoolAddressPair | 27660 | 27660 | 27660 | 27660 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBoolAddressPairArray | 27037 | 39312 | 39747 | 39831 | 258 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBoolAddressPairArray4 | 38978 | 38978 | 38978 | 38978 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBoolAddressU256Triple | 28534 | 28534 | 28534 | 28534 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBoolAddressU256TripleArray4 | 42770 | 42770 | 42770 | 42770 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBoolArray4 | 31642 | 31642 | 31642 | 31642 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBoolMatrix2x2 | 35338 | 35338 | 35338 | 35338 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt104 | 26206 | 26206 | 26206 | 26206 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt112 | 26187 | 26187 | 26187 | 26187 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt120 | 26209 | 26209 | 26209 | 26209 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt128 | 26167 | 26167 | 26167 | 26167 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt128Array4 | 32592 | 32592 | 32592 | 32592 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt136 | 26144 | 26144 | 26144 | 26144 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt144 | 26186 | 26186 | 26186 | 26186 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt152 | 26163 | 26163 | 26163 | 26163 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt16 | 26205 | 26205 | 26205 | 26205 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt160 | 26165 | 26165 | 26165 | 26165 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt160Array4 | 32530 | 32530 | 32530 | 32530 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt168 | 26185 | 26185 | 26185 | 26185 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt16Array4 | 32758 | 32758 | 32758 | 32758 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt176 | 26206 | 26206 | 26206 | 26206 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt184 | 26163 | 26163 | 26163 | 26163 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt192 | 26186 | 26186 | 26186 | 26186 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt200 | 26184 | 26184 | 26184 | 26184 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt208 | 26163 | 26163 | 26163 | 26163 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt216 | 26209 | 26209 | 26209 | 26209 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt224 | 26187 | 26187 | 26187 | 26187 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt232 | 26209 | 26209 | 26209 | 26209 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt24 | 26186 | 26186 | 26186 | 26186 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt240 | 26162 | 26162 | 26162 | 26162 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt248 | 26207 | 26207 | 26207 | 26207 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt248Array4 | 32451 | 32451 | 32451 | 32451 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt24Array4 | 32741 | 32741 | 32741 | 32741 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt256 | 26033 | 26033 | 26033 | 26033 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt256Array4 | 32086 | 32086 | 32086 | 32086 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt256Matrix2x2 | 35684 | 35684 | 35684 | 35684 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt32 | 26229 | 26229 | 26229 | 26229 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt32Array4 | 32778 | 32778 | 32778 | 32778 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt40 | 26137 | 26137 | 26137 | 26137 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt40Array4 | 32740 | 32740 | 32740 | 32740 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt40Matrix2x2 | 36397 | 36397 | 36397 | 36397 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt48 | 26164 | 26164 | 26164 | 26164 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt56 | 26208 | 26208 | 26208 | 26208 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt64 | 26164 | 26164 | 26164 | 26164 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt64Array4 | 32731 | 32731 | 32731 | 32731 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt72 | 26189 | 26189 | 26189 | 26189 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt8 | 26208 | 26208 | 26208 | 26208 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt80 | 26184 | 26184 | 26184 | 26184 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt88 | 26187 | 26187 | 26187 | 26187 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt8Array4 | 32491 | 32491 | 32491 | 32491 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt96 | 26186 | 26186 | 26186 | 26186 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt96Array4 | 32636 | 32636 | 32636 | 32636 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoPair | 29653 | 29653 | 29653 | 29653 | 2 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoString | 27657 | 27961 | 27961 | 28265 | 2 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoStringArray | 27108 | 39587 | 39711 | 41594 | 258 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoStringArray2 | 33936 | 33936 | 33936 | 33936 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoStringBoolU64Triple | 30476 | 30476 | 30476 | 30476 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoStringU64PairArray | 27157 | 46127 | 46475 | 48161 | 258 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoStringU64PairArray2 | 37642 | 37642 | 37642 | 37642 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint | 25462 | 25462 | 25462 | 25462 | 2 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint104 | 25773 | 25773 | 25773 | 25773 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint112 | 25771 | 25771 | 25771 | 25771 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint120 | 25817 | 25817 | 25817 | 25817 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint128 | 25774 | 25774 | 25774 | 25774 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint128Array4 | 31759 | 31759 | 31759 | 31759 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint136 | 25814 | 25814 | 25814 | 25814 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint144 | 25793 | 25793 | 25793 | 25793 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint152 | 25817 | 25817 | 25817 | 25817 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint16 | 25838 | 25838 | 25838 | 25838 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint160 | 25771 | 25771 | 25771 | 25771 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint160Array4 | 31496 | 31496 | 31496 | 31496 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint168 | 25837 | 25837 | 25837 | 25837 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint16Array4 | 31570 | 31570 | 31570 | 31570 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint176 | 25753 | 25753 | 25753 | 25753 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint184 | 25818 | 25818 | 25818 | 25818 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint192 | 25795 | 25795 | 25795 | 25795 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint200 | 25773 | 25773 | 25773 | 25773 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint208 | 25818 | 25818 | 25818 | 25818 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint216 | 25794 | 25794 | 25794 | 25794 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint224 | 25815 | 25815 | 25815 | 25815 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint232 | 25794 | 25794 | 25794 | 25794 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint24 | 25818 | 25818 | 25818 | 25818 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint240 | 25840 | 25840 | 25840 | 25840 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint248 | 25814 | 25814 | 25814 | 25814 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint248Array4 | 31954 | 31954 | 31954 | 31954 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint24Array4 | 31622 | 31622 | 31622 | 31622 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint24Int40Pair | 27873 | 27873 | 27873 | 27873 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint24Int40PairArray4 | 39064 | 39064 | 39064 | 39064 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint24Matrix2x2 | 35296 | 35296 | 35296 | 35296 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint32 | 25798 | 25798 | 25798 | 25798 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint32Array4 | 31638 | 31638 | 31638 | 31638 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint40 | 25817 | 25817 | 25817 | 25817 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint40Array4 | 31624 | 31624 | 31624 | 31624 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint48 | 25773 | 25773 | 25773 | 25773 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint56 | 25839 | 25839 | 25839 | 25839 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint64 | 25752 | 25752 | 25752 | 25752 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint64Array4 | 31687 | 31687 | 31687 | 31687 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint72 | 25838 | 25838 | 25838 | 25838 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint8 | 25842 | 25842 | 25842 | 25842 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint80 | 25793 | 25793 | 25793 | 25793 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint88 | 25809 | 25809 | 25809 | 25809 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint8Array4 | 31599 | 31599 | 31599 | 31599 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint96 | 25837 | 25837 | 25837 | 25837 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint96Array4 | 31750 | 31750 | 31750 | 31750 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUintArray | 27860 | 30522 | 30587 | 31457 | 258 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUintArray4 | 29774 | 29774 | 29774 | 29774 | 1 | +|------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUintMatrix2x2 | 33298 | 33298 | 33298 | 33298 | 1 | +╰------------------------------------------------+-----------------+-------+--------+-------+---------╯ + +╭-------------------------------------------------+-----------------+-------+--------+-------+---------╮ +| src/AbiRoundtripSol.sol:SolBenchCaller Contract | | | | | | ++======================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| 17156602 | 80516 | | | | | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoAddress | 26076 | 26076 | 26076 | 26076 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoAddressArray4 | 33262 | 33262 | 33262 | 33262 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoAddressMatrix2x2 | 37848 | 37848 | 37848 | 37848 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBool | 25792 | 25792 | 25792 | 25792 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBoolAddressPair | 28453 | 28453 | 28453 | 28453 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBoolAddressPairArray | 27244 | 43346 | 43851 | 43887 | 258 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBoolAddressPairArray4 | 43300 | 43300 | 43300 | 43300 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBoolAddressU256Triple | 29527 | 29527 | 29527 | 29527 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBoolAddressU256TripleArray4 | 47891 | 47891 | 47891 | 47891 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBoolArray4 | 32170 | 32170 | 32170 | 32170 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBoolMatrix2x2 | 36819 | 36819 | 36819 | 36819 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt104 | 26200 | 26200 | 26200 | 26200 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt112 | 26197 | 26197 | 26197 | 26197 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt120 | 26196 | 26196 | 26196 | 26196 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt128 | 26155 | 26155 | 26155 | 26155 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt128Array4 | 33146 | 33146 | 33146 | 33146 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt136 | 26134 | 26134 | 26134 | 26134 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt144 | 26219 | 26219 | 26219 | 26219 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt152 | 26198 | 26198 | 26198 | 26198 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt16 | 26198 | 26198 | 26198 | 26198 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt160 | 26196 | 26196 | 26196 | 26196 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt160Array4 | 33132 | 33132 | 33132 | 33132 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt168 | 26174 | 26174 | 26174 | 26174 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt16Array4 | 33333 | 33333 | 33333 | 33333 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt176 | 26198 | 26198 | 26198 | 26198 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt184 | 26174 | 26174 | 26174 | 26174 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt192 | 26198 | 26198 | 26198 | 26198 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt200 | 26174 | 26174 | 26174 | 26174 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt208 | 26131 | 26131 | 26131 | 26131 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt216 | 26198 | 26198 | 26198 | 26198 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt224 | 26176 | 26176 | 26176 | 26176 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt232 | 26198 | 26198 | 26198 | 26198 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt24 | 26177 | 26177 | 26177 | 26177 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt240 | 26134 | 26134 | 26134 | 26134 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt248 | 26221 | 26221 | 26221 | 26221 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt248Array4 | 33012 | 33012 | 33012 | 33012 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt24Array4 | 33323 | 33323 | 33323 | 33323 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt256 | 26127 | 26127 | 26127 | 26127 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt256Array4 | 32815 | 32815 | 32815 | 32815 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt256Matrix2x2 | 37379 | 37379 | 37379 | 37379 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt32 | 26243 | 26243 | 26243 | 26243 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt32Array4 | 33335 | 33335 | 33335 | 33335 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt40 | 26176 | 26176 | 26176 | 26176 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt40Array4 | 33322 | 33322 | 33322 | 33322 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt40Matrix2x2 | 37841 | 37841 | 37841 | 37841 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt48 | 26179 | 26179 | 26179 | 26179 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt56 | 26174 | 26174 | 26174 | 26174 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt64 | 26173 | 26173 | 26173 | 26173 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt64Array4 | 33309 | 33309 | 33309 | 33309 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt72 | 26200 | 26200 | 26200 | 26200 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt8 | 26237 | 26237 | 26237 | 26237 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt80 | 26196 | 26196 | 26196 | 26196 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt88 | 26174 | 26174 | 26174 | 26174 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt8Array4 | 33372 | 33372 | 33372 | 33372 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt96 | 26175 | 26175 | 26175 | 26175 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoInt96Array4 | 33236 | 33236 | 33236 | 33236 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoPair | 30558 | 30558 | 30558 | 30558 | 2 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoString | 27743 | 28051 | 28051 | 28360 | 2 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoStringArray | 27684 | 43795 | 43959 | 45861 | 258 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoStringArray2 | 35984 | 35984 | 35984 | 35984 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoStringBoolU64Triple | 31781 | 31781 | 31781 | 31781 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoStringU64PairArray | 27773 | 52992 | 53493 | 55180 | 258 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoStringU64PairArray2 | 40469 | 40469 | 40469 | 40469 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint | 25758 | 25758 | 25758 | 25758 | 2 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint104 | 25813 | 25813 | 25813 | 25813 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint112 | 25768 | 25768 | 25768 | 25768 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint120 | 25816 | 25816 | 25816 | 25816 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint128 | 25748 | 25748 | 25748 | 25748 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint128Array4 | 32330 | 32330 | 32330 | 32330 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint136 | 25859 | 25859 | 25859 | 25859 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint144 | 25794 | 25794 | 25794 | 25794 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint152 | 25814 | 25814 | 25814 | 25814 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint16 | 25836 | 25836 | 25836 | 25836 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint160 | 25792 | 25792 | 25792 | 25792 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint160Array4 | 32353 | 32353 | 32353 | 32353 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint168 | 25812 | 25812 | 25812 | 25812 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint16Array4 | 32159 | 32159 | 32159 | 32159 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint176 | 25749 | 25749 | 25749 | 25749 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint184 | 25860 | 25860 | 25860 | 25860 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint192 | 25835 | 25835 | 25835 | 25835 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint200 | 25771 | 25771 | 25771 | 25771 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint208 | 25813 | 25813 | 25813 | 25813 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint216 | 25816 | 25816 | 25816 | 25816 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint224 | 25814 | 25814 | 25814 | 25814 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint232 | 25814 | 25814 | 25814 | 25814 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint24 | 25811 | 25811 | 25811 | 25811 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint240 | 25836 | 25836 | 25836 | 25836 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint248 | 25833 | 25833 | 25833 | 25833 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint248Array4 | 32527 | 32527 | 32527 | 32527 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint24Array4 | 32217 | 32217 | 32217 | 32217 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint24Int40Pair | 28666 | 28666 | 28666 | 28666 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint24Int40PairArray4 | 43434 | 43434 | 43434 | 43434 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint24Matrix2x2 | 36803 | 36803 | 36803 | 36803 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint32 | 25791 | 25791 | 25791 | 25791 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint32Array4 | 32207 | 32207 | 32207 | 32207 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint40 | 25811 | 25811 | 25811 | 25811 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint40Array4 | 32218 | 32218 | 32218 | 32218 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint48 | 25793 | 25793 | 25793 | 25793 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint56 | 25812 | 25812 | 25812 | 25812 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint64 | 25749 | 25749 | 25749 | 25749 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint64Array4 | 32295 | 32295 | 32295 | 32295 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint72 | 25856 | 25856 | 25856 | 25856 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint8 | 25881 | 25881 | 25881 | 25881 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint80 | 25770 | 25770 | 25770 | 25770 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint88 | 25813 | 25813 | 25813 | 25813 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint8Array4 | 32215 | 32215 | 32215 | 32215 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint96 | 25838 | 25838 | 25838 | 25838 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint96Array4 | 32367 | 32367 | 32367 | 32367 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUintArray | 28216 | 31380 | 31453 | 32323 | 258 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUintArray4 | 30505 | 30505 | 30505 | 30505 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUintMatrix2x2 | 34953 | 34953 | 34953 | 34953 | 1 | +╰-------------------------------------------------+-----------------+-------+--------+-------+---------╯ + +╭---------------------------------------------------+-----------------+-------+--------+-------+---------╮ +| src/BytesSuiteSol.sol:BytesFeBenchCaller Contract | | | | | | ++========================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|---------------------------------------------------+-----------------+-------+--------+-------+---------| +| 341580 | 1623 | | | | | +|---------------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|---------------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|---------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBytes | 26811 | 27514 | 27351 | 28519 | 261 | +╰---------------------------------------------------+-----------------+-------+--------+-------+---------╯ + +╭----------------------------------------------------+-----------------+-------+--------+-------+---------╮ +| src/BytesSuiteSol.sol:BytesSolBenchCaller Contract | | | | | | ++=========================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|----------------------------------------------------+-----------------+-------+--------+-------+---------| +| 341580 | 1623 | | | | | +|----------------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|----------------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|----------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBytes | 27150 | 27780 | 27611 | 28797 | 261 | +╰----------------------------------------------------+-----------------+-------+--------+-------+---------╯ + +╭----------------------------------------------+-----------------+-------+--------+-------+---------╮ +| src/BytesSuiteSol.sol:BytesSuiteSol Contract | | | | | | ++===================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|----------------------------------------------+-----------------+-------+--------+-------+---------| +| 171987 | 577 | | | | | +|----------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|----------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|----------------------------------------------+-----------------+-------+--------+-------+---------| +| echoBytes | 22391 | 23405 | 22900 | 25700 | 261 | +╰----------------------------------------------+-----------------+-------+--------+-------+---------╯ + +╭---------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ +| src/DeepDynamicSuiteSol.sol:DeepDynamicFeBenchCaller Contract | | | | | | ++====================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|---------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| 3083861 | 14369 | | | | | +|---------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|---------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|---------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBytesArray | 27068 | 36730 | 36809 | 39501 | 257 | +|---------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBytesU64Pair | 28842 | 29591 | 29406 | 30647 | 257 | +|---------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBytesU64PairArray | 36783 | 42053 | 42089 | 44804 | 257 | +|---------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoNestedBytesArray | 27175 | 61188 | 62413 | 67532 | 257 | +|---------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoNestedBytesU64PairArray | 27131 | 75909 | 78065 | 84777 | 257 | +|---------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoNestedStringArray | 44505 | 61277 | 61392 | 64372 | 257 | +|---------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoNestedStringU64PairArray | 27179 | 75535 | 76080 | 79025 | 257 | +|---------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoNestedUintArray | 27152 | 41807 | 42047 | 43679 | 257 | +|---------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUint24Array | 31032 | 31032 | 31032 | 31032 | 1 | +╰---------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ + +╭----------------------------------------------------------------+-----------------+-------+--------+--------+---------╮ +| src/DeepDynamicSuiteSol.sol:DeepDynamicSolBenchCaller Contract | | | | | | ++======================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|----------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| 3083861 | 14369 | | | | | +|----------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| | | | | | | +|----------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|----------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoBytesArray | 27508 | 39765 | 39876 | 42599 | 257 | +|----------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoBytesU64Pair | 30119 | 30797 | 30604 | 31863 | 257 | +|----------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoBytesU64PairArray | 39819 | 46898 | 46950 | 49698 | 257 | +|----------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoNestedBytesArray | 27574 | 73641 | 75085 | 80264 | 257 | +|----------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoNestedBytesU64PairArray | 27462 | 94423 | 97064 | 103851 | 257 | +|----------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoNestedStringArray | 50147 | 73946 | 74145 | 77159 | 257 | +|----------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoNestedStringU64PairArray | 27551 | 94531 | 95340 | 98281 | 257 | +|----------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoNestedUintArray | 27506 | 48064 | 48408 | 50040 | 257 | +|----------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoUint24Array | 31284 | 31284 | 31284 | 31284 | 1 | +╰----------------------------------------------------------------+-----------------+-------+--------+--------+---------╯ + +╭----------------------------------------------------------+-----------------+-------+--------+-------+---------╮ +| src/DeepDynamicSuiteSol.sol:DeepDynamicSuiteSol Contract | | | | | | ++===============================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|----------------------------------------------------------+-----------------+-------+--------+-------+---------| +| 1836721 | 8276 | | | | | +|----------------------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|----------------------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|----------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoBytesArray | 22786 | 29632 | 29305 | 34970 | 257 | +|----------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoBytesU64Pair | 23976 | 24749 | 24440 | 26610 | 257 | +|----------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoBytesU64PairArray | 28611 | 32583 | 32478 | 37160 | 257 | +|----------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoNestedBytesArray | 22830 | 46644 | 47213 | 57230 | 257 | +|----------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoNestedBytesU64PairArray | 22763 | 55995 | 57670 | 70100 | 257 | +|----------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoNestedStringArray | 33973 | 46217 | 46289 | 49750 | 257 | +|----------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoNestedStringU64PairArray | 22764 | 55530 | 55928 | 58799 | 257 | +|----------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoNestedUintArray | 22785 | 33610 | 33818 | 35450 | 257 | +|----------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUint24Array | 22408 | 24110 | 24132 | 24180 | 257 | +╰----------------------------------------------------------+-----------------+-------+--------+-------+---------╯ + +╭---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ +| src/FixedArrayCeilingSuiteSol.sol:FixedArrayCeilingFeBenchCaller Contract | | | | | | ++================================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| 1192733 | 5585 | | | | | +|---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBoolArray17 | 47229 | 47386 | 47397 | 47565 | 257 | +|---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBytesArray17 | 73743 | 83774 | 85897 | 90847 | 257 | +|---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoStringArray17 | 76546 | 83832 | 83871 | 87403 | 257 | +|---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUintArray32 | 49774 | 53286 | 54850 | 57610 | 257 | +╰---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ + +╭----------------------------------------------------------------------------+-----------------+-------+--------+--------+---------╮ +| src/FixedArrayCeilingSuiteSol.sol:FixedArrayCeilingSolBenchCaller Contract | | | | | | ++==================================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|----------------------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| 1192733 | 5585 | | | | | +|----------------------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| | | | | | | +|----------------------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|----------------------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoBoolArray17 | 50004 | 50071 | 50076 | 50148 | 257 | +|----------------------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoBytesArray17 | 88954 | 98091 | 100234 | 105212 | 257 | +|----------------------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoStringArray17 | 91819 | 98205 | 98215 | 101776 | 257 | +|----------------------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoUintArray32 | 55836 | 59348 | 60912 | 63672 | 257 | +╰----------------------------------------------------------------------------+-----------------+-------+--------+--------+---------╯ + +╭----------------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ +| src/FixedArrayCeilingSuiteSol.sol:FixedArrayCeilingSuiteSol Contract | | | | | | ++===========================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|----------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| 675018 | 2905 | | | | | +|----------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|----------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|----------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoBoolArray17 | 28954 | 29021 | 29026 | 29098 | 257 | +|----------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoBytesArray17 | 50774 | 61071 | 62670 | 74410 | 257 | +|----------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoStringArray17 | 53460 | 59598 | 59498 | 65730 | 257 | +|----------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUintArray32 | 35436 | 42369 | 45290 | 52190 | 257 | +╰----------------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ + +╭-------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ +| src/FixedArraySuiteSol.sol:FixedArrayFeBenchCaller Contract | | | | | | ++==================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|-------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| 3331273 | 15547 | | | | | +|-------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|-------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|-------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBoolAddressPairArray8 | 50637 | 51750 | 52433 | 52561 | 257 | +|-------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBoolArray17 | 47267 | 47450 | 47463 | 47631 | 257 | +|-------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBoolArray5 | 32345 | 32416 | 32429 | 32485 | 257 | +|-------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBytesArray17 | 73843 | 83798 | 85798 | 90643 | 257 | +|-------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBytesArray5 | 41641 | 43936 | 44211 | 46383 | 257 | +|-------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoBytesU64PairArray5 | 51983 | 54241 | 54551 | 56895 | 257 | +|-------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoNestedUintArray2x5 | 37694 | 38815 | 39110 | 40502 | 257 | +|-------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoStringArray17 | 76634 | 84113 | 84121 | 88211 | 257 | +|-------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoStringArray5 | 42437 | 44055 | 43987 | 45993 | 257 | +|-------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoStringU64PairArray5 | 51490 | 53487 | 53498 | 55618 | 257 | +|-------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUintArray16 | 39075 | 40901 | 41499 | 43287 | 257 | +|-------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUintArray32 | 52138 | 55572 | 57166 | 59686 | 257 | +|-------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoUintArray8 | 32569 | 33501 | 33685 | 35221 | 257 | +╰-------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ + +╭--------------------------------------------------------------+-----------------+-------+--------+--------+---------╮ +| src/FixedArraySuiteSol.sol:FixedArraySolBenchCaller Contract | | | | | | ++====================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|--------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| 3331273 | 15547 | | | | | +|--------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| | | | | | | +|--------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|--------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoBoolAddressPairArray8 | 59938 | 60986 | 61690 | 61750 | 257 | +|--------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoBoolArray17 | 50083 | 50161 | 50167 | 50239 | 257 | +|--------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoBoolArray5 | 33367 | 33397 | 33403 | 33427 | 257 | +|--------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoBytesArray17 | 89067 | 98118 | 100167 | 104995 | 257 | +|--------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoBytesArray5 | 45716 | 47953 | 48242 | 50422 | 257 | +|--------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoBytesU64PairArray5 | 58317 | 60516 | 60832 | 63193 | 257 | +|--------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoNestedUintArray2x5 | 40016 | 41137 | 41432 | 42824 | 257 | +|--------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoStringArray17 | 91886 | 98461 | 98458 | 102563 | 257 | +|--------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoStringArray5 | 46430 | 48083 | 48013 | 50042 | 257 | +|--------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoStringU64PairArray5 | 58844 | 60797 | 60795 | 62947 | 257 | +|--------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoUintArray16 | 41152 | 42978 | 43576 | 45364 | 257 | +|--------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoUintArray32 | 55887 | 59321 | 60915 | 63435 | 257 | +|--------------------------------------------------------------+-----------------+-------+--------+--------+---------| +| benchEchoUintArray8 | 33768 | 34700 | 34884 | 36420 | 257 | +╰--------------------------------------------------------------+-----------------+-------+--------+--------+---------╯ + +╭--------------------------------------------------------+-----------------+-------+--------+-------+---------╮ +| src/FixedArraySuiteSol.sol:FixedArraySuiteSol Contract | | | | | | ++=============================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|--------------------------------------------------------+-----------------+-------+--------+-------+---------| +| 1881160 | 8482 | | | | | +|--------------------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|--------------------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|--------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoBoolAddressPairArray8 | 36376 | 37424 | 38128 | 38188 | 257 | +|--------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoBoolArray17 | 28965 | 29043 | 29049 | 29121 | 257 | +|--------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoBoolArray5 | 24038 | 24068 | 24074 | 24098 | 257 | +|--------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoBytesArray17 | 50819 | 60931 | 62250 | 73770 | 257 | +|--------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoBytesArray5 | 31161 | 33587 | 33603 | 37780 | 257 | +|--------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoBytesU64PairArray5 | 36886 | 39022 | 39335 | 41880 | 257 | +|--------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoNestedUintArray2x5 | 27627 | 28813 | 29043 | 31680 | 257 | +|--------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoStringArray17 | 53527 | 59909 | 59730 | 67530 | 257 | +|--------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoStringArray5 | 31809 | 33464 | 33349 | 36690 | 257 | +|--------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoStringU64PairArray5 | 37435 | 39313 | 39320 | 41383 | 257 | +|--------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUintArray16 | 28809 | 32171 | 33000 | 37470 | 257 | +|--------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUintArray32 | 35486 | 42367 | 45350 | 51650 | 257 | +|--------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoUintArray8 | 25382 | 26818 | 26750 | 30590 | 257 | +╰--------------------------------------------------------+-----------------+-------+--------+-------+---------╯ + +╭---------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ +| src/NestedTupleSuiteSol.sol:NestedTupleFeBenchCaller Contract | | | | | | ++====================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|---------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| 1700162 | 7947 | | | | | +|---------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|---------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|---------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoNestedDynamic | 32324 | 32324 | 32324 | 32324 | 1 | +|---------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoNestedDynamicBoth | 35906 | 35906 | 35906 | 35906 | 1 | +|---------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoNestedStatic | 29003 | 29003 | 29003 | 29003 | 1 | +|---------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoNestedStaticArray | 44468 | 44468 | 44468 | 44468 | 1 | +|---------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoNestedStaticDynArray | 40282 | 40282 | 40282 | 40282 | 1 | +|---------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoNestedStaticFlipped | 28928 | 28928 | 28928 | 28928 | 1 | +╰---------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ + +╭----------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ +| src/NestedTupleSuiteSol.sol:NestedTupleSolBenchCaller Contract | | | | | | ++=====================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| 1700162 | 7947 | | | | | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoNestedDynamic | 33712 | 33712 | 33712 | 33712 | 1 | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoNestedDynamicBoth | 38606 | 38606 | 38606 | 38606 | 1 | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoNestedStatic | 30291 | 30291 | 30291 | 30291 | 1 | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoNestedStaticArray | 51742 | 51742 | 51742 | 51742 | 1 | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoNestedStaticDynArray | 44915 | 44915 | 44915 | 44915 | 1 | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| benchEchoNestedStaticFlipped | 30651 | 30651 | 30651 | 30651 | 1 | +╰----------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ + +╭----------------------------------------------------------+-----------------+-------+--------+-------+---------╮ +| src/NestedTupleSuiteSol.sol:NestedTupleSuiteSol Contract | | | | | | ++===============================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|----------------------------------------------------------+-----------------+-------+--------+-------+---------| +| 1020261 | 4501 | | | | | +|----------------------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|----------------------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|----------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoNestedDynamic | 25114 | 25784 | 25851 | 26800 | 257 | +|----------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoNestedDynamicBoth | 27307 | 28408 | 28296 | 31210 | 257 | +|----------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoNestedStatic | 23877 | 24135 | 24141 | 24477 | 257 | +|----------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoNestedStaticArray | 33084 | 33084 | 33084 | 33084 | 1 | +|----------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoNestedStaticDynArray | 22405 | 33183 | 33603 | 34527 | 257 | +|----------------------------------------------------------+-----------------+-------+--------+-------+---------| +| echoNestedStaticFlipped | 23887 | 24159 | 24187 | 24499 | 257 | +╰----------------------------------------------------------+-----------------+-------+--------+-------+---------╯ + + +Ran 340 test suites in 119.66s (689.33s CPU time): 626 tests passed, 0 failed, 0 skipped (626 total tests) diff --git a/benchmarks/foundry-abi/reports/gas-summary.md b/benchmarks/foundry-abi/reports/gas-summary.md new file mode 100644 index 0000000000..2d5968d8d8 --- /dev/null +++ b/benchmarks/foundry-abi/reports/gas-summary.md @@ -0,0 +1,81 @@ +# ABI Gas Summary + +Generated: 2026-05-06T16:33:26.606007+00:00 + +Suite summary: 340 suites, 626 passed, 0 failed, 0 skipped + +Raw report: `reports/gas-report.txt` + +CSV: `reports/gas-deltas.csv` + +## Overall + +- Bench functions compared: 111 +- Mean Fe minus Solidity delta: -579.71 gas +- Median Fe minus Solidity delta: -33.00 gas +- Best delta: `benchEchoStringU64PairArray` = -6865 gas (-12.95%) +- Worst delta: `benchEchoInt56` = 34 gas (0.13%) + +## By Category + +| Category | Functions | Mean Delta | Median Delta | Best | Worst | +| --- | ---: | ---: | ---: | ---: | ---: | +| `scalar-bool` | 1 | 4.00 | 4.00 | 4 | 4 | +| `custom-signed` | 26 | -0.19 | 8.50 | -39 | 34 | +| `custom-unsigned` | 26 | -7.00 | 0.00 | -45 | 27 | +| `native-signed` | 6 | -21.17 | -11.50 | -94 | 12 | +| `native-unsigned` | 6 | -49.50 | 2.50 | -296 | 26 | +| `scalar-address` | 1 | -56.00 | -56.00 | -56 | -56 | +| `dynamic-string` | 1 | -90.00 | -90.00 | -90 | -90 | +| `fixed-array` | 25 | -628.84 | -594.00 | -881 | -528 | +| `tuple-static` | 3 | -859.67 | -793.00 | -993 | -793 | +| `tuple-dynamic` | 2 | -1105.00 | -1105.00 | -1305 | -905 | +| `nested-fixed-array` | 6 | -1548.33 | -1507.50 | -1695 | -1444 | +| `dynamic-fixed-array` | 2 | -3128.00 | -3128.00 | -4208 | -2048 | +| `tuple-fixed-array` | 4 | -4461.75 | -4346.00 | -5121 | -4034 | +| `tuple-fixed-array-dynamic` | 2 | -4846.00 | -4846.00 | -6865 | -2827 | + +## Notable Patterns + +- Highest mean regression category: `scalar-bool` at 4.00 gas across 1 functions. +- Lowest mean regression category: `tuple-fixed-array-dynamic` at -4846.00 gas across 2 functions. + +## Largest Regressions + +| Function | Solidity Avg | Fe Avg | Delta | Delta % | +| --- | ---: | ---: | ---: | ---: | +| `benchEchoInt56` | 26174 | 26208 | 34 | 0.13% | +| `benchEchoInt208` | 26131 | 26163 | 32 | 0.12% | +| `benchEchoInt240` | 26134 | 26162 | 28 | 0.11% | +| `benchEchoUint56` | 25812 | 25839 | 27 | 0.10% | +| `benchEchoUint128` | 25748 | 25774 | 26 | 0.10% | +| `benchEchoUint168` | 25812 | 25837 | 25 | 0.10% | +| `benchEchoUint80` | 25770 | 25793 | 23 | 0.09% | +| `benchEchoInt120` | 26196 | 26209 | 13 | 0.05% | +| `benchEchoInt88` | 26174 | 26187 | 13 | 0.05% | +| `benchEchoInt128` | 26155 | 26167 | 12 | 0.05% | +| `benchEchoInt168` | 26174 | 26185 | 11 | 0.04% | +| `benchEchoInt216` | 26198 | 26209 | 11 | 0.04% | +| `benchEchoInt224` | 26176 | 26187 | 11 | 0.04% | +| `benchEchoInt232` | 26198 | 26209 | 11 | 0.04% | +| `benchEchoInt96` | 26175 | 26186 | 11 | 0.04% | + +## Largest Improvements + +| Function | Solidity Avg | Fe Avg | Delta | Delta % | +| --- | ---: | ---: | ---: | ---: | +| `benchEchoStringU64PairArray` | 52992 | 46127 | -6865 | -12.95% | +| `benchEchoBoolAddressU256TripleArray4` | 47891 | 42770 | -5121 | -10.69% | +| `benchEchoUint24Int40PairArray4` | 43434 | 39064 | -4370 | -10.06% | +| `benchEchoBoolAddressPairArray4` | 43300 | 38978 | -4322 | -9.98% | +| `benchEchoStringArray` | 43795 | 39587 | -4208 | -9.61% | +| `benchEchoBoolAddressPairArray` | 43346 | 39312 | -4034 | -9.31% | +| `benchEchoStringU64PairArray2` | 40469 | 37642 | -2827 | -6.99% | +| `benchEchoStringArray2` | 35984 | 33936 | -2048 | -5.69% | +| `benchEchoInt256Matrix2x2` | 37379 | 35684 | -1695 | -4.53% | +| `benchEchoUintMatrix2x2` | 34953 | 33298 | -1655 | -4.73% | +| `benchEchoAddressMatrix2x2` | 37848 | 36340 | -1508 | -3.98% | +| `benchEchoUint24Matrix2x2` | 36803 | 35296 | -1507 | -4.09% | +| `benchEchoBoolMatrix2x2` | 36819 | 35338 | -1481 | -4.02% | +| `benchEchoInt40Matrix2x2` | 37841 | 36397 | -1444 | -3.82% | +| `benchEchoStringBoolU64Triple` | 31781 | 30476 | -1305 | -4.11% | diff --git a/benchmarks/foundry-abi/reports/hevm-equivalence-status.md b/benchmarks/foundry-abi/reports/hevm-equivalence-status.md new file mode 100644 index 0000000000..aed378766b --- /dev/null +++ b/benchmarks/foundry-abi/reports/hevm-equivalence-status.md @@ -0,0 +1,125 @@ +# hevm Equivalence Status + +Date: 2026-05-06 + +Environment: +- `hevm 0.57.0` +- `z3 4.16.0` +- `fe-opt 4a5777d33` +- local install from the adjacent `hevm` checkout at `../hevm/local/bin` + +Semantics: +- hevm checks matching success/failure, returndata, and storage. +- if both sides revert, hevm compares the revert payloads, not just the fact of reversion. +- logs and gas are not part of the equivalence relation. + +Helpers: +- `benchmarks/foundry-abi/scripts/run_hevm_equivalence.sh` +- `benchmarks/foundry-abi/scripts/run_hevm_curated_matrix.sh` + +Summary: +- proven equivalent: 70 +- unsupported by current hevm parser/encoder: 12 +- partial or timed out: 1 +- suspicious malformed-calldata mismatches: 1 +- other failures: 0 + +## Proven Equivalent + +- `AbiRoundtrip scalars`: `echoBool(bool)` +- `AbiRoundtrip scalars`: `echoAddress(address)` +- `AbiRoundtrip scalars`: `echoUint8(uint8)` +- `AbiRoundtrip scalars`: `echoUint16(uint16)` +- `AbiRoundtrip scalars`: `echoUint32(uint32)` +- `AbiRoundtrip scalars`: `echoUint64(uint64)` +- `AbiRoundtrip scalars`: `echoUint128(uint128)` +- `AbiRoundtrip scalars`: `echoUint(uint256)` +- `AbiRoundtrip scalars`: `echoInt8(int8)` +- `AbiRoundtrip scalars`: `echoInt16(int16)` +- `AbiRoundtrip scalars`: `echoInt32(int32)` +- `AbiRoundtrip scalars`: `echoInt64(int64)` +- `AbiRoundtrip scalars`: `echoInt128(int128)` +- `AbiRoundtrip scalars`: `echoInt256(int256)` +- `AbiRoundtrip scalars`: `echoUint24(uint24)` +- `AbiRoundtrip scalars`: `echoUint40(uint40)` +- `AbiRoundtrip scalars`: `echoUint48(uint48)` +- `AbiRoundtrip scalars`: `echoUint56(uint56)` +- `AbiRoundtrip scalars`: `echoUint72(uint72)` +- `AbiRoundtrip scalars`: `echoUint80(uint80)` +- `AbiRoundtrip scalars`: `echoUint88(uint88)` +- `AbiRoundtrip scalars`: `echoUint96(uint96)` +- `AbiRoundtrip scalars`: `echoUint104(uint104)` +- `AbiRoundtrip scalars`: `echoUint112(uint112)` +- `AbiRoundtrip scalars`: `echoUint120(uint120)` +- `AbiRoundtrip scalars`: `echoUint136(uint136)` +- `AbiRoundtrip scalars`: `echoUint144(uint144)` +- `AbiRoundtrip scalars`: `echoUint152(uint152)` +- `AbiRoundtrip scalars`: `echoUint160(uint160)` +- `AbiRoundtrip scalars`: `echoUint168(uint168)` +- `AbiRoundtrip scalars`: `echoUint176(uint176)` +- `AbiRoundtrip scalars`: `echoUint184(uint184)` +- `AbiRoundtrip scalars`: `echoUint192(uint192)` +- `AbiRoundtrip scalars`: `echoUint200(uint200)` +- `AbiRoundtrip scalars`: `echoUint208(uint208)` +- `AbiRoundtrip scalars`: `echoUint216(uint216)` +- `AbiRoundtrip scalars`: `echoUint224(uint224)` +- `AbiRoundtrip scalars`: `echoUint232(uint232)` +- `AbiRoundtrip scalars`: `echoUint240(uint240)` +- `AbiRoundtrip scalars`: `echoUint248(uint248)` +- `AbiRoundtrip scalars`: `echoInt24(int24)` +- `AbiRoundtrip scalars`: `echoInt40(int40)` +- `AbiRoundtrip scalars`: `echoInt48(int48)` +- `AbiRoundtrip scalars`: `echoInt56(int56)` +- `AbiRoundtrip scalars`: `echoInt72(int72)` +- `AbiRoundtrip scalars`: `echoInt80(int80)` +- `AbiRoundtrip scalars`: `echoInt88(int88)` +- `AbiRoundtrip scalars`: `echoInt96(int96)` +- `AbiRoundtrip scalars`: `echoInt104(int104)` +- `AbiRoundtrip scalars`: `echoInt112(int112)` +- `AbiRoundtrip scalars`: `echoInt120(int120)` +- `AbiRoundtrip scalars`: `echoInt136(int136)` +- `AbiRoundtrip scalars`: `echoInt144(int144)` +- `AbiRoundtrip scalars`: `echoInt152(int152)` +- `AbiRoundtrip scalars`: `echoInt160(int160)` +- `AbiRoundtrip scalars`: `echoInt168(int168)` +- `AbiRoundtrip scalars`: `echoInt176(int176)` +- `AbiRoundtrip scalars`: `echoInt184(int184)` +- `AbiRoundtrip scalars`: `echoInt192(int192)` +- `AbiRoundtrip scalars`: `echoInt200(int200)` +- `AbiRoundtrip scalars`: `echoInt208(int208)` +- `AbiRoundtrip scalars`: `echoInt216(int216)` +- `AbiRoundtrip scalars`: `echoInt224(int224)` +- `AbiRoundtrip scalars`: `echoInt232(int232)` +- `AbiRoundtrip scalars`: `echoInt240(int240)` +- `AbiRoundtrip scalars`: `echoInt248(int248)` +- `FixedArraySuite static`: `echoUintArray8(uint256[8] calldata)` +- `FixedArraySuite static`: `echoUintArray16(uint256[16] calldata)` +- `FixedArraySuite static`: `echoUintArray32(uint256[32] calldata)` +- `FixedArraySuite static`: `echoNestedUintArray2x5(uint256[5][2] calldata)` + +## Unsupported in hevm 0.57.0 + +- `AbiRoundtrip dynamic`: `echoString(string memory)` +- `AbiRoundtrip dynamic`: `echoUintArray(uint256[] memory)` +- `BytesSuite dynamic`: `echoBytes(bytes memory)` +- `FixedArraySuite dynamic fixed-array`: `echoStringArray5(string[5] calldata)` +- `AbiRoundtrip tuples`: `echoBoolAddressPair((bool,address) memory)` +- `AbiRoundtrip tuples`: `echoUint24Int40Pair((uint24,int40) memory)` +- `AbiRoundtrip tuples`: `echoBoolAddressU256Triple((bool,address,uint256) memory)` +- `AbiRoundtrip tuple arrays`: `echoBoolAddressPairArray4((bool,address)[4] calldata)` +- `AbiRoundtrip tuple arrays`: `echoUint24Int40PairArray4((uint24,int40)[4] calldata)` +- `AbiRoundtrip tuple arrays`: `echoBoolAddressU256TripleArray4((bool,address,uint256)[4] calldata)` +- `NestedTupleSuite tuples`: `echoNestedStatic(((bool,address),uint256) memory)` +- `NestedTupleSuite tuples`: `echoNestedStaticFlipped((bool,(address,uint256)) memory)` + +## Partial / Timeout + +- `FixedArraySuite bool timeout`: `echoBoolArray17(bool[17] calldata)` + +## Suspected hevm Front-End Bugs + +- `FixedArraySuite bool bug`: `echoBoolArray5(bool[5] calldata)` + +## Other Failures + + diff --git a/benchmarks/foundry-abi/reports/parity-status.md b/benchmarks/foundry-abi/reports/parity-status.md new file mode 100644 index 0000000000..911cdf81e9 --- /dev/null +++ b/benchmarks/foundry-abi/reports/parity-status.md @@ -0,0 +1,315 @@ +# ABI Parity Status + +Last updated: 2026-03-30 + +This note records the current status of Solidity ABI parity work in the +`benchmarks/foundry-abi` harness after rebasing the parity branch onto the +current `std-release` branch. + +## Current Verified State + +Verified in this worktree during the latest post-Sonatina rerun: + +- `cargo test --release -p sonatina-codegen gvn -- --nocapture` +- `cargo test --release -p fe-contract-harness dynamic_string_ -- --nocapture` +- `cargo test --release -p fe-contract-harness dynamic_tuple_ -- --nocapture` +- `cargo test --release -p fe-contract-harness fixed_array_contract_ -- --nocapture` +- `python3 benchmarks/foundry-abi/scripts/generate_matrix.py` +- `cargo run --release -q -p fe -- build --backend sonatina --contract AbiRoundtripFe --out-dir benchmarks/foundry-abi/fe-out benchmarks/foundry-abi/fe/AbiRoundtrip.fe` +- `forge test --root benchmarks/foundry-abi --offline` +- `python3 benchmarks/foundry-abi/scripts/run_gas_report.py` +- `cargo run --release -q -p fe -- build --backend sonatina --contract DynArraySuite --out-dir benchmarks/foundry-abi/fe-out benchmarks/foundry-abi/fe/DynArraySuite.fe` +- `forge test --root benchmarks/foundry-abi --offline --match-path test/DynArraySuiteEquivalence.t.sol --gas-report` +- `cargo run --release -q -p fe -- build --backend sonatina --contract BytesSuite --out-dir benchmarks/foundry-abi/fe-out benchmarks/foundry-abi/fe/BytesSuite.fe` +- `forge test --root benchmarks/foundry-abi --offline --match-path test/BytesSuiteEquivalence.t.sol --gas-report` +- `cargo run --release -q -p fe -- build --backend sonatina --contract DeepDynamicSuite --out-dir benchmarks/foundry-abi/fe-out benchmarks/foundry-abi/fe/DeepDynamicSuite.fe` +- `forge test --root benchmarks/foundry-abi --offline --match-path test/DeepDynamicSuiteEquivalence.t.sol --gas-report` +- `cargo run --release -q -p fe -- build --backend sonatina --contract FixedArraySuite --out-dir benchmarks/foundry-abi/fe-out benchmarks/foundry-abi/fe/FixedArraySuite.fe` +- `forge test --root benchmarks/foundry-abi --offline --match-path test/FixedArraySuiteEquivalence.t.sol --gas-report` +- `cargo run --release -q -p fe -- build --backend sonatina --contract FixedArrayCeilingSuite --out-dir benchmarks/foundry-abi/fe-out benchmarks/foundry-abi/fe/FixedArrayCeilingSuite.fe` +- `forge test --root benchmarks/foundry-abi --offline --match-path test/FixedArrayCeilingSuiteEquivalence.t.sol --gas-report` + +Focused Foundry status is green on the rebased branch: + +- `AbiRoundtripEquivalence.t.sol`: 7 tests passed +- `FixedArraySuiteEquivalence.t.sol`: 26 tests passed +- `FixedArrayCeilingSuiteEquivalence.t.sol`: 8 tests passed +- `BytesSuiteEquivalence.t.sol`: 4 tests passed +- `DynArraySuiteEquivalence.t.sol`: 8 tests passed +- `DeepDynamicSuiteEquivalence.t.sol`: 18 tests passed + +Full generated-harness status from the latest pass: + +- `340` suites +- `626` tests passed +- `0` failed +- `0` skipped + +Formal `hevm` status from the latest curated pass: + +- report: `benchmarks/foundry-abi/reports/hevm-equivalence-status.md` +- `70` proven equivalence checks +- `66` static scalar signatures proved on `AbiRoundtripFe` vs `AbiRoundtripSol` +- `4` focused static array / nested-array signatures proved on `FixedArraySuite` +- `hevm` compares revert payloads when both sides revert, in addition to + matching success/failure and storage +- current `hevm` limits still block full formal coverage for dynamic ABI shapes + like `bytes`, `string`, `T[]`, and tuple signatures + +Dynamic string / tuple contract/message ABI coverage is also green: + +- long-payload `DynString` contract decode / return roundtrips through + `fe-contract-harness` +- long-payload string literals now roundtrip directly in `DynString`-typed + contexts, including unannotated locals that later flow into `DynString`, + through `fe-contract-harness` +- the friendlier `Text` alias now roundtrips correctly in both top-level and + composite ABI shapes, including `(Text, u64)` and fixed arrays of `Text`, + through `fe-contract-harness` plus the focused Foundry suites +- `Text.view()` and `Text.as_bytes()` are both exercised through + `fe-contract-harness` +- long-payload `DynString` event ABI encoding roundtrips through + `fe-contract-harness` +- `(DynString, u64)` return, message-call, and constructor-arg roundtrips + through `fe-contract-harness` + +Fixed-array contract/message ABI boundary coverage is also green: + +- `bool[64]` roundtrips through `fe-contract-harness` +- `bool[65]` roundtrips through `fe-contract-harness` +- `string[65]` and `bytes[65]` roundtrip through `fe-contract-harness` + +Historical focused stress snapshots retained from the earlier rebased pass: + +- `forge test --root benchmarks/foundry-abi --offline --threads 0 --fuzz-runs 20000 --match-path test/BytesSuiteEquivalence.t.sol` +- `forge test --root benchmarks/foundry-abi --offline --threads 0 --fuzz-runs 10000 --match-path test/DynArraySuiteEquivalence.t.sol` +- `forge test --root benchmarks/foundry-abi --offline --threads 0 --fuzz-runs 256 --match-path test/DeepDynamicSuiteEquivalence.t.sol` +- `forge test --root benchmarks/foundry-abi --offline --threads 0 --fuzz-runs 5000 --match-path test/FixedArraySuiteEquivalence.t.sol` +- `forge test --root benchmarks/foundry-abi --offline --threads 0 --fuzz-runs 2000 --match-path test/FixedArrayCeilingSuiteEquivalence.t.sol` + +Those remained green before the latest full-matrix recheck. + +## Gas Snapshots + +Rebuilt full-harness gas snapshot from the latest pass: + +- report: `benchmarks/foundry-abi/reports/gas-summary.md` +- diagnosis note: `benchmarks/foundry-abi/reports/gas-diagnosis.md` +- Bench functions compared: `111` +- Mean Fe minus Solidity delta: `+1588.82` gas +- Median Fe minus Solidity delta: `+1534.00` gas +- Best delta: `benchEchoBoolAddressPairArray` = `-1078` +- Worst delta: `benchEchoStringU64PairArray2` = `+5203` + +Focused dynamic-array gas snapshot: + +- report: `benchmarks/foundry-abi/reports/dyn-array-suite-gas.md` +- mean wrapper delta: `+3952.00` +- median wrapper delta: `+3827.50` +- best delta: `benchEchoBoolAddressPairArray` = `+1532` +- worst delta: `benchEchoStringU64PairArray` = `+6621` + +Focused bytes gas snapshot: + +- report: `benchmarks/foundry-abi/reports/bytes-suite-gas.md` +- wrapper delta: `benchEchoBytes` = `+1718` + +Focused deep-dynamic gas snapshot: + +- report: `benchmarks/foundry-abi/reports/deep-dynamic-suite-gas.md` +- mean wrapper delta: `+7634.11` +- median wrapper delta: `+5814` +- best delta: `benchEchoBytesU64Pair` = `+2339` +- worst delta: `benchEchoNestedBytesU64PairArray` = `+15022` + +Focused fixed-array suite gas snapshot: + +- report: `benchmarks/foundry-abi/reports/fixed-array-suite-gas.md` +- mean wrapper delta: `+6558.85` +- median wrapper delta: `+3593` +- best delta: `benchEchoBoolAddressPairArray8` = `-4817` +- worst delta: `benchEchoStringArray17` = `+24071` + +Focused fixed-array ceiling suite gas snapshot: + +- report: `benchmarks/foundry-abi/reports/fixed-array-ceiling-suite-gas.md` +- mean wrapper delta: `+13204.00` +- median wrapper delta: `+13137.50` +- best delta: `benchEchoUintArray32` = `+2874` +- worst delta: `benchEchoStringArray17` = `+23667` + +## What Is Implemented + +The parity work currently includes: + +- generated roundtrip coverage in `fe/AbiRoundtrip.fe`, + `src/AbiRoundtripSol.sol`, and `test/generated/` +- first-class owned ABI strings via `std::abi::DynString`, used by the + generated and focused parity suites for Solidity `string` roundtrips with + payloads beyond the old single-word limit +- focused variable-length-array coverage in `fe/DynArraySuite.fe` and + `test/DynArraySuiteEquivalence.t.sol` +- focused first-class `bytes` coverage in `fe/BytesSuite.fe` and + `test/BytesSuiteEquivalence.t.sol` +- focused deeper dynamic coverage in `fe/DeepDynamicSuite.fe` and + `test/DeepDynamicSuiteEquivalence.t.sol` +- focused fixed-array coverage in `fe/FixedArraySuite.fe` and + `test/FixedArraySuiteEquivalence.t.sol` +- focused fixed-array ceiling coverage in `fe/FixedArrayCeilingSuite.fe` and + `test/FixedArrayCeilingSuiteEquivalence.t.sol` +- const-generic fixed-array ABI support in `ingots/core/src/abi.fe`, with + contract/message ABI roundtrips validated through `bool[65]`, `string[65]`, + and `bytes[65]` + +The deep-dynamic suite currently covers: + +- `uint24[]` +- `bytes[]` +- `bytes[][]` +- `uint256[][]` +- `string[][]` +- `(string,uint64)[][]` +- `(bytes,uint64)` +- `(bytes,uint64)[]` +- `(bytes,uint64)[][]` + +The fixed-array ceiling suite currently covers: + +- `bool[17]` +- `uint256[32]` +- `string[17]` +- `bytes[17]` + +## Safe Changes Kept + +The following rebased parity changes are considered stable enough to keep in +the worktree: + +- `crates/hir/src/analysis/ty/trait_lower.rs` + Adds cycle recovery to `collect_trait_impls`, fixing a real Salsa cycle that + appeared after the rebase and broke Fe builds broadly. +- `ingots/std/src/abi/sol/ints.fe` + Adds `AbiSpan` support for the custom-width Solidity integer wrappers so they + can participate in `DynArray` decode/encode flows. +- `ingots/core/src/abi.fe` + Restores the const-generic fixed-array ABI path for `AbiSize`, `AbiSpan`, + `Decode`, and `Encode`, and adds the first-class owned `DynString` ABI type. +- `ingots/std/src/abi.fe` +- `ingots/std/src/abi/sol/types.fe` +- `crates/fe/src/abi.rs` +- `crates/hir/src/core/lower/hir_builder.rs` + Wire `DynString` through the standard library surface and compiler ABI + lowering so it is treated as Solidity `string`. +- `Makefile` + Adds focused fixed-array and fixed-array-ceiling targets: + `foundry-abi-build-fe-fixed`, `foundry-abi-test-fixed`, + `foundry-abi-gas-fixed`, `foundry-abi-stress-fixed`, + `foundry-abi-build-fe-ceiling`, `foundry-abi-test-ceiling`, + `foundry-abi-gas-ceiling`, and `foundry-abi-stress-ceiling`. +- `crates/contract-harness/src/lib.rs` + Adds long-payload `DynString` and `(DynString, u64)` contract ABI coverage, + plus fixed-array contract ABI boundary coverage for `bool[64]`, `bool[65]`, + `string[65]`, and `bytes[65]`. +- Adjacent `sona-std-release` fixes validated with this worktree + Repair `cfg_cleanup` noreturn-tail phi cleanup, keep aggregates wider than + 16 scalar leaves out of scalarization for now, and re-enable `GVN` in the + default optimized pipeline. +- `benchmarks/foundry-abi/fe/FixedArraySuite.fe` +- `benchmarks/foundry-abi/src/FixedArraySuiteSol.sol` +- `benchmarks/foundry-abi/test/FixedArraySuiteEquivalence.t.sol` +- `benchmarks/foundry-abi/fe/FixedArrayCeilingSuite.fe` +- `benchmarks/foundry-abi/src/FixedArrayCeilingSuiteSol.sol` +- `benchmarks/foundry-abi/test/FixedArrayCeilingSuiteEquivalence.t.sol` +- `benchmarks/foundry-abi/test/DynArraySuiteEquivalence.t.sol` +- `benchmarks/foundry-abi/test/BytesSuiteEquivalence.t.sol` +- `benchmarks/foundry-abi/test/DeepDynamicSuiteEquivalence.t.sol` + +The focused equivalence suites assert both: + +- raw return-byte equality for direct low-level calls +- typed roundtrip equality through Solidity wrapper callers during fuzzing + +## Resolved In This Pass + +- The old merged-suite fixed-array Sonatina panic is gone. + `FixedArraySuite` and `FixedArrayCeilingSuite` both build and pass under the + default optimized pipeline. +- Fixed arrays no longer stop at the old `[T; 64]` ceiling in the Fe ABI + implementation. The const-generic path now roundtrips in the harness through + `bool[65]`, `string[65]`, and `bytes[65]`. +- Fe now has a first-class owned ABI string path through `std::abi::DynString`. + The generated matrix, focused suites, and contract harness all exercise + string payloads beyond the old `32`-byte ceiling. +- The full generated harness is green again on the rebased branch: + `340` suites, `626` passed, `0` failed, `0` skipped. +- The gas reports are refreshed after the latest Sonatina update. The + full-harness mean delta is now `+1588.82` gas with real long-payload string + coverage, and the worst remaining categories are still dynamic-element fixed + arrays and nested deep-dynamic wrappers. + +## Current Limits + +This is still not an exhaustive proof of complete Solidity ABI parity. + +Current limits are now mostly coverage and performance shape, not the old +fixed-array correctness breakage: + +- coverage is representative rather than exhaustive across all fixed-array + lengths and nested tuple/array combinations +- arbitrary-length ABI strings now roundtrip through `std::abi::DynString`, + and string literals can now flow there either directly from `DynString`- + typed contexts or from unannotated locals that are later constrained, but + the default language string inference still resolves to fixed-capacity + `String` +- the ergonomic alias surface is only partially expanded today: + `Text` / `Vec` are in the prelude and validated for ABI-facing use, but + richer dynamic-container helper APIs are still intentionally minimal until + the generic method/lowering path is sturdier +- `T[]` validation is still split into focused suites because the single + generated `AbiRoundtripFe` contract does not yet carry the full + dynamic-array matrix cleanly +- gas is still materially above Solidity for dynamic-element fixed arrays and + nested deep-dynamic wrappers even after the refreshed post-Sonatina rerun + +## Operational Notes + +- The generated matrix targets are not concurrency-safe: + `make foundry-abi-test` and `make foundry-abi-gas` both rewrite + `test/generated/`, so they should be run serially. +- `FixedArrayCeilingSuite` remains useful as a fast regression and gas-isolation + suite even though the merged `FixedArraySuite` now passes. + +## Recommended Next Step + +The highest-value next step is to attack the largest remaining gas cliffs now +that the refreshed post-Sonatina reports are checked in: + +1. investigate dynamic-element fixed arrays, especially `string[17]` + (`+23667` in the ceiling suite / `+24071` in the merged suite), + `bytes[17]` (`+23359` / `+23596`), and `(string,uint64)[5]` (`+9484`) +2. investigate nested deep-dynamic wrappers, especially + `(bytes,uint64)[][]` (`+15022`), `(string,uint64)[][]` (`+14730`), and + `bytes[][]` (`+10241`) +3. trim the remaining generated dynamic-array and string wrapper overhead, + especially `(string,uint64)[]` (`+6621`), `string[]` (`+4553`), and + `string` (`+2243`) + +Then continue broadening coverage across: + +- wider dynamic-element fixed arrays +- broader nested tuple/array combinations +- more generated `T[]` shapes in the monolithic matrix when compile scale + permits + +The current repaired parity envelope on this branch should be treated as: + +- full generated matrix green +- focused bytes / dyn-array / deep-dynamic / fixed-array suites green +- long-payload Solidity `string` parity validated through `DynString`, + including direct string literals and unannotated local literal bindings that + are later constrained to `DynString` +- friendlier ABI-facing aliases validated through `Text` / `Vec` without + regressing composite tuple / array head-tail handling +- const-generic fixed arrays verified in harness through `[65]` +- remaining work is coverage and gas/performance improvement, not the old + fixed-array correctness failure diff --git a/benchmarks/foundry-abi/scripts/generate_matrix.py b/benchmarks/foundry-abi/scripts/generate_matrix.py new file mode 100644 index 0000000000..69a6c3ded4 --- /dev/null +++ b/benchmarks/foundry-abi/scripts/generate_matrix.py @@ -0,0 +1,1356 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import shutil +from dataclasses import dataclass +from pathlib import Path + + +ROOT = Path(__file__).resolve().parents[1] +FE_PATH = ROOT / "fe" / "AbiRoundtrip.fe" +SOL_PATH = ROOT / "src" / "AbiRoundtripSol.sol" +GENERATED_ROOT = ROOT / "test" / "generated" +SUPPORT_DIR = GENERATED_ROOT / "support" +DETERMINISTIC_DIR = GENERATED_ROOT / "deterministic" +FUZZ_DIR = GENERATED_ROOT / "fuzz" +BENCH_DIR = GENERATED_ROOT / "bench" + + +@dataclass(frozen=True) +class TypeSpec: + slug: str + suffix: str + sol_abi: str + sol_param: str + sol_return: str + sol_local: str + sol_struct_field: str + fe_type: str + compare_kind: str + det_values: tuple[str, ...] + bench_value: str + assume_short_string: bool = False + is_dynamic: bool = False + + +@dataclass(frozen=True) +class ScalarCase: + slug: str + fn_name: str + bench_name: str + variant_name: str + ty: TypeSpec + + +@dataclass(frozen=True) +class TupleField: + name: str + ty: TypeSpec + + +@dataclass(frozen=True) +class TupleCase: + slug: str + fn_name: str + bench_name: str + variant_name: str + struct_name: str + value_name: str + fields: tuple[TupleField, ...] + det_values: tuple[dict[str, str], ...] + bench_value: dict[str, str] + + +@dataclass(frozen=True) +class ArrayCase: + slug: str + fn_name: str + bench_name: str + variant_name: str + sol_selector_sig: str + sol_param: str + sol_return: str + sol_local: str + fe_type: str + det_values: tuple[str, ...] + bench_value: str + assume_suffixes: tuple[str, ...] = () + assume_loop_exprs: tuple[str, ...] = () + max_fuzz_len: int | None = None + det_init_blocks: tuple[str, ...] = () + bench_init_block: str = "" + import_structs: tuple[str, ...] = () + + +def scalar( + slug: str, + suffix: str, + sol_abi: str, + fe_type: str, + compare_kind: str, + det_values: tuple[str, ...], + bench_value: str, + *, + assume_short_string: bool = False, + is_dynamic: bool = False, +) -> ScalarCase: + if suffix == "Uint": + fn_name = "echoUint" + bench_name = "benchEchoUint" + variant_name = "EchoUint" + elif suffix == "String": + fn_name = "echoString" + bench_name = "benchEchoString" + variant_name = "EchoString" + else: + fn_name = f"echo{suffix}" + bench_name = f"benchEcho{suffix}" + variant_name = f"Echo{suffix}" + + sol_param = "string calldata" if sol_abi == "string" else sol_abi + sol_return = "string memory" if sol_abi == "string" else sol_abi + sol_local = "string memory" if sol_abi == "string" else sol_abi + sol_struct_field = "string" if sol_abi == "string" else sol_abi + + return ScalarCase( + slug=slug, + fn_name=fn_name, + bench_name=bench_name, + variant_name=variant_name, + ty=TypeSpec( + slug=slug, + suffix=suffix, + sol_abi=sol_abi, + sol_param=sol_param, + sol_return=sol_return, + sol_local=sol_local, + sol_struct_field=sol_struct_field, + fe_type=fe_type, + compare_kind=compare_kind, + det_values=det_values, + bench_value=bench_value, + assume_short_string=assume_short_string, + is_dynamic=is_dynamic, + ), + ) + + +BOOL = TypeSpec( + slug="bool", + suffix="Bool", + sol_abi="bool", + sol_param="bool", + sol_return="bool", + sol_local="bool", + sol_struct_field="bool", + fe_type="bool", + compare_kind="eq", + det_values=("false", "true"), + bench_value="true", +) + +ADDRESS = TypeSpec( + slug="address", + suffix="Address", + sol_abi="address", + sol_param="address", + sol_return="address", + sol_local="address", + sol_struct_field="address", + fe_type="Address", + compare_kind="eq", + det_values=( + "address(0)", + "address(0x1000000000000000000000000000000000000001)", + "address(0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF)", + ), + bench_value="address(0x2000000000000000000000000000000000000002)", +) + +STRING = TypeSpec( + slug="string", + suffix="String", + sol_abi="string", + sol_param="string calldata", + sol_return="string memory", + sol_local="string memory", + sol_struct_field="string", + fe_type="DynString", + compare_kind="string", + det_values=( + 'string("")', + 'string("hello roundtrip")', + 'string("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")', + ), + bench_value='string("benchmark string payload that exceeds thirty-two bytes")', + assume_short_string=True, + is_dynamic=True, +) + +U64 = TypeSpec( + slug="uint64", + suffix="Uint64", + sol_abi="uint64", + sol_param="uint64", + sol_return="uint64", + sol_local="uint64", + sol_struct_field="uint64", + fe_type="u64", + compare_kind="eq", + det_values=("uint64(0)", "uint64(1)", "type(uint64).max"), + bench_value="uint64(99)", +) + +U256 = TypeSpec( + slug="uint256", + suffix="Uint", + sol_abi="uint256", + sol_param="uint256", + sol_return="uint256", + sol_local="uint256", + sol_struct_field="uint256", + fe_type="u256", + compare_kind="eq", + det_values=("uint256(0)", "uint256(1)", "type(uint256).max"), + bench_value="uint256(77)", +) + + +def native_uint(width: int) -> ScalarCase: + return scalar( + slug=f"uint{width}", + suffix=f"Uint{width}", + sol_abi=f"uint{width}", + fe_type=f"u{width}", + compare_kind="eq", + det_values=(f"uint{width}(0)", f"uint{width}(1)", f"type(uint{width}).max"), + bench_value=f"uint{width}(123)", + ) + + +def native_int(width: int) -> ScalarCase: + return scalar( + slug=f"int{width}", + suffix=f"Int{width}", + sol_abi=f"int{width}", + fe_type=f"i{width}", + compare_kind="eq", + det_values=(f"int{width}(0)", f"int{width}(-1)", f"type(int{width}).min", f"type(int{width}).max"), + bench_value=f"int{width}(-7)", + ) + + +def custom_uint(width: int, fe_type: str) -> ScalarCase: + return scalar( + slug=f"uint{width}", + suffix=f"Uint{width}", + sol_abi=f"uint{width}", + fe_type=fe_type, + compare_kind="eq", + det_values=(f"uint{width}(0)", f"uint{width}(1)", f"type(uint{width}).max"), + bench_value=f"uint{width}(123)", + ) + + +def custom_int(width: int, fe_type: str) -> ScalarCase: + return scalar( + slug=f"int{width}", + suffix=f"Int{width}", + sol_abi=f"int{width}", + fe_type=fe_type, + compare_kind="eq", + det_values=(f"int{width}(0)", f"int{width}(-1)", f"type(int{width}).min", f"type(int{width}).max"), + bench_value=f"int{width}(-7)", + ) + + +SCALAR_CASES: list[ScalarCase] = [ + scalar("bool", "Bool", "bool", "bool", "eq", ("false", "true"), "true"), + scalar("address", "Address", "address", "Address", "eq", ADDRESS.det_values, ADDRESS.bench_value), + scalar( + "string", + "String", + "string", + "DynString", + "string", + STRING.det_values, + STRING.bench_value, + assume_short_string=True, + is_dynamic=True, + ), + native_uint(8), + native_uint(16), + native_uint(32), + native_uint(64), + native_uint(128), + scalar("uint256", "Uint", "uint256", "u256", "eq", U256.det_values, U256.bench_value), + native_int(8), + native_int(16), + native_int(32), + native_int(64), + native_int(128), + native_int(256), +] + +for width in (24, 40, 48, 56, 72, 80, 88, 96, 104, 112, 120, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248): + SCALAR_CASES.append(custom_uint(width, f"Uint{width}")) + +for width in (24, 40, 48, 56, 72, 80, 88, 96, 104, 112, 120, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248): + SCALAR_CASES.append(custom_int(width, f"Int{width}")) + + +TUPLE_CASES: list[TupleCase] = [ + TupleCase( + slug="pair_string_u64", + fn_name="echoPair", + bench_name="benchEchoPair", + variant_name="EchoPair", + struct_name="StringU64Pair", + value_name="pair", + fields=(TupleField("text", STRING), TupleField("count", U64)), + det_values=( + {"text": '"pair payload"', "count": "uint64(42)"}, + {"text": '"0123456789abcdefghijklmnopqrstuv"', "count": "type(uint64).max"}, + ), + bench_value={"text": '"bench pair"', "count": "uint64(99)"}, + ), + TupleCase( + slug="pair_bool_address", + fn_name="echoBoolAddressPair", + bench_name="benchEchoBoolAddressPair", + variant_name="EchoBoolAddressPair", + struct_name="BoolAddressPair", + value_name="pair", + fields=(TupleField("flag", BOOL), TupleField("addr", ADDRESS)), + det_values=( + {"flag": "false", "addr": "address(0)"}, + {"flag": "true", "addr": "address(0x3000000000000000000000000000000000000003)"}, + ), + bench_value={"flag": "true", "addr": "address(0x4000000000000000000000000000000000000004)"}, + ), + TupleCase( + slug="pair_uint24_int40", + fn_name="echoUint24Int40Pair", + bench_name="benchEchoUint24Int40Pair", + variant_name="EchoUint24Int40Pair", + struct_name="Uint24Int40Pair", + value_name="pair", + fields=( + TupleField("left", TypeSpec( + slug="uint24", + suffix="Uint24", + sol_abi="uint24", + sol_param="uint24", + sol_return="uint24", + sol_local="uint24", + sol_struct_field="uint24", + fe_type="Uint24", + compare_kind="eq", + det_values=("uint24(0)", "type(uint24).max"), + bench_value="uint24(123)", + )), + TupleField("right", TypeSpec( + slug="int40", + suffix="Int40", + sol_abi="int40", + sol_param="int40", + sol_return="int40", + sol_local="int40", + sol_struct_field="int40", + fe_type="Int40", + compare_kind="eq", + det_values=("int40(0)", "type(int40).min", "type(int40).max"), + bench_value="int40(-7)", + )), + ), + det_values=( + {"left": "uint24(0)", "right": "int40(0)"}, + {"left": "type(uint24).max", "right": "type(int40).min"}, + ), + bench_value={"left": "uint24(123)", "right": "int40(-7)"}, + ), + TupleCase( + slug="triple_bool_address_u256", + fn_name="echoBoolAddressU256Triple", + bench_name="benchEchoBoolAddressU256Triple", + variant_name="EchoBoolAddressU256Triple", + struct_name="BoolAddressU256Triple", + value_name="triple", + fields=(TupleField("flag", BOOL), TupleField("addr", ADDRESS), TupleField("count", U256)), + det_values=( + {"flag": "false", "addr": "address(0)", "count": "uint256(0)"}, + {"flag": "true", "addr": "address(0x5000000000000000000000000000000000000005)", "count": "type(uint256).max"}, + ), + bench_value={"flag": "true", "addr": "address(0x6000000000000000000000000000000000000006)", "count": "uint256(123456789)"}, + ), + TupleCase( + slug="triple_string_bool_u64", + fn_name="echoStringBoolU64Triple", + bench_name="benchEchoStringBoolU64Triple", + variant_name="EchoStringBoolU64Triple", + struct_name="StringBoolU64Triple", + value_name="triple", + fields=(TupleField("text", STRING), TupleField("flag", BOOL), TupleField("count", U64)), + det_values=( + {"text": '"hello"', "flag": "false", "count": "uint64(1)"}, + {"text": '"0123456789abcdefghijklmnopqrstuv"', "flag": "true", "count": "type(uint64).max"}, + ), + bench_value={"text": '"bench triple"', "flag": "true", "count": "uint64(77)"}, + ), +] + +def all_fe_custom_types() -> list[str]: + out: set[str] = set() + for case in SCALAR_CASES: + if case.ty.fe_type.startswith(("Uint", "Int")): + out.add(case.ty.fe_type) + for case in TUPLE_CASES: + for field in case.fields: + if field.ty.fe_type.startswith(("Uint", "Int")): + out.add(field.ty.fe_type) + return sorted(out) + + +def fe_tuple_type(case: TupleCase) -> str: + return "(" + ", ".join(field.ty.fe_type for field in case.fields) + ")" + + +def sol_tuple_signature(case: TupleCase) -> str: + return "(" + ",".join(field.ty.sol_abi for field in case.fields) + ")" + + +def tuple_is_dynamic(case: TupleCase) -> bool: + return any(field.ty.is_dynamic for field in case.fields) + + +def struct_literal(case: TupleCase, value: dict[str, str]) -> str: + fields = ", ".join(f"{field.name}: {value[field.name]}" for field in case.fields) + return f"{case.struct_name}({{{fields}}})" + + +def cycle_values(values: tuple[str, ...], count: int, *, offset: int = 0) -> list[str]: + return [values[(offset + idx) % len(values)] for idx in range(count)] + + +def array_literal(values: list[str]) -> str: + return "[" + ", ".join(values) + "]" + + +def matrix_literal(rows: list[list[str]]) -> str: + return "[" + ", ".join(array_literal(row) for row in rows) + "]" + + +def indent_block(block: str, prefix: str = " ") -> list[str]: + return [prefix + line if line else "" for line in block.strip().splitlines()] + + +def scalar_array_case(case: ScalarCase, length: int) -> ArrayCase: + suffix = f"{case.ty.suffix}Array{length}" + bench_values = (case.ty.bench_value, *case.ty.det_values) + return ArrayCase( + slug=f"{case.slug}_array{length}", + fn_name=f"echo{suffix}", + bench_name=f"benchEcho{suffix}", + variant_name=f"Echo{suffix}", + sol_selector_sig=f"{case.ty.sol_abi}[{length}]", + sol_param=f"{case.ty.sol_abi}[{length}] calldata", + sol_return=f"{case.ty.sol_abi}[{length}] memory", + sol_local=f"{case.ty.sol_abi}[{length}] memory", + fe_type=f"[{case.ty.fe_type}; {length}]", + det_values=( + array_literal(cycle_values(case.ty.det_values, length, offset=0)), + array_literal(cycle_values(case.ty.det_values, length, offset=1)), + ), + bench_value=array_literal(cycle_values(bench_values, length, offset=0)), + ) + + +def scalar_matrix_case(case: ScalarCase) -> ArrayCase: + suffix = f"{case.ty.suffix}Matrix2x2" + bench_values = (case.ty.bench_value, *case.ty.det_values) + return ArrayCase( + slug=f"{case.slug}_matrix2x2", + fn_name=f"echo{suffix}", + bench_name=f"benchEcho{suffix}", + variant_name=f"Echo{suffix}", + sol_selector_sig=f"{case.ty.sol_abi}[2][2]", + sol_param=f"{case.ty.sol_abi}[2][2] calldata", + sol_return=f"{case.ty.sol_abi}[2][2] memory", + sol_local=f"{case.ty.sol_abi}[2][2] memory", + fe_type=f"[[{case.ty.fe_type}; 2]; 2]", + det_values=( + matrix_literal( + [ + cycle_values(case.ty.det_values, 2, offset=0), + cycle_values(case.ty.det_values, 2, offset=2), + ] + ), + matrix_literal( + [ + cycle_values(case.ty.det_values, 2, offset=1), + cycle_values(case.ty.det_values, 2, offset=3), + ] + ), + ), + bench_value=matrix_literal( + [ + cycle_values(bench_values, 2, offset=0), + cycle_values(bench_values, 2, offset=2), + ] + ), + ) + + +def tuple_array_case(case: TupleCase, length: int) -> ArrayCase: + bench_values = (case.bench_value, *case.det_values) + return ArrayCase( + slug=f"{case.slug}_array{length}", + fn_name=f"{case.fn_name}Array{length}", + bench_name=f"{case.bench_name}Array{length}", + variant_name=f"{case.variant_name}Array{length}", + sol_selector_sig=f"{sol_tuple_signature(case)}[{length}]", + sol_param=f"{case.struct_name}[{length}] calldata", + sol_return=f"{case.struct_name}[{length}] memory", + sol_local=f"{case.struct_name}[{length}] memory", + fe_type=f"[{fe_tuple_type(case)}; {length}]", + det_values=( + array_literal( + [struct_literal(case, value) for value in cycle_values(case.det_values, length, offset=0)] + ), + array_literal( + [struct_literal(case, value) for value in cycle_values(case.det_values, length, offset=1)] + ), + ), + bench_value=array_literal( + [struct_literal(case, value) for value in cycle_values(bench_values, length, offset=0)] + ), + import_structs=(case.struct_name,), + ) + + +STATIC_SCALAR_CASES = [case for case in SCALAR_CASES if not case.ty.is_dynamic] +STATIC_TUPLE_CASES = [case for case in TUPLE_CASES if not tuple_is_dynamic(case)] +ARRAY_SCALAR_CASES = [ + case + for case in STATIC_SCALAR_CASES + if case.slug + in { + "bool", + "address", + "uint8", + "uint16", + "uint32", + "uint64", + "uint128", + "uint256", + "int8", + "int16", + "int32", + "int64", + "int128", + "int256", + "uint24", + "uint40", + "uint96", + "uint160", + "uint248", + "int24", + "int40", + "int96", + "int160", + "int248", + } +] +MATRIX_SCALAR_CASES = [ + case + for case in STATIC_SCALAR_CASES + if case.slug in {"bool", "address", "uint256", "int256", "uint24", "int40"} +] +DYNAMIC_ARRAY_CASES: list[ArrayCase] = [ + ArrayCase( + slug="string_array2", + fn_name="echoStringArray2", + bench_name="benchEchoStringArray2", + variant_name="EchoStringArray2", + sol_selector_sig="string[2]", + sol_param="string[2] calldata", + sol_return="string[2] memory", + sol_local="string[2] memory", + fe_type="[DynString; 2]", + det_values=( + '["", "hello"]', + '["0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", "roundtrip"]', + ), + bench_value='["bench alpha with extra payload bytes", "bench beta with extra payload bytes"]', + assume_suffixes=("[0]", "[1]"), + ), + ArrayCase( + slug="string_u64_pair_array2", + fn_name="echoStringU64PairArray2", + bench_name="benchEchoStringU64PairArray2", + variant_name="EchoStringU64PairArray2", + sol_selector_sig="(string,uint64)[2]", + sol_param="StringU64Pair[2] calldata", + sol_return="StringU64Pair[2] memory", + sol_local="StringU64Pair[2] memory", + fe_type="[(DynString, u64); 2]", + det_values=( + '[StringU64Pair({text: "pair-one", count: uint64(1)}), StringU64Pair({text: "pair-two", count: uint64(2)})]', + '[StringU64Pair({text: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", count: type(uint64).max}), StringU64Pair({text: "tail", count: uint64(9)})]', + ), + bench_value='[StringU64Pair({text: "bench-one-with-extra-payload", count: uint64(11)}), StringU64Pair({text: "bench-two-with-extra-payload", count: uint64(22)})]', + assume_suffixes=("[0].text", "[1].text"), + import_structs=("StringU64Pair",), + ), +] + +DYNAMIC_LENGTH_ARRAY_CASES: list[ArrayCase] = [ + ArrayCase( + slug="uint_array", + fn_name="echoUintArray", + bench_name="benchEchoUintArray", + variant_name="EchoUintArray", + sol_selector_sig="uint256[]", + sol_param="uint256[] calldata", + sol_return="uint256[] memory", + sol_local="uint256[] memory", + fe_type="DynArray", + det_values=(), + bench_value="", + max_fuzz_len=4, + det_init_blocks=( + """ +uint256[] memory value = new uint256[](0); +""", + """ +uint256[] memory value = new uint256[](3); +value[0] = uint256(0); +value[1] = uint256(1); +value[2] = type(uint256).max; +""", + ), + bench_init_block=""" +uint256[] memory value = new uint256[](3); +value[0] = uint256(77); +value[1] = uint256(1); +value[2] = uint256(0); +""", + ), + ArrayCase( + slug="bool_address_pair_array", + fn_name="echoBoolAddressPairArray", + bench_name="benchEchoBoolAddressPairArray", + variant_name="EchoBoolAddressPairArray", + sol_selector_sig="(bool,address)[]", + sol_param="BoolAddressPair[] calldata", + sol_return="BoolAddressPair[] memory", + sol_local="BoolAddressPair[] memory", + fe_type="DynArray<(bool, Address)>", + det_values=(), + bench_value="", + max_fuzz_len=4, + det_init_blocks=( + """ +BoolAddressPair[] memory value = new BoolAddressPair[](0); +""", + """ +BoolAddressPair[] memory value = new BoolAddressPair[](2); +value[0] = BoolAddressPair({flag: false, addr: address(0)}); +value[1] = BoolAddressPair({flag: true, addr: address(0x3000000000000000000000000000000000000003)}); +""", + ), + bench_init_block=""" +BoolAddressPair[] memory value = new BoolAddressPair[](2); +value[0] = BoolAddressPair({flag: true, addr: address(0x4000000000000000000000000000000000000004)}); +value[1] = BoolAddressPair({flag: false, addr: address(0x5000000000000000000000000000000000000005)}); +""", + import_structs=("BoolAddressPair",), + ), + ArrayCase( + slug="string_array", + fn_name="echoStringArray", + bench_name="benchEchoStringArray", + variant_name="EchoStringArray", + sol_selector_sig="string[]", + sol_param="string[] calldata", + sol_return="string[] memory", + sol_local="string[] memory", + fe_type="DynArray", + det_values=(), + bench_value="", + assume_loop_exprs=("value[i]",), + max_fuzz_len=4, + det_init_blocks=( + """ +string[] memory value = new string[](0); +""", + """ +string[] memory value = new string[](2); +value[0] = ""; +value[1] = "hello dynamic with extra payload bytes"; +""", + """ +string[] memory value = new string[](2); +value[0] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; +value[1] = "tail"; +""", + ), + bench_init_block=""" +string[] memory value = new string[](2); +value[0] = "bench alpha with extra payload bytes"; +value[1] = "bench beta with extra payload bytes"; +""", + ), + ArrayCase( + slug="string_u64_pair_array", + fn_name="echoStringU64PairArray", + bench_name="benchEchoStringU64PairArray", + variant_name="EchoStringU64PairArray", + sol_selector_sig="(string,uint64)[]", + sol_param="StringU64Pair[] calldata", + sol_return="StringU64Pair[] memory", + sol_local="StringU64Pair[] memory", + fe_type="DynArray<(DynString, u64)>", + det_values=(), + bench_value="", + assume_loop_exprs=("value[i].text",), + max_fuzz_len=4, + det_init_blocks=( + """ +StringU64Pair[] memory value = new StringU64Pair[](0); +""", + """ +StringU64Pair[] memory value = new StringU64Pair[](2); +value[0] = StringU64Pair({text: "pair-one", count: uint64(1)}); +value[1] = StringU64Pair({text: "pair-two", count: uint64(2)}); +""", + """ +StringU64Pair[] memory value = new StringU64Pair[](2); +value[0] = StringU64Pair({text: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", count: type(uint64).max}); +value[1] = StringU64Pair({text: "tail", count: uint64(9)}); +""", + ), + bench_init_block=""" +StringU64Pair[] memory value = new StringU64Pair[](2); +value[0] = StringU64Pair({text: "bench-one-with-extra-payload", count: uint64(11)}); +value[1] = StringU64Pair({text: "bench-two-with-extra-payload", count: uint64(22)}); +""", + import_structs=("StringU64Pair",), + ), +] + + +ARRAY_CASES: list[ArrayCase] = [ + *(scalar_array_case(case, 4) for case in ARRAY_SCALAR_CASES), + *(scalar_matrix_case(case) for case in MATRIX_SCALAR_CASES), + *(tuple_array_case(case, 4) for case in STATIC_TUPLE_CASES), + *DYNAMIC_ARRAY_CASES, + *DYNAMIC_LENGTH_ARRAY_CASES, +] + + +def tuple_return_signature(case: TupleCase) -> str: + return f"{case.struct_name} memory" + + +def tuple_local_signature(case: TupleCase) -> str: + return f"{case.struct_name} memory" + + +def tuple_return_expr(case: TupleCase) -> str: + return "value" + + +def tuple_binding_decls(prefix: str, case: TupleCase) -> str: + return ", ".join( + f"{field.ty.sol_local} {prefix}{slug_to_pascal(field.name)}" + for field in case.fields + ) + + +def render_fe() -> str: + imports = all_fe_custom_types() + lines: list[str] = ["use std::abi::{sol, DynArray, DynString}"] + if imports: + joined = ", ".join(imports) + lines.append(f"use std::abi::sol::{{{joined}}}") + lines.append("use std::evm::Address") + lines.append("") + lines.append("msg AbiRoundtripMsg {") + for case in SCALAR_CASES: + lines.append(f' #[selector = sol("{case.fn_name}({case.ty.sol_abi})")]') + lines.append(f" {case.variant_name} {{ value: {case.ty.fe_type} }} -> {case.ty.fe_type},") + for case in ARRAY_CASES: + lines.append(f' #[selector = sol("{case.fn_name}({case.sol_selector_sig})")]') + lines.append(f" {case.variant_name} {{ value: {case.fe_type} }} -> {case.fe_type},") + for case in TUPLE_CASES: + lines.append(f' #[selector = sol("{case.fn_name}({sol_tuple_signature(case)})")]') + lines.append(f" {case.variant_name} {{ value: {fe_tuple_type(case)} }} -> {fe_tuple_type(case)},") + lines.append("}") + lines.append("") + lines.append("pub contract AbiRoundtripFe {") + lines.append(" recv AbiRoundtripMsg {") + for case in SCALAR_CASES: + lines.append(f" {case.variant_name} {{ value }} -> {case.ty.fe_type} {{") + lines.append(" value") + lines.append(" }") + lines.append("") + for case in ARRAY_CASES: + lines.append(f" {case.variant_name} {{ value }} -> {case.fe_type} {{") + lines.append(" value") + lines.append(" }") + lines.append("") + for case in TUPLE_CASES: + lines.append(f" {case.variant_name} {{ value }} -> {fe_tuple_type(case)} {{") + lines.append(" value") + lines.append(" }") + lines.append("") + if lines[-1] == "": + lines.pop() + lines.append(" }") + lines.append("}") + lines.append("") + return "\n".join(lines) + + +def render_sol() -> str: + lines: list[str] = ["// SPDX-License-Identifier: UNLICENSED", "pragma solidity ^0.8.24;", ""] + for case in TUPLE_CASES: + lines.append(f"struct {case.struct_name} {{") + for field in case.fields: + lines.append(f" {field.ty.sol_struct_field} {field.name};") + lines.append("}") + lines.append("") + lines.append("interface IAbiRoundtrip {") + for case in SCALAR_CASES: + lines.append( + f" function {case.fn_name}({case.ty.sol_param} value) external returns ({case.ty.sol_return});" + ) + for case in ARRAY_CASES: + lines.append( + f" function {case.fn_name}({case.sol_param} value) external returns ({case.sol_return});" + ) + for case in TUPLE_CASES: + lines.append( + f" function {case.fn_name}({case.struct_name} calldata value) external returns ({tuple_return_signature(case)});" + ) + lines.append("}") + lines.append("") + lines.append("contract AbiRoundtripSol is IAbiRoundtrip {") + for case in SCALAR_CASES: + lines.append( + f" function {case.fn_name}({case.ty.sol_param} value) external pure returns ({case.ty.sol_return}) {{" + ) + lines.append(" return value;") + lines.append(" }") + lines.append("") + for case in ARRAY_CASES: + lines.append( + f" function {case.fn_name}({case.sol_param} value) external pure returns ({case.sol_return}) {{" + ) + lines.append(" return value;") + lines.append(" }") + lines.append("") + for case in TUPLE_CASES: + lines.append( + f" function {case.fn_name}({case.struct_name} calldata value) external pure returns ({tuple_return_signature(case)}) {{" + ) + lines.append(f" return {tuple_return_expr(case)};") + lines.append(" }") + lines.append("") + if lines[-1] == "": + lines.pop() + lines.append("}") + lines.append("") + for contract_name in ("SolBenchCaller", "FeBenchCaller"): + lines.append(f"contract {contract_name} {{") + lines.append(" IAbiRoundtrip public immutable target;") + lines.append("") + lines.append(" constructor(address target_) {") + lines.append(" target = IAbiRoundtrip(target_);") + lines.append(" }") + lines.append("") + for case in SCALAR_CASES: + lines.append( + f" function {case.bench_name}({case.ty.sol_param} value) external returns ({case.ty.sol_return}) {{" + ) + lines.append(f" return target.{case.fn_name}(value);") + lines.append(" }") + lines.append("") + for case in ARRAY_CASES: + lines.append( + f" function {case.bench_name}({case.sol_param} value) external returns ({case.sol_return}) {{" + ) + lines.append(f" return target.{case.fn_name}(value);") + lines.append(" }") + lines.append("") + for case in TUPLE_CASES: + lines.append( + f" function {case.bench_name}({case.struct_name} calldata value) external returns ({tuple_return_signature(case)}) {{" + ) + lines.append(f" return target.{case.fn_name}(value);") + lines.append(" }") + lines.append("") + if lines[-1] == "": + lines.pop() + lines.append("}") + lines.append("") + return "\n".join(lines) + + +def render_base() -> str: + return """// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripSol, FeBenchCaller, SolBenchCaller} from "../../../src/AbiRoundtripSol.sol"; + +interface Vm { + function readFile(string calldata path) external returns (string memory); + function assume(bool condition) external; +} + +abstract contract AbiRoundtripBase { + Vm constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); + + AbiRoundtripSol internal solTarget; + address internal feTarget; + SolBenchCaller internal solBench; + FeBenchCaller internal feBench; + + function setUp() public virtual { + solTarget = new AbiRoundtripSol(); + feTarget = deploy(fromHex(vm.readFile("fe-out/AbiRoundtripFe.bin"))); + require(feTarget != address(0), "fe create failed"); + + solBench = new SolBenchCaller(address(solTarget)); + feBench = new FeBenchCaller(feTarget); + } + + function assertEquivalent(bytes memory callData) internal { + (bool okSol, bytes memory outSol) = address(solTarget).call(callData); + (bool okFe, bytes memory outFe) = feTarget.call(callData); + + require(okSol == okFe, "success mismatch"); + require(okSol, "call failed"); + require(keccak256(outSol) == keccak256(outFe), "return bytes mismatch"); + } + + function assumeShortString(string memory text) internal { + vm.assume(bytes(text).length <= 96); + } + + function deploy(bytes memory initCode) internal returns (address deployed) { + assembly { + deployed := create(0, add(initCode, 0x20), mload(initCode)) + } + } + + function fromHex(string memory s) internal pure returns (bytes memory) { + bytes memory strBytes = bytes(s); + uint256 start = 0; + while (start < strBytes.length && isWhitespace(strBytes[start])) { + start++; + } + + if ( + start + 1 < strBytes.length && + strBytes[start] == bytes1("0") && + (strBytes[start + 1] == bytes1("x") || strBytes[start + 1] == bytes1("X")) + ) { + start += 2; + } + + uint256 digits = 0; + for (uint256 i = start; i < strBytes.length; i++) { + if (isWhitespace(strBytes[i])) continue; + digits++; + } + require(digits % 2 == 0, "odd hex length"); + + bytes memory out = new bytes(digits / 2); + uint256 outIndex = 0; + uint8 high = 0; + bool highNibble = true; + for (uint256 i = start; i < strBytes.length; i++) { + bytes1 ch = strBytes[i]; + if (isWhitespace(ch)) continue; + uint8 val = fromHexChar(ch); + if (highNibble) { + high = val; + highNibble = false; + } else { + out[outIndex] = bytes1((high << 4) | val); + outIndex++; + highNibble = true; + } + } + return out; + } + + function isWhitespace(bytes1 ch) private pure returns (bool) { + return ch == 0x20 || ch == 0x0a || ch == 0x0d || ch == 0x09; + } + + function fromHexChar(bytes1 c) private pure returns (uint8) { + uint8 b = uint8(c); + if (b >= 48 && b <= 57) return b - 48; + if (b >= 65 && b <= 70) return b - 55; + if (b >= 97 && b <= 102) return b - 87; + revert("invalid hex"); + } +} +""" + + +def slug_to_pascal(slug: str) -> str: + return "".join(part.capitalize() for part in slug.split("_")) + + +def tuple_imports(case: TupleCase) -> str: + return f"IAbiRoundtrip, {case.struct_name}" + + +def array_imports(case: ArrayCase) -> str: + imports = ["IAbiRoundtrip", *case.import_structs] + return ", ".join(imports) + + +def render_array_deterministic(case: ArrayCase) -> str: + class_name = f"Abi{slug_to_pascal(case.slug)}DeterministicTest" + lines = [ + "// SPDX-License-Identifier: UNLICENSED", + "pragma solidity ^0.8.24;", + "", + 'import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol";', + f'import {{{array_imports(case)}}} from "../../../src/AbiRoundtripSol.sol";', + "", + f"contract {class_name} is AbiRoundtripBase {{", + ] + setups = case.det_init_blocks or case.det_values + for idx, value in enumerate(setups): + lines.append(f" function test{case.variant_name}Deterministic{idx}() public {{") + if case.det_init_blocks: + lines.extend(indent_block(value)) + else: + lines.append(f" {case.sol_local} value = {value};") + lines.append( + f" bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.{case.fn_name}.selector, value);" + ) + lines.append(" assertEquivalent(callData);") + lines.append(" }") + lines.append("") + if lines[-1] == "": + lines.pop() + lines.append("}") + lines.append("") + return "\n".join(lines) + + +def render_array_fuzz(case: ArrayCase) -> str: + class_name = f"Abi{slug_to_pascal(case.slug)}FuzzTest" + lines = [ + "// SPDX-License-Identifier: UNLICENSED", + "pragma solidity ^0.8.24;", + "", + 'import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol";', + f'import {{{array_imports(case)}}} from "../../../src/AbiRoundtripSol.sol";', + "", + f"contract {class_name} is AbiRoundtripBase {{", + f" function test{case.variant_name}Fuzz({case.sol_local} value) public {{", + ] + if case.max_fuzz_len is not None: + lines.append(f" vm.assume(value.length <= {case.max_fuzz_len});") + for suffix in case.assume_suffixes: + lines.append(f" assumeShortString(value{suffix});") + if case.assume_loop_exprs: + lines.append(" for (uint256 i = 0; i < value.length; i++) {") + for expr in case.assume_loop_exprs: + lines.append(f" assumeShortString({expr});") + lines.append(" }") + lines.append( + f" bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.{case.fn_name}.selector, value);" + ) + lines.append(" assertEquivalent(callData);") + lines.append(" }") + lines.append("}") + lines.append("") + return "\n".join(lines) + + +def render_array_bench(case: ArrayCase) -> str: + class_name = f"Abi{slug_to_pascal(case.slug)}BenchTest" + lines = [ + "// SPDX-License-Identifier: UNLICENSED", + "pragma solidity ^0.8.24;", + "", + 'import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol";', + ] + if case.import_structs: + lines.append( + f'import {{{", ".join(case.import_structs)}}} from "../../../src/AbiRoundtripSol.sol";' + ) + lines.extend( + [ + "", + f"contract {class_name} is AbiRoundtripBase {{", + f" function test{case.bench_name[0].upper()}{case.bench_name[1:]}() public {{", + ] + ) + if case.bench_init_block: + lines.extend(indent_block(case.bench_init_block)) + else: + lines.append(f" {case.sol_local} value = {case.bench_value};") + for suffix in case.assume_suffixes: + lines.append(f" assumeShortString(value{suffix});") + if case.assume_loop_exprs: + lines.append(" for (uint256 i = 0; i < value.length; i++) {") + for expr in case.assume_loop_exprs: + lines.append(f" assumeShortString({expr});") + lines.append(" }") + lines.append(f" {case.sol_local} solValue = solBench.{case.bench_name}(value);") + lines.append( + ' require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value");' + ) + lines.append(f" {case.sol_local} feValue = feBench.{case.bench_name}(value);") + lines.append( + ' require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value");' + ) + lines.append(" }") + lines.append("}") + lines.append("") + return "\n".join(lines) + + +def render_scalar_deterministic(case: ScalarCase) -> str: + class_name = f"Abi{slug_to_pascal(case.slug)}DeterministicTest" + lines = [ + "// SPDX-License-Identifier: UNLICENSED", + "pragma solidity ^0.8.24;", + "", + 'import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol";', + 'import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol";', + "", + f"contract {class_name} is AbiRoundtripBase {{", + ] + for idx, value in enumerate(case.ty.det_values): + lines.append(f" function test{case.variant_name}Deterministic{idx}() public {{") + lines.append(f" {case.ty.sol_local} value = {value};") + lines.append( + f" bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.{case.fn_name}.selector, value);" + ) + lines.append(" assertEquivalent(callData);") + lines.append(" }") + lines.append("") + if lines[-1] == "": + lines.pop() + lines.append("}") + lines.append("") + return "\n".join(lines) + + +def render_scalar_fuzz(case: ScalarCase) -> str: + class_name = f"Abi{slug_to_pascal(case.slug)}FuzzTest" + lines = [ + "// SPDX-License-Identifier: UNLICENSED", + "pragma solidity ^0.8.24;", + "", + 'import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol";', + 'import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol";', + "", + f"contract {class_name} is AbiRoundtripBase {{", + f" function test{case.variant_name}Fuzz({case.ty.sol_local} value) public {{", + ] + if case.ty.assume_short_string: + lines.append(" assumeShortString(value);") + lines.append( + f" bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.{case.fn_name}.selector, value);" + ) + lines.append(" assertEquivalent(callData);") + lines.append(" }") + lines.append("}") + lines.append("") + return "\n".join(lines) + + +def render_scalar_bench(case: ScalarCase) -> str: + class_name = f"Abi{slug_to_pascal(case.slug)}BenchTest" + lines = [ + "// SPDX-License-Identifier: UNLICENSED", + "pragma solidity ^0.8.24;", + "", + 'import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol";', + "", + f"contract {class_name} is AbiRoundtripBase {{", + f" function test{case.bench_name[0].upper()}{case.bench_name[1:]}() public {{", + f" {case.ty.sol_local} value = {case.ty.bench_value};", + ] + if case.ty.assume_short_string: + lines.append(" assumeShortString(value);") + if case.ty.compare_kind == "string": + lines.append(f" string memory solValue = solBench.{case.bench_name}(value);") + lines.append( + ' require(keccak256(bytes(solValue)) == keccak256(bytes(value)), "sol value");' + ) + lines.append(f" string memory feValue = feBench.{case.bench_name}(value);") + lines.append( + ' require(keccak256(bytes(feValue)) == keccak256(bytes(value)), "fe value");' + ) + else: + lines.append( + f" require(solBench.{case.bench_name}(value) == value, \"sol value\");" + ) + lines.append( + f" require(feBench.{case.bench_name}(value) == value, \"fe value\");" + ) + lines.append(" }") + lines.append("}") + lines.append("") + return "\n".join(lines) + +def tuple_assumptions(case: TupleCase, names: dict[str, str]) -> list[str]: + out: list[str] = [] + for field in case.fields: + if field.ty.assume_short_string: + out.append(f" assumeShortString({names[field.name]});") + return out + + +def tuple_compare(prefix: str, actual_prefix: str, case: TupleCase) -> list[str]: + lines: list[str] = [] + for idx, field in enumerate(case.fields): + actual_name = f"{actual_prefix}{slug_to_pascal(field.name)}" + expected = f"{prefix}.{field.name}" + if field.ty.compare_kind == "string": + lines.append( + f' require(keccak256(bytes({actual_name})) == keccak256(bytes({expected})), "{actual_prefix.lower()} {field.name}");' + ) + else: + lines.append(f' require({actual_name} == {expected}, "{actual_prefix.lower()} {field.name}");') + return lines + + +def render_tuple_deterministic(case: TupleCase) -> str: + class_name = f"Abi{slug_to_pascal(case.slug)}DeterministicTest" + lines = [ + "// SPDX-License-Identifier: UNLICENSED", + "pragma solidity ^0.8.24;", + "", + 'import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol";', + f'import {{{tuple_imports(case)}}} from "../../../src/AbiRoundtripSol.sol";', + "", + f"contract {class_name} is AbiRoundtripBase {{", + ] + for idx, value in enumerate(case.det_values): + lines.append(f" function test{case.variant_name}Deterministic{idx}() public {{") + lines.append(f" {case.struct_name} memory value = {struct_literal(case, value)};") + lines.append( + f" bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.{case.fn_name}.selector, value);" + ) + lines.append(" assertEquivalent(callData);") + lines.append(" }") + lines.append("") + if lines[-1] == "": + lines.pop() + lines.append("}") + lines.append("") + return "\n".join(lines) + + +def render_tuple_fuzz(case: TupleCase) -> str: + class_name = f"Abi{slug_to_pascal(case.slug)}FuzzTest" + params = ", ".join(f"{field.ty.sol_local} {field.name}" for field in case.fields) + names = {field.name: field.name for field in case.fields} + lines = [ + "// SPDX-License-Identifier: UNLICENSED", + "pragma solidity ^0.8.24;", + "", + 'import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol";', + f'import {{{tuple_imports(case)}}} from "../../../src/AbiRoundtripSol.sol";', + "", + f"contract {class_name} is AbiRoundtripBase {{", + f" function test{case.variant_name}Fuzz({params}) public {{", + ] + lines.extend(tuple_assumptions(case, names)) + lines.append(f" {case.struct_name} memory value = {struct_literal(case, names)};") + lines.append( + f" bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.{case.fn_name}.selector, value);" + ) + lines.append(" assertEquivalent(callData);") + lines.append(" }") + lines.append("}") + lines.append("") + return "\n".join(lines) + + +def render_tuple_bench(case: TupleCase) -> str: + class_name = f"Abi{slug_to_pascal(case.slug)}BenchTest" + lines = [ + "// SPDX-License-Identifier: UNLICENSED", + "pragma solidity ^0.8.24;", + "", + 'import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol";', + f'import {{{case.struct_name}}} from "../../../src/AbiRoundtripSol.sol";', + "", + f"contract {class_name} is AbiRoundtripBase {{", + f" function test{case.bench_name[0].upper()}{case.bench_name[1:]}() public {{", + f" {case.struct_name} memory value = {struct_literal(case, case.bench_value)};", + ] + for field in case.fields: + if field.ty.assume_short_string: + lines.append(f" assumeShortString(value.{field.name});") + lines.append(f" {case.struct_name} memory solValue = solBench.{case.bench_name}(value);") + lines.append( + ' require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value");' + ) + lines.append(f" {case.struct_name} memory feValue = feBench.{case.bench_name}(value);") + lines.append( + ' require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value");' + ) + lines.append(" }") + lines.append("}") + lines.append("") + return "\n".join(lines) + + +def write(path: Path, content: str) -> None: + path.parent.mkdir(parents=True, exist_ok=True) + path.write_text(content, encoding="utf-8") + + +def main() -> None: + if GENERATED_ROOT.exists(): + shutil.rmtree(GENERATED_ROOT) + + SUPPORT_DIR.mkdir(parents=True, exist_ok=True) + DETERMINISTIC_DIR.mkdir(parents=True, exist_ok=True) + FUZZ_DIR.mkdir(parents=True, exist_ok=True) + BENCH_DIR.mkdir(parents=True, exist_ok=True) + + write(FE_PATH, render_fe()) + write(SOL_PATH, render_sol()) + write(SUPPORT_DIR / "AbiRoundtripBase.sol", render_base()) + + for case in SCALAR_CASES: + pascal = slug_to_pascal(case.slug) + write(DETERMINISTIC_DIR / f"Abi{pascal}Deterministic.t.sol", render_scalar_deterministic(case)) + write(FUZZ_DIR / f"Abi{pascal}Fuzz.t.sol", render_scalar_fuzz(case)) + write(BENCH_DIR / f"Abi{pascal}Bench.t.sol", render_scalar_bench(case)) + + for case in ARRAY_CASES: + pascal = slug_to_pascal(case.slug) + write(DETERMINISTIC_DIR / f"Abi{pascal}Deterministic.t.sol", render_array_deterministic(case)) + write(FUZZ_DIR / f"Abi{pascal}Fuzz.t.sol", render_array_fuzz(case)) + write(BENCH_DIR / f"Abi{pascal}Bench.t.sol", render_array_bench(case)) + + for case in TUPLE_CASES: + pascal = slug_to_pascal(case.slug) + write(DETERMINISTIC_DIR / f"Abi{pascal}Deterministic.t.sol", render_tuple_deterministic(case)) + write(FUZZ_DIR / f"Abi{pascal}Fuzz.t.sol", render_tuple_fuzz(case)) + write(BENCH_DIR / f"Abi{pascal}Bench.t.sol", render_tuple_bench(case)) + + generated_count = len(list(GENERATED_ROOT.rglob("*.t.sol"))) + print(f"Generated {generated_count} test files across {len(SCALAR_CASES) + len(ARRAY_CASES) + len(TUPLE_CASES)} ABI cases.") + + +if __name__ == "__main__": + main() diff --git a/benchmarks/foundry-abi/scripts/run_gas_report.py b/benchmarks/foundry-abi/scripts/run_gas_report.py new file mode 100644 index 0000000000..cfc1aa0523 --- /dev/null +++ b/benchmarks/foundry-abi/scripts/run_gas_report.py @@ -0,0 +1,275 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import csv +import re +import statistics +import subprocess +import sys +from collections import defaultdict +from datetime import datetime, timezone +from pathlib import Path + + +ROOT = Path(__file__).resolve().parents[1] +REPORT_DIR = ROOT / "reports" +RAW_REPORT = REPORT_DIR / "gas-report.txt" +CSV_REPORT = REPORT_DIR / "gas-deltas.csv" +MD_REPORT = REPORT_DIR / "gas-summary.md" + +COMMAND = ["forge", "test", "--root", str(ROOT), "--offline", "--gas-report"] + + +def run_gas_report() -> str: + proc = subprocess.run(COMMAND, capture_output=True, text=True) + output = proc.stdout + if proc.stderr: + output = f"{output}\n{proc.stderr}" if output else proc.stderr + print(output, end="") + if proc.returncode != 0: + raise SystemExit(proc.returncode) + return output + + +def parse_contract_tables(text: str) -> dict[str, dict[str, int]]: + contract_tables: dict[str, dict[str, int]] = defaultdict(dict) + current_contract: str | None = None + in_function_table = False + + for raw_line in text.splitlines(): + line = raw_line.strip() + if not line.startswith("|"): + continue + + cols = [part.strip() for part in line.strip("|").split("|")] + if cols and cols[0].endswith("Contract"): + current_contract = cols[0] + in_function_table = False + continue + + if cols and cols[0] == "Function Name": + in_function_table = True + continue + + if not in_function_table or current_contract is None: + continue + + if len(cols) != 6: + continue + + name = cols[0] + if not name or name == "Deployment Cost" or name.startswith("-"): + continue + + try: + avg = int(cols[2]) + except ValueError: + continue + + contract_tables[current_contract][name] = avg + + return contract_tables + + +def function_width(name: str) -> int: + match = re.search(r"(Uint|Int)(\d+)$", name) + if match: + return int(match.group(2)) + if name.endswith("Uint"): + return 256 + if name.endswith("Int256"): + return 256 + return 0 + + +def classify_bench_function(name: str) -> str: + if "Matrix2x2" in name: + return "nested-fixed-array" + if "Array" in name: + if "Pair" in name or "Triple" in name: + if "String" in name: + return "tuple-fixed-array-dynamic" + return "tuple-fixed-array" + if "String" in name: + return "dynamic-fixed-array" + return "fixed-array" + if "Pair" in name or "Triple" in name: + if name == "benchEchoPair" or "String" in name: + return "tuple-dynamic" + return "tuple-static" + if name == "benchEchoString": + return "dynamic-string" + if name == "benchEchoBool": + return "scalar-bool" + if name == "benchEchoAddress": + return "scalar-address" + if name.startswith("benchEchoUint"): + width = function_width(name) + if width in {8, 16, 32, 64, 128, 256}: + return "native-unsigned" + return "custom-unsigned" + if name.startswith("benchEchoInt"): + width = function_width(name) + if width in {8, 16, 32, 64, 128, 256}: + return "native-signed" + return "custom-signed" + return "other" + + +def suite_summary(text: str) -> str: + match = re.search( + r"Ran\s+(\d+)\s+test suites?.*?:\s+(\d+)\s+tests passed,\s+(\d+)\s+failed,\s+(\d+)\s+skipped", + text, + re.DOTALL, + ) + if not match: + return "Suite summary not parsed." + suites, passed, failed, skipped = match.groups() + return f"{suites} suites, {passed} passed, {failed} failed, {skipped} skipped" + + +def write_reports(text: str) -> None: + REPORT_DIR.mkdir(parents=True, exist_ok=True) + RAW_REPORT.write_text(text, encoding="utf-8") + + tables = parse_contract_tables(text) + sol_rows = tables.get("src/AbiRoundtripSol.sol:SolBenchCaller Contract", {}) + fe_rows = tables.get("src/AbiRoundtripSol.sol:FeBenchCaller Contract", {}) + + records: list[dict[str, object]] = [] + for fn_name in sorted(set(sol_rows) & set(fe_rows)): + sol_avg = sol_rows[fn_name] + fe_avg = fe_rows[fn_name] + delta = fe_avg - sol_avg + pct = (delta / sol_avg * 100.0) if sol_avg else 0.0 + records.append( + { + "function": fn_name, + "category": classify_bench_function(fn_name), + "sol_avg": sol_avg, + "fe_avg": fe_avg, + "delta": delta, + "delta_pct": pct, + } + ) + + with CSV_REPORT.open("w", newline="", encoding="utf-8") as csv_file: + writer = csv.DictWriter( + csv_file, + fieldnames=["function", "category", "sol_avg", "fe_avg", "delta", "delta_pct"], + ) + writer.writeheader() + writer.writerows(records) + + deltas = [int(row["delta"]) for row in records] + avg_delta = statistics.mean(deltas) if deltas else 0.0 + median_delta = statistics.median(deltas) if deltas else 0.0 + + category_rows: dict[str, list[dict[str, object]]] = defaultdict(list) + for row in records: + category_rows[str(row["category"])].append(row) + + regressions = sorted(records, key=lambda row: int(row["delta"]), reverse=True)[:15] + improvements = sorted(records, key=lambda row: int(row["delta"]))[:15] + + lines: list[str] = [ + "# ABI Gas Summary", + "", + f"Generated: {datetime.now(timezone.utc).isoformat()}", + "", + f"Suite summary: {suite_summary(text)}", + "", + f"Raw report: `{RAW_REPORT.relative_to(ROOT)}`", + "", + f"CSV: `{CSV_REPORT.relative_to(ROOT)}`", + "", + "## Overall", + "", + f"- Bench functions compared: {len(records)}", + f"- Mean Fe minus Solidity delta: {avg_delta:.2f} gas", + f"- Median Fe minus Solidity delta: {median_delta:.2f} gas", + ] + + if records: + best = min(records, key=lambda row: int(row["delta"])) + worst = max(records, key=lambda row: int(row["delta"])) + lines.append( + f"- Best delta: `{best['function']}` = {best['delta']} gas ({best['delta_pct']:.2f}%)" + ) + lines.append( + f"- Worst delta: `{worst['function']}` = {worst['delta']} gas ({worst['delta_pct']:.2f}%)" + ) + + category_stats: list[tuple[str, int, float, float, int, int]] = [] + for category, rows in category_rows.items(): + category_deltas = [int(row["delta"]) for row in rows] + category_stats.append( + ( + category, + len(rows), + statistics.mean(category_deltas), + statistics.median(category_deltas), + min(category_deltas), + max(category_deltas), + ) + ) + category_stats.sort(key=lambda item: item[2], reverse=True) + + lines.extend( + [ + "", + "## By Category", + "", + "| Category | Functions | Mean Delta | Median Delta | Best | Worst |", + "| --- | ---: | ---: | ---: | ---: | ---: |", + ] + ) + for category, count, mean_delta, median_delta, best_delta, worst_delta in category_stats: + lines.append( + f"| `{category}` | {count} | {mean_delta:.2f} | {median_delta:.2f} | {best_delta} | {worst_delta} |" + ) + + if category_stats: + hottest = category_stats[0] + coolest = min(category_stats, key=lambda item: item[2]) + lines.extend( + [ + "", + "## Notable Patterns", + "", + f"- Highest mean regression category: `{hottest[0]}` at {hottest[2]:.2f} gas across {hottest[1]} functions.", + f"- Lowest mean regression category: `{coolest[0]}` at {coolest[2]:.2f} gas across {coolest[1]} functions.", + ] + ) + + def append_table(title: str, rows: list[dict[str, object]]) -> None: + lines.extend( + [ + "", + f"## {title}", + "", + "| Function | Solidity Avg | Fe Avg | Delta | Delta % |", + "| --- | ---: | ---: | ---: | ---: |", + ] + ) + for row in rows: + lines.append( + f"| `{row['function']}` | {row['sol_avg']} | {row['fe_avg']} | {row['delta']} | {row['delta_pct']:.2f}% |" + ) + + append_table("Largest Regressions", regressions) + append_table("Largest Improvements", improvements) + + MD_REPORT.write_text("\n".join(lines) + "\n", encoding="utf-8") + + +def main() -> None: + text = run_gas_report() + write_reports(text) + print(f"\nWrote {RAW_REPORT}") + print(f"Wrote {CSV_REPORT}") + print(f"Wrote {MD_REPORT}") + + +if __name__ == "__main__": + main() diff --git a/benchmarks/foundry-abi/scripts/run_hevm_curated_matrix.sh b/benchmarks/foundry-abi/scripts/run_hevm_curated_matrix.sh new file mode 100755 index 0000000000..1d7aeb5bd4 --- /dev/null +++ b/benchmarks/foundry-abi/scripts/run_hevm_curated_matrix.sh @@ -0,0 +1,295 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" +HELPER="$ROOT_DIR/benchmarks/foundry-abi/scripts/run_hevm_equivalence.sh" +REPORT_PATH="${1:-$ROOT_DIR/benchmarks/foundry-abi/reports/hevm-equivalence-status.md}" +ADJACENT_HEVM_BIN="$ROOT_DIR/../hevm/local/bin" + +if [ -d "$ADJACENT_HEVM_BIN" ]; then + PATH="$ADJACENT_HEVM_BIN:$PATH" +fi + +TMP_DIR="$(mktemp -d)" +trap 'rm -rf "$TMP_DIR"' EXIT + +PASS_FILE="$TMP_DIR/pass.txt" +UNSUPPORTED_FILE="$TMP_DIR/unsupported.txt" +PARTIAL_FILE="$TMP_DIR/partial.txt" +SUSPECT_FILE="$TMP_DIR/suspect.txt" +FAIL_FILE="$TMP_DIR/fail.txt" + +: > "$PASS_FILE" +: > "$UNSUPPORTED_FILE" +: > "$PARTIAL_FILE" +: > "$SUSPECT_FILE" +: > "$FAIL_FILE" + +pass_count=0 +unsupported_count=0 +partial_count=0 +suspect_count=0 +fail_count=0 + +run_case() { + local category="$1" + local fe_runtime="$2" + local sol_artifact="$3" + local signature="$4" + local timeout_secs="$5" + shift 5 + + local out_file + out_file="$(mktemp "$TMP_DIR/case.XXXXXX")" + + set +e + timeout "${timeout_secs}s" "$HELPER" "$fe_runtime" "$sol_artifact" "$signature" "$@" >"$out_file" 2>&1 + local status=$? + set -e + + local line="- \`$category\`: \`$signature\`" + + if grep -q '\[PASS\]' "$out_file"; then + printf '%s\n' "$line" >> "$PASS_FILE" + pass_count=$((pass_count + 1)) + return + fi + + if grep -q 'TODO: symbolic abi encoding' "$out_file" || grep -q 'unable to parse function signature' "$out_file" || grep -q 'unable to parse solc output' "$out_file" || grep -q 'ParserError:' "$out_file"; then + printf '%s\n' "$line" >> "$UNSUPPORTED_FILE" + unsupported_count=$((unsupported_count + 1)) + return + fi + + if [ "$status" -eq 124 ] || grep -q 'partially explore' "$out_file" || grep -q 'Max iterations reached' "$out_file"; then + printf '%s\n' "$line" >> "$PARTIAL_FILE" + partial_count=$((partial_count + 1)) + return + fi + + if grep -q 'Calldata:' "$out_file" && grep -q '0x00' "$out_file"; then + printf '%s\n' "$line" >> "$SUSPECT_FILE" + suspect_count=$((suspect_count + 1)) + return + fi + + printf '%s\n' "$line" >> "$FAIL_FILE" + fail_count=$((fail_count + 1)) +} + +mapfile -t scalar_sigs < <( + rg -o 'sol\("[^"]+"\)' "$ROOT_DIR/benchmarks/foundry-abi/fe/AbiRoundtrip.fe" \ + | sed 's/.*sol("//; s/").*//' \ + | grep -v '\[' \ + | grep -v 'string' \ + | grep -v 'bytes' \ + | grep -v 'Pair' \ + | grep -v 'Triple' +) + +for sig in "${scalar_sigs[@]}"; do + run_case \ + "AbiRoundtrip scalars" \ + "$ROOT_DIR/benchmarks/foundry-abi/fe-out/AbiRoundtripFe.runtime.bin" \ + "$ROOT_DIR/benchmarks/foundry-abi/out/AbiRoundtripSol.sol/AbiRoundtripSol.json" \ + "$sig" \ + 30 \ + --solver z3 --smttimeout 30 --max-iterations 8 +done + +run_case \ + "FixedArraySuite static" \ + "$ROOT_DIR/benchmarks/foundry-abi/fe-out/FixedArraySuite.runtime.bin" \ + "$ROOT_DIR/benchmarks/foundry-abi/out/FixedArraySuiteSol.sol/FixedArraySuiteSol.json" \ + 'echoUintArray8(uint256[8] calldata)' \ + 60 \ + --solver z3 --smttimeout 30 --max-iterations 32 + +run_case \ + "FixedArraySuite static" \ + "$ROOT_DIR/benchmarks/foundry-abi/fe-out/FixedArraySuite.runtime.bin" \ + "$ROOT_DIR/benchmarks/foundry-abi/out/FixedArraySuiteSol.sol/FixedArraySuiteSol.json" \ + 'echoUintArray16(uint256[16] calldata)' \ + 60 \ + --solver z3 --smttimeout 30 --max-iterations 64 + +run_case \ + "FixedArraySuite static" \ + "$ROOT_DIR/benchmarks/foundry-abi/fe-out/FixedArraySuite.runtime.bin" \ + "$ROOT_DIR/benchmarks/foundry-abi/out/FixedArraySuiteSol.sol/FixedArraySuiteSol.json" \ + 'echoUintArray32(uint256[32] calldata)' \ + 120 \ + --solver z3 --smttimeout 30 --max-iterations 64 + +run_case \ + "FixedArraySuite static" \ + "$ROOT_DIR/benchmarks/foundry-abi/fe-out/FixedArraySuite.runtime.bin" \ + "$ROOT_DIR/benchmarks/foundry-abi/out/FixedArraySuiteSol.sol/FixedArraySuiteSol.json" \ + 'echoNestedUintArray2x5(uint256[5][2] calldata)' \ + 120 \ + --solver z3 --smttimeout 30 --max-iterations 64 + +run_case \ + "FixedArraySuite bool bug" \ + "$ROOT_DIR/benchmarks/foundry-abi/fe-out/FixedArraySuite.runtime.bin" \ + "$ROOT_DIR/benchmarks/foundry-abi/out/FixedArraySuiteSol.sol/FixedArraySuiteSol.json" \ + 'echoBoolArray5(bool[5] calldata)' \ + 30 \ + --solver z3 --smttimeout 30 --max-iterations 32 + +run_case \ + "FixedArraySuite bool timeout" \ + "$ROOT_DIR/benchmarks/foundry-abi/fe-out/FixedArraySuite.runtime.bin" \ + "$ROOT_DIR/benchmarks/foundry-abi/out/FixedArraySuiteSol.sol/FixedArraySuiteSol.json" \ + 'echoBoolArray17(bool[17] calldata)' \ + 60 \ + --solver z3 --smttimeout 30 --max-iterations 96 + +run_case \ + "AbiRoundtrip dynamic" \ + "$ROOT_DIR/benchmarks/foundry-abi/fe-out/AbiRoundtripFe.runtime.bin" \ + "$ROOT_DIR/benchmarks/foundry-abi/out/AbiRoundtripSol.sol/AbiRoundtripSol.json" \ + 'echoString(string memory)' \ + 15 \ + --solver z3 --smttimeout 10 --max-iterations 8 --max-buf-size 8 + +run_case \ + "AbiRoundtrip dynamic" \ + "$ROOT_DIR/benchmarks/foundry-abi/fe-out/AbiRoundtripFe.runtime.bin" \ + "$ROOT_DIR/benchmarks/foundry-abi/out/AbiRoundtripSol.sol/AbiRoundtripSol.json" \ + 'echoUintArray(uint256[] memory)' \ + 15 \ + --solver z3 --smttimeout 10 --max-iterations 8 --max-buf-size 8 + +run_case \ + "BytesSuite dynamic" \ + "$ROOT_DIR/benchmarks/foundry-abi/fe-out/BytesSuite.runtime.bin" \ + "$ROOT_DIR/benchmarks/foundry-abi/out/BytesSuiteSol.sol/BytesSuiteSol.json" \ + 'echoBytes(bytes memory)' \ + 15 \ + --solver z3 --smttimeout 10 --max-iterations 8 --max-buf-size 8 + +run_case \ + "FixedArraySuite dynamic fixed-array" \ + "$ROOT_DIR/benchmarks/foundry-abi/fe-out/FixedArraySuite.runtime.bin" \ + "$ROOT_DIR/benchmarks/foundry-abi/out/FixedArraySuiteSol.sol/FixedArraySuiteSol.json" \ + 'echoStringArray5(string[5] calldata)' \ + 15 \ + --solver z3 --smttimeout 10 --max-iterations 8 --max-buf-size 8 + +run_case \ + "AbiRoundtrip tuples" \ + "$ROOT_DIR/benchmarks/foundry-abi/fe-out/AbiRoundtripFe.runtime.bin" \ + "$ROOT_DIR/benchmarks/foundry-abi/out/AbiRoundtripSol.sol/AbiRoundtripSol.json" \ + 'echoBoolAddressPair((bool,address) memory)' \ + 15 \ + --solver z3 --smttimeout 10 --max-iterations 8 + +run_case \ + "AbiRoundtrip tuples" \ + "$ROOT_DIR/benchmarks/foundry-abi/fe-out/AbiRoundtripFe.runtime.bin" \ + "$ROOT_DIR/benchmarks/foundry-abi/out/AbiRoundtripSol.sol/AbiRoundtripSol.json" \ + 'echoUint24Int40Pair((uint24,int40) memory)' \ + 15 \ + --solver z3 --smttimeout 10 --max-iterations 8 + +run_case \ + "AbiRoundtrip tuples" \ + "$ROOT_DIR/benchmarks/foundry-abi/fe-out/AbiRoundtripFe.runtime.bin" \ + "$ROOT_DIR/benchmarks/foundry-abi/out/AbiRoundtripSol.sol/AbiRoundtripSol.json" \ + 'echoBoolAddressU256Triple((bool,address,uint256) memory)' \ + 15 \ + --solver z3 --smttimeout 10 --max-iterations 8 + +run_case \ + "AbiRoundtrip tuple arrays" \ + "$ROOT_DIR/benchmarks/foundry-abi/fe-out/AbiRoundtripFe.runtime.bin" \ + "$ROOT_DIR/benchmarks/foundry-abi/out/AbiRoundtripSol.sol/AbiRoundtripSol.json" \ + 'echoBoolAddressPairArray4((bool,address)[4] calldata)' \ + 30 \ + --solver z3 --smttimeout 20 --max-iterations 16 + +run_case \ + "AbiRoundtrip tuple arrays" \ + "$ROOT_DIR/benchmarks/foundry-abi/fe-out/AbiRoundtripFe.runtime.bin" \ + "$ROOT_DIR/benchmarks/foundry-abi/out/AbiRoundtripSol.sol/AbiRoundtripSol.json" \ + 'echoUint24Int40PairArray4((uint24,int40)[4] calldata)' \ + 30 \ + --solver z3 --smttimeout 20 --max-iterations 16 + +run_case \ + "AbiRoundtrip tuple arrays" \ + "$ROOT_DIR/benchmarks/foundry-abi/fe-out/AbiRoundtripFe.runtime.bin" \ + "$ROOT_DIR/benchmarks/foundry-abi/out/AbiRoundtripSol.sol/AbiRoundtripSol.json" \ + 'echoBoolAddressU256TripleArray4((bool,address,uint256)[4] calldata)' \ + 30 \ + --solver z3 --smttimeout 20 --max-iterations 16 + +run_case \ + "NestedTupleSuite tuples" \ + "$ROOT_DIR/benchmarks/foundry-abi/fe-out/NestedTupleSuite.runtime.bin" \ + "$ROOT_DIR/benchmarks/foundry-abi/out/NestedTupleSuiteSol.sol/NestedTupleSuiteSol.json" \ + 'echoNestedStatic(((bool,address),uint256) memory)' \ + 30 \ + --solver z3 --smttimeout 20 --max-iterations 16 + +run_case \ + "NestedTupleSuite tuples" \ + "$ROOT_DIR/benchmarks/foundry-abi/fe-out/NestedTupleSuite.runtime.bin" \ + "$ROOT_DIR/benchmarks/foundry-abi/out/NestedTupleSuiteSol.sol/NestedTupleSuiteSol.json" \ + 'echoNestedStaticFlipped((bool,(address,uint256)) memory)' \ + 30 \ + --solver z3 --smttimeout 20 --max-iterations 16 + +{ + report_date="$(date +%Y-%m-%d)" + hevm_version="$(hevm version 2>/dev/null | awk 'NR==1 {print $1}')" + z3_version="$(z3 -version 2>/dev/null | awk 'NR==1 {print $3}')" + # When committing the generated report, we often want a stable source revision + # (e.g. the last "source" commit in a stack) rather than the commit that + # contains the report itself. + fe_opt_rev_input="${FE_OPT_REV:-}" + if [ -n "$fe_opt_rev_input" ]; then + fe_opt_rev="$(git -C "$ROOT_DIR" rev-parse --short "$fe_opt_rev_input" 2>/dev/null || printf '%s' "$fe_opt_rev_input")" + else + fe_opt_rev="$(git -C "$ROOT_DIR" rev-parse --short HEAD 2>/dev/null || true)" + fi + + printf '# hevm Equivalence Status\n\n' + printf 'Date: %s\n\n' "$report_date" + printf 'Environment:\n' + printf -- '- `hevm %s`\n' "$hevm_version" + printf -- '- `z3 %s`\n' "$z3_version" + printf -- '- `fe-opt %s`\n' "$fe_opt_rev" + printf -- '- local install from the adjacent `hevm` checkout at `../hevm/local/bin`\n\n' + + printf 'Semantics:\n' + printf -- '- hevm checks matching success/failure, returndata, and storage.\n' + printf -- '- if both sides revert, hevm compares the revert payloads, not just the fact of reversion.\n' + printf -- '- logs and gas are not part of the equivalence relation.\n\n' + + printf 'Helpers:\n' + printf -- '- `benchmarks/foundry-abi/scripts/run_hevm_equivalence.sh`\n' + printf -- '- `benchmarks/foundry-abi/scripts/run_hevm_curated_matrix.sh`\n\n' + + printf 'Summary:\n' + printf -- '- proven equivalent: %d\n' "$pass_count" + printf -- '- unsupported by current hevm parser/encoder: %d\n' "$unsupported_count" + printf -- '- partial or timed out: %d\n' "$partial_count" + printf -- '- suspicious malformed-calldata mismatches: %d\n' "$suspect_count" + printf -- '- other failures: %d\n\n' "$fail_count" + + printf '## Proven Equivalent\n\n' + cat "$PASS_FILE" + printf '\n## Unsupported in hevm 0.57.0\n\n' + cat "$UNSUPPORTED_FILE" + printf '\n## Partial / Timeout\n\n' + cat "$PARTIAL_FILE" + printf '\n## Suspected hevm Front-End Bugs\n\n' + cat "$SUSPECT_FILE" + printf '\n## Other Failures\n\n' + cat "$FAIL_FILE" + printf '\n' +} > "$REPORT_PATH" + +printf 'wrote %s\n' "$REPORT_PATH" diff --git a/benchmarks/foundry-abi/scripts/run_hevm_equivalence.sh b/benchmarks/foundry-abi/scripts/run_hevm_equivalence.sh new file mode 100755 index 0000000000..396838473b --- /dev/null +++ b/benchmarks/foundry-abi/scripts/run_hevm_equivalence.sh @@ -0,0 +1,96 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" +ADJACENT_HEVM_BIN="$ROOT_DIR/../hevm/local/bin" + +usage() { + cat <<'EOF' +Usage: + run_hevm_equivalence.sh [hevm args...] + run_hevm_equivalence.sh --raw [hevm args...] + +Examples: + benchmarks/foundry-abi/scripts/run_hevm_equivalence.sh \ + benchmarks/foundry-abi/fe-out/FixedArraySuite.runtime.bin \ + benchmarks/foundry-abi/out/FixedArraySuiteSol.sol/FixedArraySuiteSol.json \ + 'echoBoolArray4(bool[4] calldata)' \ + --solver z3 --smttimeout 30 --max-iterations 8 + + benchmarks/foundry-abi/scripts/run_hevm_equivalence.sh --raw \ + benchmarks/foundry-abi/fe-out/BytesSuite.runtime.bin \ + benchmarks/foundry-abi/out/BytesSuiteSol.sol/BytesSuiteSol.json \ + --solver z3 --smttimeout 5 --max-iterations 4 --max-buf-size 6 +EOF +} + +require_tool() { + if ! command -v "$1" >/dev/null 2>&1; then + printf 'missing required tool: %s\n' "$1" >&2 + exit 2 + fi +} + +if [ "${1:-}" = "--help" ] || [ "${1:-}" = "-h" ]; then + usage + exit 0 +fi + +raw_mode=0 +if [ "${1:-}" = "--raw" ]; then + raw_mode=1 + shift +fi + +if [ "$raw_mode" -eq 1 ]; then + if [ "$#" -lt 2 ]; then + usage >&2 + exit 2 + fi + fe_runtime_bin="$1" + sol_artifact_json="$2" + shift 2 + signature="" +else + if [ "$#" -lt 3 ]; then + usage >&2 + exit 2 + fi + fe_runtime_bin="$1" + sol_artifact_json="$2" + signature="$3" + shift 3 +fi + +require_tool jq + +if [ -d "$ADJACENT_HEVM_BIN" ]; then + PATH="$ADJACENT_HEVM_BIN:$PATH" +fi + +require_tool hevm +require_tool z3 + +tmp_sol_runtime="$(mktemp)" +trap 'rm -f "$tmp_sol_runtime"' EXIT + +jq -r '.deployedBytecode.object' "$sol_artifact_json" > "$tmp_sol_runtime" + +cmd=( + hevm + equivalence + --code-a-file "$fe_runtime_bin" + --code-b-file "$tmp_sol_runtime" +) + +if [ "$raw_mode" -eq 0 ]; then + cmd+=(--sig "$signature") +fi + +cmd+=("$@") + +printf 'running:' +printf ' %q' "${cmd[@]}" +printf '\n' + +"${cmd[@]}" diff --git a/benchmarks/foundry-abi/src/AbiRoundtripSol.sol b/benchmarks/foundry-abi/src/AbiRoundtripSol.sol new file mode 100644 index 0000000000..1be12f9f5f --- /dev/null +++ b/benchmarks/foundry-abi/src/AbiRoundtripSol.sol @@ -0,0 +1,1493 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +struct StringU64Pair { + string text; + uint64 count; +} + +struct BoolAddressPair { + bool flag; + address addr; +} + +struct Uint24Int40Pair { + uint24 left; + int40 right; +} + +struct BoolAddressU256Triple { + bool flag; + address addr; + uint256 count; +} + +struct StringBoolU64Triple { + string text; + bool flag; + uint64 count; +} + +interface IAbiRoundtrip { + function echoBool(bool value) external returns (bool); + function echoAddress(address value) external returns (address); + function echoString(string calldata value) external returns (string memory); + function echoUint8(uint8 value) external returns (uint8); + function echoUint16(uint16 value) external returns (uint16); + function echoUint32(uint32 value) external returns (uint32); + function echoUint64(uint64 value) external returns (uint64); + function echoUint128(uint128 value) external returns (uint128); + function echoUint(uint256 value) external returns (uint256); + function echoInt8(int8 value) external returns (int8); + function echoInt16(int16 value) external returns (int16); + function echoInt32(int32 value) external returns (int32); + function echoInt64(int64 value) external returns (int64); + function echoInt128(int128 value) external returns (int128); + function echoInt256(int256 value) external returns (int256); + function echoUint24(uint24 value) external returns (uint24); + function echoUint40(uint40 value) external returns (uint40); + function echoUint48(uint48 value) external returns (uint48); + function echoUint56(uint56 value) external returns (uint56); + function echoUint72(uint72 value) external returns (uint72); + function echoUint80(uint80 value) external returns (uint80); + function echoUint88(uint88 value) external returns (uint88); + function echoUint96(uint96 value) external returns (uint96); + function echoUint104(uint104 value) external returns (uint104); + function echoUint112(uint112 value) external returns (uint112); + function echoUint120(uint120 value) external returns (uint120); + function echoUint136(uint136 value) external returns (uint136); + function echoUint144(uint144 value) external returns (uint144); + function echoUint152(uint152 value) external returns (uint152); + function echoUint160(uint160 value) external returns (uint160); + function echoUint168(uint168 value) external returns (uint168); + function echoUint176(uint176 value) external returns (uint176); + function echoUint184(uint184 value) external returns (uint184); + function echoUint192(uint192 value) external returns (uint192); + function echoUint200(uint200 value) external returns (uint200); + function echoUint208(uint208 value) external returns (uint208); + function echoUint216(uint216 value) external returns (uint216); + function echoUint224(uint224 value) external returns (uint224); + function echoUint232(uint232 value) external returns (uint232); + function echoUint240(uint240 value) external returns (uint240); + function echoUint248(uint248 value) external returns (uint248); + function echoInt24(int24 value) external returns (int24); + function echoInt40(int40 value) external returns (int40); + function echoInt48(int48 value) external returns (int48); + function echoInt56(int56 value) external returns (int56); + function echoInt72(int72 value) external returns (int72); + function echoInt80(int80 value) external returns (int80); + function echoInt88(int88 value) external returns (int88); + function echoInt96(int96 value) external returns (int96); + function echoInt104(int104 value) external returns (int104); + function echoInt112(int112 value) external returns (int112); + function echoInt120(int120 value) external returns (int120); + function echoInt136(int136 value) external returns (int136); + function echoInt144(int144 value) external returns (int144); + function echoInt152(int152 value) external returns (int152); + function echoInt160(int160 value) external returns (int160); + function echoInt168(int168 value) external returns (int168); + function echoInt176(int176 value) external returns (int176); + function echoInt184(int184 value) external returns (int184); + function echoInt192(int192 value) external returns (int192); + function echoInt200(int200 value) external returns (int200); + function echoInt208(int208 value) external returns (int208); + function echoInt216(int216 value) external returns (int216); + function echoInt224(int224 value) external returns (int224); + function echoInt232(int232 value) external returns (int232); + function echoInt240(int240 value) external returns (int240); + function echoInt248(int248 value) external returns (int248); + function echoBoolArray4(bool[4] calldata value) external returns (bool[4] memory); + function echoAddressArray4(address[4] calldata value) external returns (address[4] memory); + function echoUint8Array4(uint8[4] calldata value) external returns (uint8[4] memory); + function echoUint16Array4(uint16[4] calldata value) external returns (uint16[4] memory); + function echoUint32Array4(uint32[4] calldata value) external returns (uint32[4] memory); + function echoUint64Array4(uint64[4] calldata value) external returns (uint64[4] memory); + function echoUint128Array4(uint128[4] calldata value) external returns (uint128[4] memory); + function echoUintArray4(uint256[4] calldata value) external returns (uint256[4] memory); + function echoInt8Array4(int8[4] calldata value) external returns (int8[4] memory); + function echoInt16Array4(int16[4] calldata value) external returns (int16[4] memory); + function echoInt32Array4(int32[4] calldata value) external returns (int32[4] memory); + function echoInt64Array4(int64[4] calldata value) external returns (int64[4] memory); + function echoInt128Array4(int128[4] calldata value) external returns (int128[4] memory); + function echoInt256Array4(int256[4] calldata value) external returns (int256[4] memory); + function echoUint24Array4(uint24[4] calldata value) external returns (uint24[4] memory); + function echoUint40Array4(uint40[4] calldata value) external returns (uint40[4] memory); + function echoUint96Array4(uint96[4] calldata value) external returns (uint96[4] memory); + function echoUint160Array4(uint160[4] calldata value) external returns (uint160[4] memory); + function echoUint248Array4(uint248[4] calldata value) external returns (uint248[4] memory); + function echoInt24Array4(int24[4] calldata value) external returns (int24[4] memory); + function echoInt40Array4(int40[4] calldata value) external returns (int40[4] memory); + function echoInt96Array4(int96[4] calldata value) external returns (int96[4] memory); + function echoInt160Array4(int160[4] calldata value) external returns (int160[4] memory); + function echoInt248Array4(int248[4] calldata value) external returns (int248[4] memory); + function echoBoolMatrix2x2(bool[2][2] calldata value) external returns (bool[2][2] memory); + function echoAddressMatrix2x2(address[2][2] calldata value) external returns (address[2][2] memory); + function echoUintMatrix2x2(uint256[2][2] calldata value) external returns (uint256[2][2] memory); + function echoInt256Matrix2x2(int256[2][2] calldata value) external returns (int256[2][2] memory); + function echoUint24Matrix2x2(uint24[2][2] calldata value) external returns (uint24[2][2] memory); + function echoInt40Matrix2x2(int40[2][2] calldata value) external returns (int40[2][2] memory); + function echoBoolAddressPairArray4(BoolAddressPair[4] calldata value) external returns (BoolAddressPair[4] memory); + function echoUint24Int40PairArray4(Uint24Int40Pair[4] calldata value) external returns (Uint24Int40Pair[4] memory); + function echoBoolAddressU256TripleArray4(BoolAddressU256Triple[4] calldata value) external returns (BoolAddressU256Triple[4] memory); + function echoStringArray2(string[2] calldata value) external returns (string[2] memory); + function echoStringU64PairArray2(StringU64Pair[2] calldata value) external returns (StringU64Pair[2] memory); + function echoUintArray(uint256[] calldata value) external returns (uint256[] memory); + function echoBoolAddressPairArray(BoolAddressPair[] calldata value) external returns (BoolAddressPair[] memory); + function echoStringArray(string[] calldata value) external returns (string[] memory); + function echoStringU64PairArray(StringU64Pair[] calldata value) external returns (StringU64Pair[] memory); + function echoPair(StringU64Pair calldata value) external returns (StringU64Pair memory); + function echoBoolAddressPair(BoolAddressPair calldata value) external returns (BoolAddressPair memory); + function echoUint24Int40Pair(Uint24Int40Pair calldata value) external returns (Uint24Int40Pair memory); + function echoBoolAddressU256Triple(BoolAddressU256Triple calldata value) external returns (BoolAddressU256Triple memory); + function echoStringBoolU64Triple(StringBoolU64Triple calldata value) external returns (StringBoolU64Triple memory); +} + +contract AbiRoundtripSol is IAbiRoundtrip { + function echoBool(bool value) external pure returns (bool) { + return value; + } + + function echoAddress(address value) external pure returns (address) { + return value; + } + + function echoString(string calldata value) external pure returns (string memory) { + return value; + } + + function echoUint8(uint8 value) external pure returns (uint8) { + return value; + } + + function echoUint16(uint16 value) external pure returns (uint16) { + return value; + } + + function echoUint32(uint32 value) external pure returns (uint32) { + return value; + } + + function echoUint64(uint64 value) external pure returns (uint64) { + return value; + } + + function echoUint128(uint128 value) external pure returns (uint128) { + return value; + } + + function echoUint(uint256 value) external pure returns (uint256) { + return value; + } + + function echoInt8(int8 value) external pure returns (int8) { + return value; + } + + function echoInt16(int16 value) external pure returns (int16) { + return value; + } + + function echoInt32(int32 value) external pure returns (int32) { + return value; + } + + function echoInt64(int64 value) external pure returns (int64) { + return value; + } + + function echoInt128(int128 value) external pure returns (int128) { + return value; + } + + function echoInt256(int256 value) external pure returns (int256) { + return value; + } + + function echoUint24(uint24 value) external pure returns (uint24) { + return value; + } + + function echoUint40(uint40 value) external pure returns (uint40) { + return value; + } + + function echoUint48(uint48 value) external pure returns (uint48) { + return value; + } + + function echoUint56(uint56 value) external pure returns (uint56) { + return value; + } + + function echoUint72(uint72 value) external pure returns (uint72) { + return value; + } + + function echoUint80(uint80 value) external pure returns (uint80) { + return value; + } + + function echoUint88(uint88 value) external pure returns (uint88) { + return value; + } + + function echoUint96(uint96 value) external pure returns (uint96) { + return value; + } + + function echoUint104(uint104 value) external pure returns (uint104) { + return value; + } + + function echoUint112(uint112 value) external pure returns (uint112) { + return value; + } + + function echoUint120(uint120 value) external pure returns (uint120) { + return value; + } + + function echoUint136(uint136 value) external pure returns (uint136) { + return value; + } + + function echoUint144(uint144 value) external pure returns (uint144) { + return value; + } + + function echoUint152(uint152 value) external pure returns (uint152) { + return value; + } + + function echoUint160(uint160 value) external pure returns (uint160) { + return value; + } + + function echoUint168(uint168 value) external pure returns (uint168) { + return value; + } + + function echoUint176(uint176 value) external pure returns (uint176) { + return value; + } + + function echoUint184(uint184 value) external pure returns (uint184) { + return value; + } + + function echoUint192(uint192 value) external pure returns (uint192) { + return value; + } + + function echoUint200(uint200 value) external pure returns (uint200) { + return value; + } + + function echoUint208(uint208 value) external pure returns (uint208) { + return value; + } + + function echoUint216(uint216 value) external pure returns (uint216) { + return value; + } + + function echoUint224(uint224 value) external pure returns (uint224) { + return value; + } + + function echoUint232(uint232 value) external pure returns (uint232) { + return value; + } + + function echoUint240(uint240 value) external pure returns (uint240) { + return value; + } + + function echoUint248(uint248 value) external pure returns (uint248) { + return value; + } + + function echoInt24(int24 value) external pure returns (int24) { + return value; + } + + function echoInt40(int40 value) external pure returns (int40) { + return value; + } + + function echoInt48(int48 value) external pure returns (int48) { + return value; + } + + function echoInt56(int56 value) external pure returns (int56) { + return value; + } + + function echoInt72(int72 value) external pure returns (int72) { + return value; + } + + function echoInt80(int80 value) external pure returns (int80) { + return value; + } + + function echoInt88(int88 value) external pure returns (int88) { + return value; + } + + function echoInt96(int96 value) external pure returns (int96) { + return value; + } + + function echoInt104(int104 value) external pure returns (int104) { + return value; + } + + function echoInt112(int112 value) external pure returns (int112) { + return value; + } + + function echoInt120(int120 value) external pure returns (int120) { + return value; + } + + function echoInt136(int136 value) external pure returns (int136) { + return value; + } + + function echoInt144(int144 value) external pure returns (int144) { + return value; + } + + function echoInt152(int152 value) external pure returns (int152) { + return value; + } + + function echoInt160(int160 value) external pure returns (int160) { + return value; + } + + function echoInt168(int168 value) external pure returns (int168) { + return value; + } + + function echoInt176(int176 value) external pure returns (int176) { + return value; + } + + function echoInt184(int184 value) external pure returns (int184) { + return value; + } + + function echoInt192(int192 value) external pure returns (int192) { + return value; + } + + function echoInt200(int200 value) external pure returns (int200) { + return value; + } + + function echoInt208(int208 value) external pure returns (int208) { + return value; + } + + function echoInt216(int216 value) external pure returns (int216) { + return value; + } + + function echoInt224(int224 value) external pure returns (int224) { + return value; + } + + function echoInt232(int232 value) external pure returns (int232) { + return value; + } + + function echoInt240(int240 value) external pure returns (int240) { + return value; + } + + function echoInt248(int248 value) external pure returns (int248) { + return value; + } + + function echoBoolArray4(bool[4] calldata value) external pure returns (bool[4] memory) { + return value; + } + + function echoAddressArray4(address[4] calldata value) external pure returns (address[4] memory) { + return value; + } + + function echoUint8Array4(uint8[4] calldata value) external pure returns (uint8[4] memory) { + return value; + } + + function echoUint16Array4(uint16[4] calldata value) external pure returns (uint16[4] memory) { + return value; + } + + function echoUint32Array4(uint32[4] calldata value) external pure returns (uint32[4] memory) { + return value; + } + + function echoUint64Array4(uint64[4] calldata value) external pure returns (uint64[4] memory) { + return value; + } + + function echoUint128Array4(uint128[4] calldata value) external pure returns (uint128[4] memory) { + return value; + } + + function echoUintArray4(uint256[4] calldata value) external pure returns (uint256[4] memory) { + return value; + } + + function echoInt8Array4(int8[4] calldata value) external pure returns (int8[4] memory) { + return value; + } + + function echoInt16Array4(int16[4] calldata value) external pure returns (int16[4] memory) { + return value; + } + + function echoInt32Array4(int32[4] calldata value) external pure returns (int32[4] memory) { + return value; + } + + function echoInt64Array4(int64[4] calldata value) external pure returns (int64[4] memory) { + return value; + } + + function echoInt128Array4(int128[4] calldata value) external pure returns (int128[4] memory) { + return value; + } + + function echoInt256Array4(int256[4] calldata value) external pure returns (int256[4] memory) { + return value; + } + + function echoUint24Array4(uint24[4] calldata value) external pure returns (uint24[4] memory) { + return value; + } + + function echoUint40Array4(uint40[4] calldata value) external pure returns (uint40[4] memory) { + return value; + } + + function echoUint96Array4(uint96[4] calldata value) external pure returns (uint96[4] memory) { + return value; + } + + function echoUint160Array4(uint160[4] calldata value) external pure returns (uint160[4] memory) { + return value; + } + + function echoUint248Array4(uint248[4] calldata value) external pure returns (uint248[4] memory) { + return value; + } + + function echoInt24Array4(int24[4] calldata value) external pure returns (int24[4] memory) { + return value; + } + + function echoInt40Array4(int40[4] calldata value) external pure returns (int40[4] memory) { + return value; + } + + function echoInt96Array4(int96[4] calldata value) external pure returns (int96[4] memory) { + return value; + } + + function echoInt160Array4(int160[4] calldata value) external pure returns (int160[4] memory) { + return value; + } + + function echoInt248Array4(int248[4] calldata value) external pure returns (int248[4] memory) { + return value; + } + + function echoBoolMatrix2x2(bool[2][2] calldata value) external pure returns (bool[2][2] memory) { + return value; + } + + function echoAddressMatrix2x2(address[2][2] calldata value) external pure returns (address[2][2] memory) { + return value; + } + + function echoUintMatrix2x2(uint256[2][2] calldata value) external pure returns (uint256[2][2] memory) { + return value; + } + + function echoInt256Matrix2x2(int256[2][2] calldata value) external pure returns (int256[2][2] memory) { + return value; + } + + function echoUint24Matrix2x2(uint24[2][2] calldata value) external pure returns (uint24[2][2] memory) { + return value; + } + + function echoInt40Matrix2x2(int40[2][2] calldata value) external pure returns (int40[2][2] memory) { + return value; + } + + function echoBoolAddressPairArray4(BoolAddressPair[4] calldata value) external pure returns (BoolAddressPair[4] memory) { + return value; + } + + function echoUint24Int40PairArray4(Uint24Int40Pair[4] calldata value) external pure returns (Uint24Int40Pair[4] memory) { + return value; + } + + function echoBoolAddressU256TripleArray4(BoolAddressU256Triple[4] calldata value) external pure returns (BoolAddressU256Triple[4] memory) { + return value; + } + + function echoStringArray2(string[2] calldata value) external pure returns (string[2] memory) { + return value; + } + + function echoStringU64PairArray2(StringU64Pair[2] calldata value) external pure returns (StringU64Pair[2] memory) { + return value; + } + + function echoUintArray(uint256[] calldata value) external pure returns (uint256[] memory) { + return value; + } + + function echoBoolAddressPairArray(BoolAddressPair[] calldata value) external pure returns (BoolAddressPair[] memory) { + return value; + } + + function echoStringArray(string[] calldata value) external pure returns (string[] memory) { + return value; + } + + function echoStringU64PairArray(StringU64Pair[] calldata value) external pure returns (StringU64Pair[] memory) { + return value; + } + + function echoPair(StringU64Pair calldata value) external pure returns (StringU64Pair memory) { + return value; + } + + function echoBoolAddressPair(BoolAddressPair calldata value) external pure returns (BoolAddressPair memory) { + return value; + } + + function echoUint24Int40Pair(Uint24Int40Pair calldata value) external pure returns (Uint24Int40Pair memory) { + return value; + } + + function echoBoolAddressU256Triple(BoolAddressU256Triple calldata value) external pure returns (BoolAddressU256Triple memory) { + return value; + } + + function echoStringBoolU64Triple(StringBoolU64Triple calldata value) external pure returns (StringBoolU64Triple memory) { + return value; + } +} + +contract SolBenchCaller { + IAbiRoundtrip public immutable target; + + constructor(address target_) { + target = IAbiRoundtrip(target_); + } + + function benchEchoBool(bool value) external returns (bool) { + return target.echoBool(value); + } + + function benchEchoAddress(address value) external returns (address) { + return target.echoAddress(value); + } + + function benchEchoString(string calldata value) external returns (string memory) { + return target.echoString(value); + } + + function benchEchoUint8(uint8 value) external returns (uint8) { + return target.echoUint8(value); + } + + function benchEchoUint16(uint16 value) external returns (uint16) { + return target.echoUint16(value); + } + + function benchEchoUint32(uint32 value) external returns (uint32) { + return target.echoUint32(value); + } + + function benchEchoUint64(uint64 value) external returns (uint64) { + return target.echoUint64(value); + } + + function benchEchoUint128(uint128 value) external returns (uint128) { + return target.echoUint128(value); + } + + function benchEchoUint(uint256 value) external returns (uint256) { + return target.echoUint(value); + } + + function benchEchoInt8(int8 value) external returns (int8) { + return target.echoInt8(value); + } + + function benchEchoInt16(int16 value) external returns (int16) { + return target.echoInt16(value); + } + + function benchEchoInt32(int32 value) external returns (int32) { + return target.echoInt32(value); + } + + function benchEchoInt64(int64 value) external returns (int64) { + return target.echoInt64(value); + } + + function benchEchoInt128(int128 value) external returns (int128) { + return target.echoInt128(value); + } + + function benchEchoInt256(int256 value) external returns (int256) { + return target.echoInt256(value); + } + + function benchEchoUint24(uint24 value) external returns (uint24) { + return target.echoUint24(value); + } + + function benchEchoUint40(uint40 value) external returns (uint40) { + return target.echoUint40(value); + } + + function benchEchoUint48(uint48 value) external returns (uint48) { + return target.echoUint48(value); + } + + function benchEchoUint56(uint56 value) external returns (uint56) { + return target.echoUint56(value); + } + + function benchEchoUint72(uint72 value) external returns (uint72) { + return target.echoUint72(value); + } + + function benchEchoUint80(uint80 value) external returns (uint80) { + return target.echoUint80(value); + } + + function benchEchoUint88(uint88 value) external returns (uint88) { + return target.echoUint88(value); + } + + function benchEchoUint96(uint96 value) external returns (uint96) { + return target.echoUint96(value); + } + + function benchEchoUint104(uint104 value) external returns (uint104) { + return target.echoUint104(value); + } + + function benchEchoUint112(uint112 value) external returns (uint112) { + return target.echoUint112(value); + } + + function benchEchoUint120(uint120 value) external returns (uint120) { + return target.echoUint120(value); + } + + function benchEchoUint136(uint136 value) external returns (uint136) { + return target.echoUint136(value); + } + + function benchEchoUint144(uint144 value) external returns (uint144) { + return target.echoUint144(value); + } + + function benchEchoUint152(uint152 value) external returns (uint152) { + return target.echoUint152(value); + } + + function benchEchoUint160(uint160 value) external returns (uint160) { + return target.echoUint160(value); + } + + function benchEchoUint168(uint168 value) external returns (uint168) { + return target.echoUint168(value); + } + + function benchEchoUint176(uint176 value) external returns (uint176) { + return target.echoUint176(value); + } + + function benchEchoUint184(uint184 value) external returns (uint184) { + return target.echoUint184(value); + } + + function benchEchoUint192(uint192 value) external returns (uint192) { + return target.echoUint192(value); + } + + function benchEchoUint200(uint200 value) external returns (uint200) { + return target.echoUint200(value); + } + + function benchEchoUint208(uint208 value) external returns (uint208) { + return target.echoUint208(value); + } + + function benchEchoUint216(uint216 value) external returns (uint216) { + return target.echoUint216(value); + } + + function benchEchoUint224(uint224 value) external returns (uint224) { + return target.echoUint224(value); + } + + function benchEchoUint232(uint232 value) external returns (uint232) { + return target.echoUint232(value); + } + + function benchEchoUint240(uint240 value) external returns (uint240) { + return target.echoUint240(value); + } + + function benchEchoUint248(uint248 value) external returns (uint248) { + return target.echoUint248(value); + } + + function benchEchoInt24(int24 value) external returns (int24) { + return target.echoInt24(value); + } + + function benchEchoInt40(int40 value) external returns (int40) { + return target.echoInt40(value); + } + + function benchEchoInt48(int48 value) external returns (int48) { + return target.echoInt48(value); + } + + function benchEchoInt56(int56 value) external returns (int56) { + return target.echoInt56(value); + } + + function benchEchoInt72(int72 value) external returns (int72) { + return target.echoInt72(value); + } + + function benchEchoInt80(int80 value) external returns (int80) { + return target.echoInt80(value); + } + + function benchEchoInt88(int88 value) external returns (int88) { + return target.echoInt88(value); + } + + function benchEchoInt96(int96 value) external returns (int96) { + return target.echoInt96(value); + } + + function benchEchoInt104(int104 value) external returns (int104) { + return target.echoInt104(value); + } + + function benchEchoInt112(int112 value) external returns (int112) { + return target.echoInt112(value); + } + + function benchEchoInt120(int120 value) external returns (int120) { + return target.echoInt120(value); + } + + function benchEchoInt136(int136 value) external returns (int136) { + return target.echoInt136(value); + } + + function benchEchoInt144(int144 value) external returns (int144) { + return target.echoInt144(value); + } + + function benchEchoInt152(int152 value) external returns (int152) { + return target.echoInt152(value); + } + + function benchEchoInt160(int160 value) external returns (int160) { + return target.echoInt160(value); + } + + function benchEchoInt168(int168 value) external returns (int168) { + return target.echoInt168(value); + } + + function benchEchoInt176(int176 value) external returns (int176) { + return target.echoInt176(value); + } + + function benchEchoInt184(int184 value) external returns (int184) { + return target.echoInt184(value); + } + + function benchEchoInt192(int192 value) external returns (int192) { + return target.echoInt192(value); + } + + function benchEchoInt200(int200 value) external returns (int200) { + return target.echoInt200(value); + } + + function benchEchoInt208(int208 value) external returns (int208) { + return target.echoInt208(value); + } + + function benchEchoInt216(int216 value) external returns (int216) { + return target.echoInt216(value); + } + + function benchEchoInt224(int224 value) external returns (int224) { + return target.echoInt224(value); + } + + function benchEchoInt232(int232 value) external returns (int232) { + return target.echoInt232(value); + } + + function benchEchoInt240(int240 value) external returns (int240) { + return target.echoInt240(value); + } + + function benchEchoInt248(int248 value) external returns (int248) { + return target.echoInt248(value); + } + + function benchEchoBoolArray4(bool[4] calldata value) external returns (bool[4] memory) { + return target.echoBoolArray4(value); + } + + function benchEchoAddressArray4(address[4] calldata value) external returns (address[4] memory) { + return target.echoAddressArray4(value); + } + + function benchEchoUint8Array4(uint8[4] calldata value) external returns (uint8[4] memory) { + return target.echoUint8Array4(value); + } + + function benchEchoUint16Array4(uint16[4] calldata value) external returns (uint16[4] memory) { + return target.echoUint16Array4(value); + } + + function benchEchoUint32Array4(uint32[4] calldata value) external returns (uint32[4] memory) { + return target.echoUint32Array4(value); + } + + function benchEchoUint64Array4(uint64[4] calldata value) external returns (uint64[4] memory) { + return target.echoUint64Array4(value); + } + + function benchEchoUint128Array4(uint128[4] calldata value) external returns (uint128[4] memory) { + return target.echoUint128Array4(value); + } + + function benchEchoUintArray4(uint256[4] calldata value) external returns (uint256[4] memory) { + return target.echoUintArray4(value); + } + + function benchEchoInt8Array4(int8[4] calldata value) external returns (int8[4] memory) { + return target.echoInt8Array4(value); + } + + function benchEchoInt16Array4(int16[4] calldata value) external returns (int16[4] memory) { + return target.echoInt16Array4(value); + } + + function benchEchoInt32Array4(int32[4] calldata value) external returns (int32[4] memory) { + return target.echoInt32Array4(value); + } + + function benchEchoInt64Array4(int64[4] calldata value) external returns (int64[4] memory) { + return target.echoInt64Array4(value); + } + + function benchEchoInt128Array4(int128[4] calldata value) external returns (int128[4] memory) { + return target.echoInt128Array4(value); + } + + function benchEchoInt256Array4(int256[4] calldata value) external returns (int256[4] memory) { + return target.echoInt256Array4(value); + } + + function benchEchoUint24Array4(uint24[4] calldata value) external returns (uint24[4] memory) { + return target.echoUint24Array4(value); + } + + function benchEchoUint40Array4(uint40[4] calldata value) external returns (uint40[4] memory) { + return target.echoUint40Array4(value); + } + + function benchEchoUint96Array4(uint96[4] calldata value) external returns (uint96[4] memory) { + return target.echoUint96Array4(value); + } + + function benchEchoUint160Array4(uint160[4] calldata value) external returns (uint160[4] memory) { + return target.echoUint160Array4(value); + } + + function benchEchoUint248Array4(uint248[4] calldata value) external returns (uint248[4] memory) { + return target.echoUint248Array4(value); + } + + function benchEchoInt24Array4(int24[4] calldata value) external returns (int24[4] memory) { + return target.echoInt24Array4(value); + } + + function benchEchoInt40Array4(int40[4] calldata value) external returns (int40[4] memory) { + return target.echoInt40Array4(value); + } + + function benchEchoInt96Array4(int96[4] calldata value) external returns (int96[4] memory) { + return target.echoInt96Array4(value); + } + + function benchEchoInt160Array4(int160[4] calldata value) external returns (int160[4] memory) { + return target.echoInt160Array4(value); + } + + function benchEchoInt248Array4(int248[4] calldata value) external returns (int248[4] memory) { + return target.echoInt248Array4(value); + } + + function benchEchoBoolMatrix2x2(bool[2][2] calldata value) external returns (bool[2][2] memory) { + return target.echoBoolMatrix2x2(value); + } + + function benchEchoAddressMatrix2x2(address[2][2] calldata value) external returns (address[2][2] memory) { + return target.echoAddressMatrix2x2(value); + } + + function benchEchoUintMatrix2x2(uint256[2][2] calldata value) external returns (uint256[2][2] memory) { + return target.echoUintMatrix2x2(value); + } + + function benchEchoInt256Matrix2x2(int256[2][2] calldata value) external returns (int256[2][2] memory) { + return target.echoInt256Matrix2x2(value); + } + + function benchEchoUint24Matrix2x2(uint24[2][2] calldata value) external returns (uint24[2][2] memory) { + return target.echoUint24Matrix2x2(value); + } + + function benchEchoInt40Matrix2x2(int40[2][2] calldata value) external returns (int40[2][2] memory) { + return target.echoInt40Matrix2x2(value); + } + + function benchEchoBoolAddressPairArray4(BoolAddressPair[4] calldata value) external returns (BoolAddressPair[4] memory) { + return target.echoBoolAddressPairArray4(value); + } + + function benchEchoUint24Int40PairArray4(Uint24Int40Pair[4] calldata value) external returns (Uint24Int40Pair[4] memory) { + return target.echoUint24Int40PairArray4(value); + } + + function benchEchoBoolAddressU256TripleArray4(BoolAddressU256Triple[4] calldata value) external returns (BoolAddressU256Triple[4] memory) { + return target.echoBoolAddressU256TripleArray4(value); + } + + function benchEchoStringArray2(string[2] calldata value) external returns (string[2] memory) { + return target.echoStringArray2(value); + } + + function benchEchoStringU64PairArray2(StringU64Pair[2] calldata value) external returns (StringU64Pair[2] memory) { + return target.echoStringU64PairArray2(value); + } + + function benchEchoUintArray(uint256[] calldata value) external returns (uint256[] memory) { + return target.echoUintArray(value); + } + + function benchEchoBoolAddressPairArray(BoolAddressPair[] calldata value) external returns (BoolAddressPair[] memory) { + return target.echoBoolAddressPairArray(value); + } + + function benchEchoStringArray(string[] calldata value) external returns (string[] memory) { + return target.echoStringArray(value); + } + + function benchEchoStringU64PairArray(StringU64Pair[] calldata value) external returns (StringU64Pair[] memory) { + return target.echoStringU64PairArray(value); + } + + function benchEchoPair(StringU64Pair calldata value) external returns (StringU64Pair memory) { + return target.echoPair(value); + } + + function benchEchoBoolAddressPair(BoolAddressPair calldata value) external returns (BoolAddressPair memory) { + return target.echoBoolAddressPair(value); + } + + function benchEchoUint24Int40Pair(Uint24Int40Pair calldata value) external returns (Uint24Int40Pair memory) { + return target.echoUint24Int40Pair(value); + } + + function benchEchoBoolAddressU256Triple(BoolAddressU256Triple calldata value) external returns (BoolAddressU256Triple memory) { + return target.echoBoolAddressU256Triple(value); + } + + function benchEchoStringBoolU64Triple(StringBoolU64Triple calldata value) external returns (StringBoolU64Triple memory) { + return target.echoStringBoolU64Triple(value); + } +} + +contract FeBenchCaller { + IAbiRoundtrip public immutable target; + + constructor(address target_) { + target = IAbiRoundtrip(target_); + } + + function benchEchoBool(bool value) external returns (bool) { + return target.echoBool(value); + } + + function benchEchoAddress(address value) external returns (address) { + return target.echoAddress(value); + } + + function benchEchoString(string calldata value) external returns (string memory) { + return target.echoString(value); + } + + function benchEchoUint8(uint8 value) external returns (uint8) { + return target.echoUint8(value); + } + + function benchEchoUint16(uint16 value) external returns (uint16) { + return target.echoUint16(value); + } + + function benchEchoUint32(uint32 value) external returns (uint32) { + return target.echoUint32(value); + } + + function benchEchoUint64(uint64 value) external returns (uint64) { + return target.echoUint64(value); + } + + function benchEchoUint128(uint128 value) external returns (uint128) { + return target.echoUint128(value); + } + + function benchEchoUint(uint256 value) external returns (uint256) { + return target.echoUint(value); + } + + function benchEchoInt8(int8 value) external returns (int8) { + return target.echoInt8(value); + } + + function benchEchoInt16(int16 value) external returns (int16) { + return target.echoInt16(value); + } + + function benchEchoInt32(int32 value) external returns (int32) { + return target.echoInt32(value); + } + + function benchEchoInt64(int64 value) external returns (int64) { + return target.echoInt64(value); + } + + function benchEchoInt128(int128 value) external returns (int128) { + return target.echoInt128(value); + } + + function benchEchoInt256(int256 value) external returns (int256) { + return target.echoInt256(value); + } + + function benchEchoUint24(uint24 value) external returns (uint24) { + return target.echoUint24(value); + } + + function benchEchoUint40(uint40 value) external returns (uint40) { + return target.echoUint40(value); + } + + function benchEchoUint48(uint48 value) external returns (uint48) { + return target.echoUint48(value); + } + + function benchEchoUint56(uint56 value) external returns (uint56) { + return target.echoUint56(value); + } + + function benchEchoUint72(uint72 value) external returns (uint72) { + return target.echoUint72(value); + } + + function benchEchoUint80(uint80 value) external returns (uint80) { + return target.echoUint80(value); + } + + function benchEchoUint88(uint88 value) external returns (uint88) { + return target.echoUint88(value); + } + + function benchEchoUint96(uint96 value) external returns (uint96) { + return target.echoUint96(value); + } + + function benchEchoUint104(uint104 value) external returns (uint104) { + return target.echoUint104(value); + } + + function benchEchoUint112(uint112 value) external returns (uint112) { + return target.echoUint112(value); + } + + function benchEchoUint120(uint120 value) external returns (uint120) { + return target.echoUint120(value); + } + + function benchEchoUint136(uint136 value) external returns (uint136) { + return target.echoUint136(value); + } + + function benchEchoUint144(uint144 value) external returns (uint144) { + return target.echoUint144(value); + } + + function benchEchoUint152(uint152 value) external returns (uint152) { + return target.echoUint152(value); + } + + function benchEchoUint160(uint160 value) external returns (uint160) { + return target.echoUint160(value); + } + + function benchEchoUint168(uint168 value) external returns (uint168) { + return target.echoUint168(value); + } + + function benchEchoUint176(uint176 value) external returns (uint176) { + return target.echoUint176(value); + } + + function benchEchoUint184(uint184 value) external returns (uint184) { + return target.echoUint184(value); + } + + function benchEchoUint192(uint192 value) external returns (uint192) { + return target.echoUint192(value); + } + + function benchEchoUint200(uint200 value) external returns (uint200) { + return target.echoUint200(value); + } + + function benchEchoUint208(uint208 value) external returns (uint208) { + return target.echoUint208(value); + } + + function benchEchoUint216(uint216 value) external returns (uint216) { + return target.echoUint216(value); + } + + function benchEchoUint224(uint224 value) external returns (uint224) { + return target.echoUint224(value); + } + + function benchEchoUint232(uint232 value) external returns (uint232) { + return target.echoUint232(value); + } + + function benchEchoUint240(uint240 value) external returns (uint240) { + return target.echoUint240(value); + } + + function benchEchoUint248(uint248 value) external returns (uint248) { + return target.echoUint248(value); + } + + function benchEchoInt24(int24 value) external returns (int24) { + return target.echoInt24(value); + } + + function benchEchoInt40(int40 value) external returns (int40) { + return target.echoInt40(value); + } + + function benchEchoInt48(int48 value) external returns (int48) { + return target.echoInt48(value); + } + + function benchEchoInt56(int56 value) external returns (int56) { + return target.echoInt56(value); + } + + function benchEchoInt72(int72 value) external returns (int72) { + return target.echoInt72(value); + } + + function benchEchoInt80(int80 value) external returns (int80) { + return target.echoInt80(value); + } + + function benchEchoInt88(int88 value) external returns (int88) { + return target.echoInt88(value); + } + + function benchEchoInt96(int96 value) external returns (int96) { + return target.echoInt96(value); + } + + function benchEchoInt104(int104 value) external returns (int104) { + return target.echoInt104(value); + } + + function benchEchoInt112(int112 value) external returns (int112) { + return target.echoInt112(value); + } + + function benchEchoInt120(int120 value) external returns (int120) { + return target.echoInt120(value); + } + + function benchEchoInt136(int136 value) external returns (int136) { + return target.echoInt136(value); + } + + function benchEchoInt144(int144 value) external returns (int144) { + return target.echoInt144(value); + } + + function benchEchoInt152(int152 value) external returns (int152) { + return target.echoInt152(value); + } + + function benchEchoInt160(int160 value) external returns (int160) { + return target.echoInt160(value); + } + + function benchEchoInt168(int168 value) external returns (int168) { + return target.echoInt168(value); + } + + function benchEchoInt176(int176 value) external returns (int176) { + return target.echoInt176(value); + } + + function benchEchoInt184(int184 value) external returns (int184) { + return target.echoInt184(value); + } + + function benchEchoInt192(int192 value) external returns (int192) { + return target.echoInt192(value); + } + + function benchEchoInt200(int200 value) external returns (int200) { + return target.echoInt200(value); + } + + function benchEchoInt208(int208 value) external returns (int208) { + return target.echoInt208(value); + } + + function benchEchoInt216(int216 value) external returns (int216) { + return target.echoInt216(value); + } + + function benchEchoInt224(int224 value) external returns (int224) { + return target.echoInt224(value); + } + + function benchEchoInt232(int232 value) external returns (int232) { + return target.echoInt232(value); + } + + function benchEchoInt240(int240 value) external returns (int240) { + return target.echoInt240(value); + } + + function benchEchoInt248(int248 value) external returns (int248) { + return target.echoInt248(value); + } + + function benchEchoBoolArray4(bool[4] calldata value) external returns (bool[4] memory) { + return target.echoBoolArray4(value); + } + + function benchEchoAddressArray4(address[4] calldata value) external returns (address[4] memory) { + return target.echoAddressArray4(value); + } + + function benchEchoUint8Array4(uint8[4] calldata value) external returns (uint8[4] memory) { + return target.echoUint8Array4(value); + } + + function benchEchoUint16Array4(uint16[4] calldata value) external returns (uint16[4] memory) { + return target.echoUint16Array4(value); + } + + function benchEchoUint32Array4(uint32[4] calldata value) external returns (uint32[4] memory) { + return target.echoUint32Array4(value); + } + + function benchEchoUint64Array4(uint64[4] calldata value) external returns (uint64[4] memory) { + return target.echoUint64Array4(value); + } + + function benchEchoUint128Array4(uint128[4] calldata value) external returns (uint128[4] memory) { + return target.echoUint128Array4(value); + } + + function benchEchoUintArray4(uint256[4] calldata value) external returns (uint256[4] memory) { + return target.echoUintArray4(value); + } + + function benchEchoInt8Array4(int8[4] calldata value) external returns (int8[4] memory) { + return target.echoInt8Array4(value); + } + + function benchEchoInt16Array4(int16[4] calldata value) external returns (int16[4] memory) { + return target.echoInt16Array4(value); + } + + function benchEchoInt32Array4(int32[4] calldata value) external returns (int32[4] memory) { + return target.echoInt32Array4(value); + } + + function benchEchoInt64Array4(int64[4] calldata value) external returns (int64[4] memory) { + return target.echoInt64Array4(value); + } + + function benchEchoInt128Array4(int128[4] calldata value) external returns (int128[4] memory) { + return target.echoInt128Array4(value); + } + + function benchEchoInt256Array4(int256[4] calldata value) external returns (int256[4] memory) { + return target.echoInt256Array4(value); + } + + function benchEchoUint24Array4(uint24[4] calldata value) external returns (uint24[4] memory) { + return target.echoUint24Array4(value); + } + + function benchEchoUint40Array4(uint40[4] calldata value) external returns (uint40[4] memory) { + return target.echoUint40Array4(value); + } + + function benchEchoUint96Array4(uint96[4] calldata value) external returns (uint96[4] memory) { + return target.echoUint96Array4(value); + } + + function benchEchoUint160Array4(uint160[4] calldata value) external returns (uint160[4] memory) { + return target.echoUint160Array4(value); + } + + function benchEchoUint248Array4(uint248[4] calldata value) external returns (uint248[4] memory) { + return target.echoUint248Array4(value); + } + + function benchEchoInt24Array4(int24[4] calldata value) external returns (int24[4] memory) { + return target.echoInt24Array4(value); + } + + function benchEchoInt40Array4(int40[4] calldata value) external returns (int40[4] memory) { + return target.echoInt40Array4(value); + } + + function benchEchoInt96Array4(int96[4] calldata value) external returns (int96[4] memory) { + return target.echoInt96Array4(value); + } + + function benchEchoInt160Array4(int160[4] calldata value) external returns (int160[4] memory) { + return target.echoInt160Array4(value); + } + + function benchEchoInt248Array4(int248[4] calldata value) external returns (int248[4] memory) { + return target.echoInt248Array4(value); + } + + function benchEchoBoolMatrix2x2(bool[2][2] calldata value) external returns (bool[2][2] memory) { + return target.echoBoolMatrix2x2(value); + } + + function benchEchoAddressMatrix2x2(address[2][2] calldata value) external returns (address[2][2] memory) { + return target.echoAddressMatrix2x2(value); + } + + function benchEchoUintMatrix2x2(uint256[2][2] calldata value) external returns (uint256[2][2] memory) { + return target.echoUintMatrix2x2(value); + } + + function benchEchoInt256Matrix2x2(int256[2][2] calldata value) external returns (int256[2][2] memory) { + return target.echoInt256Matrix2x2(value); + } + + function benchEchoUint24Matrix2x2(uint24[2][2] calldata value) external returns (uint24[2][2] memory) { + return target.echoUint24Matrix2x2(value); + } + + function benchEchoInt40Matrix2x2(int40[2][2] calldata value) external returns (int40[2][2] memory) { + return target.echoInt40Matrix2x2(value); + } + + function benchEchoBoolAddressPairArray4(BoolAddressPair[4] calldata value) external returns (BoolAddressPair[4] memory) { + return target.echoBoolAddressPairArray4(value); + } + + function benchEchoUint24Int40PairArray4(Uint24Int40Pair[4] calldata value) external returns (Uint24Int40Pair[4] memory) { + return target.echoUint24Int40PairArray4(value); + } + + function benchEchoBoolAddressU256TripleArray4(BoolAddressU256Triple[4] calldata value) external returns (BoolAddressU256Triple[4] memory) { + return target.echoBoolAddressU256TripleArray4(value); + } + + function benchEchoStringArray2(string[2] calldata value) external returns (string[2] memory) { + return target.echoStringArray2(value); + } + + function benchEchoStringU64PairArray2(StringU64Pair[2] calldata value) external returns (StringU64Pair[2] memory) { + return target.echoStringU64PairArray2(value); + } + + function benchEchoUintArray(uint256[] calldata value) external returns (uint256[] memory) { + return target.echoUintArray(value); + } + + function benchEchoBoolAddressPairArray(BoolAddressPair[] calldata value) external returns (BoolAddressPair[] memory) { + return target.echoBoolAddressPairArray(value); + } + + function benchEchoStringArray(string[] calldata value) external returns (string[] memory) { + return target.echoStringArray(value); + } + + function benchEchoStringU64PairArray(StringU64Pair[] calldata value) external returns (StringU64Pair[] memory) { + return target.echoStringU64PairArray(value); + } + + function benchEchoPair(StringU64Pair calldata value) external returns (StringU64Pair memory) { + return target.echoPair(value); + } + + function benchEchoBoolAddressPair(BoolAddressPair calldata value) external returns (BoolAddressPair memory) { + return target.echoBoolAddressPair(value); + } + + function benchEchoUint24Int40Pair(Uint24Int40Pair calldata value) external returns (Uint24Int40Pair memory) { + return target.echoUint24Int40Pair(value); + } + + function benchEchoBoolAddressU256Triple(BoolAddressU256Triple calldata value) external returns (BoolAddressU256Triple memory) { + return target.echoBoolAddressU256Triple(value); + } + + function benchEchoStringBoolU64Triple(StringBoolU64Triple calldata value) external returns (StringBoolU64Triple memory) { + return target.echoStringBoolU64Triple(value); + } +} diff --git a/benchmarks/foundry-abi/src/BytesSuiteSol.sol b/benchmarks/foundry-abi/src/BytesSuiteSol.sol new file mode 100644 index 0000000000..a1853fb683 --- /dev/null +++ b/benchmarks/foundry-abi/src/BytesSuiteSol.sol @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +interface IBytesSuite { + function echoBytes(bytes calldata value) external returns (bytes memory); +} + +contract BytesSuiteSol is IBytesSuite { + function echoBytes(bytes calldata value) external pure returns (bytes memory) { + return value; + } +} + +contract BytesSolBenchCaller { + IBytesSuite public immutable target; + + constructor(address target_) { + target = IBytesSuite(target_); + } + + function benchEchoBytes(bytes calldata value) external returns (bytes memory) { + return target.echoBytes(value); + } +} + +contract BytesFeBenchCaller { + IBytesSuite public immutable target; + + constructor(address target_) { + target = IBytesSuite(target_); + } + + function benchEchoBytes(bytes calldata value) external returns (bytes memory) { + return target.echoBytes(value); + } +} diff --git a/benchmarks/foundry-abi/src/DeepDynamicSuiteSol.sol b/benchmarks/foundry-abi/src/DeepDynamicSuiteSol.sol new file mode 100644 index 0000000000..f4639c2dcf --- /dev/null +++ b/benchmarks/foundry-abi/src/DeepDynamicSuiteSol.sol @@ -0,0 +1,226 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +struct StringU64PairDyn { + string text; + uint64 count; +} + +struct BytesU64Pair { + bytes data; + uint64 count; +} + +interface IDeepDynamicSuite { + function echoUint24Array(uint24[] calldata value) external returns (uint24[] memory); + function echoBytesArray(bytes[] calldata value) external returns (bytes[] memory); + function echoNestedBytesArray(bytes[][] calldata value) external returns (bytes[][] memory); + function echoNestedUintArray(uint256[][] calldata value) external returns (uint256[][] memory); + function echoNestedStringArray(string[][] calldata value) external returns (string[][] memory); + function echoNestedStringU64PairArray(StringU64PairDyn[][] calldata value) + external + returns (StringU64PairDyn[][] memory); + function echoBytesU64Pair(BytesU64Pair calldata value) external returns (BytesU64Pair memory); + function echoBytesU64PairArray(BytesU64Pair[] calldata value) + external + returns (BytesU64Pair[] memory); + function echoNestedBytesU64PairArray(BytesU64Pair[][] calldata value) + external + returns (BytesU64Pair[][] memory); +} + +contract DeepDynamicSuiteSol is IDeepDynamicSuite { + function echoUint24Array(uint24[] calldata value) external pure returns (uint24[] memory) { + return value; + } + + function echoBytesArray(bytes[] calldata value) external pure returns (bytes[] memory) { + return value; + } + + function echoNestedBytesArray(bytes[][] calldata value) + external + pure + returns (bytes[][] memory) + { + return value; + } + + function echoNestedUintArray(uint256[][] calldata value) + external + pure + returns (uint256[][] memory) + { + return value; + } + + function echoNestedStringArray(string[][] calldata value) + external + pure + returns (string[][] memory) + { + return value; + } + + function echoNestedStringU64PairArray(StringU64PairDyn[][] calldata value) + external + pure + returns (StringU64PairDyn[][] memory) + { + return value; + } + + function echoBytesU64Pair(BytesU64Pair calldata value) + external + pure + returns (BytesU64Pair memory) + { + return value; + } + + function echoBytesU64PairArray(BytesU64Pair[] calldata value) + external + pure + returns (BytesU64Pair[] memory) + { + return value; + } + + function echoNestedBytesU64PairArray(BytesU64Pair[][] calldata value) + external + pure + returns (BytesU64Pair[][] memory) + { + return value; + } +} + +contract DeepDynamicSolBenchCaller { + IDeepDynamicSuite public immutable target; + + constructor(address target_) { + target = IDeepDynamicSuite(target_); + } + + function benchEchoUint24Array(uint24[] calldata value) external returns (uint24[] memory) { + return target.echoUint24Array(value); + } + + function benchEchoBytesArray(bytes[] calldata value) external returns (bytes[] memory) { + return target.echoBytesArray(value); + } + + function benchEchoNestedBytesArray(bytes[][] calldata value) + external + returns (bytes[][] memory) + { + return target.echoNestedBytesArray(value); + } + + function benchEchoNestedUintArray(uint256[][] calldata value) + external + returns (uint256[][] memory) + { + return target.echoNestedUintArray(value); + } + + function benchEchoNestedStringArray(string[][] calldata value) + external + returns (string[][] memory) + { + return target.echoNestedStringArray(value); + } + + function benchEchoNestedStringU64PairArray(StringU64PairDyn[][] calldata value) + external + returns (StringU64PairDyn[][] memory) + { + return target.echoNestedStringU64PairArray(value); + } + + function benchEchoBytesU64Pair(BytesU64Pair calldata value) + external + returns (BytesU64Pair memory) + { + return target.echoBytesU64Pair(value); + } + + function benchEchoBytesU64PairArray(BytesU64Pair[] calldata value) + external + returns (BytesU64Pair[] memory) + { + return target.echoBytesU64PairArray(value); + } + + function benchEchoNestedBytesU64PairArray(BytesU64Pair[][] calldata value) + external + returns (BytesU64Pair[][] memory) + { + return target.echoNestedBytesU64PairArray(value); + } +} + +contract DeepDynamicFeBenchCaller { + IDeepDynamicSuite public immutable target; + + constructor(address target_) { + target = IDeepDynamicSuite(target_); + } + + function benchEchoUint24Array(uint24[] calldata value) external returns (uint24[] memory) { + return target.echoUint24Array(value); + } + + function benchEchoBytesArray(bytes[] calldata value) external returns (bytes[] memory) { + return target.echoBytesArray(value); + } + + function benchEchoNestedBytesArray(bytes[][] calldata value) + external + returns (bytes[][] memory) + { + return target.echoNestedBytesArray(value); + } + + function benchEchoNestedUintArray(uint256[][] calldata value) + external + returns (uint256[][] memory) + { + return target.echoNestedUintArray(value); + } + + function benchEchoNestedStringArray(string[][] calldata value) + external + returns (string[][] memory) + { + return target.echoNestedStringArray(value); + } + + function benchEchoNestedStringU64PairArray(StringU64PairDyn[][] calldata value) + external + returns (StringU64PairDyn[][] memory) + { + return target.echoNestedStringU64PairArray(value); + } + + function benchEchoBytesU64Pair(BytesU64Pair calldata value) + external + returns (BytesU64Pair memory) + { + return target.echoBytesU64Pair(value); + } + + function benchEchoBytesU64PairArray(BytesU64Pair[] calldata value) + external + returns (BytesU64Pair[] memory) + { + return target.echoBytesU64PairArray(value); + } + + function benchEchoNestedBytesU64PairArray(BytesU64Pair[][] calldata value) + external + returns (BytesU64Pair[][] memory) + { + return target.echoNestedBytesU64PairArray(value); + } +} diff --git a/benchmarks/foundry-abi/src/FixedArrayCeilingSuiteSol.sol b/benchmarks/foundry-abi/src/FixedArrayCeilingSuiteSol.sol new file mode 100644 index 0000000000..23503e3173 --- /dev/null +++ b/benchmarks/foundry-abi/src/FixedArrayCeilingSuiteSol.sol @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +interface IFixedArrayCeilingSuite { + function echoBoolArray17(bool[17] calldata value) external returns (bool[17] memory); + function echoUintArray32(uint256[32] calldata value) external returns (uint256[32] memory); + function echoStringArray17(string[17] calldata value) external returns (string[17] memory); + function echoBytesArray17(bytes[17] calldata value) external returns (bytes[17] memory); +} + +contract FixedArrayCeilingSuiteSol is IFixedArrayCeilingSuite { + function echoBoolArray17(bool[17] calldata value) external pure returns (bool[17] memory) { + return value; + } + + function echoUintArray32(uint256[32] calldata value) external pure returns (uint256[32] memory) { + return value; + } + + function echoStringArray17(string[17] calldata value) external pure returns (string[17] memory) { + return value; + } + + function echoBytesArray17(bytes[17] calldata value) external pure returns (bytes[17] memory) { + return value; + } +} + +contract FixedArrayCeilingSolBenchCaller { + IFixedArrayCeilingSuite public immutable target; + + constructor(address target_) { + target = IFixedArrayCeilingSuite(target_); + } + + function benchEchoBoolArray17(bool[17] calldata value) external returns (bool[17] memory) { + return target.echoBoolArray17(value); + } + + function benchEchoUintArray32(uint256[32] calldata value) external returns (uint256[32] memory) { + return target.echoUintArray32(value); + } + + function benchEchoStringArray17(string[17] calldata value) external returns (string[17] memory) { + return target.echoStringArray17(value); + } + + function benchEchoBytesArray17(bytes[17] calldata value) external returns (bytes[17] memory) { + return target.echoBytesArray17(value); + } +} + +contract FixedArrayCeilingFeBenchCaller { + IFixedArrayCeilingSuite public immutable target; + + constructor(address target_) { + target = IFixedArrayCeilingSuite(target_); + } + + function benchEchoBoolArray17(bool[17] calldata value) external returns (bool[17] memory) { + return target.echoBoolArray17(value); + } + + function benchEchoUintArray32(uint256[32] calldata value) external returns (uint256[32] memory) { + return target.echoUintArray32(value); + } + + function benchEchoStringArray17(string[17] calldata value) external returns (string[17] memory) { + return target.echoStringArray17(value); + } + + function benchEchoBytesArray17(bytes[17] calldata value) external returns (bytes[17] memory) { + return target.echoBytesArray17(value); + } +} diff --git a/benchmarks/foundry-abi/src/FixedArraySuiteSol.sol b/benchmarks/foundry-abi/src/FixedArraySuiteSol.sol new file mode 100644 index 0000000000..a0751791d0 --- /dev/null +++ b/benchmarks/foundry-abi/src/FixedArraySuiteSol.sol @@ -0,0 +1,241 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +struct FixedBoolAddressPair { + bool flag; + address addr; +} + +struct FixedStringU64Pair { + string text; + uint64 count; +} + +struct FixedBytesU64Pair { + bytes data; + uint64 count; +} + +interface IFixedArraySuite { + function echoBoolArray5(bool[5] calldata value) external returns (bool[5] memory); + function echoBoolArray17(bool[17] calldata value) external returns (bool[17] memory); + function echoUintArray8(uint256[8] calldata value) external returns (uint256[8] memory); + function echoUintArray16(uint256[16] calldata value) external returns (uint256[16] memory); + function echoUintArray32(uint256[32] calldata value) external returns (uint256[32] memory); + function echoStringArray5(string[5] calldata value) external returns (string[5] memory); + function echoStringArray17(string[17] calldata value) external returns (string[17] memory); + function echoBytesArray5(bytes[5] calldata value) external returns (bytes[5] memory); + function echoBytesArray17(bytes[17] calldata value) external returns (bytes[17] memory); + function echoBoolAddressPairArray8(FixedBoolAddressPair[8] calldata value) + external + returns (FixedBoolAddressPair[8] memory); + function echoStringU64PairArray5(FixedStringU64Pair[5] calldata value) + external + returns (FixedStringU64Pair[5] memory); + function echoBytesU64PairArray5(FixedBytesU64Pair[5] calldata value) external returns (FixedBytesU64Pair[5] memory); + function echoNestedUintArray2x5(uint256[5][2] calldata value) external returns (uint256[5][2] memory); +} + +contract FixedArraySuiteSol is IFixedArraySuite { + function echoBoolArray5(bool[5] calldata value) external pure returns (bool[5] memory) { + return value; + } + + function echoBoolArray17(bool[17] calldata value) external pure returns (bool[17] memory) { + return value; + } + + function echoUintArray8(uint256[8] calldata value) external pure returns (uint256[8] memory) { + return value; + } + + function echoUintArray16(uint256[16] calldata value) external pure returns (uint256[16] memory) { + return value; + } + + function echoUintArray32(uint256[32] calldata value) external pure returns (uint256[32] memory) { + return value; + } + + function echoStringArray5(string[5] calldata value) external pure returns (string[5] memory) { + return value; + } + + function echoStringArray17(string[17] calldata value) external pure returns (string[17] memory) { + return value; + } + + function echoBytesArray5(bytes[5] calldata value) external pure returns (bytes[5] memory) { + return value; + } + + function echoBytesArray17(bytes[17] calldata value) external pure returns (bytes[17] memory) { + return value; + } + + function echoBoolAddressPairArray8(FixedBoolAddressPair[8] calldata value) + external + pure + returns (FixedBoolAddressPair[8] memory) + { + return value; + } + + function echoStringU64PairArray5(FixedStringU64Pair[5] calldata value) + external + pure + returns (FixedStringU64Pair[5] memory) + { + return value; + } + + function echoBytesU64PairArray5(FixedBytesU64Pair[5] calldata value) + external + pure + returns (FixedBytesU64Pair[5] memory) + { + return value; + } + + function echoNestedUintArray2x5(uint256[5][2] calldata value) external pure returns (uint256[5][2] memory) { + return value; + } +} + +contract FixedArraySolBenchCaller { + IFixedArraySuite public immutable target; + + constructor(address target_) { + target = IFixedArraySuite(target_); + } + + function benchEchoBoolArray5(bool[5] calldata value) external returns (bool[5] memory) { + return target.echoBoolArray5(value); + } + + function benchEchoBoolArray17(bool[17] calldata value) external returns (bool[17] memory) { + return target.echoBoolArray17(value); + } + + function benchEchoUintArray8(uint256[8] calldata value) external returns (uint256[8] memory) { + return target.echoUintArray8(value); + } + + function benchEchoUintArray16(uint256[16] calldata value) external returns (uint256[16] memory) { + return target.echoUintArray16(value); + } + + function benchEchoUintArray32(uint256[32] calldata value) external returns (uint256[32] memory) { + return target.echoUintArray32(value); + } + + function benchEchoStringArray5(string[5] calldata value) external returns (string[5] memory) { + return target.echoStringArray5(value); + } + + function benchEchoStringArray17(string[17] calldata value) external returns (string[17] memory) { + return target.echoStringArray17(value); + } + + function benchEchoBytesArray5(bytes[5] calldata value) external returns (bytes[5] memory) { + return target.echoBytesArray5(value); + } + + function benchEchoBytesArray17(bytes[17] calldata value) external returns (bytes[17] memory) { + return target.echoBytesArray17(value); + } + + function benchEchoBoolAddressPairArray8(FixedBoolAddressPair[8] calldata value) + external + returns (FixedBoolAddressPair[8] memory) + { + return target.echoBoolAddressPairArray8(value); + } + + function benchEchoStringU64PairArray5(FixedStringU64Pair[5] calldata value) + external + returns (FixedStringU64Pair[5] memory) + { + return target.echoStringU64PairArray5(value); + } + + function benchEchoBytesU64PairArray5(FixedBytesU64Pair[5] calldata value) + external + returns (FixedBytesU64Pair[5] memory) + { + return target.echoBytesU64PairArray5(value); + } + + function benchEchoNestedUintArray2x5(uint256[5][2] calldata value) external returns (uint256[5][2] memory) { + return target.echoNestedUintArray2x5(value); + } +} + +contract FixedArrayFeBenchCaller { + IFixedArraySuite public immutable target; + + constructor(address target_) { + target = IFixedArraySuite(target_); + } + + function benchEchoBoolArray5(bool[5] calldata value) external returns (bool[5] memory) { + return target.echoBoolArray5(value); + } + + function benchEchoBoolArray17(bool[17] calldata value) external returns (bool[17] memory) { + return target.echoBoolArray17(value); + } + + function benchEchoUintArray8(uint256[8] calldata value) external returns (uint256[8] memory) { + return target.echoUintArray8(value); + } + + function benchEchoUintArray16(uint256[16] calldata value) external returns (uint256[16] memory) { + return target.echoUintArray16(value); + } + + function benchEchoUintArray32(uint256[32] calldata value) external returns (uint256[32] memory) { + return target.echoUintArray32(value); + } + + function benchEchoStringArray5(string[5] calldata value) external returns (string[5] memory) { + return target.echoStringArray5(value); + } + + function benchEchoStringArray17(string[17] calldata value) external returns (string[17] memory) { + return target.echoStringArray17(value); + } + + function benchEchoBytesArray5(bytes[5] calldata value) external returns (bytes[5] memory) { + return target.echoBytesArray5(value); + } + + function benchEchoBytesArray17(bytes[17] calldata value) external returns (bytes[17] memory) { + return target.echoBytesArray17(value); + } + + function benchEchoBoolAddressPairArray8(FixedBoolAddressPair[8] calldata value) + external + returns (FixedBoolAddressPair[8] memory) + { + return target.echoBoolAddressPairArray8(value); + } + + function benchEchoStringU64PairArray5(FixedStringU64Pair[5] calldata value) + external + returns (FixedStringU64Pair[5] memory) + { + return target.echoStringU64PairArray5(value); + } + + function benchEchoBytesU64PairArray5(FixedBytesU64Pair[5] calldata value) + external + returns (FixedBytesU64Pair[5] memory) + { + return target.echoBytesU64PairArray5(value); + } + + function benchEchoNestedUintArray2x5(uint256[5][2] calldata value) external returns (uint256[5][2] memory) { + return target.echoNestedUintArray2x5(value); + } +} diff --git a/benchmarks/foundry-abi/src/NestedTupleSuiteSol.sol b/benchmarks/foundry-abi/src/NestedTupleSuiteSol.sol new file mode 100644 index 0000000000..05ecf22fd1 --- /dev/null +++ b/benchmarks/foundry-abi/src/NestedTupleSuiteSol.sol @@ -0,0 +1,185 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +// Use suite-prefixed names to avoid collisions with the generated AbiRoundtrip +// harness and other focused suites in the same Foundry compilation unit. +struct NTBoolAddressPair { + bool flag; + address addr; +} + +struct NTAddressU256Pair { + address addr; + uint256 count; +} + +// ABI type: ((bool,address),uint256) +struct NTNestedStatic { + NTBoolAddressPair inner; + uint256 count; +} + +// ABI type: (bool,(address,uint256)) +struct NTNestedStaticFlipped { + bool flag; + NTAddressU256Pair inner; +} + +struct NTStringU64Pair { + string text; + uint64 count; +} + +// ABI type: ((string,uint64),bool) +struct NTNestedDynamic { + NTStringU64Pair pair; + bool flag; +} + +struct NTBytesBoolPair { + bytes data; + bool flag; +} + +// ABI type: ((string,uint64),(bytes,bool)) +struct NTNestedDynamicBoth { + NTStringU64Pair left; + NTBytesBoolPair right; +} + +interface INestedTupleSuite { + function echoNestedStatic(NTNestedStatic calldata value) external returns (NTNestedStatic memory); + function echoNestedStaticFlipped(NTNestedStaticFlipped calldata value) + external + returns (NTNestedStaticFlipped memory); + function echoNestedDynamic(NTNestedDynamic calldata value) external returns (NTNestedDynamic memory); + function echoNestedDynamicBoth(NTNestedDynamicBoth calldata value) external returns (NTNestedDynamicBoth memory); + + function echoNestedStaticArray(NTNestedStatic[4] calldata value) + external + returns (NTNestedStatic[4] memory); + function echoNestedStaticDynArray(NTNestedStatic[] calldata value) + external + returns (NTNestedStatic[] memory); +} + +contract NestedTupleSuiteSol is INestedTupleSuite { + function echoNestedStatic(NTNestedStatic calldata value) external pure returns (NTNestedStatic memory) { + return value; + } + + function echoNestedStaticFlipped(NTNestedStaticFlipped calldata value) + external + pure + returns (NTNestedStaticFlipped memory) + { + return value; + } + + function echoNestedDynamic(NTNestedDynamic calldata value) external pure returns (NTNestedDynamic memory) { + return value; + } + + function echoNestedDynamicBoth(NTNestedDynamicBoth calldata value) external pure returns (NTNestedDynamicBoth memory) { + return value; + } + + function echoNestedStaticArray(NTNestedStatic[4] calldata value) + external + pure + returns (NTNestedStatic[4] memory) + { + return value; + } + + function echoNestedStaticDynArray(NTNestedStatic[] calldata value) + external + pure + returns (NTNestedStatic[] memory) + { + return value; + } +} + +contract NestedTupleSolBenchCaller { + INestedTupleSuite public immutable target; + + constructor(address target_) { + target = INestedTupleSuite(target_); + } + + function benchEchoNestedStatic(NTNestedStatic calldata value) external returns (NTNestedStatic memory) { + return target.echoNestedStatic(value); + } + + function benchEchoNestedStaticFlipped(NTNestedStaticFlipped calldata value) + external + returns (NTNestedStaticFlipped memory) + { + return target.echoNestedStaticFlipped(value); + } + + function benchEchoNestedDynamic(NTNestedDynamic calldata value) external returns (NTNestedDynamic memory) { + return target.echoNestedDynamic(value); + } + + function benchEchoNestedDynamicBoth(NTNestedDynamicBoth calldata value) external returns (NTNestedDynamicBoth memory) { + return target.echoNestedDynamicBoth(value); + } + + function benchEchoNestedStaticArray(NTNestedStatic[4] calldata value) + external + returns (NTNestedStatic[4] memory) + { + return target.echoNestedStaticArray(value); + } + + function benchEchoNestedStaticDynArray(NTNestedStatic[] calldata value) + external + returns (NTNestedStatic[] memory) + { + return target.echoNestedStaticDynArray(value); + } +} + +contract NestedTupleFeBenchCaller { + INestedTupleSuite public immutable target; + + constructor(address target_) { + target = INestedTupleSuite(target_); + } + + function benchEchoNestedStatic(NTNestedStatic calldata value) external returns (NTNestedStatic memory) { + return target.echoNestedStatic(value); + } + + function benchEchoNestedStaticFlipped(NTNestedStaticFlipped calldata value) + external + returns (NTNestedStaticFlipped memory) + { + return target.echoNestedStaticFlipped(value); + } + + function benchEchoNestedDynamic(NTNestedDynamic calldata value) external returns (NTNestedDynamic memory) { + return target.echoNestedDynamic(value); + } + + function benchEchoNestedDynamicBoth(NTNestedDynamicBoth calldata value) external returns (NTNestedDynamicBoth memory) { + return target.echoNestedDynamicBoth(value); + } + + function benchEchoNestedStaticArray(NTNestedStatic[4] calldata value) + external + returns (NTNestedStatic[4] memory) + { + return target.echoNestedStaticArray(value); + } + + function benchEchoNestedStaticDynArray(NTNestedStatic[] calldata value) + external + returns (NTNestedStatic[] memory) + { + return target.echoNestedStaticDynArray(value); + } +} + diff --git a/benchmarks/foundry-abi/test/AbiRoundtripEquivalence.t.sol b/benchmarks/foundry-abi/test/AbiRoundtripEquivalence.t.sol new file mode 100644 index 0000000000..a86dce78eb --- /dev/null +++ b/benchmarks/foundry-abi/test/AbiRoundtripEquivalence.t.sol @@ -0,0 +1,157 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import { + AbiRoundtripSol, + FeBenchCaller, + IAbiRoundtrip, + SolBenchCaller, + StringU64Pair +} from "../src/AbiRoundtripSol.sol"; + +interface Vm { + function readFile(string calldata path) external returns (string memory); +} + +contract AbiRoundtripEquivalenceTest { + Vm constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); + + AbiRoundtripSol internal solTarget; + address internal feTarget; + SolBenchCaller internal solBench; + FeBenchCaller internal feBench; + + function setUp() public { + solTarget = new AbiRoundtripSol(); + feTarget = deploy(fromHex(vm.readFile("fe-out/AbiRoundtripFe.bin"))); + require(feTarget != address(0), "fe create failed"); + + solBench = new SolBenchCaller(address(solTarget)); + feBench = new FeBenchCaller(feTarget); + } + + function testEchoUintEquivalence() public { + bytes memory callData = + abi.encodeWithSelector(IAbiRoundtrip.echoUint.selector, uint256(0x123456789abcdef)); + assertEquivalent(callData); + } + + function testEchoStringEquivalence() public { + bytes memory callData = + abi.encodeWithSelector(IAbiRoundtrip.echoString.selector, string("hello roundtrip")); + assertEquivalent(callData); + } + + function testEchoStringBoundaryEquivalence() public { + string memory text = "0123456789abcdefghijklmnopqrstuv"; + require(bytes(text).length == 32, "expected 32-byte fixture"); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoString.selector, text); + assertEquivalent(callData); + } + + function testEchoPairEquivalence() public { + StringU64Pair memory pair = StringU64Pair({text: "pair payload", count: 42}); + bytes memory callData = abi.encodeWithSelector( + IAbiRoundtrip.echoPair.selector, + pair + ); + assertEquivalent(callData); + } + + function testBenchEchoUint() public { + uint256 value = 77; + require(solBench.benchEchoUint(value) == value, "sol uint"); + require(feBench.benchEchoUint(value) == value, "fe uint"); + } + + function testBenchEchoString() public { + string memory text = "benchmark string"; + require( + keccak256(bytes(solBench.benchEchoString(text))) == keccak256(bytes(text)), + "sol string" + ); + require( + keccak256(bytes(feBench.benchEchoString(text))) == keccak256(bytes(text)), + "fe string" + ); + } + + function testBenchEchoPair() public { + StringU64Pair memory pair = StringU64Pair({text: "bench pair", count: 99}); + + StringU64Pair memory solValue = solBench.benchEchoPair(pair); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(pair)), "sol value"); + + StringU64Pair memory feValue = feBench.benchEchoPair(pair); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(pair)), "fe value"); + } + + function assertEquivalent(bytes memory callData) internal { + (bool okSol, bytes memory outSol) = address(solTarget).call(callData); + (bool okFe, bytes memory outFe) = feTarget.call(callData); + + require(okSol == okFe, "success mismatch"); + require(okSol, "call failed"); + require(keccak256(outSol) == keccak256(outFe), "return bytes mismatch"); + } + + function deploy(bytes memory initCode) internal returns (address deployed) { + assembly { + deployed := create(0, add(initCode, 0x20), mload(initCode)) + } + } + + function fromHex(string memory s) internal pure returns (bytes memory) { + bytes memory strBytes = bytes(s); + uint256 start = 0; + while (start < strBytes.length && isWhitespace(strBytes[start])) { + start++; + } + + if ( + start + 1 < strBytes.length && + strBytes[start] == bytes1("0") && + (strBytes[start + 1] == bytes1("x") || strBytes[start + 1] == bytes1("X")) + ) { + start += 2; + } + + uint256 digits = 0; + for (uint256 i = start; i < strBytes.length; i++) { + if (isWhitespace(strBytes[i])) continue; + digits++; + } + require(digits % 2 == 0, "odd hex length"); + + bytes memory out = new bytes(digits / 2); + uint256 outIndex = 0; + uint8 high = 0; + bool highNibble = true; + for (uint256 i = start; i < strBytes.length; i++) { + bytes1 ch = strBytes[i]; + if (isWhitespace(ch)) continue; + uint8 val = fromHexChar(ch); + if (highNibble) { + high = val; + highNibble = false; + } else { + out[outIndex] = bytes1((high << 4) | val); + outIndex++; + highNibble = true; + } + } + return out; + } + + function isWhitespace(bytes1 ch) private pure returns (bool) { + return ch == 0x20 || ch == 0x0a || ch == 0x0d || ch == 0x09; + } + + function fromHexChar(bytes1 c) private pure returns (uint8) { + uint8 b = uint8(c); + if (b >= 48 && b <= 57) return b - 48; + if (b >= 65 && b <= 70) return b - 55; + if (b >= 97 && b <= 102) return b - 87; + revert("invalid hex"); + } +} diff --git a/benchmarks/foundry-abi/test/BytesSuiteEquivalence.t.sol b/benchmarks/foundry-abi/test/BytesSuiteEquivalence.t.sol new file mode 100644 index 0000000000..4c8b532b68 --- /dev/null +++ b/benchmarks/foundry-abi/test/BytesSuiteEquivalence.t.sol @@ -0,0 +1,149 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {BytesFeBenchCaller, BytesSolBenchCaller, BytesSuiteSol, IBytesSuite} from "../src/BytesSuiteSol.sol"; + +interface Vm { + function readFile(string calldata path) external returns (string memory); + function assume(bool condition) external; +} + +contract BytesSuiteEquivalenceTest { + Vm constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); + + BytesSuiteSol internal solTarget; + address internal feTarget; + BytesSolBenchCaller internal solBench; + BytesFeBenchCaller internal feBench; + + function setUp() public { + solTarget = new BytesSuiteSol(); + feTarget = deploy(fromHex(vm.readFile("fe-out/BytesSuite.bin"))); + require(feTarget != address(0), "fe create failed"); + + solBench = new BytesSolBenchCaller(address(solTarget)); + feBench = new BytesFeBenchCaller(feTarget); + } + + function testEchoBytesDeterministicShort() public { + bytes memory value = hex"00112233445566778899aabbccddeeff"; + assertEquivalent(abi.encodeWithSelector(IBytesSuite.echoBytes.selector, value)); + + assertTypedEquivalent(value); + } + + function testEchoBytesDeterministicLong() public { + bytes memory value = + hex"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637"; + assertEquivalent(abi.encodeWithSelector(IBytesSuite.echoBytes.selector, value)); + + assertTypedEquivalent(value); + } + + function testEchoBytesDeterministicWordBoundaries() public { + bytes memory value31 = hex"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e"; + bytes memory value32 = hex"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"; + bytes memory value33 = + hex"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20"; + + assertEquivalent(abi.encodeWithSelector(IBytesSuite.echoBytes.selector, value31)); + assertTypedEquivalent(value31); + + assertEquivalent(abi.encodeWithSelector(IBytesSuite.echoBytes.selector, value32)); + assertTypedEquivalent(value32); + + assertEquivalent(abi.encodeWithSelector(IBytesSuite.echoBytes.selector, value33)); + assertTypedEquivalent(value33); + } + + function testEchoBytesFuzz(bytes memory value) public { + value = truncateBytes(value, 96); + assertEquivalent(abi.encodeWithSelector(IBytesSuite.echoBytes.selector, value)); + assertTypedEquivalent(value); + } + + function assertEquivalent(bytes memory callData) internal { + (bool okSol, bytes memory outSol) = address(solTarget).call(callData); + (bool okFe, bytes memory outFe) = feTarget.call(callData); + + require(okSol == okFe, "success mismatch"); + require(okSol, "call failed"); + require(keccak256(outSol) == keccak256(outFe), "return bytes mismatch"); + } + + function deploy(bytes memory initCode) internal returns (address deployed) { + assembly { + deployed := create(0, add(initCode, 0x20), mload(initCode)) + } + } + + function assertTypedEquivalent(bytes memory value) internal { + bytes memory solValue = solBench.benchEchoBytes(value); + bytes memory feValue = feBench.benchEchoBytes(value); + require(keccak256(solValue) == keccak256(feValue), "typed bytes mismatch"); + } + + function truncateBytes(bytes memory value, uint256 maxLen) internal pure returns (bytes memory out) { + uint256 len = value.length; + if (len > maxLen) len = maxLen; + + out = new bytes(len); + for (uint256 i = 0; i < len; i++) { + out[i] = value[i]; + } + } + + function fromHex(string memory s) internal pure returns (bytes memory) { + bytes memory strBytes = bytes(s); + uint256 start = 0; + while (start < strBytes.length && isWhitespace(strBytes[start])) { + start++; + } + + if ( + start + 1 < strBytes.length && + strBytes[start] == bytes1("0") && + (strBytes[start + 1] == bytes1("x") || strBytes[start + 1] == bytes1("X")) + ) { + start += 2; + } + + uint256 digits = 0; + for (uint256 i = start; i < strBytes.length; i++) { + if (isWhitespace(strBytes[i])) continue; + digits++; + } + require(digits % 2 == 0, "odd hex length"); + + bytes memory out = new bytes(digits / 2); + uint256 outIndex = 0; + uint8 high = 0; + bool highNibble = true; + for (uint256 i = start; i < strBytes.length; i++) { + bytes1 ch = strBytes[i]; + if (isWhitespace(ch)) continue; + uint8 val = fromHexChar(ch); + if (highNibble) { + high = val; + highNibble = false; + } else { + out[outIndex] = bytes1((high << 4) | val); + outIndex++; + highNibble = true; + } + } + return out; + } + + function isWhitespace(bytes1 ch) private pure returns (bool) { + return ch == 0x20 || ch == 0x0a || ch == 0x0d || ch == 0x09; + } + + function fromHexChar(bytes1 c) private pure returns (uint8) { + uint8 b = uint8(c); + if (b >= 48 && b <= 57) return b - 48; + if (b >= 65 && b <= 70) return b - 55; + if (b >= 97 && b <= 102) return b - 87; + revert("invalid hex"); + } +} diff --git a/benchmarks/foundry-abi/test/DeepDynamicSuiteEquivalence.t.sol b/benchmarks/foundry-abi/test/DeepDynamicSuiteEquivalence.t.sol new file mode 100644 index 0000000000..b6dc84fdf8 --- /dev/null +++ b/benchmarks/foundry-abi/test/DeepDynamicSuiteEquivalence.t.sol @@ -0,0 +1,565 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import { + BytesU64Pair, + DeepDynamicFeBenchCaller, + DeepDynamicSolBenchCaller, + DeepDynamicSuiteSol, + IDeepDynamicSuite, + StringU64PairDyn +} from "../src/DeepDynamicSuiteSol.sol"; + +interface Vm { + function readFile(string calldata path) external returns (string memory); + function assume(bool condition) external; +} + +contract DeepDynamicSuiteEquivalenceTest { + Vm constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); + + DeepDynamicSuiteSol internal solTarget; + address internal feTarget; + DeepDynamicSolBenchCaller internal solBench; + DeepDynamicFeBenchCaller internal feBench; + + function setUp() public { + solTarget = new DeepDynamicSuiteSol(); + feTarget = deploy(fromHex(vm.readFile("fe-out/DeepDynamicSuite.bin"))); + require(feTarget != address(0), "fe create failed"); + + solBench = new DeepDynamicSolBenchCaller(address(solTarget)); + feBench = new DeepDynamicFeBenchCaller(feTarget); + } + + function testEchoUint24ArrayDeterministic() public { + uint24[] memory value = new uint24[](3); + value[0] = 0; + value[1] = 1; + value[2] = type(uint24).max; + + bytes memory callData = abi.encodeWithSelector(IDeepDynamicSuite.echoUint24Array.selector, value); + assertEquivalent(callData); + + uint24[] memory solValue = solBench.benchEchoUint24Array(value); + uint24[] memory feValue = feBench.benchEchoUint24Array(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed uint24[] mismatch"); + } + + function testEchoUint24ArrayFuzz(uint24[] memory value) public { + value = truncateUint24Array(value, 4); + bytes memory callData = abi.encodeWithSelector(IDeepDynamicSuite.echoUint24Array.selector, value); + assertEquivalent(callData); + } + + function testEchoBytesArrayDeterministic() public { + bytes[] memory value = new bytes[](3); + value[0] = hex""; + value[1] = hex"00112233"; + value[2] = + hex"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"; + + bytes memory callData = abi.encodeWithSelector(IDeepDynamicSuite.echoBytesArray.selector, value); + assertEquivalent(callData); + + bytes[] memory solValue = solBench.benchEchoBytesArray(value); + bytes[] memory feValue = feBench.benchEchoBytesArray(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed bytes[] mismatch"); + } + + function testEchoBytesArrayFuzz(bytes[] memory value) public { + value = truncateBytesArray(value, 3, 96); + bytes memory callData = abi.encodeWithSelector(IDeepDynamicSuite.echoBytesArray.selector, value); + assertEquivalent(callData); + assertBytesArrayTypedEquivalent(value); + } + + function testEchoNestedBytesArrayDeterministic() public { + bytes[][] memory value = new bytes[][](3); + value[0] = new bytes[](2); + value[0][0] = hex""; + value[0][1] = hex"00112233"; + value[1] = new bytes[](0); + value[2] = new bytes[](2); + value[2][0] = hex"101112131415161718191a1b1c1d1e1f"; + value[2][1] = + hex"202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f"; + + bytes memory callData = + abi.encodeWithSelector(IDeepDynamicSuite.echoNestedBytesArray.selector, value); + assertEquivalent(callData); + assertNestedBytesArrayTypedEquivalent(value); + } + + function testEchoNestedBytesArrayFuzz(bytes[][] memory value) public { + value = truncateBytesMatrix(value, 3, 3, 96); + bytes memory callData = + abi.encodeWithSelector(IDeepDynamicSuite.echoNestedBytesArray.selector, value); + assertEquivalent(callData); + assertNestedBytesArrayTypedEquivalent(value); + } + + function testEchoNestedUintArrayDeterministic() public { + uint256[][] memory value = new uint256[][](3); + value[0] = new uint256[](2); + value[0][0] = 1; + value[0][1] = 2; + value[1] = new uint256[](0); + value[2] = new uint256[](1); + value[2][0] = type(uint256).max; + + bytes memory callData = + abi.encodeWithSelector(IDeepDynamicSuite.echoNestedUintArray.selector, value); + assertEquivalent(callData); + + uint256[][] memory solValue = solBench.benchEchoNestedUintArray(value); + uint256[][] memory feValue = feBench.benchEchoNestedUintArray(value); + require( + keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), + "typed uint256[][] mismatch" + ); + } + + function testEchoNestedUintArrayFuzz(uint256[][] memory value) public { + value = truncateUintMatrix(value, 3, 3); + bytes memory callData = + abi.encodeWithSelector(IDeepDynamicSuite.echoNestedUintArray.selector, value); + assertEquivalent(callData); + assertNestedUintArrayTypedEquivalent(value); + } + + function testEchoNestedStringArrayDeterministic() public { + string[][] memory value = new string[][](3); + value[0] = new string[](2); + value[0][0] = "alpha"; + value[0][1] = "beta with extra payload bytes beyond thirty-two"; + value[1] = new string[](0); + value[2] = new string[](1); + value[2][0] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + + bytes memory callData = + abi.encodeWithSelector(IDeepDynamicSuite.echoNestedStringArray.selector, value); + assertEquivalent(callData); + + string[][] memory solValue = solBench.benchEchoNestedStringArray(value); + string[][] memory feValue = feBench.benchEchoNestedStringArray(value); + require( + keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), + "typed string[][] mismatch" + ); + } + + function testEchoNestedStringArrayFuzz(string[][] memory value) public { + value = truncateStringMatrix(value, 3, 3, 96); + bytes memory callData = + abi.encodeWithSelector(IDeepDynamicSuite.echoNestedStringArray.selector, value); + assertEquivalent(callData); + assertNestedStringArrayTypedEquivalent(value); + } + + function testEchoNestedStringU64PairArrayDeterministic() public { + StringU64PairDyn[][] memory value = new StringU64PairDyn[][](2); + value[0] = new StringU64PairDyn[](2); + value[0][0] = StringU64PairDyn({text: "pair-one-with-extra-payload-beyond-thirty-two", count: 1}); + value[0][1] = StringU64PairDyn({text: "pair-two-with-extra-payload-beyond-thirty-two", count: 2}); + value[1] = new StringU64PairDyn[](1); + value[1][0] = StringU64PairDyn({text: "tail-with-extra-payload-beyond-thirty-two", count: type(uint64).max}); + + bytes memory callData = + abi.encodeWithSelector(IDeepDynamicSuite.echoNestedStringU64PairArray.selector, value); + assertEquivalent(callData); + + StringU64PairDyn[][] memory solValue = solBench.benchEchoNestedStringU64PairArray(value); + StringU64PairDyn[][] memory feValue = feBench.benchEchoNestedStringU64PairArray(value); + require( + keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), + "typed (string,uint64)[][] mismatch" + ); + } + + function testEchoNestedStringU64PairArrayFuzz(StringU64PairDyn[][] memory value) public { + value = truncateStringU64PairMatrix(value, 3, 3, 96); + bytes memory callData = + abi.encodeWithSelector(IDeepDynamicSuite.echoNestedStringU64PairArray.selector, value); + assertEquivalent(callData); + assertNestedStringU64PairArrayTypedEquivalent(value); + } + + function testEchoBytesU64PairDeterministic() public { + BytesU64Pair memory value = BytesU64Pair({ + data: hex"00112233445566778899aabbccddeeff1011121314151617", + count: 77 + }); + + bytes memory callData = abi.encodeWithSelector(IDeepDynamicSuite.echoBytesU64Pair.selector, value); + assertEquivalent(callData); + + BytesU64Pair memory solValue = solBench.benchEchoBytesU64Pair(value); + BytesU64Pair memory feValue = feBench.benchEchoBytesU64Pair(value); + require( + keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), + "typed (bytes,uint64) mismatch" + ); + } + + function testEchoBytesU64PairFuzz(bytes memory data, uint64 count) public { + BytesU64Pair memory value = BytesU64Pair({data: truncateBytes(data, 96), count: count}); + bytes memory callData = abi.encodeWithSelector(IDeepDynamicSuite.echoBytesU64Pair.selector, value); + assertEquivalent(callData); + assertBytesU64PairTypedEquivalent(value); + } + + function testEchoBytesU64PairArrayDeterministic() public { + BytesU64Pair[] memory value = new BytesU64Pair[](2); + value[0] = BytesU64Pair({data: hex"00112233", count: 11}); + value[1] = BytesU64Pair({ + data: hex"101112131415161718191a1b1c1d1e1f2021222324252627", + count: 22 + }); + + bytes memory callData = + abi.encodeWithSelector(IDeepDynamicSuite.echoBytesU64PairArray.selector, value); + assertEquivalent(callData); + + BytesU64Pair[] memory solValue = solBench.benchEchoBytesU64PairArray(value); + BytesU64Pair[] memory feValue = feBench.benchEchoBytesU64PairArray(value); + require( + keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), + "typed (bytes,uint64)[] mismatch" + ); + } + + function testEchoBytesU64PairArrayFuzz(BytesU64Pair[] memory value) public { + value = truncateBytesU64PairArray(value, 3, 96); + bytes memory callData = + abi.encodeWithSelector(IDeepDynamicSuite.echoBytesU64PairArray.selector, value); + assertEquivalent(callData); + assertBytesU64PairArrayTypedEquivalent(value); + } + + function testEchoNestedBytesU64PairArrayDeterministic() public { + BytesU64Pair[][] memory value = new BytesU64Pair[][](3); + value[0] = new BytesU64Pair[](2); + value[0][0] = BytesU64Pair({data: hex"00112233", count: 11}); + value[0][1] = BytesU64Pair({data: hex"", count: 12}); + value[1] = new BytesU64Pair[](0); + value[2] = new BytesU64Pair[](2); + value[2][0] = BytesU64Pair({ + data: hex"101112131415161718191a1b1c1d1e1f2021222324252627", + count: 21 + }); + value[2][1] = BytesU64Pair({ + data: hex"303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f", + count: type(uint64).max + }); + + bytes memory callData = + abi.encodeWithSelector(IDeepDynamicSuite.echoNestedBytesU64PairArray.selector, value); + assertEquivalent(callData); + assertNestedBytesU64PairArrayTypedEquivalent(value); + } + + function testEchoNestedBytesU64PairArrayFuzz(BytesU64Pair[][] memory value) public { + value = truncateBytesU64PairMatrix(value, 3, 3, 96); + bytes memory callData = + abi.encodeWithSelector(IDeepDynamicSuite.echoNestedBytesU64PairArray.selector, value); + assertEquivalent(callData); + assertNestedBytesU64PairArrayTypedEquivalent(value); + } + + function assertEquivalent(bytes memory callData) internal { + (bool okSol, bytes memory outSol) = address(solTarget).call(callData); + (bool okFe, bytes memory outFe) = feTarget.call(callData); + + require(okSol == okFe, "success mismatch"); + require(okSol, "call failed"); + require(keccak256(outSol) == keccak256(outFe), "return bytes mismatch"); + } + + function assertBytesArrayTypedEquivalent(bytes[] memory value) internal { + bytes[] memory solValue = solBench.benchEchoBytesArray(value); + bytes[] memory feValue = feBench.benchEchoBytesArray(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed bytes[] mismatch"); + } + + function assertNestedBytesArrayTypedEquivalent(bytes[][] memory value) internal { + bytes[][] memory solValue = solBench.benchEchoNestedBytesArray(value); + bytes[][] memory feValue = feBench.benchEchoNestedBytesArray(value); + require( + keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), + "typed bytes[][] mismatch" + ); + } + + function assertNestedUintArrayTypedEquivalent(uint256[][] memory value) internal { + uint256[][] memory solValue = solBench.benchEchoNestedUintArray(value); + uint256[][] memory feValue = feBench.benchEchoNestedUintArray(value); + require( + keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), + "typed uint256[][] mismatch" + ); + } + + function assertNestedStringArrayTypedEquivalent(string[][] memory value) internal { + string[][] memory solValue = solBench.benchEchoNestedStringArray(value); + string[][] memory feValue = feBench.benchEchoNestedStringArray(value); + require( + keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), + "typed string[][] mismatch" + ); + } + + function assertNestedStringU64PairArrayTypedEquivalent(StringU64PairDyn[][] memory value) internal { + StringU64PairDyn[][] memory solValue = solBench.benchEchoNestedStringU64PairArray(value); + StringU64PairDyn[][] memory feValue = feBench.benchEchoNestedStringU64PairArray(value); + require( + keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), + "typed (string,uint64)[][] mismatch" + ); + } + + function assertBytesU64PairTypedEquivalent(BytesU64Pair memory value) internal { + BytesU64Pair memory solValue = solBench.benchEchoBytesU64Pair(value); + BytesU64Pair memory feValue = feBench.benchEchoBytesU64Pair(value); + require( + keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), + "typed (bytes,uint64) mismatch" + ); + } + + function assertBytesU64PairArrayTypedEquivalent(BytesU64Pair[] memory value) internal { + BytesU64Pair[] memory solValue = solBench.benchEchoBytesU64PairArray(value); + BytesU64Pair[] memory feValue = feBench.benchEchoBytesU64PairArray(value); + require( + keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), + "typed (bytes,uint64)[] mismatch" + ); + } + + function assertNestedBytesU64PairArrayTypedEquivalent(BytesU64Pair[][] memory value) internal { + BytesU64Pair[][] memory solValue = solBench.benchEchoNestedBytesU64PairArray(value); + BytesU64Pair[][] memory feValue = feBench.benchEchoNestedBytesU64PairArray(value); + require( + keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), + "typed (bytes,uint64)[][] mismatch" + ); + } + + function truncateUint24Array(uint24[] memory value, uint256 maxLen) + internal + pure + returns (uint24[] memory out) + { + uint256 len = value.length; + if (len > maxLen) len = maxLen; + + out = new uint24[](len); + for (uint256 i = 0; i < len; i++) { + out[i] = value[i]; + } + } + + function truncateBytesArray(bytes[] memory value, uint256 maxLen, uint256 maxBytesLen) + internal + pure + returns (bytes[] memory out) + { + uint256 len = value.length; + if (len > maxLen) len = maxLen; + + out = new bytes[](len); + for (uint256 i = 0; i < len; i++) { + out[i] = truncateBytes(value[i], maxBytesLen); + } + } + + function truncateBytesMatrix( + bytes[][] memory value, + uint256 maxOuterLen, + uint256 maxInnerLen, + uint256 maxBytesLen + ) internal pure returns (bytes[][] memory out) { + uint256 outerLen = value.length; + if (outerLen > maxOuterLen) outerLen = maxOuterLen; + + out = new bytes[][](outerLen); + for (uint256 i = 0; i < outerLen; i++) { + out[i] = truncateBytesArray(value[i], maxInnerLen, maxBytesLen); + } + } + + function truncateUintMatrix(uint256[][] memory value, uint256 maxOuterLen, uint256 maxInnerLen) + internal + pure + returns (uint256[][] memory out) + { + uint256 outerLen = value.length; + if (outerLen > maxOuterLen) outerLen = maxOuterLen; + + out = new uint256[][](outerLen); + for (uint256 i = 0; i < outerLen; i++) { + uint256 innerLen = value[i].length; + if (innerLen > maxInnerLen) innerLen = maxInnerLen; + + out[i] = new uint256[](innerLen); + for (uint256 j = 0; j < innerLen; j++) { + out[i][j] = value[i][j]; + } + } + } + + function truncateStringMatrix( + string[][] memory value, + uint256 maxOuterLen, + uint256 maxInnerLen, + uint256 maxStringBytes + ) internal pure returns (string[][] memory out) { + uint256 outerLen = value.length; + if (outerLen > maxOuterLen) outerLen = maxOuterLen; + + out = new string[][](outerLen); + for (uint256 i = 0; i < outerLen; i++) { + uint256 innerLen = value[i].length; + if (innerLen > maxInnerLen) innerLen = maxInnerLen; + + out[i] = new string[](innerLen); + for (uint256 j = 0; j < innerLen; j++) { + out[i][j] = truncateString(value[i][j], maxStringBytes); + } + } + } + + function truncateStringU64PairMatrix( + StringU64PairDyn[][] memory value, + uint256 maxOuterLen, + uint256 maxInnerLen, + uint256 maxStringBytes + ) internal pure returns (StringU64PairDyn[][] memory out) { + uint256 outerLen = value.length; + if (outerLen > maxOuterLen) outerLen = maxOuterLen; + + out = new StringU64PairDyn[][](outerLen); + for (uint256 i = 0; i < outerLen; i++) { + uint256 innerLen = value[i].length; + if (innerLen > maxInnerLen) innerLen = maxInnerLen; + + out[i] = new StringU64PairDyn[](innerLen); + for (uint256 j = 0; j < innerLen; j++) { + out[i][j] = StringU64PairDyn({ + text: truncateString(value[i][j].text, maxStringBytes), + count: value[i][j].count + }); + } + } + } + + function truncateBytesU64PairArray( + BytesU64Pair[] memory value, + uint256 maxLen, + uint256 maxBytesLen + ) internal pure returns (BytesU64Pair[] memory out) { + uint256 len = value.length; + if (len > maxLen) len = maxLen; + + out = new BytesU64Pair[](len); + for (uint256 i = 0; i < len; i++) { + out[i] = BytesU64Pair({ + data: truncateBytes(value[i].data, maxBytesLen), + count: value[i].count + }); + } + } + + function truncateBytesU64PairMatrix( + BytesU64Pair[][] memory value, + uint256 maxOuterLen, + uint256 maxInnerLen, + uint256 maxBytesLen + ) internal pure returns (BytesU64Pair[][] memory out) { + uint256 outerLen = value.length; + if (outerLen > maxOuterLen) outerLen = maxOuterLen; + + out = new BytesU64Pair[][](outerLen); + for (uint256 i = 0; i < outerLen; i++) { + out[i] = truncateBytesU64PairArray(value[i], maxInnerLen, maxBytesLen); + } + } + + function truncateString(string memory text, uint256 maxBytes) + internal + pure + returns (string memory) + { + return string(truncateBytes(bytes(text), maxBytes)); + } + + function truncateBytes(bytes memory value, uint256 maxLen) internal pure returns (bytes memory out) { + uint256 len = value.length; + if (len > maxLen) len = maxLen; + + out = new bytes(len); + for (uint256 i = 0; i < len; i++) { + out[i] = value[i]; + } + } + + function deploy(bytes memory initCode) internal returns (address deployed) { + assembly { + deployed := create(0, add(initCode, 0x20), mload(initCode)) + } + } + + function fromHex(string memory s) internal pure returns (bytes memory) { + bytes memory strBytes = bytes(s); + uint256 start = 0; + while (start < strBytes.length && isWhitespace(strBytes[start])) { + start++; + } + + if ( + start + 1 < strBytes.length && + strBytes[start] == bytes1("0") && + (strBytes[start + 1] == bytes1("x") || strBytes[start + 1] == bytes1("X")) + ) { + start += 2; + } + + uint256 digits = 0; + for (uint256 i = start; i < strBytes.length; i++) { + if (isWhitespace(strBytes[i])) continue; + digits++; + } + require(digits % 2 == 0, "odd hex length"); + + bytes memory out = new bytes(digits / 2); + uint256 outIndex = 0; + uint8 high = 0; + bool highNibble = true; + for (uint256 i = start; i < strBytes.length; i++) { + bytes1 ch = strBytes[i]; + if (isWhitespace(ch)) continue; + uint8 val = fromHexChar(ch); + if (highNibble) { + high = val; + highNibble = false; + } else { + out[outIndex] = bytes1((high << 4) | val); + outIndex++; + highNibble = true; + } + } + return out; + } + + function isWhitespace(bytes1 ch) private pure returns (bool) { + return ch == 0x20 || ch == 0x0a || ch == 0x0d || ch == 0x09; + } + + function fromHexChar(bytes1 c) private pure returns (uint8) { + uint8 b = uint8(c); + if (b >= 48 && b <= 57) return b - 48; + if (b >= 65 && b <= 70) return b - 55; + if (b >= 97 && b <= 102) return b - 87; + revert("invalid hex"); + } +} diff --git a/benchmarks/foundry-abi/test/DynArraySuiteEquivalence.t.sol b/benchmarks/foundry-abi/test/DynArraySuiteEquivalence.t.sol new file mode 100644 index 0000000000..1855dcf9e1 --- /dev/null +++ b/benchmarks/foundry-abi/test/DynArraySuiteEquivalence.t.sol @@ -0,0 +1,221 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripSol, BoolAddressPair, FeBenchCaller, IAbiRoundtrip, SolBenchCaller, StringU64Pair} from "../src/AbiRoundtripSol.sol"; +import {AbiRoundtripBase} from "./generated/support/AbiRoundtripBase.sol"; + +contract DynArraySuiteEquivalenceTest is AbiRoundtripBase { + function setUp() public override { + solTarget = new AbiRoundtripSol(); + feTarget = deploy(fromHex(vm.readFile("fe-out/DynArraySuite.bin"))); + require(feTarget != address(0), "fe create failed"); + + solBench = new SolBenchCaller(address(solTarget)); + feBench = new FeBenchCaller(feTarget); + } + + function testEchoUintArrayDeterministic() public { + uint256[] memory value = new uint256[](3); + value[0] = 1; + value[1] = 2; + value[2] = type(uint256).max; + + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUintArray.selector, value); + assertEquivalent(callData); + + uint256[] memory solValue = solBench.benchEchoUintArray(value); + uint256[] memory feValue = feBench.benchEchoUintArray(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed uint[] mismatch"); + } + + function testEchoUintArrayFuzz(uint256[] memory value) public { + value = truncateUintArray(value, 4); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUintArray.selector, value); + assertEquivalent(callData); + assertUintArrayTypedEquivalent(value); + } + + function testEchoBoolAddressPairArrayDeterministic() public { + BoolAddressPair[] memory value = new BoolAddressPair[](2); + value[0] = BoolAddressPair({flag: true, addr: address(0x1234)}); + value[1] = BoolAddressPair({flag: false, addr: address(0xBEEF)}); + + bytes memory callData = + abi.encodeWithSelector(IAbiRoundtrip.echoBoolAddressPairArray.selector, value); + assertEquivalent(callData); + + BoolAddressPair[] memory solValue = solBench.benchEchoBoolAddressPairArray(value); + BoolAddressPair[] memory feValue = feBench.benchEchoBoolAddressPairArray(value); + require( + keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), + "typed (bool,address)[] mismatch" + ); + } + + function testEchoBoolAddressPairArrayFuzz(BoolAddressPair[] memory value) public { + value = truncateBoolAddressPairArray(value, 4); + bytes memory callData = + abi.encodeWithSelector(IAbiRoundtrip.echoBoolAddressPairArray.selector, value); + assertEquivalent(callData); + assertBoolAddressPairArrayTypedEquivalent(value); + } + + function testEchoStringArrayDeterministic() public { + string[] memory value = new string[](3); + value[0] = "alpha"; + value[1] = "beta gamma with extra payload bytes beyond thirty-two"; + value[2] = "delta with extra payload bytes beyond thirty-two"; + + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoStringArray.selector, value); + assertEquivalent(callData); + + string[] memory solValue = solBench.benchEchoStringArray(value); + string[] memory feValue = feBench.benchEchoStringArray(value); + require( + keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), + "typed string[] mismatch" + ); + } + + function testEchoStringArrayFuzz(string[] memory value) public { + value = truncateStringArray(value, 4, 96); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoStringArray.selector, value); + assertEquivalent(callData); + assertStringArrayTypedEquivalent(value); + } + + function testEchoStringU64PairArrayDeterministic() public { + StringU64Pair[] memory value = new StringU64Pair[](2); + value[0] = StringU64Pair({text: "hello with extra payload bytes beyond thirty-two", count: 7}); + value[1] = StringU64Pair({text: "world with extra payload bytes beyond thirty-two", count: 11}); + + bytes memory callData = + abi.encodeWithSelector(IAbiRoundtrip.echoStringU64PairArray.selector, value); + assertEquivalent(callData); + + StringU64Pair[] memory solValue = solBench.benchEchoStringU64PairArray(value); + StringU64Pair[] memory feValue = feBench.benchEchoStringU64PairArray(value); + require( + keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), + "typed (string,uint64)[] mismatch" + ); + } + + function testEchoStringU64PairArrayFuzz(StringU64Pair[] memory value) public { + value = truncateStringU64PairArray(value, 4, 96); + bytes memory callData = + abi.encodeWithSelector(IAbiRoundtrip.echoStringU64PairArray.selector, value); + assertEquivalent(callData); + assertStringU64PairArrayTypedEquivalent(value); + } + + function assertUintArrayTypedEquivalent(uint256[] memory value) internal { + uint256[] memory solValue = solBench.benchEchoUintArray(value); + uint256[] memory feValue = feBench.benchEchoUintArray(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed uint[] mismatch"); + } + + function assertBoolAddressPairArrayTypedEquivalent(BoolAddressPair[] memory value) internal { + BoolAddressPair[] memory solValue = solBench.benchEchoBoolAddressPairArray(value); + BoolAddressPair[] memory feValue = feBench.benchEchoBoolAddressPairArray(value); + require( + keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), + "typed (bool,address)[] mismatch" + ); + } + + function assertStringArrayTypedEquivalent(string[] memory value) internal { + string[] memory solValue = solBench.benchEchoStringArray(value); + string[] memory feValue = feBench.benchEchoStringArray(value); + require( + keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), + "typed string[] mismatch" + ); + } + + function assertStringU64PairArrayTypedEquivalent(StringU64Pair[] memory value) internal { + StringU64Pair[] memory solValue = solBench.benchEchoStringU64PairArray(value); + StringU64Pair[] memory feValue = feBench.benchEchoStringU64PairArray(value); + require( + keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), + "typed (string,uint64)[] mismatch" + ); + } + + function truncateUintArray(uint256[] memory value, uint256 maxLen) + internal + pure + returns (uint256[] memory out) + { + uint256 len = value.length; + if (len > maxLen) len = maxLen; + + out = new uint256[](len); + for (uint256 i = 0; i < len; i++) { + out[i] = value[i]; + } + } + + function truncateBoolAddressPairArray(BoolAddressPair[] memory value, uint256 maxLen) + internal + pure + returns (BoolAddressPair[] memory out) + { + uint256 len = value.length; + if (len > maxLen) len = maxLen; + + out = new BoolAddressPair[](len); + for (uint256 i = 0; i < len; i++) { + out[i] = value[i]; + } + } + + function truncateStringArray(string[] memory value, uint256 maxLen, uint256 maxStringBytes) + internal + pure + returns (string[] memory out) + { + uint256 len = value.length; + if (len > maxLen) len = maxLen; + + out = new string[](len); + for (uint256 i = 0; i < len; i++) { + out[i] = truncateString(value[i], maxStringBytes); + } + } + + function truncateStringU64PairArray( + StringU64Pair[] memory value, + uint256 maxLen, + uint256 maxStringBytes + ) internal pure returns (StringU64Pair[] memory out) { + uint256 len = value.length; + if (len > maxLen) len = maxLen; + + out = new StringU64Pair[](len); + for (uint256 i = 0; i < len; i++) { + out[i] = StringU64Pair({ + text: truncateString(value[i].text, maxStringBytes), + count: value[i].count + }); + } + } + + function truncateString(string memory text, uint256 maxBytes) + internal + pure + returns (string memory) + { + return string(truncateBytes(bytes(text), maxBytes)); + } + + function truncateBytes(bytes memory value, uint256 maxLen) internal pure returns (bytes memory out) { + uint256 len = value.length; + if (len > maxLen) len = maxLen; + + out = new bytes(len); + for (uint256 i = 0; i < len; i++) { + out[i] = value[i]; + } + } +} diff --git a/benchmarks/foundry-abi/test/FixedArrayCeilingSuiteEquivalence.t.sol b/benchmarks/foundry-abi/test/FixedArrayCeilingSuiteEquivalence.t.sol new file mode 100644 index 0000000000..06f2bcd886 --- /dev/null +++ b/benchmarks/foundry-abi/test/FixedArrayCeilingSuiteEquivalence.t.sol @@ -0,0 +1,226 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import { + FixedArrayCeilingSuiteSol, + FixedArrayCeilingSolBenchCaller, + FixedArrayCeilingFeBenchCaller, + IFixedArrayCeilingSuite +} from "../src/FixedArrayCeilingSuiteSol.sol"; + +interface Vm { + function readFile(string calldata path) external returns (string memory); +} + +contract FixedArrayCeilingSuiteEquivalenceTest { + Vm constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); + + FixedArrayCeilingSuiteSol internal solTarget; + address internal feTarget; + FixedArrayCeilingSolBenchCaller internal solBench; + FixedArrayCeilingFeBenchCaller internal feBench; + + function setUp() public { + solTarget = new FixedArrayCeilingSuiteSol(); + feTarget = deploy(fromHex(vm.readFile("fe-out/FixedArrayCeilingSuite.bin"))); + require(feTarget != address(0), "fe create failed"); + + solBench = new FixedArrayCeilingSolBenchCaller(address(solTarget)); + feBench = new FixedArrayCeilingFeBenchCaller(feTarget); + } + + function testEchoBoolArray17Deterministic() public { + bool[17] memory value; + for (uint256 i = 0; i < 17; i++) { + value[i] = i % 2 == 0; + } + + assertEquivalent(abi.encodeWithSelector(IFixedArrayCeilingSuite.echoBoolArray17.selector, value)); + assertBoolArray17TypedEquivalent(value); + } + + function testEchoBoolArray17Fuzz(bool[17] memory value) public { + assertEquivalent(abi.encodeWithSelector(IFixedArrayCeilingSuite.echoBoolArray17.selector, value)); + assertBoolArray17TypedEquivalent(value); + } + + function testEchoUintArray32Deterministic() public { + uint256[32] memory value; + for (uint256 i = 0; i < 32; i++) { + value[i] = i + 1; + } + value[31] = type(uint256).max; + + assertEquivalent(abi.encodeWithSelector(IFixedArrayCeilingSuite.echoUintArray32.selector, value)); + assertUintArray32TypedEquivalent(value); + } + + function testEchoUintArray32Fuzz(uint256[32] memory value) public { + assertEquivalent(abi.encodeWithSelector(IFixedArrayCeilingSuite.echoUintArray32.selector, value)); + assertUintArray32TypedEquivalent(value); + } + + function testEchoStringArray17Deterministic() public { + string[17] memory value; + value[0] = ""; + value[1] = "alpha"; + value[2] = "beta gamma with extra payload bytes beyond thirty-two"; + value[8] = "delta with extra payload bytes beyond thirty-two"; + value[9] = "epsilon with extra payload bytes beyond thirty-two"; + value[16] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + + assertEquivalent(abi.encodeWithSelector(IFixedArrayCeilingSuite.echoStringArray17.selector, value)); + assertStringArray17TypedEquivalent(value); + } + + function testEchoStringArray17Fuzz(string[17] memory value) public { + value = normalizeStringArray17(value, 96); + assertEquivalent(abi.encodeWithSelector(IFixedArrayCeilingSuite.echoStringArray17.selector, value)); + assertStringArray17TypedEquivalent(value); + } + + function testEchoBytesArray17Deterministic() public { + bytes[17] memory value; + value[0] = hex""; + value[1] = hex"01"; + value[2] = hex"deadbeef"; + value[8] = bytes("payload"); + value[9] = hex"ffffffffffffffffffffffffffffffff"; + value[16] = hex"00112233445566778899aabbccddeeff"; + + assertEquivalent(abi.encodeWithSelector(IFixedArrayCeilingSuite.echoBytesArray17.selector, value)); + assertBytesArray17TypedEquivalent(value); + } + + function testEchoBytesArray17Fuzz(bytes[17] memory value) public { + value = normalizeBytesArray17(value, 64); + assertEquivalent(abi.encodeWithSelector(IFixedArrayCeilingSuite.echoBytesArray17.selector, value)); + assertBytesArray17TypedEquivalent(value); + } + + function assertEquivalent(bytes memory callData) internal { + (bool okSol, bytes memory outSol) = address(solTarget).call(callData); + (bool okFe, bytes memory outFe) = feTarget.call(callData); + + require(okSol == okFe, "success mismatch"); + require(okSol, "call failed"); + require(keccak256(outSol) == keccak256(outFe), "return bytes mismatch"); + } + + function assertBoolArray17TypedEquivalent(bool[17] memory value) internal { + bool[17] memory solValue = solBench.benchEchoBoolArray17(value); + bool[17] memory feValue = feBench.benchEchoBoolArray17(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed bool[17] mismatch"); + } + + function assertUintArray32TypedEquivalent(uint256[32] memory value) internal { + uint256[32] memory solValue = solBench.benchEchoUintArray32(value); + uint256[32] memory feValue = feBench.benchEchoUintArray32(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed uint256[32] mismatch"); + } + + function assertStringArray17TypedEquivalent(string[17] memory value) internal { + string[17] memory solValue = solBench.benchEchoStringArray17(value); + string[17] memory feValue = feBench.benchEchoStringArray17(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed string[17] mismatch"); + } + + function assertBytesArray17TypedEquivalent(bytes[17] memory value) internal { + bytes[17] memory solValue = solBench.benchEchoBytesArray17(value); + bytes[17] memory feValue = feBench.benchEchoBytesArray17(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed bytes[17] mismatch"); + } + + function normalizeStringArray17(string[17] memory value, uint256 maxStringBytes) + internal + pure + returns (string[17] memory out) + { + for (uint256 i = 0; i < 17; i++) { + out[i] = truncateString(value[i], maxStringBytes); + } + } + + function normalizeBytesArray17(bytes[17] memory value, uint256 maxBytes) + internal + pure + returns (bytes[17] memory out) + { + for (uint256 i = 0; i < 17; i++) { + out[i] = truncateBytes(value[i], maxBytes); + } + } + + function truncateString(string memory text, uint256 maxBytes) internal pure returns (string memory) { + return string(truncateBytes(bytes(text), maxBytes)); + } + + function truncateBytes(bytes memory value, uint256 maxLen) internal pure returns (bytes memory out) { + uint256 len = value.length; + if (len > maxLen) len = maxLen; + + out = new bytes(len); + for (uint256 i = 0; i < len; i++) { + out[i] = value[i]; + } + } + + function deploy(bytes memory initCode) internal returns (address deployed) { + assembly { + deployed := create(0, add(initCode, 0x20), mload(initCode)) + } + } + + function fromHex(string memory s) internal pure returns (bytes memory) { + bytes memory strBytes = bytes(s); + uint256 start = 0; + while (start < strBytes.length && isWhitespace(strBytes[start])) { + start++; + } + + if ( + start + 1 < strBytes.length && strBytes[start] == bytes1("0") + && (strBytes[start + 1] == bytes1("x") || strBytes[start + 1] == bytes1("X")) + ) { + start += 2; + } + + uint256 digits = 0; + for (uint256 i = start; i < strBytes.length; i++) { + if (isWhitespace(strBytes[i])) continue; + digits++; + } + require(digits % 2 == 0, "odd hex length"); + + bytes memory out = new bytes(digits / 2); + uint256 outIndex = 0; + uint8 high = 0; + bool highNibble = true; + for (uint256 i = start; i < strBytes.length; i++) { + bytes1 ch = strBytes[i]; + if (isWhitespace(ch)) continue; + uint8 val = fromHexChar(ch); + if (highNibble) { + high = val; + highNibble = false; + } else { + out[outIndex] = bytes1((high << 4) | val); + outIndex++; + highNibble = true; + } + } + return out; + } + + function isWhitespace(bytes1 ch) private pure returns (bool) { + return ch == 0x20 || ch == 0x0a || ch == 0x0d || ch == 0x09; + } + + function fromHexChar(bytes1 c) private pure returns (uint8) { + uint8 b = uint8(c); + if (b >= 48 && b <= 57) return b - 48; + if (b >= 65 && b <= 70) return b - 55; + if (b >= 97 && b <= 102) return b - 87; + revert("invalid hex"); + } +} diff --git a/benchmarks/foundry-abi/test/FixedArraySuiteEquivalence.t.sol b/benchmarks/foundry-abi/test/FixedArraySuiteEquivalence.t.sol new file mode 100644 index 0000000000..bc08d15d68 --- /dev/null +++ b/benchmarks/foundry-abi/test/FixedArraySuiteEquivalence.t.sol @@ -0,0 +1,458 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import { + FixedArraySuiteSol, + FixedArraySolBenchCaller, + FixedArrayFeBenchCaller, + IFixedArraySuite, + FixedBoolAddressPair, + FixedStringU64Pair, + FixedBytesU64Pair +} from "../src/FixedArraySuiteSol.sol"; + +interface Vm { + function readFile(string calldata path) external returns (string memory); +} + +contract FixedArraySuiteEquivalenceTest { + Vm constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); + + FixedArraySuiteSol internal solTarget; + address internal feTarget; + FixedArraySolBenchCaller internal solBench; + FixedArrayFeBenchCaller internal feBench; + + function setUp() public { + solTarget = new FixedArraySuiteSol(); + feTarget = deploy(fromHex(vm.readFile("fe-out/FixedArraySuite.bin"))); + require(feTarget != address(0), "fe create failed"); + + solBench = new FixedArraySolBenchCaller(address(solTarget)); + feBench = new FixedArrayFeBenchCaller(feTarget); + } + + function testEchoBoolArray5Deterministic() public { + bool[5] memory value = [true, false, true, false, true]; + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoBoolArray5.selector, value)); + assertBoolArray5TypedEquivalent(value); + } + + function testEchoBoolArray5Fuzz(bool[5] memory value) public { + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoBoolArray5.selector, value)); + assertBoolArray5TypedEquivalent(value); + } + + function testEchoBoolArray17Deterministic() public { + bool[17] memory value; + for (uint256 i = 0; i < 17; i++) { + value[i] = i % 2 == 0; + } + + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoBoolArray17.selector, value)); + assertBoolArray17TypedEquivalent(value); + } + + function testEchoBoolArray17Fuzz(bool[17] memory value) public { + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoBoolArray17.selector, value)); + assertBoolArray17TypedEquivalent(value); + } + + function testEchoUintArray8Deterministic() public { + uint256[8] memory value = [uint256(1), 2, 3, 4, 5, 6, 7, type(uint256).max]; + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoUintArray8.selector, value)); + assertUintArray8TypedEquivalent(value); + } + + function testEchoUintArray8Fuzz(uint256[8] memory value) public { + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoUintArray8.selector, value)); + assertUintArray8TypedEquivalent(value); + } + + function testEchoUintArray16Deterministic() public { + uint256[16] memory value = [uint256(1), 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, type(uint256).max]; + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoUintArray16.selector, value)); + assertUintArray16TypedEquivalent(value); + } + + function testEchoUintArray16Fuzz(uint256[16] memory value) public { + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoUintArray16.selector, value)); + assertUintArray16TypedEquivalent(value); + } + + function testEchoUintArray32Deterministic() public { + uint256[32] memory value; + for (uint256 i = 0; i < 32; i++) { + value[i] = i + 1; + } + value[31] = type(uint256).max; + + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoUintArray32.selector, value)); + assertUintArray32TypedEquivalent(value); + } + + function testEchoUintArray32Fuzz(uint256[32] memory value) public { + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoUintArray32.selector, value)); + assertUintArray32TypedEquivalent(value); + } + + function testEchoStringArray5Deterministic() public { + string[5] memory value; + value[0] = "alpha"; + value[1] = "beta gamma with extra payload bytes beyond thirty-two"; + value[2] = "delta with extra payload bytes beyond thirty-two"; + value[3] = "epsilon with extra payload bytes beyond thirty-two"; + value[4] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoStringArray5.selector, value)); + assertStringArray5TypedEquivalent(value); + } + + function testEchoStringArray5Fuzz(string[5] memory value) public { + value = normalizeStringArray5(value, 96); + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoStringArray5.selector, value)); + assertStringArray5TypedEquivalent(value); + } + + function testEchoStringArray17Deterministic() public { + string[17] memory value; + value[0] = ""; + value[1] = "alpha"; + value[2] = "beta gamma with extra payload bytes beyond thirty-two"; + value[8] = "delta with extra payload bytes beyond thirty-two"; + value[9] = "epsilon with extra payload bytes beyond thirty-two"; + value[16] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoStringArray17.selector, value)); + assertStringArray17TypedEquivalent(value); + } + + function testEchoStringArray17Fuzz(string[17] memory value) public { + value = normalizeStringArray17(value, 96); + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoStringArray17.selector, value)); + assertStringArray17TypedEquivalent(value); + } + + function testEchoBytesArray5Deterministic() public { + bytes[5] memory value; + value[0] = hex""; + value[1] = hex"01"; + value[2] = hex"deadbeef"; + value[3] = bytes("payload"); + value[4] = hex"ffffffffffffffffffffffffffffffff"; + + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoBytesArray5.selector, value)); + assertBytesArray5TypedEquivalent(value); + } + + function testEchoBytesArray5Fuzz(bytes[5] memory value) public { + value = normalizeBytesArray5(value, 64); + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoBytesArray5.selector, value)); + assertBytesArray5TypedEquivalent(value); + } + + function testEchoBytesArray17Deterministic() public { + bytes[17] memory value; + value[0] = hex""; + value[1] = hex"01"; + value[2] = hex"deadbeef"; + value[8] = bytes("payload"); + value[9] = hex"ffffffffffffffffffffffffffffffff"; + value[16] = hex"00112233445566778899aabbccddeeff"; + + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoBytesArray17.selector, value)); + assertBytesArray17TypedEquivalent(value); + } + + function testEchoBytesArray17Fuzz(bytes[17] memory value) public { + value = normalizeBytesArray17(value, 64); + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoBytesArray17.selector, value)); + assertBytesArray17TypedEquivalent(value); + } + + function testEchoBoolAddressPairArray8Deterministic() public { + FixedBoolAddressPair[8] memory value; + value[0] = FixedBoolAddressPair({flag: true, addr: address(0x1001)}); + value[1] = FixedBoolAddressPair({flag: false, addr: address(0x1002)}); + value[2] = FixedBoolAddressPair({flag: true, addr: address(0x1003)}); + value[3] = FixedBoolAddressPair({flag: false, addr: address(0x1004)}); + value[4] = FixedBoolAddressPair({flag: true, addr: address(0x1005)}); + value[5] = FixedBoolAddressPair({flag: false, addr: address(0x1006)}); + value[6] = FixedBoolAddressPair({flag: true, addr: address(0x1007)}); + value[7] = FixedBoolAddressPair({flag: false, addr: address(0x1008)}); + + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoBoolAddressPairArray8.selector, value)); + assertBoolAddressPairArray8TypedEquivalent(value); + } + + function testEchoBoolAddressPairArray8Fuzz(FixedBoolAddressPair[8] memory value) public { + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoBoolAddressPairArray8.selector, value)); + assertBoolAddressPairArray8TypedEquivalent(value); + } + + function testEchoStringU64PairArray5Deterministic() public { + FixedStringU64Pair[5] memory value; + value[0] = FixedStringU64Pair({text: "hello with extra payload bytes beyond thirty-two", count: 7}); + value[1] = FixedStringU64Pair({text: "world with extra payload bytes beyond thirty-two", count: 11}); + value[2] = FixedStringU64Pair({text: "fixed with extra payload bytes beyond thirty-two", count: 13}); + value[3] = FixedStringU64Pair({text: "arrays with extra payload bytes beyond thirty-two", count: 17}); + value[4] = FixedStringU64Pair({text: "bench with extra payload bytes beyond thirty-two", count: 19}); + + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoStringU64PairArray5.selector, value)); + assertStringU64PairArray5TypedEquivalent(value); + } + + function testEchoStringU64PairArray5Fuzz(FixedStringU64Pair[5] memory value) public { + value = normalizeStringU64PairArray5(value, 96); + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoStringU64PairArray5.selector, value)); + assertStringU64PairArray5TypedEquivalent(value); + } + + function testEchoBytesU64PairArray5Deterministic() public { + FixedBytesU64Pair[5] memory value; + value[0] = FixedBytesU64Pair({data: hex"", count: 1}); + value[1] = FixedBytesU64Pair({data: hex"01", count: 2}); + value[2] = FixedBytesU64Pair({data: hex"deadbeef", count: 3}); + value[3] = FixedBytesU64Pair({data: bytes("payload"), count: 4}); + value[4] = FixedBytesU64Pair({data: hex"cafebabef00d", count: 5}); + + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoBytesU64PairArray5.selector, value)); + assertBytesU64PairArray5TypedEquivalent(value); + } + + function testEchoBytesU64PairArray5Fuzz(FixedBytesU64Pair[5] memory value) public { + value = normalizeBytesU64PairArray5(value, 64); + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoBytesU64PairArray5.selector, value)); + assertBytesU64PairArray5TypedEquivalent(value); + } + + function testEchoNestedUintArray2x5Deterministic() public { + uint256[5][2] memory value; + value[0] = [uint256(1), 2, 3, 4, 5]; + value[1] = [uint256(6), 7, 8, 9, 10]; + + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoNestedUintArray2x5.selector, value)); + assertNestedUintArray2x5TypedEquivalent(value); + } + + function testEchoNestedUintArray2x5Fuzz(uint256[5][2] memory value) public { + assertEquivalent(abi.encodeWithSelector(IFixedArraySuite.echoNestedUintArray2x5.selector, value)); + assertNestedUintArray2x5TypedEquivalent(value); + } + + function assertEquivalent(bytes memory callData) internal { + (bool okSol, bytes memory outSol) = address(solTarget).call(callData); + (bool okFe, bytes memory outFe) = feTarget.call(callData); + + require(okSol == okFe, "success mismatch"); + require(okSol, "call failed"); + require(keccak256(outSol) == keccak256(outFe), "return bytes mismatch"); + } + + function assertBoolArray5TypedEquivalent(bool[5] memory value) internal { + bool[5] memory solValue = solBench.benchEchoBoolArray5(value); + bool[5] memory feValue = feBench.benchEchoBoolArray5(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed bool[5] mismatch"); + } + + function assertBoolArray17TypedEquivalent(bool[17] memory value) internal { + bool[17] memory solValue = solBench.benchEchoBoolArray17(value); + bool[17] memory feValue = feBench.benchEchoBoolArray17(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed bool[17] mismatch"); + } + + function assertUintArray8TypedEquivalent(uint256[8] memory value) internal { + uint256[8] memory solValue = solBench.benchEchoUintArray8(value); + uint256[8] memory feValue = feBench.benchEchoUintArray8(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed uint256[8] mismatch"); + } + + function assertUintArray16TypedEquivalent(uint256[16] memory value) internal { + uint256[16] memory solValue = solBench.benchEchoUintArray16(value); + uint256[16] memory feValue = feBench.benchEchoUintArray16(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed uint256[16] mismatch"); + } + + function assertUintArray32TypedEquivalent(uint256[32] memory value) internal { + uint256[32] memory solValue = solBench.benchEchoUintArray32(value); + uint256[32] memory feValue = feBench.benchEchoUintArray32(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed uint256[32] mismatch"); + } + + function assertStringArray5TypedEquivalent(string[5] memory value) internal { + string[5] memory solValue = solBench.benchEchoStringArray5(value); + string[5] memory feValue = feBench.benchEchoStringArray5(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed string[5] mismatch"); + } + + function assertStringArray17TypedEquivalent(string[17] memory value) internal { + string[17] memory solValue = solBench.benchEchoStringArray17(value); + string[17] memory feValue = feBench.benchEchoStringArray17(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed string[17] mismatch"); + } + + function assertBytesArray5TypedEquivalent(bytes[5] memory value) internal { + bytes[5] memory solValue = solBench.benchEchoBytesArray5(value); + bytes[5] memory feValue = feBench.benchEchoBytesArray5(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed bytes[5] mismatch"); + } + + function assertBytesArray17TypedEquivalent(bytes[17] memory value) internal { + bytes[17] memory solValue = solBench.benchEchoBytesArray17(value); + bytes[17] memory feValue = feBench.benchEchoBytesArray17(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed bytes[17] mismatch"); + } + + function assertBoolAddressPairArray8TypedEquivalent(FixedBoolAddressPair[8] memory value) internal { + FixedBoolAddressPair[8] memory solValue = solBench.benchEchoBoolAddressPairArray8(value); + FixedBoolAddressPair[8] memory feValue = feBench.benchEchoBoolAddressPairArray8(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed (bool,address)[8] mismatch"); + } + + function assertStringU64PairArray5TypedEquivalent(FixedStringU64Pair[5] memory value) internal { + FixedStringU64Pair[5] memory solValue = solBench.benchEchoStringU64PairArray5(value); + FixedStringU64Pair[5] memory feValue = feBench.benchEchoStringU64PairArray5(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed (string,uint64)[5] mismatch"); + } + + function assertBytesU64PairArray5TypedEquivalent(FixedBytesU64Pair[5] memory value) internal { + FixedBytesU64Pair[5] memory solValue = solBench.benchEchoBytesU64PairArray5(value); + FixedBytesU64Pair[5] memory feValue = feBench.benchEchoBytesU64PairArray5(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed (bytes,uint64)[5] mismatch"); + } + + function assertNestedUintArray2x5TypedEquivalent(uint256[5][2] memory value) internal { + uint256[5][2] memory solValue = solBench.benchEchoNestedUintArray2x5(value); + uint256[5][2] memory feValue = feBench.benchEchoNestedUintArray2x5(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed uint256[5][2] mismatch"); + } + + function normalizeStringArray5(string[5] memory value, uint256 maxStringBytes) + internal + pure + returns (string[5] memory out) + { + for (uint256 i = 0; i < 5; i++) { + out[i] = truncateString(value[i], maxStringBytes); + } + } + + function normalizeStringArray17(string[17] memory value, uint256 maxStringBytes) + internal + pure + returns (string[17] memory out) + { + for (uint256 i = 0; i < 17; i++) { + out[i] = truncateString(value[i], maxStringBytes); + } + } + + function normalizeBytesArray5(bytes[5] memory value, uint256 maxBytes) internal pure returns (bytes[5] memory out) { + for (uint256 i = 0; i < 5; i++) { + out[i] = truncateBytes(value[i], maxBytes); + } + } + + function normalizeBytesArray17(bytes[17] memory value, uint256 maxBytes) + internal + pure + returns (bytes[17] memory out) + { + for (uint256 i = 0; i < 17; i++) { + out[i] = truncateBytes(value[i], maxBytes); + } + } + + function normalizeStringU64PairArray5(FixedStringU64Pair[5] memory value, uint256 maxStringBytes) + internal + pure + returns (FixedStringU64Pair[5] memory out) + { + for (uint256 i = 0; i < 5; i++) { + out[i] = FixedStringU64Pair({text: truncateString(value[i].text, maxStringBytes), count: value[i].count}); + } + } + + function normalizeBytesU64PairArray5(FixedBytesU64Pair[5] memory value, uint256 maxBytes) + internal + pure + returns (FixedBytesU64Pair[5] memory out) + { + for (uint256 i = 0; i < 5; i++) { + out[i] = FixedBytesU64Pair({data: truncateBytes(value[i].data, maxBytes), count: value[i].count}); + } + } + + function truncateString(string memory text, uint256 maxBytes) internal pure returns (string memory) { + return string(truncateBytes(bytes(text), maxBytes)); + } + + function truncateBytes(bytes memory value, uint256 maxLen) internal pure returns (bytes memory out) { + uint256 len = value.length; + if (len > maxLen) len = maxLen; + + out = new bytes(len); + for (uint256 i = 0; i < len; i++) { + out[i] = value[i]; + } + } + + function deploy(bytes memory initCode) internal returns (address deployed) { + assembly { + deployed := create(0, add(initCode, 0x20), mload(initCode)) + } + } + + function fromHex(string memory s) internal pure returns (bytes memory) { + bytes memory strBytes = bytes(s); + uint256 start = 0; + while (start < strBytes.length && isWhitespace(strBytes[start])) { + start++; + } + + if ( + start + 1 < strBytes.length && strBytes[start] == bytes1("0") + && (strBytes[start + 1] == bytes1("x") || strBytes[start + 1] == bytes1("X")) + ) { + start += 2; + } + + uint256 digits = 0; + for (uint256 i = start; i < strBytes.length; i++) { + if (isWhitespace(strBytes[i])) continue; + digits++; + } + require(digits % 2 == 0, "odd hex length"); + + bytes memory out = new bytes(digits / 2); + uint256 outIndex = 0; + uint8 high = 0; + bool highNibble = true; + for (uint256 i = start; i < strBytes.length; i++) { + bytes1 ch = strBytes[i]; + if (isWhitespace(ch)) continue; + uint8 val = fromHexChar(ch); + if (highNibble) { + high = val; + highNibble = false; + } else { + out[outIndex] = bytes1((high << 4) | val); + outIndex++; + highNibble = true; + } + } + return out; + } + + function isWhitespace(bytes1 ch) private pure returns (bool) { + return ch == 0x20 || ch == 0x0a || ch == 0x0d || ch == 0x09; + } + + function fromHexChar(bytes1 c) private pure returns (uint8) { + uint8 b = uint8(c); + if (b >= 48 && b <= 57) return b - 48; + if (b >= 65 && b <= 70) return b - 55; + if (b >= 97 && b <= 102) return b - 87; + revert("invalid hex"); + } +} diff --git a/benchmarks/foundry-abi/test/NestedTupleSuiteEquivalence.t.sol b/benchmarks/foundry-abi/test/NestedTupleSuiteEquivalence.t.sol new file mode 100644 index 0000000000..306d3985e8 --- /dev/null +++ b/benchmarks/foundry-abi/test/NestedTupleSuiteEquivalence.t.sol @@ -0,0 +1,298 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import { + INestedTupleSuite, + NestedTupleFeBenchCaller, + NestedTupleSolBenchCaller, + NestedTupleSuiteSol, + NTAddressU256Pair, + NTBoolAddressPair, + NTBytesBoolPair, + NTNestedDynamic, + NTNestedDynamicBoth, + NTNestedStatic, + NTNestedStaticFlipped, + NTStringU64Pair +} from "../src/NestedTupleSuiteSol.sol"; + +interface Vm { + function readFile(string calldata path) external returns (string memory); + function assume(bool condition) external; +} + +contract NestedTupleSuiteEquivalenceTest { + Vm constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); + + NestedTupleSuiteSol internal solTarget; + address internal feTarget; + NestedTupleSolBenchCaller internal solBench; + NestedTupleFeBenchCaller internal feBench; + + function setUp() public { + solTarget = new NestedTupleSuiteSol(); + feTarget = deploy(fromHex(vm.readFile("fe-out/NestedTupleSuite.bin"))); + require(feTarget != address(0), "fe create failed"); + + solBench = new NestedTupleSolBenchCaller(address(solTarget)); + feBench = new NestedTupleFeBenchCaller(feTarget); + } + + function testEchoNestedStaticDeterministic() public { + NTNestedStatic memory value = NTNestedStatic({ + inner: NTBoolAddressPair({flag: true, addr: address(0x1000000000000000000000000000000000000001)}), + count: 123 + }); + + assertEquivalent(abi.encodeWithSelector(INestedTupleSuite.echoNestedStatic.selector, value)); + assertNestedStaticTypedEquivalent(value); + } + + function testEchoNestedStaticFuzz(bool innerFlag, address innerAddr, uint256 count) public { + NTNestedStatic memory value = + NTNestedStatic({inner: NTBoolAddressPair({flag: innerFlag, addr: innerAddr}), count: count}); + assertEquivalent(abi.encodeWithSelector(INestedTupleSuite.echoNestedStatic.selector, value)); + } + + function testEchoNestedStaticFlippedDeterministic() public { + NTNestedStaticFlipped memory value = NTNestedStaticFlipped({ + flag: false, + inner: NTAddressU256Pair({addr: address(0x2000000000000000000000000000000000000002), count: type(uint256).max}) + }); + + assertEquivalent(abi.encodeWithSelector(INestedTupleSuite.echoNestedStaticFlipped.selector, value)); + assertNestedStaticFlippedTypedEquivalent(value); + } + + function testEchoNestedStaticFlippedFuzz(bool flag, address innerAddr, uint256 innerCount) public { + NTNestedStaticFlipped memory value = + NTNestedStaticFlipped({flag: flag, inner: NTAddressU256Pair({addr: innerAddr, count: innerCount})}); + assertEquivalent(abi.encodeWithSelector(INestedTupleSuite.echoNestedStaticFlipped.selector, value)); + } + + function testEchoNestedDynamicDeterministic() public { + NTNestedDynamic memory value = NTNestedDynamic({ + pair: NTStringU64Pair({ + text: "alpha with extra payload bytes beyond thirty-two", + count: type(uint64).max + }), + flag: true + }); + + assertEquivalent(abi.encodeWithSelector(INestedTupleSuite.echoNestedDynamic.selector, value)); + assertNestedDynamicTypedEquivalent(value); + } + + function testEchoNestedDynamicFuzz(string memory text, uint64 count, bool flag) public { + assumeShortString(text, 96); + NTNestedDynamic memory value = NTNestedDynamic({pair: NTStringU64Pair({text: text, count: count}), flag: flag}); + assertEquivalent(abi.encodeWithSelector(INestedTupleSuite.echoNestedDynamic.selector, value)); + } + + function testEchoNestedDynamicBothDeterministic() public { + NTNestedDynamicBoth memory value = NTNestedDynamicBoth({ + left: NTStringU64Pair({ + text: "bravo with extra payload bytes beyond thirty-two", + count: 42 + }), + right: NTBytesBoolPair({ + data: hex"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20212223", + flag: false + }) + }); + + assertEquivalent(abi.encodeWithSelector(INestedTupleSuite.echoNestedDynamicBoth.selector, value)); + assertNestedDynamicBothTypedEquivalent(value); + } + + function testEchoNestedDynamicBothFuzz(string memory text, uint64 count, bytes memory data, bool flag) public { + assumeShortString(text, 96); + data = truncateBytes(data, 96); + NTNestedDynamicBoth memory value = NTNestedDynamicBoth({ + left: NTStringU64Pair({text: text, count: count}), + right: NTBytesBoolPair({data: data, flag: flag}) + }); + assertEquivalent(abi.encodeWithSelector(INestedTupleSuite.echoNestedDynamicBoth.selector, value)); + } + + function testEchoNestedStaticArrayDeterministic() public { + NTNestedStatic[4] memory value; + value[0] = NTNestedStatic({inner: NTBoolAddressPair({flag: false, addr: address(0)}), count: 0}); + value[1] = NTNestedStatic({ + inner: NTBoolAddressPair({flag: true, addr: address(0x3000000000000000000000000000000000000003)}), + count: 1 + }); + value[2] = NTNestedStatic({ + inner: NTBoolAddressPair({flag: false, addr: address(0x4000000000000000000000000000000000000004)}), + count: type(uint256).max + }); + value[3] = NTNestedStatic({ + inner: NTBoolAddressPair({flag: true, addr: address(0x5000000000000000000000000000000000000005)}), + count: 999 + }); + + assertEquivalent(abi.encodeWithSelector(INestedTupleSuite.echoNestedStaticArray.selector, value)); + assertNestedStaticArrayTypedEquivalent(value); + } + + function testEchoNestedStaticDynArrayDeterministic() public { + NTNestedStatic[] memory value = new NTNestedStatic[](3); + value[0] = NTNestedStatic({inner: NTBoolAddressPair({flag: false, addr: address(0)}), count: 0}); + value[1] = NTNestedStatic({ + inner: NTBoolAddressPair({flag: true, addr: address(0x6000000000000000000000000000000000000006)}), + count: 123 + }); + value[2] = NTNestedStatic({ + inner: NTBoolAddressPair({flag: false, addr: address(0x7000000000000000000000000000000000000007)}), + count: type(uint256).max + }); + + assertEquivalent(abi.encodeWithSelector(INestedTupleSuite.echoNestedStaticDynArray.selector, value)); + assertNestedStaticDynArrayTypedEquivalent(value); + } + + function testEchoNestedStaticDynArrayFuzz(NTNestedStatic[] memory value) public { + value = truncateNestedStaticDynArray(value, 4); + assertEquivalent(abi.encodeWithSelector(INestedTupleSuite.echoNestedStaticDynArray.selector, value)); + } + + function assertEquivalent(bytes memory callData) internal { + (bool okSol, bytes memory outSol) = address(solTarget).call(callData); + (bool okFe, bytes memory outFe) = feTarget.call(callData); + + require(okSol == okFe, "success mismatch"); + require(okSol, "call failed"); + require(keccak256(outSol) == keccak256(outFe), "return bytes mismatch"); + } + + function assertNestedStaticTypedEquivalent(NTNestedStatic memory value) internal { + NTNestedStatic memory solValue = solBench.benchEchoNestedStatic(value); + NTNestedStatic memory feValue = feBench.benchEchoNestedStatic(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed nested static mismatch"); + } + + function assertNestedStaticFlippedTypedEquivalent(NTNestedStaticFlipped memory value) internal { + NTNestedStaticFlipped memory solValue = solBench.benchEchoNestedStaticFlipped(value); + NTNestedStaticFlipped memory feValue = feBench.benchEchoNestedStaticFlipped(value); + require( + keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), + "typed nested static flipped mismatch" + ); + } + + function assertNestedDynamicTypedEquivalent(NTNestedDynamic memory value) internal { + NTNestedDynamic memory solValue = solBench.benchEchoNestedDynamic(value); + NTNestedDynamic memory feValue = feBench.benchEchoNestedDynamic(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed nested dynamic mismatch"); + } + + function assertNestedDynamicBothTypedEquivalent(NTNestedDynamicBoth memory value) internal { + NTNestedDynamicBoth memory solValue = solBench.benchEchoNestedDynamicBoth(value); + NTNestedDynamicBoth memory feValue = feBench.benchEchoNestedDynamicBoth(value); + require( + keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), + "typed nested dynamic both mismatch" + ); + } + + function assertNestedStaticArrayTypedEquivalent(NTNestedStatic[4] memory value) internal { + NTNestedStatic[4] memory solValue = solBench.benchEchoNestedStaticArray(value); + NTNestedStatic[4] memory feValue = feBench.benchEchoNestedStaticArray(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed nested static[4] mismatch"); + } + + function assertNestedStaticDynArrayTypedEquivalent(NTNestedStatic[] memory value) internal { + NTNestedStatic[] memory solValue = solBench.benchEchoNestedStaticDynArray(value); + NTNestedStatic[] memory feValue = feBench.benchEchoNestedStaticDynArray(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(feValue)), "typed nested static[] mismatch"); + } + + function assumeShortString(string memory text, uint256 maxBytes) internal { + vm.assume(bytes(text).length <= maxBytes); + } + + function truncateNestedStaticDynArray(NTNestedStatic[] memory value, uint256 maxLen) + internal + pure + returns (NTNestedStatic[] memory out) + { + uint256 len = value.length; + if (len > maxLen) len = maxLen; + + out = new NTNestedStatic[](len); + for (uint256 i = 0; i < len; i++) { + out[i] = value[i]; + } + } + + function truncateBytes(bytes memory value, uint256 maxLen) internal pure returns (bytes memory out) { + uint256 len = value.length; + if (len > maxLen) len = maxLen; + + out = new bytes(len); + for (uint256 i = 0; i < len; i++) { + out[i] = value[i]; + } + } + + function deploy(bytes memory initCode) internal returns (address deployed) { + assembly { + deployed := create(0, add(initCode, 0x20), mload(initCode)) + } + } + + function fromHex(string memory s) internal pure returns (bytes memory) { + bytes memory strBytes = bytes(s); + uint256 start = 0; + while (start < strBytes.length && isWhitespace(strBytes[start])) { + start++; + } + + if ( + start + 1 < strBytes.length && + strBytes[start] == bytes1("0") && + (strBytes[start + 1] == bytes1("x") || strBytes[start + 1] == bytes1("X")) + ) { + start += 2; + } + + uint256 digits = 0; + for (uint256 i = start; i < strBytes.length; i++) { + if (isWhitespace(strBytes[i])) continue; + digits++; + } + require(digits % 2 == 0, "odd hex length"); + + bytes memory out = new bytes(digits / 2); + uint256 outIndex = 0; + uint8 high = 0; + bool highNibble = true; + for (uint256 i = start; i < strBytes.length; i++) { + bytes1 ch = strBytes[i]; + if (isWhitespace(ch)) continue; + uint8 val = fromHexChar(ch); + if (highNibble) { + high = val; + highNibble = false; + } else { + out[outIndex] = bytes1((high << 4) | val); + outIndex++; + highNibble = true; + } + } + return out; + } + + function isWhitespace(bytes1 ch) private pure returns (bool) { + return ch == 0x20 || ch == 0x0a || ch == 0x0d || ch == 0x09; + } + + function fromHexChar(bytes1 c) private pure returns (uint8) { + uint8 b = uint8(c); + if (b >= 48 && b <= 57) return b - 48; + if (b >= 65 && b <= 70) return b - 55; + if (b >= 97 && b <= 102) return b - 87; + revert("invalid hex"); + } +} + diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiAddressArray4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiAddressArray4Bench.t.sol new file mode 100644 index 0000000000..f34f900e5b --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiAddressArray4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiAddressArray4BenchTest is AbiRoundtripBase { + function testBenchEchoAddressArray4() public { + address[4] memory value = [address(0x2000000000000000000000000000000000000002), address(0), address(0x1000000000000000000000000000000000000001), address(0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF)]; + address[4] memory solValue = solBench.benchEchoAddressArray4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + address[4] memory feValue = feBench.benchEchoAddressArray4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiAddressBench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiAddressBench.t.sol new file mode 100644 index 0000000000..2aa7019a89 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiAddressBench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiAddressBenchTest is AbiRoundtripBase { + function testBenchEchoAddress() public { + address value = address(0x2000000000000000000000000000000000000002); + require(solBench.benchEchoAddress(value) == value, "sol value"); + require(feBench.benchEchoAddress(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiAddressMatrix2x2Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiAddressMatrix2x2Bench.t.sol new file mode 100644 index 0000000000..346b8e801f --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiAddressMatrix2x2Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiAddressMatrix2x2BenchTest is AbiRoundtripBase { + function testBenchEchoAddressMatrix2x2() public { + address[2][2] memory value = [[address(0x2000000000000000000000000000000000000002), address(0)], [address(0x1000000000000000000000000000000000000001), address(0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF)]]; + address[2][2] memory solValue = solBench.benchEchoAddressMatrix2x2(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + address[2][2] memory feValue = feBench.benchEchoAddressMatrix2x2(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiBoolAddressPairArrayBench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiBoolAddressPairArrayBench.t.sol new file mode 100644 index 0000000000..3311598650 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiBoolAddressPairArrayBench.t.sol @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {BoolAddressPair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiBoolAddressPairArrayBenchTest is AbiRoundtripBase { + function testBenchEchoBoolAddressPairArray() public { + BoolAddressPair[] memory value = new BoolAddressPair[](2); + value[0] = BoolAddressPair({flag: true, addr: address(0x4000000000000000000000000000000000000004)}); + value[1] = BoolAddressPair({flag: false, addr: address(0x5000000000000000000000000000000000000005)}); + BoolAddressPair[] memory solValue = solBench.benchEchoBoolAddressPairArray(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + BoolAddressPair[] memory feValue = feBench.benchEchoBoolAddressPairArray(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiBoolArray4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiBoolArray4Bench.t.sol new file mode 100644 index 0000000000..688e9eacad --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiBoolArray4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiBoolArray4BenchTest is AbiRoundtripBase { + function testBenchEchoBoolArray4() public { + bool[4] memory value = [true, false, true, true]; + bool[4] memory solValue = solBench.benchEchoBoolArray4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + bool[4] memory feValue = feBench.benchEchoBoolArray4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiBoolBench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiBoolBench.t.sol new file mode 100644 index 0000000000..3260bd4939 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiBoolBench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiBoolBenchTest is AbiRoundtripBase { + function testBenchEchoBool() public { + bool value = true; + require(solBench.benchEchoBool(value) == value, "sol value"); + require(feBench.benchEchoBool(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiBoolMatrix2x2Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiBoolMatrix2x2Bench.t.sol new file mode 100644 index 0000000000..24b9dd0690 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiBoolMatrix2x2Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiBoolMatrix2x2BenchTest is AbiRoundtripBase { + function testBenchEchoBoolMatrix2x2() public { + bool[2][2] memory value = [[true, false], [true, true]]; + bool[2][2] memory solValue = solBench.benchEchoBoolMatrix2x2(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + bool[2][2] memory feValue = feBench.benchEchoBoolMatrix2x2(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt104Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt104Bench.t.sol new file mode 100644 index 0000000000..333cd274f0 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt104Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt104BenchTest is AbiRoundtripBase { + function testBenchEchoInt104() public { + int104 value = int104(-7); + require(solBench.benchEchoInt104(value) == value, "sol value"); + require(feBench.benchEchoInt104(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt112Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt112Bench.t.sol new file mode 100644 index 0000000000..660ef0defa --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt112Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt112BenchTest is AbiRoundtripBase { + function testBenchEchoInt112() public { + int112 value = int112(-7); + require(solBench.benchEchoInt112(value) == value, "sol value"); + require(feBench.benchEchoInt112(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt120Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt120Bench.t.sol new file mode 100644 index 0000000000..36fd569fe8 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt120Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt120BenchTest is AbiRoundtripBase { + function testBenchEchoInt120() public { + int120 value = int120(-7); + require(solBench.benchEchoInt120(value) == value, "sol value"); + require(feBench.benchEchoInt120(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt128Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt128Array4Bench.t.sol new file mode 100644 index 0000000000..e0533aa5d8 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt128Array4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt128Array4BenchTest is AbiRoundtripBase { + function testBenchEchoInt128Array4() public { + int128[4] memory value = [int128(-7), int128(0), int128(-1), type(int128).min]; + int128[4] memory solValue = solBench.benchEchoInt128Array4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + int128[4] memory feValue = feBench.benchEchoInt128Array4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt128Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt128Bench.t.sol new file mode 100644 index 0000000000..6fe13d3371 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt128Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt128BenchTest is AbiRoundtripBase { + function testBenchEchoInt128() public { + int128 value = int128(-7); + require(solBench.benchEchoInt128(value) == value, "sol value"); + require(feBench.benchEchoInt128(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt136Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt136Bench.t.sol new file mode 100644 index 0000000000..2487c09ba7 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt136Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt136BenchTest is AbiRoundtripBase { + function testBenchEchoInt136() public { + int136 value = int136(-7); + require(solBench.benchEchoInt136(value) == value, "sol value"); + require(feBench.benchEchoInt136(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt144Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt144Bench.t.sol new file mode 100644 index 0000000000..8090aa0db5 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt144Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt144BenchTest is AbiRoundtripBase { + function testBenchEchoInt144() public { + int144 value = int144(-7); + require(solBench.benchEchoInt144(value) == value, "sol value"); + require(feBench.benchEchoInt144(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt152Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt152Bench.t.sol new file mode 100644 index 0000000000..70222da37c --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt152Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt152BenchTest is AbiRoundtripBase { + function testBenchEchoInt152() public { + int152 value = int152(-7); + require(solBench.benchEchoInt152(value) == value, "sol value"); + require(feBench.benchEchoInt152(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt160Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt160Array4Bench.t.sol new file mode 100644 index 0000000000..4bb20a44ab --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt160Array4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt160Array4BenchTest is AbiRoundtripBase { + function testBenchEchoInt160Array4() public { + int160[4] memory value = [int160(-7), int160(0), int160(-1), type(int160).min]; + int160[4] memory solValue = solBench.benchEchoInt160Array4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + int160[4] memory feValue = feBench.benchEchoInt160Array4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt160Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt160Bench.t.sol new file mode 100644 index 0000000000..0fa21efe81 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt160Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt160BenchTest is AbiRoundtripBase { + function testBenchEchoInt160() public { + int160 value = int160(-7); + require(solBench.benchEchoInt160(value) == value, "sol value"); + require(feBench.benchEchoInt160(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt168Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt168Bench.t.sol new file mode 100644 index 0000000000..c9ac3f5aca --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt168Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt168BenchTest is AbiRoundtripBase { + function testBenchEchoInt168() public { + int168 value = int168(-7); + require(solBench.benchEchoInt168(value) == value, "sol value"); + require(feBench.benchEchoInt168(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt16Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt16Array4Bench.t.sol new file mode 100644 index 0000000000..b361740488 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt16Array4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt16Array4BenchTest is AbiRoundtripBase { + function testBenchEchoInt16Array4() public { + int16[4] memory value = [int16(-7), int16(0), int16(-1), type(int16).min]; + int16[4] memory solValue = solBench.benchEchoInt16Array4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + int16[4] memory feValue = feBench.benchEchoInt16Array4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt16Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt16Bench.t.sol new file mode 100644 index 0000000000..3241b28002 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt16Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt16BenchTest is AbiRoundtripBase { + function testBenchEchoInt16() public { + int16 value = int16(-7); + require(solBench.benchEchoInt16(value) == value, "sol value"); + require(feBench.benchEchoInt16(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt176Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt176Bench.t.sol new file mode 100644 index 0000000000..25134a1c4e --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt176Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt176BenchTest is AbiRoundtripBase { + function testBenchEchoInt176() public { + int176 value = int176(-7); + require(solBench.benchEchoInt176(value) == value, "sol value"); + require(feBench.benchEchoInt176(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt184Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt184Bench.t.sol new file mode 100644 index 0000000000..489ff1286b --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt184Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt184BenchTest is AbiRoundtripBase { + function testBenchEchoInt184() public { + int184 value = int184(-7); + require(solBench.benchEchoInt184(value) == value, "sol value"); + require(feBench.benchEchoInt184(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt192Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt192Bench.t.sol new file mode 100644 index 0000000000..586a68e560 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt192Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt192BenchTest is AbiRoundtripBase { + function testBenchEchoInt192() public { + int192 value = int192(-7); + require(solBench.benchEchoInt192(value) == value, "sol value"); + require(feBench.benchEchoInt192(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt200Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt200Bench.t.sol new file mode 100644 index 0000000000..92696f7ec6 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt200Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt200BenchTest is AbiRoundtripBase { + function testBenchEchoInt200() public { + int200 value = int200(-7); + require(solBench.benchEchoInt200(value) == value, "sol value"); + require(feBench.benchEchoInt200(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt208Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt208Bench.t.sol new file mode 100644 index 0000000000..7f6a40054b --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt208Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt208BenchTest is AbiRoundtripBase { + function testBenchEchoInt208() public { + int208 value = int208(-7); + require(solBench.benchEchoInt208(value) == value, "sol value"); + require(feBench.benchEchoInt208(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt216Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt216Bench.t.sol new file mode 100644 index 0000000000..a5caff86e5 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt216Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt216BenchTest is AbiRoundtripBase { + function testBenchEchoInt216() public { + int216 value = int216(-7); + require(solBench.benchEchoInt216(value) == value, "sol value"); + require(feBench.benchEchoInt216(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt224Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt224Bench.t.sol new file mode 100644 index 0000000000..c015caaaf5 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt224Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt224BenchTest is AbiRoundtripBase { + function testBenchEchoInt224() public { + int224 value = int224(-7); + require(solBench.benchEchoInt224(value) == value, "sol value"); + require(feBench.benchEchoInt224(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt232Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt232Bench.t.sol new file mode 100644 index 0000000000..6bbeec13a3 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt232Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt232BenchTest is AbiRoundtripBase { + function testBenchEchoInt232() public { + int232 value = int232(-7); + require(solBench.benchEchoInt232(value) == value, "sol value"); + require(feBench.benchEchoInt232(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt240Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt240Bench.t.sol new file mode 100644 index 0000000000..e1cf1065e2 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt240Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt240BenchTest is AbiRoundtripBase { + function testBenchEchoInt240() public { + int240 value = int240(-7); + require(solBench.benchEchoInt240(value) == value, "sol value"); + require(feBench.benchEchoInt240(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt248Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt248Array4Bench.t.sol new file mode 100644 index 0000000000..6be1ca94b3 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt248Array4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt248Array4BenchTest is AbiRoundtripBase { + function testBenchEchoInt248Array4() public { + int248[4] memory value = [int248(-7), int248(0), int248(-1), type(int248).min]; + int248[4] memory solValue = solBench.benchEchoInt248Array4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + int248[4] memory feValue = feBench.benchEchoInt248Array4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt248Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt248Bench.t.sol new file mode 100644 index 0000000000..38852e5b55 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt248Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt248BenchTest is AbiRoundtripBase { + function testBenchEchoInt248() public { + int248 value = int248(-7); + require(solBench.benchEchoInt248(value) == value, "sol value"); + require(feBench.benchEchoInt248(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt24Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt24Array4Bench.t.sol new file mode 100644 index 0000000000..e160450a42 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt24Array4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt24Array4BenchTest is AbiRoundtripBase { + function testBenchEchoInt24Array4() public { + int24[4] memory value = [int24(-7), int24(0), int24(-1), type(int24).min]; + int24[4] memory solValue = solBench.benchEchoInt24Array4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + int24[4] memory feValue = feBench.benchEchoInt24Array4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt24Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt24Bench.t.sol new file mode 100644 index 0000000000..98ccee07fc --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt24Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt24BenchTest is AbiRoundtripBase { + function testBenchEchoInt24() public { + int24 value = int24(-7); + require(solBench.benchEchoInt24(value) == value, "sol value"); + require(feBench.benchEchoInt24(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt256Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt256Array4Bench.t.sol new file mode 100644 index 0000000000..3b33b6862a --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt256Array4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt256Array4BenchTest is AbiRoundtripBase { + function testBenchEchoInt256Array4() public { + int256[4] memory value = [int256(-7), int256(0), int256(-1), type(int256).min]; + int256[4] memory solValue = solBench.benchEchoInt256Array4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + int256[4] memory feValue = feBench.benchEchoInt256Array4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt256Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt256Bench.t.sol new file mode 100644 index 0000000000..6c3cb5f89e --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt256Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt256BenchTest is AbiRoundtripBase { + function testBenchEchoInt256() public { + int256 value = int256(-7); + require(solBench.benchEchoInt256(value) == value, "sol value"); + require(feBench.benchEchoInt256(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt256Matrix2x2Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt256Matrix2x2Bench.t.sol new file mode 100644 index 0000000000..66c229252e --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt256Matrix2x2Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt256Matrix2x2BenchTest is AbiRoundtripBase { + function testBenchEchoInt256Matrix2x2() public { + int256[2][2] memory value = [[int256(-7), int256(0)], [int256(-1), type(int256).min]]; + int256[2][2] memory solValue = solBench.benchEchoInt256Matrix2x2(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + int256[2][2] memory feValue = feBench.benchEchoInt256Matrix2x2(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt32Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt32Array4Bench.t.sol new file mode 100644 index 0000000000..d3a5e592ba --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt32Array4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt32Array4BenchTest is AbiRoundtripBase { + function testBenchEchoInt32Array4() public { + int32[4] memory value = [int32(-7), int32(0), int32(-1), type(int32).min]; + int32[4] memory solValue = solBench.benchEchoInt32Array4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + int32[4] memory feValue = feBench.benchEchoInt32Array4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt32Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt32Bench.t.sol new file mode 100644 index 0000000000..73c53d4b46 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt32Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt32BenchTest is AbiRoundtripBase { + function testBenchEchoInt32() public { + int32 value = int32(-7); + require(solBench.benchEchoInt32(value) == value, "sol value"); + require(feBench.benchEchoInt32(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt40Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt40Array4Bench.t.sol new file mode 100644 index 0000000000..125f757ea6 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt40Array4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt40Array4BenchTest is AbiRoundtripBase { + function testBenchEchoInt40Array4() public { + int40[4] memory value = [int40(-7), int40(0), int40(-1), type(int40).min]; + int40[4] memory solValue = solBench.benchEchoInt40Array4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + int40[4] memory feValue = feBench.benchEchoInt40Array4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt40Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt40Bench.t.sol new file mode 100644 index 0000000000..d782f7e68a --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt40Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt40BenchTest is AbiRoundtripBase { + function testBenchEchoInt40() public { + int40 value = int40(-7); + require(solBench.benchEchoInt40(value) == value, "sol value"); + require(feBench.benchEchoInt40(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt40Matrix2x2Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt40Matrix2x2Bench.t.sol new file mode 100644 index 0000000000..8c4b6d89f5 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt40Matrix2x2Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt40Matrix2x2BenchTest is AbiRoundtripBase { + function testBenchEchoInt40Matrix2x2() public { + int40[2][2] memory value = [[int40(-7), int40(0)], [int40(-1), type(int40).min]]; + int40[2][2] memory solValue = solBench.benchEchoInt40Matrix2x2(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + int40[2][2] memory feValue = feBench.benchEchoInt40Matrix2x2(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt48Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt48Bench.t.sol new file mode 100644 index 0000000000..d36153b766 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt48Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt48BenchTest is AbiRoundtripBase { + function testBenchEchoInt48() public { + int48 value = int48(-7); + require(solBench.benchEchoInt48(value) == value, "sol value"); + require(feBench.benchEchoInt48(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt56Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt56Bench.t.sol new file mode 100644 index 0000000000..6af2b0d41b --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt56Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt56BenchTest is AbiRoundtripBase { + function testBenchEchoInt56() public { + int56 value = int56(-7); + require(solBench.benchEchoInt56(value) == value, "sol value"); + require(feBench.benchEchoInt56(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt64Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt64Array4Bench.t.sol new file mode 100644 index 0000000000..d853163526 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt64Array4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt64Array4BenchTest is AbiRoundtripBase { + function testBenchEchoInt64Array4() public { + int64[4] memory value = [int64(-7), int64(0), int64(-1), type(int64).min]; + int64[4] memory solValue = solBench.benchEchoInt64Array4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + int64[4] memory feValue = feBench.benchEchoInt64Array4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt64Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt64Bench.t.sol new file mode 100644 index 0000000000..e7e095d6f2 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt64Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt64BenchTest is AbiRoundtripBase { + function testBenchEchoInt64() public { + int64 value = int64(-7); + require(solBench.benchEchoInt64(value) == value, "sol value"); + require(feBench.benchEchoInt64(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt72Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt72Bench.t.sol new file mode 100644 index 0000000000..fb5347b002 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt72Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt72BenchTest is AbiRoundtripBase { + function testBenchEchoInt72() public { + int72 value = int72(-7); + require(solBench.benchEchoInt72(value) == value, "sol value"); + require(feBench.benchEchoInt72(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt80Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt80Bench.t.sol new file mode 100644 index 0000000000..81d19651a9 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt80Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt80BenchTest is AbiRoundtripBase { + function testBenchEchoInt80() public { + int80 value = int80(-7); + require(solBench.benchEchoInt80(value) == value, "sol value"); + require(feBench.benchEchoInt80(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt88Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt88Bench.t.sol new file mode 100644 index 0000000000..975ff4c6fc --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt88Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt88BenchTest is AbiRoundtripBase { + function testBenchEchoInt88() public { + int88 value = int88(-7); + require(solBench.benchEchoInt88(value) == value, "sol value"); + require(feBench.benchEchoInt88(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt8Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt8Array4Bench.t.sol new file mode 100644 index 0000000000..ed17d4fff3 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt8Array4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt8Array4BenchTest is AbiRoundtripBase { + function testBenchEchoInt8Array4() public { + int8[4] memory value = [int8(-7), int8(0), int8(-1), type(int8).min]; + int8[4] memory solValue = solBench.benchEchoInt8Array4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + int8[4] memory feValue = feBench.benchEchoInt8Array4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt8Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt8Bench.t.sol new file mode 100644 index 0000000000..9799592e75 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt8Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt8BenchTest is AbiRoundtripBase { + function testBenchEchoInt8() public { + int8 value = int8(-7); + require(solBench.benchEchoInt8(value) == value, "sol value"); + require(feBench.benchEchoInt8(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt96Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt96Array4Bench.t.sol new file mode 100644 index 0000000000..0cd9f81ddc --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt96Array4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt96Array4BenchTest is AbiRoundtripBase { + function testBenchEchoInt96Array4() public { + int96[4] memory value = [int96(-7), int96(0), int96(-1), type(int96).min]; + int96[4] memory solValue = solBench.benchEchoInt96Array4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + int96[4] memory feValue = feBench.benchEchoInt96Array4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiInt96Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiInt96Bench.t.sol new file mode 100644 index 0000000000..71f0d33086 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiInt96Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiInt96BenchTest is AbiRoundtripBase { + function testBenchEchoInt96() public { + int96 value = int96(-7); + require(solBench.benchEchoInt96(value) == value, "sol value"); + require(feBench.benchEchoInt96(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiPairBoolAddressArray4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiPairBoolAddressArray4Bench.t.sol new file mode 100644 index 0000000000..cf02e6521c --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiPairBoolAddressArray4Bench.t.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {BoolAddressPair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiPairBoolAddressArray4BenchTest is AbiRoundtripBase { + function testBenchEchoBoolAddressPairArray4() public { + BoolAddressPair[4] memory value = [BoolAddressPair({flag: true, addr: address(0x4000000000000000000000000000000000000004)}), BoolAddressPair({flag: false, addr: address(0)}), BoolAddressPair({flag: true, addr: address(0x3000000000000000000000000000000000000003)}), BoolAddressPair({flag: true, addr: address(0x4000000000000000000000000000000000000004)})]; + BoolAddressPair[4] memory solValue = solBench.benchEchoBoolAddressPairArray4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + BoolAddressPair[4] memory feValue = feBench.benchEchoBoolAddressPairArray4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiPairBoolAddressBench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiPairBoolAddressBench.t.sol new file mode 100644 index 0000000000..8806e3e400 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiPairBoolAddressBench.t.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {BoolAddressPair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiPairBoolAddressBenchTest is AbiRoundtripBase { + function testBenchEchoBoolAddressPair() public { + BoolAddressPair memory value = BoolAddressPair({flag: true, addr: address(0x4000000000000000000000000000000000000004)}); + BoolAddressPair memory solValue = solBench.benchEchoBoolAddressPair(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + BoolAddressPair memory feValue = feBench.benchEchoBoolAddressPair(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiPairStringU64Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiPairStringU64Bench.t.sol new file mode 100644 index 0000000000..343530df20 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiPairStringU64Bench.t.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {StringU64Pair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiPairStringU64BenchTest is AbiRoundtripBase { + function testBenchEchoPair() public { + StringU64Pair memory value = StringU64Pair({text: "bench pair", count: uint64(99)}); + assumeShortString(value.text); + StringU64Pair memory solValue = solBench.benchEchoPair(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + StringU64Pair memory feValue = feBench.benchEchoPair(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiPairUint24Int40Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiPairUint24Int40Array4Bench.t.sol new file mode 100644 index 0000000000..24252d934f --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiPairUint24Int40Array4Bench.t.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {Uint24Int40Pair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiPairUint24Int40Array4BenchTest is AbiRoundtripBase { + function testBenchEchoUint24Int40PairArray4() public { + Uint24Int40Pair[4] memory value = [Uint24Int40Pair({left: uint24(123), right: int40(-7)}), Uint24Int40Pair({left: uint24(0), right: int40(0)}), Uint24Int40Pair({left: type(uint24).max, right: type(int40).min}), Uint24Int40Pair({left: uint24(123), right: int40(-7)})]; + Uint24Int40Pair[4] memory solValue = solBench.benchEchoUint24Int40PairArray4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + Uint24Int40Pair[4] memory feValue = feBench.benchEchoUint24Int40PairArray4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiPairUint24Int40Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiPairUint24Int40Bench.t.sol new file mode 100644 index 0000000000..ca3b22820e --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiPairUint24Int40Bench.t.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {Uint24Int40Pair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiPairUint24Int40BenchTest is AbiRoundtripBase { + function testBenchEchoUint24Int40Pair() public { + Uint24Int40Pair memory value = Uint24Int40Pair({left: uint24(123), right: int40(-7)}); + Uint24Int40Pair memory solValue = solBench.benchEchoUint24Int40Pair(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + Uint24Int40Pair memory feValue = feBench.benchEchoUint24Int40Pair(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiStringArray2Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiStringArray2Bench.t.sol new file mode 100644 index 0000000000..4c39ca5693 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiStringArray2Bench.t.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiStringArray2BenchTest is AbiRoundtripBase { + function testBenchEchoStringArray2() public { + string[2] memory value = ["bench alpha with extra payload bytes", "bench beta with extra payload bytes"]; + assumeShortString(value[0]); + assumeShortString(value[1]); + string[2] memory solValue = solBench.benchEchoStringArray2(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + string[2] memory feValue = feBench.benchEchoStringArray2(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiStringArrayBench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiStringArrayBench.t.sol new file mode 100644 index 0000000000..391f5811eb --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiStringArrayBench.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiStringArrayBenchTest is AbiRoundtripBase { + function testBenchEchoStringArray() public { + string[] memory value = new string[](2); + value[0] = "bench alpha with extra payload bytes"; + value[1] = "bench beta with extra payload bytes"; + for (uint256 i = 0; i < value.length; i++) { + assumeShortString(value[i]); + } + string[] memory solValue = solBench.benchEchoStringArray(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + string[] memory feValue = feBench.benchEchoStringArray(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiStringBench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiStringBench.t.sol new file mode 100644 index 0000000000..20beba36ff --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiStringBench.t.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiStringBenchTest is AbiRoundtripBase { + function testBenchEchoString() public { + string memory value = string("benchmark string payload that exceeds thirty-two bytes"); + assumeShortString(value); + string memory solValue = solBench.benchEchoString(value); + require(keccak256(bytes(solValue)) == keccak256(bytes(value)), "sol value"); + string memory feValue = feBench.benchEchoString(value); + require(keccak256(bytes(feValue)) == keccak256(bytes(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiStringU64PairArray2Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiStringU64PairArray2Bench.t.sol new file mode 100644 index 0000000000..748df9f76d --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiStringU64PairArray2Bench.t.sol @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {StringU64Pair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiStringU64PairArray2BenchTest is AbiRoundtripBase { + function testBenchEchoStringU64PairArray2() public { + StringU64Pair[2] memory value = [StringU64Pair({text: "bench-one-with-extra-payload", count: uint64(11)}), StringU64Pair({text: "bench-two-with-extra-payload", count: uint64(22)})]; + assumeShortString(value[0].text); + assumeShortString(value[1].text); + StringU64Pair[2] memory solValue = solBench.benchEchoStringU64PairArray2(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + StringU64Pair[2] memory feValue = feBench.benchEchoStringU64PairArray2(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiStringU64PairArrayBench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiStringU64PairArrayBench.t.sol new file mode 100644 index 0000000000..7f8d229732 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiStringU64PairArrayBench.t.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {StringU64Pair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiStringU64PairArrayBenchTest is AbiRoundtripBase { + function testBenchEchoStringU64PairArray() public { + StringU64Pair[] memory value = new StringU64Pair[](2); + value[0] = StringU64Pair({text: "bench-one-with-extra-payload", count: uint64(11)}); + value[1] = StringU64Pair({text: "bench-two-with-extra-payload", count: uint64(22)}); + for (uint256 i = 0; i < value.length; i++) { + assumeShortString(value[i].text); + } + StringU64Pair[] memory solValue = solBench.benchEchoStringU64PairArray(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + StringU64Pair[] memory feValue = feBench.benchEchoStringU64PairArray(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiTripleBoolAddressU256Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiTripleBoolAddressU256Array4Bench.t.sol new file mode 100644 index 0000000000..3908450f82 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiTripleBoolAddressU256Array4Bench.t.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {BoolAddressU256Triple} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiTripleBoolAddressU256Array4BenchTest is AbiRoundtripBase { + function testBenchEchoBoolAddressU256TripleArray4() public { + BoolAddressU256Triple[4] memory value = [BoolAddressU256Triple({flag: true, addr: address(0x6000000000000000000000000000000000000006), count: uint256(123456789)}), BoolAddressU256Triple({flag: false, addr: address(0), count: uint256(0)}), BoolAddressU256Triple({flag: true, addr: address(0x5000000000000000000000000000000000000005), count: type(uint256).max}), BoolAddressU256Triple({flag: true, addr: address(0x6000000000000000000000000000000000000006), count: uint256(123456789)})]; + BoolAddressU256Triple[4] memory solValue = solBench.benchEchoBoolAddressU256TripleArray4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + BoolAddressU256Triple[4] memory feValue = feBench.benchEchoBoolAddressU256TripleArray4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiTripleBoolAddressU256Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiTripleBoolAddressU256Bench.t.sol new file mode 100644 index 0000000000..556f993f26 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiTripleBoolAddressU256Bench.t.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {BoolAddressU256Triple} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiTripleBoolAddressU256BenchTest is AbiRoundtripBase { + function testBenchEchoBoolAddressU256Triple() public { + BoolAddressU256Triple memory value = BoolAddressU256Triple({flag: true, addr: address(0x6000000000000000000000000000000000000006), count: uint256(123456789)}); + BoolAddressU256Triple memory solValue = solBench.benchEchoBoolAddressU256Triple(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + BoolAddressU256Triple memory feValue = feBench.benchEchoBoolAddressU256Triple(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiTripleStringBoolU64Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiTripleStringBoolU64Bench.t.sol new file mode 100644 index 0000000000..b386766ffd --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiTripleStringBoolU64Bench.t.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {StringBoolU64Triple} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiTripleStringBoolU64BenchTest is AbiRoundtripBase { + function testBenchEchoStringBoolU64Triple() public { + StringBoolU64Triple memory value = StringBoolU64Triple({text: "bench triple", flag: true, count: uint64(77)}); + assumeShortString(value.text); + StringBoolU64Triple memory solValue = solBench.benchEchoStringBoolU64Triple(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + StringBoolU64Triple memory feValue = feBench.benchEchoStringBoolU64Triple(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint104Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint104Bench.t.sol new file mode 100644 index 0000000000..90ef6655e9 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint104Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint104BenchTest is AbiRoundtripBase { + function testBenchEchoUint104() public { + uint104 value = uint104(123); + require(solBench.benchEchoUint104(value) == value, "sol value"); + require(feBench.benchEchoUint104(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint112Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint112Bench.t.sol new file mode 100644 index 0000000000..9d21519648 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint112Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint112BenchTest is AbiRoundtripBase { + function testBenchEchoUint112() public { + uint112 value = uint112(123); + require(solBench.benchEchoUint112(value) == value, "sol value"); + require(feBench.benchEchoUint112(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint120Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint120Bench.t.sol new file mode 100644 index 0000000000..cc7b078fed --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint120Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint120BenchTest is AbiRoundtripBase { + function testBenchEchoUint120() public { + uint120 value = uint120(123); + require(solBench.benchEchoUint120(value) == value, "sol value"); + require(feBench.benchEchoUint120(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint128Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint128Array4Bench.t.sol new file mode 100644 index 0000000000..f04d9e25f5 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint128Array4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint128Array4BenchTest is AbiRoundtripBase { + function testBenchEchoUint128Array4() public { + uint128[4] memory value = [uint128(123), uint128(0), uint128(1), type(uint128).max]; + uint128[4] memory solValue = solBench.benchEchoUint128Array4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + uint128[4] memory feValue = feBench.benchEchoUint128Array4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint128Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint128Bench.t.sol new file mode 100644 index 0000000000..b2f8e16369 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint128Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint128BenchTest is AbiRoundtripBase { + function testBenchEchoUint128() public { + uint128 value = uint128(123); + require(solBench.benchEchoUint128(value) == value, "sol value"); + require(feBench.benchEchoUint128(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint136Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint136Bench.t.sol new file mode 100644 index 0000000000..558d8c389f --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint136Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint136BenchTest is AbiRoundtripBase { + function testBenchEchoUint136() public { + uint136 value = uint136(123); + require(solBench.benchEchoUint136(value) == value, "sol value"); + require(feBench.benchEchoUint136(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint144Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint144Bench.t.sol new file mode 100644 index 0000000000..ee1854e51a --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint144Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint144BenchTest is AbiRoundtripBase { + function testBenchEchoUint144() public { + uint144 value = uint144(123); + require(solBench.benchEchoUint144(value) == value, "sol value"); + require(feBench.benchEchoUint144(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint152Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint152Bench.t.sol new file mode 100644 index 0000000000..85966cc4a2 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint152Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint152BenchTest is AbiRoundtripBase { + function testBenchEchoUint152() public { + uint152 value = uint152(123); + require(solBench.benchEchoUint152(value) == value, "sol value"); + require(feBench.benchEchoUint152(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint160Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint160Array4Bench.t.sol new file mode 100644 index 0000000000..4a4c9b5aab --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint160Array4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint160Array4BenchTest is AbiRoundtripBase { + function testBenchEchoUint160Array4() public { + uint160[4] memory value = [uint160(123), uint160(0), uint160(1), type(uint160).max]; + uint160[4] memory solValue = solBench.benchEchoUint160Array4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + uint160[4] memory feValue = feBench.benchEchoUint160Array4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint160Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint160Bench.t.sol new file mode 100644 index 0000000000..b54ca96dfe --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint160Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint160BenchTest is AbiRoundtripBase { + function testBenchEchoUint160() public { + uint160 value = uint160(123); + require(solBench.benchEchoUint160(value) == value, "sol value"); + require(feBench.benchEchoUint160(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint168Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint168Bench.t.sol new file mode 100644 index 0000000000..5623b9efae --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint168Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint168BenchTest is AbiRoundtripBase { + function testBenchEchoUint168() public { + uint168 value = uint168(123); + require(solBench.benchEchoUint168(value) == value, "sol value"); + require(feBench.benchEchoUint168(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint16Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint16Array4Bench.t.sol new file mode 100644 index 0000000000..f1bb54c7ca --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint16Array4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint16Array4BenchTest is AbiRoundtripBase { + function testBenchEchoUint16Array4() public { + uint16[4] memory value = [uint16(123), uint16(0), uint16(1), type(uint16).max]; + uint16[4] memory solValue = solBench.benchEchoUint16Array4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + uint16[4] memory feValue = feBench.benchEchoUint16Array4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint16Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint16Bench.t.sol new file mode 100644 index 0000000000..354ceef6dc --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint16Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint16BenchTest is AbiRoundtripBase { + function testBenchEchoUint16() public { + uint16 value = uint16(123); + require(solBench.benchEchoUint16(value) == value, "sol value"); + require(feBench.benchEchoUint16(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint176Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint176Bench.t.sol new file mode 100644 index 0000000000..efeaf3e88b --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint176Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint176BenchTest is AbiRoundtripBase { + function testBenchEchoUint176() public { + uint176 value = uint176(123); + require(solBench.benchEchoUint176(value) == value, "sol value"); + require(feBench.benchEchoUint176(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint184Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint184Bench.t.sol new file mode 100644 index 0000000000..396d229a12 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint184Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint184BenchTest is AbiRoundtripBase { + function testBenchEchoUint184() public { + uint184 value = uint184(123); + require(solBench.benchEchoUint184(value) == value, "sol value"); + require(feBench.benchEchoUint184(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint192Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint192Bench.t.sol new file mode 100644 index 0000000000..bdb7677507 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint192Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint192BenchTest is AbiRoundtripBase { + function testBenchEchoUint192() public { + uint192 value = uint192(123); + require(solBench.benchEchoUint192(value) == value, "sol value"); + require(feBench.benchEchoUint192(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint200Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint200Bench.t.sol new file mode 100644 index 0000000000..53cfc82723 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint200Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint200BenchTest is AbiRoundtripBase { + function testBenchEchoUint200() public { + uint200 value = uint200(123); + require(solBench.benchEchoUint200(value) == value, "sol value"); + require(feBench.benchEchoUint200(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint208Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint208Bench.t.sol new file mode 100644 index 0000000000..9a369faee7 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint208Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint208BenchTest is AbiRoundtripBase { + function testBenchEchoUint208() public { + uint208 value = uint208(123); + require(solBench.benchEchoUint208(value) == value, "sol value"); + require(feBench.benchEchoUint208(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint216Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint216Bench.t.sol new file mode 100644 index 0000000000..e298a70045 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint216Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint216BenchTest is AbiRoundtripBase { + function testBenchEchoUint216() public { + uint216 value = uint216(123); + require(solBench.benchEchoUint216(value) == value, "sol value"); + require(feBench.benchEchoUint216(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint224Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint224Bench.t.sol new file mode 100644 index 0000000000..64f07723d5 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint224Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint224BenchTest is AbiRoundtripBase { + function testBenchEchoUint224() public { + uint224 value = uint224(123); + require(solBench.benchEchoUint224(value) == value, "sol value"); + require(feBench.benchEchoUint224(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint232Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint232Bench.t.sol new file mode 100644 index 0000000000..6c6e6e2374 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint232Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint232BenchTest is AbiRoundtripBase { + function testBenchEchoUint232() public { + uint232 value = uint232(123); + require(solBench.benchEchoUint232(value) == value, "sol value"); + require(feBench.benchEchoUint232(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint240Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint240Bench.t.sol new file mode 100644 index 0000000000..80b79b5778 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint240Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint240BenchTest is AbiRoundtripBase { + function testBenchEchoUint240() public { + uint240 value = uint240(123); + require(solBench.benchEchoUint240(value) == value, "sol value"); + require(feBench.benchEchoUint240(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint248Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint248Array4Bench.t.sol new file mode 100644 index 0000000000..dbf7c8cd5a --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint248Array4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint248Array4BenchTest is AbiRoundtripBase { + function testBenchEchoUint248Array4() public { + uint248[4] memory value = [uint248(123), uint248(0), uint248(1), type(uint248).max]; + uint248[4] memory solValue = solBench.benchEchoUint248Array4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + uint248[4] memory feValue = feBench.benchEchoUint248Array4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint248Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint248Bench.t.sol new file mode 100644 index 0000000000..7dcb4edc6b --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint248Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint248BenchTest is AbiRoundtripBase { + function testBenchEchoUint248() public { + uint248 value = uint248(123); + require(solBench.benchEchoUint248(value) == value, "sol value"); + require(feBench.benchEchoUint248(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint24Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint24Array4Bench.t.sol new file mode 100644 index 0000000000..a3f6c7f68c --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint24Array4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint24Array4BenchTest is AbiRoundtripBase { + function testBenchEchoUint24Array4() public { + uint24[4] memory value = [uint24(123), uint24(0), uint24(1), type(uint24).max]; + uint24[4] memory solValue = solBench.benchEchoUint24Array4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + uint24[4] memory feValue = feBench.benchEchoUint24Array4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint24Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint24Bench.t.sol new file mode 100644 index 0000000000..c815820447 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint24Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint24BenchTest is AbiRoundtripBase { + function testBenchEchoUint24() public { + uint24 value = uint24(123); + require(solBench.benchEchoUint24(value) == value, "sol value"); + require(feBench.benchEchoUint24(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint24Matrix2x2Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint24Matrix2x2Bench.t.sol new file mode 100644 index 0000000000..5413c6ee72 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint24Matrix2x2Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint24Matrix2x2BenchTest is AbiRoundtripBase { + function testBenchEchoUint24Matrix2x2() public { + uint24[2][2] memory value = [[uint24(123), uint24(0)], [uint24(1), type(uint24).max]]; + uint24[2][2] memory solValue = solBench.benchEchoUint24Matrix2x2(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + uint24[2][2] memory feValue = feBench.benchEchoUint24Matrix2x2(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint256Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint256Array4Bench.t.sol new file mode 100644 index 0000000000..2b0a547b68 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint256Array4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint256Array4BenchTest is AbiRoundtripBase { + function testBenchEchoUintArray4() public { + uint256[4] memory value = [uint256(77), uint256(0), uint256(1), type(uint256).max]; + uint256[4] memory solValue = solBench.benchEchoUintArray4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + uint256[4] memory feValue = feBench.benchEchoUintArray4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint256Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint256Bench.t.sol new file mode 100644 index 0000000000..bdca2c972f --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint256Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint256BenchTest is AbiRoundtripBase { + function testBenchEchoUint() public { + uint256 value = uint256(77); + require(solBench.benchEchoUint(value) == value, "sol value"); + require(feBench.benchEchoUint(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint256Matrix2x2Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint256Matrix2x2Bench.t.sol new file mode 100644 index 0000000000..58b86eedc2 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint256Matrix2x2Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint256Matrix2x2BenchTest is AbiRoundtripBase { + function testBenchEchoUintMatrix2x2() public { + uint256[2][2] memory value = [[uint256(77), uint256(0)], [uint256(1), type(uint256).max]]; + uint256[2][2] memory solValue = solBench.benchEchoUintMatrix2x2(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + uint256[2][2] memory feValue = feBench.benchEchoUintMatrix2x2(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint32Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint32Array4Bench.t.sol new file mode 100644 index 0000000000..1f1faf2060 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint32Array4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint32Array4BenchTest is AbiRoundtripBase { + function testBenchEchoUint32Array4() public { + uint32[4] memory value = [uint32(123), uint32(0), uint32(1), type(uint32).max]; + uint32[4] memory solValue = solBench.benchEchoUint32Array4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + uint32[4] memory feValue = feBench.benchEchoUint32Array4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint32Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint32Bench.t.sol new file mode 100644 index 0000000000..5ec2da63f1 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint32Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint32BenchTest is AbiRoundtripBase { + function testBenchEchoUint32() public { + uint32 value = uint32(123); + require(solBench.benchEchoUint32(value) == value, "sol value"); + require(feBench.benchEchoUint32(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint40Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint40Array4Bench.t.sol new file mode 100644 index 0000000000..094cbe1b84 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint40Array4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint40Array4BenchTest is AbiRoundtripBase { + function testBenchEchoUint40Array4() public { + uint40[4] memory value = [uint40(123), uint40(0), uint40(1), type(uint40).max]; + uint40[4] memory solValue = solBench.benchEchoUint40Array4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + uint40[4] memory feValue = feBench.benchEchoUint40Array4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint40Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint40Bench.t.sol new file mode 100644 index 0000000000..6cab6448b4 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint40Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint40BenchTest is AbiRoundtripBase { + function testBenchEchoUint40() public { + uint40 value = uint40(123); + require(solBench.benchEchoUint40(value) == value, "sol value"); + require(feBench.benchEchoUint40(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint48Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint48Bench.t.sol new file mode 100644 index 0000000000..e227b822fa --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint48Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint48BenchTest is AbiRoundtripBase { + function testBenchEchoUint48() public { + uint48 value = uint48(123); + require(solBench.benchEchoUint48(value) == value, "sol value"); + require(feBench.benchEchoUint48(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint56Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint56Bench.t.sol new file mode 100644 index 0000000000..f19177337f --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint56Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint56BenchTest is AbiRoundtripBase { + function testBenchEchoUint56() public { + uint56 value = uint56(123); + require(solBench.benchEchoUint56(value) == value, "sol value"); + require(feBench.benchEchoUint56(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint64Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint64Array4Bench.t.sol new file mode 100644 index 0000000000..52c0b0840b --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint64Array4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint64Array4BenchTest is AbiRoundtripBase { + function testBenchEchoUint64Array4() public { + uint64[4] memory value = [uint64(123), uint64(0), uint64(1), type(uint64).max]; + uint64[4] memory solValue = solBench.benchEchoUint64Array4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + uint64[4] memory feValue = feBench.benchEchoUint64Array4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint64Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint64Bench.t.sol new file mode 100644 index 0000000000..2bf2551bd0 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint64Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint64BenchTest is AbiRoundtripBase { + function testBenchEchoUint64() public { + uint64 value = uint64(123); + require(solBench.benchEchoUint64(value) == value, "sol value"); + require(feBench.benchEchoUint64(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint72Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint72Bench.t.sol new file mode 100644 index 0000000000..37a0fe1794 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint72Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint72BenchTest is AbiRoundtripBase { + function testBenchEchoUint72() public { + uint72 value = uint72(123); + require(solBench.benchEchoUint72(value) == value, "sol value"); + require(feBench.benchEchoUint72(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint80Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint80Bench.t.sol new file mode 100644 index 0000000000..b7cad2e8b4 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint80Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint80BenchTest is AbiRoundtripBase { + function testBenchEchoUint80() public { + uint80 value = uint80(123); + require(solBench.benchEchoUint80(value) == value, "sol value"); + require(feBench.benchEchoUint80(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint88Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint88Bench.t.sol new file mode 100644 index 0000000000..474c28cf74 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint88Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint88BenchTest is AbiRoundtripBase { + function testBenchEchoUint88() public { + uint88 value = uint88(123); + require(solBench.benchEchoUint88(value) == value, "sol value"); + require(feBench.benchEchoUint88(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint8Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint8Array4Bench.t.sol new file mode 100644 index 0000000000..c19123b813 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint8Array4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint8Array4BenchTest is AbiRoundtripBase { + function testBenchEchoUint8Array4() public { + uint8[4] memory value = [uint8(123), uint8(0), uint8(1), type(uint8).max]; + uint8[4] memory solValue = solBench.benchEchoUint8Array4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + uint8[4] memory feValue = feBench.benchEchoUint8Array4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint8Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint8Bench.t.sol new file mode 100644 index 0000000000..c96d8069df --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint8Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint8BenchTest is AbiRoundtripBase { + function testBenchEchoUint8() public { + uint8 value = uint8(123); + require(solBench.benchEchoUint8(value) == value, "sol value"); + require(feBench.benchEchoUint8(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint96Array4Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint96Array4Bench.t.sol new file mode 100644 index 0000000000..a718402150 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint96Array4Bench.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint96Array4BenchTest is AbiRoundtripBase { + function testBenchEchoUint96Array4() public { + uint96[4] memory value = [uint96(123), uint96(0), uint96(1), type(uint96).max]; + uint96[4] memory solValue = solBench.benchEchoUint96Array4(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + uint96[4] memory feValue = feBench.benchEchoUint96Array4(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUint96Bench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUint96Bench.t.sol new file mode 100644 index 0000000000..3cd72cd68a --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUint96Bench.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUint96BenchTest is AbiRoundtripBase { + function testBenchEchoUint96() public { + uint96 value = uint96(123); + require(solBench.benchEchoUint96(value) == value, "sol value"); + require(feBench.benchEchoUint96(value) == value, "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/bench/AbiUintArrayBench.t.sol b/benchmarks/foundry-abi/test/generated/bench/AbiUintArrayBench.t.sol new file mode 100644 index 0000000000..20c883bbeb --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/bench/AbiUintArrayBench.t.sol @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; + +contract AbiUintArrayBenchTest is AbiRoundtripBase { + function testBenchEchoUintArray() public { + uint256[] memory value = new uint256[](3); + value[0] = uint256(77); + value[1] = uint256(1); + value[2] = uint256(0); + uint256[] memory solValue = solBench.benchEchoUintArray(value); + require(keccak256(abi.encode(solValue)) == keccak256(abi.encode(value)), "sol value"); + uint256[] memory feValue = feBench.benchEchoUintArray(value); + require(keccak256(abi.encode(feValue)) == keccak256(abi.encode(value)), "fe value"); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiAddressArray4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiAddressArray4Deterministic.t.sol new file mode 100644 index 0000000000..e7155f0b08 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiAddressArray4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiAddressArray4DeterministicTest is AbiRoundtripBase { + function testEchoAddressArray4Deterministic0() public { + address[4] memory value = [address(0), address(0x1000000000000000000000000000000000000001), address(0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF), address(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoAddressArray4.selector, value); + assertEquivalent(callData); + } + + function testEchoAddressArray4Deterministic1() public { + address[4] memory value = [address(0x1000000000000000000000000000000000000001), address(0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF), address(0), address(0x1000000000000000000000000000000000000001)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoAddressArray4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiAddressDeterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiAddressDeterministic.t.sol new file mode 100644 index 0000000000..2bde6616bf --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiAddressDeterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiAddressDeterministicTest is AbiRoundtripBase { + function testEchoAddressDeterministic0() public { + address value = address(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoAddress.selector, value); + assertEquivalent(callData); + } + + function testEchoAddressDeterministic1() public { + address value = address(0x1000000000000000000000000000000000000001); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoAddress.selector, value); + assertEquivalent(callData); + } + + function testEchoAddressDeterministic2() public { + address value = address(0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoAddress.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiAddressMatrix2x2Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiAddressMatrix2x2Deterministic.t.sol new file mode 100644 index 0000000000..c677c5c490 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiAddressMatrix2x2Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiAddressMatrix2x2DeterministicTest is AbiRoundtripBase { + function testEchoAddressMatrix2x2Deterministic0() public { + address[2][2] memory value = [[address(0), address(0x1000000000000000000000000000000000000001)], [address(0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF), address(0)]]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoAddressMatrix2x2.selector, value); + assertEquivalent(callData); + } + + function testEchoAddressMatrix2x2Deterministic1() public { + address[2][2] memory value = [[address(0x1000000000000000000000000000000000000001), address(0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF)], [address(0), address(0x1000000000000000000000000000000000000001)]]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoAddressMatrix2x2.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiBoolAddressPairArrayDeterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiBoolAddressPairArrayDeterministic.t.sol new file mode 100644 index 0000000000..5a0d561bdb --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiBoolAddressPairArrayDeterministic.t.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip, BoolAddressPair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiBoolAddressPairArrayDeterministicTest is AbiRoundtripBase { + function testEchoBoolAddressPairArrayDeterministic0() public { + BoolAddressPair[] memory value = new BoolAddressPair[](0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBoolAddressPairArray.selector, value); + assertEquivalent(callData); + } + + function testEchoBoolAddressPairArrayDeterministic1() public { + BoolAddressPair[] memory value = new BoolAddressPair[](2); + value[0] = BoolAddressPair({flag: false, addr: address(0)}); + value[1] = BoolAddressPair({flag: true, addr: address(0x3000000000000000000000000000000000000003)}); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBoolAddressPairArray.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiBoolArray4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiBoolArray4Deterministic.t.sol new file mode 100644 index 0000000000..cbe2dd2a41 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiBoolArray4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiBoolArray4DeterministicTest is AbiRoundtripBase { + function testEchoBoolArray4Deterministic0() public { + bool[4] memory value = [false, true, false, true]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBoolArray4.selector, value); + assertEquivalent(callData); + } + + function testEchoBoolArray4Deterministic1() public { + bool[4] memory value = [true, false, true, false]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBoolArray4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiBoolDeterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiBoolDeterministic.t.sol new file mode 100644 index 0000000000..2f56d82a6f --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiBoolDeterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiBoolDeterministicTest is AbiRoundtripBase { + function testEchoBoolDeterministic0() public { + bool value = false; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBool.selector, value); + assertEquivalent(callData); + } + + function testEchoBoolDeterministic1() public { + bool value = true; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBool.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiBoolMatrix2x2Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiBoolMatrix2x2Deterministic.t.sol new file mode 100644 index 0000000000..ee7054d41b --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiBoolMatrix2x2Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiBoolMatrix2x2DeterministicTest is AbiRoundtripBase { + function testEchoBoolMatrix2x2Deterministic0() public { + bool[2][2] memory value = [[false, true], [false, true]]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBoolMatrix2x2.selector, value); + assertEquivalent(callData); + } + + function testEchoBoolMatrix2x2Deterministic1() public { + bool[2][2] memory value = [[true, false], [true, false]]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBoolMatrix2x2.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt104Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt104Deterministic.t.sol new file mode 100644 index 0000000000..fac93ef2d9 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt104Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt104DeterministicTest is AbiRoundtripBase { + function testEchoInt104Deterministic0() public { + int104 value = int104(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt104.selector, value); + assertEquivalent(callData); + } + + function testEchoInt104Deterministic1() public { + int104 value = int104(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt104.selector, value); + assertEquivalent(callData); + } + + function testEchoInt104Deterministic2() public { + int104 value = type(int104).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt104.selector, value); + assertEquivalent(callData); + } + + function testEchoInt104Deterministic3() public { + int104 value = type(int104).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt104.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt112Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt112Deterministic.t.sol new file mode 100644 index 0000000000..9713022030 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt112Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt112DeterministicTest is AbiRoundtripBase { + function testEchoInt112Deterministic0() public { + int112 value = int112(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt112.selector, value); + assertEquivalent(callData); + } + + function testEchoInt112Deterministic1() public { + int112 value = int112(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt112.selector, value); + assertEquivalent(callData); + } + + function testEchoInt112Deterministic2() public { + int112 value = type(int112).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt112.selector, value); + assertEquivalent(callData); + } + + function testEchoInt112Deterministic3() public { + int112 value = type(int112).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt112.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt120Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt120Deterministic.t.sol new file mode 100644 index 0000000000..c814c65cb4 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt120Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt120DeterministicTest is AbiRoundtripBase { + function testEchoInt120Deterministic0() public { + int120 value = int120(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt120.selector, value); + assertEquivalent(callData); + } + + function testEchoInt120Deterministic1() public { + int120 value = int120(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt120.selector, value); + assertEquivalent(callData); + } + + function testEchoInt120Deterministic2() public { + int120 value = type(int120).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt120.selector, value); + assertEquivalent(callData); + } + + function testEchoInt120Deterministic3() public { + int120 value = type(int120).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt120.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt128Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt128Array4Deterministic.t.sol new file mode 100644 index 0000000000..8d9eb7e5de --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt128Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt128Array4DeterministicTest is AbiRoundtripBase { + function testEchoInt128Array4Deterministic0() public { + int128[4] memory value = [int128(0), int128(-1), type(int128).min, type(int128).max]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt128Array4.selector, value); + assertEquivalent(callData); + } + + function testEchoInt128Array4Deterministic1() public { + int128[4] memory value = [int128(-1), type(int128).min, type(int128).max, int128(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt128Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt128Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt128Deterministic.t.sol new file mode 100644 index 0000000000..d476ed228d --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt128Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt128DeterministicTest is AbiRoundtripBase { + function testEchoInt128Deterministic0() public { + int128 value = int128(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt128.selector, value); + assertEquivalent(callData); + } + + function testEchoInt128Deterministic1() public { + int128 value = int128(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt128.selector, value); + assertEquivalent(callData); + } + + function testEchoInt128Deterministic2() public { + int128 value = type(int128).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt128.selector, value); + assertEquivalent(callData); + } + + function testEchoInt128Deterministic3() public { + int128 value = type(int128).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt128.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt136Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt136Deterministic.t.sol new file mode 100644 index 0000000000..4eedb164f3 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt136Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt136DeterministicTest is AbiRoundtripBase { + function testEchoInt136Deterministic0() public { + int136 value = int136(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt136.selector, value); + assertEquivalent(callData); + } + + function testEchoInt136Deterministic1() public { + int136 value = int136(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt136.selector, value); + assertEquivalent(callData); + } + + function testEchoInt136Deterministic2() public { + int136 value = type(int136).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt136.selector, value); + assertEquivalent(callData); + } + + function testEchoInt136Deterministic3() public { + int136 value = type(int136).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt136.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt144Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt144Deterministic.t.sol new file mode 100644 index 0000000000..181927a12c --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt144Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt144DeterministicTest is AbiRoundtripBase { + function testEchoInt144Deterministic0() public { + int144 value = int144(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt144.selector, value); + assertEquivalent(callData); + } + + function testEchoInt144Deterministic1() public { + int144 value = int144(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt144.selector, value); + assertEquivalent(callData); + } + + function testEchoInt144Deterministic2() public { + int144 value = type(int144).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt144.selector, value); + assertEquivalent(callData); + } + + function testEchoInt144Deterministic3() public { + int144 value = type(int144).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt144.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt152Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt152Deterministic.t.sol new file mode 100644 index 0000000000..3a24018eb1 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt152Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt152DeterministicTest is AbiRoundtripBase { + function testEchoInt152Deterministic0() public { + int152 value = int152(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt152.selector, value); + assertEquivalent(callData); + } + + function testEchoInt152Deterministic1() public { + int152 value = int152(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt152.selector, value); + assertEquivalent(callData); + } + + function testEchoInt152Deterministic2() public { + int152 value = type(int152).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt152.selector, value); + assertEquivalent(callData); + } + + function testEchoInt152Deterministic3() public { + int152 value = type(int152).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt152.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt160Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt160Array4Deterministic.t.sol new file mode 100644 index 0000000000..f948a4d778 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt160Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt160Array4DeterministicTest is AbiRoundtripBase { + function testEchoInt160Array4Deterministic0() public { + int160[4] memory value = [int160(0), int160(-1), type(int160).min, type(int160).max]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt160Array4.selector, value); + assertEquivalent(callData); + } + + function testEchoInt160Array4Deterministic1() public { + int160[4] memory value = [int160(-1), type(int160).min, type(int160).max, int160(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt160Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt160Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt160Deterministic.t.sol new file mode 100644 index 0000000000..a714b6abe8 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt160Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt160DeterministicTest is AbiRoundtripBase { + function testEchoInt160Deterministic0() public { + int160 value = int160(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt160.selector, value); + assertEquivalent(callData); + } + + function testEchoInt160Deterministic1() public { + int160 value = int160(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt160.selector, value); + assertEquivalent(callData); + } + + function testEchoInt160Deterministic2() public { + int160 value = type(int160).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt160.selector, value); + assertEquivalent(callData); + } + + function testEchoInt160Deterministic3() public { + int160 value = type(int160).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt160.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt168Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt168Deterministic.t.sol new file mode 100644 index 0000000000..31215bcbd5 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt168Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt168DeterministicTest is AbiRoundtripBase { + function testEchoInt168Deterministic0() public { + int168 value = int168(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt168.selector, value); + assertEquivalent(callData); + } + + function testEchoInt168Deterministic1() public { + int168 value = int168(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt168.selector, value); + assertEquivalent(callData); + } + + function testEchoInt168Deterministic2() public { + int168 value = type(int168).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt168.selector, value); + assertEquivalent(callData); + } + + function testEchoInt168Deterministic3() public { + int168 value = type(int168).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt168.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt16Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt16Array4Deterministic.t.sol new file mode 100644 index 0000000000..8d27dc2f36 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt16Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt16Array4DeterministicTest is AbiRoundtripBase { + function testEchoInt16Array4Deterministic0() public { + int16[4] memory value = [int16(0), int16(-1), type(int16).min, type(int16).max]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt16Array4.selector, value); + assertEquivalent(callData); + } + + function testEchoInt16Array4Deterministic1() public { + int16[4] memory value = [int16(-1), type(int16).min, type(int16).max, int16(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt16Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt16Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt16Deterministic.t.sol new file mode 100644 index 0000000000..317f3875d8 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt16Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt16DeterministicTest is AbiRoundtripBase { + function testEchoInt16Deterministic0() public { + int16 value = int16(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt16.selector, value); + assertEquivalent(callData); + } + + function testEchoInt16Deterministic1() public { + int16 value = int16(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt16.selector, value); + assertEquivalent(callData); + } + + function testEchoInt16Deterministic2() public { + int16 value = type(int16).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt16.selector, value); + assertEquivalent(callData); + } + + function testEchoInt16Deterministic3() public { + int16 value = type(int16).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt16.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt176Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt176Deterministic.t.sol new file mode 100644 index 0000000000..bdd0adf7cb --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt176Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt176DeterministicTest is AbiRoundtripBase { + function testEchoInt176Deterministic0() public { + int176 value = int176(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt176.selector, value); + assertEquivalent(callData); + } + + function testEchoInt176Deterministic1() public { + int176 value = int176(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt176.selector, value); + assertEquivalent(callData); + } + + function testEchoInt176Deterministic2() public { + int176 value = type(int176).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt176.selector, value); + assertEquivalent(callData); + } + + function testEchoInt176Deterministic3() public { + int176 value = type(int176).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt176.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt184Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt184Deterministic.t.sol new file mode 100644 index 0000000000..0e43479e15 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt184Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt184DeterministicTest is AbiRoundtripBase { + function testEchoInt184Deterministic0() public { + int184 value = int184(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt184.selector, value); + assertEquivalent(callData); + } + + function testEchoInt184Deterministic1() public { + int184 value = int184(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt184.selector, value); + assertEquivalent(callData); + } + + function testEchoInt184Deterministic2() public { + int184 value = type(int184).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt184.selector, value); + assertEquivalent(callData); + } + + function testEchoInt184Deterministic3() public { + int184 value = type(int184).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt184.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt192Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt192Deterministic.t.sol new file mode 100644 index 0000000000..0407c287cb --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt192Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt192DeterministicTest is AbiRoundtripBase { + function testEchoInt192Deterministic0() public { + int192 value = int192(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt192.selector, value); + assertEquivalent(callData); + } + + function testEchoInt192Deterministic1() public { + int192 value = int192(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt192.selector, value); + assertEquivalent(callData); + } + + function testEchoInt192Deterministic2() public { + int192 value = type(int192).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt192.selector, value); + assertEquivalent(callData); + } + + function testEchoInt192Deterministic3() public { + int192 value = type(int192).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt192.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt200Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt200Deterministic.t.sol new file mode 100644 index 0000000000..9a7284f153 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt200Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt200DeterministicTest is AbiRoundtripBase { + function testEchoInt200Deterministic0() public { + int200 value = int200(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt200.selector, value); + assertEquivalent(callData); + } + + function testEchoInt200Deterministic1() public { + int200 value = int200(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt200.selector, value); + assertEquivalent(callData); + } + + function testEchoInt200Deterministic2() public { + int200 value = type(int200).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt200.selector, value); + assertEquivalent(callData); + } + + function testEchoInt200Deterministic3() public { + int200 value = type(int200).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt200.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt208Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt208Deterministic.t.sol new file mode 100644 index 0000000000..8fa0f3f2cc --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt208Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt208DeterministicTest is AbiRoundtripBase { + function testEchoInt208Deterministic0() public { + int208 value = int208(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt208.selector, value); + assertEquivalent(callData); + } + + function testEchoInt208Deterministic1() public { + int208 value = int208(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt208.selector, value); + assertEquivalent(callData); + } + + function testEchoInt208Deterministic2() public { + int208 value = type(int208).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt208.selector, value); + assertEquivalent(callData); + } + + function testEchoInt208Deterministic3() public { + int208 value = type(int208).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt208.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt216Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt216Deterministic.t.sol new file mode 100644 index 0000000000..c206780153 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt216Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt216DeterministicTest is AbiRoundtripBase { + function testEchoInt216Deterministic0() public { + int216 value = int216(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt216.selector, value); + assertEquivalent(callData); + } + + function testEchoInt216Deterministic1() public { + int216 value = int216(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt216.selector, value); + assertEquivalent(callData); + } + + function testEchoInt216Deterministic2() public { + int216 value = type(int216).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt216.selector, value); + assertEquivalent(callData); + } + + function testEchoInt216Deterministic3() public { + int216 value = type(int216).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt216.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt224Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt224Deterministic.t.sol new file mode 100644 index 0000000000..acda3b2f77 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt224Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt224DeterministicTest is AbiRoundtripBase { + function testEchoInt224Deterministic0() public { + int224 value = int224(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt224.selector, value); + assertEquivalent(callData); + } + + function testEchoInt224Deterministic1() public { + int224 value = int224(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt224.selector, value); + assertEquivalent(callData); + } + + function testEchoInt224Deterministic2() public { + int224 value = type(int224).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt224.selector, value); + assertEquivalent(callData); + } + + function testEchoInt224Deterministic3() public { + int224 value = type(int224).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt224.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt232Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt232Deterministic.t.sol new file mode 100644 index 0000000000..d54178eff6 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt232Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt232DeterministicTest is AbiRoundtripBase { + function testEchoInt232Deterministic0() public { + int232 value = int232(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt232.selector, value); + assertEquivalent(callData); + } + + function testEchoInt232Deterministic1() public { + int232 value = int232(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt232.selector, value); + assertEquivalent(callData); + } + + function testEchoInt232Deterministic2() public { + int232 value = type(int232).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt232.selector, value); + assertEquivalent(callData); + } + + function testEchoInt232Deterministic3() public { + int232 value = type(int232).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt232.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt240Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt240Deterministic.t.sol new file mode 100644 index 0000000000..199a9e9fac --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt240Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt240DeterministicTest is AbiRoundtripBase { + function testEchoInt240Deterministic0() public { + int240 value = int240(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt240.selector, value); + assertEquivalent(callData); + } + + function testEchoInt240Deterministic1() public { + int240 value = int240(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt240.selector, value); + assertEquivalent(callData); + } + + function testEchoInt240Deterministic2() public { + int240 value = type(int240).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt240.selector, value); + assertEquivalent(callData); + } + + function testEchoInt240Deterministic3() public { + int240 value = type(int240).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt240.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt248Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt248Array4Deterministic.t.sol new file mode 100644 index 0000000000..31542048e1 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt248Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt248Array4DeterministicTest is AbiRoundtripBase { + function testEchoInt248Array4Deterministic0() public { + int248[4] memory value = [int248(0), int248(-1), type(int248).min, type(int248).max]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt248Array4.selector, value); + assertEquivalent(callData); + } + + function testEchoInt248Array4Deterministic1() public { + int248[4] memory value = [int248(-1), type(int248).min, type(int248).max, int248(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt248Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt248Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt248Deterministic.t.sol new file mode 100644 index 0000000000..8f49a1a8c2 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt248Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt248DeterministicTest is AbiRoundtripBase { + function testEchoInt248Deterministic0() public { + int248 value = int248(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt248.selector, value); + assertEquivalent(callData); + } + + function testEchoInt248Deterministic1() public { + int248 value = int248(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt248.selector, value); + assertEquivalent(callData); + } + + function testEchoInt248Deterministic2() public { + int248 value = type(int248).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt248.selector, value); + assertEquivalent(callData); + } + + function testEchoInt248Deterministic3() public { + int248 value = type(int248).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt248.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt24Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt24Array4Deterministic.t.sol new file mode 100644 index 0000000000..a16e55134d --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt24Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt24Array4DeterministicTest is AbiRoundtripBase { + function testEchoInt24Array4Deterministic0() public { + int24[4] memory value = [int24(0), int24(-1), type(int24).min, type(int24).max]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt24Array4.selector, value); + assertEquivalent(callData); + } + + function testEchoInt24Array4Deterministic1() public { + int24[4] memory value = [int24(-1), type(int24).min, type(int24).max, int24(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt24Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt24Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt24Deterministic.t.sol new file mode 100644 index 0000000000..7d6390bd2c --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt24Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt24DeterministicTest is AbiRoundtripBase { + function testEchoInt24Deterministic0() public { + int24 value = int24(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt24.selector, value); + assertEquivalent(callData); + } + + function testEchoInt24Deterministic1() public { + int24 value = int24(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt24.selector, value); + assertEquivalent(callData); + } + + function testEchoInt24Deterministic2() public { + int24 value = type(int24).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt24.selector, value); + assertEquivalent(callData); + } + + function testEchoInt24Deterministic3() public { + int24 value = type(int24).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt24.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt256Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt256Array4Deterministic.t.sol new file mode 100644 index 0000000000..de8f11deef --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt256Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt256Array4DeterministicTest is AbiRoundtripBase { + function testEchoInt256Array4Deterministic0() public { + int256[4] memory value = [int256(0), int256(-1), type(int256).min, type(int256).max]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt256Array4.selector, value); + assertEquivalent(callData); + } + + function testEchoInt256Array4Deterministic1() public { + int256[4] memory value = [int256(-1), type(int256).min, type(int256).max, int256(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt256Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt256Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt256Deterministic.t.sol new file mode 100644 index 0000000000..4b2175341b --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt256Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt256DeterministicTest is AbiRoundtripBase { + function testEchoInt256Deterministic0() public { + int256 value = int256(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt256.selector, value); + assertEquivalent(callData); + } + + function testEchoInt256Deterministic1() public { + int256 value = int256(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt256.selector, value); + assertEquivalent(callData); + } + + function testEchoInt256Deterministic2() public { + int256 value = type(int256).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt256.selector, value); + assertEquivalent(callData); + } + + function testEchoInt256Deterministic3() public { + int256 value = type(int256).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt256.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt256Matrix2x2Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt256Matrix2x2Deterministic.t.sol new file mode 100644 index 0000000000..376a889e41 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt256Matrix2x2Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt256Matrix2x2DeterministicTest is AbiRoundtripBase { + function testEchoInt256Matrix2x2Deterministic0() public { + int256[2][2] memory value = [[int256(0), int256(-1)], [type(int256).min, type(int256).max]]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt256Matrix2x2.selector, value); + assertEquivalent(callData); + } + + function testEchoInt256Matrix2x2Deterministic1() public { + int256[2][2] memory value = [[int256(-1), type(int256).min], [type(int256).max, int256(0)]]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt256Matrix2x2.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt32Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt32Array4Deterministic.t.sol new file mode 100644 index 0000000000..c02800547a --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt32Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt32Array4DeterministicTest is AbiRoundtripBase { + function testEchoInt32Array4Deterministic0() public { + int32[4] memory value = [int32(0), int32(-1), type(int32).min, type(int32).max]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt32Array4.selector, value); + assertEquivalent(callData); + } + + function testEchoInt32Array4Deterministic1() public { + int32[4] memory value = [int32(-1), type(int32).min, type(int32).max, int32(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt32Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt32Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt32Deterministic.t.sol new file mode 100644 index 0000000000..a5a45032f6 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt32Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt32DeterministicTest is AbiRoundtripBase { + function testEchoInt32Deterministic0() public { + int32 value = int32(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt32.selector, value); + assertEquivalent(callData); + } + + function testEchoInt32Deterministic1() public { + int32 value = int32(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt32.selector, value); + assertEquivalent(callData); + } + + function testEchoInt32Deterministic2() public { + int32 value = type(int32).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt32.selector, value); + assertEquivalent(callData); + } + + function testEchoInt32Deterministic3() public { + int32 value = type(int32).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt32.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt40Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt40Array4Deterministic.t.sol new file mode 100644 index 0000000000..f668eaa94f --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt40Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt40Array4DeterministicTest is AbiRoundtripBase { + function testEchoInt40Array4Deterministic0() public { + int40[4] memory value = [int40(0), int40(-1), type(int40).min, type(int40).max]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt40Array4.selector, value); + assertEquivalent(callData); + } + + function testEchoInt40Array4Deterministic1() public { + int40[4] memory value = [int40(-1), type(int40).min, type(int40).max, int40(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt40Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt40Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt40Deterministic.t.sol new file mode 100644 index 0000000000..f80510411e --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt40Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt40DeterministicTest is AbiRoundtripBase { + function testEchoInt40Deterministic0() public { + int40 value = int40(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt40.selector, value); + assertEquivalent(callData); + } + + function testEchoInt40Deterministic1() public { + int40 value = int40(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt40.selector, value); + assertEquivalent(callData); + } + + function testEchoInt40Deterministic2() public { + int40 value = type(int40).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt40.selector, value); + assertEquivalent(callData); + } + + function testEchoInt40Deterministic3() public { + int40 value = type(int40).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt40.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt40Matrix2x2Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt40Matrix2x2Deterministic.t.sol new file mode 100644 index 0000000000..cf499b245d --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt40Matrix2x2Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt40Matrix2x2DeterministicTest is AbiRoundtripBase { + function testEchoInt40Matrix2x2Deterministic0() public { + int40[2][2] memory value = [[int40(0), int40(-1)], [type(int40).min, type(int40).max]]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt40Matrix2x2.selector, value); + assertEquivalent(callData); + } + + function testEchoInt40Matrix2x2Deterministic1() public { + int40[2][2] memory value = [[int40(-1), type(int40).min], [type(int40).max, int40(0)]]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt40Matrix2x2.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt48Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt48Deterministic.t.sol new file mode 100644 index 0000000000..42be8b37f4 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt48Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt48DeterministicTest is AbiRoundtripBase { + function testEchoInt48Deterministic0() public { + int48 value = int48(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt48.selector, value); + assertEquivalent(callData); + } + + function testEchoInt48Deterministic1() public { + int48 value = int48(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt48.selector, value); + assertEquivalent(callData); + } + + function testEchoInt48Deterministic2() public { + int48 value = type(int48).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt48.selector, value); + assertEquivalent(callData); + } + + function testEchoInt48Deterministic3() public { + int48 value = type(int48).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt48.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt56Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt56Deterministic.t.sol new file mode 100644 index 0000000000..e1012bd0a8 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt56Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt56DeterministicTest is AbiRoundtripBase { + function testEchoInt56Deterministic0() public { + int56 value = int56(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt56.selector, value); + assertEquivalent(callData); + } + + function testEchoInt56Deterministic1() public { + int56 value = int56(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt56.selector, value); + assertEquivalent(callData); + } + + function testEchoInt56Deterministic2() public { + int56 value = type(int56).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt56.selector, value); + assertEquivalent(callData); + } + + function testEchoInt56Deterministic3() public { + int56 value = type(int56).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt56.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt64Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt64Array4Deterministic.t.sol new file mode 100644 index 0000000000..739b1e5b62 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt64Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt64Array4DeterministicTest is AbiRoundtripBase { + function testEchoInt64Array4Deterministic0() public { + int64[4] memory value = [int64(0), int64(-1), type(int64).min, type(int64).max]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt64Array4.selector, value); + assertEquivalent(callData); + } + + function testEchoInt64Array4Deterministic1() public { + int64[4] memory value = [int64(-1), type(int64).min, type(int64).max, int64(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt64Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt64Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt64Deterministic.t.sol new file mode 100644 index 0000000000..36ca478739 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt64Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt64DeterministicTest is AbiRoundtripBase { + function testEchoInt64Deterministic0() public { + int64 value = int64(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt64.selector, value); + assertEquivalent(callData); + } + + function testEchoInt64Deterministic1() public { + int64 value = int64(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt64.selector, value); + assertEquivalent(callData); + } + + function testEchoInt64Deterministic2() public { + int64 value = type(int64).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt64.selector, value); + assertEquivalent(callData); + } + + function testEchoInt64Deterministic3() public { + int64 value = type(int64).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt64.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt72Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt72Deterministic.t.sol new file mode 100644 index 0000000000..c10104c871 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt72Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt72DeterministicTest is AbiRoundtripBase { + function testEchoInt72Deterministic0() public { + int72 value = int72(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt72.selector, value); + assertEquivalent(callData); + } + + function testEchoInt72Deterministic1() public { + int72 value = int72(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt72.selector, value); + assertEquivalent(callData); + } + + function testEchoInt72Deterministic2() public { + int72 value = type(int72).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt72.selector, value); + assertEquivalent(callData); + } + + function testEchoInt72Deterministic3() public { + int72 value = type(int72).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt72.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt80Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt80Deterministic.t.sol new file mode 100644 index 0000000000..4c58c9f2f6 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt80Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt80DeterministicTest is AbiRoundtripBase { + function testEchoInt80Deterministic0() public { + int80 value = int80(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt80.selector, value); + assertEquivalent(callData); + } + + function testEchoInt80Deterministic1() public { + int80 value = int80(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt80.selector, value); + assertEquivalent(callData); + } + + function testEchoInt80Deterministic2() public { + int80 value = type(int80).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt80.selector, value); + assertEquivalent(callData); + } + + function testEchoInt80Deterministic3() public { + int80 value = type(int80).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt80.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt88Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt88Deterministic.t.sol new file mode 100644 index 0000000000..0e0d3cf16a --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt88Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt88DeterministicTest is AbiRoundtripBase { + function testEchoInt88Deterministic0() public { + int88 value = int88(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt88.selector, value); + assertEquivalent(callData); + } + + function testEchoInt88Deterministic1() public { + int88 value = int88(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt88.selector, value); + assertEquivalent(callData); + } + + function testEchoInt88Deterministic2() public { + int88 value = type(int88).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt88.selector, value); + assertEquivalent(callData); + } + + function testEchoInt88Deterministic3() public { + int88 value = type(int88).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt88.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt8Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt8Array4Deterministic.t.sol new file mode 100644 index 0000000000..e53f58e45b --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt8Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt8Array4DeterministicTest is AbiRoundtripBase { + function testEchoInt8Array4Deterministic0() public { + int8[4] memory value = [int8(0), int8(-1), type(int8).min, type(int8).max]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt8Array4.selector, value); + assertEquivalent(callData); + } + + function testEchoInt8Array4Deterministic1() public { + int8[4] memory value = [int8(-1), type(int8).min, type(int8).max, int8(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt8Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt8Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt8Deterministic.t.sol new file mode 100644 index 0000000000..93906660ae --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt8Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt8DeterministicTest is AbiRoundtripBase { + function testEchoInt8Deterministic0() public { + int8 value = int8(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt8.selector, value); + assertEquivalent(callData); + } + + function testEchoInt8Deterministic1() public { + int8 value = int8(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt8.selector, value); + assertEquivalent(callData); + } + + function testEchoInt8Deterministic2() public { + int8 value = type(int8).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt8.selector, value); + assertEquivalent(callData); + } + + function testEchoInt8Deterministic3() public { + int8 value = type(int8).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt8.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt96Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt96Array4Deterministic.t.sol new file mode 100644 index 0000000000..fad5dea475 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt96Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt96Array4DeterministicTest is AbiRoundtripBase { + function testEchoInt96Array4Deterministic0() public { + int96[4] memory value = [int96(0), int96(-1), type(int96).min, type(int96).max]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt96Array4.selector, value); + assertEquivalent(callData); + } + + function testEchoInt96Array4Deterministic1() public { + int96[4] memory value = [int96(-1), type(int96).min, type(int96).max, int96(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt96Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiInt96Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt96Deterministic.t.sol new file mode 100644 index 0000000000..df3c0d2746 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiInt96Deterministic.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt96DeterministicTest is AbiRoundtripBase { + function testEchoInt96Deterministic0() public { + int96 value = int96(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt96.selector, value); + assertEquivalent(callData); + } + + function testEchoInt96Deterministic1() public { + int96 value = int96(-1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt96.selector, value); + assertEquivalent(callData); + } + + function testEchoInt96Deterministic2() public { + int96 value = type(int96).min; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt96.selector, value); + assertEquivalent(callData); + } + + function testEchoInt96Deterministic3() public { + int96 value = type(int96).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt96.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiPairBoolAddressArray4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiPairBoolAddressArray4Deterministic.t.sol new file mode 100644 index 0000000000..e8a45edbbc --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiPairBoolAddressArray4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip, BoolAddressPair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiPairBoolAddressArray4DeterministicTest is AbiRoundtripBase { + function testEchoBoolAddressPairArray4Deterministic0() public { + BoolAddressPair[4] memory value = [BoolAddressPair({flag: false, addr: address(0)}), BoolAddressPair({flag: true, addr: address(0x3000000000000000000000000000000000000003)}), BoolAddressPair({flag: false, addr: address(0)}), BoolAddressPair({flag: true, addr: address(0x3000000000000000000000000000000000000003)})]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBoolAddressPairArray4.selector, value); + assertEquivalent(callData); + } + + function testEchoBoolAddressPairArray4Deterministic1() public { + BoolAddressPair[4] memory value = [BoolAddressPair({flag: true, addr: address(0x3000000000000000000000000000000000000003)}), BoolAddressPair({flag: false, addr: address(0)}), BoolAddressPair({flag: true, addr: address(0x3000000000000000000000000000000000000003)}), BoolAddressPair({flag: false, addr: address(0)})]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBoolAddressPairArray4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiPairBoolAddressDeterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiPairBoolAddressDeterministic.t.sol new file mode 100644 index 0000000000..25f0a81edc --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiPairBoolAddressDeterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip, BoolAddressPair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiPairBoolAddressDeterministicTest is AbiRoundtripBase { + function testEchoBoolAddressPairDeterministic0() public { + BoolAddressPair memory value = BoolAddressPair({flag: false, addr: address(0)}); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBoolAddressPair.selector, value); + assertEquivalent(callData); + } + + function testEchoBoolAddressPairDeterministic1() public { + BoolAddressPair memory value = BoolAddressPair({flag: true, addr: address(0x3000000000000000000000000000000000000003)}); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBoolAddressPair.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiPairStringU64Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiPairStringU64Deterministic.t.sol new file mode 100644 index 0000000000..1292257ea7 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiPairStringU64Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip, StringU64Pair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiPairStringU64DeterministicTest is AbiRoundtripBase { + function testEchoPairDeterministic0() public { + StringU64Pair memory value = StringU64Pair({text: "pair payload", count: uint64(42)}); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoPair.selector, value); + assertEquivalent(callData); + } + + function testEchoPairDeterministic1() public { + StringU64Pair memory value = StringU64Pair({text: "0123456789abcdefghijklmnopqrstuv", count: type(uint64).max}); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoPair.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiPairUint24Int40Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiPairUint24Int40Array4Deterministic.t.sol new file mode 100644 index 0000000000..faf02e4c2a --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiPairUint24Int40Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip, Uint24Int40Pair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiPairUint24Int40Array4DeterministicTest is AbiRoundtripBase { + function testEchoUint24Int40PairArray4Deterministic0() public { + Uint24Int40Pair[4] memory value = [Uint24Int40Pair({left: uint24(0), right: int40(0)}), Uint24Int40Pair({left: type(uint24).max, right: type(int40).min}), Uint24Int40Pair({left: uint24(0), right: int40(0)}), Uint24Int40Pair({left: type(uint24).max, right: type(int40).min})]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint24Int40PairArray4.selector, value); + assertEquivalent(callData); + } + + function testEchoUint24Int40PairArray4Deterministic1() public { + Uint24Int40Pair[4] memory value = [Uint24Int40Pair({left: type(uint24).max, right: type(int40).min}), Uint24Int40Pair({left: uint24(0), right: int40(0)}), Uint24Int40Pair({left: type(uint24).max, right: type(int40).min}), Uint24Int40Pair({left: uint24(0), right: int40(0)})]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint24Int40PairArray4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiPairUint24Int40Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiPairUint24Int40Deterministic.t.sol new file mode 100644 index 0000000000..bbe99c33d3 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiPairUint24Int40Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip, Uint24Int40Pair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiPairUint24Int40DeterministicTest is AbiRoundtripBase { + function testEchoUint24Int40PairDeterministic0() public { + Uint24Int40Pair memory value = Uint24Int40Pair({left: uint24(0), right: int40(0)}); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint24Int40Pair.selector, value); + assertEquivalent(callData); + } + + function testEchoUint24Int40PairDeterministic1() public { + Uint24Int40Pair memory value = Uint24Int40Pair({left: type(uint24).max, right: type(int40).min}); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint24Int40Pair.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiStringArray2Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiStringArray2Deterministic.t.sol new file mode 100644 index 0000000000..7df536df33 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiStringArray2Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiStringArray2DeterministicTest is AbiRoundtripBase { + function testEchoStringArray2Deterministic0() public { + string[2] memory value = ["", "hello"]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoStringArray2.selector, value); + assertEquivalent(callData); + } + + function testEchoStringArray2Deterministic1() public { + string[2] memory value = ["0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", "roundtrip"]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoStringArray2.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiStringArrayDeterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiStringArrayDeterministic.t.sol new file mode 100644 index 0000000000..3b3d63bf02 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiStringArrayDeterministic.t.sol @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiStringArrayDeterministicTest is AbiRoundtripBase { + function testEchoStringArrayDeterministic0() public { + string[] memory value = new string[](0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoStringArray.selector, value); + assertEquivalent(callData); + } + + function testEchoStringArrayDeterministic1() public { + string[] memory value = new string[](2); + value[0] = ""; + value[1] = "hello dynamic with extra payload bytes"; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoStringArray.selector, value); + assertEquivalent(callData); + } + + function testEchoStringArrayDeterministic2() public { + string[] memory value = new string[](2); + value[0] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + value[1] = "tail"; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoStringArray.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiStringDeterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiStringDeterministic.t.sol new file mode 100644 index 0000000000..18fe267a53 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiStringDeterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiStringDeterministicTest is AbiRoundtripBase { + function testEchoStringDeterministic0() public { + string memory value = string(""); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoString.selector, value); + assertEquivalent(callData); + } + + function testEchoStringDeterministic1() public { + string memory value = string("hello roundtrip"); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoString.selector, value); + assertEquivalent(callData); + } + + function testEchoStringDeterministic2() public { + string memory value = string("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoString.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiStringU64PairArray2Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiStringU64PairArray2Deterministic.t.sol new file mode 100644 index 0000000000..9a57b435d9 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiStringU64PairArray2Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip, StringU64Pair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiStringU64PairArray2DeterministicTest is AbiRoundtripBase { + function testEchoStringU64PairArray2Deterministic0() public { + StringU64Pair[2] memory value = [StringU64Pair({text: "pair-one", count: uint64(1)}), StringU64Pair({text: "pair-two", count: uint64(2)})]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoStringU64PairArray2.selector, value); + assertEquivalent(callData); + } + + function testEchoStringU64PairArray2Deterministic1() public { + StringU64Pair[2] memory value = [StringU64Pair({text: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", count: type(uint64).max}), StringU64Pair({text: "tail", count: uint64(9)})]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoStringU64PairArray2.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiStringU64PairArrayDeterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiStringU64PairArrayDeterministic.t.sol new file mode 100644 index 0000000000..bf7ec73444 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiStringU64PairArrayDeterministic.t.sol @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip, StringU64Pair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiStringU64PairArrayDeterministicTest is AbiRoundtripBase { + function testEchoStringU64PairArrayDeterministic0() public { + StringU64Pair[] memory value = new StringU64Pair[](0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoStringU64PairArray.selector, value); + assertEquivalent(callData); + } + + function testEchoStringU64PairArrayDeterministic1() public { + StringU64Pair[] memory value = new StringU64Pair[](2); + value[0] = StringU64Pair({text: "pair-one", count: uint64(1)}); + value[1] = StringU64Pair({text: "pair-two", count: uint64(2)}); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoStringU64PairArray.selector, value); + assertEquivalent(callData); + } + + function testEchoStringU64PairArrayDeterministic2() public { + StringU64Pair[] memory value = new StringU64Pair[](2); + value[0] = StringU64Pair({text: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", count: type(uint64).max}); + value[1] = StringU64Pair({text: "tail", count: uint64(9)}); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoStringU64PairArray.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiTripleBoolAddressU256Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiTripleBoolAddressU256Array4Deterministic.t.sol new file mode 100644 index 0000000000..470e173c93 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiTripleBoolAddressU256Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip, BoolAddressU256Triple} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiTripleBoolAddressU256Array4DeterministicTest is AbiRoundtripBase { + function testEchoBoolAddressU256TripleArray4Deterministic0() public { + BoolAddressU256Triple[4] memory value = [BoolAddressU256Triple({flag: false, addr: address(0), count: uint256(0)}), BoolAddressU256Triple({flag: true, addr: address(0x5000000000000000000000000000000000000005), count: type(uint256).max}), BoolAddressU256Triple({flag: false, addr: address(0), count: uint256(0)}), BoolAddressU256Triple({flag: true, addr: address(0x5000000000000000000000000000000000000005), count: type(uint256).max})]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBoolAddressU256TripleArray4.selector, value); + assertEquivalent(callData); + } + + function testEchoBoolAddressU256TripleArray4Deterministic1() public { + BoolAddressU256Triple[4] memory value = [BoolAddressU256Triple({flag: true, addr: address(0x5000000000000000000000000000000000000005), count: type(uint256).max}), BoolAddressU256Triple({flag: false, addr: address(0), count: uint256(0)}), BoolAddressU256Triple({flag: true, addr: address(0x5000000000000000000000000000000000000005), count: type(uint256).max}), BoolAddressU256Triple({flag: false, addr: address(0), count: uint256(0)})]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBoolAddressU256TripleArray4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiTripleBoolAddressU256Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiTripleBoolAddressU256Deterministic.t.sol new file mode 100644 index 0000000000..2cacd560be --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiTripleBoolAddressU256Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip, BoolAddressU256Triple} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiTripleBoolAddressU256DeterministicTest is AbiRoundtripBase { + function testEchoBoolAddressU256TripleDeterministic0() public { + BoolAddressU256Triple memory value = BoolAddressU256Triple({flag: false, addr: address(0), count: uint256(0)}); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBoolAddressU256Triple.selector, value); + assertEquivalent(callData); + } + + function testEchoBoolAddressU256TripleDeterministic1() public { + BoolAddressU256Triple memory value = BoolAddressU256Triple({flag: true, addr: address(0x5000000000000000000000000000000000000005), count: type(uint256).max}); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBoolAddressU256Triple.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiTripleStringBoolU64Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiTripleStringBoolU64Deterministic.t.sol new file mode 100644 index 0000000000..58a847c4fe --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiTripleStringBoolU64Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip, StringBoolU64Triple} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiTripleStringBoolU64DeterministicTest is AbiRoundtripBase { + function testEchoStringBoolU64TripleDeterministic0() public { + StringBoolU64Triple memory value = StringBoolU64Triple({text: "hello", flag: false, count: uint64(1)}); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoStringBoolU64Triple.selector, value); + assertEquivalent(callData); + } + + function testEchoStringBoolU64TripleDeterministic1() public { + StringBoolU64Triple memory value = StringBoolU64Triple({text: "0123456789abcdefghijklmnopqrstuv", flag: true, count: type(uint64).max}); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoStringBoolU64Triple.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint104Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint104Deterministic.t.sol new file mode 100644 index 0000000000..0bc0ebd09d --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint104Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint104DeterministicTest is AbiRoundtripBase { + function testEchoUint104Deterministic0() public { + uint104 value = uint104(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint104.selector, value); + assertEquivalent(callData); + } + + function testEchoUint104Deterministic1() public { + uint104 value = uint104(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint104.selector, value); + assertEquivalent(callData); + } + + function testEchoUint104Deterministic2() public { + uint104 value = type(uint104).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint104.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint112Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint112Deterministic.t.sol new file mode 100644 index 0000000000..f153eccf34 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint112Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint112DeterministicTest is AbiRoundtripBase { + function testEchoUint112Deterministic0() public { + uint112 value = uint112(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint112.selector, value); + assertEquivalent(callData); + } + + function testEchoUint112Deterministic1() public { + uint112 value = uint112(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint112.selector, value); + assertEquivalent(callData); + } + + function testEchoUint112Deterministic2() public { + uint112 value = type(uint112).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint112.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint120Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint120Deterministic.t.sol new file mode 100644 index 0000000000..f2fc6357d4 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint120Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint120DeterministicTest is AbiRoundtripBase { + function testEchoUint120Deterministic0() public { + uint120 value = uint120(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint120.selector, value); + assertEquivalent(callData); + } + + function testEchoUint120Deterministic1() public { + uint120 value = uint120(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint120.selector, value); + assertEquivalent(callData); + } + + function testEchoUint120Deterministic2() public { + uint120 value = type(uint120).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint120.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint128Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint128Array4Deterministic.t.sol new file mode 100644 index 0000000000..28ee205e1d --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint128Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint128Array4DeterministicTest is AbiRoundtripBase { + function testEchoUint128Array4Deterministic0() public { + uint128[4] memory value = [uint128(0), uint128(1), type(uint128).max, uint128(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint128Array4.selector, value); + assertEquivalent(callData); + } + + function testEchoUint128Array4Deterministic1() public { + uint128[4] memory value = [uint128(1), type(uint128).max, uint128(0), uint128(1)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint128Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint128Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint128Deterministic.t.sol new file mode 100644 index 0000000000..a81ccf7223 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint128Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint128DeterministicTest is AbiRoundtripBase { + function testEchoUint128Deterministic0() public { + uint128 value = uint128(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint128.selector, value); + assertEquivalent(callData); + } + + function testEchoUint128Deterministic1() public { + uint128 value = uint128(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint128.selector, value); + assertEquivalent(callData); + } + + function testEchoUint128Deterministic2() public { + uint128 value = type(uint128).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint128.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint136Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint136Deterministic.t.sol new file mode 100644 index 0000000000..261a8ee7f9 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint136Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint136DeterministicTest is AbiRoundtripBase { + function testEchoUint136Deterministic0() public { + uint136 value = uint136(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint136.selector, value); + assertEquivalent(callData); + } + + function testEchoUint136Deterministic1() public { + uint136 value = uint136(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint136.selector, value); + assertEquivalent(callData); + } + + function testEchoUint136Deterministic2() public { + uint136 value = type(uint136).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint136.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint144Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint144Deterministic.t.sol new file mode 100644 index 0000000000..eaf79e05c1 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint144Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint144DeterministicTest is AbiRoundtripBase { + function testEchoUint144Deterministic0() public { + uint144 value = uint144(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint144.selector, value); + assertEquivalent(callData); + } + + function testEchoUint144Deterministic1() public { + uint144 value = uint144(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint144.selector, value); + assertEquivalent(callData); + } + + function testEchoUint144Deterministic2() public { + uint144 value = type(uint144).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint144.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint152Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint152Deterministic.t.sol new file mode 100644 index 0000000000..f8c16aec0d --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint152Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint152DeterministicTest is AbiRoundtripBase { + function testEchoUint152Deterministic0() public { + uint152 value = uint152(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint152.selector, value); + assertEquivalent(callData); + } + + function testEchoUint152Deterministic1() public { + uint152 value = uint152(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint152.selector, value); + assertEquivalent(callData); + } + + function testEchoUint152Deterministic2() public { + uint152 value = type(uint152).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint152.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint160Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint160Array4Deterministic.t.sol new file mode 100644 index 0000000000..b67eb2fa6f --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint160Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint160Array4DeterministicTest is AbiRoundtripBase { + function testEchoUint160Array4Deterministic0() public { + uint160[4] memory value = [uint160(0), uint160(1), type(uint160).max, uint160(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint160Array4.selector, value); + assertEquivalent(callData); + } + + function testEchoUint160Array4Deterministic1() public { + uint160[4] memory value = [uint160(1), type(uint160).max, uint160(0), uint160(1)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint160Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint160Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint160Deterministic.t.sol new file mode 100644 index 0000000000..7606682afe --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint160Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint160DeterministicTest is AbiRoundtripBase { + function testEchoUint160Deterministic0() public { + uint160 value = uint160(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint160.selector, value); + assertEquivalent(callData); + } + + function testEchoUint160Deterministic1() public { + uint160 value = uint160(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint160.selector, value); + assertEquivalent(callData); + } + + function testEchoUint160Deterministic2() public { + uint160 value = type(uint160).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint160.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint168Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint168Deterministic.t.sol new file mode 100644 index 0000000000..489343eeea --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint168Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint168DeterministicTest is AbiRoundtripBase { + function testEchoUint168Deterministic0() public { + uint168 value = uint168(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint168.selector, value); + assertEquivalent(callData); + } + + function testEchoUint168Deterministic1() public { + uint168 value = uint168(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint168.selector, value); + assertEquivalent(callData); + } + + function testEchoUint168Deterministic2() public { + uint168 value = type(uint168).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint168.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint16Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint16Array4Deterministic.t.sol new file mode 100644 index 0000000000..eeac6c848c --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint16Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint16Array4DeterministicTest is AbiRoundtripBase { + function testEchoUint16Array4Deterministic0() public { + uint16[4] memory value = [uint16(0), uint16(1), type(uint16).max, uint16(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint16Array4.selector, value); + assertEquivalent(callData); + } + + function testEchoUint16Array4Deterministic1() public { + uint16[4] memory value = [uint16(1), type(uint16).max, uint16(0), uint16(1)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint16Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint16Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint16Deterministic.t.sol new file mode 100644 index 0000000000..bed0ef2254 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint16Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint16DeterministicTest is AbiRoundtripBase { + function testEchoUint16Deterministic0() public { + uint16 value = uint16(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint16.selector, value); + assertEquivalent(callData); + } + + function testEchoUint16Deterministic1() public { + uint16 value = uint16(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint16.selector, value); + assertEquivalent(callData); + } + + function testEchoUint16Deterministic2() public { + uint16 value = type(uint16).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint16.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint176Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint176Deterministic.t.sol new file mode 100644 index 0000000000..967228f8ce --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint176Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint176DeterministicTest is AbiRoundtripBase { + function testEchoUint176Deterministic0() public { + uint176 value = uint176(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint176.selector, value); + assertEquivalent(callData); + } + + function testEchoUint176Deterministic1() public { + uint176 value = uint176(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint176.selector, value); + assertEquivalent(callData); + } + + function testEchoUint176Deterministic2() public { + uint176 value = type(uint176).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint176.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint184Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint184Deterministic.t.sol new file mode 100644 index 0000000000..bd5ebf847c --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint184Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint184DeterministicTest is AbiRoundtripBase { + function testEchoUint184Deterministic0() public { + uint184 value = uint184(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint184.selector, value); + assertEquivalent(callData); + } + + function testEchoUint184Deterministic1() public { + uint184 value = uint184(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint184.selector, value); + assertEquivalent(callData); + } + + function testEchoUint184Deterministic2() public { + uint184 value = type(uint184).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint184.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint192Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint192Deterministic.t.sol new file mode 100644 index 0000000000..a6bbd97d05 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint192Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint192DeterministicTest is AbiRoundtripBase { + function testEchoUint192Deterministic0() public { + uint192 value = uint192(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint192.selector, value); + assertEquivalent(callData); + } + + function testEchoUint192Deterministic1() public { + uint192 value = uint192(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint192.selector, value); + assertEquivalent(callData); + } + + function testEchoUint192Deterministic2() public { + uint192 value = type(uint192).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint192.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint200Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint200Deterministic.t.sol new file mode 100644 index 0000000000..c61dc948b6 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint200Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint200DeterministicTest is AbiRoundtripBase { + function testEchoUint200Deterministic0() public { + uint200 value = uint200(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint200.selector, value); + assertEquivalent(callData); + } + + function testEchoUint200Deterministic1() public { + uint200 value = uint200(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint200.selector, value); + assertEquivalent(callData); + } + + function testEchoUint200Deterministic2() public { + uint200 value = type(uint200).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint200.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint208Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint208Deterministic.t.sol new file mode 100644 index 0000000000..5e3eb226ca --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint208Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint208DeterministicTest is AbiRoundtripBase { + function testEchoUint208Deterministic0() public { + uint208 value = uint208(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint208.selector, value); + assertEquivalent(callData); + } + + function testEchoUint208Deterministic1() public { + uint208 value = uint208(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint208.selector, value); + assertEquivalent(callData); + } + + function testEchoUint208Deterministic2() public { + uint208 value = type(uint208).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint208.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint216Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint216Deterministic.t.sol new file mode 100644 index 0000000000..5a95ef1411 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint216Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint216DeterministicTest is AbiRoundtripBase { + function testEchoUint216Deterministic0() public { + uint216 value = uint216(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint216.selector, value); + assertEquivalent(callData); + } + + function testEchoUint216Deterministic1() public { + uint216 value = uint216(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint216.selector, value); + assertEquivalent(callData); + } + + function testEchoUint216Deterministic2() public { + uint216 value = type(uint216).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint216.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint224Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint224Deterministic.t.sol new file mode 100644 index 0000000000..5854aafc76 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint224Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint224DeterministicTest is AbiRoundtripBase { + function testEchoUint224Deterministic0() public { + uint224 value = uint224(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint224.selector, value); + assertEquivalent(callData); + } + + function testEchoUint224Deterministic1() public { + uint224 value = uint224(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint224.selector, value); + assertEquivalent(callData); + } + + function testEchoUint224Deterministic2() public { + uint224 value = type(uint224).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint224.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint232Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint232Deterministic.t.sol new file mode 100644 index 0000000000..ae82229adb --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint232Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint232DeterministicTest is AbiRoundtripBase { + function testEchoUint232Deterministic0() public { + uint232 value = uint232(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint232.selector, value); + assertEquivalent(callData); + } + + function testEchoUint232Deterministic1() public { + uint232 value = uint232(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint232.selector, value); + assertEquivalent(callData); + } + + function testEchoUint232Deterministic2() public { + uint232 value = type(uint232).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint232.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint240Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint240Deterministic.t.sol new file mode 100644 index 0000000000..913f9a4cf5 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint240Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint240DeterministicTest is AbiRoundtripBase { + function testEchoUint240Deterministic0() public { + uint240 value = uint240(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint240.selector, value); + assertEquivalent(callData); + } + + function testEchoUint240Deterministic1() public { + uint240 value = uint240(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint240.selector, value); + assertEquivalent(callData); + } + + function testEchoUint240Deterministic2() public { + uint240 value = type(uint240).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint240.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint248Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint248Array4Deterministic.t.sol new file mode 100644 index 0000000000..18077ad672 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint248Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint248Array4DeterministicTest is AbiRoundtripBase { + function testEchoUint248Array4Deterministic0() public { + uint248[4] memory value = [uint248(0), uint248(1), type(uint248).max, uint248(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint248Array4.selector, value); + assertEquivalent(callData); + } + + function testEchoUint248Array4Deterministic1() public { + uint248[4] memory value = [uint248(1), type(uint248).max, uint248(0), uint248(1)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint248Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint248Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint248Deterministic.t.sol new file mode 100644 index 0000000000..40478c0ffa --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint248Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint248DeterministicTest is AbiRoundtripBase { + function testEchoUint248Deterministic0() public { + uint248 value = uint248(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint248.selector, value); + assertEquivalent(callData); + } + + function testEchoUint248Deterministic1() public { + uint248 value = uint248(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint248.selector, value); + assertEquivalent(callData); + } + + function testEchoUint248Deterministic2() public { + uint248 value = type(uint248).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint248.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint24Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint24Array4Deterministic.t.sol new file mode 100644 index 0000000000..2c275076ae --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint24Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint24Array4DeterministicTest is AbiRoundtripBase { + function testEchoUint24Array4Deterministic0() public { + uint24[4] memory value = [uint24(0), uint24(1), type(uint24).max, uint24(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint24Array4.selector, value); + assertEquivalent(callData); + } + + function testEchoUint24Array4Deterministic1() public { + uint24[4] memory value = [uint24(1), type(uint24).max, uint24(0), uint24(1)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint24Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint24Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint24Deterministic.t.sol new file mode 100644 index 0000000000..4f5bb8c5dd --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint24Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint24DeterministicTest is AbiRoundtripBase { + function testEchoUint24Deterministic0() public { + uint24 value = uint24(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint24.selector, value); + assertEquivalent(callData); + } + + function testEchoUint24Deterministic1() public { + uint24 value = uint24(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint24.selector, value); + assertEquivalent(callData); + } + + function testEchoUint24Deterministic2() public { + uint24 value = type(uint24).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint24.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint24Matrix2x2Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint24Matrix2x2Deterministic.t.sol new file mode 100644 index 0000000000..d905888bfa --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint24Matrix2x2Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint24Matrix2x2DeterministicTest is AbiRoundtripBase { + function testEchoUint24Matrix2x2Deterministic0() public { + uint24[2][2] memory value = [[uint24(0), uint24(1)], [type(uint24).max, uint24(0)]]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint24Matrix2x2.selector, value); + assertEquivalent(callData); + } + + function testEchoUint24Matrix2x2Deterministic1() public { + uint24[2][2] memory value = [[uint24(1), type(uint24).max], [uint24(0), uint24(1)]]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint24Matrix2x2.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint256Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint256Array4Deterministic.t.sol new file mode 100644 index 0000000000..207fbe1ab8 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint256Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint256Array4DeterministicTest is AbiRoundtripBase { + function testEchoUintArray4Deterministic0() public { + uint256[4] memory value = [uint256(0), uint256(1), type(uint256).max, uint256(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUintArray4.selector, value); + assertEquivalent(callData); + } + + function testEchoUintArray4Deterministic1() public { + uint256[4] memory value = [uint256(1), type(uint256).max, uint256(0), uint256(1)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUintArray4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint256Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint256Deterministic.t.sol new file mode 100644 index 0000000000..542d9ea832 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint256Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint256DeterministicTest is AbiRoundtripBase { + function testEchoUintDeterministic0() public { + uint256 value = uint256(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint.selector, value); + assertEquivalent(callData); + } + + function testEchoUintDeterministic1() public { + uint256 value = uint256(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint.selector, value); + assertEquivalent(callData); + } + + function testEchoUintDeterministic2() public { + uint256 value = type(uint256).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint256Matrix2x2Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint256Matrix2x2Deterministic.t.sol new file mode 100644 index 0000000000..fac0fa7b5e --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint256Matrix2x2Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint256Matrix2x2DeterministicTest is AbiRoundtripBase { + function testEchoUintMatrix2x2Deterministic0() public { + uint256[2][2] memory value = [[uint256(0), uint256(1)], [type(uint256).max, uint256(0)]]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUintMatrix2x2.selector, value); + assertEquivalent(callData); + } + + function testEchoUintMatrix2x2Deterministic1() public { + uint256[2][2] memory value = [[uint256(1), type(uint256).max], [uint256(0), uint256(1)]]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUintMatrix2x2.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint32Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint32Array4Deterministic.t.sol new file mode 100644 index 0000000000..241ea821a1 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint32Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint32Array4DeterministicTest is AbiRoundtripBase { + function testEchoUint32Array4Deterministic0() public { + uint32[4] memory value = [uint32(0), uint32(1), type(uint32).max, uint32(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint32Array4.selector, value); + assertEquivalent(callData); + } + + function testEchoUint32Array4Deterministic1() public { + uint32[4] memory value = [uint32(1), type(uint32).max, uint32(0), uint32(1)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint32Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint32Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint32Deterministic.t.sol new file mode 100644 index 0000000000..493046afc6 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint32Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint32DeterministicTest is AbiRoundtripBase { + function testEchoUint32Deterministic0() public { + uint32 value = uint32(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint32.selector, value); + assertEquivalent(callData); + } + + function testEchoUint32Deterministic1() public { + uint32 value = uint32(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint32.selector, value); + assertEquivalent(callData); + } + + function testEchoUint32Deterministic2() public { + uint32 value = type(uint32).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint32.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint40Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint40Array4Deterministic.t.sol new file mode 100644 index 0000000000..a3a0cdf53d --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint40Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint40Array4DeterministicTest is AbiRoundtripBase { + function testEchoUint40Array4Deterministic0() public { + uint40[4] memory value = [uint40(0), uint40(1), type(uint40).max, uint40(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint40Array4.selector, value); + assertEquivalent(callData); + } + + function testEchoUint40Array4Deterministic1() public { + uint40[4] memory value = [uint40(1), type(uint40).max, uint40(0), uint40(1)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint40Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint40Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint40Deterministic.t.sol new file mode 100644 index 0000000000..23562d6828 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint40Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint40DeterministicTest is AbiRoundtripBase { + function testEchoUint40Deterministic0() public { + uint40 value = uint40(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint40.selector, value); + assertEquivalent(callData); + } + + function testEchoUint40Deterministic1() public { + uint40 value = uint40(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint40.selector, value); + assertEquivalent(callData); + } + + function testEchoUint40Deterministic2() public { + uint40 value = type(uint40).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint40.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint48Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint48Deterministic.t.sol new file mode 100644 index 0000000000..dd2f353e8a --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint48Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint48DeterministicTest is AbiRoundtripBase { + function testEchoUint48Deterministic0() public { + uint48 value = uint48(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint48.selector, value); + assertEquivalent(callData); + } + + function testEchoUint48Deterministic1() public { + uint48 value = uint48(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint48.selector, value); + assertEquivalent(callData); + } + + function testEchoUint48Deterministic2() public { + uint48 value = type(uint48).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint48.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint56Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint56Deterministic.t.sol new file mode 100644 index 0000000000..aafd7e28a4 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint56Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint56DeterministicTest is AbiRoundtripBase { + function testEchoUint56Deterministic0() public { + uint56 value = uint56(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint56.selector, value); + assertEquivalent(callData); + } + + function testEchoUint56Deterministic1() public { + uint56 value = uint56(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint56.selector, value); + assertEquivalent(callData); + } + + function testEchoUint56Deterministic2() public { + uint56 value = type(uint56).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint56.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint64Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint64Array4Deterministic.t.sol new file mode 100644 index 0000000000..45614ed1f8 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint64Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint64Array4DeterministicTest is AbiRoundtripBase { + function testEchoUint64Array4Deterministic0() public { + uint64[4] memory value = [uint64(0), uint64(1), type(uint64).max, uint64(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint64Array4.selector, value); + assertEquivalent(callData); + } + + function testEchoUint64Array4Deterministic1() public { + uint64[4] memory value = [uint64(1), type(uint64).max, uint64(0), uint64(1)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint64Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint64Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint64Deterministic.t.sol new file mode 100644 index 0000000000..8598c4488f --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint64Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint64DeterministicTest is AbiRoundtripBase { + function testEchoUint64Deterministic0() public { + uint64 value = uint64(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint64.selector, value); + assertEquivalent(callData); + } + + function testEchoUint64Deterministic1() public { + uint64 value = uint64(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint64.selector, value); + assertEquivalent(callData); + } + + function testEchoUint64Deterministic2() public { + uint64 value = type(uint64).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint64.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint72Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint72Deterministic.t.sol new file mode 100644 index 0000000000..48da2248e2 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint72Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint72DeterministicTest is AbiRoundtripBase { + function testEchoUint72Deterministic0() public { + uint72 value = uint72(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint72.selector, value); + assertEquivalent(callData); + } + + function testEchoUint72Deterministic1() public { + uint72 value = uint72(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint72.selector, value); + assertEquivalent(callData); + } + + function testEchoUint72Deterministic2() public { + uint72 value = type(uint72).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint72.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint80Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint80Deterministic.t.sol new file mode 100644 index 0000000000..2f1b5a7877 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint80Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint80DeterministicTest is AbiRoundtripBase { + function testEchoUint80Deterministic0() public { + uint80 value = uint80(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint80.selector, value); + assertEquivalent(callData); + } + + function testEchoUint80Deterministic1() public { + uint80 value = uint80(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint80.selector, value); + assertEquivalent(callData); + } + + function testEchoUint80Deterministic2() public { + uint80 value = type(uint80).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint80.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint88Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint88Deterministic.t.sol new file mode 100644 index 0000000000..61488ab4b5 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint88Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint88DeterministicTest is AbiRoundtripBase { + function testEchoUint88Deterministic0() public { + uint88 value = uint88(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint88.selector, value); + assertEquivalent(callData); + } + + function testEchoUint88Deterministic1() public { + uint88 value = uint88(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint88.selector, value); + assertEquivalent(callData); + } + + function testEchoUint88Deterministic2() public { + uint88 value = type(uint88).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint88.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint8Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint8Array4Deterministic.t.sol new file mode 100644 index 0000000000..9592bcce10 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint8Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint8Array4DeterministicTest is AbiRoundtripBase { + function testEchoUint8Array4Deterministic0() public { + uint8[4] memory value = [uint8(0), uint8(1), type(uint8).max, uint8(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint8Array4.selector, value); + assertEquivalent(callData); + } + + function testEchoUint8Array4Deterministic1() public { + uint8[4] memory value = [uint8(1), type(uint8).max, uint8(0), uint8(1)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint8Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint8Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint8Deterministic.t.sol new file mode 100644 index 0000000000..ec7f80e2b1 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint8Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint8DeterministicTest is AbiRoundtripBase { + function testEchoUint8Deterministic0() public { + uint8 value = uint8(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint8.selector, value); + assertEquivalent(callData); + } + + function testEchoUint8Deterministic1() public { + uint8 value = uint8(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint8.selector, value); + assertEquivalent(callData); + } + + function testEchoUint8Deterministic2() public { + uint8 value = type(uint8).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint8.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint96Array4Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint96Array4Deterministic.t.sol new file mode 100644 index 0000000000..ea567e1adf --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint96Array4Deterministic.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint96Array4DeterministicTest is AbiRoundtripBase { + function testEchoUint96Array4Deterministic0() public { + uint96[4] memory value = [uint96(0), uint96(1), type(uint96).max, uint96(0)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint96Array4.selector, value); + assertEquivalent(callData); + } + + function testEchoUint96Array4Deterministic1() public { + uint96[4] memory value = [uint96(1), type(uint96).max, uint96(0), uint96(1)]; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint96Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUint96Deterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint96Deterministic.t.sol new file mode 100644 index 0000000000..6bfbebb148 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUint96Deterministic.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint96DeterministicTest is AbiRoundtripBase { + function testEchoUint96Deterministic0() public { + uint96 value = uint96(0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint96.selector, value); + assertEquivalent(callData); + } + + function testEchoUint96Deterministic1() public { + uint96 value = uint96(1); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint96.selector, value); + assertEquivalent(callData); + } + + function testEchoUint96Deterministic2() public { + uint96 value = type(uint96).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint96.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/deterministic/AbiUintArrayDeterministic.t.sol b/benchmarks/foundry-abi/test/generated/deterministic/AbiUintArrayDeterministic.t.sol new file mode 100644 index 0000000000..7de5b7cad8 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/deterministic/AbiUintArrayDeterministic.t.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUintArrayDeterministicTest is AbiRoundtripBase { + function testEchoUintArrayDeterministic0() public { + uint256[] memory value = new uint256[](0); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUintArray.selector, value); + assertEquivalent(callData); + } + + function testEchoUintArrayDeterministic1() public { + uint256[] memory value = new uint256[](3); + value[0] = uint256(0); + value[1] = uint256(1); + value[2] = type(uint256).max; + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUintArray.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiAddressArray4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiAddressArray4Fuzz.t.sol new file mode 100644 index 0000000000..83e1eafeca --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiAddressArray4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiAddressArray4FuzzTest is AbiRoundtripBase { + function testEchoAddressArray4Fuzz(address[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoAddressArray4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiAddressFuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiAddressFuzz.t.sol new file mode 100644 index 0000000000..0bc5a5347e --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiAddressFuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiAddressFuzzTest is AbiRoundtripBase { + function testEchoAddressFuzz(address value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoAddress.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiAddressMatrix2x2Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiAddressMatrix2x2Fuzz.t.sol new file mode 100644 index 0000000000..eb6782076c --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiAddressMatrix2x2Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiAddressMatrix2x2FuzzTest is AbiRoundtripBase { + function testEchoAddressMatrix2x2Fuzz(address[2][2] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoAddressMatrix2x2.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiBoolAddressPairArrayFuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiBoolAddressPairArrayFuzz.t.sol new file mode 100644 index 0000000000..3e5f62ff69 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiBoolAddressPairArrayFuzz.t.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip, BoolAddressPair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiBoolAddressPairArrayFuzzTest is AbiRoundtripBase { + function testEchoBoolAddressPairArrayFuzz(BoolAddressPair[] memory value) public { + vm.assume(value.length <= 4); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBoolAddressPairArray.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiBoolArray4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiBoolArray4Fuzz.t.sol new file mode 100644 index 0000000000..94b816850f --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiBoolArray4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiBoolArray4FuzzTest is AbiRoundtripBase { + function testEchoBoolArray4Fuzz(bool[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBoolArray4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiBoolFuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiBoolFuzz.t.sol new file mode 100644 index 0000000000..823cb3243d --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiBoolFuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiBoolFuzzTest is AbiRoundtripBase { + function testEchoBoolFuzz(bool value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBool.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiBoolMatrix2x2Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiBoolMatrix2x2Fuzz.t.sol new file mode 100644 index 0000000000..6903fb727c --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiBoolMatrix2x2Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiBoolMatrix2x2FuzzTest is AbiRoundtripBase { + function testEchoBoolMatrix2x2Fuzz(bool[2][2] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBoolMatrix2x2.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt104Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt104Fuzz.t.sol new file mode 100644 index 0000000000..4905cc4c6e --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt104Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt104FuzzTest is AbiRoundtripBase { + function testEchoInt104Fuzz(int104 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt104.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt112Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt112Fuzz.t.sol new file mode 100644 index 0000000000..019915f602 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt112Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt112FuzzTest is AbiRoundtripBase { + function testEchoInt112Fuzz(int112 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt112.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt120Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt120Fuzz.t.sol new file mode 100644 index 0000000000..d5208cbf0f --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt120Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt120FuzzTest is AbiRoundtripBase { + function testEchoInt120Fuzz(int120 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt120.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt128Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt128Array4Fuzz.t.sol new file mode 100644 index 0000000000..a519c03719 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt128Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt128Array4FuzzTest is AbiRoundtripBase { + function testEchoInt128Array4Fuzz(int128[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt128Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt128Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt128Fuzz.t.sol new file mode 100644 index 0000000000..972abf7b1b --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt128Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt128FuzzTest is AbiRoundtripBase { + function testEchoInt128Fuzz(int128 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt128.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt136Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt136Fuzz.t.sol new file mode 100644 index 0000000000..f1180e9d92 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt136Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt136FuzzTest is AbiRoundtripBase { + function testEchoInt136Fuzz(int136 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt136.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt144Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt144Fuzz.t.sol new file mode 100644 index 0000000000..f37d284d08 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt144Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt144FuzzTest is AbiRoundtripBase { + function testEchoInt144Fuzz(int144 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt144.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt152Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt152Fuzz.t.sol new file mode 100644 index 0000000000..6d96831530 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt152Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt152FuzzTest is AbiRoundtripBase { + function testEchoInt152Fuzz(int152 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt152.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt160Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt160Array4Fuzz.t.sol new file mode 100644 index 0000000000..f18d979fd2 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt160Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt160Array4FuzzTest is AbiRoundtripBase { + function testEchoInt160Array4Fuzz(int160[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt160Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt160Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt160Fuzz.t.sol new file mode 100644 index 0000000000..ac752ec410 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt160Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt160FuzzTest is AbiRoundtripBase { + function testEchoInt160Fuzz(int160 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt160.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt168Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt168Fuzz.t.sol new file mode 100644 index 0000000000..a4b1450d62 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt168Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt168FuzzTest is AbiRoundtripBase { + function testEchoInt168Fuzz(int168 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt168.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt16Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt16Array4Fuzz.t.sol new file mode 100644 index 0000000000..56eb9bf40e --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt16Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt16Array4FuzzTest is AbiRoundtripBase { + function testEchoInt16Array4Fuzz(int16[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt16Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt16Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt16Fuzz.t.sol new file mode 100644 index 0000000000..c2cceaa3ba --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt16Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt16FuzzTest is AbiRoundtripBase { + function testEchoInt16Fuzz(int16 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt16.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt176Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt176Fuzz.t.sol new file mode 100644 index 0000000000..9071370b4f --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt176Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt176FuzzTest is AbiRoundtripBase { + function testEchoInt176Fuzz(int176 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt176.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt184Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt184Fuzz.t.sol new file mode 100644 index 0000000000..2c45e4ad9b --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt184Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt184FuzzTest is AbiRoundtripBase { + function testEchoInt184Fuzz(int184 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt184.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt192Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt192Fuzz.t.sol new file mode 100644 index 0000000000..33869955c0 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt192Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt192FuzzTest is AbiRoundtripBase { + function testEchoInt192Fuzz(int192 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt192.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt200Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt200Fuzz.t.sol new file mode 100644 index 0000000000..532176630f --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt200Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt200FuzzTest is AbiRoundtripBase { + function testEchoInt200Fuzz(int200 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt200.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt208Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt208Fuzz.t.sol new file mode 100644 index 0000000000..e72f143fe6 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt208Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt208FuzzTest is AbiRoundtripBase { + function testEchoInt208Fuzz(int208 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt208.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt216Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt216Fuzz.t.sol new file mode 100644 index 0000000000..d6da841cd7 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt216Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt216FuzzTest is AbiRoundtripBase { + function testEchoInt216Fuzz(int216 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt216.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt224Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt224Fuzz.t.sol new file mode 100644 index 0000000000..c9a0bf2c71 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt224Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt224FuzzTest is AbiRoundtripBase { + function testEchoInt224Fuzz(int224 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt224.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt232Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt232Fuzz.t.sol new file mode 100644 index 0000000000..a7136a4eac --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt232Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt232FuzzTest is AbiRoundtripBase { + function testEchoInt232Fuzz(int232 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt232.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt240Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt240Fuzz.t.sol new file mode 100644 index 0000000000..d5aca45555 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt240Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt240FuzzTest is AbiRoundtripBase { + function testEchoInt240Fuzz(int240 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt240.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt248Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt248Array4Fuzz.t.sol new file mode 100644 index 0000000000..f9260a648a --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt248Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt248Array4FuzzTest is AbiRoundtripBase { + function testEchoInt248Array4Fuzz(int248[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt248Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt248Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt248Fuzz.t.sol new file mode 100644 index 0000000000..a583a01298 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt248Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt248FuzzTest is AbiRoundtripBase { + function testEchoInt248Fuzz(int248 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt248.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt24Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt24Array4Fuzz.t.sol new file mode 100644 index 0000000000..aea15d5d3c --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt24Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt24Array4FuzzTest is AbiRoundtripBase { + function testEchoInt24Array4Fuzz(int24[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt24Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt24Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt24Fuzz.t.sol new file mode 100644 index 0000000000..63a416b08c --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt24Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt24FuzzTest is AbiRoundtripBase { + function testEchoInt24Fuzz(int24 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt24.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt256Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt256Array4Fuzz.t.sol new file mode 100644 index 0000000000..422efc8d50 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt256Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt256Array4FuzzTest is AbiRoundtripBase { + function testEchoInt256Array4Fuzz(int256[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt256Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt256Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt256Fuzz.t.sol new file mode 100644 index 0000000000..83f61c15fe --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt256Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt256FuzzTest is AbiRoundtripBase { + function testEchoInt256Fuzz(int256 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt256.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt256Matrix2x2Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt256Matrix2x2Fuzz.t.sol new file mode 100644 index 0000000000..4ad842af70 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt256Matrix2x2Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt256Matrix2x2FuzzTest is AbiRoundtripBase { + function testEchoInt256Matrix2x2Fuzz(int256[2][2] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt256Matrix2x2.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt32Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt32Array4Fuzz.t.sol new file mode 100644 index 0000000000..504c5a7c6d --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt32Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt32Array4FuzzTest is AbiRoundtripBase { + function testEchoInt32Array4Fuzz(int32[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt32Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt32Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt32Fuzz.t.sol new file mode 100644 index 0000000000..cb333e9d64 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt32Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt32FuzzTest is AbiRoundtripBase { + function testEchoInt32Fuzz(int32 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt32.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt40Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt40Array4Fuzz.t.sol new file mode 100644 index 0000000000..dcb1805f1b --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt40Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt40Array4FuzzTest is AbiRoundtripBase { + function testEchoInt40Array4Fuzz(int40[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt40Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt40Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt40Fuzz.t.sol new file mode 100644 index 0000000000..2956b2857a --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt40Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt40FuzzTest is AbiRoundtripBase { + function testEchoInt40Fuzz(int40 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt40.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt40Matrix2x2Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt40Matrix2x2Fuzz.t.sol new file mode 100644 index 0000000000..4afc944583 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt40Matrix2x2Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt40Matrix2x2FuzzTest is AbiRoundtripBase { + function testEchoInt40Matrix2x2Fuzz(int40[2][2] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt40Matrix2x2.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt48Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt48Fuzz.t.sol new file mode 100644 index 0000000000..fcef8ebf40 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt48Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt48FuzzTest is AbiRoundtripBase { + function testEchoInt48Fuzz(int48 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt48.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt56Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt56Fuzz.t.sol new file mode 100644 index 0000000000..5aee270199 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt56Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt56FuzzTest is AbiRoundtripBase { + function testEchoInt56Fuzz(int56 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt56.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt64Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt64Array4Fuzz.t.sol new file mode 100644 index 0000000000..3b3a772c63 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt64Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt64Array4FuzzTest is AbiRoundtripBase { + function testEchoInt64Array4Fuzz(int64[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt64Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt64Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt64Fuzz.t.sol new file mode 100644 index 0000000000..9b9de8869a --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt64Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt64FuzzTest is AbiRoundtripBase { + function testEchoInt64Fuzz(int64 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt64.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt72Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt72Fuzz.t.sol new file mode 100644 index 0000000000..9c611a08a1 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt72Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt72FuzzTest is AbiRoundtripBase { + function testEchoInt72Fuzz(int72 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt72.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt80Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt80Fuzz.t.sol new file mode 100644 index 0000000000..22c9130962 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt80Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt80FuzzTest is AbiRoundtripBase { + function testEchoInt80Fuzz(int80 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt80.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt88Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt88Fuzz.t.sol new file mode 100644 index 0000000000..3eff28053e --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt88Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt88FuzzTest is AbiRoundtripBase { + function testEchoInt88Fuzz(int88 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt88.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt8Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt8Array4Fuzz.t.sol new file mode 100644 index 0000000000..5a9fa93b71 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt8Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt8Array4FuzzTest is AbiRoundtripBase { + function testEchoInt8Array4Fuzz(int8[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt8Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt8Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt8Fuzz.t.sol new file mode 100644 index 0000000000..1cd22a9765 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt8Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt8FuzzTest is AbiRoundtripBase { + function testEchoInt8Fuzz(int8 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt8.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt96Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt96Array4Fuzz.t.sol new file mode 100644 index 0000000000..6e1dd7ffd4 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt96Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt96Array4FuzzTest is AbiRoundtripBase { + function testEchoInt96Array4Fuzz(int96[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt96Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiInt96Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt96Fuzz.t.sol new file mode 100644 index 0000000000..a6fe547cc0 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiInt96Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiInt96FuzzTest is AbiRoundtripBase { + function testEchoInt96Fuzz(int96 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoInt96.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiPairBoolAddressArray4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiPairBoolAddressArray4Fuzz.t.sol new file mode 100644 index 0000000000..88e6a01036 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiPairBoolAddressArray4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip, BoolAddressPair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiPairBoolAddressArray4FuzzTest is AbiRoundtripBase { + function testEchoBoolAddressPairArray4Fuzz(BoolAddressPair[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBoolAddressPairArray4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiPairBoolAddressFuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiPairBoolAddressFuzz.t.sol new file mode 100644 index 0000000000..5dd7e719af --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiPairBoolAddressFuzz.t.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip, BoolAddressPair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiPairBoolAddressFuzzTest is AbiRoundtripBase { + function testEchoBoolAddressPairFuzz(bool flag, address addr) public { + BoolAddressPair memory value = BoolAddressPair({flag: flag, addr: addr}); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBoolAddressPair.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiPairStringU64Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiPairStringU64Fuzz.t.sol new file mode 100644 index 0000000000..5345719030 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiPairStringU64Fuzz.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip, StringU64Pair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiPairStringU64FuzzTest is AbiRoundtripBase { + function testEchoPairFuzz(string memory text, uint64 count) public { + assumeShortString(text); + StringU64Pair memory value = StringU64Pair({text: text, count: count}); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoPair.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiPairUint24Int40Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiPairUint24Int40Array4Fuzz.t.sol new file mode 100644 index 0000000000..2acc74dab2 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiPairUint24Int40Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip, Uint24Int40Pair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiPairUint24Int40Array4FuzzTest is AbiRoundtripBase { + function testEchoUint24Int40PairArray4Fuzz(Uint24Int40Pair[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint24Int40PairArray4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiPairUint24Int40Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiPairUint24Int40Fuzz.t.sol new file mode 100644 index 0000000000..52c0d9d9d3 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiPairUint24Int40Fuzz.t.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip, Uint24Int40Pair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiPairUint24Int40FuzzTest is AbiRoundtripBase { + function testEchoUint24Int40PairFuzz(uint24 left, int40 right) public { + Uint24Int40Pair memory value = Uint24Int40Pair({left: left, right: right}); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint24Int40Pair.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiStringArray2Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiStringArray2Fuzz.t.sol new file mode 100644 index 0000000000..6df027cf5b --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiStringArray2Fuzz.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiStringArray2FuzzTest is AbiRoundtripBase { + function testEchoStringArray2Fuzz(string[2] memory value) public { + assumeShortString(value[0]); + assumeShortString(value[1]); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoStringArray2.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiStringArrayFuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiStringArrayFuzz.t.sol new file mode 100644 index 0000000000..73facb2d5b --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiStringArrayFuzz.t.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiStringArrayFuzzTest is AbiRoundtripBase { + function testEchoStringArrayFuzz(string[] memory value) public { + vm.assume(value.length <= 4); + for (uint256 i = 0; i < value.length; i++) { + assumeShortString(value[i]); + } + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoStringArray.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiStringFuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiStringFuzz.t.sol new file mode 100644 index 0000000000..25d4a04b21 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiStringFuzz.t.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiStringFuzzTest is AbiRoundtripBase { + function testEchoStringFuzz(string memory value) public { + assumeShortString(value); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoString.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiStringU64PairArray2Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiStringU64PairArray2Fuzz.t.sol new file mode 100644 index 0000000000..b61c251bfd --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiStringU64PairArray2Fuzz.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip, StringU64Pair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiStringU64PairArray2FuzzTest is AbiRoundtripBase { + function testEchoStringU64PairArray2Fuzz(StringU64Pair[2] memory value) public { + assumeShortString(value[0].text); + assumeShortString(value[1].text); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoStringU64PairArray2.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiStringU64PairArrayFuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiStringU64PairArrayFuzz.t.sol new file mode 100644 index 0000000000..39fbe87409 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiStringU64PairArrayFuzz.t.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip, StringU64Pair} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiStringU64PairArrayFuzzTest is AbiRoundtripBase { + function testEchoStringU64PairArrayFuzz(StringU64Pair[] memory value) public { + vm.assume(value.length <= 4); + for (uint256 i = 0; i < value.length; i++) { + assumeShortString(value[i].text); + } + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoStringU64PairArray.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiTripleBoolAddressU256Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiTripleBoolAddressU256Array4Fuzz.t.sol new file mode 100644 index 0000000000..1c5375bea7 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiTripleBoolAddressU256Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip, BoolAddressU256Triple} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiTripleBoolAddressU256Array4FuzzTest is AbiRoundtripBase { + function testEchoBoolAddressU256TripleArray4Fuzz(BoolAddressU256Triple[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBoolAddressU256TripleArray4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiTripleBoolAddressU256Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiTripleBoolAddressU256Fuzz.t.sol new file mode 100644 index 0000000000..80d18b7549 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiTripleBoolAddressU256Fuzz.t.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip, BoolAddressU256Triple} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiTripleBoolAddressU256FuzzTest is AbiRoundtripBase { + function testEchoBoolAddressU256TripleFuzz(bool flag, address addr, uint256 count) public { + BoolAddressU256Triple memory value = BoolAddressU256Triple({flag: flag, addr: addr, count: count}); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoBoolAddressU256Triple.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiTripleStringBoolU64Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiTripleStringBoolU64Fuzz.t.sol new file mode 100644 index 0000000000..fd0718985b --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiTripleStringBoolU64Fuzz.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip, StringBoolU64Triple} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiTripleStringBoolU64FuzzTest is AbiRoundtripBase { + function testEchoStringBoolU64TripleFuzz(string memory text, bool flag, uint64 count) public { + assumeShortString(text); + StringBoolU64Triple memory value = StringBoolU64Triple({text: text, flag: flag, count: count}); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoStringBoolU64Triple.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint104Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint104Fuzz.t.sol new file mode 100644 index 0000000000..7c5e5cfd27 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint104Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint104FuzzTest is AbiRoundtripBase { + function testEchoUint104Fuzz(uint104 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint104.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint112Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint112Fuzz.t.sol new file mode 100644 index 0000000000..c46a49b144 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint112Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint112FuzzTest is AbiRoundtripBase { + function testEchoUint112Fuzz(uint112 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint112.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint120Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint120Fuzz.t.sol new file mode 100644 index 0000000000..527d314282 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint120Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint120FuzzTest is AbiRoundtripBase { + function testEchoUint120Fuzz(uint120 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint120.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint128Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint128Array4Fuzz.t.sol new file mode 100644 index 0000000000..97945af8bc --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint128Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint128Array4FuzzTest is AbiRoundtripBase { + function testEchoUint128Array4Fuzz(uint128[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint128Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint128Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint128Fuzz.t.sol new file mode 100644 index 0000000000..c11db08d67 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint128Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint128FuzzTest is AbiRoundtripBase { + function testEchoUint128Fuzz(uint128 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint128.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint136Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint136Fuzz.t.sol new file mode 100644 index 0000000000..5d85b3f6b9 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint136Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint136FuzzTest is AbiRoundtripBase { + function testEchoUint136Fuzz(uint136 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint136.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint144Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint144Fuzz.t.sol new file mode 100644 index 0000000000..f35097eafa --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint144Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint144FuzzTest is AbiRoundtripBase { + function testEchoUint144Fuzz(uint144 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint144.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint152Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint152Fuzz.t.sol new file mode 100644 index 0000000000..718d759bfc --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint152Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint152FuzzTest is AbiRoundtripBase { + function testEchoUint152Fuzz(uint152 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint152.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint160Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint160Array4Fuzz.t.sol new file mode 100644 index 0000000000..30fa8c71b3 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint160Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint160Array4FuzzTest is AbiRoundtripBase { + function testEchoUint160Array4Fuzz(uint160[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint160Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint160Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint160Fuzz.t.sol new file mode 100644 index 0000000000..7909832d26 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint160Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint160FuzzTest is AbiRoundtripBase { + function testEchoUint160Fuzz(uint160 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint160.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint168Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint168Fuzz.t.sol new file mode 100644 index 0000000000..cd0ea2b9cd --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint168Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint168FuzzTest is AbiRoundtripBase { + function testEchoUint168Fuzz(uint168 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint168.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint16Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint16Array4Fuzz.t.sol new file mode 100644 index 0000000000..14cc20da77 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint16Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint16Array4FuzzTest is AbiRoundtripBase { + function testEchoUint16Array4Fuzz(uint16[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint16Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint16Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint16Fuzz.t.sol new file mode 100644 index 0000000000..12a2ecb5e3 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint16Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint16FuzzTest is AbiRoundtripBase { + function testEchoUint16Fuzz(uint16 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint16.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint176Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint176Fuzz.t.sol new file mode 100644 index 0000000000..ecfc287e29 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint176Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint176FuzzTest is AbiRoundtripBase { + function testEchoUint176Fuzz(uint176 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint176.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint184Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint184Fuzz.t.sol new file mode 100644 index 0000000000..fe2cf7cc30 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint184Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint184FuzzTest is AbiRoundtripBase { + function testEchoUint184Fuzz(uint184 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint184.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint192Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint192Fuzz.t.sol new file mode 100644 index 0000000000..1e4ab6bd32 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint192Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint192FuzzTest is AbiRoundtripBase { + function testEchoUint192Fuzz(uint192 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint192.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint200Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint200Fuzz.t.sol new file mode 100644 index 0000000000..d4678023a6 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint200Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint200FuzzTest is AbiRoundtripBase { + function testEchoUint200Fuzz(uint200 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint200.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint208Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint208Fuzz.t.sol new file mode 100644 index 0000000000..f5b7d9c90e --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint208Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint208FuzzTest is AbiRoundtripBase { + function testEchoUint208Fuzz(uint208 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint208.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint216Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint216Fuzz.t.sol new file mode 100644 index 0000000000..e82cb622d1 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint216Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint216FuzzTest is AbiRoundtripBase { + function testEchoUint216Fuzz(uint216 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint216.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint224Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint224Fuzz.t.sol new file mode 100644 index 0000000000..99de1ca54c --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint224Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint224FuzzTest is AbiRoundtripBase { + function testEchoUint224Fuzz(uint224 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint224.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint232Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint232Fuzz.t.sol new file mode 100644 index 0000000000..504e5ce4ee --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint232Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint232FuzzTest is AbiRoundtripBase { + function testEchoUint232Fuzz(uint232 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint232.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint240Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint240Fuzz.t.sol new file mode 100644 index 0000000000..e5ad9d4cc2 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint240Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint240FuzzTest is AbiRoundtripBase { + function testEchoUint240Fuzz(uint240 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint240.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint248Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint248Array4Fuzz.t.sol new file mode 100644 index 0000000000..2955140083 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint248Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint248Array4FuzzTest is AbiRoundtripBase { + function testEchoUint248Array4Fuzz(uint248[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint248Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint248Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint248Fuzz.t.sol new file mode 100644 index 0000000000..850b90ce03 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint248Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint248FuzzTest is AbiRoundtripBase { + function testEchoUint248Fuzz(uint248 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint248.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint24Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint24Array4Fuzz.t.sol new file mode 100644 index 0000000000..52d0613c68 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint24Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint24Array4FuzzTest is AbiRoundtripBase { + function testEchoUint24Array4Fuzz(uint24[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint24Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint24Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint24Fuzz.t.sol new file mode 100644 index 0000000000..01d730823f --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint24Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint24FuzzTest is AbiRoundtripBase { + function testEchoUint24Fuzz(uint24 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint24.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint24Matrix2x2Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint24Matrix2x2Fuzz.t.sol new file mode 100644 index 0000000000..2baa0ed0aa --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint24Matrix2x2Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint24Matrix2x2FuzzTest is AbiRoundtripBase { + function testEchoUint24Matrix2x2Fuzz(uint24[2][2] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint24Matrix2x2.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint256Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint256Array4Fuzz.t.sol new file mode 100644 index 0000000000..aaf7d89822 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint256Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint256Array4FuzzTest is AbiRoundtripBase { + function testEchoUintArray4Fuzz(uint256[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUintArray4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint256Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint256Fuzz.t.sol new file mode 100644 index 0000000000..019e4cce48 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint256Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint256FuzzTest is AbiRoundtripBase { + function testEchoUintFuzz(uint256 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint256Matrix2x2Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint256Matrix2x2Fuzz.t.sol new file mode 100644 index 0000000000..73495e02aa --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint256Matrix2x2Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint256Matrix2x2FuzzTest is AbiRoundtripBase { + function testEchoUintMatrix2x2Fuzz(uint256[2][2] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUintMatrix2x2.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint32Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint32Array4Fuzz.t.sol new file mode 100644 index 0000000000..ce50934e97 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint32Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint32Array4FuzzTest is AbiRoundtripBase { + function testEchoUint32Array4Fuzz(uint32[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint32Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint32Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint32Fuzz.t.sol new file mode 100644 index 0000000000..9075d93115 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint32Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint32FuzzTest is AbiRoundtripBase { + function testEchoUint32Fuzz(uint32 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint32.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint40Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint40Array4Fuzz.t.sol new file mode 100644 index 0000000000..a1a900c1ca --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint40Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint40Array4FuzzTest is AbiRoundtripBase { + function testEchoUint40Array4Fuzz(uint40[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint40Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint40Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint40Fuzz.t.sol new file mode 100644 index 0000000000..3e026098d8 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint40Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint40FuzzTest is AbiRoundtripBase { + function testEchoUint40Fuzz(uint40 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint40.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint48Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint48Fuzz.t.sol new file mode 100644 index 0000000000..83330de17e --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint48Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint48FuzzTest is AbiRoundtripBase { + function testEchoUint48Fuzz(uint48 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint48.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint56Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint56Fuzz.t.sol new file mode 100644 index 0000000000..bed2990743 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint56Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint56FuzzTest is AbiRoundtripBase { + function testEchoUint56Fuzz(uint56 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint56.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint64Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint64Array4Fuzz.t.sol new file mode 100644 index 0000000000..d2e898e048 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint64Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint64Array4FuzzTest is AbiRoundtripBase { + function testEchoUint64Array4Fuzz(uint64[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint64Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint64Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint64Fuzz.t.sol new file mode 100644 index 0000000000..7b47035a13 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint64Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint64FuzzTest is AbiRoundtripBase { + function testEchoUint64Fuzz(uint64 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint64.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint72Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint72Fuzz.t.sol new file mode 100644 index 0000000000..a284b446e3 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint72Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint72FuzzTest is AbiRoundtripBase { + function testEchoUint72Fuzz(uint72 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint72.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint80Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint80Fuzz.t.sol new file mode 100644 index 0000000000..b1f5d6a304 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint80Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint80FuzzTest is AbiRoundtripBase { + function testEchoUint80Fuzz(uint80 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint80.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint88Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint88Fuzz.t.sol new file mode 100644 index 0000000000..e64a5d0331 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint88Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint88FuzzTest is AbiRoundtripBase { + function testEchoUint88Fuzz(uint88 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint88.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint8Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint8Array4Fuzz.t.sol new file mode 100644 index 0000000000..a8abfd84db --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint8Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint8Array4FuzzTest is AbiRoundtripBase { + function testEchoUint8Array4Fuzz(uint8[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint8Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint8Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint8Fuzz.t.sol new file mode 100644 index 0000000000..a1fe9282f5 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint8Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint8FuzzTest is AbiRoundtripBase { + function testEchoUint8Fuzz(uint8 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint8.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint96Array4Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint96Array4Fuzz.t.sol new file mode 100644 index 0000000000..e2f80b64b1 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint96Array4Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint96Array4FuzzTest is AbiRoundtripBase { + function testEchoUint96Array4Fuzz(uint96[4] memory value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint96Array4.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUint96Fuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint96Fuzz.t.sol new file mode 100644 index 0000000000..dcf8d21a55 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUint96Fuzz.t.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUint96FuzzTest is AbiRoundtripBase { + function testEchoUint96Fuzz(uint96 value) public { + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUint96.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/fuzz/AbiUintArrayFuzz.t.sol b/benchmarks/foundry-abi/test/generated/fuzz/AbiUintArrayFuzz.t.sol new file mode 100644 index 0000000000..f004c3fa2f --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/fuzz/AbiUintArrayFuzz.t.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripBase} from "../support/AbiRoundtripBase.sol"; +import {IAbiRoundtrip} from "../../../src/AbiRoundtripSol.sol"; + +contract AbiUintArrayFuzzTest is AbiRoundtripBase { + function testEchoUintArrayFuzz(uint256[] memory value) public { + vm.assume(value.length <= 4); + bytes memory callData = abi.encodeWithSelector(IAbiRoundtrip.echoUintArray.selector, value); + assertEquivalent(callData); + } +} diff --git a/benchmarks/foundry-abi/test/generated/support/AbiRoundtripBase.sol b/benchmarks/foundry-abi/test/generated/support/AbiRoundtripBase.sol new file mode 100644 index 0000000000..b27fab74a4 --- /dev/null +++ b/benchmarks/foundry-abi/test/generated/support/AbiRoundtripBase.sol @@ -0,0 +1,100 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {AbiRoundtripSol, FeBenchCaller, SolBenchCaller} from "../../../src/AbiRoundtripSol.sol"; + +interface Vm { + function readFile(string calldata path) external returns (string memory); + function assume(bool condition) external; +} + +abstract contract AbiRoundtripBase { + Vm constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); + + AbiRoundtripSol internal solTarget; + address internal feTarget; + SolBenchCaller internal solBench; + FeBenchCaller internal feBench; + + function setUp() public virtual { + solTarget = new AbiRoundtripSol(); + feTarget = deploy(fromHex(vm.readFile("fe-out/AbiRoundtripFe.bin"))); + require(feTarget != address(0), "fe create failed"); + + solBench = new SolBenchCaller(address(solTarget)); + feBench = new FeBenchCaller(feTarget); + } + + function assertEquivalent(bytes memory callData) internal { + (bool okSol, bytes memory outSol) = address(solTarget).call(callData); + (bool okFe, bytes memory outFe) = feTarget.call(callData); + + require(okSol == okFe, "success mismatch"); + require(okSol, "call failed"); + require(keccak256(outSol) == keccak256(outFe), "return bytes mismatch"); + } + + function assumeShortString(string memory text) internal { + vm.assume(bytes(text).length <= 96); + } + + function deploy(bytes memory initCode) internal returns (address deployed) { + assembly { + deployed := create(0, add(initCode, 0x20), mload(initCode)) + } + } + + function fromHex(string memory s) internal pure returns (bytes memory) { + bytes memory strBytes = bytes(s); + uint256 start = 0; + while (start < strBytes.length && isWhitespace(strBytes[start])) { + start++; + } + + if ( + start + 1 < strBytes.length && + strBytes[start] == bytes1("0") && + (strBytes[start + 1] == bytes1("x") || strBytes[start + 1] == bytes1("X")) + ) { + start += 2; + } + + uint256 digits = 0; + for (uint256 i = start; i < strBytes.length; i++) { + if (isWhitespace(strBytes[i])) continue; + digits++; + } + require(digits % 2 == 0, "odd hex length"); + + bytes memory out = new bytes(digits / 2); + uint256 outIndex = 0; + uint8 high = 0; + bool highNibble = true; + for (uint256 i = start; i < strBytes.length; i++) { + bytes1 ch = strBytes[i]; + if (isWhitespace(ch)) continue; + uint8 val = fromHexChar(ch); + if (highNibble) { + high = val; + highNibble = false; + } else { + out[outIndex] = bytes1((high << 4) | val); + outIndex++; + highNibble = true; + } + } + return out; + } + + function isWhitespace(bytes1 ch) private pure returns (bool) { + return ch == 0x20 || ch == 0x0a || ch == 0x0d || ch == 0x09; + } + + function fromHexChar(bytes1 c) private pure returns (uint8) { + uint8 b = uint8(c); + if (b >= 48 && b <= 57) return b - 48; + if (b >= 65 && b <= 70) return b - 55; + if (b >= 97 && b <= 102) return b - 87; + revert("invalid hex"); + } +} diff --git a/crates/codegen/tests/fixtures/sonatina_ir/by_ref_trait_provider_storage_bug.snap b/crates/codegen/tests/fixtures/sonatina_ir/by_ref_trait_provider_storage_bug.snap index 7f31c536f0..a1f50f4e3f 100644 --- a/crates/codegen/tests/fixtures/sonatina_ir/by_ref_trait_provider_storage_bug.snap +++ b/crates/codegen/tests/fixtures/sonatina_ir/by_ref_trait_provider_storage_bug.snap @@ -172,7 +172,8 @@ func private %contract_runtime_root_ByRefTraitProviderStorageBug() { v4.i256 = evm_calldata_load 0.i256; v6.i256 = shr 224.i256 v4; v7.i32 = trunc v6 i32; - br_table v7 block3 (1.i32 block4); + v9.i1 = eq v7 1.i32; + br v9 block4 block3; block3: evm_revert 0.i256 0.i256; diff --git a/crates/codegen/tests/fixtures/sonatina_ir/create_contract.snap b/crates/codegen/tests/fixtures/sonatina_ir/create_contract.snap index 9c9e751667..e3baf7cc46 100644 --- a/crates/codegen/tests/fixtures/sonatina_ir/create_contract.snap +++ b/crates/codegen/tests/fixtures/sonatina_ir/create_contract.snap @@ -466,7 +466,7 @@ func private %contract_runtime_root_Child() { v4.i256 = evm_calldata_load 0.i256; v6.i256 = shr 224.i256 v4; v7.i32 = trunc v6 i32; - br_table v7 block3; + jump block3; block3: evm_revert 0.i256 0.i256; @@ -485,7 +485,9 @@ func private %contract_runtime_root_Factory() { v4.i256 = evm_calldata_load 0.i256; v6.i256 = shr 224.i256 v4; v7.i32 = trunc v6 i32; - br_table v7 block3 (1.i32 block4) (2.i32 block5); + v9.i1 = gt v7 1.i32; + v10.i1 = is_zero v9; + br v10 block6 block7; block3: evm_revert 0.i256 0.i256; @@ -497,6 +499,14 @@ func private %contract_runtime_root_Factory() { block5: call %contract_recv_abi_Factory_2; unreachable; + + block6: + v13.i1 = eq v7 1.i32; + br v13 block4 block3; + + block7: + v16.i1 = eq v7 2.i32; + br v16 block5 block3; } func private %copy_words(v0.i256, v1.i256, v2.i256) { diff --git a/crates/codegen/tests/fixtures/sonatina_ir/effect_handle_field_deref.snap b/crates/codegen/tests/fixtures/sonatina_ir/effect_handle_field_deref.snap index 2bde5e6f37..a9c37353f1 100644 --- a/crates/codegen/tests/fixtures/sonatina_ir/effect_handle_field_deref.snap +++ b/crates/codegen/tests/fixtures/sonatina_ir/effect_handle_field_deref.snap @@ -467,7 +467,9 @@ func private %contract_runtime_root_EffectHandleFieldDeref() { v4.i256 = evm_calldata_load 0.i256; v6.i256 = shr 224.i256 v4; v7.i32 = trunc v6 i32; - br_table v7 block3 (1.i32 block4) (2.i32 block5) (3.i32 block6); + v9.i1 = gt v7 2.i32; + v10.i1 = is_zero v9; + br v10 block7 block8; block3: evm_revert 0.i256 0.i256; @@ -483,6 +485,23 @@ func private %contract_runtime_root_EffectHandleFieldDeref() { block6: call %contract_recv_abi_EffectHandleFieldDeref_3; unreachable; + + block7: + v14.i1 = gt v7 1.i32; + v15.i1 = is_zero v14; + br v15 block9 block10; + + block8: + v18.i1 = eq v7 3.i32; + br v18 block6 block3; + + block9: + v20.i1 = eq v7 1.i32; + br v20 block4 block3; + + block10: + v22.i1 = eq v7 2.i32; + br v22 block5 block3; } func private %std__lib__abi__sol__impl_trait_Sol_1f5f__decode_error_1efd() { diff --git a/crates/codegen/tests/fixtures/sonatina_ir/erc20.snap b/crates/codegen/tests/fixtures/sonatina_ir/erc20.snap index 7e46d955f6..6f85360d71 100644 --- a/crates/codegen/tests/fixtures/sonatina_ir/erc20.snap +++ b/crates/codegen/tests/fixtures/sonatina_ir/erc20.snap @@ -2587,7 +2587,9 @@ func private %contract_runtime_root_CoolCoin() { v4.i256 = evm_calldata_load 0.i256; v6.i256 = shr 224.i256 v4; v7.i32 = trunc v6 i32; - br_table v7 block3 (117300739.i32 block4) (157198259.i32 block5) (404098525.i32 block6) (599290589.i32 block7) (826074471.i32 block8) (961581905.i32 block9) (1086394137.i32 block10) (1117154408.i32 block11) (1889567281.i32 block12) (2043438992.i32 block13) (-1780966591.i32 block14) (-1537752361.i32 block15) (-1459249989.i32 block16) (-580719298.i32 block17); + v9.i1 = gt v7 1086394137.i32; + v10.i1 = is_zero v9; + br v10 block18 block19; block3: evm_revert 0.i256 0.i256; @@ -2647,6 +2649,122 @@ func private %contract_runtime_root_CoolCoin() { block17: call %contract_recv_abi_CoolCoin_3714247998; unreachable; + + block18: + v14.i1 = gt v7 599290589.i32; + v15.i1 = is_zero v14; + br v15 block20 block21; + + block19: + v18.i1 = gt v7 -1780966591.i32; + v19.i1 = is_zero v18; + br v19 block32 block33; + + block20: + v22.i1 = gt v7 157198259.i32; + v23.i1 = is_zero v22; + br v23 block22 block23; + + block21: + v26.i1 = gt v7 961581905.i32; + v27.i1 = is_zero v26; + br v27 block28 block29; + + block22: + v30.i1 = gt v7 117300739.i32; + v31.i1 = is_zero v30; + br v31 block24 block25; + + block23: + v34.i1 = gt v7 404098525.i32; + v35.i1 = is_zero v34; + br v35 block26 block27; + + block24: + v37.i1 = eq v7 117300739.i32; + br v37 block4 block3; + + block25: + v39.i1 = eq v7 157198259.i32; + br v39 block5 block3; + + block26: + v41.i1 = eq v7 404098525.i32; + br v41 block6 block3; + + block27: + v43.i1 = eq v7 599290589.i32; + br v43 block7 block3; + + block28: + v46.i1 = gt v7 826074471.i32; + v47.i1 = is_zero v46; + br v47 block30 block31; + + block29: + v49.i1 = eq v7 1086394137.i32; + br v49 block10 block3; + + block30: + v51.i1 = eq v7 826074471.i32; + br v51 block8 block3; + + block31: + v53.i1 = eq v7 961581905.i32; + br v53 block9 block3; + + block32: + v56.i1 = gt v7 1889567281.i32; + v57.i1 = is_zero v56; + br v57 block34 block35; + + block33: + v60.i1 = gt v7 -1459249989.i32; + v61.i1 = is_zero v60; + br v61 block40 block41; + + block34: + v64.i1 = gt v7 1117154408.i32; + v65.i1 = is_zero v64; + br v65 block36 block37; + + block35: + v68.i1 = gt v7 2043438992.i32; + v69.i1 = is_zero v68; + br v69 block38 block39; + + block36: + v71.i1 = eq v7 1117154408.i32; + br v71 block11 block3; + + block37: + v73.i1 = eq v7 1889567281.i32; + br v73 block12 block3; + + block38: + v75.i1 = eq v7 2043438992.i32; + br v75 block13 block3; + + block39: + v77.i1 = eq v7 -1780966591.i32; + br v77 block14 block3; + + block40: + v80.i1 = gt v7 -1537752361.i32; + v81.i1 = is_zero v80; + br v81 block42 block43; + + block41: + v84.i1 = eq v7 -580719298.i32; + br v84 block17 block3; + + block42: + v86.i1 = eq v7 -1537752361.i32; + br v86 block15 block3; + + block43: + v88.i1 = eq v7 -1459249989.i32; + br v88 block16 block3; } func private %std__lib__abi__sol__impl_trait_Sol_1f5f__decode_error_0b81() { diff --git a/crates/codegen/tests/fixtures/sonatina_ir/high_level_contract.snap b/crates/codegen/tests/fixtures/sonatina_ir/high_level_contract.snap index bc80be603d..07a84b31ba 100644 --- a/crates/codegen/tests/fixtures/sonatina_ir/high_level_contract.snap +++ b/crates/codegen/tests/fixtures/sonatina_ir/high_level_contract.snap @@ -5,17 +5,16 @@ input_file: crates/codegen/tests/fixtures/high_level_contract.fe --- target = "evm-ethereum-osaka" -type @layout_0 = {i256, i256}; +type @layout_0 = {i256}; type @layout_1 = {i256, i256}; -type @layout_2 = {@layout_1, i256}; +type @layout_2 = {i256, i256}; type @layout_3 = {@layout_2, i256}; -type @layout_4 = {i256}; -type @layout_5 = {i256}; -type @layout_6 = {i256, i256}; -type @layout_7 = {}; -type @layout_8 = {@layout_7}; +type @layout_4 = {@layout_3, i256}; +type @layout_5 = {i256, i256}; +type @layout_6 = {}; +type @layout_7 = {@layout_6}; -global private const @layout_4 $const_region_0 = {0}; +global private const @layout_0 $const_region_0 = {0}; func private %__EchoContract_init(v0.i256, v1.i256, v2.i256) { block0: @@ -36,21 +35,35 @@ func private %__EchoContract_recv_0_0() -> i256 { return 42.i256; } -func private %__EchoContract_recv_0_1(v0.i256) -> i256 { +func private %__EchoContract_recv_0_2(v0.i256) -> i256 { block0: jump block1; block1: - return v0; + v2.i256 = evm_sload v0; + return v2; } -func private %__EchoContract_recv_0_2(v0.i256) -> i256 { +func private %abi_field_end_with_input_len(v0.objref<@layout_0>, v1.i256, v2.i256, v3.i256) -> i256 { block0: jump block1; block1: - v2.i256 = evm_sload v0; - return v2; + br 0.i1 block2 block3; + + block2: + v7.i256 = call %impl_trait_CallData__word_at v0 v2; + v9.i256 = call %checked_tail v1 v7; + v12.i256 = call %checked_frame_end v9 32.i256 v3; + v13.i256 = call %payload_end_with_input_len v0 v9 v9 v3; + return v13; + + block3: + jump block4; + + block4: + v18.i256 = call %payload_end_with_input_len v0 v1 v2 v3; + return v18; } func private %abi_field_size(v0.i256) -> i256 { @@ -98,15 +111,6 @@ func private %std__lib__evm__effects__impl_trait_Evm_c913__abort_2725() { unreachable; } -func private %std__lib__evm__effects__impl_trait_Evm_c913__abort_87bf() { - block0: - jump block1; - - block1: - call %std__lib__evm__effects__impl_trait_Evm_0098__revert_f892 0.i256 0.i256; - unreachable; -} - func private %std__lib__evm__effects__impl_trait_Evm_c913__abort_ee4e() { block0: jump block1; @@ -116,17 +120,17 @@ func private %std__lib__evm__effects__impl_trait_Evm_c913__abort_ee4e() { unreachable; } -func inline(always) private %at(v0.i256) -> @layout_0 { +func inline(always) private %at(v0.i256) -> @layout_1 { block0: jump block1; block1: - v4.@layout_0 = insert_value undef.@layout_0 0.i256 v0; - v6.@layout_0 = insert_value v4 1.i256 v0; + v4.@layout_1 = insert_value undef.@layout_1 0.i256 v0; + v6.@layout_1 = insert_value v4 1.i256 v0; return v6; } -func private %base__g463e(v0.objref<@layout_3>) -> i256 { +func private %base__g463e(v0.objref<@layout_4>) -> i256 { block0: jump block1; @@ -136,7 +140,7 @@ func private %base__g463e(v0.objref<@layout_3>) -> i256 { return v4; } -func private %impl_trait_SolEncoder__base(v0.objref<@layout_0>) -> i256 { +func private %impl_trait_SolEncoder__base(v0.objref<@layout_1>) -> i256 { block0: jump block1; @@ -155,7 +159,7 @@ func inline(always) private %checked_frame_end(v0.i256, v1.i256, v2.i256) -> i25 br v6 block6 block7; block2: - call %std__lib__abi__sol__impl_trait_Sol_1f5f__decode_error_f5d2; + call %decode_error; unreachable; block3: @@ -187,7 +191,7 @@ func inline(always) private %checked_tail(v0.i256, v1.i256) -> i256 { br v5 block5 block6; block2: - call %std__lib__abi__sol__impl_trait_Sol_1f5f__decode_error_eb34; + call %decode_error; unreachable; block3: @@ -208,8 +212,8 @@ func inline(always) private %checked_tail(v0.i256, v1.i256) -> i256 { func inline(always) private %contract_init_abi_EchoContract() { block0: - v0.objref<@layout_1> = obj.alloc @layout_1; - v1.objref<@layout_3> = obj.alloc @layout_3; + v0.objref<@layout_2> = obj.alloc @layout_2; + v1.objref<@layout_4> = obj.alloc @layout_4; jump block1; block1: @@ -247,12 +251,12 @@ func inline(always) private %contract_init_abi_EchoContract() { obj.store v23 v20; v25.objref = obj.proj v0 1.i256; obj.store v25 v13; - v26.@layout_1 = obj.load v0; - v27.@layout_3 = call %decoder_new v26; - v28.objref<@layout_2> = obj.proj v1 0.i256; - v29.@layout_2 = extract_value v27 0.i256; - v30.objref<@layout_1> = obj.proj v28 0.i256; - v31.@layout_1 = extract_value v29 0.i256; + v26.@layout_2 = obj.load v0; + v27.@layout_4 = call %decoder_new v26; + v28.objref<@layout_3> = obj.proj v1 0.i256; + v29.@layout_3 = extract_value v27 0.i256; + v30.objref<@layout_2> = obj.proj v28 0.i256; + v31.@layout_2 = extract_value v29 0.i256; v32.objref = obj.proj v30 0.i256; v33.i256 = extract_value v31 0.i256; obj.store v32 v33; @@ -265,7 +269,7 @@ func inline(always) private %contract_init_abi_EchoContract() { v38.objref = obj.proj v1 1.i256; v39.i256 = extract_value v27 1.i256; obj.store v38 v39; - v40.@layout_6 = call %decode_payload__g4770 v1; + v40.@layout_5 = call %decode_payload__g4770 v1; v41.i256 = extract_value v40 0.i256; v42.i256 = extract_value v40 1.i256; call %__EchoContract_init v41 v42 0.i256; @@ -298,10 +302,10 @@ func inline(always) private %contract_recv_abi_EchoContract_1() { evm_revert 0.i256 0.i256; block3: - v5.objref<@layout_8> = obj.alloc @layout_8; + v5.objref<@layout_7> = obj.alloc @layout_7; call %decode_runtime_args__g235a v5; v7.i256 = call %__EchoContract_recv_0_0; - v8.@layout_6 = call %encode_single_root_alloc v7; + v8.@layout_5 = call %encode_single_root_alloc v7; v9.i256 = extract_value v8 0.i256; v11.i256 = extract_value v8 1.i256; evm_return v9 v11; @@ -309,26 +313,34 @@ func inline(always) private %contract_recv_abi_EchoContract_1() { func inline(always) private %contract_recv_abi_EchoContract_2() { block0: + v0.objref<@layout_0> = obj.alloc @layout_0; jump block1; block1: - v1.i256 = evm_call_value; - v2.i1 = eq v1 0.i256; - v3.i1 = is_zero v2; - br v3 block2 block3; + v2.i256 = evm_call_value; + v3.i1 = eq v2 0.i256; + v4.i1 = is_zero v3; + br v4 block2 block3; block2: evm_revert 0.i256 0.i256; block3: - v5.objref<@layout_8> = obj.alloc @layout_8; - v6.@layout_5 = call %decode_runtime_args__g9e33 v5; - v7.i256 = extract_value v6 0.i256; - v8.i256 = call %__EchoContract_recv_0_1 v7; - v9.@layout_6 = call %encode_single_root_alloc v8; - v10.i256 = extract_value v9 0.i256; - v12.i256 = extract_value v9 1.i256; - evm_return v10 v12; + v8.objref = obj.proj v0 0.i256; + obj.store v8 0.i256; + v9.i256 = evm_calldata_size; + v10.i256 = call %abi_field_end_with_input_len v0 4.i256 4.i256 v9; + (v11.i256, v12.i1) = usubo v10 4.i256; + br v12 block4 block5; + + block4: + mstore 0.i256 35408467139433450592217433187231851964531694900788300625387963629091585785856.i256 i256; + mstore 4.i256 17.i256 i256; + evm_revert 0.i256 36.i256; + + block5: + evm_calldata_copy 0.i256 4.i256 v11; + evm_return 0.i256 v11; } func inline(always) private %contract_recv_abi_EchoContract_3() { @@ -345,10 +357,10 @@ func inline(always) private %contract_recv_abi_EchoContract_3() { evm_revert 0.i256 0.i256; block3: - v5.objref<@layout_8> = obj.alloc @layout_8; + v5.objref<@layout_7> = obj.alloc @layout_7; call %decode_runtime_args__gf173 v5; v7.i256 = call %__EchoContract_recv_0_2 0.i256; - v8.@layout_6 = call %encode_single_root_alloc v7; + v8.@layout_5 = call %encode_single_root_alloc v7; v9.i256 = extract_value v8 0.i256; v11.i256 = extract_value v8 1.i256; evm_return v9 v11; @@ -367,7 +379,9 @@ func private %contract_runtime_root_EchoContract() { v4.i256 = evm_calldata_load 0.i256; v6.i256 = shr 224.i256 v4; v7.i32 = trunc v6 i32; - br_table v7 block3 (1.i32 block4) (2.i32 block5) (3.i32 block6); + v9.i1 = gt v7 2.i32; + v10.i1 = is_zero v9; + br v10 block7 block8; block3: evm_revert 0.i256 0.i256; @@ -383,17 +397,26 @@ func private %contract_runtime_root_EchoContract() { block6: call %contract_recv_abi_EchoContract_3; unreachable; -} -func private %std__lib__abi__sol__impl_trait_Sol_1f5f__decode_error_eb34() { - block0: - jump block1; + block7: + v14.i1 = gt v7 1.i32; + v15.i1 = is_zero v14; + br v15 block9 block10; - block1: - evm_revert 0.i256 0.i256; + block8: + v18.i1 = eq v7 3.i32; + br v18 block6 block3; + + block9: + v20.i1 = eq v7 1.i32; + br v20 block4 block3; + + block10: + v22.i1 = eq v7 2.i32; + br v22 block5 block3; } -func private %std__lib__abi__sol__impl_trait_Sol_1f5f__decode_error_f5d2() { +func private %decode_error() { block0: jump block1; @@ -401,7 +424,7 @@ func private %std__lib__abi__sol__impl_trait_Sol_1f5f__decode_error_f5d2() { evm_revert 0.i256 0.i256; } -func inline(always) private %decode_field(v0.objref<@layout_3>) -> i256 { +func inline(always) private %decode_field(v0.objref<@layout_4>) -> i256 { block0: jump block1; @@ -437,68 +460,7 @@ func inline(always) private %decode_field(v0.objref<@layout_3>) -> i256 { return v17; } -func inline(always) private %decode_field_from(v0.@layout_4, v1.i256, v2.i256) -> i256 { - block0: - jump block1; - - block1: - br 0.i1 block2 block3; - - block2: - v6.i256 = call %std__lib__evm__calldata__impl_trait_CallData_087c__word_at_1f7f v0 v2; - (v8.i256, v9.i1) = uaddo v1 v6; - br v9 block5 block6; - - block3: - jump block4; - - block4: - v19.i256 = call %core__lib__abi__impl_trait_u256_85b6__decode_from__g72ab_4818_0 v0 v2; - return v19; - - block5: - mstore 0.i256 35408467139433450592217433187231851964531694900788300625387963629091585785856.i256 i256; - mstore 4.i256 17.i256 i256; - evm_revert 0.i256 36.i256; - - block6: - v16.i256 = call %core__lib__abi__impl_trait_u256_85b6__decode_from__g72ab_4818_0 v0 v8; - return v16; -} - -func inline(always) private %decode_field_from_prechecked_head(v0.@layout_4, v1.i256, v2.i256, v3.i256) -> i256 { - block0: - jump block1; - - block1: - br 0.i1 block2 block3; - - block2: - v7.i256 = call %std__lib__evm__calldata__impl_trait_CallData_087c__word_at_1f7f v0 v2; - v9.i256 = call %checked_tail v1 v7; - v11.i256 = call %decode_from_bounded v0 v9 v3; - return v11; - - block3: - jump block4; - - block4: - v14.i256 = call %core__lib__abi__impl_trait_u256_85b6__decode_from__g72ab_4818_0 v0 v2; - return v14; -} - -func inline(always) private %impl_trait_Echo__decode_from__gd20d(v0.@layout_4, v1.i256) -> @layout_5 { - block0: - jump block1; - - block1: - v3.i256 = call %std__lib__evm__calldata__impl_trait_CallData_087c__len_6a97 v0; - v5.i256 = call %decode_msg_field_from v0 v1 v1 v3; - v8.@layout_5 = insert_value undef.@layout_5 0.i256 v5; - return v8; -} - -func inline(always) private %impl_trait_Answer__decode_from__gd20d(v0.@layout_4, v1.i256) { +func inline(always) private %impl_trait_Answer__decode_from__gd20d(v0.@layout_0, v1.i256) { block0: jump block1; @@ -506,7 +468,7 @@ func inline(always) private %impl_trait_Answer__decode_from__gd20d(v0.@layout_4, return; } -func inline(always) private %impl_trait_GetX__decode_from__gd20d(v0.@layout_4, v1.i256) { +func inline(always) private %impl_trait_GetX__decode_from__gd20d(v0.@layout_0, v1.i256) { block0: jump block1; @@ -514,35 +476,7 @@ func inline(always) private %impl_trait_GetX__decode_from__gd20d(v0.@layout_4, v return; } -func inline(always) private %core__lib__abi__impl_trait_u256_85b6__decode_from__g72ab_4818(v0.@layout_4, v1.i256) -> i256 { - block0: - jump block1; - - block1: - v4.i256 = call %std__lib__evm__calldata__impl_trait_CallData_087c__word_at_81b2 v0 v1; - return v4; -} - -func inline(always) private %core__lib__abi__impl_trait_u256_85b6__decode_from__g72ab_4818_0(v0.@layout_4, v1.i256) -> i256 { - block0: - jump block1; - - block1: - v4.i256 = call %std__lib__evm__calldata__impl_trait_CallData_087c__word_at_81b2_0 v0 v1; - return v4; -} - -func private %decode_from_bounded(v0.@layout_4, v1.i256, v2.i256) -> i256 { - block0: - jump block1; - - block1: - v6.i256 = call %checked_frame_end v1 32.i256 v2; - v8.i256 = call %core__lib__abi__impl_trait_u256_85b6__decode_from__g72ab_4818 v0 v1; - return v8; -} - -func inline(always) private %decode_from_prechecked_head__g2d0f(v0.@layout_4, v1.i256, v2.i256) { +func inline(always) private %decode_from_prechecked_head__g2d0f(v0.@layout_0, v1.i256, v2.i256) { block0: jump block1; @@ -551,7 +485,7 @@ func inline(always) private %decode_from_prechecked_head__g2d0f(v0.@layout_4, v1 return; } -func inline(always) private %decode_from_prechecked_head__g2f3f(v0.@layout_4, v1.i256, v2.i256) { +func inline(always) private %decode_from_prechecked_head__g2f3f(v0.@layout_0, v1.i256, v2.i256) { block0: jump block1; @@ -560,35 +494,7 @@ func inline(always) private %decode_from_prechecked_head__g2f3f(v0.@layout_4, v1 return; } -func inline(always) private %decode_from_prechecked_head__g6fcf(v0.@layout_4, v1.i256, v2.i256) -> @layout_5 { - block0: - jump block1; - - block1: - v6.@layout_5 = call %impl_trait_Echo__decode_from__gd20d v0 v1; - return v6; -} - -func inline(always) private %decode_msg_field_from(v0.@layout_4, v1.i256, v2.i256, v3.i256) -> i256 { - block0: - jump block1; - - block1: - br 0.i1 block2 block3; - - block2: - v9.i256 = call %decode_field_from_prechecked_head v0 v1 v2 v3; - return v9; - - block3: - jump block4; - - block4: - v14.i256 = call %decode_field_from v0 v1 v2; - return v14; -} - -func inline(always) private %decode_payload__g407e(v0.objref<@layout_3>) -> i256 { +func inline(always) private %decode_payload__g407e(v0.objref<@layout_4>) -> i256 { block0: jump block1; @@ -597,56 +503,26 @@ func inline(always) private %decode_payload__g407e(v0.objref<@layout_3>) -> i256 return v2; } -func private %decode_payload__g4770(v0.objref<@layout_3>) -> @layout_6 { +func private %decode_payload__g4770(v0.objref<@layout_4>) -> @layout_5 { block0: jump block1; block1: v2.i256 = call %decode_field v0; v3.i256 = call %decode_field v0; - v6.@layout_6 = insert_value undef.@layout_6 0.i256 v2; - v8.@layout_6 = insert_value v6 1.i256 v3; + v6.@layout_5 = insert_value undef.@layout_5 0.i256 v2; + v8.@layout_5 = insert_value v6 1.i256 v3; return v8; } -func inline(always) private %decode_runtime_args__g9e33(v0.objref<@layout_8>) -> @layout_5 { +func inline(always) private %decode_runtime_args__gf173(v0.objref<@layout_7>) { block0: v1.*i256 = alloca i256; v2.*i256 = alloca i256; jump block1; block1: - v3.@layout_4 = call %std__lib__evm__effects__impl_trait_Evm_c913__input_024f; - v5.i256 = call %std__lib__evm__calldata__impl_trait_CallData_087c__len_7c2f v3; - mstore v1 4.i256 i256; - br 0.i1 block2 block5; - - block2: - call %std__lib__evm__effects__impl_trait_Evm_c913__abort_87bf; - unreachable; - - block3: - jump block4; - - block4: - v12.@layout_5 = call %decode_from_prechecked_head__g6fcf v3 4.i256 v5; - return v12; - - block5: - mstore v2 v5 i256; - v15.i256 = mload v2 i256; - v16.i1 = gt 36.i256 v15; - br v16 block2 block3; -} - -func inline(always) private %decode_runtime_args__gf173(v0.objref<@layout_8>) { - block0: - v1.*i256 = alloca i256; - v2.*i256 = alloca i256; - jump block1; - - block1: - v3.@layout_4 = call %std__lib__evm__effects__impl_trait_Evm_c913__input_58ca; + v3.@layout_0 = call %std__lib__evm__effects__impl_trait_Evm_c913__input_58ca; v5.i256 = call %std__lib__evm__calldata__impl_trait_CallData_087c__len_34dc v3; mstore v1 4.i256 i256; br 0.i1 block2 block5; @@ -669,14 +545,14 @@ func inline(always) private %decode_runtime_args__gf173(v0.objref<@layout_8>) { br v15 block2 block3; } -func inline(always) private %decode_runtime_args__g235a(v0.objref<@layout_8>) { +func inline(always) private %decode_runtime_args__g235a(v0.objref<@layout_7>) { block0: v1.*i256 = alloca i256; v2.*i256 = alloca i256; jump block1; block1: - v3.@layout_4 = call %std__lib__evm__effects__impl_trait_Evm_c913__input_414c; + v3.@layout_0 = call %std__lib__evm__effects__impl_trait_Evm_c913__input_414c; v5.i256 = call %std__lib__evm__calldata__impl_trait_CallData_087c__len_1779 v3; mstore v1 4.i256 i256; br 0.i1 block2 block5; @@ -699,16 +575,16 @@ func inline(always) private %decode_runtime_args__g235a(v0.objref<@layout_8>) { br v15 block2 block3; } -func private %decoder_new(v0.@layout_1) -> @layout_3 { +func private %decoder_new(v0.@layout_2) -> @layout_4 { block0: jump block1; block1: - v2.@layout_3 = call %impl_SolDecoder__new__g463e v0; + v2.@layout_4 = call %impl_SolDecoder__new__g463e v0; return v2; } -func private %encode(v0.i256, v1.objref<@layout_0>) { +func private %encode(v0.i256, v1.objref<@layout_1>) { block0: jump block1; @@ -717,7 +593,7 @@ func private %encode(v0.i256, v1.objref<@layout_0>) { return; } -func private %encode_field(v0.i256, v1.objref<@layout_0>, v2.i256) { +func private %encode_field(v0.i256, v1.objref<@layout_1>, v2.i256) { block0: jump block1; @@ -764,7 +640,7 @@ func private %encode_field(v0.i256, v1.objref<@layout_0>, v2.i256) { return; } -func private %encode_single_root(v0.i256, v1.objref<@layout_0>) { +func private %encode_single_root(v0.i256, v1.objref<@layout_1>) { block0: v2.*i256 = alloca i256; jump block1; @@ -778,14 +654,14 @@ func private %encode_single_root(v0.i256, v1.objref<@layout_0>) { return; } -func private %encode_single_root_alloc(v0.i256) -> @layout_6 { +func private %encode_single_root_alloc(v0.i256) -> @layout_5 { block0: jump block1; block1: v2.i256 = call %abi_single_root_size v0; - v3.@layout_0 = call %encoder_new v2; - v4.objref<@layout_0> = obj.alloc @layout_0; + v3.@layout_1 = call %encoder_new v2; + v4.objref<@layout_1> = obj.alloc @layout_1; v6.objref = obj.proj v4 0.i256; v7.i256 = extract_value v3 0.i256; obj.store v6 v7; @@ -794,8 +670,8 @@ func private %encode_single_root_alloc(v0.i256) -> @layout_6 { obj.store v9 v10; v11.i256 = call %impl_trait_SolEncoder__base v4; call %encode_single_root v0 v4; - v14.@layout_6 = insert_value undef.@layout_6 0.i256 v11; - v15.@layout_6 = insert_value v14 1.i256 v2; + v14.@layout_5 = insert_value undef.@layout_5 0.i256 v11; + v15.@layout_5 = insert_value v14 1.i256 v2; return v15; } @@ -808,43 +684,34 @@ func private %encode_to_ptr(v0.i256, v1.i256) { return; } -func private %encoder_new(v0.i256) -> @layout_0 { +func private %encoder_new(v0.i256) -> @layout_1 { block0: jump block1; block1: - v2.@layout_0 = call %impl_SolEncoder__new v0; + v2.@layout_1 = call %impl_SolEncoder__new v0; return v2; } -func private %std__lib__evm__effects__impl_trait_Evm_c913__input_024f() -> @layout_4 { - block0: - jump block1; - - block1: - v0.@layout_4 = call %std__lib__evm__calldata__impl_CallData_8f43__new_45d4; - return v0; -} - -func private %std__lib__evm__effects__impl_trait_Evm_c913__input_414c() -> @layout_4 { +func private %std__lib__evm__effects__impl_trait_Evm_c913__input_414c() -> @layout_0 { block0: jump block1; block1: - v0.@layout_4 = call %std__lib__evm__calldata__impl_CallData_8f43__new_c043; + v0.@layout_0 = call %std__lib__evm__calldata__impl_CallData_8f43__new_c043; return v0; } -func private %std__lib__evm__effects__impl_trait_Evm_c913__input_58ca() -> @layout_4 { +func private %std__lib__evm__effects__impl_trait_Evm_c913__input_58ca() -> @layout_0 { block0: jump block1; block1: - v0.@layout_4 = call %std__lib__evm__calldata__impl_CallData_8f43__new_bdf6; + v0.@layout_0 = call %std__lib__evm__calldata__impl_CallData_8f43__new_bdf6; return v0; } -func inline(always) private %std__lib__evm__calldata__impl_trait_CallData_087c__len_1779(v0.@layout_4) -> i256 { +func inline(always) private %std__lib__evm__calldata__impl_trait_CallData_087c__len_1779(v0.@layout_0) -> i256 { block0: v1.*i256 = alloca i256; jump block1; @@ -878,7 +745,7 @@ func inline(always) private %std__lib__evm__calldata__impl_trait_CallData_087c__ jump block4; } -func inline(always) private %std__lib__evm__calldata__impl_trait_CallData_087c__len_34dc(v0.@layout_4) -> i256 { +func inline(always) private %std__lib__evm__calldata__impl_trait_CallData_087c__len_34dc(v0.@layout_0) -> i256 { block0: v1.*i256 = alloca i256; jump block1; @@ -912,75 +779,7 @@ func inline(always) private %std__lib__evm__calldata__impl_trait_CallData_087c__ jump block4; } -func inline(always) private %std__lib__evm__calldata__impl_trait_CallData_087c__len_6a97(v0.@layout_4) -> i256 { - block0: - v1.*i256 = alloca i256; - jump block1; - - block1: - v2.i256 = evm_calldata_size; - v5.i256 = extract_value v0 0.i256; - mstore v1 v2 i256; - v6.i256 = mload v1 i256; - v7.i1 = gt v5 v6; - br v7 block2 block3; - - block2: - jump block4; - - block3: - v9.i256 = extract_value v0 0.i256; - (v11.i256, v12.i1) = usubo v2 v9; - br v12 block5 block6; - - block4: - v17.i256 = phi (0.i256 block2) (v11 block6); - return v17; - - block5: - mstore 0.i256 35408467139433450592217433187231851964531694900788300625387963629091585785856.i256 i256; - mstore 4.i256 17.i256 i256; - evm_revert 0.i256 36.i256; - - block6: - jump block4; -} - -func inline(always) private %std__lib__evm__calldata__impl_trait_CallData_087c__len_7c2f(v0.@layout_4) -> i256 { - block0: - v1.*i256 = alloca i256; - jump block1; - - block1: - v2.i256 = evm_calldata_size; - v5.i256 = extract_value v0 0.i256; - mstore v1 v2 i256; - v6.i256 = mload v1 i256; - v7.i1 = gt v5 v6; - br v7 block2 block3; - - block2: - jump block4; - - block3: - v9.i256 = extract_value v0 0.i256; - (v11.i256, v12.i1) = usubo v2 v9; - br v12 block5 block6; - - block4: - v17.i256 = phi (0.i256 block2) (v11 block6); - return v17; - - block5: - mstore 0.i256 35408467139433450592217433187231851964531694900788300625387963629091585785856.i256 i256; - mstore 4.i256 17.i256 i256; - evm_revert 0.i256 36.i256; - - block6: - jump block4; -} - -func private %std__lib__evm__memory_input__impl_trait_MemoryBytes_c1cd__len_8748(v0.objref<@layout_1>) -> i256 { +func private %std__lib__evm__memory_input__impl_trait_MemoryBytes_c1cd__len_8748(v0.objref<@layout_2>) -> i256 { block0: jump block1; @@ -990,7 +789,7 @@ func private %std__lib__evm__memory_input__impl_trait_MemoryBytes_c1cd__len_8748 return v4; } -func private %std__lib__evm__memory_input__impl_trait_MemoryBytes_c1cd__len_f8db(v0.objref<@layout_1>) -> i256 { +func private %std__lib__evm__memory_input__impl_trait_MemoryBytes_c1cd__len_f8db(v0.objref<@layout_2>) -> i256 { block0: jump block1; @@ -1000,7 +799,7 @@ func private %std__lib__evm__memory_input__impl_trait_MemoryBytes_c1cd__len_f8db return v4; } -func private %impl_SolEncoder__new(v0.i256) -> @layout_0 { +func private %impl_SolEncoder__new(v0.i256) -> @layout_1 { block0: jump block1; @@ -1018,65 +817,79 @@ func private %impl_SolEncoder__new(v0.i256) -> @layout_0 { block4: v7.i256 = phi (0.i256 block2) (v6 block3); - v8.@layout_0 = call %at v7; + v8.@layout_1 = call %at v7; return v8; } -func inline(always) private %std__lib__evm__calldata__impl_CallData_8f43__new_45d4() -> @layout_4 { +func inline(always) private %impl_Cursor__new__g463e(v0.@layout_2) -> @layout_3 { block0: jump block1; block1: - v1.constref<@layout_4> = const.ref $const_region_0; - v2.objref<@layout_4> = obj.alloc @layout_4; - obj.init.const v2 v1; - v3.@layout_4 = obj.load v2; - return v3; + v4.@layout_3 = insert_value undef.@layout_3 0.i256 v0; + v6.@layout_3 = insert_value v4 1.i256 0.i256; + return v6; } -func inline(always) private %impl_Cursor__new__g463e(v0.@layout_1) -> @layout_2 { +func inline(always) private %std__lib__evm__calldata__impl_CallData_8f43__new_bdf6() -> @layout_0 { block0: jump block1; block1: - v4.@layout_2 = insert_value undef.@layout_2 0.i256 v0; - v6.@layout_2 = insert_value v4 1.i256 0.i256; - return v6; + v1.constref<@layout_0> = const.ref $const_region_0; + v2.objref<@layout_0> = obj.alloc @layout_0; + obj.init.const v2 v1; + v3.@layout_0 = obj.load v2; + return v3; } -func inline(always) private %std__lib__evm__calldata__impl_CallData_8f43__new_bdf6() -> @layout_4 { +func inline(always) private %std__lib__evm__calldata__impl_CallData_8f43__new_c043() -> @layout_0 { block0: jump block1; block1: - v1.constref<@layout_4> = const.ref $const_region_0; - v2.objref<@layout_4> = obj.alloc @layout_4; + v1.constref<@layout_0> = const.ref $const_region_0; + v2.objref<@layout_0> = obj.alloc @layout_0; obj.init.const v2 v1; - v3.@layout_4 = obj.load v2; + v3.@layout_0 = obj.load v2; return v3; } -func inline(always) private %std__lib__evm__calldata__impl_CallData_8f43__new_c043() -> @layout_4 { +func inline(always) private %impl_SolDecoder__new__g463e(v0.@layout_2) -> @layout_4 { block0: jump block1; block1: - v1.constref<@layout_4> = const.ref $const_region_0; - v2.objref<@layout_4> = obj.alloc @layout_4; - obj.init.const v2 v1; - v3.@layout_4 = obj.load v2; - return v3; + v2.@layout_3 = call %impl_Cursor__new__g463e v0; + v5.@layout_4 = insert_value undef.@layout_4 0.i256 v2; + v7.@layout_4 = insert_value v5 1.i256 0.i256; + return v7; } -func inline(always) private %impl_SolDecoder__new__g463e(v0.@layout_1) -> @layout_3 { +func private %payload_end(v0.objref<@layout_0>, v1.i256, v2.i256) -> i256 { block0: jump block1; block1: - v2.@layout_2 = call %impl_Cursor__new__g463e v0; - v5.@layout_3 = insert_value undef.@layout_3 0.i256 v2; - v7.@layout_3 = insert_value v5 1.i256 0.i256; - return v7; + (v5.i256, v6.i1) = uaddo v2 32.i256; + br v6 block2 block3; + + block2: + mstore 0.i256 35408467139433450592217433187231851964531694900788300625387963629091585785856.i256 i256; + mstore 4.i256 17.i256 i256; + evm_revert 0.i256 36.i256; + + block3: + return v5; +} + +func private %payload_end_with_input_len(v0.objref<@layout_0>, v1.i256, v2.i256, v3.i256) -> i256 { + block0: + jump block1; + + block1: + v8.i256 = call %payload_end v0 v1 v2; + return v8; } func private %core__lib__abi__trait_AbiSize__payload_size__ge513_9950(v0.i256) -> i256 { @@ -1095,18 +908,18 @@ func private %core__lib__abi__trait_AbiSize__payload_size__ge513_9950_0(v0.i256) return 32.i256; } -func private %pos__g463e(v0.objref<@layout_3>) -> i256 { +func private %pos__g463e(v0.objref<@layout_4>) -> i256 { block0: jump block1; block1: - v3.objref<@layout_2> = obj.proj v0 0.i256; + v3.objref<@layout_3> = obj.proj v0 0.i256; v5.objref = obj.proj v3 1.i256; v6.i256 = obj.load v5; return v6; } -func private %impl_trait_SolEncoder__pos(v0.objref<@layout_0>) -> i256 { +func private %impl_trait_SolEncoder__pos(v0.objref<@layout_1>) -> i256 { block0: jump block1; @@ -1116,19 +929,19 @@ func private %impl_trait_SolEncoder__pos(v0.objref<@layout_0>) -> i256 { return v4; } -func inline(always) private %std__lib__abi__sol__impl_trait_SolDecoder_68ab__read_word__g463e_66f1(v0.objref<@layout_3>) -> i256 { +func inline(always) private %std__lib__abi__sol__impl_trait_SolDecoder_68ab__read_word__g463e_66f1(v0.objref<@layout_4>) -> i256 { block0: v1.*i256 = alloca i256; jump block1; block1: - v4.objref<@layout_2> = obj.proj v0 0.i256; - v5.objref<@layout_1> = obj.proj v4 0.i256; - v6.@layout_1 = obj.load v5; - v7.objref<@layout_2> = obj.proj v0 0.i256; - v8.objref<@layout_1> = obj.proj v7 0.i256; + v4.objref<@layout_3> = obj.proj v0 0.i256; + v5.objref<@layout_2> = obj.proj v4 0.i256; + v6.@layout_2 = obj.load v5; + v7.objref<@layout_3> = obj.proj v0 0.i256; + v8.objref<@layout_2> = obj.proj v7 0.i256; v9.i256 = call %std__lib__evm__memory_input__impl_trait_MemoryBytes_c1cd__len_f8db v8; - v10.objref<@layout_2> = obj.proj v0 0.i256; + v10.objref<@layout_3> = obj.proj v0 0.i256; v12.objref = obj.proj v10 1.i256; v13.i256 = obj.load v12; (v15.i256, v16.i1) = uaddo v13 32.i256; @@ -1141,16 +954,16 @@ func inline(always) private %std__lib__abi__sol__impl_trait_SolDecoder_68ab__rea jump block4; block4: - v27.objref<@layout_2> = obj.proj v0 0.i256; - v28.objref<@layout_1> = obj.proj v27 0.i256; - v29.@layout_1 = obj.load v28; - v30.objref<@layout_2> = obj.proj v0 0.i256; + v27.objref<@layout_3> = obj.proj v0 0.i256; + v28.objref<@layout_2> = obj.proj v27 0.i256; + v29.@layout_2 = obj.load v28; + v30.objref<@layout_3> = obj.proj v0 0.i256; v31.objref = obj.proj v30 1.i256; v32.i256 = obj.load v31; - v33.objref<@layout_2> = obj.proj v0 0.i256; - v34.objref<@layout_1> = obj.proj v33 0.i256; + v33.objref<@layout_3> = obj.proj v0 0.i256; + v34.objref<@layout_2> = obj.proj v33 0.i256; v35.i256 = call %std__lib__evm__memory_input__impl_trait_MemoryBytes_c1cd__word_at_7f06 v34 v32; - v37.objref<@layout_2> = obj.proj v0 0.i256; + v37.objref<@layout_3> = obj.proj v0 0.i256; v38.objref = obj.proj v37 1.i256; obj.store v38 v15; return v35; @@ -1167,26 +980,26 @@ func inline(always) private %std__lib__abi__sol__impl_trait_SolDecoder_68ab__rea evm_revert 0.i256 36.i256; block7: - v22.objref<@layout_2> = obj.proj v0 0.i256; + v22.objref<@layout_3> = obj.proj v0 0.i256; v23.objref = obj.proj v22 1.i256; v24.i256 = obj.load v23; v25.i1 = lt v15 v24; br v25 block2 block5; } -func inline(always) private %std__lib__abi__sol__impl_trait_SolDecoder_68ab__read_word__g463e_d95a(v0.objref<@layout_3>) -> i256 { +func inline(always) private %std__lib__abi__sol__impl_trait_SolDecoder_68ab__read_word__g463e_d95a(v0.objref<@layout_4>) -> i256 { block0: v1.*i256 = alloca i256; jump block1; block1: - v4.objref<@layout_2> = obj.proj v0 0.i256; - v5.objref<@layout_1> = obj.proj v4 0.i256; - v6.@layout_1 = obj.load v5; - v7.objref<@layout_2> = obj.proj v0 0.i256; - v8.objref<@layout_1> = obj.proj v7 0.i256; + v4.objref<@layout_3> = obj.proj v0 0.i256; + v5.objref<@layout_2> = obj.proj v4 0.i256; + v6.@layout_2 = obj.load v5; + v7.objref<@layout_3> = obj.proj v0 0.i256; + v8.objref<@layout_2> = obj.proj v7 0.i256; v9.i256 = call %std__lib__evm__memory_input__impl_trait_MemoryBytes_c1cd__len_8748 v8; - v10.objref<@layout_2> = obj.proj v0 0.i256; + v10.objref<@layout_3> = obj.proj v0 0.i256; v12.objref = obj.proj v10 1.i256; v13.i256 = obj.load v12; (v15.i256, v16.i1) = uaddo v13 32.i256; @@ -1199,16 +1012,16 @@ func inline(always) private %std__lib__abi__sol__impl_trait_SolDecoder_68ab__rea jump block4; block4: - v27.objref<@layout_2> = obj.proj v0 0.i256; - v28.objref<@layout_1> = obj.proj v27 0.i256; - v29.@layout_1 = obj.load v28; - v30.objref<@layout_2> = obj.proj v0 0.i256; + v27.objref<@layout_3> = obj.proj v0 0.i256; + v28.objref<@layout_2> = obj.proj v27 0.i256; + v29.@layout_2 = obj.load v28; + v30.objref<@layout_3> = obj.proj v0 0.i256; v31.objref = obj.proj v30 1.i256; v32.i256 = obj.load v31; - v33.objref<@layout_2> = obj.proj v0 0.i256; - v34.objref<@layout_1> = obj.proj v33 0.i256; + v33.objref<@layout_3> = obj.proj v0 0.i256; + v34.objref<@layout_2> = obj.proj v33 0.i256; v35.i256 = call %std__lib__evm__memory_input__impl_trait_MemoryBytes_c1cd__word_at_38bd v34 v32; - v37.objref<@layout_2> = obj.proj v0 0.i256; + v37.objref<@layout_3> = obj.proj v0 0.i256; v38.objref = obj.proj v37 1.i256; obj.store v38 v15; return v35; @@ -1225,7 +1038,7 @@ func inline(always) private %std__lib__abi__sol__impl_trait_SolDecoder_68ab__rea evm_revert 0.i256 36.i256; block7: - v22.objref<@layout_2> = obj.proj v0 0.i256; + v22.objref<@layout_3> = obj.proj v0 0.i256; v23.objref = obj.proj v22 1.i256; v24.i256 = obj.load v23; v25.i1 = lt v15 v24; @@ -1248,15 +1061,7 @@ func private %std__lib__evm__effects__impl_trait_Evm_0098__revert_a97d(v0.i256, evm_revert v0 v1; } -func private %std__lib__evm__effects__impl_trait_Evm_0098__revert_f892(v0.i256, v1.i256) { - block0: - jump block1; - - block1: - evm_revert v0 v1; -} - -func private %impl_trait_SolEncoder__set_base(v0.objref<@layout_0>, v1.i256) { +func private %impl_trait_SolEncoder__set_base(v0.objref<@layout_1>, v1.i256) { block0: jump block1; @@ -1266,7 +1071,7 @@ func private %impl_trait_SolEncoder__set_base(v0.objref<@layout_0>, v1.i256) { return; } -func private %set_base__g463e(v0.objref<@layout_3>, v1.i256) { +func private %set_base__g463e(v0.objref<@layout_4>, v1.i256) { block0: jump block1; @@ -1276,18 +1081,18 @@ func private %set_base__g463e(v0.objref<@layout_3>, v1.i256) { return; } -func private %set_pos__g463e(v0.objref<@layout_3>, v1.i256) { +func private %set_pos__g463e(v0.objref<@layout_4>, v1.i256) { block0: jump block1; block1: - v5.objref<@layout_2> = obj.proj v0 0.i256; + v5.objref<@layout_3> = obj.proj v0 0.i256; v7.objref = obj.proj v5 1.i256; obj.store v7 v1; return; } -func private %impl_trait_SolEncoder__set_pos(v0.objref<@layout_0>, v1.i256) { +func private %impl_trait_SolEncoder__set_pos(v0.objref<@layout_1>, v1.i256) { block0: jump block1; @@ -1306,18 +1111,7 @@ func private %store_word(v0.i256, v1.i256) { return; } -func inline(always) private %std__lib__evm__calldata__impl_trait_CallData_087c__word_at_1f7f(v0.@layout_4, v1.i256) -> i256 { - block0: - jump block1; - - block1: - v4.i256 = extract_value v0 0.i256; - v6.i256 = add v4 v1; - v7.i256 = evm_calldata_load v6; - return v7; -} - -func private %std__lib__evm__memory_input__impl_trait_MemoryBytes_c1cd__word_at_38bd(v0.objref<@layout_1>, v1.i256) -> i256 { +func private %std__lib__evm__memory_input__impl_trait_MemoryBytes_c1cd__word_at_38bd(v0.objref<@layout_2>, v1.i256) -> i256 { block0: jump block1; @@ -1329,7 +1123,7 @@ func private %std__lib__evm__memory_input__impl_trait_MemoryBytes_c1cd__word_at_ return v8; } -func private %std__lib__evm__memory_input__impl_trait_MemoryBytes_c1cd__word_at_7f06(v0.objref<@layout_1>, v1.i256) -> i256 { +func inline(always) private %impl_trait_CallData__word_at(v0.objref<@layout_0>, v1.i256) -> i256 { block0: jump block1; @@ -1337,33 +1131,23 @@ func private %std__lib__evm__memory_input__impl_trait_MemoryBytes_c1cd__word_at_ v4.objref = obj.proj v0 0.i256; v5.i256 = obj.load v4; v7.i256 = add v5 v1; - v8.i256 = mload v7 i256; + v8.i256 = evm_calldata_load v7; return v8; } -func inline(always) private %std__lib__evm__calldata__impl_trait_CallData_087c__word_at_81b2(v0.@layout_4, v1.i256) -> i256 { +func private %std__lib__evm__memory_input__impl_trait_MemoryBytes_c1cd__word_at_7f06(v0.objref<@layout_2>, v1.i256) -> i256 { block0: jump block1; block1: - v4.i256 = extract_value v0 0.i256; - v6.i256 = add v4 v1; - v7.i256 = evm_calldata_load v6; - return v7; -} - -func inline(always) private %std__lib__evm__calldata__impl_trait_CallData_087c__word_at_81b2_0(v0.@layout_4, v1.i256) -> i256 { - block0: - jump block1; - - block1: - v4.i256 = extract_value v0 0.i256; - v6.i256 = add v4 v1; - v7.i256 = evm_calldata_load v6; - return v7; + v4.objref = obj.proj v0 0.i256; + v5.i256 = obj.load v4; + v7.i256 = add v5 v1; + v8.i256 = mload v7 i256; + return v8; } -func private %std__lib__abi__sol__impl_trait_SolEncoder_19ce__write_word_6213(v0.objref<@layout_0>, v1.i256) { +func private %std__lib__abi__sol__impl_trait_SolEncoder_19ce__write_word_6213(v0.objref<@layout_1>, v1.i256) { block0: jump block1; @@ -1377,7 +1161,7 @@ func private %std__lib__abi__sol__impl_trait_SolEncoder_19ce__write_word_6213(v0 return; } -func private %std__lib__abi__sol__impl_trait_SolEncoder_19ce__write_word_d116(v0.objref<@layout_0>, v1.i256) { +func private %std__lib__abi__sol__impl_trait_SolEncoder_19ce__write_word_d116(v0.objref<@layout_1>, v1.i256) { block0: jump block1; diff --git a/crates/codegen/tests/fixtures/sonatina_ir/immutable_contract_field_init_set.snap b/crates/codegen/tests/fixtures/sonatina_ir/immutable_contract_field_init_set.snap index fb0b6dc571..7cc07a880e 100644 --- a/crates/codegen/tests/fixtures/sonatina_ir/immutable_contract_field_init_set.snap +++ b/crates/codegen/tests/fixtures/sonatina_ir/immutable_contract_field_init_set.snap @@ -1,6 +1,5 @@ --- source: crates/codegen/tests/sonatina_ir.rs -assertion_line: 449 expression: output input_file: crates/codegen/tests/fixtures/immutable_contract_field_init_set.fe --- @@ -260,7 +259,8 @@ func private %contract_runtime_root_ImmutableContractFieldInitSet() { v4.i256 = evm_calldata_load 0.i256; v6.i256 = shr 224.i256 v4; v7.i32 = trunc v6 i32; - br_table v7 block3 (1.i32 block4); + v9.i1 = eq v7 1.i32; + br v9 block4 block3; block3: evm_revert 0.i256 0.i256; diff --git a/crates/codegen/tests/fixtures/sonatina_ir/init_args_with_child_dep.snap b/crates/codegen/tests/fixtures/sonatina_ir/init_args_with_child_dep.snap index 67e3562671..634f6f7f0d 100644 --- a/crates/codegen/tests/fixtures/sonatina_ir/init_args_with_child_dep.snap +++ b/crates/codegen/tests/fixtures/sonatina_ir/init_args_with_child_dep.snap @@ -259,7 +259,7 @@ func private %contract_runtime_root_Child() { v4.i256 = evm_calldata_load 0.i256; v6.i256 = shr 224.i256 v4; v7.i32 = trunc v6 i32; - br_table v7 block3; + jump block3; block3: evm_revert 0.i256 0.i256; @@ -278,7 +278,7 @@ func private %contract_runtime_root_Parent() { v4.i256 = evm_calldata_load 0.i256; v6.i256 = shr 224.i256 v4; v7.i32 = trunc v6 i32; - br_table v7 block3; + jump block3; block3: evm_revert 0.i256 0.i256; diff --git a/crates/codegen/tests/fixtures/sonatina_ir/newtype_storage_byplace_effect_arg.snap b/crates/codegen/tests/fixtures/sonatina_ir/newtype_storage_byplace_effect_arg.snap index 780d89e77c..bbb4ec4c32 100644 --- a/crates/codegen/tests/fixtures/sonatina_ir/newtype_storage_byplace_effect_arg.snap +++ b/crates/codegen/tests/fixtures/sonatina_ir/newtype_storage_byplace_effect_arg.snap @@ -192,7 +192,8 @@ func private %contract_runtime_root_NewtypeByPlaceEffectArg() { v4.i256 = evm_calldata_load 0.i256; v6.i256 = shr 224.i256 v4; v7.i32 = trunc v6 i32; - br_table v7 block3 (1.i32 block4); + v9.i1 = eq v7 1.i32; + br v9 block4 block3; block3: evm_revert 0.i256 0.i256; diff --git a/crates/codegen/tests/fixtures/sonatina_ir/newtype_storage_field_mut_method_call.snap b/crates/codegen/tests/fixtures/sonatina_ir/newtype_storage_field_mut_method_call.snap index da8cda06b0..dc1d08e6ed 100644 --- a/crates/codegen/tests/fixtures/sonatina_ir/newtype_storage_field_mut_method_call.snap +++ b/crates/codegen/tests/fixtures/sonatina_ir/newtype_storage_field_mut_method_call.snap @@ -1,6 +1,5 @@ --- source: crates/codegen/tests/sonatina_ir.rs -assertion_line: 449 expression: output input_file: crates/codegen/tests/fixtures/newtype_storage_field_mut_method_call.fe --- @@ -182,7 +181,8 @@ func private %contract_runtime_root_NewtypeStorageFieldMutMethodCall() { v4.i256 = evm_calldata_load 0.i256; v6.i256 = shr 224.i256 v4; v7.i32 = trunc v6 i32; - br_table v7 block3 (1.i32 block4); + v9.i1 = eq v7 1.i32; + br v9 block4 block3; block3: evm_revert 0.i256 0.i256; diff --git a/crates/codegen/tests/fixtures/sonatina_ir/storage_map.snap b/crates/codegen/tests/fixtures/sonatina_ir/storage_map.snap index f3321cbafb..0868272e6a 100644 --- a/crates/codegen/tests/fixtures/sonatina_ir/storage_map.snap +++ b/crates/codegen/tests/fixtures/sonatina_ir/storage_map.snap @@ -155,7 +155,8 @@ func private %contract_runtime_root_C() { v4.i256 = evm_calldata_load 0.i256; v6.i256 = shr 224.i256 v4; v7.i32 = trunc v6 i32; - br_table v7 block3 (0.i32 block4); + v9.i1 = eq v7 0.i32; + br v9 block4 block3; block3: evm_revert 0.i256 0.i256; diff --git a/crates/codegen/tests/fixtures/sonatina_ir/storage_packed_array.snap b/crates/codegen/tests/fixtures/sonatina_ir/storage_packed_array.snap index 1f7f11940c..72c6ac9041 100644 --- a/crates/codegen/tests/fixtures/sonatina_ir/storage_packed_array.snap +++ b/crates/codegen/tests/fixtures/sonatina_ir/storage_packed_array.snap @@ -161,7 +161,8 @@ func private %contract_runtime_root_C() { v4.i256 = evm_calldata_load 0.i256; v6.i256 = shr 224.i256 v4; v7.i32 = trunc v6 i32; - br_table v7 block3 (0.i32 block4); + v9.i1 = eq v7 0.i32; + br v9 block4 block3; block3: evm_revert 0.i256 0.i256; diff --git a/crates/codegen/tests/fixtures/sonatina_ir/tstor_ptr_contract.snap b/crates/codegen/tests/fixtures/sonatina_ir/tstor_ptr_contract.snap index 834d5d8fae..657fc27552 100644 --- a/crates/codegen/tests/fixtures/sonatina_ir/tstor_ptr_contract.snap +++ b/crates/codegen/tests/fixtures/sonatina_ir/tstor_ptr_contract.snap @@ -178,7 +178,8 @@ func private %contract_runtime_root_GuardContract() { v4.i256 = evm_calldata_load 0.i256; v6.i256 = shr 224.i256 v4; v7.i32 = trunc v6 i32; - br_table v7 block3 (1.i32 block4); + v9.i1 = eq v7 1.i32; + br v9 block4 block3; block3: evm_revert 0.i256 0.i256; diff --git a/crates/codegen/tests/fixtures/sonatina_ir/tuple_return_contract.snap b/crates/codegen/tests/fixtures/sonatina_ir/tuple_return_contract.snap index bf02396193..be0acd95e0 100644 --- a/crates/codegen/tests/fixtures/sonatina_ir/tuple_return_contract.snap +++ b/crates/codegen/tests/fixtures/sonatina_ir/tuple_return_contract.snap @@ -167,7 +167,8 @@ func private %contract_runtime_root_TupleReturnContract() { v4.i256 = evm_calldata_load 0.i256; v6.i256 = shr 224.i256 v4; v7.i32 = trunc v6 i32; - br_table v7 block3 (1.i32 block4); + v9.i1 = eq v7 1.i32; + br v9 block4 block3; block3: evm_revert 0.i256 0.i256; diff --git a/crates/hir/tests/runtime_builtin_func_kind.rs b/crates/hir/tests/runtime_builtin_func_kind.rs index c03417bdd1..d1ad1423be 100644 --- a/crates/hir/tests/runtime_builtin_func_kind.rs +++ b/crates/hir/tests/runtime_builtin_func_kind.rs @@ -22,6 +22,8 @@ fn classifies_core_and_std_runtime_builtins() { .expect("failed to resolve core::panic"); let keccak = resolve_lib_func_path(&db, func.scope(), "core::intrinsic::__keccak256") .expect("failed to resolve core::intrinsic::__keccak256"); + let signextend = resolve_lib_func_path(&db, func.scope(), "std::evm::ops::signextend") + .expect("failed to resolve std::evm::ops::signextend"); assert_eq!( runtime_builtin_func_kind(&db, alloc), @@ -39,4 +41,8 @@ fn classifies_core_and_std_runtime_builtins() { runtime_builtin_func_kind(&db, keccak), Some(RuntimeBuiltinFuncKind::IntrinsicKeccak256) ); + assert_eq!( + runtime_builtin_func_kind(&db, signextend), + Some(RuntimeBuiltinFuncKind::SignExtend) + ); }