From 7ff6c3eafdd4b8f4909b9e90cf3de4b1ef92bff0 Mon Sep 17 00:00:00 2001 From: xunilrj Date: Wed, 3 Apr 2024 07:34:24 +0100 Subject: [PATCH 1/8] fix and improve errors when the entry fns cannot be generated --- .../ast_node/declaration/auto_impl.rs | 102 +++++++++++------- sway-core/src/semantic_analysis/module.rs | 12 +-- sway-error/src/error.rs | 3 + 3 files changed, 71 insertions(+), 46 deletions(-) diff --git a/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl.rs b/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl.rs index 479d130f4ca..e18f6c702ab 100644 --- a/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl.rs +++ b/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl.rs @@ -10,9 +10,9 @@ use crate::{ Engines, TypeId, TypeInfo, TypeParameter, }; use itertools::Itertools; -use sway_error::handler::Handler; +use sway_error::{error::CompileError, handler::{ErrorEmitted, Handler}}; use sway_parse::Parse; -use sway_types::{integer_bits::IntegerBits, BaseIdent, ModuleId, Named, Spanned}; +use sway_types::{integer_bits::IntegerBits, BaseIdent, ModuleId, Named, Span, Spanned}; /// Contains all information needed to implement AbiEncode pub struct AutoImplAbiEncodeContext<'a, 'b> @@ -262,7 +262,7 @@ where module_id: Option, kind: FunctionDeclarationKind, code: &str, - ) -> Option { + ) -> Result { let mut ctx = crate::transform::to_parsed_lang::Context::new( crate::BuildTarget::Fuel, self.ctx.experimental, @@ -302,32 +302,24 @@ where assert!(!handler.has_warnings(), "{:?}", handler); let ctx = self.ctx.by_ref(); - let decl = TyDecl::type_check( - &handler, - ctx, - parsed::Declaration::FunctionDeclaration(decl), - ) - .unwrap(); + let decl = ctx.scoped(|ctx| { + TyDecl::type_check( + &handler, + ctx, + parsed::Declaration::FunctionDeclaration(decl), + ) + }).unwrap(); - if handler.has_errors() { - panic!( - "{:?} {} {:?}", - handler, - code, - module_id - .and_then(|x| engines.se().get_source_ids_from_module_id(x)) - .unwrap() - .iter() - .map(|x| engines.se().get_path(x)) - .collect::>() - ); - } assert!(!handler.has_warnings(), "{:?}", handler); - Some(TyAstNode { - span: decl.span(), - content: ty::TyAstNodeContent::Declaration(decl), - }) + if handler.has_errors() { + Err(handler) + } else { + Ok(TyAstNode { + span: decl.span(), + content: ty::TyAstNodeContent::Declaration(decl), + }) + } } fn parse_item_impl_to_typed_ast_node( @@ -357,7 +349,11 @@ where assert!(!handler.has_errors(), "{:?}", handler); let ctx = self.ctx.by_ref(); - let decl = TyDecl::type_check(&handler, ctx, Declaration::ImplTrait(decl)).unwrap(); + let decl = ctx.scoped(|ctx| { + TyDecl::type_check(&handler, ctx, Declaration::ImplTrait(decl)) + }).unwrap(); + + //println!("HASERROR: {code}, {}", handler.has_errors()); if handler.has_errors() { None @@ -538,7 +534,8 @@ where module_id: Option, contract_fns: &[DeclRef>], fallback_fn: Option>, - ) -> Option { + handler: &Handler, + ) -> Result { let mut code = String::new(); let mut reads = false; @@ -591,7 +588,7 @@ where }}\n")); } else { code.push_str(&format!("if method_name == \"{method_name}\" {{ - let args = decode_second_param::<{args_types}>(); + let args: {args_types} = decode_second_param::<{args_types}>(); let result_{method_name}: raw_slice = encode::<{return_type}>(__contract_entry_{method_name}({expanded_args})); __contract_ret(result_{method_name}.ptr(), result_{method_name}.len::()); }}\n")); @@ -624,19 +621,29 @@ where {fallback} }}" ); - self.parse_item_fn_to_typed_ast_node( + + let entry_fn = self.parse_item_fn_to_typed_ast_node( engines, module_id, FunctionDeclarationKind::Entry, &code, - ) + ); + + match entry_fn { + Ok(entry_fn) => Ok(entry_fn), + Err(gen_handler) => { + handler.append(gen_handler); + Err(handler.emit_err(CompileError::CouldNotGenerateEntry { span: Span::dummy() })) + }, + } } pub(crate) fn generate_predicate_entry( &mut self, engines: &Engines, decl: &TyFunctionDecl, - ) -> Option { + handler: &Handler, + ) -> Result { let module_id = decl.span.source_id().map(|sid| sid.module_id()); let args_types = itertools::intersperse( @@ -662,25 +669,34 @@ where let args_types = format!("({args_types},)"); format!( "pub fn __entry() -> bool {{ - let args = decode_predicate_data::<{args_types}>(); + let args: {args_types} = decode_predicate_data::<{args_types}>(); main({expanded_args}) }}" ) }; - self.parse_item_fn_to_typed_ast_node( + let entry_fn = self.parse_item_fn_to_typed_ast_node( engines, module_id, FunctionDeclarationKind::Entry, &code, - ) + ); + + match entry_fn { + Ok(entry_fn) => Ok(entry_fn), + Err(gen_handler) => { + handler.append(gen_handler); + Err(handler.emit_err(CompileError::CouldNotGenerateEntry { span: Span::dummy() })) + }, + } } pub(crate) fn generate_script_entry( &mut self, engines: &Engines, decl: &TyFunctionDecl, - ) -> Option { + handler: &Handler, + ) -> Result { let module_id = decl.span.source_id().map(|sid| sid.module_id()); let args_types = itertools::intersperse( @@ -718,18 +734,26 @@ where } else { format!( "pub fn __entry() -> raw_slice {{ - let args = decode_script_data::<{args_types}>(); + let args: {args_types} = decode_script_data::<{args_types}>(); let result: {return_type} = main({expanded_args}); encode::<{return_type}>(result) }}" ) }; - self.parse_item_fn_to_typed_ast_node( + let entry_fn = self.parse_item_fn_to_typed_ast_node( engines, module_id, FunctionDeclarationKind::Entry, &code, - ) + ); + + match entry_fn { + Ok(entry_fn) => Ok(entry_fn), + Err(gen_handler) => { + handler.append(gen_handler); + Err(handler.emit_err(CompileError::CouldNotGenerateEntry { span: Span::dummy() })) + }, + } } } diff --git a/sway-core/src/semantic_analysis/module.rs b/sway-core/src/semantic_analysis/module.rs index 986de04ce1d..401e773f351 100644 --- a/sway-core/src/semantic_analysis/module.rs +++ b/sway-core/src/semantic_analysis/module.rs @@ -9,7 +9,7 @@ use sway_error::{ error::CompileError, handler::{ErrorEmitted, Handler}, }; -use sway_types::{BaseIdent, Named}; +use sway_types::{BaseIdent, Named, Span}; use crate::{ decl_engine::{DeclEngineGet, DeclId}, @@ -329,16 +329,14 @@ impl ty::TyModule { let mut fn_generator = auto_impl::AutoImplAbiEncodeContext::new(&mut ctx).unwrap(); let node = fn_generator - .generate_predicate_entry(engines, main_decl.as_ref().unwrap()) - .unwrap(); + .generate_predicate_entry(engines, main_decl.as_ref().unwrap(), handler)?; all_nodes.push(node) } (TreeType::Script, true) => { let mut fn_generator = auto_impl::AutoImplAbiEncodeContext::new(&mut ctx).unwrap(); let node = fn_generator - .generate_script_entry(engines, main_decl.as_ref().unwrap()) - .unwrap(); + .generate_script_entry(engines, main_decl.as_ref().unwrap(), handler)?; all_nodes.push(node) } (TreeType::Contract, _) => { @@ -358,8 +356,8 @@ impl ty::TyModule { parsed.span.source_id().map(|x| x.module_id()), &contract_fns, fallback_fn, - ) - .unwrap(); + handler, + )?; all_nodes.push(node) } _ => {} diff --git a/sway-error/src/error.rs b/sway-error/src/error.rs index 3a6fa30b947..57d91edada1 100644 --- a/sway-error/src/error.rs +++ b/sway-error/src/error.rs @@ -866,6 +866,8 @@ pub enum CompileError { FallbackFnsAreContractOnly { span: Span }, #[error("Fallback functions cannot have parameters")] FallbackFnsCannotHaveParameters { span: Span }, + #[error("Could not generate the entry method because one of the arguments does not implement AbiEncode/AbiDecode")] + CouldNotGenerateEntry { span: Span } } impl std::convert::From for CompileError { @@ -1067,6 +1069,7 @@ impl Spanned for CompileError { ExpressionCannotBeDereferenced { span, .. } => span.clone(), FallbackFnsAreContractOnly { span } => span.clone(), FallbackFnsCannotHaveParameters { span } => span.clone(), + CouldNotGenerateEntry { span } => span.clone(), } } } From fd323b929d9403357b3321a36c919781612da241 Mon Sep 17 00:00:00 2001 From: xunilrj Date: Wed, 3 Apr 2024 13:28:49 +0100 Subject: [PATCH 2/8] inline impl for arrays --- .../ast_node/declaration/auto_impl.rs | 172 ++++++++++++------ sway-lib-core/src/codec.sw | 20 ++ 2 files changed, 134 insertions(+), 58 deletions(-) diff --git a/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl.rs b/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl.rs index e18f6c702ab..5f6e7f920a8 100644 --- a/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl.rs +++ b/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl.rs @@ -1,16 +1,15 @@ use crate::{ - asm_generation::fuel::compiler_constants::MISMATCHED_SELECTOR_REVERT_CODE, - decl_engine::{DeclEngineGet, DeclId, DeclRef}, - language::{ + asm_generation::fuel::compiler_constants::MISMATCHED_SELECTOR_REVERT_CODE, decl_engine::{DeclEngineGet, DeclId, DeclRef}, language::{ parsed::{self, AstNodeContent, Declaration, FunctionDeclarationKind}, ty::{self, TyAstNode, TyDecl, TyEnumDecl, TyFunctionDecl, TyStructDecl}, Purity, - }, - semantic_analysis::TypeCheckContext, - Engines, TypeId, TypeInfo, TypeParameter, + }, semantic_analysis::TypeCheckContext, Engines, Length, TypeArgument, TypeId, TypeInfo, TypeParameter }; use itertools::Itertools; -use sway_error::{error::CompileError, handler::{ErrorEmitted, Handler}}; +use sway_error::{ + error::CompileError, + handler::{ErrorEmitted, Handler}, +}; use sway_parse::Parse; use sway_types::{integer_bits::IntegerBits, BaseIdent, ModuleId, Named, Span, Spanned}; @@ -186,31 +185,65 @@ where fn generate_abi_decode_struct_body(&self, engines: &Engines, decl: &TyStructDecl) -> String { let mut code = String::new(); for f in decl.fields.iter() { - code.push_str(&format!( - "{field_name}: buffer.decode::<{field_type_name}>(),", - field_name = f.name.as_str(), - field_type_name = Self::generate_type(engines, f.type_argument.type_id), - )); + match &*engines.te().get(f.type_argument.type_id) { + TypeInfo::Array(t, len) => { + code.push_str(&format!( + "{field_name}: {{ {code} array }},", + field_name = f.name.as_str(), + code = Self::generate_decode_for_array(engines, t, len), + )); + } + _ => { + code.push_str(&format!( + "{field_name}: buffer.decode::<{field_type_name}>(),", + field_name = f.name.as_str(), + field_type_name = Self::generate_type(engines, f.type_argument.type_id), + )); + } + } } format!("Self {{ {code} }}") } + fn generate_encode_for_array(_engines: &Engines, _t: &TypeArgument, len: &Length) -> String { + format!("let mut i = 0; while i < {} {{ array[i].abi_encode(buffer); i += 1; }}", len.val()) + } + + fn generate_decode_for_array(engines: &Engines, t: &TypeArgument, len: &Length) -> String { + let array_type_name = Self::generate_type(engines, t.type_id); + let mut code = String::new(); + code.push_str(&format!("let first: {array_type_name} = buffer.decode::<{array_type_name}>();")); + code.push_str(&format!("let mut array = [first; {}];", len.val())); + code.push_str(&format!("let mut i = 1; while i < {} {{ array[i] = buffer.decode::<{}>(); i += 1; }}", len.val(), array_type_name)); + code + } + fn generate_abi_decode_enum_body(&self, engines: &Engines, decl: &TyEnumDecl) -> String { let enum_name = decl.call_path.suffix.as_str(); let arms = decl.variants.iter() .map(|x| { let name = x.name.as_str(); - if engines.te().get(x.type_argument.type_id).is_unit() { - format!("{} => {}::{}, \n", x.tag, enum_name, name) - } else { - let variant_type_name = Self::generate_type(engines, x.type_argument.type_id); - format!("{tag_value} => {enum_name}::{variant_name}(buffer.decode::<{variant_type}>()), \n", - tag_value = x.tag, - enum_name = enum_name, - variant_name = name, - variant_type = variant_type_name - ) + match &*engines.te().get(x.type_argument.type_id) { + // unit + TypeInfo::Tuple(fiels) if fiels.is_empty() => { + format!("{} => {}::{}, \n", x.tag, enum_name, name) + }, + TypeInfo::Array(t, len) => { + let mut code = String::new(); + code.push_str(&format!("{} => {{ \n{}\n", x.tag, Self::generate_decode_for_array(engines, t, len))); + code.push_str(&format!("{}::{}(array) }},\n", enum_name, name)); + code + } + _ => { + let variant_type_name = Self::generate_type(engines, x.type_argument.type_id); + format!("{tag_value} => {enum_name}::{variant_name}(buffer.decode::<{variant_type}>()), \n", + tag_value = x.tag, + enum_name = enum_name, + variant_name = name, + variant_type = variant_type_name + ) + } } }) .collect::(); @@ -230,25 +263,41 @@ where .iter() .map(|x| { let name = x.name.as_str(); - if engines.te().get(x.type_argument.type_id).is_unit() { - format!( - "{enum_name}::{variant_name} => {{ - {tag_value}u64.abi_encode(buffer); - }}, \n", - tag_value = x.tag, - enum_name = enum_name, - variant_name = name - ) - } else { - format!( - "{enum_name}::{variant_name}(value) => {{ - {tag_value}u64.abi_encode(buffer); - value.abi_encode(buffer); - }}, \n", - tag_value = x.tag, - enum_name = enum_name, - variant_name = name, - ) + match &*engines.te().get(x.type_argument.type_id) { + // Unit + TypeInfo::Tuple(fields) if fields.is_empty() => { + format!( + "{enum_name}::{variant_name} => {{ + {tag_value}u64.abi_encode(buffer); + }}, \n", + tag_value = x.tag, + enum_name = enum_name, + variant_name = name + ) + } + TypeInfo::Array(t, len) => { + format!( + "{enum_name}::{variant_name}(array) => {{ + {tag_value}u64.abi_encode(buffer); + {code} + }}, \n", + enum_name = enum_name, + variant_name = name, + tag_value = x.tag, + code = Self::generate_encode_for_array(engines, t, len), + ) + } + _ => { + format!( + "{enum_name}::{variant_name}(value) => {{ + {tag_value}u64.abi_encode(buffer); + value.abi_encode(buffer); + }}, \n", + tag_value = x.tag, + enum_name = enum_name, + variant_name = name, + ) + } } }) .collect::(); @@ -302,13 +351,15 @@ where assert!(!handler.has_warnings(), "{:?}", handler); let ctx = self.ctx.by_ref(); - let decl = ctx.scoped(|ctx| { - TyDecl::type_check( - &handler, - ctx, - parsed::Declaration::FunctionDeclaration(decl), - ) - }).unwrap(); + let decl = ctx + .scoped(|ctx| { + TyDecl::type_check( + &handler, + ctx, + parsed::Declaration::FunctionDeclaration(decl), + ) + }) + .unwrap(); assert!(!handler.has_warnings(), "{:?}", handler); @@ -349,11 +400,10 @@ where assert!(!handler.has_errors(), "{:?}", handler); let ctx = self.ctx.by_ref(); - let decl = ctx.scoped(|ctx| { - TyDecl::type_check(&handler, ctx, Declaration::ImplTrait(decl)) - }).unwrap(); + let decl = TyDecl::type_check(&handler, ctx, Declaration::ImplTrait(decl)).unwrap(); - //println!("HASERROR: {code}, {}", handler.has_errors()); + // Uncomment this to understand why a auto impl failed for a type. + // println!("{:#?}", handler); if handler.has_errors() { None @@ -633,8 +683,10 @@ where Ok(entry_fn) => Ok(entry_fn), Err(gen_handler) => { handler.append(gen_handler); - Err(handler.emit_err(CompileError::CouldNotGenerateEntry { span: Span::dummy() })) - }, + Err(handler.emit_err(CompileError::CouldNotGenerateEntry { + span: Span::dummy(), + })) + } } } @@ -686,8 +738,10 @@ where Ok(entry_fn) => Ok(entry_fn), Err(gen_handler) => { handler.append(gen_handler); - Err(handler.emit_err(CompileError::CouldNotGenerateEntry { span: Span::dummy() })) - }, + Err(handler.emit_err(CompileError::CouldNotGenerateEntry { + span: Span::dummy(), + })) + } } } @@ -752,8 +806,10 @@ where Ok(entry_fn) => Ok(entry_fn), Err(gen_handler) => { handler.append(gen_handler); - Err(handler.emit_err(CompileError::CouldNotGenerateEntry { span: Span::dummy() })) - }, + Err(handler.emit_err(CompileError::CouldNotGenerateEntry { + span: Span::dummy(), + })) + } } } } diff --git a/sway-lib-core/src/codec.sw b/sway-lib-core/src/codec.sw index 64fd264698f..eea2b842fb6 100644 --- a/sway-lib-core/src/codec.sw +++ b/sway-lib-core/src/codec.sw @@ -3811,6 +3811,19 @@ where } } +fn to_slice(array: T) -> raw_slice { + let len = __size_of::(); + raw_slice::from_parts::(__addr_of(array), len) +} + +fn assert_eq(a: T, b: T) +where T: Eq +{ + if a != b { + __revert(0) + } +} + #[test] fn ok_abi_encoding() { // bool @@ -3891,6 +3904,13 @@ fn ok_abi_encoding() { assert_encoding([255u8; 3], [255u8; 3]); assert_encoding([255u8; 4], [255u8; 4]); assert_encoding([255u8; 5], [255u8; 5]); + + let array = abi_decode::<[u8; 1]>(to_slice([255u8])); + assert_eq(array[0], 255u8); + + let array = abi_decode::<[u8; 2]>(to_slice([255u8, 254u8])); + assert_eq(array[0], 255u8); + assert_eq(array[1], 254u8); } pub fn contract_call( From aaac403bc643418b88b2f7891d1b9e3ded7b94fb Mon Sep 17 00:00:00 2001 From: xunilrj Date: Wed, 3 Apr 2024 14:59:28 +0100 Subject: [PATCH 3/8] array impls for ABiEncode/AbiDecode --- .../ast_node/declaration/auto_impl.rs | 74 +- .../semantic_analysis/type_check_context.rs | 29 + sway-lib-core/generate.sh | 16 + sway-lib-core/src/codec.sw | 3797 ++--------------- 4 files changed, 472 insertions(+), 3444 deletions(-) diff --git a/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl.rs b/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl.rs index 5f6e7f920a8..fe6751b39fb 100644 --- a/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl.rs +++ b/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl.rs @@ -3,7 +3,7 @@ use crate::{ parsed::{self, AstNodeContent, Declaration, FunctionDeclarationKind}, ty::{self, TyAstNode, TyDecl, TyEnumDecl, TyFunctionDecl, TyStructDecl}, Purity, - }, semantic_analysis::TypeCheckContext, Engines, Length, TypeArgument, TypeId, TypeInfo, TypeParameter + }, namespace, semantic_analysis::TypeCheckContext, Engines, Length, TypeArgument, TypeId, TypeInfo, TypeParameter }; use itertools::Itertools; use sway_error::{ @@ -185,40 +185,16 @@ where fn generate_abi_decode_struct_body(&self, engines: &Engines, decl: &TyStructDecl) -> String { let mut code = String::new(); for f in decl.fields.iter() { - match &*engines.te().get(f.type_argument.type_id) { - TypeInfo::Array(t, len) => { - code.push_str(&format!( - "{field_name}: {{ {code} array }},", - field_name = f.name.as_str(), - code = Self::generate_decode_for_array(engines, t, len), - )); - } - _ => { - code.push_str(&format!( - "{field_name}: buffer.decode::<{field_type_name}>(),", - field_name = f.name.as_str(), - field_type_name = Self::generate_type(engines, f.type_argument.type_id), - )); - } - } + code.push_str(&format!( + "{field_name}: buffer.decode::<{field_type_name}>(),", + field_name = f.name.as_str(), + field_type_name = Self::generate_type(engines, f.type_argument.type_id), + )); } format!("Self {{ {code} }}") } - fn generate_encode_for_array(_engines: &Engines, _t: &TypeArgument, len: &Length) -> String { - format!("let mut i = 0; while i < {} {{ array[i].abi_encode(buffer); i += 1; }}", len.val()) - } - - fn generate_decode_for_array(engines: &Engines, t: &TypeArgument, len: &Length) -> String { - let array_type_name = Self::generate_type(engines, t.type_id); - let mut code = String::new(); - code.push_str(&format!("let first: {array_type_name} = buffer.decode::<{array_type_name}>();")); - code.push_str(&format!("let mut array = [first; {}];", len.val())); - code.push_str(&format!("let mut i = 1; while i < {} {{ array[i] = buffer.decode::<{}>(); i += 1; }}", len.val(), array_type_name)); - code - } - fn generate_abi_decode_enum_body(&self, engines: &Engines, decl: &TyEnumDecl) -> String { let enum_name = decl.call_path.suffix.as_str(); let arms = decl.variants.iter() @@ -229,12 +205,6 @@ where TypeInfo::Tuple(fiels) if fiels.is_empty() => { format!("{} => {}::{}, \n", x.tag, enum_name, name) }, - TypeInfo::Array(t, len) => { - let mut code = String::new(); - code.push_str(&format!("{} => {{ \n{}\n", x.tag, Self::generate_decode_for_array(engines, t, len))); - code.push_str(&format!("{}::{}(array) }},\n", enum_name, name)); - code - } _ => { let variant_type_name = Self::generate_type(engines, x.type_argument.type_id); format!("{tag_value} => {enum_name}::{variant_name}(buffer.decode::<{variant_type}>()), \n", @@ -275,18 +245,6 @@ where variant_name = name ) } - TypeInfo::Array(t, len) => { - format!( - "{enum_name}::{variant_name}(array) => {{ - {tag_value}u64.abi_encode(buffer); - {code} - }}, \n", - enum_name = enum_name, - variant_name = name, - tag_value = x.tag, - code = Self::generate_encode_for_array(engines, t, len), - ) - } _ => { format!( "{enum_name}::{variant_name}(value) => {{ @@ -400,14 +358,20 @@ where assert!(!handler.has_errors(), "{:?}", handler); let ctx = self.ctx.by_ref(); - let decl = TyDecl::type_check(&handler, ctx, Declaration::ImplTrait(decl)).unwrap(); + let (decl, namespace) = ctx.scoped_and_namespace(|ctx| { + TyDecl::type_check(&handler, ctx, Declaration::ImplTrait(decl)) + }).unwrap(); - // Uncomment this to understand why a auto impl failed for a type. + // Uncomment this to understand why auto impl failed for a type. // println!("{:#?}", handler); if handler.has_errors() { None } else { + if !matches!(decl, TyDecl::ErrorRecovery(_, _)) { + *self.ctx.namespace = namespace; + } + Some(TyAstNode { span: decl.span(), content: ty::TyAstNodeContent::Declaration(decl), @@ -467,14 +431,16 @@ where let module_id = enum_decl.span().source_id().map(|sid| sid.module_id()); - let abi_decode_body = self.generate_abi_encode_enum_body(engines, &enum_decl); - let abi_decode_code = self.generate_abi_encode_code( + let abi_encode_body = self.generate_abi_encode_enum_body(engines, &enum_decl); + let abi_encode_code = self.generate_abi_encode_code( enum_decl.name(), &enum_decl.type_parameters, - abi_decode_body, + abi_encode_body, ); let abi_encode_node = - self.parse_item_impl_to_typed_ast_node(engines, module_id, &abi_decode_code); + self.parse_item_impl_to_typed_ast_node(engines, module_id, &abi_encode_code); + + let abi_decode_body = self.generate_abi_decode_enum_body(engines, &enum_decl); let abi_decode_code = self.generate_abi_decode_code( diff --git a/sway-core/src/semantic_analysis/type_check_context.rs b/sway-core/src/semantic_analysis/type_check_context.rs index 9e81b565120..11084cf3458 100644 --- a/sway-core/src/semantic_analysis/type_check_context.rs +++ b/sway-core/src/semantic_analysis/type_check_context.rs @@ -232,6 +232,35 @@ impl<'a> TypeCheckContext<'a> { }; with_scoped_ctx(ctx) } + + /// Scope the `TypeCheckContext` with a new namespace but update the original if success. + pub fn scoped_and_namespace( + self, + with_scoped_ctx: impl FnOnce(TypeCheckContext) -> Result, + ) -> Result<(T, Namespace), ErrorEmitted> { + let mut namespace = self.namespace.clone(); + let ctx = TypeCheckContext { + namespace: &mut namespace, + type_annotation: self.type_annotation, + function_type_annotation: self.function_type_annotation, + unify_generic: self.unify_generic, + self_type: self.self_type, + type_subst: self.type_subst, + abi_mode: self.abi_mode, + const_shadowing_mode: self.const_shadowing_mode, + generic_shadowing_mode: self.generic_shadowing_mode, + help_text: self.help_text, + purity: self.purity, + kind: self.kind, + engines: self.engines, + disallow_functions: self.disallow_functions, + defer_monomorphization: self.defer_monomorphization, + storage_declaration: self.storage_declaration, + experimental: self.experimental, + }; + let r = with_scoped_ctx(ctx)?; + Ok((r, namespace)) + } /// Enter the submodule with the given name and produce a type-check context ready for /// type-checking its content. diff --git a/sway-lib-core/generate.sh b/sway-lib-core/generate.sh index 6a66a8482a4..3ed838d9988 100755 --- a/sway-lib-core/generate.sh +++ b/sway-lib-core/generate.sh @@ -9,6 +9,22 @@ remove_generated_code() { sed -i "$((START+1)),$((END-1))d" ./src/codec.sw } +remove_generated_code "ARRAY_ENCODE" +START=1 +END=64 +for ((i=END;i>=START;i--)); do + CODE="impl AbiEncode for [T; $i] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < $i { self[i].abi_encode(buffer); i += 1; } } }" + sed -i "s/\/\/ BEGIN ARRAY_ENCODE/\/\/ BEGIN ARRAY_ENCODE\n$CODE/g" ./src/codec.sw +done + +remove_generated_code "ARRAY_DECODE" +START=1 +END=64 +for ((i=END;i>=START;i--)); do + CODE="impl AbiDecode for [T; $i] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; $i] { let first: T = buffer.decode::(); let mut array = [first; $i]; let mut i = 1; while i < $i { array[i] = buffer.decode::(); i += 1; }; array } }" + sed -i "s/\/\/ BEGIN ARRAY_DECODE/\/\/ BEGIN ARRAY_DECODE\n$CODE/g" ./src/codec.sw +done + remove_generated_code "STRARRAY_ENCODE" START=1 END=64 diff --git a/sway-lib-core/src/codec.sw b/sway-lib-core/src/codec.sw index eea2b842fb6..f53365a3a65 100644 --- a/sway-lib-core/src/codec.sw +++ b/sway-lib-core/src/codec.sw @@ -306,3435 +306,452 @@ impl AbiEncode for str[0] { } // BEGIN STRARRAY_ENCODE -impl AbiEncode for str[1] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[2] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[3] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[4] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[5] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[6] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[7] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[8] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[9] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[10] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[11] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[12] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[13] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[14] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[15] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[16] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[17] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[18] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[19] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[20] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[21] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[22] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[23] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[24] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[25] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[26] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[27] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[28] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[29] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[30] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[31] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[32] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[33] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[34] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[35] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[36] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[37] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[38] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[39] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[40] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[41] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[42] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[43] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[44] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[45] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[46] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[47] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[48] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[49] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[50] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[51] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[52] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[53] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[54] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[55] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[56] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[57] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[58] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[59] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[60] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[61] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[62] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[63] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -impl AbiEncode for str[64] { - fn abi_encode(self, ref mut buffer: Buffer) { - use ::str::*; - let s = from_str_array(self); - let len = s.len(); - let ptr = s.as_ptr(); - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} -// END STRARRAY_ENCODE - -// Encode Arrays and Slices - -impl AbiEncode for raw_slice { - fn abi_encode(self, ref mut buffer: Buffer) { - let len = self.number_of_bytes(); - buffer.push_u64(len); - - let ptr = self.ptr(); - - let mut i = 0; - while i < len { - let byte = ptr.add::(i).read::(); - buffer.push_byte(byte); - i += 1; - } - } -} - -impl AbiEncode for [T; 0] -where - T: AbiEncode, -{ - fn abi_encode(self, ref mut _buffer: Buffer) {} -} - -impl AbiEncode for [T; 1] -where - T: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self[0].abi_encode(buffer); - } -} - -impl AbiEncode for [T; 2] -where - T: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self[0].abi_encode(buffer); - self[1].abi_encode(buffer); - } -} - -impl AbiEncode for [T; 3] -where - T: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self[0].abi_encode(buffer); - self[1].abi_encode(buffer); - self[2].abi_encode(buffer); - } -} - -impl AbiEncode for [T; 4] -where - T: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self[0].abi_encode(buffer); - self[1].abi_encode(buffer); - self[2].abi_encode(buffer); - self[3].abi_encode(buffer); - } -} - -impl AbiEncode for [T; 5] -where - T: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self[0].abi_encode(buffer); - self[1].abi_encode(buffer); - self[2].abi_encode(buffer); - self[3].abi_encode(buffer); - self[4].abi_encode(buffer); - } -} - -impl AbiEncode for [T; 9] -where - T: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self[0].abi_encode(buffer); - self[1].abi_encode(buffer); - self[2].abi_encode(buffer); - self[3].abi_encode(buffer); - self[4].abi_encode(buffer); - self[5].abi_encode(buffer); - self[6].abi_encode(buffer); - self[7].abi_encode(buffer); - self[8].abi_encode(buffer); - } -} - -// Encode Tuples - - -impl AbiEncode for () { - fn abi_encode(self, ref mut _buffer: Buffer) {} -} - -// BEGIN TUPLES_ENCODE -impl AbiEncode for (A, ) -where - A: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - } -} -impl AbiEncode for (A, B) -where - A: AbiEncode, - B: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D, E) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, - E: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - self.4.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D, E, F) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, - E: AbiEncode, - F: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - self.4.abi_encode(buffer); - self.5.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D, E, F, G) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, - E: AbiEncode, - F: AbiEncode, - G: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - self.4.abi_encode(buffer); - self.5.abi_encode(buffer); - self.6.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D, E, F, G, H) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, - E: AbiEncode, - F: AbiEncode, - G: AbiEncode, - H: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - self.4.abi_encode(buffer); - self.5.abi_encode(buffer); - self.6.abi_encode(buffer); - self.7.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D, E, F, G, H, I) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, - E: AbiEncode, - F: AbiEncode, - G: AbiEncode, - H: AbiEncode, - I: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - self.4.abi_encode(buffer); - self.5.abi_encode(buffer); - self.6.abi_encode(buffer); - self.7.abi_encode(buffer); - self.8.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D, E, F, G, H, I, J) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, - E: AbiEncode, - F: AbiEncode, - G: AbiEncode, - H: AbiEncode, - I: AbiEncode, - J: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - self.4.abi_encode(buffer); - self.5.abi_encode(buffer); - self.6.abi_encode(buffer); - self.7.abi_encode(buffer); - self.8.abi_encode(buffer); - self.9.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, - E: AbiEncode, - F: AbiEncode, - G: AbiEncode, - H: AbiEncode, - I: AbiEncode, - J: AbiEncode, - K: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - self.4.abi_encode(buffer); - self.5.abi_encode(buffer); - self.6.abi_encode(buffer); - self.7.abi_encode(buffer); - self.8.abi_encode(buffer); - self.9.abi_encode(buffer); - self.10.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, - E: AbiEncode, - F: AbiEncode, - G: AbiEncode, - H: AbiEncode, - I: AbiEncode, - J: AbiEncode, - K: AbiEncode, - L: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - self.4.abi_encode(buffer); - self.5.abi_encode(buffer); - self.6.abi_encode(buffer); - self.7.abi_encode(buffer); - self.8.abi_encode(buffer); - self.9.abi_encode(buffer); - self.10.abi_encode(buffer); - self.11.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, - E: AbiEncode, - F: AbiEncode, - G: AbiEncode, - H: AbiEncode, - I: AbiEncode, - J: AbiEncode, - K: AbiEncode, - L: AbiEncode, - M: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - self.4.abi_encode(buffer); - self.5.abi_encode(buffer); - self.6.abi_encode(buffer); - self.7.abi_encode(buffer); - self.8.abi_encode(buffer); - self.9.abi_encode(buffer); - self.10.abi_encode(buffer); - self.11.abi_encode(buffer); - self.12.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, - E: AbiEncode, - F: AbiEncode, - G: AbiEncode, - H: AbiEncode, - I: AbiEncode, - J: AbiEncode, - K: AbiEncode, - L: AbiEncode, - M: AbiEncode, - N: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - self.4.abi_encode(buffer); - self.5.abi_encode(buffer); - self.6.abi_encode(buffer); - self.7.abi_encode(buffer); - self.8.abi_encode(buffer); - self.9.abi_encode(buffer); - self.10.abi_encode(buffer); - self.11.abi_encode(buffer); - self.12.abi_encode(buffer); - self.13.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, - E: AbiEncode, - F: AbiEncode, - G: AbiEncode, - H: AbiEncode, - I: AbiEncode, - J: AbiEncode, - K: AbiEncode, - L: AbiEncode, - M: AbiEncode, - N: AbiEncode, - O: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - self.4.abi_encode(buffer); - self.5.abi_encode(buffer); - self.6.abi_encode(buffer); - self.7.abi_encode(buffer); - self.8.abi_encode(buffer); - self.9.abi_encode(buffer); - self.10.abi_encode(buffer); - self.11.abi_encode(buffer); - self.12.abi_encode(buffer); - self.13.abi_encode(buffer); - self.14.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, - E: AbiEncode, - F: AbiEncode, - G: AbiEncode, - H: AbiEncode, - I: AbiEncode, - J: AbiEncode, - K: AbiEncode, - L: AbiEncode, - M: AbiEncode, - N: AbiEncode, - O: AbiEncode, - P: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - self.4.abi_encode(buffer); - self.5.abi_encode(buffer); - self.6.abi_encode(buffer); - self.7.abi_encode(buffer); - self.8.abi_encode(buffer); - self.9.abi_encode(buffer); - self.10.abi_encode(buffer); - self.11.abi_encode(buffer); - self.12.abi_encode(buffer); - self.13.abi_encode(buffer); - self.14.abi_encode(buffer); - self.15.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, - E: AbiEncode, - F: AbiEncode, - G: AbiEncode, - H: AbiEncode, - I: AbiEncode, - J: AbiEncode, - K: AbiEncode, - L: AbiEncode, - M: AbiEncode, - N: AbiEncode, - O: AbiEncode, - P: AbiEncode, - Q: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - self.4.abi_encode(buffer); - self.5.abi_encode(buffer); - self.6.abi_encode(buffer); - self.7.abi_encode(buffer); - self.8.abi_encode(buffer); - self.9.abi_encode(buffer); - self.10.abi_encode(buffer); - self.11.abi_encode(buffer); - self.12.abi_encode(buffer); - self.13.abi_encode(buffer); - self.14.abi_encode(buffer); - self.15.abi_encode(buffer); - self.16.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, - E: AbiEncode, - F: AbiEncode, - G: AbiEncode, - H: AbiEncode, - I: AbiEncode, - J: AbiEncode, - K: AbiEncode, - L: AbiEncode, - M: AbiEncode, - N: AbiEncode, - O: AbiEncode, - P: AbiEncode, - Q: AbiEncode, - R: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - self.4.abi_encode(buffer); - self.5.abi_encode(buffer); - self.6.abi_encode(buffer); - self.7.abi_encode(buffer); - self.8.abi_encode(buffer); - self.9.abi_encode(buffer); - self.10.abi_encode(buffer); - self.11.abi_encode(buffer); - self.12.abi_encode(buffer); - self.13.abi_encode(buffer); - self.14.abi_encode(buffer); - self.15.abi_encode(buffer); - self.16.abi_encode(buffer); - self.17.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, - E: AbiEncode, - F: AbiEncode, - G: AbiEncode, - H: AbiEncode, - I: AbiEncode, - J: AbiEncode, - K: AbiEncode, - L: AbiEncode, - M: AbiEncode, - N: AbiEncode, - O: AbiEncode, - P: AbiEncode, - Q: AbiEncode, - R: AbiEncode, - S: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - self.4.abi_encode(buffer); - self.5.abi_encode(buffer); - self.6.abi_encode(buffer); - self.7.abi_encode(buffer); - self.8.abi_encode(buffer); - self.9.abi_encode(buffer); - self.10.abi_encode(buffer); - self.11.abi_encode(buffer); - self.12.abi_encode(buffer); - self.13.abi_encode(buffer); - self.14.abi_encode(buffer); - self.15.abi_encode(buffer); - self.16.abi_encode(buffer); - self.17.abi_encode(buffer); - self.18.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, - E: AbiEncode, - F: AbiEncode, - G: AbiEncode, - H: AbiEncode, - I: AbiEncode, - J: AbiEncode, - K: AbiEncode, - L: AbiEncode, - M: AbiEncode, - N: AbiEncode, - O: AbiEncode, - P: AbiEncode, - Q: AbiEncode, - R: AbiEncode, - S: AbiEncode, - T: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - self.4.abi_encode(buffer); - self.5.abi_encode(buffer); - self.6.abi_encode(buffer); - self.7.abi_encode(buffer); - self.8.abi_encode(buffer); - self.9.abi_encode(buffer); - self.10.abi_encode(buffer); - self.11.abi_encode(buffer); - self.12.abi_encode(buffer); - self.13.abi_encode(buffer); - self.14.abi_encode(buffer); - self.15.abi_encode(buffer); - self.16.abi_encode(buffer); - self.17.abi_encode(buffer); - self.18.abi_encode(buffer); - self.19.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, - E: AbiEncode, - F: AbiEncode, - G: AbiEncode, - H: AbiEncode, - I: AbiEncode, - J: AbiEncode, - K: AbiEncode, - L: AbiEncode, - M: AbiEncode, - N: AbiEncode, - O: AbiEncode, - P: AbiEncode, - Q: AbiEncode, - R: AbiEncode, - S: AbiEncode, - T: AbiEncode, - U: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - self.4.abi_encode(buffer); - self.5.abi_encode(buffer); - self.6.abi_encode(buffer); - self.7.abi_encode(buffer); - self.8.abi_encode(buffer); - self.9.abi_encode(buffer); - self.10.abi_encode(buffer); - self.11.abi_encode(buffer); - self.12.abi_encode(buffer); - self.13.abi_encode(buffer); - self.14.abi_encode(buffer); - self.15.abi_encode(buffer); - self.16.abi_encode(buffer); - self.17.abi_encode(buffer); - self.18.abi_encode(buffer); - self.19.abi_encode(buffer); - self.20.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, - E: AbiEncode, - F: AbiEncode, - G: AbiEncode, - H: AbiEncode, - I: AbiEncode, - J: AbiEncode, - K: AbiEncode, - L: AbiEncode, - M: AbiEncode, - N: AbiEncode, - O: AbiEncode, - P: AbiEncode, - Q: AbiEncode, - R: AbiEncode, - S: AbiEncode, - T: AbiEncode, - U: AbiEncode, - V: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - self.4.abi_encode(buffer); - self.5.abi_encode(buffer); - self.6.abi_encode(buffer); - self.7.abi_encode(buffer); - self.8.abi_encode(buffer); - self.9.abi_encode(buffer); - self.10.abi_encode(buffer); - self.11.abi_encode(buffer); - self.12.abi_encode(buffer); - self.13.abi_encode(buffer); - self.14.abi_encode(buffer); - self.15.abi_encode(buffer); - self.16.abi_encode(buffer); - self.17.abi_encode(buffer); - self.18.abi_encode(buffer); - self.19.abi_encode(buffer); - self.20.abi_encode(buffer); - self.21.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, - E: AbiEncode, - F: AbiEncode, - G: AbiEncode, - H: AbiEncode, - I: AbiEncode, - J: AbiEncode, - K: AbiEncode, - L: AbiEncode, - M: AbiEncode, - N: AbiEncode, - O: AbiEncode, - P: AbiEncode, - Q: AbiEncode, - R: AbiEncode, - S: AbiEncode, - T: AbiEncode, - U: AbiEncode, - V: AbiEncode, - W: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - self.4.abi_encode(buffer); - self.5.abi_encode(buffer); - self.6.abi_encode(buffer); - self.7.abi_encode(buffer); - self.8.abi_encode(buffer); - self.9.abi_encode(buffer); - self.10.abi_encode(buffer); - self.11.abi_encode(buffer); - self.12.abi_encode(buffer); - self.13.abi_encode(buffer); - self.14.abi_encode(buffer); - self.15.abi_encode(buffer); - self.16.abi_encode(buffer); - self.17.abi_encode(buffer); - self.18.abi_encode(buffer); - self.19.abi_encode(buffer); - self.20.abi_encode(buffer); - self.21.abi_encode(buffer); - self.22.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, - E: AbiEncode, - F: AbiEncode, - G: AbiEncode, - H: AbiEncode, - I: AbiEncode, - J: AbiEncode, - K: AbiEncode, - L: AbiEncode, - M: AbiEncode, - N: AbiEncode, - O: AbiEncode, - P: AbiEncode, - Q: AbiEncode, - R: AbiEncode, - S: AbiEncode, - T: AbiEncode, - U: AbiEncode, - V: AbiEncode, - W: AbiEncode, - X: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - self.4.abi_encode(buffer); - self.5.abi_encode(buffer); - self.6.abi_encode(buffer); - self.7.abi_encode(buffer); - self.8.abi_encode(buffer); - self.9.abi_encode(buffer); - self.10.abi_encode(buffer); - self.11.abi_encode(buffer); - self.12.abi_encode(buffer); - self.13.abi_encode(buffer); - self.14.abi_encode(buffer); - self.15.abi_encode(buffer); - self.16.abi_encode(buffer); - self.17.abi_encode(buffer); - self.18.abi_encode(buffer); - self.19.abi_encode(buffer); - self.20.abi_encode(buffer); - self.21.abi_encode(buffer); - self.22.abi_encode(buffer); - self.23.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, - E: AbiEncode, - F: AbiEncode, - G: AbiEncode, - H: AbiEncode, - I: AbiEncode, - J: AbiEncode, - K: AbiEncode, - L: AbiEncode, - M: AbiEncode, - N: AbiEncode, - O: AbiEncode, - P: AbiEncode, - Q: AbiEncode, - R: AbiEncode, - S: AbiEncode, - T: AbiEncode, - U: AbiEncode, - V: AbiEncode, - W: AbiEncode, - X: AbiEncode, - Y: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - self.4.abi_encode(buffer); - self.5.abi_encode(buffer); - self.6.abi_encode(buffer); - self.7.abi_encode(buffer); - self.8.abi_encode(buffer); - self.9.abi_encode(buffer); - self.10.abi_encode(buffer); - self.11.abi_encode(buffer); - self.12.abi_encode(buffer); - self.13.abi_encode(buffer); - self.14.abi_encode(buffer); - self.15.abi_encode(buffer); - self.16.abi_encode(buffer); - self.17.abi_encode(buffer); - self.18.abi_encode(buffer); - self.19.abi_encode(buffer); - self.20.abi_encode(buffer); - self.21.abi_encode(buffer); - self.22.abi_encode(buffer); - self.23.abi_encode(buffer); - self.24.abi_encode(buffer); - } -} -impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z) -where - A: AbiEncode, - B: AbiEncode, - C: AbiEncode, - D: AbiEncode, - E: AbiEncode, - F: AbiEncode, - G: AbiEncode, - H: AbiEncode, - I: AbiEncode, - J: AbiEncode, - K: AbiEncode, - L: AbiEncode, - M: AbiEncode, - N: AbiEncode, - O: AbiEncode, - P: AbiEncode, - Q: AbiEncode, - R: AbiEncode, - S: AbiEncode, - T: AbiEncode, - U: AbiEncode, - V: AbiEncode, - W: AbiEncode, - X: AbiEncode, - Y: AbiEncode, - Z: AbiEncode, -{ - fn abi_encode(self, ref mut buffer: Buffer) { - self.0.abi_encode(buffer); - self.1.abi_encode(buffer); - self.2.abi_encode(buffer); - self.3.abi_encode(buffer); - self.4.abi_encode(buffer); - self.5.abi_encode(buffer); - self.6.abi_encode(buffer); - self.7.abi_encode(buffer); - self.8.abi_encode(buffer); - self.9.abi_encode(buffer); - self.10.abi_encode(buffer); - self.11.abi_encode(buffer); - self.12.abi_encode(buffer); - self.13.abi_encode(buffer); - self.14.abi_encode(buffer); - self.15.abi_encode(buffer); - self.16.abi_encode(buffer); - self.17.abi_encode(buffer); - self.18.abi_encode(buffer); - self.19.abi_encode(buffer); - self.20.abi_encode(buffer); - self.21.abi_encode(buffer); - self.22.abi_encode(buffer); - self.23.abi_encode(buffer); - self.24.abi_encode(buffer); - self.25.abi_encode(buffer); - } -} -// END TUPLES_ENCODE - -pub fn encode(item: T) -> raw_slice -where - T: AbiEncode, -{ - let mut buffer = Buffer::new(); - item.abi_encode(buffer); - buffer.as_raw_slice() -} - -pub fn abi_decode(data: raw_slice) -> T -where - T: AbiDecode, -{ - let mut buffer = BufferReader::from_parts(data.ptr(), data.len::()); - T::abi_decode(buffer) -} - -// Decode - -pub trait AbiDecode { - fn abi_decode(ref mut buffer: BufferReader) -> Self; -} - -impl AbiDecode for b256 { - fn abi_decode(ref mut buffer: BufferReader) -> b256 { - buffer.read::() - } -} - -impl AbiDecode for u256 { - fn abi_decode(ref mut buffer: BufferReader) -> u256 { - buffer.read::() - } -} - -impl AbiDecode for u64 { - fn abi_decode(ref mut buffer: BufferReader) -> u64 { - buffer.read::() - } -} - -impl AbiDecode for u32 { - fn abi_decode(ref mut buffer: BufferReader) -> u32 { - use ::primitive_conversions::*; - let a = buffer.read::().as_u32(); - let b = buffer.read::().as_u32(); - let c = buffer.read::().as_u32(); - let d = buffer.read::().as_u32(); - (a << 24) | (b << 16) | (c << 8) | d - } -} - -impl AbiDecode for u16 { - fn abi_decode(ref mut buffer: BufferReader) -> u16 { - use ::primitive_conversions::*; - let a = buffer.read::().as_u16(); - let b = buffer.read::().as_u16(); - (a << 8) | b - } -} - -impl AbiDecode for u8 { - fn abi_decode(ref mut buffer: BufferReader) -> u8 { - buffer.read::() - } -} - -impl AbiDecode for bool { - fn abi_decode(ref mut buffer: BufferReader) -> bool { - buffer.read::() - } -} - -impl AbiDecode for raw_slice { - fn abi_decode(ref mut buffer: BufferReader) -> raw_slice { - let len = u64::abi_decode(buffer); - let data = buffer.read_bytes(len); - asm(s: (data.ptr(), len)) { - s: raw_slice - } - } -} - -impl AbiDecode for str { - fn abi_decode(ref mut buffer: BufferReader) -> str { - let len = u64::abi_decode(buffer); - let data = buffer.read_bytes(len); - asm(s: (data.ptr(), len)) { - s: str - } - } -} - -// BEGIN STRARRAY_DECODE -impl AbiDecode for str[1] { - fn abi_decode(ref mut buffer: BufferReader) -> str[1] { - let data = buffer.read_bytes(1); - asm(s: data.ptr()) { - s: str[1] - } - } -} -impl AbiDecode for str[2] { - fn abi_decode(ref mut buffer: BufferReader) -> str[2] { - let data = buffer.read_bytes(2); - asm(s: data.ptr()) { - s: str[2] - } - } -} -impl AbiDecode for str[3] { - fn abi_decode(ref mut buffer: BufferReader) -> str[3] { - let data = buffer.read_bytes(3); - asm(s: data.ptr()) { - s: str[3] - } - } -} -impl AbiDecode for str[4] { - fn abi_decode(ref mut buffer: BufferReader) -> str[4] { - let data = buffer.read_bytes(4); - asm(s: data.ptr()) { - s: str[4] - } - } -} -impl AbiDecode for str[5] { - fn abi_decode(ref mut buffer: BufferReader) -> str[5] { - let data = buffer.read_bytes(5); - asm(s: data.ptr()) { - s: str[5] - } - } -} -impl AbiDecode for str[6] { - fn abi_decode(ref mut buffer: BufferReader) -> str[6] { - let data = buffer.read_bytes(6); - asm(s: data.ptr()) { - s: str[6] - } - } -} -impl AbiDecode for str[7] { - fn abi_decode(ref mut buffer: BufferReader) -> str[7] { - let data = buffer.read_bytes(7); - asm(s: data.ptr()) { - s: str[7] - } - } -} -impl AbiDecode for str[8] { - fn abi_decode(ref mut buffer: BufferReader) -> str[8] { - let data = buffer.read_bytes(8); - asm(s: data.ptr()) { - s: str[8] - } - } -} -impl AbiDecode for str[9] { - fn abi_decode(ref mut buffer: BufferReader) -> str[9] { - let data = buffer.read_bytes(9); - asm(s: data.ptr()) { - s: str[9] - } - } -} -impl AbiDecode for str[10] { - fn abi_decode(ref mut buffer: BufferReader) -> str[10] { - let data = buffer.read_bytes(10); - asm(s: data.ptr()) { - s: str[10] - } - } -} -impl AbiDecode for str[11] { - fn abi_decode(ref mut buffer: BufferReader) -> str[11] { - let data = buffer.read_bytes(11); - asm(s: data.ptr()) { - s: str[11] - } - } -} -impl AbiDecode for str[12] { - fn abi_decode(ref mut buffer: BufferReader) -> str[12] { - let data = buffer.read_bytes(12); - asm(s: data.ptr()) { - s: str[12] - } - } -} -impl AbiDecode for str[13] { - fn abi_decode(ref mut buffer: BufferReader) -> str[13] { - let data = buffer.read_bytes(13); - asm(s: data.ptr()) { - s: str[13] - } - } -} -impl AbiDecode for str[14] { - fn abi_decode(ref mut buffer: BufferReader) -> str[14] { - let data = buffer.read_bytes(14); - asm(s: data.ptr()) { - s: str[14] - } - } -} -impl AbiDecode for str[15] { - fn abi_decode(ref mut buffer: BufferReader) -> str[15] { - let data = buffer.read_bytes(15); - asm(s: data.ptr()) { - s: str[15] - } - } -} -impl AbiDecode for str[16] { - fn abi_decode(ref mut buffer: BufferReader) -> str[16] { - let data = buffer.read_bytes(16); - asm(s: data.ptr()) { - s: str[16] - } - } -} -impl AbiDecode for str[17] { - fn abi_decode(ref mut buffer: BufferReader) -> str[17] { - let data = buffer.read_bytes(17); - asm(s: data.ptr()) { - s: str[17] - } - } -} -impl AbiDecode for str[18] { - fn abi_decode(ref mut buffer: BufferReader) -> str[18] { - let data = buffer.read_bytes(18); - asm(s: data.ptr()) { - s: str[18] - } - } -} -impl AbiDecode for str[19] { - fn abi_decode(ref mut buffer: BufferReader) -> str[19] { - let data = buffer.read_bytes(19); - asm(s: data.ptr()) { - s: str[19] - } - } -} -impl AbiDecode for str[20] { - fn abi_decode(ref mut buffer: BufferReader) -> str[20] { - let data = buffer.read_bytes(20); - asm(s: data.ptr()) { - s: str[20] - } - } -} -impl AbiDecode for str[21] { - fn abi_decode(ref mut buffer: BufferReader) -> str[21] { - let data = buffer.read_bytes(21); - asm(s: data.ptr()) { - s: str[21] - } - } -} -impl AbiDecode for str[22] { - fn abi_decode(ref mut buffer: BufferReader) -> str[22] { - let data = buffer.read_bytes(22); - asm(s: data.ptr()) { - s: str[22] - } - } -} -impl AbiDecode for str[23] { - fn abi_decode(ref mut buffer: BufferReader) -> str[23] { - let data = buffer.read_bytes(23); - asm(s: data.ptr()) { - s: str[23] - } - } -} -impl AbiDecode for str[24] { - fn abi_decode(ref mut buffer: BufferReader) -> str[24] { - let data = buffer.read_bytes(24); - asm(s: data.ptr()) { - s: str[24] - } - } -} -impl AbiDecode for str[25] { - fn abi_decode(ref mut buffer: BufferReader) -> str[25] { - let data = buffer.read_bytes(25); - asm(s: data.ptr()) { - s: str[25] - } - } -} -impl AbiDecode for str[26] { - fn abi_decode(ref mut buffer: BufferReader) -> str[26] { - let data = buffer.read_bytes(26); - asm(s: data.ptr()) { - s: str[26] - } - } -} -impl AbiDecode for str[27] { - fn abi_decode(ref mut buffer: BufferReader) -> str[27] { - let data = buffer.read_bytes(27); - asm(s: data.ptr()) { - s: str[27] - } - } -} -impl AbiDecode for str[28] { - fn abi_decode(ref mut buffer: BufferReader) -> str[28] { - let data = buffer.read_bytes(28); - asm(s: data.ptr()) { - s: str[28] - } - } -} -impl AbiDecode for str[29] { - fn abi_decode(ref mut buffer: BufferReader) -> str[29] { - let data = buffer.read_bytes(29); - asm(s: data.ptr()) { - s: str[29] - } - } -} -impl AbiDecode for str[30] { - fn abi_decode(ref mut buffer: BufferReader) -> str[30] { - let data = buffer.read_bytes(30); - asm(s: data.ptr()) { - s: str[30] - } - } -} -impl AbiDecode for str[31] { - fn abi_decode(ref mut buffer: BufferReader) -> str[31] { - let data = buffer.read_bytes(31); - asm(s: data.ptr()) { - s: str[31] - } - } -} -impl AbiDecode for str[32] { - fn abi_decode(ref mut buffer: BufferReader) -> str[32] { - let data = buffer.read_bytes(32); - asm(s: data.ptr()) { - s: str[32] - } - } -} -impl AbiDecode for str[33] { - fn abi_decode(ref mut buffer: BufferReader) -> str[33] { - let data = buffer.read_bytes(33); - asm(s: data.ptr()) { - s: str[33] - } - } -} -impl AbiDecode for str[34] { - fn abi_decode(ref mut buffer: BufferReader) -> str[34] { - let data = buffer.read_bytes(34); - asm(s: data.ptr()) { - s: str[34] - } - } -} -impl AbiDecode for str[35] { - fn abi_decode(ref mut buffer: BufferReader) -> str[35] { - let data = buffer.read_bytes(35); - asm(s: data.ptr()) { - s: str[35] - } - } -} -impl AbiDecode for str[36] { - fn abi_decode(ref mut buffer: BufferReader) -> str[36] { - let data = buffer.read_bytes(36); - asm(s: data.ptr()) { - s: str[36] - } - } -} -impl AbiDecode for str[37] { - fn abi_decode(ref mut buffer: BufferReader) -> str[37] { - let data = buffer.read_bytes(37); - asm(s: data.ptr()) { - s: str[37] - } - } -} -impl AbiDecode for str[38] { - fn abi_decode(ref mut buffer: BufferReader) -> str[38] { - let data = buffer.read_bytes(38); - asm(s: data.ptr()) { - s: str[38] - } - } -} -impl AbiDecode for str[39] { - fn abi_decode(ref mut buffer: BufferReader) -> str[39] { - let data = buffer.read_bytes(39); - asm(s: data.ptr()) { - s: str[39] - } - } -} -impl AbiDecode for str[40] { - fn abi_decode(ref mut buffer: BufferReader) -> str[40] { - let data = buffer.read_bytes(40); - asm(s: data.ptr()) { - s: str[40] - } - } -} -impl AbiDecode for str[41] { - fn abi_decode(ref mut buffer: BufferReader) -> str[41] { - let data = buffer.read_bytes(41); - asm(s: data.ptr()) { - s: str[41] - } - } -} -impl AbiDecode for str[42] { - fn abi_decode(ref mut buffer: BufferReader) -> str[42] { - let data = buffer.read_bytes(42); - asm(s: data.ptr()) { - s: str[42] - } - } -} -impl AbiDecode for str[43] { - fn abi_decode(ref mut buffer: BufferReader) -> str[43] { - let data = buffer.read_bytes(43); - asm(s: data.ptr()) { - s: str[43] - } - } -} -impl AbiDecode for str[44] { - fn abi_decode(ref mut buffer: BufferReader) -> str[44] { - let data = buffer.read_bytes(44); - asm(s: data.ptr()) { - s: str[44] - } - } -} -impl AbiDecode for str[45] { - fn abi_decode(ref mut buffer: BufferReader) -> str[45] { - let data = buffer.read_bytes(45); - asm(s: data.ptr()) { - s: str[45] - } - } -} -impl AbiDecode for str[46] { - fn abi_decode(ref mut buffer: BufferReader) -> str[46] { - let data = buffer.read_bytes(46); - asm(s: data.ptr()) { - s: str[46] - } - } -} -impl AbiDecode for str[47] { - fn abi_decode(ref mut buffer: BufferReader) -> str[47] { - let data = buffer.read_bytes(47); - asm(s: data.ptr()) { - s: str[47] - } - } -} -impl AbiDecode for str[48] { - fn abi_decode(ref mut buffer: BufferReader) -> str[48] { - let data = buffer.read_bytes(48); - asm(s: data.ptr()) { - s: str[48] - } - } -} -impl AbiDecode for str[49] { - fn abi_decode(ref mut buffer: BufferReader) -> str[49] { - let data = buffer.read_bytes(49); - asm(s: data.ptr()) { - s: str[49] - } - } -} -impl AbiDecode for str[50] { - fn abi_decode(ref mut buffer: BufferReader) -> str[50] { - let data = buffer.read_bytes(50); - asm(s: data.ptr()) { - s: str[50] - } - } -} -impl AbiDecode for str[51] { - fn abi_decode(ref mut buffer: BufferReader) -> str[51] { - let data = buffer.read_bytes(51); - asm(s: data.ptr()) { - s: str[51] - } - } -} -impl AbiDecode for str[52] { - fn abi_decode(ref mut buffer: BufferReader) -> str[52] { - let data = buffer.read_bytes(52); - asm(s: data.ptr()) { - s: str[52] - } - } -} -impl AbiDecode for str[53] { - fn abi_decode(ref mut buffer: BufferReader) -> str[53] { - let data = buffer.read_bytes(53); - asm(s: data.ptr()) { - s: str[53] - } - } -} -impl AbiDecode for str[54] { - fn abi_decode(ref mut buffer: BufferReader) -> str[54] { - let data = buffer.read_bytes(54); - asm(s: data.ptr()) { - s: str[54] - } - } -} -impl AbiDecode for str[55] { - fn abi_decode(ref mut buffer: BufferReader) -> str[55] { - let data = buffer.read_bytes(55); - asm(s: data.ptr()) { - s: str[55] - } - } -} -impl AbiDecode for str[56] { - fn abi_decode(ref mut buffer: BufferReader) -> str[56] { - let data = buffer.read_bytes(56); - asm(s: data.ptr()) { - s: str[56] - } - } -} -impl AbiDecode for str[57] { - fn abi_decode(ref mut buffer: BufferReader) -> str[57] { - let data = buffer.read_bytes(57); - asm(s: data.ptr()) { - s: str[57] - } - } -} -impl AbiDecode for str[58] { - fn abi_decode(ref mut buffer: BufferReader) -> str[58] { - let data = buffer.read_bytes(58); - asm(s: data.ptr()) { - s: str[58] - } - } -} -impl AbiDecode for str[59] { - fn abi_decode(ref mut buffer: BufferReader) -> str[59] { - let data = buffer.read_bytes(59); - asm(s: data.ptr()) { - s: str[59] - } - } -} -impl AbiDecode for str[60] { - fn abi_decode(ref mut buffer: BufferReader) -> str[60] { - let data = buffer.read_bytes(60); - asm(s: data.ptr()) { - s: str[60] - } - } -} -impl AbiDecode for str[61] { - fn abi_decode(ref mut buffer: BufferReader) -> str[61] { - let data = buffer.read_bytes(61); - asm(s: data.ptr()) { - s: str[61] - } - } -} -impl AbiDecode for str[62] { - fn abi_decode(ref mut buffer: BufferReader) -> str[62] { - let data = buffer.read_bytes(62); - asm(s: data.ptr()) { - s: str[62] - } - } -} -impl AbiDecode for str[63] { - fn abi_decode(ref mut buffer: BufferReader) -> str[63] { - let data = buffer.read_bytes(63); - asm(s: data.ptr()) { - s: str[63] - } - } -} -impl AbiDecode for str[64] { - fn abi_decode(ref mut buffer: BufferReader) -> str[64] { - let data = buffer.read_bytes(64); - asm(s: data.ptr()) { - s: str[64] +impl AbiEncode for str[1] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[2] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[3] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[4] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[5] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[6] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[7] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[8] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[9] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[10] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[11] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[12] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[13] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[14] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[15] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[16] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[17] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[18] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[19] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[20] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[21] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[22] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[23] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[24] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[25] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[26] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[27] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[28] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[29] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[30] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[31] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[32] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[33] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[34] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[35] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[36] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[37] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[38] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[39] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[40] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[41] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[42] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[43] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[44] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[45] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[46] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[47] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[48] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[49] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[50] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[51] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[52] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[53] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[54] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[55] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[56] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[57] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[58] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[59] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[60] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[61] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[62] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[63] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +impl AbiEncode for str[64] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } +// END STRARRAY_ENCODE + +// Encode Arrays and Slices + +impl AbiEncode for raw_slice { + fn abi_encode(self, ref mut buffer: Buffer) { + let len = self.number_of_bytes(); + buffer.push_u64(len); + + let ptr = self.ptr(); + + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; } } } -// END STRARRAY_DECODE -impl AbiDecode for [T; 0] -where - T: AbiDecode, -{ - fn abi_decode(ref mut _buffer: BufferReader) -> [T; 0] { - [] - } -} +// BEGIN ARRAY_ENCODE +impl AbiEncode for [T; 1] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 1 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 2] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 2 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 3] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 3 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 4] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 4 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 5] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 5 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 6] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 6 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 7] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 7 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 8] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 8 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 9] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 9 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 10] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 10 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 11] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 11 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 12] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 12 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 13] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 13 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 14] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 14 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 15] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 15 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 16] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 16 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 17] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 17 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 18] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 18 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 19] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 19 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 20] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 20 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 21] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 21 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 22] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 22 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 23] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 23 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 24] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 24 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 25] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 25 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 26] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 26 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 27] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 27 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 28] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 28 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 29] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 29 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 30] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 30 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 31] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 31 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 32] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 32 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 33] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 33 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 34] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 34 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 35] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 35 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 36] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 36 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 37] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 37 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 38] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 38 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 39] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 39 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 40] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 40 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 41] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 41 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 42] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 42 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 43] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 43 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 44] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 44 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 45] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 45 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 46] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 46 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 47] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 47 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 48] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 48 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 49] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 49 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 50] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 50 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 51] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 51 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 52] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 52 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 53] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 53 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 54] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 54 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 55] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 55 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 56] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 56 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 57] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 57 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 58] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 58 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 59] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 59 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 60] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 60 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 61] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 61 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 62] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 62 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 63] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 63 { self[i].abi_encode(buffer); i += 1; } } } +impl AbiEncode for [T; 64] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 64 { self[i].abi_encode(buffer); i += 1; } } } +// END ARRAY_ENCODE -impl AbiDecode for [T; 1] -where - T: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> [T; 1] { - [T::abi_decode(buffer)] - } -} +// Encode Tuples -impl AbiDecode for [T; 2] -where - T: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> [T; 2] { - [T::abi_decode(buffer), T::abi_decode(buffer)] - } +impl AbiEncode for () { + fn abi_encode(self, ref mut _buffer: Buffer) {} } -impl AbiDecode for [T; 3] +// BEGIN TUPLES_ENCODE +impl< A,> AbiEncode for ( A,) where A: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); } } +impl< A, B,> AbiEncode for ( A, B,) where A: AbiEncode, B: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); } } +impl< A, B, C,> AbiEncode for ( A, B, C,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); } } +impl< A, B, C, D,> AbiEncode for ( A, B, C, D,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); } } +impl< A, B, C, D, E,> AbiEncode for ( A, B, C, D, E,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); } } +impl< A, B, C, D, E, F,> AbiEncode for ( A, B, C, D, E, F,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); } } +impl< A, B, C, D, E, F, G,> AbiEncode for ( A, B, C, D, E, F, G,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); } } +impl< A, B, C, D, E, F, G, H,> AbiEncode for ( A, B, C, D, E, F, G, H,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); } } +impl< A, B, C, D, E, F, G, H, I,> AbiEncode for ( A, B, C, D, E, F, G, H, I,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); } } +impl< A, B, C, D, E, F, G, H, I, J,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); } } +impl< A, B, C, D, E, F, G, H, I, J, K,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); } } +impl< A, B, C, D, E, F, G, H, I, J, K, L,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, P: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); self.15.abi_encode(buffer); } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, P: AbiEncode, Q: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); self.15.abi_encode(buffer); self.16.abi_encode(buffer); } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, P: AbiEncode, Q: AbiEncode, R: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); self.15.abi_encode(buffer); self.16.abi_encode(buffer); self.17.abi_encode(buffer); } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, P: AbiEncode, Q: AbiEncode, R: AbiEncode, S: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); self.15.abi_encode(buffer); self.16.abi_encode(buffer); self.17.abi_encode(buffer); self.18.abi_encode(buffer); } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, P: AbiEncode, Q: AbiEncode, R: AbiEncode, S: AbiEncode, T: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); self.15.abi_encode(buffer); self.16.abi_encode(buffer); self.17.abi_encode(buffer); self.18.abi_encode(buffer); self.19.abi_encode(buffer); } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, P: AbiEncode, Q: AbiEncode, R: AbiEncode, S: AbiEncode, T: AbiEncode, U: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); self.15.abi_encode(buffer); self.16.abi_encode(buffer); self.17.abi_encode(buffer); self.18.abi_encode(buffer); self.19.abi_encode(buffer); self.20.abi_encode(buffer); } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, P: AbiEncode, Q: AbiEncode, R: AbiEncode, S: AbiEncode, T: AbiEncode, U: AbiEncode, V: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); self.15.abi_encode(buffer); self.16.abi_encode(buffer); self.17.abi_encode(buffer); self.18.abi_encode(buffer); self.19.abi_encode(buffer); self.20.abi_encode(buffer); self.21.abi_encode(buffer); } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, P: AbiEncode, Q: AbiEncode, R: AbiEncode, S: AbiEncode, T: AbiEncode, U: AbiEncode, V: AbiEncode, W: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); self.15.abi_encode(buffer); self.16.abi_encode(buffer); self.17.abi_encode(buffer); self.18.abi_encode(buffer); self.19.abi_encode(buffer); self.20.abi_encode(buffer); self.21.abi_encode(buffer); self.22.abi_encode(buffer); } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, P: AbiEncode, Q: AbiEncode, R: AbiEncode, S: AbiEncode, T: AbiEncode, U: AbiEncode, V: AbiEncode, W: AbiEncode, X: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); self.15.abi_encode(buffer); self.16.abi_encode(buffer); self.17.abi_encode(buffer); self.18.abi_encode(buffer); self.19.abi_encode(buffer); self.20.abi_encode(buffer); self.21.abi_encode(buffer); self.22.abi_encode(buffer); self.23.abi_encode(buffer); } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, P: AbiEncode, Q: AbiEncode, R: AbiEncode, S: AbiEncode, T: AbiEncode, U: AbiEncode, V: AbiEncode, W: AbiEncode, X: AbiEncode, Y: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); self.15.abi_encode(buffer); self.16.abi_encode(buffer); self.17.abi_encode(buffer); self.18.abi_encode(buffer); self.19.abi_encode(buffer); self.20.abi_encode(buffer); self.21.abi_encode(buffer); self.22.abi_encode(buffer); self.23.abi_encode(buffer); self.24.abi_encode(buffer); } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, P: AbiEncode, Q: AbiEncode, R: AbiEncode, S: AbiEncode, T: AbiEncode, U: AbiEncode, V: AbiEncode, W: AbiEncode, X: AbiEncode, Y: AbiEncode, Z: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); self.15.abi_encode(buffer); self.16.abi_encode(buffer); self.17.abi_encode(buffer); self.18.abi_encode(buffer); self.19.abi_encode(buffer); self.20.abi_encode(buffer); self.21.abi_encode(buffer); self.22.abi_encode(buffer); self.23.abi_encode(buffer); self.24.abi_encode(buffer); self.25.abi_encode(buffer); } } +// END TUPLES_ENCODE + +pub fn encode(item: T) -> raw_slice where - T: AbiDecode, + T: AbiEncode, { - fn abi_decode(ref mut buffer: BufferReader) -> [T; 3] { - [T::abi_decode(buffer), T::abi_decode(buffer), T::abi_decode(buffer)] - } + let mut buffer = Buffer::new(); + item.abi_encode(buffer); + buffer.as_raw_slice() } -impl AbiDecode for [T; 4] +pub fn abi_decode(data: raw_slice) -> T where T: AbiDecode, { - fn abi_decode(ref mut buffer: BufferReader) -> [T; 4] { - [ - T::abi_decode(buffer), - T::abi_decode(buffer), - T::abi_decode(buffer), - T::abi_decode(buffer), - ] - } + let mut buffer = BufferReader::from_parts(data.ptr(), data.len::()); + T::abi_decode(buffer) } -impl AbiDecode for () { - fn abi_decode(ref mut _buffer: BufferReader) -> () { - () - } -} +// Decode -// BEGIN TUPLES_DECODE -impl AbiDecode for (A, ) -where - A: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - (A::abi_decode(buffer), ) - } -} -impl AbiDecode for (A, B) -where - A: AbiDecode, - B: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - (A::abi_decode(buffer), B::abi_decode(buffer)) - } -} -impl AbiDecode for (A, B, C) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - (A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer)) - } -} -impl AbiDecode for (A, B, C, D) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - ) - } -} -impl AbiDecode for (A, B, C, D, E) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, - E: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - E::abi_decode(buffer), - ) - } -} -impl AbiDecode for (A, B, C, D, E, F) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, - E: AbiDecode, - F: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - E::abi_decode(buffer), - F::abi_decode(buffer), - ) - } -} -impl AbiDecode for (A, B, C, D, E, F, G) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, - E: AbiDecode, - F: AbiDecode, - G: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - E::abi_decode(buffer), - F::abi_decode(buffer), - G::abi_decode(buffer), - ) - } -} -impl AbiDecode for (A, B, C, D, E, F, G, H) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, - E: AbiDecode, - F: AbiDecode, - G: AbiDecode, - H: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - E::abi_decode(buffer), - F::abi_decode(buffer), - G::abi_decode(buffer), - H::abi_decode(buffer), - ) - } -} -impl AbiDecode for (A, B, C, D, E, F, G, H, I) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, - E: AbiDecode, - F: AbiDecode, - G: AbiDecode, - H: AbiDecode, - I: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - E::abi_decode(buffer), - F::abi_decode(buffer), - G::abi_decode(buffer), - H::abi_decode(buffer), - I::abi_decode(buffer), - ) - } -} -impl AbiDecode for (A, B, C, D, E, F, G, H, I, J) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, - E: AbiDecode, - F: AbiDecode, - G: AbiDecode, - H: AbiDecode, - I: AbiDecode, - J: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - E::abi_decode(buffer), - F::abi_decode(buffer), - G::abi_decode(buffer), - H::abi_decode(buffer), - I::abi_decode(buffer), - J::abi_decode(buffer), - ) - } -} -impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, - E: AbiDecode, - F: AbiDecode, - G: AbiDecode, - H: AbiDecode, - I: AbiDecode, - J: AbiDecode, - K: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - E::abi_decode(buffer), - F::abi_decode(buffer), - G::abi_decode(buffer), - H::abi_decode(buffer), - I::abi_decode(buffer), - J::abi_decode(buffer), - K::abi_decode(buffer), - ) - } -} -impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, - E: AbiDecode, - F: AbiDecode, - G: AbiDecode, - H: AbiDecode, - I: AbiDecode, - J: AbiDecode, - K: AbiDecode, - L: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - E::abi_decode(buffer), - F::abi_decode(buffer), - G::abi_decode(buffer), - H::abi_decode(buffer), - I::abi_decode(buffer), - J::abi_decode(buffer), - K::abi_decode(buffer), - L::abi_decode(buffer), - ) - } -} -impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, - E: AbiDecode, - F: AbiDecode, - G: AbiDecode, - H: AbiDecode, - I: AbiDecode, - J: AbiDecode, - K: AbiDecode, - L: AbiDecode, - M: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - E::abi_decode(buffer), - F::abi_decode(buffer), - G::abi_decode(buffer), - H::abi_decode(buffer), - I::abi_decode(buffer), - J::abi_decode(buffer), - K::abi_decode(buffer), - L::abi_decode(buffer), - M::abi_decode(buffer), - ) - } -} -impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, - E: AbiDecode, - F: AbiDecode, - G: AbiDecode, - H: AbiDecode, - I: AbiDecode, - J: AbiDecode, - K: AbiDecode, - L: AbiDecode, - M: AbiDecode, - N: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - E::abi_decode(buffer), - F::abi_decode(buffer), - G::abi_decode(buffer), - H::abi_decode(buffer), - I::abi_decode(buffer), - J::abi_decode(buffer), - K::abi_decode(buffer), - L::abi_decode(buffer), - M::abi_decode(buffer), - N::abi_decode(buffer), - ) - } -} -impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, - E: AbiDecode, - F: AbiDecode, - G: AbiDecode, - H: AbiDecode, - I: AbiDecode, - J: AbiDecode, - K: AbiDecode, - L: AbiDecode, - M: AbiDecode, - N: AbiDecode, - O: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - E::abi_decode(buffer), - F::abi_decode(buffer), - G::abi_decode(buffer), - H::abi_decode(buffer), - I::abi_decode(buffer), - J::abi_decode(buffer), - K::abi_decode(buffer), - L::abi_decode(buffer), - M::abi_decode(buffer), - N::abi_decode(buffer), - O::abi_decode(buffer), - ) - } -} -impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, - E: AbiDecode, - F: AbiDecode, - G: AbiDecode, - H: AbiDecode, - I: AbiDecode, - J: AbiDecode, - K: AbiDecode, - L: AbiDecode, - M: AbiDecode, - N: AbiDecode, - O: AbiDecode, - P: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - E::abi_decode(buffer), - F::abi_decode(buffer), - G::abi_decode(buffer), - H::abi_decode(buffer), - I::abi_decode(buffer), - J::abi_decode(buffer), - K::abi_decode(buffer), - L::abi_decode(buffer), - M::abi_decode(buffer), - N::abi_decode(buffer), - O::abi_decode(buffer), - P::abi_decode(buffer), - ) - } +pub trait AbiDecode { + fn abi_decode(ref mut buffer: BufferReader) -> Self; } -impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, - E: AbiDecode, - F: AbiDecode, - G: AbiDecode, - H: AbiDecode, - I: AbiDecode, - J: AbiDecode, - K: AbiDecode, - L: AbiDecode, - M: AbiDecode, - N: AbiDecode, - O: AbiDecode, - P: AbiDecode, - Q: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - E::abi_decode(buffer), - F::abi_decode(buffer), - G::abi_decode(buffer), - H::abi_decode(buffer), - I::abi_decode(buffer), - J::abi_decode(buffer), - K::abi_decode(buffer), - L::abi_decode(buffer), - M::abi_decode(buffer), - N::abi_decode(buffer), - O::abi_decode(buffer), - P::abi_decode(buffer), - Q::abi_decode(buffer), - ) + +impl AbiDecode for b256 { + fn abi_decode(ref mut buffer: BufferReader) -> b256 { + buffer.read::() } } -impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, - E: AbiDecode, - F: AbiDecode, - G: AbiDecode, - H: AbiDecode, - I: AbiDecode, - J: AbiDecode, - K: AbiDecode, - L: AbiDecode, - M: AbiDecode, - N: AbiDecode, - O: AbiDecode, - P: AbiDecode, - Q: AbiDecode, - R: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - E::abi_decode(buffer), - F::abi_decode(buffer), - G::abi_decode(buffer), - H::abi_decode(buffer), - I::abi_decode(buffer), - J::abi_decode(buffer), - K::abi_decode(buffer), - L::abi_decode(buffer), - M::abi_decode(buffer), - N::abi_decode(buffer), - O::abi_decode(buffer), - P::abi_decode(buffer), - Q::abi_decode(buffer), - R::abi_decode(buffer), - ) + +impl AbiDecode for u256 { + fn abi_decode(ref mut buffer: BufferReader) -> u256 { + buffer.read::() } } -impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, - E: AbiDecode, - F: AbiDecode, - G: AbiDecode, - H: AbiDecode, - I: AbiDecode, - J: AbiDecode, - K: AbiDecode, - L: AbiDecode, - M: AbiDecode, - N: AbiDecode, - O: AbiDecode, - P: AbiDecode, - Q: AbiDecode, - R: AbiDecode, - S: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - E::abi_decode(buffer), - F::abi_decode(buffer), - G::abi_decode(buffer), - H::abi_decode(buffer), - I::abi_decode(buffer), - J::abi_decode(buffer), - K::abi_decode(buffer), - L::abi_decode(buffer), - M::abi_decode(buffer), - N::abi_decode(buffer), - O::abi_decode(buffer), - P::abi_decode(buffer), - Q::abi_decode(buffer), - R::abi_decode(buffer), - S::abi_decode(buffer), - ) + +impl AbiDecode for u64 { + fn abi_decode(ref mut buffer: BufferReader) -> u64 { + buffer.read::() } } -impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, - E: AbiDecode, - F: AbiDecode, - G: AbiDecode, - H: AbiDecode, - I: AbiDecode, - J: AbiDecode, - K: AbiDecode, - L: AbiDecode, - M: AbiDecode, - N: AbiDecode, - O: AbiDecode, - P: AbiDecode, - Q: AbiDecode, - R: AbiDecode, - S: AbiDecode, - T: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - E::abi_decode(buffer), - F::abi_decode(buffer), - G::abi_decode(buffer), - H::abi_decode(buffer), - I::abi_decode(buffer), - J::abi_decode(buffer), - K::abi_decode(buffer), - L::abi_decode(buffer), - M::abi_decode(buffer), - N::abi_decode(buffer), - O::abi_decode(buffer), - P::abi_decode(buffer), - Q::abi_decode(buffer), - R::abi_decode(buffer), - S::abi_decode(buffer), - T::abi_decode(buffer), - ) + +impl AbiDecode for u32 { + fn abi_decode(ref mut buffer: BufferReader) -> u32 { + use ::primitive_conversions::*; + let a = buffer.read::().as_u32(); + let b = buffer.read::().as_u32(); + let c = buffer.read::().as_u32(); + let d = buffer.read::().as_u32(); + (a << 24) | (b << 16) | (c << 8) | d } } -impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, - E: AbiDecode, - F: AbiDecode, - G: AbiDecode, - H: AbiDecode, - I: AbiDecode, - J: AbiDecode, - K: AbiDecode, - L: AbiDecode, - M: AbiDecode, - N: AbiDecode, - O: AbiDecode, - P: AbiDecode, - Q: AbiDecode, - R: AbiDecode, - S: AbiDecode, - T: AbiDecode, - U: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - E::abi_decode(buffer), - F::abi_decode(buffer), - G::abi_decode(buffer), - H::abi_decode(buffer), - I::abi_decode(buffer), - J::abi_decode(buffer), - K::abi_decode(buffer), - L::abi_decode(buffer), - M::abi_decode(buffer), - N::abi_decode(buffer), - O::abi_decode(buffer), - P::abi_decode(buffer), - Q::abi_decode(buffer), - R::abi_decode(buffer), - S::abi_decode(buffer), - T::abi_decode(buffer), - U::abi_decode(buffer), - ) + +impl AbiDecode for u16 { + fn abi_decode(ref mut buffer: BufferReader) -> u16 { + use ::primitive_conversions::*; + let a = buffer.read::().as_u16(); + let b = buffer.read::().as_u16(); + (a << 8) | b } } -impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, - E: AbiDecode, - F: AbiDecode, - G: AbiDecode, - H: AbiDecode, - I: AbiDecode, - J: AbiDecode, - K: AbiDecode, - L: AbiDecode, - M: AbiDecode, - N: AbiDecode, - O: AbiDecode, - P: AbiDecode, - Q: AbiDecode, - R: AbiDecode, - S: AbiDecode, - T: AbiDecode, - U: AbiDecode, - V: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - E::abi_decode(buffer), - F::abi_decode(buffer), - G::abi_decode(buffer), - H::abi_decode(buffer), - I::abi_decode(buffer), - J::abi_decode(buffer), - K::abi_decode(buffer), - L::abi_decode(buffer), - M::abi_decode(buffer), - N::abi_decode(buffer), - O::abi_decode(buffer), - P::abi_decode(buffer), - Q::abi_decode(buffer), - R::abi_decode(buffer), - S::abi_decode(buffer), - T::abi_decode(buffer), - U::abi_decode(buffer), - V::abi_decode(buffer), - ) + +impl AbiDecode for u8 { + fn abi_decode(ref mut buffer: BufferReader) -> u8 { + buffer.read::() } } -impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, - E: AbiDecode, - F: AbiDecode, - G: AbiDecode, - H: AbiDecode, - I: AbiDecode, - J: AbiDecode, - K: AbiDecode, - L: AbiDecode, - M: AbiDecode, - N: AbiDecode, - O: AbiDecode, - P: AbiDecode, - Q: AbiDecode, - R: AbiDecode, - S: AbiDecode, - T: AbiDecode, - U: AbiDecode, - V: AbiDecode, - W: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - E::abi_decode(buffer), - F::abi_decode(buffer), - G::abi_decode(buffer), - H::abi_decode(buffer), - I::abi_decode(buffer), - J::abi_decode(buffer), - K::abi_decode(buffer), - L::abi_decode(buffer), - M::abi_decode(buffer), - N::abi_decode(buffer), - O::abi_decode(buffer), - P::abi_decode(buffer), - Q::abi_decode(buffer), - R::abi_decode(buffer), - S::abi_decode(buffer), - T::abi_decode(buffer), - U::abi_decode(buffer), - V::abi_decode(buffer), - W::abi_decode(buffer), - ) + +impl AbiDecode for bool { + fn abi_decode(ref mut buffer: BufferReader) -> bool { + buffer.read::() } } -impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, - E: AbiDecode, - F: AbiDecode, - G: AbiDecode, - H: AbiDecode, - I: AbiDecode, - J: AbiDecode, - K: AbiDecode, - L: AbiDecode, - M: AbiDecode, - N: AbiDecode, - O: AbiDecode, - P: AbiDecode, - Q: AbiDecode, - R: AbiDecode, - S: AbiDecode, - T: AbiDecode, - U: AbiDecode, - V: AbiDecode, - W: AbiDecode, - X: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - E::abi_decode(buffer), - F::abi_decode(buffer), - G::abi_decode(buffer), - H::abi_decode(buffer), - I::abi_decode(buffer), - J::abi_decode(buffer), - K::abi_decode(buffer), - L::abi_decode(buffer), - M::abi_decode(buffer), - N::abi_decode(buffer), - O::abi_decode(buffer), - P::abi_decode(buffer), - Q::abi_decode(buffer), - R::abi_decode(buffer), - S::abi_decode(buffer), - T::abi_decode(buffer), - U::abi_decode(buffer), - V::abi_decode(buffer), - W::abi_decode(buffer), - X::abi_decode(buffer), - ) + +impl AbiDecode for raw_slice { + fn abi_decode(ref mut buffer: BufferReader) -> raw_slice { + let len = u64::abi_decode(buffer); + let data = buffer.read_bytes(len); + asm(s: (data.ptr(), len)) { + s: raw_slice + } } } -impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, - E: AbiDecode, - F: AbiDecode, - G: AbiDecode, - H: AbiDecode, - I: AbiDecode, - J: AbiDecode, - K: AbiDecode, - L: AbiDecode, - M: AbiDecode, - N: AbiDecode, - O: AbiDecode, - P: AbiDecode, - Q: AbiDecode, - R: AbiDecode, - S: AbiDecode, - T: AbiDecode, - U: AbiDecode, - V: AbiDecode, - W: AbiDecode, - X: AbiDecode, - Y: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - E::abi_decode(buffer), - F::abi_decode(buffer), - G::abi_decode(buffer), - H::abi_decode(buffer), - I::abi_decode(buffer), - J::abi_decode(buffer), - K::abi_decode(buffer), - L::abi_decode(buffer), - M::abi_decode(buffer), - N::abi_decode(buffer), - O::abi_decode(buffer), - P::abi_decode(buffer), - Q::abi_decode(buffer), - R::abi_decode(buffer), - S::abi_decode(buffer), - T::abi_decode(buffer), - U::abi_decode(buffer), - V::abi_decode(buffer), - W::abi_decode(buffer), - X::abi_decode(buffer), - Y::abi_decode(buffer), - ) + +impl AbiDecode for str { + fn abi_decode(ref mut buffer: BufferReader) -> str { + let len = u64::abi_decode(buffer); + let data = buffer.read_bytes(len); + asm(s: (data.ptr(), len)) { + s: str + } } } -impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z) -where - A: AbiDecode, - B: AbiDecode, - C: AbiDecode, - D: AbiDecode, - E: AbiDecode, - F: AbiDecode, - G: AbiDecode, - H: AbiDecode, - I: AbiDecode, - J: AbiDecode, - K: AbiDecode, - L: AbiDecode, - M: AbiDecode, - N: AbiDecode, - O: AbiDecode, - P: AbiDecode, - Q: AbiDecode, - R: AbiDecode, - S: AbiDecode, - T: AbiDecode, - U: AbiDecode, - V: AbiDecode, - W: AbiDecode, - X: AbiDecode, - Y: AbiDecode, - Z: AbiDecode, -{ - fn abi_decode(ref mut buffer: BufferReader) -> Self { - ( - A::abi_decode(buffer), - B::abi_decode(buffer), - C::abi_decode(buffer), - D::abi_decode(buffer), - E::abi_decode(buffer), - F::abi_decode(buffer), - G::abi_decode(buffer), - H::abi_decode(buffer), - I::abi_decode(buffer), - J::abi_decode(buffer), - K::abi_decode(buffer), - L::abi_decode(buffer), - M::abi_decode(buffer), - N::abi_decode(buffer), - O::abi_decode(buffer), - P::abi_decode(buffer), - Q::abi_decode(buffer), - R::abi_decode(buffer), - S::abi_decode(buffer), - T::abi_decode(buffer), - U::abi_decode(buffer), - V::abi_decode(buffer), - W::abi_decode(buffer), - X::abi_decode(buffer), - Y::abi_decode(buffer), - Z::abi_decode(buffer), - ) + +// BEGIN STRARRAY_DECODE +impl AbiDecode for str[1] { fn abi_decode(ref mut buffer: BufferReader) -> str[1] { let data = buffer.read_bytes(1); asm(s: data.ptr()) { s: str[1] } } } +impl AbiDecode for str[2] { fn abi_decode(ref mut buffer: BufferReader) -> str[2] { let data = buffer.read_bytes(2); asm(s: data.ptr()) { s: str[2] } } } +impl AbiDecode for str[3] { fn abi_decode(ref mut buffer: BufferReader) -> str[3] { let data = buffer.read_bytes(3); asm(s: data.ptr()) { s: str[3] } } } +impl AbiDecode for str[4] { fn abi_decode(ref mut buffer: BufferReader) -> str[4] { let data = buffer.read_bytes(4); asm(s: data.ptr()) { s: str[4] } } } +impl AbiDecode for str[5] { fn abi_decode(ref mut buffer: BufferReader) -> str[5] { let data = buffer.read_bytes(5); asm(s: data.ptr()) { s: str[5] } } } +impl AbiDecode for str[6] { fn abi_decode(ref mut buffer: BufferReader) -> str[6] { let data = buffer.read_bytes(6); asm(s: data.ptr()) { s: str[6] } } } +impl AbiDecode for str[7] { fn abi_decode(ref mut buffer: BufferReader) -> str[7] { let data = buffer.read_bytes(7); asm(s: data.ptr()) { s: str[7] } } } +impl AbiDecode for str[8] { fn abi_decode(ref mut buffer: BufferReader) -> str[8] { let data = buffer.read_bytes(8); asm(s: data.ptr()) { s: str[8] } } } +impl AbiDecode for str[9] { fn abi_decode(ref mut buffer: BufferReader) -> str[9] { let data = buffer.read_bytes(9); asm(s: data.ptr()) { s: str[9] } } } +impl AbiDecode for str[10] { fn abi_decode(ref mut buffer: BufferReader) -> str[10] { let data = buffer.read_bytes(10); asm(s: data.ptr()) { s: str[10] } } } +impl AbiDecode for str[11] { fn abi_decode(ref mut buffer: BufferReader) -> str[11] { let data = buffer.read_bytes(11); asm(s: data.ptr()) { s: str[11] } } } +impl AbiDecode for str[12] { fn abi_decode(ref mut buffer: BufferReader) -> str[12] { let data = buffer.read_bytes(12); asm(s: data.ptr()) { s: str[12] } } } +impl AbiDecode for str[13] { fn abi_decode(ref mut buffer: BufferReader) -> str[13] { let data = buffer.read_bytes(13); asm(s: data.ptr()) { s: str[13] } } } +impl AbiDecode for str[14] { fn abi_decode(ref mut buffer: BufferReader) -> str[14] { let data = buffer.read_bytes(14); asm(s: data.ptr()) { s: str[14] } } } +impl AbiDecode for str[15] { fn abi_decode(ref mut buffer: BufferReader) -> str[15] { let data = buffer.read_bytes(15); asm(s: data.ptr()) { s: str[15] } } } +impl AbiDecode for str[16] { fn abi_decode(ref mut buffer: BufferReader) -> str[16] { let data = buffer.read_bytes(16); asm(s: data.ptr()) { s: str[16] } } } +impl AbiDecode for str[17] { fn abi_decode(ref mut buffer: BufferReader) -> str[17] { let data = buffer.read_bytes(17); asm(s: data.ptr()) { s: str[17] } } } +impl AbiDecode for str[18] { fn abi_decode(ref mut buffer: BufferReader) -> str[18] { let data = buffer.read_bytes(18); asm(s: data.ptr()) { s: str[18] } } } +impl AbiDecode for str[19] { fn abi_decode(ref mut buffer: BufferReader) -> str[19] { let data = buffer.read_bytes(19); asm(s: data.ptr()) { s: str[19] } } } +impl AbiDecode for str[20] { fn abi_decode(ref mut buffer: BufferReader) -> str[20] { let data = buffer.read_bytes(20); asm(s: data.ptr()) { s: str[20] } } } +impl AbiDecode for str[21] { fn abi_decode(ref mut buffer: BufferReader) -> str[21] { let data = buffer.read_bytes(21); asm(s: data.ptr()) { s: str[21] } } } +impl AbiDecode for str[22] { fn abi_decode(ref mut buffer: BufferReader) -> str[22] { let data = buffer.read_bytes(22); asm(s: data.ptr()) { s: str[22] } } } +impl AbiDecode for str[23] { fn abi_decode(ref mut buffer: BufferReader) -> str[23] { let data = buffer.read_bytes(23); asm(s: data.ptr()) { s: str[23] } } } +impl AbiDecode for str[24] { fn abi_decode(ref mut buffer: BufferReader) -> str[24] { let data = buffer.read_bytes(24); asm(s: data.ptr()) { s: str[24] } } } +impl AbiDecode for str[25] { fn abi_decode(ref mut buffer: BufferReader) -> str[25] { let data = buffer.read_bytes(25); asm(s: data.ptr()) { s: str[25] } } } +impl AbiDecode for str[26] { fn abi_decode(ref mut buffer: BufferReader) -> str[26] { let data = buffer.read_bytes(26); asm(s: data.ptr()) { s: str[26] } } } +impl AbiDecode for str[27] { fn abi_decode(ref mut buffer: BufferReader) -> str[27] { let data = buffer.read_bytes(27); asm(s: data.ptr()) { s: str[27] } } } +impl AbiDecode for str[28] { fn abi_decode(ref mut buffer: BufferReader) -> str[28] { let data = buffer.read_bytes(28); asm(s: data.ptr()) { s: str[28] } } } +impl AbiDecode for str[29] { fn abi_decode(ref mut buffer: BufferReader) -> str[29] { let data = buffer.read_bytes(29); asm(s: data.ptr()) { s: str[29] } } } +impl AbiDecode for str[30] { fn abi_decode(ref mut buffer: BufferReader) -> str[30] { let data = buffer.read_bytes(30); asm(s: data.ptr()) { s: str[30] } } } +impl AbiDecode for str[31] { fn abi_decode(ref mut buffer: BufferReader) -> str[31] { let data = buffer.read_bytes(31); asm(s: data.ptr()) { s: str[31] } } } +impl AbiDecode for str[32] { fn abi_decode(ref mut buffer: BufferReader) -> str[32] { let data = buffer.read_bytes(32); asm(s: data.ptr()) { s: str[32] } } } +impl AbiDecode for str[33] { fn abi_decode(ref mut buffer: BufferReader) -> str[33] { let data = buffer.read_bytes(33); asm(s: data.ptr()) { s: str[33] } } } +impl AbiDecode for str[34] { fn abi_decode(ref mut buffer: BufferReader) -> str[34] { let data = buffer.read_bytes(34); asm(s: data.ptr()) { s: str[34] } } } +impl AbiDecode for str[35] { fn abi_decode(ref mut buffer: BufferReader) -> str[35] { let data = buffer.read_bytes(35); asm(s: data.ptr()) { s: str[35] } } } +impl AbiDecode for str[36] { fn abi_decode(ref mut buffer: BufferReader) -> str[36] { let data = buffer.read_bytes(36); asm(s: data.ptr()) { s: str[36] } } } +impl AbiDecode for str[37] { fn abi_decode(ref mut buffer: BufferReader) -> str[37] { let data = buffer.read_bytes(37); asm(s: data.ptr()) { s: str[37] } } } +impl AbiDecode for str[38] { fn abi_decode(ref mut buffer: BufferReader) -> str[38] { let data = buffer.read_bytes(38); asm(s: data.ptr()) { s: str[38] } } } +impl AbiDecode for str[39] { fn abi_decode(ref mut buffer: BufferReader) -> str[39] { let data = buffer.read_bytes(39); asm(s: data.ptr()) { s: str[39] } } } +impl AbiDecode for str[40] { fn abi_decode(ref mut buffer: BufferReader) -> str[40] { let data = buffer.read_bytes(40); asm(s: data.ptr()) { s: str[40] } } } +impl AbiDecode for str[41] { fn abi_decode(ref mut buffer: BufferReader) -> str[41] { let data = buffer.read_bytes(41); asm(s: data.ptr()) { s: str[41] } } } +impl AbiDecode for str[42] { fn abi_decode(ref mut buffer: BufferReader) -> str[42] { let data = buffer.read_bytes(42); asm(s: data.ptr()) { s: str[42] } } } +impl AbiDecode for str[43] { fn abi_decode(ref mut buffer: BufferReader) -> str[43] { let data = buffer.read_bytes(43); asm(s: data.ptr()) { s: str[43] } } } +impl AbiDecode for str[44] { fn abi_decode(ref mut buffer: BufferReader) -> str[44] { let data = buffer.read_bytes(44); asm(s: data.ptr()) { s: str[44] } } } +impl AbiDecode for str[45] { fn abi_decode(ref mut buffer: BufferReader) -> str[45] { let data = buffer.read_bytes(45); asm(s: data.ptr()) { s: str[45] } } } +impl AbiDecode for str[46] { fn abi_decode(ref mut buffer: BufferReader) -> str[46] { let data = buffer.read_bytes(46); asm(s: data.ptr()) { s: str[46] } } } +impl AbiDecode for str[47] { fn abi_decode(ref mut buffer: BufferReader) -> str[47] { let data = buffer.read_bytes(47); asm(s: data.ptr()) { s: str[47] } } } +impl AbiDecode for str[48] { fn abi_decode(ref mut buffer: BufferReader) -> str[48] { let data = buffer.read_bytes(48); asm(s: data.ptr()) { s: str[48] } } } +impl AbiDecode for str[49] { fn abi_decode(ref mut buffer: BufferReader) -> str[49] { let data = buffer.read_bytes(49); asm(s: data.ptr()) { s: str[49] } } } +impl AbiDecode for str[50] { fn abi_decode(ref mut buffer: BufferReader) -> str[50] { let data = buffer.read_bytes(50); asm(s: data.ptr()) { s: str[50] } } } +impl AbiDecode for str[51] { fn abi_decode(ref mut buffer: BufferReader) -> str[51] { let data = buffer.read_bytes(51); asm(s: data.ptr()) { s: str[51] } } } +impl AbiDecode for str[52] { fn abi_decode(ref mut buffer: BufferReader) -> str[52] { let data = buffer.read_bytes(52); asm(s: data.ptr()) { s: str[52] } } } +impl AbiDecode for str[53] { fn abi_decode(ref mut buffer: BufferReader) -> str[53] { let data = buffer.read_bytes(53); asm(s: data.ptr()) { s: str[53] } } } +impl AbiDecode for str[54] { fn abi_decode(ref mut buffer: BufferReader) -> str[54] { let data = buffer.read_bytes(54); asm(s: data.ptr()) { s: str[54] } } } +impl AbiDecode for str[55] { fn abi_decode(ref mut buffer: BufferReader) -> str[55] { let data = buffer.read_bytes(55); asm(s: data.ptr()) { s: str[55] } } } +impl AbiDecode for str[56] { fn abi_decode(ref mut buffer: BufferReader) -> str[56] { let data = buffer.read_bytes(56); asm(s: data.ptr()) { s: str[56] } } } +impl AbiDecode for str[57] { fn abi_decode(ref mut buffer: BufferReader) -> str[57] { let data = buffer.read_bytes(57); asm(s: data.ptr()) { s: str[57] } } } +impl AbiDecode for str[58] { fn abi_decode(ref mut buffer: BufferReader) -> str[58] { let data = buffer.read_bytes(58); asm(s: data.ptr()) { s: str[58] } } } +impl AbiDecode for str[59] { fn abi_decode(ref mut buffer: BufferReader) -> str[59] { let data = buffer.read_bytes(59); asm(s: data.ptr()) { s: str[59] } } } +impl AbiDecode for str[60] { fn abi_decode(ref mut buffer: BufferReader) -> str[60] { let data = buffer.read_bytes(60); asm(s: data.ptr()) { s: str[60] } } } +impl AbiDecode for str[61] { fn abi_decode(ref mut buffer: BufferReader) -> str[61] { let data = buffer.read_bytes(61); asm(s: data.ptr()) { s: str[61] } } } +impl AbiDecode for str[62] { fn abi_decode(ref mut buffer: BufferReader) -> str[62] { let data = buffer.read_bytes(62); asm(s: data.ptr()) { s: str[62] } } } +impl AbiDecode for str[63] { fn abi_decode(ref mut buffer: BufferReader) -> str[63] { let data = buffer.read_bytes(63); asm(s: data.ptr()) { s: str[63] } } } +impl AbiDecode for str[64] { fn abi_decode(ref mut buffer: BufferReader) -> str[64] { let data = buffer.read_bytes(64); asm(s: data.ptr()) { s: str[64] } } } +// END STRARRAY_DECODE + +// BEGIN ARRAY_DECODE +impl AbiDecode for [T; 1] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 1] { let first: T = buffer.decode::(); let mut array = [first; 1]; let mut i = 1; while i < 1 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 2] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 2] { let first: T = buffer.decode::(); let mut array = [first; 2]; let mut i = 1; while i < 2 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 3] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 3] { let first: T = buffer.decode::(); let mut array = [first; 3]; let mut i = 1; while i < 3 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 4] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 4] { let first: T = buffer.decode::(); let mut array = [first; 4]; let mut i = 1; while i < 4 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 5] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 5] { let first: T = buffer.decode::(); let mut array = [first; 5]; let mut i = 1; while i < 5 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 6] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 6] { let first: T = buffer.decode::(); let mut array = [first; 6]; let mut i = 1; while i < 6 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 7] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 7] { let first: T = buffer.decode::(); let mut array = [first; 7]; let mut i = 1; while i < 7 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 8] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 8] { let first: T = buffer.decode::(); let mut array = [first; 8]; let mut i = 1; while i < 8 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 9] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 9] { let first: T = buffer.decode::(); let mut array = [first; 9]; let mut i = 1; while i < 9 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 10] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 10] { let first: T = buffer.decode::(); let mut array = [first; 10]; let mut i = 1; while i < 10 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 11] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 11] { let first: T = buffer.decode::(); let mut array = [first; 11]; let mut i = 1; while i < 11 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 12] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 12] { let first: T = buffer.decode::(); let mut array = [first; 12]; let mut i = 1; while i < 12 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 13] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 13] { let first: T = buffer.decode::(); let mut array = [first; 13]; let mut i = 1; while i < 13 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 14] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 14] { let first: T = buffer.decode::(); let mut array = [first; 14]; let mut i = 1; while i < 14 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 15] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 15] { let first: T = buffer.decode::(); let mut array = [first; 15]; let mut i = 1; while i < 15 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 16] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 16] { let first: T = buffer.decode::(); let mut array = [first; 16]; let mut i = 1; while i < 16 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 17] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 17] { let first: T = buffer.decode::(); let mut array = [first; 17]; let mut i = 1; while i < 17 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 18] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 18] { let first: T = buffer.decode::(); let mut array = [first; 18]; let mut i = 1; while i < 18 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 19] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 19] { let first: T = buffer.decode::(); let mut array = [first; 19]; let mut i = 1; while i < 19 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 20] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 20] { let first: T = buffer.decode::(); let mut array = [first; 20]; let mut i = 1; while i < 20 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 21] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 21] { let first: T = buffer.decode::(); let mut array = [first; 21]; let mut i = 1; while i < 21 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 22] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 22] { let first: T = buffer.decode::(); let mut array = [first; 22]; let mut i = 1; while i < 22 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 23] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 23] { let first: T = buffer.decode::(); let mut array = [first; 23]; let mut i = 1; while i < 23 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 24] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 24] { let first: T = buffer.decode::(); let mut array = [first; 24]; let mut i = 1; while i < 24 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 25] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 25] { let first: T = buffer.decode::(); let mut array = [first; 25]; let mut i = 1; while i < 25 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 26] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 26] { let first: T = buffer.decode::(); let mut array = [first; 26]; let mut i = 1; while i < 26 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 27] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 27] { let first: T = buffer.decode::(); let mut array = [first; 27]; let mut i = 1; while i < 27 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 28] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 28] { let first: T = buffer.decode::(); let mut array = [first; 28]; let mut i = 1; while i < 28 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 29] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 29] { let first: T = buffer.decode::(); let mut array = [first; 29]; let mut i = 1; while i < 29 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 30] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 30] { let first: T = buffer.decode::(); let mut array = [first; 30]; let mut i = 1; while i < 30 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 31] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 31] { let first: T = buffer.decode::(); let mut array = [first; 31]; let mut i = 1; while i < 31 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 32] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 32] { let first: T = buffer.decode::(); let mut array = [first; 32]; let mut i = 1; while i < 32 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 33] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 33] { let first: T = buffer.decode::(); let mut array = [first; 33]; let mut i = 1; while i < 33 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 34] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 34] { let first: T = buffer.decode::(); let mut array = [first; 34]; let mut i = 1; while i < 34 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 35] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 35] { let first: T = buffer.decode::(); let mut array = [first; 35]; let mut i = 1; while i < 35 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 36] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 36] { let first: T = buffer.decode::(); let mut array = [first; 36]; let mut i = 1; while i < 36 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 37] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 37] { let first: T = buffer.decode::(); let mut array = [first; 37]; let mut i = 1; while i < 37 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 38] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 38] { let first: T = buffer.decode::(); let mut array = [first; 38]; let mut i = 1; while i < 38 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 39] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 39] { let first: T = buffer.decode::(); let mut array = [first; 39]; let mut i = 1; while i < 39 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 40] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 40] { let first: T = buffer.decode::(); let mut array = [first; 40]; let mut i = 1; while i < 40 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 41] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 41] { let first: T = buffer.decode::(); let mut array = [first; 41]; let mut i = 1; while i < 41 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 42] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 42] { let first: T = buffer.decode::(); let mut array = [first; 42]; let mut i = 1; while i < 42 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 43] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 43] { let first: T = buffer.decode::(); let mut array = [first; 43]; let mut i = 1; while i < 43 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 44] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 44] { let first: T = buffer.decode::(); let mut array = [first; 44]; let mut i = 1; while i < 44 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 45] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 45] { let first: T = buffer.decode::(); let mut array = [first; 45]; let mut i = 1; while i < 45 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 46] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 46] { let first: T = buffer.decode::(); let mut array = [first; 46]; let mut i = 1; while i < 46 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 47] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 47] { let first: T = buffer.decode::(); let mut array = [first; 47]; let mut i = 1; while i < 47 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 48] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 48] { let first: T = buffer.decode::(); let mut array = [first; 48]; let mut i = 1; while i < 48 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 49] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 49] { let first: T = buffer.decode::(); let mut array = [first; 49]; let mut i = 1; while i < 49 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 50] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 50] { let first: T = buffer.decode::(); let mut array = [first; 50]; let mut i = 1; while i < 50 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 51] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 51] { let first: T = buffer.decode::(); let mut array = [first; 51]; let mut i = 1; while i < 51 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 52] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 52] { let first: T = buffer.decode::(); let mut array = [first; 52]; let mut i = 1; while i < 52 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 53] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 53] { let first: T = buffer.decode::(); let mut array = [first; 53]; let mut i = 1; while i < 53 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 54] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 54] { let first: T = buffer.decode::(); let mut array = [first; 54]; let mut i = 1; while i < 54 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 55] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 55] { let first: T = buffer.decode::(); let mut array = [first; 55]; let mut i = 1; while i < 55 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 56] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 56] { let first: T = buffer.decode::(); let mut array = [first; 56]; let mut i = 1; while i < 56 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 57] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 57] { let first: T = buffer.decode::(); let mut array = [first; 57]; let mut i = 1; while i < 57 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 58] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 58] { let first: T = buffer.decode::(); let mut array = [first; 58]; let mut i = 1; while i < 58 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 59] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 59] { let first: T = buffer.decode::(); let mut array = [first; 59]; let mut i = 1; while i < 59 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 60] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 60] { let first: T = buffer.decode::(); let mut array = [first; 60]; let mut i = 1; while i < 60 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 61] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 61] { let first: T = buffer.decode::(); let mut array = [first; 61]; let mut i = 1; while i < 61 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 62] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 62] { let first: T = buffer.decode::(); let mut array = [first; 62]; let mut i = 1; while i < 62 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 63] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 63] { let first: T = buffer.decode::(); let mut array = [first; 63]; let mut i = 1; while i < 63 { array[i] = buffer.decode::(); i += 1; }; array } } +impl AbiDecode for [T; 64] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 64] { let first: T = buffer.decode::(); let mut array = [first; 64]; let mut i = 1; while i < 64 { array[i] = buffer.decode::(); i += 1; }; array } } +// END ARRAY_DECODE + +impl AbiDecode for () { + fn abi_decode(ref mut _buffer: BufferReader) -> () { + () } } + +// BEGIN TUPLES_DECODE +impl< A,> AbiDecode for ( A,) where A: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer),) } } +impl< A, B,> AbiDecode for ( A, B,) where A: AbiDecode, B: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer),) } } +impl< A, B, C,> AbiDecode for ( A, B, C,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer),) } } +impl< A, B, C, D,> AbiDecode for ( A, B, C, D,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer),) } } +impl< A, B, C, D, E,> AbiDecode for ( A, B, C, D, E,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer),) } } +impl< A, B, C, D, E, F,> AbiDecode for ( A, B, C, D, E, F,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer),) } } +impl< A, B, C, D, E, F, G,> AbiDecode for ( A, B, C, D, E, F, G,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer),) } } +impl< A, B, C, D, E, F, G, H,> AbiDecode for ( A, B, C, D, E, F, G, H,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer),) } } +impl< A, B, C, D, E, F, G, H, I,> AbiDecode for ( A, B, C, D, E, F, G, H, I,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer),) } } +impl< A, B, C, D, E, F, G, H, I, J,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer),) } } +impl< A, B, C, D, E, F, G, H, I, J, K,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer),) } } +impl< A, B, C, D, E, F, G, H, I, J, K, L,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer),) } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer),) } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer),) } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer),) } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, P: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer), P::abi_decode(buffer),) } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, P: AbiDecode, Q: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer), P::abi_decode(buffer), Q::abi_decode(buffer),) } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, P: AbiDecode, Q: AbiDecode, R: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer), P::abi_decode(buffer), Q::abi_decode(buffer), R::abi_decode(buffer),) } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, P: AbiDecode, Q: AbiDecode, R: AbiDecode, S: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer), P::abi_decode(buffer), Q::abi_decode(buffer), R::abi_decode(buffer), S::abi_decode(buffer),) } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, P: AbiDecode, Q: AbiDecode, R: AbiDecode, S: AbiDecode, T: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer), P::abi_decode(buffer), Q::abi_decode(buffer), R::abi_decode(buffer), S::abi_decode(buffer), T::abi_decode(buffer),) } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, P: AbiDecode, Q: AbiDecode, R: AbiDecode, S: AbiDecode, T: AbiDecode, U: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer), P::abi_decode(buffer), Q::abi_decode(buffer), R::abi_decode(buffer), S::abi_decode(buffer), T::abi_decode(buffer), U::abi_decode(buffer),) } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, P: AbiDecode, Q: AbiDecode, R: AbiDecode, S: AbiDecode, T: AbiDecode, U: AbiDecode, V: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer), P::abi_decode(buffer), Q::abi_decode(buffer), R::abi_decode(buffer), S::abi_decode(buffer), T::abi_decode(buffer), U::abi_decode(buffer), V::abi_decode(buffer),) } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, P: AbiDecode, Q: AbiDecode, R: AbiDecode, S: AbiDecode, T: AbiDecode, U: AbiDecode, V: AbiDecode, W: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer), P::abi_decode(buffer), Q::abi_decode(buffer), R::abi_decode(buffer), S::abi_decode(buffer), T::abi_decode(buffer), U::abi_decode(buffer), V::abi_decode(buffer), W::abi_decode(buffer),) } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, P: AbiDecode, Q: AbiDecode, R: AbiDecode, S: AbiDecode, T: AbiDecode, U: AbiDecode, V: AbiDecode, W: AbiDecode, X: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer), P::abi_decode(buffer), Q::abi_decode(buffer), R::abi_decode(buffer), S::abi_decode(buffer), T::abi_decode(buffer), U::abi_decode(buffer), V::abi_decode(buffer), W::abi_decode(buffer), X::abi_decode(buffer),) } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, P: AbiDecode, Q: AbiDecode, R: AbiDecode, S: AbiDecode, T: AbiDecode, U: AbiDecode, V: AbiDecode, W: AbiDecode, X: AbiDecode, Y: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer), P::abi_decode(buffer), Q::abi_decode(buffer), R::abi_decode(buffer), S::abi_decode(buffer), T::abi_decode(buffer), U::abi_decode(buffer), V::abi_decode(buffer), W::abi_decode(buffer), X::abi_decode(buffer), Y::abi_decode(buffer),) } } +impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, P: AbiDecode, Q: AbiDecode, R: AbiDecode, S: AbiDecode, T: AbiDecode, U: AbiDecode, V: AbiDecode, W: AbiDecode, X: AbiDecode, Y: AbiDecode, Z: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer), P::abi_decode(buffer), Q::abi_decode(buffer), R::abi_decode(buffer), S::abi_decode(buffer), T::abi_decode(buffer), U::abi_decode(buffer), V::abi_decode(buffer), W::abi_decode(buffer), X::abi_decode(buffer), Y::abi_decode(buffer), Z::abi_decode(buffer),) } } // END TUPLES_DECODE use ::ops::*; From 098eac8e4ed80113f9fc71c28103b5bb6fe4e470 Mon Sep 17 00:00:00 2001 From: xunilrj Date: Wed, 3 Apr 2024 15:02:21 +0100 Subject: [PATCH 4/8] clippy and fmt issues --- sway-core/src/ir_generation/const_eval.rs | 1 + .../ast_node/declaration/auto_impl.rs | 18 ++++++----- sway-core/src/semantic_analysis/module.rs | 31 +++++++++++-------- .../semantic_analysis/type_check_context.rs | 2 +- sway-core/src/type_system/engine.rs | 4 +-- sway-error/src/error.rs | 2 +- sway-ir/src/parser.rs | 1 + sway-parse/src/attribute.rs | 2 +- sway-parse/src/parse.rs | 2 +- swayfmt/src/utils/map/byte_span.rs | 2 +- 10 files changed, 37 insertions(+), 28 deletions(-) diff --git a/sway-core/src/ir_generation/const_eval.rs b/sway-core/src/ir_generation/const_eval.rs index 921f2ed6562..4248f76f66d 100644 --- a/sway-core/src/ir_generation/const_eval.rs +++ b/sway-core/src/ir_generation/const_eval.rs @@ -31,6 +31,7 @@ use sway_types::{ident::Ident, integer_bits::IntegerBits, span::Spanned, Span}; use sway_utils::mapped_stack::MappedStack; enum ConstEvalError { + #[allow(dead_code)] CompileError(CompileError), CannotBeEvaluatedToConst { // This is not used at the moment because we do not give detailed description of why a diff --git a/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl.rs b/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl.rs index fe6751b39fb..ddbef6b5ade 100644 --- a/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl.rs +++ b/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl.rs @@ -1,9 +1,13 @@ use crate::{ - asm_generation::fuel::compiler_constants::MISMATCHED_SELECTOR_REVERT_CODE, decl_engine::{DeclEngineGet, DeclId, DeclRef}, language::{ + asm_generation::fuel::compiler_constants::MISMATCHED_SELECTOR_REVERT_CODE, + decl_engine::{DeclEngineGet, DeclId, DeclRef}, + language::{ parsed::{self, AstNodeContent, Declaration, FunctionDeclarationKind}, ty::{self, TyAstNode, TyDecl, TyEnumDecl, TyFunctionDecl, TyStructDecl}, Purity, - }, namespace, semantic_analysis::TypeCheckContext, Engines, Length, TypeArgument, TypeId, TypeInfo, TypeParameter + }, + semantic_analysis::TypeCheckContext, + Engines, TypeId, TypeInfo, TypeParameter, }; use itertools::Itertools; use sway_error::{ @@ -358,9 +362,11 @@ where assert!(!handler.has_errors(), "{:?}", handler); let ctx = self.ctx.by_ref(); - let (decl, namespace) = ctx.scoped_and_namespace(|ctx| { - TyDecl::type_check(&handler, ctx, Declaration::ImplTrait(decl)) - }).unwrap(); + let (decl, namespace) = ctx + .scoped_and_namespace(|ctx| { + TyDecl::type_check(&handler, ctx, Declaration::ImplTrait(decl)) + }) + .unwrap(); // Uncomment this to understand why auto impl failed for a type. // println!("{:#?}", handler); @@ -440,8 +446,6 @@ where let abi_encode_node = self.parse_item_impl_to_typed_ast_node(engines, module_id, &abi_encode_code); - - let abi_decode_body = self.generate_abi_decode_enum_body(engines, &enum_decl); let abi_decode_code = self.generate_abi_decode_code( enum_decl.name(), diff --git a/sway-core/src/semantic_analysis/module.rs b/sway-core/src/semantic_analysis/module.rs index 401e773f351..f14a3e8eb21 100644 --- a/sway-core/src/semantic_analysis/module.rs +++ b/sway-core/src/semantic_analysis/module.rs @@ -9,7 +9,7 @@ use sway_error::{ error::CompileError, handler::{ErrorEmitted, Handler}, }; -use sway_types::{BaseIdent, Named, Span}; +use sway_types::{BaseIdent, Named}; use crate::{ decl_engine::{DeclEngineGet, DeclId}, @@ -328,15 +328,21 @@ impl ty::TyModule { (TreeType::Predicate, true) => { let mut fn_generator = auto_impl::AutoImplAbiEncodeContext::new(&mut ctx).unwrap(); - let node = fn_generator - .generate_predicate_entry(engines, main_decl.as_ref().unwrap(), handler)?; + let node = fn_generator.generate_predicate_entry( + engines, + main_decl.as_ref().unwrap(), + handler, + )?; all_nodes.push(node) } (TreeType::Script, true) => { let mut fn_generator = auto_impl::AutoImplAbiEncodeContext::new(&mut ctx).unwrap(); - let node = fn_generator - .generate_script_entry(engines, main_decl.as_ref().unwrap(), handler)?; + let node = fn_generator.generate_script_entry( + engines, + main_decl.as_ref().unwrap(), + handler, + )?; all_nodes.push(node) } (TreeType::Contract, _) => { @@ -350,14 +356,13 @@ impl ty::TyModule { let mut fn_generator = auto_impl::AutoImplAbiEncodeContext::new(&mut ctx).unwrap(); - let node = fn_generator - .generate_contract_entry( - engines, - parsed.span.source_id().map(|x| x.module_id()), - &contract_fns, - fallback_fn, - handler, - )?; + let node = fn_generator.generate_contract_entry( + engines, + parsed.span.source_id().map(|x| x.module_id()), + &contract_fns, + fallback_fn, + handler, + )?; all_nodes.push(node) } _ => {} diff --git a/sway-core/src/semantic_analysis/type_check_context.rs b/sway-core/src/semantic_analysis/type_check_context.rs index 11084cf3458..283ff08728d 100644 --- a/sway-core/src/semantic_analysis/type_check_context.rs +++ b/sway-core/src/semantic_analysis/type_check_context.rs @@ -232,7 +232,7 @@ impl<'a> TypeCheckContext<'a> { }; with_scoped_ctx(ctx) } - + /// Scope the `TypeCheckContext` with a new namespace but update the original if success. pub fn scoped_and_namespace( self, diff --git a/sway-core/src/type_system/engine.rs b/sway-core/src/type_system/engine.rs index 5fc92e14977..ef0b459055d 100644 --- a/sway-core/src/type_system/engine.rs +++ b/sway-core/src/type_system/engine.rs @@ -40,9 +40,7 @@ impl TypeEngine { ty: TypeInfo, source_id: Option<&SourceId>, ) -> TypeId { - let source_id = source_id - .map(Clone::clone) - .or_else(|| info_to_source_id(&ty)); + let source_id = source_id.copied().or_else(|| info_to_source_id(&ty)); let tsi = TypeSourceInfo { type_info: ty.clone().into(), source_id, diff --git a/sway-error/src/error.rs b/sway-error/src/error.rs index 57d91edada1..d02e04466e4 100644 --- a/sway-error/src/error.rs +++ b/sway-error/src/error.rs @@ -867,7 +867,7 @@ pub enum CompileError { #[error("Fallback functions cannot have parameters")] FallbackFnsCannotHaveParameters { span: Span }, #[error("Could not generate the entry method because one of the arguments does not implement AbiEncode/AbiDecode")] - CouldNotGenerateEntry { span: Span } + CouldNotGenerateEntry { span: Span }, } impl std::convert::From for CompileError { diff --git a/sway-ir/src/parser.rs b/sway-ir/src/parser.rs index 6ec9ef8e9e5..d12124e704f 100644 --- a/sway-ir/src/parser.rs +++ b/sway-ir/src/parser.rs @@ -764,6 +764,7 @@ mod ir_builder { #[derive(Debug)] enum IrAstConstValue { + #[allow(dead_code)] Undef(IrAstTy), Unit, Bool(bool), diff --git a/sway-parse/src/attribute.rs b/sway-parse/src/attribute.rs index d6f683d06c0..84a174f3bf2 100644 --- a/sway-parse/src/attribute.rs +++ b/sway-parse/src/attribute.rs @@ -14,7 +14,7 @@ use sway_types::{Ident, Spanned}; impl Peek for DocComment { fn peek(peeker: Peeker<'_>) -> Option { - peeker.peek_doc_comment().ok().map(Clone::clone) + peeker.peek_doc_comment().ok().cloned() } } diff --git a/sway-parse/src/parse.rs b/sway-parse/src/parse.rs index 986f22bbf73..f96ffa0d132 100644 --- a/sway-parse/src/parse.rs +++ b/sway-parse/src/parse.rs @@ -125,7 +125,7 @@ where impl Peek for Ident { fn peek(peeker: Peeker<'_>) -> Option { - peeker.peek_ident().ok().map(Ident::clone) + peeker.peek_ident().ok().cloned() } } diff --git a/swayfmt/src/utils/map/byte_span.rs b/swayfmt/src/utils/map/byte_span.rs index 63ddf12b3f6..36578739dcf 100644 --- a/swayfmt/src/utils/map/byte_span.rs +++ b/swayfmt/src/utils/map/byte_span.rs @@ -233,7 +233,7 @@ mod tests { let second_span = ByteSpan { start: 2, end: 4 }; let third_span = ByteSpan { start: 4, end: 7 }; - let mut vec = vec![second_span.clone(), third_span.clone(), first_span.clone()]; + let mut vec = [second_span.clone(), third_span.clone(), first_span.clone()]; vec.sort(); assert_eq!(vec[0], first_span); From 3972c6a9bc3a0ebb69048b89907f4e986872759b Mon Sep 17 00:00:00 2001 From: xunilrj Date: Wed, 3 Apr 2024 15:07:35 +0100 Subject: [PATCH 5/8] formatting codec.sw --- sway-lib-core/src/codec.sw | 5398 +++++++++++++++++++++++++++++++++--- 1 file changed, 4993 insertions(+), 405 deletions(-) diff --git a/sway-lib-core/src/codec.sw b/sway-lib-core/src/codec.sw index f53365a3a65..8749d5fc02a 100644 --- a/sway-lib-core/src/codec.sw +++ b/sway-lib-core/src/codec.sw @@ -306,417 +306,4129 @@ impl AbiEncode for str[0] { } // BEGIN STRARRAY_ENCODE -impl AbiEncode for str[1] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[2] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[3] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[4] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[5] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[6] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[7] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[8] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[9] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[10] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[11] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[12] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[13] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[14] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[15] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[16] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[17] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[18] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[19] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[20] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[21] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[22] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[23] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[24] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[25] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[26] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[27] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[28] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[29] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[30] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[31] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[32] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[33] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[34] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[35] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[36] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[37] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[38] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[39] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[40] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[41] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[42] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[43] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[44] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[45] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[46] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[47] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[48] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[49] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[50] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[51] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[52] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[53] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[54] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[55] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[56] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[57] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[58] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[59] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[60] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[61] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[62] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[63] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -impl AbiEncode for str[64] { fn abi_encode(self, ref mut buffer: Buffer) { use ::str::*; let s = from_str_array(self); let len = s.len(); let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; } } } -// END STRARRAY_ENCODE - -// Encode Arrays and Slices - -impl AbiEncode for raw_slice { +impl AbiEncode for str[1] { fn abi_encode(self, ref mut buffer: Buffer) { - let len = self.number_of_bytes(); - buffer.push_u64(len); - - let ptr = self.ptr(); - + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[2] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[3] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[4] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[5] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[6] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[7] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[8] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[9] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[10] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[11] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[12] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[13] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[14] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[15] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[16] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[17] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[18] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[19] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[20] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[21] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[22] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[23] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[24] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[25] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); let mut i = 0; while i < len { let byte = ptr.add::(i).read::(); buffer.push_byte(byte); i += 1; - } + } + } +} +impl AbiEncode for str[26] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[27] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[28] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[29] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[30] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[31] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[32] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[33] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[34] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[35] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[36] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[37] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[38] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[39] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[40] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[41] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[42] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[43] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[44] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[45] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[46] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[47] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[48] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[49] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[50] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[51] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[52] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[53] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[54] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[55] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[56] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[57] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[58] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[59] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[60] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[61] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[62] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[63] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +impl AbiEncode for str[64] { + fn abi_encode(self, ref mut buffer: Buffer) { + use ::str::*; + let s = from_str_array(self); + let len = s.len(); + let ptr = s.as_ptr(); + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} +// END STRARRAY_ENCODE + +// Encode Arrays and Slices + +impl AbiEncode for raw_slice { + fn abi_encode(self, ref mut buffer: Buffer) { + let len = self.number_of_bytes(); + buffer.push_u64(len); + + let ptr = self.ptr(); + + let mut i = 0; + while i < len { + let byte = ptr.add::(i).read::(); + buffer.push_byte(byte); + i += 1; + } + } +} + +// BEGIN ARRAY_ENCODE +impl AbiEncode for [T; 1] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 1 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 2] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 2 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 3] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 3 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 4] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 4 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 5] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 5 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 6] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 6 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 7] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 7 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 8] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 8 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 9] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 9 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 10] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 10 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 11] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 11 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 12] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 12 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 13] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 13 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 14] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 14 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 15] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 15 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 16] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 16 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 17] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 17 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 18] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 18 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 19] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 19 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 20] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 20 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 21] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 21 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 22] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 22 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 23] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 23 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 24] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 24 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 25] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 25 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 26] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 26 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 27] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 27 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 28] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 28 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 29] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 29 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 30] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 30 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 31] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 31 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 32] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 32 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 33] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 33 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 34] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 34 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 35] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 35 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 36] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 36 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 37] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 37 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 38] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 38 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 39] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 39 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 40] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 40 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 41] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 41 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 42] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 42 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 43] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 43 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 44] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 44 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 45] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 45 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 46] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 46 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 47] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 47 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 48] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 48 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 49] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 49 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 50] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 50 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 51] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 51 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 52] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 52 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 53] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 53 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 54] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 54 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 55] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 55 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 56] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 56 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 57] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 57 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 58] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 58 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 59] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 59 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 60] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 60 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 61] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 61 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 62] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 62 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 63] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 63 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +impl AbiEncode for [T; 64] +where + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + let mut i = 0; + while i < 64 { + self[i].abi_encode(buffer); + i += 1; + } + } +} +// END ARRAY_ENCODE + +// Encode Tuples + +impl AbiEncode for () { + fn abi_encode(self, ref mut _buffer: Buffer) {} +} + +// BEGIN TUPLES_ENCODE +impl AbiEncode for (A, ) +where + A: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + } +} +impl AbiEncode for (A, B) +where + A: AbiEncode, + B: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D, E) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, + E: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + self.4.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D, E, F) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, + E: AbiEncode, + F: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + self.4.abi_encode(buffer); + self.5.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D, E, F, G) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, + E: AbiEncode, + F: AbiEncode, + G: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + self.4.abi_encode(buffer); + self.5.abi_encode(buffer); + self.6.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D, E, F, G, H) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, + E: AbiEncode, + F: AbiEncode, + G: AbiEncode, + H: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + self.4.abi_encode(buffer); + self.5.abi_encode(buffer); + self.6.abi_encode(buffer); + self.7.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D, E, F, G, H, I) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, + E: AbiEncode, + F: AbiEncode, + G: AbiEncode, + H: AbiEncode, + I: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + self.4.abi_encode(buffer); + self.5.abi_encode(buffer); + self.6.abi_encode(buffer); + self.7.abi_encode(buffer); + self.8.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D, E, F, G, H, I, J) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, + E: AbiEncode, + F: AbiEncode, + G: AbiEncode, + H: AbiEncode, + I: AbiEncode, + J: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + self.4.abi_encode(buffer); + self.5.abi_encode(buffer); + self.6.abi_encode(buffer); + self.7.abi_encode(buffer); + self.8.abi_encode(buffer); + self.9.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, + E: AbiEncode, + F: AbiEncode, + G: AbiEncode, + H: AbiEncode, + I: AbiEncode, + J: AbiEncode, + K: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + self.4.abi_encode(buffer); + self.5.abi_encode(buffer); + self.6.abi_encode(buffer); + self.7.abi_encode(buffer); + self.8.abi_encode(buffer); + self.9.abi_encode(buffer); + self.10.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, + E: AbiEncode, + F: AbiEncode, + G: AbiEncode, + H: AbiEncode, + I: AbiEncode, + J: AbiEncode, + K: AbiEncode, + L: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + self.4.abi_encode(buffer); + self.5.abi_encode(buffer); + self.6.abi_encode(buffer); + self.7.abi_encode(buffer); + self.8.abi_encode(buffer); + self.9.abi_encode(buffer); + self.10.abi_encode(buffer); + self.11.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, + E: AbiEncode, + F: AbiEncode, + G: AbiEncode, + H: AbiEncode, + I: AbiEncode, + J: AbiEncode, + K: AbiEncode, + L: AbiEncode, + M: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + self.4.abi_encode(buffer); + self.5.abi_encode(buffer); + self.6.abi_encode(buffer); + self.7.abi_encode(buffer); + self.8.abi_encode(buffer); + self.9.abi_encode(buffer); + self.10.abi_encode(buffer); + self.11.abi_encode(buffer); + self.12.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, + E: AbiEncode, + F: AbiEncode, + G: AbiEncode, + H: AbiEncode, + I: AbiEncode, + J: AbiEncode, + K: AbiEncode, + L: AbiEncode, + M: AbiEncode, + N: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + self.4.abi_encode(buffer); + self.5.abi_encode(buffer); + self.6.abi_encode(buffer); + self.7.abi_encode(buffer); + self.8.abi_encode(buffer); + self.9.abi_encode(buffer); + self.10.abi_encode(buffer); + self.11.abi_encode(buffer); + self.12.abi_encode(buffer); + self.13.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, + E: AbiEncode, + F: AbiEncode, + G: AbiEncode, + H: AbiEncode, + I: AbiEncode, + J: AbiEncode, + K: AbiEncode, + L: AbiEncode, + M: AbiEncode, + N: AbiEncode, + O: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + self.4.abi_encode(buffer); + self.5.abi_encode(buffer); + self.6.abi_encode(buffer); + self.7.abi_encode(buffer); + self.8.abi_encode(buffer); + self.9.abi_encode(buffer); + self.10.abi_encode(buffer); + self.11.abi_encode(buffer); + self.12.abi_encode(buffer); + self.13.abi_encode(buffer); + self.14.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, + E: AbiEncode, + F: AbiEncode, + G: AbiEncode, + H: AbiEncode, + I: AbiEncode, + J: AbiEncode, + K: AbiEncode, + L: AbiEncode, + M: AbiEncode, + N: AbiEncode, + O: AbiEncode, + P: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + self.4.abi_encode(buffer); + self.5.abi_encode(buffer); + self.6.abi_encode(buffer); + self.7.abi_encode(buffer); + self.8.abi_encode(buffer); + self.9.abi_encode(buffer); + self.10.abi_encode(buffer); + self.11.abi_encode(buffer); + self.12.abi_encode(buffer); + self.13.abi_encode(buffer); + self.14.abi_encode(buffer); + self.15.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, + E: AbiEncode, + F: AbiEncode, + G: AbiEncode, + H: AbiEncode, + I: AbiEncode, + J: AbiEncode, + K: AbiEncode, + L: AbiEncode, + M: AbiEncode, + N: AbiEncode, + O: AbiEncode, + P: AbiEncode, + Q: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + self.4.abi_encode(buffer); + self.5.abi_encode(buffer); + self.6.abi_encode(buffer); + self.7.abi_encode(buffer); + self.8.abi_encode(buffer); + self.9.abi_encode(buffer); + self.10.abi_encode(buffer); + self.11.abi_encode(buffer); + self.12.abi_encode(buffer); + self.13.abi_encode(buffer); + self.14.abi_encode(buffer); + self.15.abi_encode(buffer); + self.16.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, + E: AbiEncode, + F: AbiEncode, + G: AbiEncode, + H: AbiEncode, + I: AbiEncode, + J: AbiEncode, + K: AbiEncode, + L: AbiEncode, + M: AbiEncode, + N: AbiEncode, + O: AbiEncode, + P: AbiEncode, + Q: AbiEncode, + R: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + self.4.abi_encode(buffer); + self.5.abi_encode(buffer); + self.6.abi_encode(buffer); + self.7.abi_encode(buffer); + self.8.abi_encode(buffer); + self.9.abi_encode(buffer); + self.10.abi_encode(buffer); + self.11.abi_encode(buffer); + self.12.abi_encode(buffer); + self.13.abi_encode(buffer); + self.14.abi_encode(buffer); + self.15.abi_encode(buffer); + self.16.abi_encode(buffer); + self.17.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, + E: AbiEncode, + F: AbiEncode, + G: AbiEncode, + H: AbiEncode, + I: AbiEncode, + J: AbiEncode, + K: AbiEncode, + L: AbiEncode, + M: AbiEncode, + N: AbiEncode, + O: AbiEncode, + P: AbiEncode, + Q: AbiEncode, + R: AbiEncode, + S: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + self.4.abi_encode(buffer); + self.5.abi_encode(buffer); + self.6.abi_encode(buffer); + self.7.abi_encode(buffer); + self.8.abi_encode(buffer); + self.9.abi_encode(buffer); + self.10.abi_encode(buffer); + self.11.abi_encode(buffer); + self.12.abi_encode(buffer); + self.13.abi_encode(buffer); + self.14.abi_encode(buffer); + self.15.abi_encode(buffer); + self.16.abi_encode(buffer); + self.17.abi_encode(buffer); + self.18.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, + E: AbiEncode, + F: AbiEncode, + G: AbiEncode, + H: AbiEncode, + I: AbiEncode, + J: AbiEncode, + K: AbiEncode, + L: AbiEncode, + M: AbiEncode, + N: AbiEncode, + O: AbiEncode, + P: AbiEncode, + Q: AbiEncode, + R: AbiEncode, + S: AbiEncode, + T: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + self.4.abi_encode(buffer); + self.5.abi_encode(buffer); + self.6.abi_encode(buffer); + self.7.abi_encode(buffer); + self.8.abi_encode(buffer); + self.9.abi_encode(buffer); + self.10.abi_encode(buffer); + self.11.abi_encode(buffer); + self.12.abi_encode(buffer); + self.13.abi_encode(buffer); + self.14.abi_encode(buffer); + self.15.abi_encode(buffer); + self.16.abi_encode(buffer); + self.17.abi_encode(buffer); + self.18.abi_encode(buffer); + self.19.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, + E: AbiEncode, + F: AbiEncode, + G: AbiEncode, + H: AbiEncode, + I: AbiEncode, + J: AbiEncode, + K: AbiEncode, + L: AbiEncode, + M: AbiEncode, + N: AbiEncode, + O: AbiEncode, + P: AbiEncode, + Q: AbiEncode, + R: AbiEncode, + S: AbiEncode, + T: AbiEncode, + U: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + self.4.abi_encode(buffer); + self.5.abi_encode(buffer); + self.6.abi_encode(buffer); + self.7.abi_encode(buffer); + self.8.abi_encode(buffer); + self.9.abi_encode(buffer); + self.10.abi_encode(buffer); + self.11.abi_encode(buffer); + self.12.abi_encode(buffer); + self.13.abi_encode(buffer); + self.14.abi_encode(buffer); + self.15.abi_encode(buffer); + self.16.abi_encode(buffer); + self.17.abi_encode(buffer); + self.18.abi_encode(buffer); + self.19.abi_encode(buffer); + self.20.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, + E: AbiEncode, + F: AbiEncode, + G: AbiEncode, + H: AbiEncode, + I: AbiEncode, + J: AbiEncode, + K: AbiEncode, + L: AbiEncode, + M: AbiEncode, + N: AbiEncode, + O: AbiEncode, + P: AbiEncode, + Q: AbiEncode, + R: AbiEncode, + S: AbiEncode, + T: AbiEncode, + U: AbiEncode, + V: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + self.4.abi_encode(buffer); + self.5.abi_encode(buffer); + self.6.abi_encode(buffer); + self.7.abi_encode(buffer); + self.8.abi_encode(buffer); + self.9.abi_encode(buffer); + self.10.abi_encode(buffer); + self.11.abi_encode(buffer); + self.12.abi_encode(buffer); + self.13.abi_encode(buffer); + self.14.abi_encode(buffer); + self.15.abi_encode(buffer); + self.16.abi_encode(buffer); + self.17.abi_encode(buffer); + self.18.abi_encode(buffer); + self.19.abi_encode(buffer); + self.20.abi_encode(buffer); + self.21.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, + E: AbiEncode, + F: AbiEncode, + G: AbiEncode, + H: AbiEncode, + I: AbiEncode, + J: AbiEncode, + K: AbiEncode, + L: AbiEncode, + M: AbiEncode, + N: AbiEncode, + O: AbiEncode, + P: AbiEncode, + Q: AbiEncode, + R: AbiEncode, + S: AbiEncode, + T: AbiEncode, + U: AbiEncode, + V: AbiEncode, + W: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + self.4.abi_encode(buffer); + self.5.abi_encode(buffer); + self.6.abi_encode(buffer); + self.7.abi_encode(buffer); + self.8.abi_encode(buffer); + self.9.abi_encode(buffer); + self.10.abi_encode(buffer); + self.11.abi_encode(buffer); + self.12.abi_encode(buffer); + self.13.abi_encode(buffer); + self.14.abi_encode(buffer); + self.15.abi_encode(buffer); + self.16.abi_encode(buffer); + self.17.abi_encode(buffer); + self.18.abi_encode(buffer); + self.19.abi_encode(buffer); + self.20.abi_encode(buffer); + self.21.abi_encode(buffer); + self.22.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, + E: AbiEncode, + F: AbiEncode, + G: AbiEncode, + H: AbiEncode, + I: AbiEncode, + J: AbiEncode, + K: AbiEncode, + L: AbiEncode, + M: AbiEncode, + N: AbiEncode, + O: AbiEncode, + P: AbiEncode, + Q: AbiEncode, + R: AbiEncode, + S: AbiEncode, + T: AbiEncode, + U: AbiEncode, + V: AbiEncode, + W: AbiEncode, + X: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + self.4.abi_encode(buffer); + self.5.abi_encode(buffer); + self.6.abi_encode(buffer); + self.7.abi_encode(buffer); + self.8.abi_encode(buffer); + self.9.abi_encode(buffer); + self.10.abi_encode(buffer); + self.11.abi_encode(buffer); + self.12.abi_encode(buffer); + self.13.abi_encode(buffer); + self.14.abi_encode(buffer); + self.15.abi_encode(buffer); + self.16.abi_encode(buffer); + self.17.abi_encode(buffer); + self.18.abi_encode(buffer); + self.19.abi_encode(buffer); + self.20.abi_encode(buffer); + self.21.abi_encode(buffer); + self.22.abi_encode(buffer); + self.23.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, + E: AbiEncode, + F: AbiEncode, + G: AbiEncode, + H: AbiEncode, + I: AbiEncode, + J: AbiEncode, + K: AbiEncode, + L: AbiEncode, + M: AbiEncode, + N: AbiEncode, + O: AbiEncode, + P: AbiEncode, + Q: AbiEncode, + R: AbiEncode, + S: AbiEncode, + T: AbiEncode, + U: AbiEncode, + V: AbiEncode, + W: AbiEncode, + X: AbiEncode, + Y: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + self.4.abi_encode(buffer); + self.5.abi_encode(buffer); + self.6.abi_encode(buffer); + self.7.abi_encode(buffer); + self.8.abi_encode(buffer); + self.9.abi_encode(buffer); + self.10.abi_encode(buffer); + self.11.abi_encode(buffer); + self.12.abi_encode(buffer); + self.13.abi_encode(buffer); + self.14.abi_encode(buffer); + self.15.abi_encode(buffer); + self.16.abi_encode(buffer); + self.17.abi_encode(buffer); + self.18.abi_encode(buffer); + self.19.abi_encode(buffer); + self.20.abi_encode(buffer); + self.21.abi_encode(buffer); + self.22.abi_encode(buffer); + self.23.abi_encode(buffer); + self.24.abi_encode(buffer); + } +} +impl AbiEncode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z) +where + A: AbiEncode, + B: AbiEncode, + C: AbiEncode, + D: AbiEncode, + E: AbiEncode, + F: AbiEncode, + G: AbiEncode, + H: AbiEncode, + I: AbiEncode, + J: AbiEncode, + K: AbiEncode, + L: AbiEncode, + M: AbiEncode, + N: AbiEncode, + O: AbiEncode, + P: AbiEncode, + Q: AbiEncode, + R: AbiEncode, + S: AbiEncode, + T: AbiEncode, + U: AbiEncode, + V: AbiEncode, + W: AbiEncode, + X: AbiEncode, + Y: AbiEncode, + Z: AbiEncode, +{ + fn abi_encode(self, ref mut buffer: Buffer) { + self.0.abi_encode(buffer); + self.1.abi_encode(buffer); + self.2.abi_encode(buffer); + self.3.abi_encode(buffer); + self.4.abi_encode(buffer); + self.5.abi_encode(buffer); + self.6.abi_encode(buffer); + self.7.abi_encode(buffer); + self.8.abi_encode(buffer); + self.9.abi_encode(buffer); + self.10.abi_encode(buffer); + self.11.abi_encode(buffer); + self.12.abi_encode(buffer); + self.13.abi_encode(buffer); + self.14.abi_encode(buffer); + self.15.abi_encode(buffer); + self.16.abi_encode(buffer); + self.17.abi_encode(buffer); + self.18.abi_encode(buffer); + self.19.abi_encode(buffer); + self.20.abi_encode(buffer); + self.21.abi_encode(buffer); + self.22.abi_encode(buffer); + self.23.abi_encode(buffer); + self.24.abi_encode(buffer); + self.25.abi_encode(buffer); + } +} +// END TUPLES_ENCODE + +pub fn encode(item: T) -> raw_slice +where + T: AbiEncode, +{ + let mut buffer = Buffer::new(); + item.abi_encode(buffer); + buffer.as_raw_slice() +} + +pub fn abi_decode(data: raw_slice) -> T +where + T: AbiDecode, +{ + let mut buffer = BufferReader::from_parts(data.ptr(), data.len::()); + T::abi_decode(buffer) +} + +// Decode + +pub trait AbiDecode { + fn abi_decode(ref mut buffer: BufferReader) -> Self; +} + +impl AbiDecode for b256 { + fn abi_decode(ref mut buffer: BufferReader) -> b256 { + buffer.read::() + } +} + +impl AbiDecode for u256 { + fn abi_decode(ref mut buffer: BufferReader) -> u256 { + buffer.read::() + } +} + +impl AbiDecode for u64 { + fn abi_decode(ref mut buffer: BufferReader) -> u64 { + buffer.read::() + } +} + +impl AbiDecode for u32 { + fn abi_decode(ref mut buffer: BufferReader) -> u32 { + use ::primitive_conversions::*; + let a = buffer.read::().as_u32(); + let b = buffer.read::().as_u32(); + let c = buffer.read::().as_u32(); + let d = buffer.read::().as_u32(); + (a << 24) | (b << 16) | (c << 8) | d + } +} + +impl AbiDecode for u16 { + fn abi_decode(ref mut buffer: BufferReader) -> u16 { + use ::primitive_conversions::*; + let a = buffer.read::().as_u16(); + let b = buffer.read::().as_u16(); + (a << 8) | b + } +} + +impl AbiDecode for u8 { + fn abi_decode(ref mut buffer: BufferReader) -> u8 { + buffer.read::() + } +} + +impl AbiDecode for bool { + fn abi_decode(ref mut buffer: BufferReader) -> bool { + buffer.read::() + } +} + +impl AbiDecode for raw_slice { + fn abi_decode(ref mut buffer: BufferReader) -> raw_slice { + let len = u64::abi_decode(buffer); + let data = buffer.read_bytes(len); + asm(s: (data.ptr(), len)) { + s: raw_slice + } + } +} + +impl AbiDecode for str { + fn abi_decode(ref mut buffer: BufferReader) -> str { + let len = u64::abi_decode(buffer); + let data = buffer.read_bytes(len); + asm(s: (data.ptr(), len)) { + s: str + } + } +} + +// BEGIN STRARRAY_DECODE +impl AbiDecode for str[1] { + fn abi_decode(ref mut buffer: BufferReader) -> str[1] { + let data = buffer.read_bytes(1); + asm(s: data.ptr()) { + s: str[1] + } + } +} +impl AbiDecode for str[2] { + fn abi_decode(ref mut buffer: BufferReader) -> str[2] { + let data = buffer.read_bytes(2); + asm(s: data.ptr()) { + s: str[2] + } + } +} +impl AbiDecode for str[3] { + fn abi_decode(ref mut buffer: BufferReader) -> str[3] { + let data = buffer.read_bytes(3); + asm(s: data.ptr()) { + s: str[3] + } + } +} +impl AbiDecode for str[4] { + fn abi_decode(ref mut buffer: BufferReader) -> str[4] { + let data = buffer.read_bytes(4); + asm(s: data.ptr()) { + s: str[4] + } + } +} +impl AbiDecode for str[5] { + fn abi_decode(ref mut buffer: BufferReader) -> str[5] { + let data = buffer.read_bytes(5); + asm(s: data.ptr()) { + s: str[5] + } + } +} +impl AbiDecode for str[6] { + fn abi_decode(ref mut buffer: BufferReader) -> str[6] { + let data = buffer.read_bytes(6); + asm(s: data.ptr()) { + s: str[6] + } + } +} +impl AbiDecode for str[7] { + fn abi_decode(ref mut buffer: BufferReader) -> str[7] { + let data = buffer.read_bytes(7); + asm(s: data.ptr()) { + s: str[7] + } + } +} +impl AbiDecode for str[8] { + fn abi_decode(ref mut buffer: BufferReader) -> str[8] { + let data = buffer.read_bytes(8); + asm(s: data.ptr()) { + s: str[8] + } + } +} +impl AbiDecode for str[9] { + fn abi_decode(ref mut buffer: BufferReader) -> str[9] { + let data = buffer.read_bytes(9); + asm(s: data.ptr()) { + s: str[9] + } + } +} +impl AbiDecode for str[10] { + fn abi_decode(ref mut buffer: BufferReader) -> str[10] { + let data = buffer.read_bytes(10); + asm(s: data.ptr()) { + s: str[10] + } + } +} +impl AbiDecode for str[11] { + fn abi_decode(ref mut buffer: BufferReader) -> str[11] { + let data = buffer.read_bytes(11); + asm(s: data.ptr()) { + s: str[11] + } + } +} +impl AbiDecode for str[12] { + fn abi_decode(ref mut buffer: BufferReader) -> str[12] { + let data = buffer.read_bytes(12); + asm(s: data.ptr()) { + s: str[12] + } + } +} +impl AbiDecode for str[13] { + fn abi_decode(ref mut buffer: BufferReader) -> str[13] { + let data = buffer.read_bytes(13); + asm(s: data.ptr()) { + s: str[13] + } + } +} +impl AbiDecode for str[14] { + fn abi_decode(ref mut buffer: BufferReader) -> str[14] { + let data = buffer.read_bytes(14); + asm(s: data.ptr()) { + s: str[14] + } + } +} +impl AbiDecode for str[15] { + fn abi_decode(ref mut buffer: BufferReader) -> str[15] { + let data = buffer.read_bytes(15); + asm(s: data.ptr()) { + s: str[15] + } + } +} +impl AbiDecode for str[16] { + fn abi_decode(ref mut buffer: BufferReader) -> str[16] { + let data = buffer.read_bytes(16); + asm(s: data.ptr()) { + s: str[16] + } + } +} +impl AbiDecode for str[17] { + fn abi_decode(ref mut buffer: BufferReader) -> str[17] { + let data = buffer.read_bytes(17); + asm(s: data.ptr()) { + s: str[17] + } + } +} +impl AbiDecode for str[18] { + fn abi_decode(ref mut buffer: BufferReader) -> str[18] { + let data = buffer.read_bytes(18); + asm(s: data.ptr()) { + s: str[18] + } + } +} +impl AbiDecode for str[19] { + fn abi_decode(ref mut buffer: BufferReader) -> str[19] { + let data = buffer.read_bytes(19); + asm(s: data.ptr()) { + s: str[19] + } + } +} +impl AbiDecode for str[20] { + fn abi_decode(ref mut buffer: BufferReader) -> str[20] { + let data = buffer.read_bytes(20); + asm(s: data.ptr()) { + s: str[20] + } + } +} +impl AbiDecode for str[21] { + fn abi_decode(ref mut buffer: BufferReader) -> str[21] { + let data = buffer.read_bytes(21); + asm(s: data.ptr()) { + s: str[21] + } + } +} +impl AbiDecode for str[22] { + fn abi_decode(ref mut buffer: BufferReader) -> str[22] { + let data = buffer.read_bytes(22); + asm(s: data.ptr()) { + s: str[22] + } + } +} +impl AbiDecode for str[23] { + fn abi_decode(ref mut buffer: BufferReader) -> str[23] { + let data = buffer.read_bytes(23); + asm(s: data.ptr()) { + s: str[23] + } + } +} +impl AbiDecode for str[24] { + fn abi_decode(ref mut buffer: BufferReader) -> str[24] { + let data = buffer.read_bytes(24); + asm(s: data.ptr()) { + s: str[24] + } + } +} +impl AbiDecode for str[25] { + fn abi_decode(ref mut buffer: BufferReader) -> str[25] { + let data = buffer.read_bytes(25); + asm(s: data.ptr()) { + s: str[25] + } + } +} +impl AbiDecode for str[26] { + fn abi_decode(ref mut buffer: BufferReader) -> str[26] { + let data = buffer.read_bytes(26); + asm(s: data.ptr()) { + s: str[26] + } + } +} +impl AbiDecode for str[27] { + fn abi_decode(ref mut buffer: BufferReader) -> str[27] { + let data = buffer.read_bytes(27); + asm(s: data.ptr()) { + s: str[27] + } + } +} +impl AbiDecode for str[28] { + fn abi_decode(ref mut buffer: BufferReader) -> str[28] { + let data = buffer.read_bytes(28); + asm(s: data.ptr()) { + s: str[28] + } + } +} +impl AbiDecode for str[29] { + fn abi_decode(ref mut buffer: BufferReader) -> str[29] { + let data = buffer.read_bytes(29); + asm(s: data.ptr()) { + s: str[29] + } + } +} +impl AbiDecode for str[30] { + fn abi_decode(ref mut buffer: BufferReader) -> str[30] { + let data = buffer.read_bytes(30); + asm(s: data.ptr()) { + s: str[30] + } + } +} +impl AbiDecode for str[31] { + fn abi_decode(ref mut buffer: BufferReader) -> str[31] { + let data = buffer.read_bytes(31); + asm(s: data.ptr()) { + s: str[31] + } + } +} +impl AbiDecode for str[32] { + fn abi_decode(ref mut buffer: BufferReader) -> str[32] { + let data = buffer.read_bytes(32); + asm(s: data.ptr()) { + s: str[32] + } + } +} +impl AbiDecode for str[33] { + fn abi_decode(ref mut buffer: BufferReader) -> str[33] { + let data = buffer.read_bytes(33); + asm(s: data.ptr()) { + s: str[33] + } + } +} +impl AbiDecode for str[34] { + fn abi_decode(ref mut buffer: BufferReader) -> str[34] { + let data = buffer.read_bytes(34); + asm(s: data.ptr()) { + s: str[34] + } + } +} +impl AbiDecode for str[35] { + fn abi_decode(ref mut buffer: BufferReader) -> str[35] { + let data = buffer.read_bytes(35); + asm(s: data.ptr()) { + s: str[35] + } + } +} +impl AbiDecode for str[36] { + fn abi_decode(ref mut buffer: BufferReader) -> str[36] { + let data = buffer.read_bytes(36); + asm(s: data.ptr()) { + s: str[36] + } + } +} +impl AbiDecode for str[37] { + fn abi_decode(ref mut buffer: BufferReader) -> str[37] { + let data = buffer.read_bytes(37); + asm(s: data.ptr()) { + s: str[37] + } + } +} +impl AbiDecode for str[38] { + fn abi_decode(ref mut buffer: BufferReader) -> str[38] { + let data = buffer.read_bytes(38); + asm(s: data.ptr()) { + s: str[38] + } + } +} +impl AbiDecode for str[39] { + fn abi_decode(ref mut buffer: BufferReader) -> str[39] { + let data = buffer.read_bytes(39); + asm(s: data.ptr()) { + s: str[39] + } + } +} +impl AbiDecode for str[40] { + fn abi_decode(ref mut buffer: BufferReader) -> str[40] { + let data = buffer.read_bytes(40); + asm(s: data.ptr()) { + s: str[40] + } + } +} +impl AbiDecode for str[41] { + fn abi_decode(ref mut buffer: BufferReader) -> str[41] { + let data = buffer.read_bytes(41); + asm(s: data.ptr()) { + s: str[41] + } + } +} +impl AbiDecode for str[42] { + fn abi_decode(ref mut buffer: BufferReader) -> str[42] { + let data = buffer.read_bytes(42); + asm(s: data.ptr()) { + s: str[42] + } + } +} +impl AbiDecode for str[43] { + fn abi_decode(ref mut buffer: BufferReader) -> str[43] { + let data = buffer.read_bytes(43); + asm(s: data.ptr()) { + s: str[43] + } + } +} +impl AbiDecode for str[44] { + fn abi_decode(ref mut buffer: BufferReader) -> str[44] { + let data = buffer.read_bytes(44); + asm(s: data.ptr()) { + s: str[44] + } + } +} +impl AbiDecode for str[45] { + fn abi_decode(ref mut buffer: BufferReader) -> str[45] { + let data = buffer.read_bytes(45); + asm(s: data.ptr()) { + s: str[45] + } + } +} +impl AbiDecode for str[46] { + fn abi_decode(ref mut buffer: BufferReader) -> str[46] { + let data = buffer.read_bytes(46); + asm(s: data.ptr()) { + s: str[46] + } + } +} +impl AbiDecode for str[47] { + fn abi_decode(ref mut buffer: BufferReader) -> str[47] { + let data = buffer.read_bytes(47); + asm(s: data.ptr()) { + s: str[47] + } + } +} +impl AbiDecode for str[48] { + fn abi_decode(ref mut buffer: BufferReader) -> str[48] { + let data = buffer.read_bytes(48); + asm(s: data.ptr()) { + s: str[48] + } + } +} +impl AbiDecode for str[49] { + fn abi_decode(ref mut buffer: BufferReader) -> str[49] { + let data = buffer.read_bytes(49); + asm(s: data.ptr()) { + s: str[49] + } + } +} +impl AbiDecode for str[50] { + fn abi_decode(ref mut buffer: BufferReader) -> str[50] { + let data = buffer.read_bytes(50); + asm(s: data.ptr()) { + s: str[50] + } + } +} +impl AbiDecode for str[51] { + fn abi_decode(ref mut buffer: BufferReader) -> str[51] { + let data = buffer.read_bytes(51); + asm(s: data.ptr()) { + s: str[51] + } + } +} +impl AbiDecode for str[52] { + fn abi_decode(ref mut buffer: BufferReader) -> str[52] { + let data = buffer.read_bytes(52); + asm(s: data.ptr()) { + s: str[52] + } + } +} +impl AbiDecode for str[53] { + fn abi_decode(ref mut buffer: BufferReader) -> str[53] { + let data = buffer.read_bytes(53); + asm(s: data.ptr()) { + s: str[53] + } + } +} +impl AbiDecode for str[54] { + fn abi_decode(ref mut buffer: BufferReader) -> str[54] { + let data = buffer.read_bytes(54); + asm(s: data.ptr()) { + s: str[54] + } + } +} +impl AbiDecode for str[55] { + fn abi_decode(ref mut buffer: BufferReader) -> str[55] { + let data = buffer.read_bytes(55); + asm(s: data.ptr()) { + s: str[55] + } + } +} +impl AbiDecode for str[56] { + fn abi_decode(ref mut buffer: BufferReader) -> str[56] { + let data = buffer.read_bytes(56); + asm(s: data.ptr()) { + s: str[56] + } + } +} +impl AbiDecode for str[57] { + fn abi_decode(ref mut buffer: BufferReader) -> str[57] { + let data = buffer.read_bytes(57); + asm(s: data.ptr()) { + s: str[57] + } + } +} +impl AbiDecode for str[58] { + fn abi_decode(ref mut buffer: BufferReader) -> str[58] { + let data = buffer.read_bytes(58); + asm(s: data.ptr()) { + s: str[58] + } + } +} +impl AbiDecode for str[59] { + fn abi_decode(ref mut buffer: BufferReader) -> str[59] { + let data = buffer.read_bytes(59); + asm(s: data.ptr()) { + s: str[59] + } + } +} +impl AbiDecode for str[60] { + fn abi_decode(ref mut buffer: BufferReader) -> str[60] { + let data = buffer.read_bytes(60); + asm(s: data.ptr()) { + s: str[60] + } + } +} +impl AbiDecode for str[61] { + fn abi_decode(ref mut buffer: BufferReader) -> str[61] { + let data = buffer.read_bytes(61); + asm(s: data.ptr()) { + s: str[61] + } + } +} +impl AbiDecode for str[62] { + fn abi_decode(ref mut buffer: BufferReader) -> str[62] { + let data = buffer.read_bytes(62); + asm(s: data.ptr()) { + s: str[62] + } + } +} +impl AbiDecode for str[63] { + fn abi_decode(ref mut buffer: BufferReader) -> str[63] { + let data = buffer.read_bytes(63); + asm(s: data.ptr()) { + s: str[63] + } + } +} +impl AbiDecode for str[64] { + fn abi_decode(ref mut buffer: BufferReader) -> str[64] { + let data = buffer.read_bytes(64); + asm(s: data.ptr()) { + s: str[64] + } + } +} +// END STRARRAY_DECODE + +// BEGIN ARRAY_DECODE +impl AbiDecode for [T; 1] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 1] { + let first: T = buffer.decode::(); + let mut array = [first; 1]; + let mut i = 1; + while i < 1 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 2] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 2] { + let first: T = buffer.decode::(); + let mut array = [first; 2]; + let mut i = 1; + while i < 2 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 3] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 3] { + let first: T = buffer.decode::(); + let mut array = [first; 3]; + let mut i = 1; + while i < 3 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 4] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 4] { + let first: T = buffer.decode::(); + let mut array = [first; 4]; + let mut i = 1; + while i < 4 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 5] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 5] { + let first: T = buffer.decode::(); + let mut array = [first; 5]; + let mut i = 1; + while i < 5 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 6] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 6] { + let first: T = buffer.decode::(); + let mut array = [first; 6]; + let mut i = 1; + while i < 6 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 7] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 7] { + let first: T = buffer.decode::(); + let mut array = [first; 7]; + let mut i = 1; + while i < 7 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 8] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 8] { + let first: T = buffer.decode::(); + let mut array = [first; 8]; + let mut i = 1; + while i < 8 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 9] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 9] { + let first: T = buffer.decode::(); + let mut array = [first; 9]; + let mut i = 1; + while i < 9 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 10] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 10] { + let first: T = buffer.decode::(); + let mut array = [first; 10]; + let mut i = 1; + while i < 10 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 11] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 11] { + let first: T = buffer.decode::(); + let mut array = [first; 11]; + let mut i = 1; + while i < 11 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 12] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 12] { + let first: T = buffer.decode::(); + let mut array = [first; 12]; + let mut i = 1; + while i < 12 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 13] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 13] { + let first: T = buffer.decode::(); + let mut array = [first; 13]; + let mut i = 1; + while i < 13 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 14] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 14] { + let first: T = buffer.decode::(); + let mut array = [first; 14]; + let mut i = 1; + while i < 14 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 15] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 15] { + let first: T = buffer.decode::(); + let mut array = [first; 15]; + let mut i = 1; + while i < 15 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 16] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 16] { + let first: T = buffer.decode::(); + let mut array = [first; 16]; + let mut i = 1; + while i < 16 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 17] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 17] { + let first: T = buffer.decode::(); + let mut array = [first; 17]; + let mut i = 1; + while i < 17 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 18] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 18] { + let first: T = buffer.decode::(); + let mut array = [first; 18]; + let mut i = 1; + while i < 18 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 19] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 19] { + let first: T = buffer.decode::(); + let mut array = [first; 19]; + let mut i = 1; + while i < 19 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 20] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 20] { + let first: T = buffer.decode::(); + let mut array = [first; 20]; + let mut i = 1; + while i < 20 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 21] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 21] { + let first: T = buffer.decode::(); + let mut array = [first; 21]; + let mut i = 1; + while i < 21 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 22] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 22] { + let first: T = buffer.decode::(); + let mut array = [first; 22]; + let mut i = 1; + while i < 22 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 23] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 23] { + let first: T = buffer.decode::(); + let mut array = [first; 23]; + let mut i = 1; + while i < 23 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 24] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 24] { + let first: T = buffer.decode::(); + let mut array = [first; 24]; + let mut i = 1; + while i < 24 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 25] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 25] { + let first: T = buffer.decode::(); + let mut array = [first; 25]; + let mut i = 1; + while i < 25 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 26] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 26] { + let first: T = buffer.decode::(); + let mut array = [first; 26]; + let mut i = 1; + while i < 26 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 27] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 27] { + let first: T = buffer.decode::(); + let mut array = [first; 27]; + let mut i = 1; + while i < 27 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 28] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 28] { + let first: T = buffer.decode::(); + let mut array = [first; 28]; + let mut i = 1; + while i < 28 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 29] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 29] { + let first: T = buffer.decode::(); + let mut array = [first; 29]; + let mut i = 1; + while i < 29 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 30] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 30] { + let first: T = buffer.decode::(); + let mut array = [first; 30]; + let mut i = 1; + while i < 30 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 31] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 31] { + let first: T = buffer.decode::(); + let mut array = [first; 31]; + let mut i = 1; + while i < 31 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 32] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 32] { + let first: T = buffer.decode::(); + let mut array = [first; 32]; + let mut i = 1; + while i < 32 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 33] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 33] { + let first: T = buffer.decode::(); + let mut array = [first; 33]; + let mut i = 1; + while i < 33 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 34] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 34] { + let first: T = buffer.decode::(); + let mut array = [first; 34]; + let mut i = 1; + while i < 34 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 35] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 35] { + let first: T = buffer.decode::(); + let mut array = [first; 35]; + let mut i = 1; + while i < 35 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 36] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 36] { + let first: T = buffer.decode::(); + let mut array = [first; 36]; + let mut i = 1; + while i < 36 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 37] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 37] { + let first: T = buffer.decode::(); + let mut array = [first; 37]; + let mut i = 1; + while i < 37 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 38] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 38] { + let first: T = buffer.decode::(); + let mut array = [first; 38]; + let mut i = 1; + while i < 38 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 39] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 39] { + let first: T = buffer.decode::(); + let mut array = [first; 39]; + let mut i = 1; + while i < 39 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 40] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 40] { + let first: T = buffer.decode::(); + let mut array = [first; 40]; + let mut i = 1; + while i < 40 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 41] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 41] { + let first: T = buffer.decode::(); + let mut array = [first; 41]; + let mut i = 1; + while i < 41 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 42] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 42] { + let first: T = buffer.decode::(); + let mut array = [first; 42]; + let mut i = 1; + while i < 42 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 43] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 43] { + let first: T = buffer.decode::(); + let mut array = [first; 43]; + let mut i = 1; + while i < 43 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 44] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 44] { + let first: T = buffer.decode::(); + let mut array = [first; 44]; + let mut i = 1; + while i < 44 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 45] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 45] { + let first: T = buffer.decode::(); + let mut array = [first; 45]; + let mut i = 1; + while i < 45 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 46] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 46] { + let first: T = buffer.decode::(); + let mut array = [first; 46]; + let mut i = 1; + while i < 46 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 47] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 47] { + let first: T = buffer.decode::(); + let mut array = [first; 47]; + let mut i = 1; + while i < 47 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 48] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 48] { + let first: T = buffer.decode::(); + let mut array = [first; 48]; + let mut i = 1; + while i < 48 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 49] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 49] { + let first: T = buffer.decode::(); + let mut array = [first; 49]; + let mut i = 1; + while i < 49 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 50] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 50] { + let first: T = buffer.decode::(); + let mut array = [first; 50]; + let mut i = 1; + while i < 50 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 51] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 51] { + let first: T = buffer.decode::(); + let mut array = [first; 51]; + let mut i = 1; + while i < 51 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } +} +impl AbiDecode for [T; 52] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 52] { + let first: T = buffer.decode::(); + let mut array = [first; 52]; + let mut i = 1; + while i < 52 { + array[i] = buffer.decode::(); + i += 1; + }; + array } } - -// BEGIN ARRAY_ENCODE -impl AbiEncode for [T; 1] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 1 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 2] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 2 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 3] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 3 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 4] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 4 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 5] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 5 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 6] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 6 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 7] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 7 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 8] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 8 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 9] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 9 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 10] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 10 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 11] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 11 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 12] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 12 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 13] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 13 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 14] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 14 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 15] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 15 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 16] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 16 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 17] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 17 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 18] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 18 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 19] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 19 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 20] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 20 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 21] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 21 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 22] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 22 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 23] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 23 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 24] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 24 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 25] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 25 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 26] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 26 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 27] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 27 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 28] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 28 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 29] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 29 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 30] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 30 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 31] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 31 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 32] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 32 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 33] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 33 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 34] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 34 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 35] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 35 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 36] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 36 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 37] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 37 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 38] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 38 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 39] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 39 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 40] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 40 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 41] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 41 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 42] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 42 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 43] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 43 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 44] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 44 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 45] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 45 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 46] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 46 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 47] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 47 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 48] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 48 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 49] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 49 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 50] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 50 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 51] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 51 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 52] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 52 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 53] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 53 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 54] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 54 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 55] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 55 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 56] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 56 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 57] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 57 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 58] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 58 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 59] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 59 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 60] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 60 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 61] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 61 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 62] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 62 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 63] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 63 { self[i].abi_encode(buffer); i += 1; } } } -impl AbiEncode for [T; 64] where T: AbiEncode { fn abi_encode(self, ref mut buffer: Buffer) { let mut i = 0; while i < 64 { self[i].abi_encode(buffer); i += 1; } } } -// END ARRAY_ENCODE - -// Encode Tuples - -impl AbiEncode for () { - fn abi_encode(self, ref mut _buffer: Buffer) {} -} - -// BEGIN TUPLES_ENCODE -impl< A,> AbiEncode for ( A,) where A: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); } } -impl< A, B,> AbiEncode for ( A, B,) where A: AbiEncode, B: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); } } -impl< A, B, C,> AbiEncode for ( A, B, C,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); } } -impl< A, B, C, D,> AbiEncode for ( A, B, C, D,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); } } -impl< A, B, C, D, E,> AbiEncode for ( A, B, C, D, E,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); } } -impl< A, B, C, D, E, F,> AbiEncode for ( A, B, C, D, E, F,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); } } -impl< A, B, C, D, E, F, G,> AbiEncode for ( A, B, C, D, E, F, G,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); } } -impl< A, B, C, D, E, F, G, H,> AbiEncode for ( A, B, C, D, E, F, G, H,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); } } -impl< A, B, C, D, E, F, G, H, I,> AbiEncode for ( A, B, C, D, E, F, G, H, I,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); } } -impl< A, B, C, D, E, F, G, H, I, J,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); } } -impl< A, B, C, D, E, F, G, H, I, J, K,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); } } -impl< A, B, C, D, E, F, G, H, I, J, K, L,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, P: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); self.15.abi_encode(buffer); } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, P: AbiEncode, Q: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); self.15.abi_encode(buffer); self.16.abi_encode(buffer); } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, P: AbiEncode, Q: AbiEncode, R: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); self.15.abi_encode(buffer); self.16.abi_encode(buffer); self.17.abi_encode(buffer); } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, P: AbiEncode, Q: AbiEncode, R: AbiEncode, S: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); self.15.abi_encode(buffer); self.16.abi_encode(buffer); self.17.abi_encode(buffer); self.18.abi_encode(buffer); } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, P: AbiEncode, Q: AbiEncode, R: AbiEncode, S: AbiEncode, T: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); self.15.abi_encode(buffer); self.16.abi_encode(buffer); self.17.abi_encode(buffer); self.18.abi_encode(buffer); self.19.abi_encode(buffer); } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, P: AbiEncode, Q: AbiEncode, R: AbiEncode, S: AbiEncode, T: AbiEncode, U: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); self.15.abi_encode(buffer); self.16.abi_encode(buffer); self.17.abi_encode(buffer); self.18.abi_encode(buffer); self.19.abi_encode(buffer); self.20.abi_encode(buffer); } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, P: AbiEncode, Q: AbiEncode, R: AbiEncode, S: AbiEncode, T: AbiEncode, U: AbiEncode, V: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); self.15.abi_encode(buffer); self.16.abi_encode(buffer); self.17.abi_encode(buffer); self.18.abi_encode(buffer); self.19.abi_encode(buffer); self.20.abi_encode(buffer); self.21.abi_encode(buffer); } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, P: AbiEncode, Q: AbiEncode, R: AbiEncode, S: AbiEncode, T: AbiEncode, U: AbiEncode, V: AbiEncode, W: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); self.15.abi_encode(buffer); self.16.abi_encode(buffer); self.17.abi_encode(buffer); self.18.abi_encode(buffer); self.19.abi_encode(buffer); self.20.abi_encode(buffer); self.21.abi_encode(buffer); self.22.abi_encode(buffer); } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, P: AbiEncode, Q: AbiEncode, R: AbiEncode, S: AbiEncode, T: AbiEncode, U: AbiEncode, V: AbiEncode, W: AbiEncode, X: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); self.15.abi_encode(buffer); self.16.abi_encode(buffer); self.17.abi_encode(buffer); self.18.abi_encode(buffer); self.19.abi_encode(buffer); self.20.abi_encode(buffer); self.21.abi_encode(buffer); self.22.abi_encode(buffer); self.23.abi_encode(buffer); } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, P: AbiEncode, Q: AbiEncode, R: AbiEncode, S: AbiEncode, T: AbiEncode, U: AbiEncode, V: AbiEncode, W: AbiEncode, X: AbiEncode, Y: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); self.15.abi_encode(buffer); self.16.abi_encode(buffer); self.17.abi_encode(buffer); self.18.abi_encode(buffer); self.19.abi_encode(buffer); self.20.abi_encode(buffer); self.21.abi_encode(buffer); self.22.abi_encode(buffer); self.23.abi_encode(buffer); self.24.abi_encode(buffer); } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z,> AbiEncode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z,) where A: AbiEncode, B: AbiEncode, C: AbiEncode, D: AbiEncode, E: AbiEncode, F: AbiEncode, G: AbiEncode, H: AbiEncode, I: AbiEncode, J: AbiEncode, K: AbiEncode, L: AbiEncode, M: AbiEncode, N: AbiEncode, O: AbiEncode, P: AbiEncode, Q: AbiEncode, R: AbiEncode, S: AbiEncode, T: AbiEncode, U: AbiEncode, V: AbiEncode, W: AbiEncode, X: AbiEncode, Y: AbiEncode, Z: AbiEncode, { fn abi_encode(self, ref mut buffer: Buffer) { self.0.abi_encode(buffer); self.1.abi_encode(buffer); self.2.abi_encode(buffer); self.3.abi_encode(buffer); self.4.abi_encode(buffer); self.5.abi_encode(buffer); self.6.abi_encode(buffer); self.7.abi_encode(buffer); self.8.abi_encode(buffer); self.9.abi_encode(buffer); self.10.abi_encode(buffer); self.11.abi_encode(buffer); self.12.abi_encode(buffer); self.13.abi_encode(buffer); self.14.abi_encode(buffer); self.15.abi_encode(buffer); self.16.abi_encode(buffer); self.17.abi_encode(buffer); self.18.abi_encode(buffer); self.19.abi_encode(buffer); self.20.abi_encode(buffer); self.21.abi_encode(buffer); self.22.abi_encode(buffer); self.23.abi_encode(buffer); self.24.abi_encode(buffer); self.25.abi_encode(buffer); } } -// END TUPLES_ENCODE - -pub fn encode(item: T) -> raw_slice +impl AbiDecode for [T; 53] where - T: AbiEncode, + T: AbiDecode, { - let mut buffer = Buffer::new(); - item.abi_encode(buffer); - buffer.as_raw_slice() + fn abi_decode(ref mut buffer: BufferReader) -> [T; 53] { + let first: T = buffer.decode::(); + let mut array = [first; 53]; + let mut i = 1; + while i < 53 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } } - -pub fn abi_decode(data: raw_slice) -> T +impl AbiDecode for [T; 54] where T: AbiDecode, { - let mut buffer = BufferReader::from_parts(data.ptr(), data.len::()); - T::abi_decode(buffer) + fn abi_decode(ref mut buffer: BufferReader) -> [T; 54] { + let first: T = buffer.decode::(); + let mut array = [first; 54]; + let mut i = 1; + while i < 54 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } } - -// Decode - -pub trait AbiDecode { - fn abi_decode(ref mut buffer: BufferReader) -> Self; +impl AbiDecode for [T; 55] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 55] { + let first: T = buffer.decode::(); + let mut array = [first; 55]; + let mut i = 1; + while i < 55 { + array[i] = buffer.decode::(); + i += 1; + }; + array + } } - -impl AbiDecode for b256 { - fn abi_decode(ref mut buffer: BufferReader) -> b256 { - buffer.read::() +impl AbiDecode for [T; 56] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 56] { + let first: T = buffer.decode::(); + let mut array = [first; 56]; + let mut i = 1; + while i < 56 { + array[i] = buffer.decode::(); + i += 1; + }; + array } } - -impl AbiDecode for u256 { - fn abi_decode(ref mut buffer: BufferReader) -> u256 { - buffer.read::() +impl AbiDecode for [T; 57] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 57] { + let first: T = buffer.decode::(); + let mut array = [first; 57]; + let mut i = 1; + while i < 57 { + array[i] = buffer.decode::(); + i += 1; + }; + array } } - -impl AbiDecode for u64 { - fn abi_decode(ref mut buffer: BufferReader) -> u64 { - buffer.read::() +impl AbiDecode for [T; 58] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 58] { + let first: T = buffer.decode::(); + let mut array = [first; 58]; + let mut i = 1; + while i < 58 { + array[i] = buffer.decode::(); + i += 1; + }; + array } } - -impl AbiDecode for u32 { - fn abi_decode(ref mut buffer: BufferReader) -> u32 { - use ::primitive_conversions::*; - let a = buffer.read::().as_u32(); - let b = buffer.read::().as_u32(); - let c = buffer.read::().as_u32(); - let d = buffer.read::().as_u32(); - (a << 24) | (b << 16) | (c << 8) | d +impl AbiDecode for [T; 59] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 59] { + let first: T = buffer.decode::(); + let mut array = [first; 59]; + let mut i = 1; + while i < 59 { + array[i] = buffer.decode::(); + i += 1; + }; + array } } - -impl AbiDecode for u16 { - fn abi_decode(ref mut buffer: BufferReader) -> u16 { - use ::primitive_conversions::*; - let a = buffer.read::().as_u16(); - let b = buffer.read::().as_u16(); - (a << 8) | b +impl AbiDecode for [T; 60] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 60] { + let first: T = buffer.decode::(); + let mut array = [first; 60]; + let mut i = 1; + while i < 60 { + array[i] = buffer.decode::(); + i += 1; + }; + array } } - -impl AbiDecode for u8 { - fn abi_decode(ref mut buffer: BufferReader) -> u8 { - buffer.read::() +impl AbiDecode for [T; 61] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 61] { + let first: T = buffer.decode::(); + let mut array = [first; 61]; + let mut i = 1; + while i < 61 { + array[i] = buffer.decode::(); + i += 1; + }; + array } } - -impl AbiDecode for bool { - fn abi_decode(ref mut buffer: BufferReader) -> bool { - buffer.read::() +impl AbiDecode for [T; 62] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 62] { + let first: T = buffer.decode::(); + let mut array = [first; 62]; + let mut i = 1; + while i < 62 { + array[i] = buffer.decode::(); + i += 1; + }; + array } } - -impl AbiDecode for raw_slice { - fn abi_decode(ref mut buffer: BufferReader) -> raw_slice { - let len = u64::abi_decode(buffer); - let data = buffer.read_bytes(len); - asm(s: (data.ptr(), len)) { - s: raw_slice - } +impl AbiDecode for [T; 63] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 63] { + let first: T = buffer.decode::(); + let mut array = [first; 63]; + let mut i = 1; + while i < 63 { + array[i] = buffer.decode::(); + i += 1; + }; + array } } - -impl AbiDecode for str { - fn abi_decode(ref mut buffer: BufferReader) -> str { - let len = u64::abi_decode(buffer); - let data = buffer.read_bytes(len); - asm(s: (data.ptr(), len)) { - s: str - } +impl AbiDecode for [T; 64] +where + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> [T; 64] { + let first: T = buffer.decode::(); + let mut array = [first; 64]; + let mut i = 1; + while i < 64 { + array[i] = buffer.decode::(); + i += 1; + }; + array } } - -// BEGIN STRARRAY_DECODE -impl AbiDecode for str[1] { fn abi_decode(ref mut buffer: BufferReader) -> str[1] { let data = buffer.read_bytes(1); asm(s: data.ptr()) { s: str[1] } } } -impl AbiDecode for str[2] { fn abi_decode(ref mut buffer: BufferReader) -> str[2] { let data = buffer.read_bytes(2); asm(s: data.ptr()) { s: str[2] } } } -impl AbiDecode for str[3] { fn abi_decode(ref mut buffer: BufferReader) -> str[3] { let data = buffer.read_bytes(3); asm(s: data.ptr()) { s: str[3] } } } -impl AbiDecode for str[4] { fn abi_decode(ref mut buffer: BufferReader) -> str[4] { let data = buffer.read_bytes(4); asm(s: data.ptr()) { s: str[4] } } } -impl AbiDecode for str[5] { fn abi_decode(ref mut buffer: BufferReader) -> str[5] { let data = buffer.read_bytes(5); asm(s: data.ptr()) { s: str[5] } } } -impl AbiDecode for str[6] { fn abi_decode(ref mut buffer: BufferReader) -> str[6] { let data = buffer.read_bytes(6); asm(s: data.ptr()) { s: str[6] } } } -impl AbiDecode for str[7] { fn abi_decode(ref mut buffer: BufferReader) -> str[7] { let data = buffer.read_bytes(7); asm(s: data.ptr()) { s: str[7] } } } -impl AbiDecode for str[8] { fn abi_decode(ref mut buffer: BufferReader) -> str[8] { let data = buffer.read_bytes(8); asm(s: data.ptr()) { s: str[8] } } } -impl AbiDecode for str[9] { fn abi_decode(ref mut buffer: BufferReader) -> str[9] { let data = buffer.read_bytes(9); asm(s: data.ptr()) { s: str[9] } } } -impl AbiDecode for str[10] { fn abi_decode(ref mut buffer: BufferReader) -> str[10] { let data = buffer.read_bytes(10); asm(s: data.ptr()) { s: str[10] } } } -impl AbiDecode for str[11] { fn abi_decode(ref mut buffer: BufferReader) -> str[11] { let data = buffer.read_bytes(11); asm(s: data.ptr()) { s: str[11] } } } -impl AbiDecode for str[12] { fn abi_decode(ref mut buffer: BufferReader) -> str[12] { let data = buffer.read_bytes(12); asm(s: data.ptr()) { s: str[12] } } } -impl AbiDecode for str[13] { fn abi_decode(ref mut buffer: BufferReader) -> str[13] { let data = buffer.read_bytes(13); asm(s: data.ptr()) { s: str[13] } } } -impl AbiDecode for str[14] { fn abi_decode(ref mut buffer: BufferReader) -> str[14] { let data = buffer.read_bytes(14); asm(s: data.ptr()) { s: str[14] } } } -impl AbiDecode for str[15] { fn abi_decode(ref mut buffer: BufferReader) -> str[15] { let data = buffer.read_bytes(15); asm(s: data.ptr()) { s: str[15] } } } -impl AbiDecode for str[16] { fn abi_decode(ref mut buffer: BufferReader) -> str[16] { let data = buffer.read_bytes(16); asm(s: data.ptr()) { s: str[16] } } } -impl AbiDecode for str[17] { fn abi_decode(ref mut buffer: BufferReader) -> str[17] { let data = buffer.read_bytes(17); asm(s: data.ptr()) { s: str[17] } } } -impl AbiDecode for str[18] { fn abi_decode(ref mut buffer: BufferReader) -> str[18] { let data = buffer.read_bytes(18); asm(s: data.ptr()) { s: str[18] } } } -impl AbiDecode for str[19] { fn abi_decode(ref mut buffer: BufferReader) -> str[19] { let data = buffer.read_bytes(19); asm(s: data.ptr()) { s: str[19] } } } -impl AbiDecode for str[20] { fn abi_decode(ref mut buffer: BufferReader) -> str[20] { let data = buffer.read_bytes(20); asm(s: data.ptr()) { s: str[20] } } } -impl AbiDecode for str[21] { fn abi_decode(ref mut buffer: BufferReader) -> str[21] { let data = buffer.read_bytes(21); asm(s: data.ptr()) { s: str[21] } } } -impl AbiDecode for str[22] { fn abi_decode(ref mut buffer: BufferReader) -> str[22] { let data = buffer.read_bytes(22); asm(s: data.ptr()) { s: str[22] } } } -impl AbiDecode for str[23] { fn abi_decode(ref mut buffer: BufferReader) -> str[23] { let data = buffer.read_bytes(23); asm(s: data.ptr()) { s: str[23] } } } -impl AbiDecode for str[24] { fn abi_decode(ref mut buffer: BufferReader) -> str[24] { let data = buffer.read_bytes(24); asm(s: data.ptr()) { s: str[24] } } } -impl AbiDecode for str[25] { fn abi_decode(ref mut buffer: BufferReader) -> str[25] { let data = buffer.read_bytes(25); asm(s: data.ptr()) { s: str[25] } } } -impl AbiDecode for str[26] { fn abi_decode(ref mut buffer: BufferReader) -> str[26] { let data = buffer.read_bytes(26); asm(s: data.ptr()) { s: str[26] } } } -impl AbiDecode for str[27] { fn abi_decode(ref mut buffer: BufferReader) -> str[27] { let data = buffer.read_bytes(27); asm(s: data.ptr()) { s: str[27] } } } -impl AbiDecode for str[28] { fn abi_decode(ref mut buffer: BufferReader) -> str[28] { let data = buffer.read_bytes(28); asm(s: data.ptr()) { s: str[28] } } } -impl AbiDecode for str[29] { fn abi_decode(ref mut buffer: BufferReader) -> str[29] { let data = buffer.read_bytes(29); asm(s: data.ptr()) { s: str[29] } } } -impl AbiDecode for str[30] { fn abi_decode(ref mut buffer: BufferReader) -> str[30] { let data = buffer.read_bytes(30); asm(s: data.ptr()) { s: str[30] } } } -impl AbiDecode for str[31] { fn abi_decode(ref mut buffer: BufferReader) -> str[31] { let data = buffer.read_bytes(31); asm(s: data.ptr()) { s: str[31] } } } -impl AbiDecode for str[32] { fn abi_decode(ref mut buffer: BufferReader) -> str[32] { let data = buffer.read_bytes(32); asm(s: data.ptr()) { s: str[32] } } } -impl AbiDecode for str[33] { fn abi_decode(ref mut buffer: BufferReader) -> str[33] { let data = buffer.read_bytes(33); asm(s: data.ptr()) { s: str[33] } } } -impl AbiDecode for str[34] { fn abi_decode(ref mut buffer: BufferReader) -> str[34] { let data = buffer.read_bytes(34); asm(s: data.ptr()) { s: str[34] } } } -impl AbiDecode for str[35] { fn abi_decode(ref mut buffer: BufferReader) -> str[35] { let data = buffer.read_bytes(35); asm(s: data.ptr()) { s: str[35] } } } -impl AbiDecode for str[36] { fn abi_decode(ref mut buffer: BufferReader) -> str[36] { let data = buffer.read_bytes(36); asm(s: data.ptr()) { s: str[36] } } } -impl AbiDecode for str[37] { fn abi_decode(ref mut buffer: BufferReader) -> str[37] { let data = buffer.read_bytes(37); asm(s: data.ptr()) { s: str[37] } } } -impl AbiDecode for str[38] { fn abi_decode(ref mut buffer: BufferReader) -> str[38] { let data = buffer.read_bytes(38); asm(s: data.ptr()) { s: str[38] } } } -impl AbiDecode for str[39] { fn abi_decode(ref mut buffer: BufferReader) -> str[39] { let data = buffer.read_bytes(39); asm(s: data.ptr()) { s: str[39] } } } -impl AbiDecode for str[40] { fn abi_decode(ref mut buffer: BufferReader) -> str[40] { let data = buffer.read_bytes(40); asm(s: data.ptr()) { s: str[40] } } } -impl AbiDecode for str[41] { fn abi_decode(ref mut buffer: BufferReader) -> str[41] { let data = buffer.read_bytes(41); asm(s: data.ptr()) { s: str[41] } } } -impl AbiDecode for str[42] { fn abi_decode(ref mut buffer: BufferReader) -> str[42] { let data = buffer.read_bytes(42); asm(s: data.ptr()) { s: str[42] } } } -impl AbiDecode for str[43] { fn abi_decode(ref mut buffer: BufferReader) -> str[43] { let data = buffer.read_bytes(43); asm(s: data.ptr()) { s: str[43] } } } -impl AbiDecode for str[44] { fn abi_decode(ref mut buffer: BufferReader) -> str[44] { let data = buffer.read_bytes(44); asm(s: data.ptr()) { s: str[44] } } } -impl AbiDecode for str[45] { fn abi_decode(ref mut buffer: BufferReader) -> str[45] { let data = buffer.read_bytes(45); asm(s: data.ptr()) { s: str[45] } } } -impl AbiDecode for str[46] { fn abi_decode(ref mut buffer: BufferReader) -> str[46] { let data = buffer.read_bytes(46); asm(s: data.ptr()) { s: str[46] } } } -impl AbiDecode for str[47] { fn abi_decode(ref mut buffer: BufferReader) -> str[47] { let data = buffer.read_bytes(47); asm(s: data.ptr()) { s: str[47] } } } -impl AbiDecode for str[48] { fn abi_decode(ref mut buffer: BufferReader) -> str[48] { let data = buffer.read_bytes(48); asm(s: data.ptr()) { s: str[48] } } } -impl AbiDecode for str[49] { fn abi_decode(ref mut buffer: BufferReader) -> str[49] { let data = buffer.read_bytes(49); asm(s: data.ptr()) { s: str[49] } } } -impl AbiDecode for str[50] { fn abi_decode(ref mut buffer: BufferReader) -> str[50] { let data = buffer.read_bytes(50); asm(s: data.ptr()) { s: str[50] } } } -impl AbiDecode for str[51] { fn abi_decode(ref mut buffer: BufferReader) -> str[51] { let data = buffer.read_bytes(51); asm(s: data.ptr()) { s: str[51] } } } -impl AbiDecode for str[52] { fn abi_decode(ref mut buffer: BufferReader) -> str[52] { let data = buffer.read_bytes(52); asm(s: data.ptr()) { s: str[52] } } } -impl AbiDecode for str[53] { fn abi_decode(ref mut buffer: BufferReader) -> str[53] { let data = buffer.read_bytes(53); asm(s: data.ptr()) { s: str[53] } } } -impl AbiDecode for str[54] { fn abi_decode(ref mut buffer: BufferReader) -> str[54] { let data = buffer.read_bytes(54); asm(s: data.ptr()) { s: str[54] } } } -impl AbiDecode for str[55] { fn abi_decode(ref mut buffer: BufferReader) -> str[55] { let data = buffer.read_bytes(55); asm(s: data.ptr()) { s: str[55] } } } -impl AbiDecode for str[56] { fn abi_decode(ref mut buffer: BufferReader) -> str[56] { let data = buffer.read_bytes(56); asm(s: data.ptr()) { s: str[56] } } } -impl AbiDecode for str[57] { fn abi_decode(ref mut buffer: BufferReader) -> str[57] { let data = buffer.read_bytes(57); asm(s: data.ptr()) { s: str[57] } } } -impl AbiDecode for str[58] { fn abi_decode(ref mut buffer: BufferReader) -> str[58] { let data = buffer.read_bytes(58); asm(s: data.ptr()) { s: str[58] } } } -impl AbiDecode for str[59] { fn abi_decode(ref mut buffer: BufferReader) -> str[59] { let data = buffer.read_bytes(59); asm(s: data.ptr()) { s: str[59] } } } -impl AbiDecode for str[60] { fn abi_decode(ref mut buffer: BufferReader) -> str[60] { let data = buffer.read_bytes(60); asm(s: data.ptr()) { s: str[60] } } } -impl AbiDecode for str[61] { fn abi_decode(ref mut buffer: BufferReader) -> str[61] { let data = buffer.read_bytes(61); asm(s: data.ptr()) { s: str[61] } } } -impl AbiDecode for str[62] { fn abi_decode(ref mut buffer: BufferReader) -> str[62] { let data = buffer.read_bytes(62); asm(s: data.ptr()) { s: str[62] } } } -impl AbiDecode for str[63] { fn abi_decode(ref mut buffer: BufferReader) -> str[63] { let data = buffer.read_bytes(63); asm(s: data.ptr()) { s: str[63] } } } -impl AbiDecode for str[64] { fn abi_decode(ref mut buffer: BufferReader) -> str[64] { let data = buffer.read_bytes(64); asm(s: data.ptr()) { s: str[64] } } } -// END STRARRAY_DECODE - -// BEGIN ARRAY_DECODE -impl AbiDecode for [T; 1] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 1] { let first: T = buffer.decode::(); let mut array = [first; 1]; let mut i = 1; while i < 1 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 2] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 2] { let first: T = buffer.decode::(); let mut array = [first; 2]; let mut i = 1; while i < 2 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 3] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 3] { let first: T = buffer.decode::(); let mut array = [first; 3]; let mut i = 1; while i < 3 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 4] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 4] { let first: T = buffer.decode::(); let mut array = [first; 4]; let mut i = 1; while i < 4 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 5] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 5] { let first: T = buffer.decode::(); let mut array = [first; 5]; let mut i = 1; while i < 5 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 6] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 6] { let first: T = buffer.decode::(); let mut array = [first; 6]; let mut i = 1; while i < 6 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 7] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 7] { let first: T = buffer.decode::(); let mut array = [first; 7]; let mut i = 1; while i < 7 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 8] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 8] { let first: T = buffer.decode::(); let mut array = [first; 8]; let mut i = 1; while i < 8 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 9] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 9] { let first: T = buffer.decode::(); let mut array = [first; 9]; let mut i = 1; while i < 9 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 10] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 10] { let first: T = buffer.decode::(); let mut array = [first; 10]; let mut i = 1; while i < 10 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 11] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 11] { let first: T = buffer.decode::(); let mut array = [first; 11]; let mut i = 1; while i < 11 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 12] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 12] { let first: T = buffer.decode::(); let mut array = [first; 12]; let mut i = 1; while i < 12 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 13] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 13] { let first: T = buffer.decode::(); let mut array = [first; 13]; let mut i = 1; while i < 13 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 14] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 14] { let first: T = buffer.decode::(); let mut array = [first; 14]; let mut i = 1; while i < 14 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 15] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 15] { let first: T = buffer.decode::(); let mut array = [first; 15]; let mut i = 1; while i < 15 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 16] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 16] { let first: T = buffer.decode::(); let mut array = [first; 16]; let mut i = 1; while i < 16 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 17] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 17] { let first: T = buffer.decode::(); let mut array = [first; 17]; let mut i = 1; while i < 17 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 18] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 18] { let first: T = buffer.decode::(); let mut array = [first; 18]; let mut i = 1; while i < 18 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 19] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 19] { let first: T = buffer.decode::(); let mut array = [first; 19]; let mut i = 1; while i < 19 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 20] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 20] { let first: T = buffer.decode::(); let mut array = [first; 20]; let mut i = 1; while i < 20 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 21] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 21] { let first: T = buffer.decode::(); let mut array = [first; 21]; let mut i = 1; while i < 21 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 22] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 22] { let first: T = buffer.decode::(); let mut array = [first; 22]; let mut i = 1; while i < 22 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 23] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 23] { let first: T = buffer.decode::(); let mut array = [first; 23]; let mut i = 1; while i < 23 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 24] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 24] { let first: T = buffer.decode::(); let mut array = [first; 24]; let mut i = 1; while i < 24 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 25] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 25] { let first: T = buffer.decode::(); let mut array = [first; 25]; let mut i = 1; while i < 25 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 26] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 26] { let first: T = buffer.decode::(); let mut array = [first; 26]; let mut i = 1; while i < 26 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 27] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 27] { let first: T = buffer.decode::(); let mut array = [first; 27]; let mut i = 1; while i < 27 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 28] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 28] { let first: T = buffer.decode::(); let mut array = [first; 28]; let mut i = 1; while i < 28 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 29] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 29] { let first: T = buffer.decode::(); let mut array = [first; 29]; let mut i = 1; while i < 29 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 30] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 30] { let first: T = buffer.decode::(); let mut array = [first; 30]; let mut i = 1; while i < 30 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 31] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 31] { let first: T = buffer.decode::(); let mut array = [first; 31]; let mut i = 1; while i < 31 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 32] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 32] { let first: T = buffer.decode::(); let mut array = [first; 32]; let mut i = 1; while i < 32 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 33] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 33] { let first: T = buffer.decode::(); let mut array = [first; 33]; let mut i = 1; while i < 33 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 34] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 34] { let first: T = buffer.decode::(); let mut array = [first; 34]; let mut i = 1; while i < 34 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 35] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 35] { let first: T = buffer.decode::(); let mut array = [first; 35]; let mut i = 1; while i < 35 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 36] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 36] { let first: T = buffer.decode::(); let mut array = [first; 36]; let mut i = 1; while i < 36 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 37] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 37] { let first: T = buffer.decode::(); let mut array = [first; 37]; let mut i = 1; while i < 37 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 38] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 38] { let first: T = buffer.decode::(); let mut array = [first; 38]; let mut i = 1; while i < 38 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 39] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 39] { let first: T = buffer.decode::(); let mut array = [first; 39]; let mut i = 1; while i < 39 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 40] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 40] { let first: T = buffer.decode::(); let mut array = [first; 40]; let mut i = 1; while i < 40 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 41] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 41] { let first: T = buffer.decode::(); let mut array = [first; 41]; let mut i = 1; while i < 41 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 42] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 42] { let first: T = buffer.decode::(); let mut array = [first; 42]; let mut i = 1; while i < 42 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 43] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 43] { let first: T = buffer.decode::(); let mut array = [first; 43]; let mut i = 1; while i < 43 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 44] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 44] { let first: T = buffer.decode::(); let mut array = [first; 44]; let mut i = 1; while i < 44 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 45] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 45] { let first: T = buffer.decode::(); let mut array = [first; 45]; let mut i = 1; while i < 45 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 46] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 46] { let first: T = buffer.decode::(); let mut array = [first; 46]; let mut i = 1; while i < 46 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 47] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 47] { let first: T = buffer.decode::(); let mut array = [first; 47]; let mut i = 1; while i < 47 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 48] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 48] { let first: T = buffer.decode::(); let mut array = [first; 48]; let mut i = 1; while i < 48 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 49] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 49] { let first: T = buffer.decode::(); let mut array = [first; 49]; let mut i = 1; while i < 49 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 50] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 50] { let first: T = buffer.decode::(); let mut array = [first; 50]; let mut i = 1; while i < 50 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 51] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 51] { let first: T = buffer.decode::(); let mut array = [first; 51]; let mut i = 1; while i < 51 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 52] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 52] { let first: T = buffer.decode::(); let mut array = [first; 52]; let mut i = 1; while i < 52 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 53] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 53] { let first: T = buffer.decode::(); let mut array = [first; 53]; let mut i = 1; while i < 53 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 54] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 54] { let first: T = buffer.decode::(); let mut array = [first; 54]; let mut i = 1; while i < 54 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 55] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 55] { let first: T = buffer.decode::(); let mut array = [first; 55]; let mut i = 1; while i < 55 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 56] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 56] { let first: T = buffer.decode::(); let mut array = [first; 56]; let mut i = 1; while i < 56 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 57] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 57] { let first: T = buffer.decode::(); let mut array = [first; 57]; let mut i = 1; while i < 57 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 58] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 58] { let first: T = buffer.decode::(); let mut array = [first; 58]; let mut i = 1; while i < 58 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 59] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 59] { let first: T = buffer.decode::(); let mut array = [first; 59]; let mut i = 1; while i < 59 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 60] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 60] { let first: T = buffer.decode::(); let mut array = [first; 60]; let mut i = 1; while i < 60 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 61] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 61] { let first: T = buffer.decode::(); let mut array = [first; 61]; let mut i = 1; while i < 61 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 62] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 62] { let first: T = buffer.decode::(); let mut array = [first; 62]; let mut i = 1; while i < 62 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 63] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 63] { let first: T = buffer.decode::(); let mut array = [first; 63]; let mut i = 1; while i < 63 { array[i] = buffer.decode::(); i += 1; }; array } } -impl AbiDecode for [T; 64] where T: AbiDecode { fn abi_decode(ref mut buffer: BufferReader) -> [T; 64] { let first: T = buffer.decode::(); let mut array = [first; 64]; let mut i = 1; while i < 64 { array[i] = buffer.decode::(); i += 1; }; array } } // END ARRAY_DECODE impl AbiDecode for () { @@ -726,32 +4438,907 @@ impl AbiDecode for () { } // BEGIN TUPLES_DECODE -impl< A,> AbiDecode for ( A,) where A: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer),) } } -impl< A, B,> AbiDecode for ( A, B,) where A: AbiDecode, B: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer),) } } -impl< A, B, C,> AbiDecode for ( A, B, C,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer),) } } -impl< A, B, C, D,> AbiDecode for ( A, B, C, D,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer),) } } -impl< A, B, C, D, E,> AbiDecode for ( A, B, C, D, E,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer),) } } -impl< A, B, C, D, E, F,> AbiDecode for ( A, B, C, D, E, F,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer),) } } -impl< A, B, C, D, E, F, G,> AbiDecode for ( A, B, C, D, E, F, G,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer),) } } -impl< A, B, C, D, E, F, G, H,> AbiDecode for ( A, B, C, D, E, F, G, H,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer),) } } -impl< A, B, C, D, E, F, G, H, I,> AbiDecode for ( A, B, C, D, E, F, G, H, I,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer),) } } -impl< A, B, C, D, E, F, G, H, I, J,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer),) } } -impl< A, B, C, D, E, F, G, H, I, J, K,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer),) } } -impl< A, B, C, D, E, F, G, H, I, J, K, L,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer),) } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer),) } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer),) } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer),) } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, P: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer), P::abi_decode(buffer),) } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, P: AbiDecode, Q: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer), P::abi_decode(buffer), Q::abi_decode(buffer),) } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, P: AbiDecode, Q: AbiDecode, R: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer), P::abi_decode(buffer), Q::abi_decode(buffer), R::abi_decode(buffer),) } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, P: AbiDecode, Q: AbiDecode, R: AbiDecode, S: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer), P::abi_decode(buffer), Q::abi_decode(buffer), R::abi_decode(buffer), S::abi_decode(buffer),) } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, P: AbiDecode, Q: AbiDecode, R: AbiDecode, S: AbiDecode, T: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer), P::abi_decode(buffer), Q::abi_decode(buffer), R::abi_decode(buffer), S::abi_decode(buffer), T::abi_decode(buffer),) } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, P: AbiDecode, Q: AbiDecode, R: AbiDecode, S: AbiDecode, T: AbiDecode, U: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer), P::abi_decode(buffer), Q::abi_decode(buffer), R::abi_decode(buffer), S::abi_decode(buffer), T::abi_decode(buffer), U::abi_decode(buffer),) } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, P: AbiDecode, Q: AbiDecode, R: AbiDecode, S: AbiDecode, T: AbiDecode, U: AbiDecode, V: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer), P::abi_decode(buffer), Q::abi_decode(buffer), R::abi_decode(buffer), S::abi_decode(buffer), T::abi_decode(buffer), U::abi_decode(buffer), V::abi_decode(buffer),) } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, P: AbiDecode, Q: AbiDecode, R: AbiDecode, S: AbiDecode, T: AbiDecode, U: AbiDecode, V: AbiDecode, W: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer), P::abi_decode(buffer), Q::abi_decode(buffer), R::abi_decode(buffer), S::abi_decode(buffer), T::abi_decode(buffer), U::abi_decode(buffer), V::abi_decode(buffer), W::abi_decode(buffer),) } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, P: AbiDecode, Q: AbiDecode, R: AbiDecode, S: AbiDecode, T: AbiDecode, U: AbiDecode, V: AbiDecode, W: AbiDecode, X: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer), P::abi_decode(buffer), Q::abi_decode(buffer), R::abi_decode(buffer), S::abi_decode(buffer), T::abi_decode(buffer), U::abi_decode(buffer), V::abi_decode(buffer), W::abi_decode(buffer), X::abi_decode(buffer),) } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, P: AbiDecode, Q: AbiDecode, R: AbiDecode, S: AbiDecode, T: AbiDecode, U: AbiDecode, V: AbiDecode, W: AbiDecode, X: AbiDecode, Y: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer), P::abi_decode(buffer), Q::abi_decode(buffer), R::abi_decode(buffer), S::abi_decode(buffer), T::abi_decode(buffer), U::abi_decode(buffer), V::abi_decode(buffer), W::abi_decode(buffer), X::abi_decode(buffer), Y::abi_decode(buffer),) } } -impl< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z,> AbiDecode for ( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z,) where A: AbiDecode, B: AbiDecode, C: AbiDecode, D: AbiDecode, E: AbiDecode, F: AbiDecode, G: AbiDecode, H: AbiDecode, I: AbiDecode, J: AbiDecode, K: AbiDecode, L: AbiDecode, M: AbiDecode, N: AbiDecode, O: AbiDecode, P: AbiDecode, Q: AbiDecode, R: AbiDecode, S: AbiDecode, T: AbiDecode, U: AbiDecode, V: AbiDecode, W: AbiDecode, X: AbiDecode, Y: AbiDecode, Z: AbiDecode, { fn abi_decode(ref mut buffer: BufferReader) -> Self { ( A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer), D::abi_decode(buffer), E::abi_decode(buffer), F::abi_decode(buffer), G::abi_decode(buffer), H::abi_decode(buffer), I::abi_decode(buffer), J::abi_decode(buffer), K::abi_decode(buffer), L::abi_decode(buffer), M::abi_decode(buffer), N::abi_decode(buffer), O::abi_decode(buffer), P::abi_decode(buffer), Q::abi_decode(buffer), R::abi_decode(buffer), S::abi_decode(buffer), T::abi_decode(buffer), U::abi_decode(buffer), V::abi_decode(buffer), W::abi_decode(buffer), X::abi_decode(buffer), Y::abi_decode(buffer), Z::abi_decode(buffer),) } } +impl AbiDecode for (A, ) +where + A: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + (A::abi_decode(buffer), ) + } +} +impl AbiDecode for (A, B) +where + A: AbiDecode, + B: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + (A::abi_decode(buffer), B::abi_decode(buffer)) + } +} +impl AbiDecode for (A, B, C) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + (A::abi_decode(buffer), B::abi_decode(buffer), C::abi_decode(buffer)) + } +} +impl AbiDecode for (A, B, C, D) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + ) + } +} +impl AbiDecode for (A, B, C, D, E) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, + E: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + E::abi_decode(buffer), + ) + } +} +impl AbiDecode for (A, B, C, D, E, F) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, + E: AbiDecode, + F: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + E::abi_decode(buffer), + F::abi_decode(buffer), + ) + } +} +impl AbiDecode for (A, B, C, D, E, F, G) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, + E: AbiDecode, + F: AbiDecode, + G: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + E::abi_decode(buffer), + F::abi_decode(buffer), + G::abi_decode(buffer), + ) + } +} +impl AbiDecode for (A, B, C, D, E, F, G, H) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, + E: AbiDecode, + F: AbiDecode, + G: AbiDecode, + H: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + E::abi_decode(buffer), + F::abi_decode(buffer), + G::abi_decode(buffer), + H::abi_decode(buffer), + ) + } +} +impl AbiDecode for (A, B, C, D, E, F, G, H, I) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, + E: AbiDecode, + F: AbiDecode, + G: AbiDecode, + H: AbiDecode, + I: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + E::abi_decode(buffer), + F::abi_decode(buffer), + G::abi_decode(buffer), + H::abi_decode(buffer), + I::abi_decode(buffer), + ) + } +} +impl AbiDecode for (A, B, C, D, E, F, G, H, I, J) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, + E: AbiDecode, + F: AbiDecode, + G: AbiDecode, + H: AbiDecode, + I: AbiDecode, + J: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + E::abi_decode(buffer), + F::abi_decode(buffer), + G::abi_decode(buffer), + H::abi_decode(buffer), + I::abi_decode(buffer), + J::abi_decode(buffer), + ) + } +} +impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, + E: AbiDecode, + F: AbiDecode, + G: AbiDecode, + H: AbiDecode, + I: AbiDecode, + J: AbiDecode, + K: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + E::abi_decode(buffer), + F::abi_decode(buffer), + G::abi_decode(buffer), + H::abi_decode(buffer), + I::abi_decode(buffer), + J::abi_decode(buffer), + K::abi_decode(buffer), + ) + } +} +impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, + E: AbiDecode, + F: AbiDecode, + G: AbiDecode, + H: AbiDecode, + I: AbiDecode, + J: AbiDecode, + K: AbiDecode, + L: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + E::abi_decode(buffer), + F::abi_decode(buffer), + G::abi_decode(buffer), + H::abi_decode(buffer), + I::abi_decode(buffer), + J::abi_decode(buffer), + K::abi_decode(buffer), + L::abi_decode(buffer), + ) + } +} +impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, + E: AbiDecode, + F: AbiDecode, + G: AbiDecode, + H: AbiDecode, + I: AbiDecode, + J: AbiDecode, + K: AbiDecode, + L: AbiDecode, + M: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + E::abi_decode(buffer), + F::abi_decode(buffer), + G::abi_decode(buffer), + H::abi_decode(buffer), + I::abi_decode(buffer), + J::abi_decode(buffer), + K::abi_decode(buffer), + L::abi_decode(buffer), + M::abi_decode(buffer), + ) + } +} +impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, + E: AbiDecode, + F: AbiDecode, + G: AbiDecode, + H: AbiDecode, + I: AbiDecode, + J: AbiDecode, + K: AbiDecode, + L: AbiDecode, + M: AbiDecode, + N: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + E::abi_decode(buffer), + F::abi_decode(buffer), + G::abi_decode(buffer), + H::abi_decode(buffer), + I::abi_decode(buffer), + J::abi_decode(buffer), + K::abi_decode(buffer), + L::abi_decode(buffer), + M::abi_decode(buffer), + N::abi_decode(buffer), + ) + } +} +impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, + E: AbiDecode, + F: AbiDecode, + G: AbiDecode, + H: AbiDecode, + I: AbiDecode, + J: AbiDecode, + K: AbiDecode, + L: AbiDecode, + M: AbiDecode, + N: AbiDecode, + O: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + E::abi_decode(buffer), + F::abi_decode(buffer), + G::abi_decode(buffer), + H::abi_decode(buffer), + I::abi_decode(buffer), + J::abi_decode(buffer), + K::abi_decode(buffer), + L::abi_decode(buffer), + M::abi_decode(buffer), + N::abi_decode(buffer), + O::abi_decode(buffer), + ) + } +} +impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, + E: AbiDecode, + F: AbiDecode, + G: AbiDecode, + H: AbiDecode, + I: AbiDecode, + J: AbiDecode, + K: AbiDecode, + L: AbiDecode, + M: AbiDecode, + N: AbiDecode, + O: AbiDecode, + P: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + E::abi_decode(buffer), + F::abi_decode(buffer), + G::abi_decode(buffer), + H::abi_decode(buffer), + I::abi_decode(buffer), + J::abi_decode(buffer), + K::abi_decode(buffer), + L::abi_decode(buffer), + M::abi_decode(buffer), + N::abi_decode(buffer), + O::abi_decode(buffer), + P::abi_decode(buffer), + ) + } +} +impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, + E: AbiDecode, + F: AbiDecode, + G: AbiDecode, + H: AbiDecode, + I: AbiDecode, + J: AbiDecode, + K: AbiDecode, + L: AbiDecode, + M: AbiDecode, + N: AbiDecode, + O: AbiDecode, + P: AbiDecode, + Q: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + E::abi_decode(buffer), + F::abi_decode(buffer), + G::abi_decode(buffer), + H::abi_decode(buffer), + I::abi_decode(buffer), + J::abi_decode(buffer), + K::abi_decode(buffer), + L::abi_decode(buffer), + M::abi_decode(buffer), + N::abi_decode(buffer), + O::abi_decode(buffer), + P::abi_decode(buffer), + Q::abi_decode(buffer), + ) + } +} +impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, + E: AbiDecode, + F: AbiDecode, + G: AbiDecode, + H: AbiDecode, + I: AbiDecode, + J: AbiDecode, + K: AbiDecode, + L: AbiDecode, + M: AbiDecode, + N: AbiDecode, + O: AbiDecode, + P: AbiDecode, + Q: AbiDecode, + R: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + E::abi_decode(buffer), + F::abi_decode(buffer), + G::abi_decode(buffer), + H::abi_decode(buffer), + I::abi_decode(buffer), + J::abi_decode(buffer), + K::abi_decode(buffer), + L::abi_decode(buffer), + M::abi_decode(buffer), + N::abi_decode(buffer), + O::abi_decode(buffer), + P::abi_decode(buffer), + Q::abi_decode(buffer), + R::abi_decode(buffer), + ) + } +} +impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, + E: AbiDecode, + F: AbiDecode, + G: AbiDecode, + H: AbiDecode, + I: AbiDecode, + J: AbiDecode, + K: AbiDecode, + L: AbiDecode, + M: AbiDecode, + N: AbiDecode, + O: AbiDecode, + P: AbiDecode, + Q: AbiDecode, + R: AbiDecode, + S: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + E::abi_decode(buffer), + F::abi_decode(buffer), + G::abi_decode(buffer), + H::abi_decode(buffer), + I::abi_decode(buffer), + J::abi_decode(buffer), + K::abi_decode(buffer), + L::abi_decode(buffer), + M::abi_decode(buffer), + N::abi_decode(buffer), + O::abi_decode(buffer), + P::abi_decode(buffer), + Q::abi_decode(buffer), + R::abi_decode(buffer), + S::abi_decode(buffer), + ) + } +} +impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, + E: AbiDecode, + F: AbiDecode, + G: AbiDecode, + H: AbiDecode, + I: AbiDecode, + J: AbiDecode, + K: AbiDecode, + L: AbiDecode, + M: AbiDecode, + N: AbiDecode, + O: AbiDecode, + P: AbiDecode, + Q: AbiDecode, + R: AbiDecode, + S: AbiDecode, + T: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + E::abi_decode(buffer), + F::abi_decode(buffer), + G::abi_decode(buffer), + H::abi_decode(buffer), + I::abi_decode(buffer), + J::abi_decode(buffer), + K::abi_decode(buffer), + L::abi_decode(buffer), + M::abi_decode(buffer), + N::abi_decode(buffer), + O::abi_decode(buffer), + P::abi_decode(buffer), + Q::abi_decode(buffer), + R::abi_decode(buffer), + S::abi_decode(buffer), + T::abi_decode(buffer), + ) + } +} +impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, + E: AbiDecode, + F: AbiDecode, + G: AbiDecode, + H: AbiDecode, + I: AbiDecode, + J: AbiDecode, + K: AbiDecode, + L: AbiDecode, + M: AbiDecode, + N: AbiDecode, + O: AbiDecode, + P: AbiDecode, + Q: AbiDecode, + R: AbiDecode, + S: AbiDecode, + T: AbiDecode, + U: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + E::abi_decode(buffer), + F::abi_decode(buffer), + G::abi_decode(buffer), + H::abi_decode(buffer), + I::abi_decode(buffer), + J::abi_decode(buffer), + K::abi_decode(buffer), + L::abi_decode(buffer), + M::abi_decode(buffer), + N::abi_decode(buffer), + O::abi_decode(buffer), + P::abi_decode(buffer), + Q::abi_decode(buffer), + R::abi_decode(buffer), + S::abi_decode(buffer), + T::abi_decode(buffer), + U::abi_decode(buffer), + ) + } +} +impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, + E: AbiDecode, + F: AbiDecode, + G: AbiDecode, + H: AbiDecode, + I: AbiDecode, + J: AbiDecode, + K: AbiDecode, + L: AbiDecode, + M: AbiDecode, + N: AbiDecode, + O: AbiDecode, + P: AbiDecode, + Q: AbiDecode, + R: AbiDecode, + S: AbiDecode, + T: AbiDecode, + U: AbiDecode, + V: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + E::abi_decode(buffer), + F::abi_decode(buffer), + G::abi_decode(buffer), + H::abi_decode(buffer), + I::abi_decode(buffer), + J::abi_decode(buffer), + K::abi_decode(buffer), + L::abi_decode(buffer), + M::abi_decode(buffer), + N::abi_decode(buffer), + O::abi_decode(buffer), + P::abi_decode(buffer), + Q::abi_decode(buffer), + R::abi_decode(buffer), + S::abi_decode(buffer), + T::abi_decode(buffer), + U::abi_decode(buffer), + V::abi_decode(buffer), + ) + } +} +impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, + E: AbiDecode, + F: AbiDecode, + G: AbiDecode, + H: AbiDecode, + I: AbiDecode, + J: AbiDecode, + K: AbiDecode, + L: AbiDecode, + M: AbiDecode, + N: AbiDecode, + O: AbiDecode, + P: AbiDecode, + Q: AbiDecode, + R: AbiDecode, + S: AbiDecode, + T: AbiDecode, + U: AbiDecode, + V: AbiDecode, + W: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + E::abi_decode(buffer), + F::abi_decode(buffer), + G::abi_decode(buffer), + H::abi_decode(buffer), + I::abi_decode(buffer), + J::abi_decode(buffer), + K::abi_decode(buffer), + L::abi_decode(buffer), + M::abi_decode(buffer), + N::abi_decode(buffer), + O::abi_decode(buffer), + P::abi_decode(buffer), + Q::abi_decode(buffer), + R::abi_decode(buffer), + S::abi_decode(buffer), + T::abi_decode(buffer), + U::abi_decode(buffer), + V::abi_decode(buffer), + W::abi_decode(buffer), + ) + } +} +impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, + E: AbiDecode, + F: AbiDecode, + G: AbiDecode, + H: AbiDecode, + I: AbiDecode, + J: AbiDecode, + K: AbiDecode, + L: AbiDecode, + M: AbiDecode, + N: AbiDecode, + O: AbiDecode, + P: AbiDecode, + Q: AbiDecode, + R: AbiDecode, + S: AbiDecode, + T: AbiDecode, + U: AbiDecode, + V: AbiDecode, + W: AbiDecode, + X: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + E::abi_decode(buffer), + F::abi_decode(buffer), + G::abi_decode(buffer), + H::abi_decode(buffer), + I::abi_decode(buffer), + J::abi_decode(buffer), + K::abi_decode(buffer), + L::abi_decode(buffer), + M::abi_decode(buffer), + N::abi_decode(buffer), + O::abi_decode(buffer), + P::abi_decode(buffer), + Q::abi_decode(buffer), + R::abi_decode(buffer), + S::abi_decode(buffer), + T::abi_decode(buffer), + U::abi_decode(buffer), + V::abi_decode(buffer), + W::abi_decode(buffer), + X::abi_decode(buffer), + ) + } +} +impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, + E: AbiDecode, + F: AbiDecode, + G: AbiDecode, + H: AbiDecode, + I: AbiDecode, + J: AbiDecode, + K: AbiDecode, + L: AbiDecode, + M: AbiDecode, + N: AbiDecode, + O: AbiDecode, + P: AbiDecode, + Q: AbiDecode, + R: AbiDecode, + S: AbiDecode, + T: AbiDecode, + U: AbiDecode, + V: AbiDecode, + W: AbiDecode, + X: AbiDecode, + Y: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + E::abi_decode(buffer), + F::abi_decode(buffer), + G::abi_decode(buffer), + H::abi_decode(buffer), + I::abi_decode(buffer), + J::abi_decode(buffer), + K::abi_decode(buffer), + L::abi_decode(buffer), + M::abi_decode(buffer), + N::abi_decode(buffer), + O::abi_decode(buffer), + P::abi_decode(buffer), + Q::abi_decode(buffer), + R::abi_decode(buffer), + S::abi_decode(buffer), + T::abi_decode(buffer), + U::abi_decode(buffer), + V::abi_decode(buffer), + W::abi_decode(buffer), + X::abi_decode(buffer), + Y::abi_decode(buffer), + ) + } +} +impl AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z) +where + A: AbiDecode, + B: AbiDecode, + C: AbiDecode, + D: AbiDecode, + E: AbiDecode, + F: AbiDecode, + G: AbiDecode, + H: AbiDecode, + I: AbiDecode, + J: AbiDecode, + K: AbiDecode, + L: AbiDecode, + M: AbiDecode, + N: AbiDecode, + O: AbiDecode, + P: AbiDecode, + Q: AbiDecode, + R: AbiDecode, + S: AbiDecode, + T: AbiDecode, + U: AbiDecode, + V: AbiDecode, + W: AbiDecode, + X: AbiDecode, + Y: AbiDecode, + Z: AbiDecode, +{ + fn abi_decode(ref mut buffer: BufferReader) -> Self { + ( + A::abi_decode(buffer), + B::abi_decode(buffer), + C::abi_decode(buffer), + D::abi_decode(buffer), + E::abi_decode(buffer), + F::abi_decode(buffer), + G::abi_decode(buffer), + H::abi_decode(buffer), + I::abi_decode(buffer), + J::abi_decode(buffer), + K::abi_decode(buffer), + L::abi_decode(buffer), + M::abi_decode(buffer), + N::abi_decode(buffer), + O::abi_decode(buffer), + P::abi_decode(buffer), + Q::abi_decode(buffer), + R::abi_decode(buffer), + S::abi_decode(buffer), + T::abi_decode(buffer), + U::abi_decode(buffer), + V::abi_decode(buffer), + W::abi_decode(buffer), + X::abi_decode(buffer), + Y::abi_decode(buffer), + Z::abi_decode(buffer), + ) + } +} // END TUPLES_DECODE use ::ops::*; @@ -833,8 +5420,9 @@ fn to_slice(array: T) -> raw_slice { raw_slice::from_parts::(__addr_of(array), len) } -fn assert_eq(a: T, b: T) -where T: Eq +fn assert_eq(a: T, b: T) +where + T: Eq, { if a != b { __revert(0) From 8ecabe23dc898b8fec78f0c3a2a1323c426fbaab Mon Sep 17 00:00:00 2001 From: xunilrj Date: Wed, 3 Apr 2024 20:48:55 +0100 Subject: [PATCH 6/8] contract ids updated --- .../array_of_structs_caller/src/main.sw | 2 +- .../call_contract_with_type_aliases/src/main.sw | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/array_of_structs_caller/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/array_of_structs_caller/src/main.sw index e892312cdfb..6ee9ff1d949 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/array_of_structs_caller/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/array_of_structs_caller/src/main.sw @@ -6,7 +6,7 @@ use std::hash::*; #[cfg(experimental_new_encoding = false)] const CONTRACT_ID = 0x7fae96947a8cad59cc2a25239f9f80897955d4c1b10d31510681f15842b93265; #[cfg(experimental_new_encoding = true)] -const CONTRACT_ID = 0x53de34b4a064de1a09fb9eb8ed407fd2c3b205c27ad5d8e0c63b28c752a09bbc; +const CONTRACT_ID = 0x54996ea6be619740d315438a413cf060d858fd548ffb75a54408fd8af1519ff8; fn main() -> u64 { let addr = abi(TestContract, CONTRACT_ID); diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_contract_with_type_aliases/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_contract_with_type_aliases/src/main.sw index f999d23e8ac..30f2c556ac8 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_contract_with_type_aliases/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_contract_with_type_aliases/src/main.sw @@ -5,7 +5,7 @@ use contract_with_type_aliases_abi::*; #[cfg(experimental_new_encoding = false)] const CONTRACT_ID = 0x9d76ecbf446c30ef659efd1157d67d156de02b1e6c2ac2f9c744125571efa229; #[cfg(experimental_new_encoding = true)] -const CONTRACT_ID = 0xdf7ff45bea6a49aa2b6ba9f12eac13dafa349b9c57cd8f7d4892bb0ebcc3782a; +const CONTRACT_ID = 0x02ab63e5c022d26c890c2adff800623b10a09612d6da902c12afa11705b9c5cd; fn main() { let caller = abi(MyContract, CONTRACT_ID); From 64476a73f693e1f21e55a0bf6858e425c1f3bd22 Mon Sep 17 00:00:00 2001 From: xunilrj Date: Thu, 4 Apr 2024 09:53:55 +0100 Subject: [PATCH 7/8] small clean up --- .../ast_node/declaration/auto_impl.rs | 69 ++++++++----------- sway-core/src/semantic_analysis/module.rs | 10 +-- .../semantic_analysis/type_check_context.rs | 5 +- 3 files changed, 36 insertions(+), 48 deletions(-) diff --git a/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl.rs b/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl.rs index ddbef6b5ade..67eef140672 100644 --- a/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl.rs +++ b/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl.rs @@ -18,14 +18,14 @@ use sway_parse::Parse; use sway_types::{integer_bits::IntegerBits, BaseIdent, ModuleId, Named, Span, Spanned}; /// Contains all information needed to implement AbiEncode -pub struct AutoImplAbiEncodeContext<'a, 'b> +pub struct EncodingAutoImplContext<'a, 'b> where 'a: 'b, { ctx: &'b mut TypeCheckContext<'a>, } -impl<'a, 'b> AutoImplAbiEncodeContext<'a, 'b> +impl<'a, 'b> EncodingAutoImplContext<'a, 'b> where 'a: 'b, { @@ -33,7 +33,7 @@ where Some(Self { ctx }) } - pub fn parse(engines: &Engines, module_id: Option, input: &str) -> T + fn parse(engines: &Engines, module_id: Option, input: &str) -> T where T: Parse, { @@ -267,7 +267,7 @@ where format!("match self {{ {arms} }}") } - pub fn parse_item_fn_to_typed_ast_node( + pub fn parse_fn_to_ty_ast_node( &mut self, engines: &Engines, module_id: Option, @@ -313,8 +313,8 @@ where assert!(!handler.has_warnings(), "{:?}", handler); let ctx = self.ctx.by_ref(); - let decl = ctx - .scoped(|ctx| { + let (decl, namespace) = ctx + .scoped_and_namespace(|ctx| { TyDecl::type_check( &handler, ctx, @@ -325,9 +325,13 @@ where assert!(!handler.has_warnings(), "{:?}", handler); - if handler.has_errors() { + // Uncomment this to understand why an entry function was not generated + // println!("{:#?}", handler); + + if handler.has_errors() || matches!(decl, TyDecl::ErrorRecovery(_, _)) { Err(handler) } else { + *self.ctx.namespace = namespace; Ok(TyAstNode { span: decl.span(), content: ty::TyAstNodeContent::Declaration(decl), @@ -335,12 +339,12 @@ where } } - fn parse_item_impl_to_typed_ast_node( + fn parse_impl_trait_to_ty_ast_node( &mut self, engines: &Engines, module_id: Option, code: &str, - ) -> Option { + ) -> Result { let mut ctx = crate::transform::to_parsed_lang::Context::new( crate::BuildTarget::Fuel, self.ctx.experimental, @@ -371,14 +375,11 @@ where // Uncomment this to understand why auto impl failed for a type. // println!("{:#?}", handler); - if handler.has_errors() { - None + if handler.has_errors() || matches!(decl, TyDecl::ErrorRecovery(_, _)) { + Err(handler) } else { - if !matches!(decl, TyDecl::ErrorRecovery(_, _)) { - *self.ctx.namespace = namespace; - } - - Some(TyAstNode { + *self.ctx.namespace = namespace; + Ok(TyAstNode { span: decl.span(), content: ty::TyAstNodeContent::Declaration(decl), }) @@ -408,7 +409,7 @@ where abi_encode_body, ); let abi_encode_node = - self.parse_item_impl_to_typed_ast_node(engines, module_id, &abi_encode_code); + self.parse_impl_trait_to_ty_ast_node(engines, module_id, &abi_encode_code); let abi_decode_body = self.generate_abi_decode_struct_body(engines, &struct_decl); let abi_decode_code = self.generate_abi_decode_code( @@ -417,9 +418,9 @@ where abi_decode_body, ); let abi_decode_node = - self.parse_item_impl_to_typed_ast_node(engines, module_id, &abi_decode_code); + self.parse_impl_trait_to_ty_ast_node(engines, module_id, &abi_decode_code); - (abi_encode_node, abi_decode_node) + (abi_encode_node.ok(), abi_decode_node.ok()) } fn auto_impl_enum( @@ -444,7 +445,7 @@ where abi_encode_body, ); let abi_encode_node = - self.parse_item_impl_to_typed_ast_node(engines, module_id, &abi_encode_code); + self.parse_impl_trait_to_ty_ast_node(engines, module_id, &abi_encode_code); let abi_decode_body = self.generate_abi_decode_enum_body(engines, &enum_decl); let abi_decode_code = self.generate_abi_decode_code( @@ -453,9 +454,9 @@ where abi_decode_body, ); let abi_decode_node = - self.parse_item_impl_to_typed_ast_node(engines, module_id, &abi_decode_code); + self.parse_impl_trait_to_ty_ast_node(engines, module_id, &abi_decode_code); - (abi_encode_node, abi_decode_node) + (abi_encode_node.ok(), abi_decode_node.ok()) } pub fn generate( @@ -642,12 +643,8 @@ where }}" ); - let entry_fn = self.parse_item_fn_to_typed_ast_node( - engines, - module_id, - FunctionDeclarationKind::Entry, - &code, - ); + let entry_fn = + self.parse_fn_to_ty_ast_node(engines, module_id, FunctionDeclarationKind::Entry, &code); match entry_fn { Ok(entry_fn) => Ok(entry_fn), @@ -697,12 +694,8 @@ where ) }; - let entry_fn = self.parse_item_fn_to_typed_ast_node( - engines, - module_id, - FunctionDeclarationKind::Entry, - &code, - ); + let entry_fn = + self.parse_fn_to_ty_ast_node(engines, module_id, FunctionDeclarationKind::Entry, &code); match entry_fn { Ok(entry_fn) => Ok(entry_fn), @@ -765,12 +758,8 @@ where ) }; - let entry_fn = self.parse_item_fn_to_typed_ast_node( - engines, - module_id, - FunctionDeclarationKind::Entry, - &code, - ); + let entry_fn = + self.parse_fn_to_ty_ast_node(engines, module_id, FunctionDeclarationKind::Entry, &code); match entry_fn { Ok(entry_fn) => Ok(entry_fn), diff --git a/sway-core/src/semantic_analysis/module.rs b/sway-core/src/semantic_analysis/module.rs index f14a3e8eb21..5158858e7ad 100644 --- a/sway-core/src/semantic_analysis/module.rs +++ b/sway-core/src/semantic_analysis/module.rs @@ -25,7 +25,7 @@ use crate::{ use super::{ collection_context::SymbolCollectionContext, - declaration::auto_impl::{self, AutoImplAbiEncodeContext}, + declaration::auto_impl::{self, EncodingAutoImplContext}, }; #[derive(Clone, Debug)] @@ -327,7 +327,7 @@ impl ty::TyModule { match (&kind, main_decl.is_some()) { (TreeType::Predicate, true) => { let mut fn_generator = - auto_impl::AutoImplAbiEncodeContext::new(&mut ctx).unwrap(); + auto_impl::EncodingAutoImplContext::new(&mut ctx).unwrap(); let node = fn_generator.generate_predicate_entry( engines, main_decl.as_ref().unwrap(), @@ -337,7 +337,7 @@ impl ty::TyModule { } (TreeType::Script, true) => { let mut fn_generator = - auto_impl::AutoImplAbiEncodeContext::new(&mut ctx).unwrap(); + auto_impl::EncodingAutoImplContext::new(&mut ctx).unwrap(); let node = fn_generator.generate_script_entry( engines, main_decl.as_ref().unwrap(), @@ -355,7 +355,7 @@ impl ty::TyModule { .collect::>(); let mut fn_generator = - auto_impl::AutoImplAbiEncodeContext::new(&mut ctx).unwrap(); + auto_impl::EncodingAutoImplContext::new(&mut ctx).unwrap(); let node = fn_generator.generate_contract_entry( engines, parsed.span.source_id().map(|x| x.module_id()), @@ -452,7 +452,7 @@ impl ty::TyModule { let mut generated = vec![]; if let (true, Some(mut ctx)) = ( auto_impl_encoding_traits, - AutoImplAbiEncodeContext::new(&mut ctx), + EncodingAutoImplContext::new(&mut ctx), ) { match &node.content { TyAstNodeContent::Declaration(decl @ TyDecl::StructDecl(_)) diff --git a/sway-core/src/semantic_analysis/type_check_context.rs b/sway-core/src/semantic_analysis/type_check_context.rs index 283ff08728d..5994196b9fd 100644 --- a/sway-core/src/semantic_analysis/type_check_context.rs +++ b/sway-core/src/semantic_analysis/type_check_context.rs @@ -233,7 +233,7 @@ impl<'a> TypeCheckContext<'a> { with_scoped_ctx(ctx) } - /// Scope the `TypeCheckContext` with a new namespace but update the original if success. + /// Scope the `TypeCheckContext` with a new namespace and returns it in case of success. pub fn scoped_and_namespace( self, with_scoped_ctx: impl FnOnce(TypeCheckContext) -> Result, @@ -258,8 +258,7 @@ impl<'a> TypeCheckContext<'a> { storage_declaration: self.storage_declaration, experimental: self.experimental, }; - let r = with_scoped_ctx(ctx)?; - Ok((r, namespace)) + Ok((with_scoped_ctx(ctx)?, namespace)) } /// Enter the submodule with the given name and produce a type-check context ready for From 1f498b876ac42bc172cdb1bc6c6b7db7b81ae589 Mon Sep 17 00:00:00 2001 From: xunilrj Date: Fri, 5 Apr 2024 12:33:49 +0100 Subject: [PATCH 8/8] removing unused variant data --- sway-core/src/ir_generation/const_eval.rs | 30 ++++++----------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/sway-core/src/ir_generation/const_eval.rs b/sway-core/src/ir_generation/const_eval.rs index 4248f76f66d..ad01563a8f4 100644 --- a/sway-core/src/ir_generation/const_eval.rs +++ b/sway-core/src/ir_generation/const_eval.rs @@ -31,8 +31,7 @@ use sway_types::{ident::Ident, integer_bits::IntegerBits, span::Spanned, Span}; use sway_utils::mapped_stack::MappedStack; enum ConstEvalError { - #[allow(dead_code)] - CompileError(CompileError), + CompileError, CannotBeEvaluatedToConst { // This is not used at the moment because we do not give detailed description of why a // const eval failed. @@ -641,13 +640,7 @@ fn const_eval_typed_expr( if index < count { Some(items[index as usize].clone()) } else { - return Err(ConstEvalError::CompileError( - CompileError::ArrayOutOfBounds { - index, - count, - span: expr.span.clone(), - }, - )); + return Err(ConstEvalError::CompileError); } } _ => { @@ -658,10 +651,7 @@ fn const_eval_typed_expr( } } ty::TyExpressionVariant::Ref(_) | ty::TyExpressionVariant::Deref(_) => { - return Err(ConstEvalError::CompileError(CompileError::Unimplemented( - "Constant references are currently not supported.", - expr.span.clone(), - ))); + return Err(ConstEvalError::CompileError); } ty::TyExpressionVariant::Reassignment(_) | ty::TyExpressionVariant::FunctionParameter @@ -994,7 +984,7 @@ fn const_eval_intrinsic( &targ.type_id, &targ.span, ) - .map_err(ConstEvalError::CompileError)?; + .map_err(|_| ConstEvalError::CompileError)?; Ok(Some(Constant { ty: Type::get_uint64(lookup.context), value: ConstantValue::Uint(ir_type.size(lookup.context).in_bytes()), @@ -1010,7 +1000,7 @@ fn const_eval_intrinsic( &type_id, &val.span, ) - .map_err(ConstEvalError::CompileError)?; + .map_err(|_| ConstEvalError::CompileError)?; Ok(Some(Constant { ty: Type::get_uint64(lookup.context), value: ConstantValue::Uint(ir_type.size(lookup.context).in_bytes()), @@ -1025,7 +1015,7 @@ fn const_eval_intrinsic( &targ.type_id, &targ.span, ) - .map_err(ConstEvalError::CompileError)?; + .map_err(|_| ConstEvalError::CompileError)?; Ok(Some(Constant { ty: Type::get_uint64(lookup.context), value: ConstantValue::Uint( @@ -1042,17 +1032,13 @@ fn const_eval_intrinsic( &targ.type_id, &targ.span, ) - .map_err(ConstEvalError::CompileError)?; + .map_err(|_| ConstEvalError::CompileError)?; match ir_type.get_content(lookup.context) { TypeContent::StringSlice | TypeContent::StringArray(_) => Ok(Some(Constant { ty: Type::get_unit(lookup.context), value: ConstantValue::Unit, })), - _ => Err(ConstEvalError::CompileError( - CompileError::NonStrGenericType { - span: targ.span.clone(), - }, - )), + _ => Err(ConstEvalError::CompileError), } } Intrinsic::ToStrArray => {