From 72d219a3f9891ef10096ee46c748f64a6492cf5d Mon Sep 17 00:00:00 2001 From: Arthur Date: Fri, 12 Dec 2025 09:23:58 -0500 Subject: [PATCH 1/9] Replace smlxl by duneanalytics github references --- SECURITY.md | 2 +- docs/CONTRIBUTING.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index b46b770..3ca805d 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -13,4 +13,4 @@ currently being supported with security updates. ## Reporting a Vulnerability Vulnerabilities can currently be reported as security advisories at -[this link](https://github.com/smlxl/storage-layout-extractor/security/advisories/new). +[this link](https://github.com/duneanalytics/storage-layout-extractor/security/advisories/new). diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 2f709f6..001e9e8 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -16,13 +16,13 @@ Getting set up with this project is pretty simple. 1. Clone the repository. If you don't want to contribute directly you can use HTTPS clones: ```shell - git clone https://github.com/smlxlio/storage-layout-extractor + git clone https://github.com/duneanalytics/storage-layout-extractor ``` If you _do_ want to contribute directly to the tree, we recommend cloning over SSH: ```shell - git clone git@github.com:smlxlio/storage-layout-extractor.git + git clone git@github.com:duneanalytics/storage-layout-extractor.git ``` 2. Building the project is then as simple as entering the project directory and using `cargo`. @@ -40,7 +40,7 @@ Getting set up with this project is pretty simple. ## Getting Your Work on `main` For contributions this repository works on a -[Pull Request](https://github.com/smlxl/storage-layout-extractor/pulls) and subsequent review +[Pull Request](https://github.com/duneanalytics/storage-layout-extractor/pulls) and subsequent review model, supported by CI to check that things avoid being broken. The process works as follows: 1. If necessary, you fork the repository, but if you have access please create a branch. From 560b89801faab834dae8215bcad8015926571e78 Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 15 Dec 2025 12:27:51 -0500 Subject: [PATCH 2/9] lint --- .github/workflows/ci.yml | 2 +- Cargo.toml | 2 +- src/disassembly/disassembler.rs | 15 +-- src/disassembly/mod.rs | 4 +- src/error/container.rs | 2 +- src/error/disassembly.rs | 2 +- src/error/execution.rs | 2 +- src/error/mod.rs | 2 +- src/error/unification.rs | 2 +- src/extractor/mod.rs | 4 +- src/extractor/state.rs | 2 +- src/opcode/arithmetic.rs | 18 ++-- src/opcode/control.rs | 12 +-- src/opcode/environment.rs | 6 +- src/opcode/logic.rs | 12 +-- src/opcode/memory.rs | 39 ++++--- src/opcode/mod.rs | 2 +- src/opcode/util.rs | 2 +- src/tc/abi.rs | 6 +- src/tc/debug.rs | 4 +- src/tc/expression.rs | 7 +- src/tc/lift/dynamic_array_access.rs | 16 +-- src/tc/lift/mapping_index.rs | 18 ++-- src/tc/lift/mapping_offset.rs | 28 ++--- src/tc/lift/mod.rs | 12 +-- src/tc/lift/mul_shifted.rs | 28 ++--- src/tc/lift/packed_encoding.rs | 54 +++++----- src/tc/lift/proxy_slots.rs | 22 ++-- src/tc/lift/recognise_hashed_slots.rs | 6 +- src/tc/lift/storage_slots.rs | 34 +++--- src/tc/lift/sub_word.rs | 24 ++--- src/tc/mod.rs | 58 +++++------ src/tc/rule/arithmetic_operations.rs | 24 ++--- src/tc/rule/bit_shifts.rs | 2 +- src/tc/rule/boolean_operations.rs | 18 ++-- src/tc/rule/call_data.rs | 8 +- src/tc/rule/create.rs | 8 +- src/tc/rule/dynamic_array_write.rs | 6 +- src/tc/rule/environment_opcodes.rs | 2 +- src/tc/rule/ext_code.rs | 6 +- src/tc/rule/external_calls.rs | 20 ++-- src/tc/rule/mapping_access.rs | 8 +- src/tc/rule/masked_word.rs | 8 +- src/tc/rule/mod.rs | 24 ++--- src/tc/rule/offset_size.rs | 6 +- src/tc/rule/packed_encoding.rs | 2 +- src/tc/rule/s_load_is_inner_types.rs | 4 +- src/tc/rule/sha3.rs | 2 +- src/tc/rule/storage_key.rs | 2 +- src/tc/rule/storage_write.rs | 4 +- src/tc/state/mod.rs | 80 +++++++------- src/tc/state/type_variable.rs | 2 +- src/tc/unification.rs | 35 +++---- src/vm/mod.rs | 21 ++-- src/vm/state/memory.rs | 12 +-- src/vm/state/mod.rs | 4 +- src/vm/state/stack.rs | 4 +- src/vm/state/storage.rs | 8 +- src/vm/thread.rs | 2 +- src/vm/value/mod.rs | 144 +++++++++++++------------- src/watchdog.rs | 2 +- tests/balancers_vault.rs | 34 +++--- tests/common/mod.rs | 7 +- tests/crypto_kitties.rs | 8 +- tests/cryptoadz_custom_image_37b.rs | 4 +- tests/curve_v1_adapter_2_assets.rs | 4 +- tests/house.rs | 54 +++++----- tests/indelible.rs | 22 ++-- tests/kakigori.rs | 14 +-- tests/paw_warz.rs | 12 +-- tests/sale_clock_auction.rs | 2 +- tests/shardwallet.rs | 20 ++-- tests/simple_contract.rs | 4 +- tests/uniswap_permit2.rs | 10 +- tests/uniswap_v2_pair.rs | 8 +- tests/uniswap_v3_pool.rs | 6 +- tests/watchdog.rs | 2 +- 77 files changed, 546 insertions(+), 580 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87f948d..3527206 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ on: # Environment variables that will be set on all runners env: - RUST_VERSION: 1.71.0 # Specify the Rust version to be used on CI. + RUST_VERSION: 1.81.0 # Specify the Rust version to be used on CI. CARGO_TERM_COLOR: always # Always colour Cargo's output. CARGO_INCREMENTAL: 0 # Always run without incremental builds on CI. CARGO_PROFILE_DEV_DEBUG: 0 # Don't embed debug info even though the build is a dev build. diff --git a/Cargo.toml b/Cargo.toml index f77c549..81a4150 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ readme = "README.md" # to let authors opt in to backwards-incompatible changes. Crates using one edition can interoperate with crates using # another edition, thereby ensuring that there's no ecosystem split. edition = "2021" -rust-version = "1.71.0" +rust-version = "1.81.0" # Prevent publishing by accident. publish = false diff --git a/src/disassembly/disassembler.rs b/src/disassembly/disassembler.rs index 547fcb7..2c6ff70 100644 --- a/src/disassembly/disassembler.rs +++ b/src/disassembly/disassembler.rs @@ -11,24 +11,15 @@ use std::rc::Rc; use crate::{ constant::{ - DUP_OPCODE_BASE_VALUE, - LOG_OPCODE_BASE_VALUE, - PUSH_OPCODE_BASE_VALUE, - PUSH_OPCODE_MAX_BYTES, - SWAP_OPCODE_BASE_VALUE, + DUP_OPCODE_BASE_VALUE, LOG_OPCODE_BASE_VALUE, PUSH_OPCODE_BASE_VALUE, + PUSH_OPCODE_MAX_BYTES, SWAP_OPCODE_BASE_VALUE, }, error::{ container::Locatable, disassembly::{Error, Result}, }, opcode::{ - arithmetic as arith, - control, - environment as env, - logic, - memory as mem, - DynOpcode, - Opcode, + DynOpcode, Opcode, arithmetic as arith, control, environment as env, logic, memory as mem, }, }; diff --git a/src/disassembly/mod.rs b/src/disassembly/mod.rs index 4ba9e79..a6eead0 100644 --- a/src/disassembly/mod.rs +++ b/src/disassembly/mod.rs @@ -307,7 +307,7 @@ impl ExecutionThread { let range_usize: Range = Range { start: range.start as usize, - end: range.end as usize, + end: range.end as usize, }; Some(&self.instructions[range_usize]) @@ -341,7 +341,7 @@ mod test { constant::{DUP_OPCODE_BASE_VALUE, LOG_OPCODE_BASE_VALUE, SWAP_OPCODE_BASE_VALUE}, disassembly::InstructionStream, error::disassembly, - opcode::{control, memory, Opcode}, + opcode::{Opcode, control, memory}, }; #[test] diff --git a/src/error/container.rs b/src/error/container.rs index d7b5a62..27df453 100644 --- a/src/error/container.rs +++ b/src/error/container.rs @@ -55,7 +55,7 @@ where fn locate(self, instruction_pointer: u32) -> Self::Located { self.map_err(|e| Located { location: instruction_pointer, - payload: e, + payload: e, }) } } diff --git a/src/error/disassembly.rs b/src/error/disassembly.rs index 0d6c718..328f01c 100644 --- a/src/error/disassembly.rs +++ b/src/error/disassembly.rs @@ -44,7 +44,7 @@ impl container::Locatable for Error { fn locate(self, instruction_pointer: u32) -> Self::Located { container::Located { location: instruction_pointer, - payload: self, + payload: self, } } } diff --git a/src/error/execution.rs b/src/error/execution.rs index 26c42da..8990861 100644 --- a/src/error/execution.rs +++ b/src/error/execution.rs @@ -68,7 +68,7 @@ impl container::Locatable for Error { fn locate(self, instruction_pointer: u32) -> Self::Located { container::Located { location: instruction_pointer, - payload: self, + payload: self, } } } diff --git a/src/error/mod.rs b/src/error/mod.rs index ea00adc..d2db780 100644 --- a/src/error/mod.rs +++ b/src/error/mod.rs @@ -58,7 +58,7 @@ impl container::Locatable for Error { fn locate(self, instruction_pointer: u32) -> Self::Located { container::Located { location: instruction_pointer, - payload: self, + payload: self, } } } diff --git a/src/error/unification.rs b/src/error/unification.rs index 4f7542e..530db09 100644 --- a/src/error/unification.rs +++ b/src/error/unification.rs @@ -51,7 +51,7 @@ impl container::Locatable for Error { fn locate(self, instruction_pointer: u32) -> Self::Located { container::Located { location: instruction_pointer, - payload: self, + payload: self, } } } diff --git a/src/extractor/mod.rs b/src/extractor/mod.rs index 3457017..2dc6c29 100644 --- a/src/extractor/mod.rs +++ b/src/extractor/mod.rs @@ -5,6 +5,7 @@ pub mod contract; pub mod state; use crate::{ + StorageLayout, disassembly::InstructionStream, error, extractor::{contract::Contract, state::State}, @@ -13,7 +14,6 @@ use crate::{ vm, vm::VM, watchdog::DynWatchdog, - StorageLayout, }; /// Creates a new extractor wrapping the provided `contract`, and with the @@ -128,7 +128,7 @@ impl Extractor { pub unsafe fn set_state(self, new_state: NS) -> Extractor { Extractor { contract: self.contract, - state: new_state, + state: new_state, } } diff --git a/src/extractor/state.rs b/src/extractor/state.rs index 0c1ca6d..dc68377 100644 --- a/src/extractor/state.rs +++ b/src/extractor/state.rs @@ -3,13 +3,13 @@ use std::fmt::Debug; use crate::{ + StorageLayout, disassembly::InstructionStream, tc, tc::TypeChecker, vm, vm::{ExecutionResult, VM}, watchdog::DynWatchdog, - StorageLayout, }; /// A marker trait that says that the type implementing it is an extractor diff --git a/src/opcode/arithmetic.rs b/src/opcode/arithmetic.rs index 8d9965b..2e75c8f 100644 --- a/src/opcode/arithmetic.rs +++ b/src/opcode/arithmetic.rs @@ -2,7 +2,7 @@ use crate::{ opcode::{ExecuteResult, Opcode}, - vm::{value::RSVD, VM}, + vm::{VM, value::RSVD}, }; /// The `ADD` opcode performs addition. @@ -204,7 +204,7 @@ impl Opcode for Div { instruction_pointer, RSVD::Divide { dividend: a, - divisor: b, + divisor: b, }, ); @@ -267,7 +267,7 @@ impl Opcode for SDiv { instruction_pointer, RSVD::SignedDivide { dividend: a, - divisor: b, + divisor: b, }, ); @@ -327,7 +327,7 @@ impl Opcode for Mod { instruction_pointer, RSVD::Modulo { dividend: a, - divisor: b, + divisor: b, }, ); @@ -390,7 +390,7 @@ impl Opcode for SMod { instruction_pointer, RSVD::SignedModulo { dividend: a, - divisor: b, + divisor: b, }, ); @@ -461,7 +461,7 @@ impl Opcode for AddMod { instruction_pointer, RSVD::Modulo { dividend: add, - divisor: n, + divisor: n, }, ); @@ -532,7 +532,7 @@ impl Opcode for MulMod { instruction_pointer, RSVD::Modulo { dividend: mul, - divisor: n, + divisor: n, }, ); @@ -591,7 +591,7 @@ impl Opcode for Exp { let result = vm.build().symbolic_exec( instruction_pointer, RSVD::Exp { - value: a, + value: a, exponent: b, }, ); @@ -685,7 +685,7 @@ impl Opcode for SignExtend { #[cfg(test)] mod test { use crate::{ - opcode::{arithmetic, test_util as util, Opcode}, + opcode::{Opcode, arithmetic, test_util as util}, vm::value::{Provenance, RSV, RSVD}, }; diff --git a/src/opcode/control.rs b/src/opcode/control.rs index 2537970..0202a7a 100644 --- a/src/opcode/control.rs +++ b/src/opcode/control.rs @@ -2,10 +2,10 @@ use crate::{ error::{container::Locatable, execution, execution::Error}, - opcode::{util, ExecuteResult, Opcode}, + opcode::{ExecuteResult, Opcode, util}, vm::{ - value::{known::KnownWord, Provenance, RuntimeBoxedVal, RSVD}, VM, + value::{Provenance, RSVD, RuntimeBoxedVal, known::KnownWord}, }, }; @@ -384,7 +384,7 @@ fn store_return_data( let dest_offset = vm.build().symbolic_exec( instruction_pointer, RSVD::Add { - left: ret_offset.constant_fold(), + left: ret_offset.constant_fold(), right: to_add_to_offset, }, ); @@ -396,7 +396,7 @@ fn store_return_data( instruction_pointer, RSVD::ReturnData { offset: src_offset, - size: num_32.clone(), + size: num_32.clone(), }, ); let memory = vm.state()?.memory_mut(); @@ -900,8 +900,8 @@ mod test { use crate::{ disassembly::InstructionStream, error::execution, - opcode::{control, macros::bytecode, test_util as util, Opcode}, - vm::value::{known::KnownWord, Provenance, RSV, RSVD}, + opcode::{Opcode, control, macros::bytecode, test_util as util}, + vm::value::{Provenance, RSV, RSVD, known::KnownWord}, }; #[test] diff --git a/src/opcode/environment.rs b/src/opcode/environment.rs index d6dfb05..6a8055e 100644 --- a/src/opcode/environment.rs +++ b/src/opcode/environment.rs @@ -5,8 +5,8 @@ use crate::{ error::disassembly, opcode::{ExecuteResult, Opcode}, vm::{ - value::{RuntimeBoxedVal, RSVD}, VM, + value::{RSVD, RuntimeBoxedVal}, }, }; @@ -1266,8 +1266,8 @@ impl Opcode for SelfDestruct { #[cfg(test)] mod test { use crate::{ - opcode::{environment, test_util as util, Opcode}, - vm::value::{Provenance, RuntimeBoxedVal, RSV, RSVD}, + opcode::{Opcode, environment, test_util as util}, + vm::value::{Provenance, RSV, RSVD, RuntimeBoxedVal}, }; #[test] diff --git a/src/opcode/logic.rs b/src/opcode/logic.rs index 0548022..cdef09e 100644 --- a/src/opcode/logic.rs +++ b/src/opcode/logic.rs @@ -3,8 +3,8 @@ use crate::{ opcode::{ExecuteResult, Opcode}, vm::{ - value::{known::KnownWord, Provenance, RSVD}, VM, + value::{Provenance, RSVD, known::KnownWord}, }, }; @@ -598,14 +598,14 @@ impl Opcode for Byte { let offset_times_0x08 = vm.build().symbolic_exec( instruction_pointer, RSVD::Multiply { - left: offset, + left: offset, right: const_0x08, }, ); let shift = vm.build().symbolic_exec( instruction_pointer, RSVD::Subtract { - left: const_0xf8, + left: const_0xf8, right: offset_times_0x08, }, ); @@ -615,7 +615,7 @@ impl Opcode for Byte { let result = vm.build().symbolic_exec( instruction_pointer, RSVD::And { - left: shifted, + left: shifted, right: const_0xff, }, ); @@ -836,8 +836,8 @@ impl Opcode for Sar { #[cfg(test)] mod test { use crate::{ - opcode::{logic, test_util as util, Opcode}, - vm::value::{known::KnownWord, Provenance, RSV, RSVD}, + opcode::{Opcode, logic, test_util as util}, + vm::value::{Provenance, RSV, RSVD, known::KnownWord}, }; #[test] diff --git a/src/opcode/memory.rs b/src/opcode/memory.rs index 8f9a851..4417bea 100644 --- a/src/opcode/memory.rs +++ b/src/opcode/memory.rs @@ -4,17 +4,14 @@ use std::mem; use crate::{ constant::{ - CONTRACT_MAXIMUM_SIZE_BYTES, - DUP_OPCODE_BASE_VALUE, - PUSH_OPCODE_BASE_VALUE, - PUSH_OPCODE_MAX_BYTES, - SWAP_OPCODE_BASE_VALUE, + CONTRACT_MAXIMUM_SIZE_BYTES, DUP_OPCODE_BASE_VALUE, PUSH_OPCODE_BASE_VALUE, + PUSH_OPCODE_MAX_BYTES, SWAP_OPCODE_BASE_VALUE, }, error::{container::Locatable, disassembly, execution::Error}, opcode::{ExecuteResult, Opcode}, vm::{ - value::{known::KnownWord, Provenance, RSV, RSVD}, VM, + value::{Provenance, RSV, RSVD, known::KnownWord}, }, }; @@ -192,14 +189,14 @@ impl Opcode for CallDataCopy { let dest_offset = vm.build().symbolic_exec( instruction_pointer, RSVD::Add { - left: dest_offset.clone(), + left: dest_offset.clone(), right: to_add_to_offset.clone(), }, ); let src_offset = vm.build().symbolic_exec( instruction_pointer, RSVD::Add { - left: offset.clone(), + left: offset.clone(), right: to_add_to_offset, }, ); @@ -348,14 +345,14 @@ impl Opcode for CodeCopy { let dest_offset = vm.build().symbolic_exec( instruction_pointer, RSVD::Add { - left: dest_offset.clone(), + left: dest_offset.clone(), right: to_add_to_offset.clone(), }, ); let src_offset = vm.build().symbolic_exec( instruction_pointer, RSVD::Add { - left: offset.clone(), + left: offset.clone(), right: to_add_to_offset, }, ); @@ -363,7 +360,7 @@ impl Opcode for CodeCopy { instruction_pointer, RSVD::CodeCopy { offset: src_offset, - size: num_32.clone(), + size: num_32.clone(), }, ); let memory = vm.state()?.memory_mut(); @@ -517,14 +514,14 @@ impl Opcode for ExtCodeCopy { let dest_offset = vm.build().symbolic_exec( instruction_pointer, RSVD::Add { - left: dest_offset.clone(), + left: dest_offset.clone(), right: to_add_to_offset.clone(), }, ); let src_offset = vm.build().symbolic_exec( instruction_pointer, RSVD::Add { - left: offset.clone(), + left: offset.clone(), right: to_add_to_offset, }, ); @@ -532,8 +529,8 @@ impl Opcode for ExtCodeCopy { instruction_pointer, RSVD::ExtCodeCopy { address: address.clone(), - offset: src_offset, - size: num_32.clone(), + offset: src_offset, + size: num_32.clone(), }, ); let memory = vm.state()?.memory_mut(); @@ -684,14 +681,14 @@ impl Opcode for ReturnDataCopy { let dest_offset = vm.build().symbolic_exec( instruction_pointer, RSVD::Add { - left: dest_offset.clone(), + left: dest_offset.clone(), right: to_add_to_offset.clone(), }, ); let src_offset = vm.build().symbolic_exec( instruction_pointer, RSVD::Add { - left: offset.clone(), + left: offset.clone(), right: to_add_to_offset, }, ); @@ -699,7 +696,7 @@ impl Opcode for ReturnDataCopy { instruction_pointer, RSVD::ReturnData { offset: src_offset, - size: num_32.clone(), + size: num_32.clone(), }, ); let memory = vm.state()?.memory_mut(); @@ -1180,7 +1177,7 @@ impl Opcode for Push0 { #[derive(Clone, Debug, Eq, PartialEq)] pub struct PushN { byte_count: u8, - bytes: Vec, + bytes: Vec, } impl PushN { @@ -1441,10 +1438,10 @@ mod test { use rand::random; use crate::{ - opcode::{memory, test_util as util, Opcode}, + opcode::{Opcode, memory, test_util as util}, vm::{ state::memory::MemStoreSize, - value::{known::KnownWord, Provenance, RuntimeBoxedVal, RSV, RSVD}, + value::{Provenance, RSV, RSVD, RuntimeBoxedVal, known::KnownWord}, }, }; diff --git a/src/opcode/mod.rs b/src/opcode/mod.rs index f85d73b..e171ee9 100644 --- a/src/opcode/mod.rs +++ b/src/opcode/mod.rs @@ -100,7 +100,7 @@ pub type ExecuteResult = Result<()>; mod test_util { use crate::{ disassembly::InstructionStream, - vm::{value::RuntimeBoxedVal, Config, VM}, + vm::{Config, VM, value::RuntimeBoxedVal}, watchdog::LazyWatchdog, }; diff --git a/src/opcode/util.rs b/src/opcode/util.rs index 02f9bcb..89eeb1e 100644 --- a/src/opcode/util.rs +++ b/src/opcode/util.rs @@ -5,8 +5,8 @@ use crate::{ error::{container::Locatable, execution}, opcode::control::JumpDest, vm::{ - value::{RuntimeBoxedVal, RSVD}, VM, + value::{RSVD, RuntimeBoxedVal}, }, }; diff --git a/src/tc/abi.rs b/src/tc/abi.rs index 7892e6d..633cc5e 100644 --- a/src/tc/abi.rs +++ b/src/tc/abi.rs @@ -67,7 +67,7 @@ pub enum AbiType { Array { size: U256Wrapper, #[serde(rename = "type")] - tp: Box, + tp: Box, }, /// Byte arrays of a fixed `length`, where `0 < length <= 32`. @@ -115,7 +115,7 @@ pub enum AbiType { #[derivative(Hash = "ignore", PartialEq = "ignore")] conflicts: Vec, #[derivative(Hash = "ignore", PartialEq = "ignore")] - reasons: Vec, + reasons: Vec, }, } @@ -128,7 +128,7 @@ impl AbiType { pub fn conflict() -> Self { Self::ConflictedType { conflicts: Vec::new(), - reasons: Vec::new(), + reasons: Vec::new(), } } } diff --git a/src/tc/debug.rs b/src/tc/debug.rs index 59d2287..cf353c3 100644 --- a/src/tc/debug.rs +++ b/src/tc/debug.rs @@ -5,10 +5,10 @@ use std::collections::{HashSet, VecDeque}; use crate::{ tc::{ expression::{InferenceSet, TE}, - state::{type_variable::TypeVariable, TypeCheckerState}, + state::{TypeCheckerState, type_variable::TypeVariable}, unification::UnificationForest, }, - vm::value::{known::KnownWord, TCBoxedVal, TCSVD}, + vm::value::{TCBoxedVal, TCSVD, known::KnownWord}, }; /// Gets the type variable for the storage slot at `index` in `state`. diff --git a/src/tc/expression.rs b/src/tc/expression.rs index beb0054..73eaea2 100644 --- a/src/tc/expression.rs +++ b/src/tc/expression.rs @@ -14,10 +14,7 @@ use itertools::Itertools; use crate::{ constant::{ - ADDRESS_WIDTH_BITS, - BOOL_WIDTH_BITS, - BYTE_SIZE_BITS, - FUNCTION_WIDTH_BITS, + ADDRESS_WIDTH_BITS, BOOL_WIDTH_BITS, BYTE_SIZE_BITS, FUNCTION_WIDTH_BITS, SELECTOR_WIDTH_BITS, }, tc::state::type_variable::TypeVariable, @@ -204,7 +201,7 @@ impl TypeExpression { Self::Conflict { conflicts: all_conflicts, - reasons: all_reasons, + reasons: all_reasons, } } diff --git a/src/tc/lift/dynamic_array_access.rs b/src/tc/lift/dynamic_array_access.rs index 7a793cc..34edadc 100644 --- a/src/tc/lift/dynamic_array_access.rs +++ b/src/tc/lift/dynamic_array_access.rs @@ -3,7 +3,7 @@ use crate::{ tc::{lift::Lift, state::TypeCheckerState}, - vm::value::{RuntimeBoxedVal, RSVD}, + vm::value::{RSVD, RuntimeBoxedVal}, }; /// This pass detects and lifts expressions that perform dynamic array indices @@ -46,11 +46,11 @@ impl Lift for DynamicArrayIndex { fn guard_dyn_array_accesses(data: &RSVD) -> Option { match data { RSVD::StorageWrite { key, value } => Some(RSVD::StorageWrite { - key: key.clone().transform_data(lift_dyn_array_accesses), + key: key.clone().transform_data(lift_dyn_array_accesses), value: value.clone().transform_data(lift_dyn_array_accesses), }), RSVD::SLoad { key, value } => Some(RSVD::SLoad { - key: key.clone().transform_data(lift_dyn_array_accesses), + key: key.clone().transform_data(lift_dyn_array_accesses), value: value.clone().transform_data(lift_dyn_array_accesses), }), RSVD::UnwrittenStorageValue { key } => Some(RSVD::UnwrittenStorageValue { @@ -82,7 +82,7 @@ impl Lift for DynamicArrayIndex { }; let access = RSVD::DynamicArrayIndex { - slot: data.transform_data(lift_dyn_array_accesses), + slot: data.transform_data(lift_dyn_array_accesses), index: right.clone().transform_data(lift_dyn_array_accesses), }; @@ -97,10 +97,10 @@ impl Lift for DynamicArrayIndex { mod test { use crate::{ tc::{ - lift::{dynamic_array_access::DynamicArrayIndex, Lift}, + lift::{Lift, dynamic_array_access::DynamicArrayIndex}, state::TypeCheckerState, }, - vm::value::{known::KnownWord, Provenance, RSV, RSVD}, + vm::value::{Provenance, RSV, RSVD, known::KnownWord}, }; #[test] @@ -117,14 +117,14 @@ mod test { let add = RSV::new_synthetic( 3, RSVD::Add { - left: hash, + left: hash, right: input_index.clone(), }, ); let store = RSV::new_synthetic( 4, RSVD::StorageWrite { - key: add, + key: add, value: input_value.clone(), }, ); diff --git a/src/tc/lift/mapping_index.rs b/src/tc/lift/mapping_index.rs index 17731ab..a617ba7 100644 --- a/src/tc/lift/mapping_index.rs +++ b/src/tc/lift/mapping_index.rs @@ -3,7 +3,7 @@ use crate::{ tc::{lift::Lift, state::TypeCheckerState}, - vm::value::{RuntimeBoxedVal, RSVD}, + vm::value::{RSVD, RuntimeBoxedVal}, }; /// This pass detects and folds expressions that represent indices into mappings @@ -42,11 +42,11 @@ impl Lift for MappingIndex { fn guard_mapping_accesses(data: &RSVD) -> Option { match data { RSVD::StorageWrite { key, value } => Some(RSVD::StorageWrite { - key: key.clone().transform_data(insert_mapping_accesses), + key: key.clone().transform_data(insert_mapping_accesses), value: value.clone().transform_data(insert_mapping_accesses), }), RSVD::SLoad { key, value } => Some(RSVD::SLoad { - key: key.clone().transform_data(insert_mapping_accesses), + key: key.clone().transform_data(insert_mapping_accesses), value: value.clone().transform_data(insert_mapping_accesses), }), RSVD::UnwrittenStorageValue { key } => Some(RSVD::UnwrittenStorageValue { @@ -68,8 +68,8 @@ impl Lift for MappingIndex { }; Some(RSVD::MappingIndex { - key: key.clone().transform_data(insert_mapping_accesses), - slot: slot.clone().transform_data(insert_mapping_accesses), + key: key.clone().transform_data(insert_mapping_accesses), + slot: slot.clone().transform_data(insert_mapping_accesses), projection: None, }) } @@ -82,10 +82,10 @@ impl Lift for MappingIndex { mod test { use crate::{ tc::{ - lift::{mapping_index::MappingIndex, Lift}, + lift::{Lift, mapping_index::MappingIndex}, state::TypeCheckerState, }, - vm::value::{known::KnownWord, Provenance, RSV, RSVD}, + vm::value::{Provenance, RSV, RSVD, known::KnownWord}, }; #[test] @@ -103,7 +103,7 @@ mod test { let s_load = RSV::new_synthetic( 5, RSVD::SLoad { - key: slot_key.clone(), + key: slot_key.clone(), value: hash.clone(), }, ); @@ -156,7 +156,7 @@ mod test { let s_store = RSV::new_synthetic( 7, RSVD::StorageWrite { - key: slot_key.clone(), + key: slot_key.clone(), value: outer_hash.clone(), }, ); diff --git a/src/tc/lift/mapping_offset.rs b/src/tc/lift/mapping_offset.rs index 74862ab..defe14b 100644 --- a/src/tc/lift/mapping_offset.rs +++ b/src/tc/lift/mapping_offset.rs @@ -3,7 +3,7 @@ use crate::{ tc::{lift::Lift, state::TypeCheckerState}, - vm::value::{RuntimeBoxedVal, RSVD}, + vm::value::{RSVD, RuntimeBoxedVal}, }; /// This pass detects and folds expressions that access values in mappings that @@ -45,8 +45,8 @@ impl Lift for MappingOffset { }; Some(RSVD::MappingIndex { - key: key.clone().transform_data(insert_mapping_offset), - slot: slot.clone().transform_data(insert_mapping_offset), + key: key.clone().transform_data(insert_mapping_offset), + slot: slot.clone().transform_data(insert_mapping_offset), projection: Some(offset), }) } @@ -59,10 +59,10 @@ impl Lift for MappingOffset { mod test { use crate::{ tc::{ - lift::{mapping_offset::MappingOffset, Lift}, + lift::{Lift, mapping_offset::MappingOffset}, state::TypeCheckerState, }, - vm::value::{known::KnownWord, Provenance, RSV, RSVD}, + vm::value::{Provenance, RSV, RSVD, known::KnownWord}, }; #[test] @@ -73,8 +73,8 @@ mod test { let mapping = RSV::new_synthetic( 2, RSVD::MappingIndex { - slot: input_slot.clone(), - key: input_key.clone(), + slot: input_slot.clone(), + key: input_key.clone(), projection: None, }, ); @@ -82,7 +82,7 @@ mod test { let add = RSV::new_synthetic( 4, RSVD::Add { - left: mapping.clone(), + left: mapping.clone(), right: constant.clone(), }, ); @@ -116,8 +116,8 @@ mod test { let inner_mapping = RSV::new_synthetic( 2, RSVD::MappingIndex { - slot: input_slot.clone(), - key: input_key.clone(), + slot: input_slot.clone(), + key: input_key.clone(), projection: None, }, ); @@ -126,15 +126,15 @@ mod test { let inner_add = RSV::new_synthetic( 4, RSVD::Add { - left: inner_mapping.clone(), + left: inner_mapping.clone(), right: inner_constant.clone(), }, ); let outer_mapping = RSV::new_synthetic( 5, RSVD::MappingIndex { - slot: inner_add.clone(), - key: input_key.clone(), + slot: inner_add.clone(), + key: input_key.clone(), projection: None, }, ); @@ -143,7 +143,7 @@ mod test { let outer_add = RSV::new_synthetic( 7, RSVD::Add { - left: outer_constant.clone(), + left: outer_constant.clone(), right: outer_mapping.clone(), }, ); diff --git a/src/tc/lift/mod.rs b/src/tc/lift/mod.rs index a86b2aa..a583bb5 100644 --- a/src/tc/lift/mod.rs +++ b/src/tc/lift/mod.rs @@ -23,14 +23,10 @@ use crate::{ error::unification::Result, tc::{ lift::{ - dynamic_array_access::DynamicArrayIndex, - mapping_index::MappingIndex, - mapping_offset::MappingOffset, - mul_shifted::MulShiftedValue, - packed_encoding::PackedEncoding, - proxy_slots::ProxySlots, - recognise_hashed_slots::StorageSlotHashes, - storage_slots::StorageSlots, + dynamic_array_access::DynamicArrayIndex, mapping_index::MappingIndex, + mapping_offset::MappingOffset, mul_shifted::MulShiftedValue, + packed_encoding::PackedEncoding, proxy_slots::ProxySlots, + recognise_hashed_slots::StorageSlotHashes, storage_slots::StorageSlots, sub_word::SubWordValue, }, state::TypeCheckerState, diff --git a/src/tc/lift/mul_shifted.rs b/src/tc/lift/mul_shifted.rs index eb8d434..439ec39 100644 --- a/src/tc/lift/mul_shifted.rs +++ b/src/tc/lift/mul_shifted.rs @@ -4,7 +4,7 @@ use crate::{ constant::WORD_SIZE_BITS, tc::{lift::Lift, state::TypeCheckerState}, - vm::value::{known::KnownWord, RuntimeBoxedVal, RSVD}, + vm::value::{RSVD, RuntimeBoxedVal, known::KnownWord}, }; /// This pass detects and lifts expressions that move values around inside a @@ -103,10 +103,10 @@ impl Lift for MulShiftedValue { mod test { use crate::{ tc::{ - lift::{mul_shifted::MulShiftedValue, Lift}, + lift::{Lift, mul_shifted::MulShiftedValue}, state::TypeCheckerState, }, - vm::value::{known::KnownWord, Provenance, SV, SVD}, + vm::value::{Provenance, SV, SVD, known::KnownWord}, }; #[test] @@ -142,14 +142,14 @@ mod test { let mul_const_on_left = SV::new_synthetic( 3, SVD::Multiply { - left: constant.clone(), + left: constant.clone(), right: sub_word.clone(), }, ); let mul_const_on_right = SV::new_synthetic( 4, SVD::Multiply { - left: sub_word.clone(), + left: sub_word.clone(), right: constant, }, ); @@ -185,9 +185,9 @@ mod test { let inner_sub_word = SV::new_synthetic( 1, SVD::SubWord { - value: inner_value, + value: inner_value, offset: 0, - size: 128, + size: 128, }, ); let constant = SV::new_known_value( @@ -199,22 +199,22 @@ mod test { let inner_mul = SV::new_synthetic( 3, SVD::Multiply { - left: constant.clone(), + left: constant.clone(), right: inner_sub_word.clone(), }, ); let outer_sub_word = SV::new_synthetic( 4, SVD::SubWord { - value: inner_mul, + value: inner_mul, offset: 0, - size: 192, + size: 192, }, ); let outer_mul = SV::new_synthetic( 5, SVD::Multiply { - left: outer_sub_word, + left: outer_sub_word, right: constant, }, ); @@ -270,7 +270,7 @@ mod test { let mul = SV::new_synthetic( 3, SVD::Multiply { - left: constant, + left: constant, right: sub_word, }, ); @@ -298,7 +298,7 @@ mod test { let mul = SV::new_synthetic( 3, SVD::Multiply { - left: constant, + left: constant, right: value, }, ); @@ -330,7 +330,7 @@ mod test { let mul = SV::new_synthetic( 3, SVD::Multiply { - left: constant, + left: constant, right: sub_word, }, ); diff --git a/src/tc/lift/packed_encoding.rs b/src/tc/lift/packed_encoding.rs index 50d70c7..aed2d86 100644 --- a/src/tc/lift/packed_encoding.rs +++ b/src/tc/lift/packed_encoding.rs @@ -6,7 +6,7 @@ use itertools::Itertools; use crate::{ tc::{lift::Lift, state::TypeCheckerState}, - vm::value::{PackedSpan, RuntimeBoxedVal, RSV, RSVD}, + vm::value::{PackedSpan, RSV, RSVD, RuntimeBoxedVal}, }; /// This pass detects and lifts expressions that represent the packing of @@ -123,7 +123,7 @@ impl Lift for PackedEncoding { None, ); let store = RSVD::StorageWrite { - key: key.clone(), + key: key.clone(), value: packed, }; Some(store) @@ -140,7 +140,7 @@ impl Lift for PackedEncoding { mod test { use crate::{ tc::{ - lift::{packed_encoding::PackedEncoding, Lift}, + lift::{Lift, packed_encoding::PackedEncoding}, state::TypeCheckerState, }, vm::value::{PackedSpan, Provenance, RSV, RSVD}, @@ -153,9 +153,9 @@ mod test { let sub_word_1 = RSV::new_synthetic( 1, RSVD::SubWord { - value: value.clone(), + value: value.clone(), offset: 128, - size: 128, + size: 128, }, ); let sub_word_2 = RSV::new_synthetic( @@ -169,7 +169,7 @@ mod test { let or = RSV::new_synthetic( 3, RSVD::Or { - left: sub_word_1.clone(), + left: sub_word_1.clone(), right: sub_word_2.clone(), }, ); @@ -177,7 +177,7 @@ mod test { let store = RSV::new_synthetic( 5, RSVD::StorageWrite { - key: input_key.clone(), + key: input_key.clone(), value: or, }, ); @@ -212,17 +212,17 @@ mod test { let sub_word_1 = RSV::new_synthetic( 1, RSVD::SubWord { - value: value.clone(), + value: value.clone(), offset: 128, - size: 128, + size: 128, }, ); let sub_word_2 = RSV::new_synthetic( 2, RSVD::SubWord { - value: value.clone(), + value: value.clone(), offset: 64, - size: 64, + size: 64, }, ); let sub_word_3 = RSV::new_synthetic( @@ -236,14 +236,14 @@ mod test { let inner_or = RSV::new_synthetic( 4, RSVD::Or { - left: sub_word_1.clone(), + left: sub_word_1.clone(), right: sub_word_2.clone(), }, ); let outer_or = RSV::new_synthetic( 5, RSVD::Or { - left: inner_or, + left: inner_or, right: sub_word_3.clone(), }, ); @@ -251,7 +251,7 @@ mod test { let store = RSV::new_synthetic( 7, RSVD::StorageWrite { - key: input_key.clone(), + key: input_key.clone(), value: outer_or, }, ); @@ -287,17 +287,17 @@ mod test { let sub_word_1 = RSV::new_synthetic( 1, RSVD::SubWord { - value: value.clone(), + value: value.clone(), offset: 128, - size: 128, + size: 128, }, ); let sub_word_2 = RSV::new_synthetic( 2, RSVD::SubWord { - value: value.clone(), + value: value.clone(), offset: 0, - size: 64, + size: 64, }, ); let sub_word_3 = RSV::new_synthetic( @@ -312,20 +312,20 @@ mod test { 4, RSVD::Shifted { offset: 64, - value: sub_word_3.clone(), + value: sub_word_3.clone(), }, ); let inner_or = RSV::new_synthetic( 4, RSVD::Or { - left: sub_word_1.clone(), + left: sub_word_1.clone(), right: sub_word_2.clone(), }, ); let outer_or = RSV::new_synthetic( 5, RSVD::Or { - left: inner_or, + left: inner_or, right: shifted.clone(), }, ); @@ -333,7 +333,7 @@ mod test { let store = RSV::new_synthetic( 7, RSVD::StorageWrite { - key: input_key.clone(), + key: input_key.clone(), value: outer_or, }, ); @@ -376,7 +376,7 @@ mod test { let s_load = RSV::new_synthetic( 7, RSVD::SLoad { - key: input_key.clone(), + key: input_key.clone(), value: uninit_load, }, ); @@ -391,22 +391,22 @@ mod test { let sub_word_2 = RSV::new_synthetic( 2, RSVD::SubWord { - value: s_load, + value: s_load, offset: 0, - size: 128, + size: 128, }, ); let or = RSV::new_synthetic( 3, RSVD::Or { - left: sub_word_1.clone(), + left: sub_word_1.clone(), right: sub_word_2, }, ); let store = RSV::new_synthetic( 5, RSVD::StorageWrite { - key: input_key.clone(), + key: input_key.clone(), value: or, }, ); diff --git a/src/tc/lift/proxy_slots.rs b/src/tc/lift/proxy_slots.rs index 8dec242..b18e792 100644 --- a/src/tc/lift/proxy_slots.rs +++ b/src/tc/lift/proxy_slots.rs @@ -8,7 +8,7 @@ use sha3::{Digest, Keccak256}; use crate::{ constant::SOLIDITY_STRING_POINTER, tc::{lift::Lift, state::TypeCheckerState}, - vm::value::{known::KnownWord, RuntimeBoxedVal, RSV, RSVD}, + vm::value::{RSV, RSVD, RuntimeBoxedVal, known::KnownWord}, }; /// This pass detects and folds expressions that access slots constructed using @@ -211,7 +211,7 @@ impl Lift for ProxySlots { fn recognise_proxy_slots(data: &RSVD) -> Option { match data { RSVD::SLoad { key, value } => Some(RSVD::SLoad { - key: if let Some(new_key) = unpick_proxy_slots(key.data()) { + key: if let Some(new_key) = unpick_proxy_slots(key.data()) { RSV::new(key.instruction_pointer(), new_key, key.provenance(), None) } else { key.clone().transform_data(recognise_proxy_slots) @@ -219,7 +219,7 @@ impl Lift for ProxySlots { value: value.clone().transform_data(recognise_proxy_slots), }), RSVD::StorageWrite { key, value } => Some(RSVD::StorageWrite { - key: if let Some(new_key) = unpick_proxy_slots(key.data()) { + key: if let Some(new_key) = unpick_proxy_slots(key.data()) { RSV::new(key.instruction_pointer(), new_key, key.provenance(), None) } else { key.clone().transform_data(recognise_proxy_slots) @@ -241,10 +241,10 @@ mod test { use crate::{ tc::{ - lift::{proxy_slots::ProxySlots, Lift}, + lift::{Lift, proxy_slots::ProxySlots}, state::TypeCheckerState, }, - vm::value::{known::KnownWord, Provenance, RSV, RSVD}, + vm::value::{Provenance, RSV, RSVD, known::KnownWord}, }; #[test] @@ -373,7 +373,7 @@ mod test { let s_load = RSV::new_synthetic( 3, RSVD::SLoad { - key: input_key.clone(), + key: input_key.clone(), value: input_value.clone(), }, ); @@ -421,7 +421,7 @@ mod test { let s_load = RSV::new_synthetic( 3, RSVD::SLoad { - key: input_key.clone(), + key: input_key.clone(), value: input_value.clone(), }, ); @@ -473,7 +473,7 @@ mod test { let s_load = RSV::new_synthetic( 4, RSVD::SLoad { - key: sha3, + key: sha3, value: input_value.clone(), }, ); @@ -523,7 +523,7 @@ mod test { let s_load = RSV::new_synthetic( 4, RSVD::SLoad { - key: sha3.clone(), + key: sha3.clone(), value: input_value.clone(), }, ); @@ -571,7 +571,7 @@ mod test { let s_load = RSV::new_synthetic( 4, RSVD::SLoad { - key: sha3, + key: sha3, value: input_value.clone(), }, ); @@ -631,7 +631,7 @@ mod test { let s_load = RSV::new_synthetic( 4, RSVD::SLoad { - key: sha3.clone(), + key: sha3.clone(), value: input_value.clone(), }, ); diff --git a/src/tc/lift/recognise_hashed_slots.rs b/src/tc/lift/recognise_hashed_slots.rs index 020439a..45c9cf2 100644 --- a/src/tc/lift/recognise_hashed_slots.rs +++ b/src/tc/lift/recognise_hashed_slots.rs @@ -10,7 +10,7 @@ use sha3::{Digest, Keccak256}; use crate::{ tc::{lift::Lift, state::TypeCheckerState}, - vm::value::{known::KnownWord, RuntimeBoxedVal, RSV, RSVD}, + vm::value::{RSV, RSVD, RuntimeBoxedVal, known::KnownWord}, }; /// The number of storage indices for which hashes will be generated (and hence @@ -116,10 +116,10 @@ impl Lift for StorageSlotHashes { mod test { use crate::{ tc::{ - lift::{recognise_hashed_slots::StorageSlotHashes, Lift}, + lift::{Lift, recognise_hashed_slots::StorageSlotHashes}, state::TypeCheckerState, }, - vm::value::{known::KnownWord, Provenance, RSV, RSVD}, + vm::value::{Provenance, RSV, RSVD, known::KnownWord}, }; #[test] diff --git a/src/tc/lift/storage_slots.rs b/src/tc/lift/storage_slots.rs index 581c635..ac1e853 100644 --- a/src/tc/lift/storage_slots.rs +++ b/src/tc/lift/storage_slots.rs @@ -3,7 +3,7 @@ use crate::{ tc::{lift::Lift, state::TypeCheckerState}, - vm::value::{RuntimeBoxedVal, RSV, RSVD}, + vm::value::{RSV, RSVD, RuntimeBoxedVal}, }; /// This pass detects and wraps expressions that access constant storage slots @@ -63,7 +63,7 @@ impl Lift for StorageSlots { }; let new_key = RSV::new(key.instruction_pointer(), data, key.provenance(), None); Some(RSVD::StorageWrite { - key: new_key, + key: new_key, value: value.clone().transform_data(insert_storage_accesses), }) } @@ -89,7 +89,7 @@ impl Lift for StorageSlots { }; let slot = RSV::new(key.instruction_pointer(), data, key.provenance(), None); Some(RSVD::SLoad { - key: slot, + key: slot, value: value.clone().transform_data(insert_storage_accesses), }) } @@ -105,10 +105,10 @@ impl Lift for StorageSlots { mod test { use crate::{ tc::{ - lift::{storage_slots::StorageSlots, Lift}, + lift::{Lift, storage_slots::StorageSlots}, state::TypeCheckerState, }, - vm::value::{known::KnownWord, Provenance, RSV, RSVD}, + vm::value::{Provenance, RSV, RSVD, known::KnownWord}, }; #[test] @@ -119,8 +119,8 @@ mod test { let mapping_access = RSV::new_synthetic( 2, RSVD::MappingIndex { - key: mapping_key.clone(), - slot: slot_index_constant.clone(), + key: mapping_key.clone(), + slot: slot_index_constant.clone(), projection: None, }, ); @@ -157,8 +157,8 @@ mod test { let mapping_access = RSV::new_synthetic( 2, RSVD::MappingIndex { - key: mapping_key.clone(), - slot: slot_index_constant.clone(), + key: mapping_key.clone(), + slot: slot_index_constant.clone(), projection: None, }, ); @@ -166,7 +166,7 @@ mod test { let write = RSV::new_synthetic( 7, RSVD::StorageWrite { - key: outer_key.clone(), + key: outer_key.clone(), value: mapping_access, }, ); @@ -214,7 +214,7 @@ mod test { let storage_store = RSV::new_synthetic( 2, RSVD::StorageWrite { - key: storage_key.clone(), + key: storage_key.clone(), value: storage_value.clone(), }, ); @@ -243,7 +243,7 @@ mod test { let dyn_array = RSV::new_synthetic( 2, RSVD::DynamicArrayIndex { - slot: input_slot.clone(), + slot: input_slot.clone(), index: input_index.clone(), }, ); @@ -280,8 +280,8 @@ mod test { let mapping_access = RSV::new_synthetic( 2, RSVD::MappingIndex { - key: mapping_key.clone(), - slot: input_slot.clone(), + key: mapping_key.clone(), + slot: input_slot.clone(), projection: None, }, ); @@ -317,7 +317,7 @@ mod test { let storage_store = RSV::new_synthetic( 2, RSVD::StorageWrite { - key: input_slot.clone(), + key: input_slot.clone(), value: storage_value.clone(), }, ); @@ -348,7 +348,7 @@ mod test { let dyn_array = RSV::new_synthetic( 2, RSVD::DynamicArrayIndex { - slot: input_slot.clone(), + slot: input_slot.clone(), index: input_index.clone(), }, ); @@ -374,7 +374,7 @@ mod test { let s_load = RSV::new_synthetic( 1, RSVD::SLoad { - key: input_key.clone(), + key: input_key.clone(), value: input_value.clone(), }, ); diff --git a/src/tc/lift/sub_word.rs b/src/tc/lift/sub_word.rs index 2578669..1f58545 100644 --- a/src/tc/lift/sub_word.rs +++ b/src/tc/lift/sub_word.rs @@ -6,10 +6,10 @@ use itertools::Itertools; use crate::{ constant::WORD_SIZE_BITS, tc::{ - lift::{mul_shifted::MulShiftedValue, Lift}, + lift::{Lift, mul_shifted::MulShiftedValue}, state::TypeCheckerState, }, - vm::value::{RuntimeBoxedVal, RSVD, SVD}, + vm::value::{RSVD, RuntimeBoxedVal, SVD}, }; /// This pass detects and folds expressions that mask word-size values where the @@ -209,10 +209,10 @@ impl SubWord { mod test { use crate::{ tc::{ - lift::{sub_word::SubWordValue, Lift}, + lift::{Lift, sub_word::SubWordValue}, state::TypeCheckerState, }, - vm::value::{known::KnownWord, Provenance, SV, SVD}, + vm::value::{Provenance, SV, SVD, known::KnownWord}, }; #[test] @@ -281,7 +281,7 @@ mod test { let subtract = SV::new_synthetic( 3, SVD::Subtract { - left: shift, + left: shift, right: one, }, ); @@ -322,7 +322,7 @@ mod test { let mask = SV::new_synthetic( 3, SVD::Subtract { - left: shift, + left: shift, right: one, }, ); @@ -334,14 +334,14 @@ mod test { let mask_on_left = SV::new_synthetic( 5, SVD::And { - left: mask.clone(), + left: mask.clone(), right: input_value.clone(), }, ); let mask_on_right = SV::new_synthetic( 5, SVD::And { - left: input_value.clone(), + left: input_value.clone(), right: mask, }, ); @@ -386,7 +386,7 @@ mod test { let mask = SV::new_synthetic( 3, SVD::Subtract { - left: shift, + left: shift, right: one, }, ); @@ -396,7 +396,7 @@ mod test { let mask_operation = SV::new_synthetic( 5, SVD::And { - left: mask.clone(), + left: mask.clone(), right: input_value.clone(), }, ); @@ -405,14 +405,14 @@ mod test { let recurse_on_left = SV::new_synthetic( 6, SVD::And { - left: mask_operation.clone(), + left: mask_operation.clone(), right: mask.clone(), }, ); let recurse_on_right = SV::new_synthetic( 7, SVD::And { - left: mask, + left: mask, right: mask_operation, }, ); diff --git a/src/tc/mod.rs b/src/tc/mod.rs index 39ce63b..8d73f2b 100644 --- a/src/tc/mod.rs +++ b/src/tc/mod.rs @@ -7,6 +7,7 @@ use itertools::Itertools; use state::type_variable::TypeVariable; use crate::{ + StorageLayout, constant::BYTE_SIZE_BITS, error::{ container::Locatable, @@ -14,18 +15,17 @@ use crate::{ }, tc::{ abi::{AbiType, StructElement}, - expression::{Span, TypeExpression, WordUse, TE}, + expression::{Span, TE, TypeExpression, WordUse}, lift::LiftingPasses, rule::InferenceRules, state::TypeCheckerState, }, utility::U256Wrapper, vm::{ - value::{RuntimeBoxedVal, TCBoxedVal, TCSVD}, ExecutionResult, + value::{RuntimeBoxedVal, TCBoxedVal, TCSVD}, }, watchdog::DynWatchdog, - StorageLayout, }; pub mod abi; @@ -224,14 +224,14 @@ impl TypeChecker { let ty_var = self.state.var_unchecked(&slot); let TCSVD::StorageSlot { key } = slot.data() else { Err(Error::InvalidTree { - value: slot.clone(), + value: slot.clone(), reason: "Failed to destructure supposedly known structure".into(), } .locate(slot.instruction_pointer()))? }; let TCSVD::KnownData { value: index } = key.data() else { Err(Error::InvalidTree { - value: key.clone(), + value: key.clone(), reason: "Failed to destructure supposedly known structure".into(), } .locate(slot.instruction_pointer()))? @@ -304,7 +304,7 @@ impl TypeChecker { WordUse::Bool => { if width != usage.size() { return Err(Error::InvalidInference { - value: type_expr, + value: type_expr, reason: "Bool inferred with incorrect width".into(), } .locate(location) @@ -315,7 +315,7 @@ impl TypeChecker { WordUse::Address => { if width != usage.size() { return Err(Error::InvalidInference { - value: type_expr, + value: type_expr, reason: "Address inferred with incorrect width".into(), } .locate(location) @@ -326,7 +326,7 @@ impl TypeChecker { WordUse::Selector => { if width != usage.size() { return Err(Error::InvalidInference { - value: type_expr, + value: type_expr, reason: "Selector inferred with incorrect width".into(), } .locate(location) @@ -337,7 +337,7 @@ impl TypeChecker { WordUse::Function => { if width != usage.size() { return Err(Error::InvalidInference { - value: type_expr, + value: type_expr, reason: "Function inferred with incorrect width".into(), } .locate(location) @@ -353,7 +353,7 @@ impl TypeChecker { .expect_type("Fixed array element resolved to multiple types"); AbiType::Array { size: U256Wrapper(length), - tp: Box::new(tp), + tp: Box::new(tp), } .into() } @@ -365,7 +365,7 @@ impl TypeChecker { .abi_type_for_impl(value, seen_exprs, ParentType::Other)? .expect_type("Mapping value resolved to multiple types"); AbiType::Mapping { - key_type: Box::new(key_tp), + key_type: Box::new(key_tp), value_type: Box::new(val_tp), } .into() @@ -428,7 +428,7 @@ impl TypeChecker { } TE::Equal { id } => { return Err(Error::InvalidInference { - value: TE::Equal { id }, + value: TE::Equal { id }, reason: "Equalities cannot be converted into ABI types".into(), } .locate(location) @@ -471,7 +471,7 @@ impl TypeChecker { let location = self.state.value_unchecked(type_variable).instruction_pointer(); Err(Error::UnificationIncomplete { - var: type_variable, + var: type_variable, inferences: inferences.iter().cloned().collect(), } .locate(location))? @@ -668,9 +668,9 @@ pub mod test { use std::collections::VecDeque; use crate::{ - tc::{abi::AbiType, Config, TypeChecker}, + tc::{Config, TypeChecker, abi::AbiType}, utility::U256W, - vm::value::{known::KnownWord, Provenance, RSV, RSVD}, + vm::value::{Provenance, RSV, RSVD, known::KnownWord}, watchdog::LazyWatchdog, }; @@ -682,7 +682,7 @@ pub mod test { let add = RSV::new( 2, RSVD::Add { - left: v_2.clone(), + left: v_2.clone(), right: v_3.clone(), }, Provenance::Synthetic, @@ -715,7 +715,7 @@ pub mod test { let store = RSV::new( 6, RSVD::StorageWrite { - key: sha3.clone(), + key: sha3.clone(), value: add.clone(), }, Provenance::Synthetic, @@ -739,8 +739,8 @@ pub mod test { let c_1_mapping = RSV::new( 0, RSVD::MappingIndex { - key: v_1.clone(), - slot: c_1_slot.clone(), + key: v_1.clone(), + slot: c_1_slot.clone(), projection: None, }, Provenance::Synthetic, @@ -757,7 +757,7 @@ pub mod test { let processed_store = RSV::new( 0, RSVD::StorageWrite { - key: store_slot.clone(), + key: store_slot.clone(), value: add.clone(), }, Provenance::Synthetic, @@ -780,7 +780,7 @@ pub mod test { assert_eq!( first_slot.typ, AbiType::Mapping { - key_type: Box::new(AbiType::Any), + key_type: Box::new(AbiType::Any), value_type: Box::new(AbiType::Number { size: None }), } ); @@ -796,7 +796,7 @@ pub mod test { let add = RSV::new( 2, RSVD::Add { - left: var_1.clone(), + left: var_1.clone(), right: var_2.clone(), }, Provenance::Synthetic, @@ -814,8 +814,8 @@ pub mod test { let mapping = RSV::new( 4, RSVD::MappingIndex { - slot: storage_slot.clone(), - key: add.clone(), + slot: storage_slot.clone(), + key: add.clone(), projection: None, }, Provenance::Synthetic, @@ -844,7 +844,7 @@ pub mod test { disassembly::InstructionStream, error::execution, opcode::control::Invalid, - vm::{state::VMState, value::RuntimeBoxedVal, Config, ExecutionResult}, + vm::{Config, ExecutionResult, state::VMState, value::RuntimeBoxedVal}, }; /// Creates a default execution result. @@ -853,8 +853,8 @@ pub mod test { ExecutionResult { instructions: InstructionStream::try_from(bytecode![Invalid::default()].as_slice()) .expect("Cannot actually panic due to statically-known bytecode"), - states: Vec::new(), - errors: execution::Errors::new(), + states: Vec::new(), + errors: execution::Errors::new(), } } @@ -868,8 +868,8 @@ pub mod test { ExecutionResult { instructions: InstructionStream::try_from(bytecode![Invalid::default()].as_slice()) .expect("Cannot actually panic due to statically-known bytecode"), - states: vec![state_with_values], - errors: execution::Errors::new(), + states: vec![state_with_values], + errors: execution::Errors::new(), } } } diff --git a/src/tc/rule/arithmetic_operations.rs b/src/tc/rule/arithmetic_operations.rs index b769fc1..1d7ef28 100644 --- a/src/tc/rule/arithmetic_operations.rs +++ b/src/tc/rule/arithmetic_operations.rs @@ -68,10 +68,10 @@ mod test { use crate::{ tc::{ expression::TE, - rule::{arithmetic_operations::ArithmeticOperationRule, InferenceRule}, + rule::{InferenceRule, arithmetic_operations::ArithmeticOperationRule}, state::TypeCheckerState, }, - vm::value::{known::KnownWord, Provenance, RSV, RSVD, TCSVD}, + vm::value::{Provenance, RSV, RSVD, TCSVD, known::KnownWord}, }; #[test] @@ -82,7 +82,7 @@ mod test { let add = RSV::new_synthetic( 2, RSVD::Add { - left: left.clone(), + left: left.clone(), right: right.clone(), }, ); @@ -113,7 +113,7 @@ mod test { let mul = RSV::new_synthetic( 2, RSVD::Multiply { - left: left.clone(), + left: left.clone(), right: right.clone(), }, ); @@ -144,7 +144,7 @@ mod test { let sub = RSV::new_synthetic( 2, RSVD::Subtract { - left: left.clone(), + left: left.clone(), right: right.clone(), }, ); @@ -176,7 +176,7 @@ mod test { 2, RSVD::Divide { dividend: dividend.clone(), - divisor: divisor.clone(), + divisor: divisor.clone(), }, ); @@ -207,7 +207,7 @@ mod test { 2, RSVD::SignedDivide { dividend: dividend.clone(), - divisor: divisor.clone(), + divisor: divisor.clone(), }, ); @@ -238,7 +238,7 @@ mod test { 2, RSVD::Modulo { dividend: dividend.clone(), - divisor: divisor.clone(), + divisor: divisor.clone(), }, ); @@ -269,7 +269,7 @@ mod test { 2, RSVD::SignedModulo { dividend: dividend.clone(), - divisor: divisor.clone(), + divisor: divisor.clone(), }, ); @@ -299,7 +299,7 @@ mod test { let exp = RSV::new_synthetic( 2, RSVD::Exp { - value: value.clone(), + value: value.clone(), exponent: exponent.clone(), }, ); @@ -331,7 +331,7 @@ mod test { 2, RSVD::SignExtend { value: value.clone(), - size: size.clone(), + size: size.clone(), }, ); @@ -362,7 +362,7 @@ mod test { 2, RSVD::SignExtend { value: value.clone(), - size: size.clone(), + size: size.clone(), }, ); diff --git a/src/tc/rule/bit_shifts.rs b/src/tc/rule/bit_shifts.rs index 00d9fb2..90b7c78 100644 --- a/src/tc/rule/bit_shifts.rs +++ b/src/tc/rule/bit_shifts.rs @@ -53,7 +53,7 @@ mod test { use crate::{ tc::{ expression::TE, - rule::{bit_shifts::BitShiftRule, InferenceRule}, + rule::{InferenceRule, bit_shifts::BitShiftRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, diff --git a/src/tc/rule/boolean_operations.rs b/src/tc/rule/boolean_operations.rs index 61f429d..5c2d329 100644 --- a/src/tc/rule/boolean_operations.rs +++ b/src/tc/rule/boolean_operations.rs @@ -58,7 +58,7 @@ mod test { use crate::{ tc::{ expression::TE, - rule::{boolean_operations::BooleanOpsRule, InferenceRule}, + rule::{InferenceRule, boolean_operations::BooleanOpsRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, @@ -72,7 +72,7 @@ mod test { let operator = RSV::new_synthetic( 2, RSVD::LessThan { - left: left.clone(), + left: left.clone(), right: right.clone(), }, ); @@ -103,7 +103,7 @@ mod test { let operator = RSV::new_synthetic( 2, RSVD::GreaterThan { - left: left.clone(), + left: left.clone(), right: right.clone(), }, ); @@ -134,7 +134,7 @@ mod test { let operator = RSV::new_synthetic( 2, RSVD::SignedLessThan { - left: left.clone(), + left: left.clone(), right: right.clone(), }, ); @@ -165,7 +165,7 @@ mod test { let operator = RSV::new_synthetic( 2, RSVD::SignedGreaterThan { - left: left.clone(), + left: left.clone(), right: right.clone(), }, ); @@ -196,7 +196,7 @@ mod test { let operator = RSV::new_synthetic( 2, RSVD::Equals { - left: left.clone(), + left: left.clone(), right: right.clone(), }, ); @@ -255,7 +255,7 @@ mod test { let operator = RSV::new_synthetic( 2, RSVD::And { - left: left.clone(), + left: left.clone(), right: right.clone(), }, ); @@ -286,7 +286,7 @@ mod test { let operator = RSV::new_synthetic( 2, RSVD::Or { - left: left.clone(), + left: left.clone(), right: right.clone(), }, ); @@ -317,7 +317,7 @@ mod test { let operator = RSV::new_synthetic( 2, RSVD::Xor { - left: left.clone(), + left: left.clone(), right: right.clone(), }, ); diff --git a/src/tc/rule/call_data.rs b/src/tc/rule/call_data.rs index 859b064..7038e1c 100644 --- a/src/tc/rule/call_data.rs +++ b/src/tc/rule/call_data.rs @@ -5,7 +5,7 @@ use crate::{ constant::BYTE_SIZE_BITS, error::unification::Result, tc::{expression::TE, rule::InferenceRule, state::TypeCheckerState}, - vm::value::{known::KnownWord, TCBoxedVal, TCSVD}, + vm::value::{TCBoxedVal, TCSVD, known::KnownWord}, }; /// This rule creates equations as described below for expressions of the @@ -52,10 +52,10 @@ mod test { constant::BYTE_SIZE_BITS, tc::{ expression::TE, - rule::{call_data::CallDataRule, InferenceRule}, + rule::{InferenceRule, call_data::CallDataRule}, state::TypeCheckerState, }, - vm::value::{known::KnownWord, Provenance, RSV, RSVD, TCSVD}, + vm::value::{Provenance, RSV, RSVD, TCSVD, known::KnownWord}, }; #[test] @@ -124,7 +124,7 @@ mod test { let size = RSV::new_synthetic( 3, RSVD::Add { - left: left_val.clone(), + left: left_val.clone(), right: right_val.clone(), }, ); diff --git a/src/tc/rule/create.rs b/src/tc/rule/create.rs index 5a1efc4..a46c2e1 100644 --- a/src/tc/rule/create.rs +++ b/src/tc/rule/create.rs @@ -47,7 +47,7 @@ mod test { constant::WORD_SIZE_BITS, tc::{ expression::TE, - rule::{create::CreateContractRule, InferenceRule}, + rule::{InferenceRule, create::CreateContractRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, @@ -62,7 +62,7 @@ mod test { 2, RSVD::Create { value: value.clone(), - data: data.clone(), + data: data.clone(), }, ); @@ -94,8 +94,8 @@ mod test { 3, RSVD::Create2 { value: value.clone(), - salt: salt.clone(), - data: data.clone(), + salt: salt.clone(), + data: data.clone(), }, ); diff --git a/src/tc/rule/dynamic_array_write.rs b/src/tc/rule/dynamic_array_write.rs index 32cd722..efc311e 100644 --- a/src/tc/rule/dynamic_array_write.rs +++ b/src/tc/rule/dynamic_array_write.rs @@ -58,7 +58,7 @@ mod test { use crate::{ tc::{ expression::TE, - rule::{dynamic_array_write::DynamicArrayWriteRule, InferenceRule}, + rule::{InferenceRule, dynamic_array_write::DynamicArrayWriteRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, @@ -79,7 +79,7 @@ mod test { let dyn_array = RSV::new_synthetic( 4, RSVD::DynamicArrayIndex { - slot: slot_of_base_slot.clone(), + slot: slot_of_base_slot.clone(), index: index.clone(), }, ); @@ -92,7 +92,7 @@ mod test { let store = RSV::new_synthetic( 6, RSVD::StorageWrite { - key: slot_of_dyn_array.clone(), + key: slot_of_dyn_array.clone(), value: value.clone(), }, ); diff --git a/src/tc/rule/environment_opcodes.rs b/src/tc/rule/environment_opcodes.rs index ea6f09a..d122157 100644 --- a/src/tc/rule/environment_opcodes.rs +++ b/src/tc/rule/environment_opcodes.rs @@ -53,7 +53,7 @@ mod test { use crate::{ tc::{ expression::TE, - rule::{environment_opcodes::EnvironmentCodesRule, InferenceRule}, + rule::{InferenceRule, environment_opcodes::EnvironmentCodesRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, diff --git a/src/tc/rule/ext_code.rs b/src/tc/rule/ext_code.rs index 6703155..d32285d 100644 --- a/src/tc/rule/ext_code.rs +++ b/src/tc/rule/ext_code.rs @@ -59,7 +59,7 @@ mod test { use crate::{ tc::{ expression::TE, - rule::{ext_code::ExtCodeRule, InferenceRule}, + rule::{InferenceRule, ext_code::ExtCodeRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, @@ -103,8 +103,8 @@ mod test { 3, RSVD::ExtCodeCopy { address: address.clone(), - offset: offset.clone(), - size: size.clone(), + offset: offset.clone(), + size: size.clone(), }, ); diff --git a/src/tc/rule/external_calls.rs b/src/tc/rule/external_calls.rs index 563a9aa..fe3dd1e 100644 --- a/src/tc/rule/external_calls.rs +++ b/src/tc/rule/external_calls.rs @@ -104,7 +104,7 @@ mod test { use crate::{ tc::{ expression::TE, - rule::{external_calls::ExternalCallRule, InferenceRule}, + rule::{InferenceRule, external_calls::ExternalCallRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, @@ -123,12 +123,12 @@ mod test { let call = RSV::new_synthetic( 6, RSVD::CallWithValue { - gas: gas.clone(), - address: address.clone(), - value: value.clone(), + gas: gas.clone(), + address: address.clone(), + value: value.clone(), argument_data: arg_data.clone(), - ret_offset: ret_offset.clone(), - ret_size: ret_size.clone(), + ret_offset: ret_offset.clone(), + ret_size: ret_size.clone(), }, ); @@ -179,11 +179,11 @@ mod test { let call = RSV::new_synthetic( 6, RSVD::CallWithoutValue { - gas: gas.clone(), - address: address.clone(), + gas: gas.clone(), + address: address.clone(), argument_data: arg_data.clone(), - ret_offset: ret_offset.clone(), - ret_size: ret_size.clone(), + ret_offset: ret_offset.clone(), + ret_size: ret_size.clone(), }, ); diff --git a/src/tc/rule/mapping_access.rs b/src/tc/rule/mapping_access.rs index 43ce00b..abd5cff 100644 --- a/src/tc/rule/mapping_access.rs +++ b/src/tc/rule/mapping_access.rs @@ -65,10 +65,10 @@ mod test { constant::WORD_SIZE_BITS, tc::{ expression::{Span, TE}, - rule::{mapping_access::MappingAccessRule, InferenceRule}, + rule::{InferenceRule, mapping_access::MappingAccessRule}, state::TypeCheckerState, }, - vm::value::{known::KnownWord, Provenance, RSV, RSVD, TCSVD}, + vm::value::{Provenance, RSV, RSVD, TCSVD, known::KnownWord}, }; #[test] @@ -80,8 +80,8 @@ mod test { let mapping = RSV::new_synthetic( 3, RSVD::MappingIndex { - key: v_1.clone(), - slot: mapping_slot.clone(), + key: v_1.clone(), + slot: mapping_slot.clone(), projection: None, }, ); diff --git a/src/tc/rule/masked_word.rs b/src/tc/rule/masked_word.rs index 73c9795..f5c7410 100644 --- a/src/tc/rule/masked_word.rs +++ b/src/tc/rule/masked_word.rs @@ -52,8 +52,8 @@ impl InferenceRule for MaskedWordRule { mod test { use crate::{ tc::{ - expression::{Span, WordUse, TE}, - rule::{masked_word::MaskedWordRule, InferenceRule}, + expression::{Span, TE, WordUse}, + rule::{InferenceRule, masked_word::MaskedWordRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, @@ -66,9 +66,9 @@ mod test { let mask = RSV::new_synthetic( 1, RSVD::SubWord { - value: value.clone(), + value: value.clone(), offset: 64, - size: 128, + size: 128, }, ); diff --git a/src/tc/rule/mod.rs b/src/tc/rule/mod.rs index 0310dac..0cf7533 100644 --- a/src/tc/rule/mod.rs +++ b/src/tc/rule/mod.rs @@ -34,22 +34,14 @@ use crate::{ error::unification::Result, tc::{ rule::{ - arithmetic_operations::ArithmeticOperationRule, - bit_shifts::BitShiftRule, - boolean_operations::BooleanOpsRule, - call_data::CallDataRule, - create::CreateContractRule, - dynamic_array_write::DynamicArrayWriteRule, - environment_opcodes::EnvironmentCodesRule, - external_calls::ExternalCallRule, - mapping_access::MappingAccessRule, - masked_word::MaskedWordRule, - offset_size::OffsetSizeRule, - packed_encoding::PackedEncodingRule, - s_load_is_inner_types::SLoadIsInnerTypesRule, - sha3::HashRule, - storage_key::StorageKeyRule, - storage_write::StorageWriteRule, + arithmetic_operations::ArithmeticOperationRule, bit_shifts::BitShiftRule, + boolean_operations::BooleanOpsRule, call_data::CallDataRule, + create::CreateContractRule, dynamic_array_write::DynamicArrayWriteRule, + environment_opcodes::EnvironmentCodesRule, external_calls::ExternalCallRule, + mapping_access::MappingAccessRule, masked_word::MaskedWordRule, + offset_size::OffsetSizeRule, packed_encoding::PackedEncodingRule, + s_load_is_inner_types::SLoadIsInnerTypesRule, sha3::HashRule, + storage_key::StorageKeyRule, storage_write::StorageWriteRule, }, state::TypeCheckerState, }, diff --git a/src/tc/rule/offset_size.rs b/src/tc/rule/offset_size.rs index 7e24d09..0ced94e 100644 --- a/src/tc/rule/offset_size.rs +++ b/src/tc/rule/offset_size.rs @@ -42,7 +42,7 @@ mod test { use crate::{ tc::{ expression::TE, - rule::{offset_size::OffsetSizeRule, InferenceRule}, + rule::{InferenceRule, offset_size::OffsetSizeRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, @@ -82,7 +82,7 @@ mod test { 2, RSVD::CodeCopy { offset: offset.clone(), - size: size.clone(), + size: size.clone(), }, ); @@ -113,7 +113,7 @@ mod test { 2, RSVD::ReturnData { offset: offset.clone(), - size: size.clone(), + size: size.clone(), }, ); diff --git a/src/tc/rule/packed_encoding.rs b/src/tc/rule/packed_encoding.rs index b246fa5..86d700e 100644 --- a/src/tc/rule/packed_encoding.rs +++ b/src/tc/rule/packed_encoding.rs @@ -49,7 +49,7 @@ mod test { use crate::{ tc::{ expression::{Span, TE}, - rule::{packed_encoding::PackedEncodingRule, InferenceRule}, + rule::{InferenceRule, packed_encoding::PackedEncodingRule}, state::TypeCheckerState, }, vm::value::{PackedSpan, Provenance, RSV, RSVD, TCSVD}, diff --git a/src/tc/rule/s_load_is_inner_types.rs b/src/tc/rule/s_load_is_inner_types.rs index 6102e1a..18b28f3 100644 --- a/src/tc/rule/s_load_is_inner_types.rs +++ b/src/tc/rule/s_load_is_inner_types.rs @@ -47,7 +47,7 @@ mod test { use crate::{ tc::{ expression::TE, - rule::{s_load_is_inner_types::SLoadIsInnerTypesRule, InferenceRule}, + rule::{InferenceRule, s_load_is_inner_types::SLoadIsInnerTypesRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, @@ -61,7 +61,7 @@ mod test { let s_load = RSV::new_synthetic( 2, RSVD::SLoad { - key: key.clone(), + key: key.clone(), value: value.clone(), }, ); diff --git a/src/tc/rule/sha3.rs b/src/tc/rule/sha3.rs index b5b3b6a..c71b2a3 100644 --- a/src/tc/rule/sha3.rs +++ b/src/tc/rule/sha3.rs @@ -36,7 +36,7 @@ mod test { constant::WORD_SIZE_BITS, tc::{ expression::TE, - rule::{sha3::HashRule, InferenceRule}, + rule::{InferenceRule, sha3::HashRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, diff --git a/src/tc/rule/storage_key.rs b/src/tc/rule/storage_key.rs index 9ec7766..c2c820d 100644 --- a/src/tc/rule/storage_key.rs +++ b/src/tc/rule/storage_key.rs @@ -33,7 +33,7 @@ mod test { use crate::{ tc::{ expression::TE, - rule::{storage_key::StorageKeyRule, InferenceRule}, + rule::{InferenceRule, storage_key::StorageKeyRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, diff --git a/src/tc/rule/storage_write.rs b/src/tc/rule/storage_write.rs index ebad29c..4b0f7da 100644 --- a/src/tc/rule/storage_write.rs +++ b/src/tc/rule/storage_write.rs @@ -49,7 +49,7 @@ mod test { use crate::{ tc::{ expression::TE, - rule::{storage_write::StorageWriteRule, InferenceRule}, + rule::{InferenceRule, storage_write::StorageWriteRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, @@ -63,7 +63,7 @@ mod test { let write = RSV::new_synthetic( 2, RSVD::StorageWrite { - key: input_key.clone(), + key: input_key.clone(), value: input_value.clone(), }, ); diff --git a/src/tc/state/mod.rs b/src/tc/state/mod.rs index 065ea4a..a007452 100644 --- a/src/tc/state/mod.rs +++ b/src/tc/state/mod.rs @@ -10,10 +10,10 @@ use type_variable::{TypeVariable, TypeVariableSource}; use crate::{ tc::{ - expression::{InferenceSet, TypeExpression, TE}, + expression::{InferenceSet, TE, TypeExpression}, unification::UnificationForest, }, - vm::value::{PackedSpan, Provenance, RuntimeBoxedVal, TCBoxedVal, RSVD, TCSV, TCSVD}, + vm::value::{PackedSpan, Provenance, RSVD, RuntimeBoxedVal, TCBoxedVal, TCSV, TCSVD}, }; pub mod type_variable; @@ -149,39 +149,39 @@ impl TypeCheckerState { RSVD::Value { id } => TCSVD::Value { id }, RSVD::KnownData { value } => TCSVD::KnownData { value }, RSVD::Add { left, right } => TCSVD::Add { - left: self.register_internal(left), + left: self.register_internal(left), right: self.register_internal(right), }, RSVD::Multiply { left, right } => TCSVD::Multiply { - left: self.register_internal(left), + left: self.register_internal(left), right: self.register_internal(right), }, RSVD::Subtract { left, right } => TCSVD::Subtract { - left: self.register_internal(left), + left: self.register_internal(left), right: self.register_internal(right), }, RSVD::Divide { dividend, divisor } => TCSVD::Divide { dividend: self.register_internal(dividend), - divisor: self.register_internal(divisor), + divisor: self.register_internal(divisor), }, RSVD::SignedDivide { dividend, divisor } => TCSVD::SignedDivide { dividend: self.register_internal(dividend), - divisor: self.register_internal(divisor), + divisor: self.register_internal(divisor), }, RSVD::Modulo { dividend, divisor } => TCSVD::Modulo { dividend: self.register_internal(dividend), - divisor: self.register_internal(divisor), + divisor: self.register_internal(divisor), }, RSVD::SignedModulo { dividend, divisor } => TCSVD::SignedModulo { dividend: self.register_internal(dividend), - divisor: self.register_internal(divisor), + divisor: self.register_internal(divisor), }, RSVD::Exp { value, exponent } => TCSVD::Exp { - value: self.register_internal(value), + value: self.register_internal(value), exponent: self.register_internal(exponent), }, RSVD::SignExtend { size, value } => TCSVD::SignExtend { - size: self.register_internal(size), + size: self.register_internal(size), value: self.register_internal(value), }, RSVD::CallWithValue { @@ -192,12 +192,12 @@ impl TypeCheckerState { ret_offset, ret_size, } => TCSVD::CallWithValue { - gas: self.register_internal(gas), - address: self.register_internal(address), - value: self.register_internal(value), + gas: self.register_internal(gas), + address: self.register_internal(address), + value: self.register_internal(value), argument_data: self.register_internal(argument_data), - ret_offset: self.register_internal(ret_offset), - ret_size: self.register_internal(ret_size), + ret_offset: self.register_internal(ret_offset), + ret_size: self.register_internal(ret_size), }, RSVD::CallWithoutValue { gas, @@ -206,11 +206,11 @@ impl TypeCheckerState { ret_offset, ret_size, } => TCSVD::CallWithoutValue { - gas: self.register_internal(gas), - address: self.register_internal(address), + gas: self.register_internal(gas), + address: self.register_internal(address), argument_data: self.register_internal(argument_data), - ret_offset: self.register_internal(ret_offset), - ret_size: self.register_internal(ret_size), + ret_offset: self.register_internal(ret_offset), + ret_size: self.register_internal(ret_size), }, RSVD::Sha3 { data } => TCSVD::Sha3 { data: self.register_internal(data), @@ -239,54 +239,54 @@ impl TypeCheckerState { RSVD::BaseFee => TCSVD::BaseFee, RSVD::Gas => TCSVD::Gas, RSVD::Log { data, topics } => TCSVD::Log { - data: self.register_internal(data), + data: self.register_internal(data), topics: topics.into_iter().map(|t| self.register_internal(t)).collect(), }, RSVD::Create { value, data } => TCSVD::Create { value: self.register_internal(value), - data: self.register_internal(data), + data: self.register_internal(data), }, RSVD::Create2 { value, salt, data } => TCSVD::Create2 { value: self.register_internal(value), - salt: self.register_internal(salt), - data: self.register_internal(data), + salt: self.register_internal(salt), + data: self.register_internal(data), }, RSVD::SelfDestruct { target } => TCSVD::SelfDestruct { target: self.register_internal(target), }, RSVD::LessThan { left, right } => TCSVD::LessThan { - left: self.register_internal(left), + left: self.register_internal(left), right: self.register_internal(right), }, RSVD::GreaterThan { left, right } => TCSVD::GreaterThan { - left: self.register_internal(left), + left: self.register_internal(left), right: self.register_internal(right), }, RSVD::SignedLessThan { left, right } => TCSVD::SignedLessThan { - left: self.register_internal(left), + left: self.register_internal(left), right: self.register_internal(right), }, RSVD::SignedGreaterThan { left, right } => TCSVD::SignedGreaterThan { - left: self.register_internal(left), + left: self.register_internal(left), right: self.register_internal(right), }, RSVD::Equals { left, right } => TCSVD::Equals { - left: self.register_internal(left), + left: self.register_internal(left), right: self.register_internal(right), }, RSVD::IsZero { number } => TCSVD::IsZero { number: self.register_internal(number), }, RSVD::And { left, right } => TCSVD::And { - left: self.register_internal(left), + left: self.register_internal(left), right: self.register_internal(right), }, RSVD::Or { left, right } => TCSVD::Or { - left: self.register_internal(left), + left: self.register_internal(left), right: self.register_internal(right), }, RSVD::Xor { left, right } => TCSVD::Xor { - left: self.register_internal(left), + left: self.register_internal(left), right: self.register_internal(right), }, RSVD::Not { value } => TCSVD::Not { @@ -312,7 +312,7 @@ impl TypeCheckerState { RSVD::CallDataSize => TCSVD::CallDataSize, RSVD::CodeCopy { offset, size } => TCSVD::CodeCopy { offset: self.register_internal(offset), - size: self.register_internal(size), + size: self.register_internal(size), }, RSVD::ExtCodeSize { address } => TCSVD::ExtCodeSize { address: self.register_internal(address), @@ -323,12 +323,12 @@ impl TypeCheckerState { size, } => TCSVD::ExtCodeCopy { address: self.register_internal(address), - offset: self.register_internal(offset), - size: self.register_internal(size), + offset: self.register_internal(offset), + size: self.register_internal(size), }, RSVD::ReturnData { offset, size } => TCSVD::ReturnData { offset: self.register_internal(offset), - size: self.register_internal(size), + size: self.register_internal(size), }, RSVD::Return { data } => TCSVD::Return { data: self.register_internal(data), @@ -340,11 +340,11 @@ impl TypeCheckerState { key: self.register_internal(key), }, RSVD::SLoad { key, value } => TCSVD::SLoad { - key: self.register_internal(key), + key: self.register_internal(key), value: self.register_internal(value), }, RSVD::StorageWrite { key, value } => TCSVD::StorageWrite { - key: self.register_internal(key), + key: self.register_internal(key), value: self.register_internal(value), }, RSVD::Concat { values } => TCSVD::Concat { @@ -360,7 +360,7 @@ impl TypeCheckerState { projection, }, RSVD::DynamicArrayIndex { slot, index } => TCSVD::DynamicArrayIndex { - slot: self.register_internal(slot), + slot: self.register_internal(slot), index: self.register_internal(index), }, RSVD::SubWord { @@ -685,7 +685,7 @@ mod test { use crate::{ tc::{ - expression::{TypeExpression, TE}, + expression::{TE, TypeExpression}, state::TypeCheckerState, }, vm::value::{Provenance, RSV}, diff --git a/src/tc/state/type_variable.rs b/src/tc/state/type_variable.rs index dbf252b..995ef41 100644 --- a/src/tc/state/type_variable.rs +++ b/src/tc/state/type_variable.rs @@ -4,8 +4,8 @@ use std::{ fmt::{Display, Formatter}, sync::{ - atomic::{AtomicUsize, Ordering}, Arc, + atomic::{AtomicUsize, Ordering}, }, }; diff --git a/src/tc/unification.rs b/src/tc/unification.rs index e77be2e..1722e53 100644 --- a/src/tc/unification.rs +++ b/src/tc/unification.rs @@ -16,8 +16,8 @@ use crate::{ unification::{Error, Result}, }, tc::{ - expression::{InferenceSet, Span, TypeExpression, WordUse, TE}, - state::{type_variable::TypeVariable, TypeCheckerState}, + expression::{InferenceSet, Span, TE, TypeExpression, WordUse}, + state::{TypeCheckerState, type_variable::TypeVariable}, }, watchdog::DynWatchdog, }; @@ -615,7 +615,7 @@ impl Merge { /// A representation of a symmetrical equality between two type variables. #[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)] pub struct Equality { - pub left: TypeVariable, + pub left: TypeVariable, pub right: TypeVariable, } @@ -660,7 +660,7 @@ mod test { use crate::{ constant::ADDRESS_WIDTH_BITS, tc::{ - expression::{Span, WordUse, TE}, + expression::{Span, TE, WordUse}, state::TypeCheckerState, unification::{merge, unify}, }, @@ -964,11 +964,11 @@ mod test { // Create some inferences and register them let array_inference_1 = TE::FixedArray { element: elem_1_tv, - length: input_len, + length: input_len, }; let array_inference_2 = TE::FixedArray { element: elem_2_tv, - length: input_len, + length: input_len, }; let elem_inference_1 = TE::bytes(None); let elem_inference_2 = TE::signed_word(Some(64)); @@ -1013,11 +1013,11 @@ mod test { // Create some inferences and register them let array_inference_1 = TE::FixedArray { element: elem_1_tv, - length: input_len, + length: input_len, }; let array_inference_2 = TE::FixedArray { element: elem_2_tv, - length: input_len, + length: input_len, }; let elem_inference_1 = TE::unsigned_word(None); let elem_inference_2 = TE::signed_word(Some(64)); @@ -1064,11 +1064,11 @@ mod test { // Create some inferences and register them let array_inference_1 = TE::FixedArray { element: elem_1_tv, - length: U256::from(7u32), + length: U256::from(7u32), }; let array_inference_2 = TE::FixedArray { element: elem_2_tv, - length: U256::from(8u32), + length: U256::from(8u32), }; let elem_inference_1 = TE::bytes(None); let elem_inference_2 = TE::signed_word(Some(64)); @@ -1110,14 +1110,14 @@ mod test { state.infer( mapping_tv, TE::Mapping { - key: key_1_tv, + key: key_1_tv, value: value_1_tv, }, ); state.infer( mapping_tv, TE::Mapping { - key: key_2_tv, + key: key_2_tv, value: value_2_tv, }, ); @@ -1158,14 +1158,14 @@ mod test { state.infer( mapping_tv, TE::Mapping { - key: key_1_tv, + key: key_1_tv, value: value_1_tv, }, ); state.infer( mapping_tv, TE::Mapping { - key: key_2_tv, + key: key_2_tv, value: value_2_tv, }, ); @@ -1209,14 +1209,14 @@ mod test { state.infer( mapping_tv, TE::Mapping { - key: key_1_tv, + key: key_1_tv, value: value_1_tv, }, ); state.infer( mapping_tv, TE::Mapping { - key: key_2_tv, + key: key_2_tv, value: value_2_tv, }, ); @@ -1434,8 +1434,7 @@ mod test { mod util { use crate::tc::{ - expression::TypeExpression, - state::type_variable::TypeVariable, + expression::TypeExpression, state::type_variable::TypeVariable, unification::UnificationForest, }; diff --git a/src/vm/mod.rs b/src/vm/mod.rs index 5843afe..23bb3ad 100644 --- a/src/vm/mod.rs +++ b/src/vm/mod.rs @@ -9,12 +9,9 @@ use std::collections::VecDeque; use crate::{ constant::{ - BLOCK_GAS_LIMIT, - DEFAULT_CONDITIONAL_JUMP_PER_TARGET_FORK_LIMIT, - DEFAULT_ITERATIONS_PER_OPCODE, - DEFAULT_MEMORY_SINGLE_OPERATION_MAX_BYTES, - DEFAULT_PERMISSIVE_ERRORS_ENABLED, - DEFAULT_VALUE_SIZE_LIMIT, + BLOCK_GAS_LIMIT, DEFAULT_CONDITIONAL_JUMP_PER_TARGET_FORK_LIMIT, + DEFAULT_ITERATIONS_PER_OPCODE, DEFAULT_MEMORY_SINGLE_OPERATION_MAX_BYTES, + DEFAULT_PERMISSIVE_ERRORS_ENABLED, DEFAULT_VALUE_SIZE_LIMIT, }, disassembly::{ExecutionThread, InstructionStream}, error::{ @@ -25,9 +22,9 @@ use crate::{ opcode::DynOpcode, vm::{ data::JumpTargets, - state::{stack::LocatedStackHandle, VMState}, + state::{VMState, stack::LocatedStackHandle}, thread::VMThread, - value::{known::KnownWord, Provenance, RuntimeBoxedVal, RSV, RSVD}, + value::{Provenance, RSV, RSVD, RuntimeBoxedVal, known::KnownWord}, }, watchdog::DynWatchdog, }; @@ -516,8 +513,8 @@ impl VM { pub fn consume(self) -> ExecutionResult { ExecutionResult { instructions: self.instructions, - states: self.stored_states, - errors: self.errors, + states: self.stored_states, + errors: self.errors, } } } @@ -895,14 +892,14 @@ mod test { error_container.payloads()[0], LocatedError { location: 4, - payload: Error::InvalidJumpTarget { offset: 11 }, + payload: Error::InvalidJumpTarget { offset: 11 }, } ); assert_eq!( error_container.payloads()[1], LocatedError { location: 5, - payload: Error::NoSuchStackFrame { depth: 0 }, + payload: Error::NoSuchStackFrame { depth: 0 }, } ); diff --git a/src/vm/state/memory.rs b/src/vm/state/memory.rs index b05bb91..fb44ed4 100644 --- a/src/vm/state/memory.rs +++ b/src/vm/state/memory.rs @@ -4,7 +4,7 @@ use std::{collections::HashMap, hash::Hash}; use crate::{ constant::WORD_SIZE_BITS, - vm::value::{known::KnownWord, Provenance, RuntimeBoxedVal, RSV, RSVD}, + vm::value::{Provenance, RSV, RSVD, RuntimeBoxedVal, known::KnownWord}, }; /// A representation of the transient memory of the symbolic virtual machine. @@ -327,7 +327,7 @@ mod test { constant::DEFAULT_MEMORY_SINGLE_OPERATION_MAX_BYTES, vm::{ state::memory::{MemStoreSize, Memory}, - value::{known::KnownWord, Provenance, RuntimeBoxedVal, RSV, RSVD}, + value::{Provenance, RSV, RSVD, RuntimeBoxedVal, known::KnownWord}, }, }; @@ -502,21 +502,21 @@ mod test { let sum = RSV::new_synthetic( 2, RSVD::Add { - left: left.clone(), + left: left.clone(), right: right.clone(), }, ); let prod = RSV::new_synthetic( 3, RSVD::Multiply { - left: left.clone(), + left: left.clone(), right: right.clone(), }, ); let sub = RSV::new_synthetic( 4, RSVD::Subtract { - left: left.clone(), + left: left.clone(), right: right.clone(), }, ); @@ -524,7 +524,7 @@ mod test { 5, RSVD::Divide { dividend: left, - divisor: right, + divisor: right, }, ); diff --git a/src/vm/state/mod.rs b/src/vm/state/mod.rs index 36cd259..ac1150f 100644 --- a/src/vm/state/mod.rs +++ b/src/vm/state/mod.rs @@ -6,10 +6,10 @@ pub mod stack; pub mod storage; use crate::vm::{ + Config, data::VisitedOpcodes, state::{memory::Memory, stack::Stack, storage::Storage}, value::RuntimeBoxedVal, - Config, }; /// The state representation for the [`super::VM`]. @@ -203,9 +203,9 @@ impl VMState { #[cfg(test)] mod test { use crate::vm::{ + Config, state::VMState, value::{RSV, RSVD}, - Config, }; #[test] diff --git a/src/vm/state/stack.rs b/src/vm/state/stack.rs index 7d56b93..f6cd62f 100644 --- a/src/vm/state/stack.rs +++ b/src/vm/state/stack.rs @@ -194,7 +194,7 @@ pub type StackResult = std::result::Result; #[derive(Debug)] pub struct LocatedStackHandle<'a> { instruction_pointer: u32, - stack: &'a mut Stack, + stack: &'a mut Stack, } impl<'a> LocatedStackHandle<'a> { @@ -257,7 +257,7 @@ mod test { constant::MAXIMUM_STACK_DEPTH, vm::{ state::stack::Stack, - value::{Provenance, RuntimeBoxedVal, RSV}, + value::{Provenance, RSV, RuntimeBoxedVal}, }, }; diff --git a/src/vm/state/storage.rs b/src/vm/state/storage.rs index d2f7f82..cd12930 100644 --- a/src/vm/state/storage.rs +++ b/src/vm/state/storage.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; -use crate::vm::value::{Provenance, RuntimeBoxedVal, RSV, RSVD}; +use crate::vm::value::{Provenance, RSV, RSVD, RuntimeBoxedVal}; /// A representation of the persistent storage of the symbolic virtual machine. /// @@ -110,7 +110,7 @@ impl Storage { most_recent.data().clone() } else { RSVD::SLoad { - key: key.clone(), + key: key.clone(), value: most_recent.clone(), } }, @@ -187,7 +187,7 @@ impl Storage { RSV::new( v.instruction_pointer(), RSVD::StorageWrite { - key: k.clone(), + key: k.clone(), value: v, }, provenance, @@ -210,7 +210,7 @@ impl Default for Storage { mod test { use crate::vm::{ state::storage::Storage, - value::{known::KnownWord, Provenance, RuntimeBoxedVal, RSV, RSVD}, + value::{Provenance, RSV, RSVD, RuntimeBoxedVal, known::KnownWord}, }; /// Creates a new synthetic value for testing purposes. diff --git a/src/vm/thread.rs b/src/vm/thread.rs index e3051b3..bb1076a 100644 --- a/src/vm/thread.rs +++ b/src/vm/thread.rs @@ -102,7 +102,7 @@ impl From for VMState { mod test { use crate::{ disassembly::InstructionStream, - vm::{state::VMState, thread::VMThread, Config}, + vm::{Config, state::VMState, thread::VMThread}, }; #[test] diff --git a/src/vm/value/mod.rs b/src/vm/value/mod.rs index 3bdfdd9..80eb6c3 100644 --- a/src/vm/value/mod.rs +++ b/src/vm/value/mod.rs @@ -12,9 +12,7 @@ use derivative::Derivative; use uuid::Uuid; use crate::{ - tc::state::type_variable::TypeVariable, - utility::clip_uuid, - vm::value::known::KnownWord, + tc::state::type_variable::TypeVariable, utility::clip_uuid, vm::value::known::KnownWord, }; /// The type of auxiliary data used at runtime. @@ -457,12 +455,12 @@ pub enum SymbolicValueData { /// about what the call will do with the argument. Internal execution will /// read from memory directly, so we pick up the returned value there. CallWithValue { - gas: BoxedVal, - address: BoxedVal, - value: BoxedVal, + gas: BoxedVal, + address: BoxedVal, + value: BoxedVal, argument_data: BoxedVal, - ret_offset: BoxedVal, - ret_size: BoxedVal, + ret_offset: BoxedVal, + ret_size: BoxedVal, }, /// A message call that passes a value. @@ -474,11 +472,11 @@ pub enum SymbolicValueData { /// about what the call will do with the argument. Internal execution will /// read from memory directly, so we pick up the returned value there. CallWithoutValue { - gas: BoxedVal, - address: BoxedVal, + gas: BoxedVal, + address: BoxedVal, argument_data: BoxedVal, - ret_offset: BoxedVal, - ret_size: BoxedVal, + ret_offset: BoxedVal, + ret_size: BoxedVal, }, /// A keccak256 hash on symbolic values. @@ -545,8 +543,8 @@ pub enum SymbolicValueData { /// Creates a new contract at a predictable address. Create2 { value: BoxedVal, - salt: BoxedVal, - data: BoxedVal, + salt: BoxedVal, + data: BoxedVal, }, /// Registers the account for deletion. @@ -610,8 +608,8 @@ pub enum SymbolicValueData { /// `offset` for `size`. ExtCodeCopy { address: BoxedVal, - offset: BoxedVal, - size: BoxedVal, + offset: BoxedVal, + size: BoxedVal, }, /// Data copied from the return data from the previous call at `offset` for @@ -646,8 +644,8 @@ pub enum SymbolicValueData { /// The value is a mapping index with `slot` as its base and the particular /// location specified by `key` offset by `projection`. MappingIndex { - slot: BoxedVal, - key: BoxedVal, + slot: BoxedVal, + key: BoxedVal, projection: Option, }, @@ -836,39 +834,39 @@ where Self::Value { .. } => inner_self, Self::KnownData { .. } => inner_self, Self::Add { left, right } => Self::Add { - left: left.transform_data(transform), + left: left.transform_data(transform), right: right.transform_data(transform), }, Self::Multiply { left, right } => Self::Multiply { - left: left.transform_data(transform), + left: left.transform_data(transform), right: right.transform_data(transform), }, Self::Subtract { left, right } => Self::Subtract { - left: left.transform_data(transform), + left: left.transform_data(transform), right: right.transform_data(transform), }, Self::Divide { divisor, dividend } => Self::Divide { dividend: dividend.transform_data(transform), - divisor: divisor.transform_data(transform), + divisor: divisor.transform_data(transform), }, Self::SignedDivide { divisor, dividend } => Self::SignedDivide { dividend: dividend.transform_data(transform), - divisor: divisor.transform_data(transform), + divisor: divisor.transform_data(transform), }, Self::Modulo { divisor, dividend } => Self::Modulo { dividend: dividend.transform_data(transform), - divisor: divisor.transform_data(transform), + divisor: divisor.transform_data(transform), }, Self::SignedModulo { divisor, dividend } => Self::SignedModulo { dividend: dividend.transform_data(transform), - divisor: divisor.transform_data(transform), + divisor: divisor.transform_data(transform), }, Self::Exp { value, exponent } => Self::Exp { - value: value.transform_data(transform), + value: value.transform_data(transform), exponent: exponent.transform_data(transform), }, Self::SignExtend { size, value } => Self::SignExtend { - size: size.transform_data(transform), + size: size.transform_data(transform), value: value.transform_data(transform), }, Self::CallWithValue { @@ -879,12 +877,12 @@ where ret_offset, ret_size, } => Self::CallWithValue { - gas: gas.transform_data(transform), - address: address.transform_data(transform), - value: value.transform_data(transform), + gas: gas.transform_data(transform), + address: address.transform_data(transform), + value: value.transform_data(transform), argument_data: argument_data.transform_data(transform), - ret_offset: ret_offset.transform_data(transform), - ret_size: ret_size.transform_data(transform), + ret_offset: ret_offset.transform_data(transform), + ret_size: ret_size.transform_data(transform), }, Self::CallWithoutValue { gas, @@ -893,11 +891,11 @@ where ret_offset, ret_size, } => Self::CallWithoutValue { - gas: gas.transform_data(transform), - address: address.transform_data(transform), + gas: gas.transform_data(transform), + address: address.transform_data(transform), argument_data: argument_data.transform_data(transform), - ret_offset: ret_offset.transform_data(transform), - ret_size: ret_size.transform_data(transform), + ret_offset: ret_offset.transform_data(transform), + ret_size: ret_size.transform_data(transform), }, Self::Sha3 { data } => Self::Sha3 { data: data.transform_data(transform), @@ -926,54 +924,54 @@ where Self::BaseFee => inner_self, Self::Gas => inner_self, Self::Log { data, topics } => Self::Log { - data: data.transform_data(transform), + data: data.transform_data(transform), topics: topics.iter().map(|t| t.transform_data(transform)).collect(), }, Self::Create { value, data } => Self::Create { value: value.transform_data(transform), - data: data.transform_data(transform), + data: data.transform_data(transform), }, Self::Create2 { value, data, salt } => Self::Create2 { value: value.transform_data(transform), - data: data.transform_data(transform), - salt: salt.transform_data(transform), + data: data.transform_data(transform), + salt: salt.transform_data(transform), }, Self::SelfDestruct { target } => Self::SelfDestruct { target: target.transform_data(transform), }, Self::LessThan { left, right } => Self::LessThan { - left: left.transform_data(transform), + left: left.transform_data(transform), right: right.transform_data(transform), }, Self::GreaterThan { left, right } => Self::GreaterThan { - left: left.transform_data(transform), + left: left.transform_data(transform), right: right.transform_data(transform), }, Self::SignedLessThan { left, right } => Self::SignedLessThan { - left: left.transform_data(transform), + left: left.transform_data(transform), right: right.transform_data(transform), }, Self::SignedGreaterThan { left, right } => Self::SignedGreaterThan { - left: left.transform_data(transform), + left: left.transform_data(transform), right: right.transform_data(transform), }, Self::Equals { left, right } => Self::Equals { - left: left.transform_data(transform), + left: left.transform_data(transform), right: right.transform_data(transform), }, Self::IsZero { number } => Self::IsZero { number: number.transform_data(transform), }, Self::And { left, right } => Self::And { - left: left.transform_data(transform), + left: left.transform_data(transform), right: right.transform_data(transform), }, Self::Or { left, right } => Self::Or { - left: left.transform_data(transform), + left: left.transform_data(transform), right: right.transform_data(transform), }, Self::Xor { left, right } => Self::Xor { - left: left.transform_data(transform), + left: left.transform_data(transform), right: right.transform_data(transform), }, Self::Not { value } => Self::Not { @@ -992,14 +990,14 @@ where value: value.transform_data(transform), }, Self::CallData { id, offset, size } => Self::CallData { - id: *id, + id: *id, offset: offset.transform_data(transform), - size: size.transform_data(transform), + size: size.transform_data(transform), }, Self::CallDataSize => inner_self, Self::CodeCopy { offset, size } => Self::CodeCopy { offset: offset.transform_data(transform), - size: size.transform_data(transform), + size: size.transform_data(transform), }, Self::ExtCodeSize { address } => Self::ExtCodeSize { address: address.transform_data(transform), @@ -1010,12 +1008,12 @@ where size, } => Self::ExtCodeCopy { address: address.transform_data(transform), - offset: offset.transform_data(transform), - size: size.transform_data(transform), + offset: offset.transform_data(transform), + size: size.transform_data(transform), }, Self::ReturnData { offset, size } => Self::ReturnData { offset: offset.transform_data(transform), - size: size.transform_data(transform), + size: size.transform_data(transform), }, Self::Return { data } => Self::Return { data: data.transform_data(transform), @@ -1027,14 +1025,14 @@ where key: key.transform_data(transform), }, Self::SLoad { key, value } => Self::SLoad { - key: key.transform_data(transform), + key: key.transform_data(transform), value: value.transform_data(transform), }, Self::StorageSlot { key } => Self::StorageSlot { key: key.transform_data(transform), }, Self::StorageWrite { key, value } => Self::StorageWrite { - key: key.transform_data(transform), + key: key.transform_data(transform), value: value.transform_data(transform), }, Self::Concat { values } => Self::Concat { @@ -1045,12 +1043,12 @@ where key, projection, } => Self::MappingIndex { - slot: slot.transform_data(transform), - key: key.transform_data(transform), + slot: slot.transform_data(transform), + key: key.transform_data(transform), projection: *projection, }, Self::DynamicArrayIndex { slot, index } => Self::DynamicArrayIndex { - slot: slot.transform_data(transform), + slot: slot.transform_data(transform), index: index.transform_data(transform), }, Self::SubWord { @@ -1058,13 +1056,13 @@ where offset, size, } => Self::SubWord { - value: value.transform_data(transform), + value: value.transform_data(transform), offset: *offset, - size: *size, + size: *size, }, Self::Shifted { offset, value } => Self::Shifted { offset: *offset, - value: value.transform_data(transform), + value: value.transform_data(transform), }, Self::Packed { elements } => Self::Packed { elements: elements.iter().map(|elem| elem.transform(transform)).collect(), @@ -1552,8 +1550,8 @@ where let new_data = self.value.transform_data(transform); Self { offset: self.offset, - size: self.size, - value: new_data, + size: self.size, + value: new_data, } } } @@ -1647,7 +1645,7 @@ mod test { use ethnum::U256; use uuid::Uuid; - use crate::vm::value::{known::KnownWord, Provenance, RSV, RSVD}; + use crate::vm::value::{Provenance, RSV, RSVD, known::KnownWord}; #[test] fn equality_ignores_instruction_pointer() { @@ -2065,7 +2063,7 @@ mod test { let inner_add = RSV::new( 2, RSVD::Add { - left: inner_add_left, + left: inner_add_left, right: inner_add_right, }, Provenance::Synthetic, @@ -2076,7 +2074,7 @@ mod test { let outer_add = RSV::new( 2, RSVD::Add { - left: outer_add_left, + left: outer_add_left, right: inner_add, }, Provenance::Synthetic, @@ -2100,14 +2098,14 @@ mod test { let add = RSV::new_synthetic( 3, RSVD::Add { - left: value_1.clone(), + left: value_1.clone(), right: value_2.clone(), }, ); let mul = RSV::new_synthetic( 4, RSVD::Multiply { - left: add.clone(), + left: add.clone(), right: value_3.clone(), }, ); @@ -2129,14 +2127,14 @@ mod test { let add = RSV::new_synthetic( 3, RSVD::Add { - left: value_1.clone(), + left: value_1.clone(), right: value_2.clone(), }, ); let mul = RSV::new_synthetic( 4, RSVD::Multiply { - left: add.clone(), + left: add.clone(), right: value_3.clone(), }, ); @@ -2166,14 +2164,14 @@ mod test { let add = RSV::new_synthetic( 3, RSVD::Add { - left: value_1.clone(), + left: value_1.clone(), right: value_2.clone(), }, ); let mul = RSV::new_synthetic( 4, RSVD::Multiply { - left: add.clone(), + left: add.clone(), right: value_3.clone(), }, ); diff --git a/src/watchdog.rs b/src/watchdog.rs index 3bee0e1..86bd804 100644 --- a/src/watchdog.rs +++ b/src/watchdog.rs @@ -16,8 +16,8 @@ use std::{ fmt::Debug, rc::Rc, sync::{ - atomic::{AtomicBool, Ordering}, Arc, + atomic::{AtomicBool, Ordering}, }, }; diff --git a/tests/balancers_vault.rs b/tests/balancers_vault.rs index ec66ec7..8dbddbd 100644 --- a/tests/balancers_vault.rs +++ b/tests/balancers_vault.rs @@ -34,7 +34,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 1, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Struct { + key_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Bytes { length: Some(10) }), StructElement::new(80, AbiType::UInt { size: Some(16) }), @@ -47,7 +47,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { StructElement::new( 256, AbiType::Mapping { - key_type: Box::new(AbiType::Number { size: None }), + key_type: Box::new(AbiType::Number { size: None }), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Bytes { length: Some(20) }), @@ -60,7 +60,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { StructElement::new( 512, AbiType::Mapping { - key_type: Box::new(AbiType::Bytes { length: Some(20) }), + key_type: Box::new(AbiType::Bytes { length: Some(20) }), value_type: Box::new(AbiType::Number { size: None }), } ) @@ -75,7 +75,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 2, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Bytes { length: Some(20) }), + key_type: Box::new(AbiType::Bytes { length: Some(20) }), value_type: Box::new(AbiType::Number { size: None }), } )); @@ -91,9 +91,9 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 4, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Bytes { length: Some(20) }), + key_type: Box::new(AbiType::Bytes { length: Some(20) }), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Number { size: Some(8) }), @@ -110,7 +110,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 5, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Struct { + key_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Bytes { length: Some(10) }), StructElement::new(80, AbiType::UInt { size: Some(16) }), @@ -136,7 +136,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 7, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Struct { + key_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Bytes { length: Some(10) }), StructElement::new(80, AbiType::UInt { size: Some(16) }), @@ -144,7 +144,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { ], }), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::Bytes { length: Some(20) }), + key_type: Box::new(AbiType::Bytes { length: Some(20) }), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Bytes { length: Some(14) }), @@ -162,7 +162,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 8, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Struct { + key_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Bytes { length: Some(10) }), StructElement::new(80, AbiType::UInt { size: Some(16) }), @@ -180,7 +180,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { StructElement::new( 256, AbiType::Mapping { - key_type: Box::new(AbiType::Bytes { length: Some(20) }), + key_type: Box::new(AbiType::Bytes { length: Some(20) }), value_type: Box::new(AbiType::Number { size: None }), } ) @@ -196,7 +196,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 9, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Struct { + key_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Bytes { length: Some(10) }), StructElement::new(80, AbiType::UInt { size: Some(16) }), @@ -210,7 +210,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { StructElement::new( 512, AbiType::Mapping { - key_type: Box::new(AbiType::Any), + key_type: Box::new(AbiType::Any), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::UInt { size: Some(112) }), @@ -232,7 +232,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 10, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Struct { + key_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Bytes { length: Some(10) }), StructElement::new(80, AbiType::UInt { size: Some(16) }), @@ -240,7 +240,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { ], }), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::Bytes { length: Some(20) }), + key_type: Box::new(AbiType::Bytes { length: Some(20) }), value_type: Box::new(AbiType::Bytes { length: Some(20) }), }), } @@ -252,9 +252,9 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 11, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Bytes { length: Some(20) }), + key_type: Box::new(AbiType::Bytes { length: Some(20) }), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::Bytes { length: Some(20) }), + key_type: Box::new(AbiType::Bytes { length: Some(20) }), value_type: Box::new(AbiType::UInt { size: None }), }), } diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 5a7f708..c70f779 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -10,15 +10,14 @@ use serde::{Deserialize, Serialize}; use storage_layout_extractor as sle; use storage_layout_extractor::{ extractor::{ + InitialExtractor, chain::{ - version::{ChainVersion, EthereumVersion}, Chain, + version::{ChainVersion, EthereumVersion}, }, contract::Contract, - InitialExtractor, }, - tc, - vm, + tc, vm, watchdog::{DynWatchdog, LazyWatchdog}, }; diff --git a/tests/crypto_kitties.rs b/tests/crypto_kitties.rs index ccddc3e..189ae99 100644 --- a/tests/crypto_kitties.rs +++ b/tests/crypto_kitties.rs @@ -52,7 +52,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 7, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Number { size: Some(32) }), + key_type: Box::new(AbiType::Number { size: Some(32) }), value_type: Box::new(AbiType::Address), } )); @@ -62,7 +62,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 8, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::UInt { size: None }), } )); @@ -72,7 +72,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 9, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Number { size: Some(32) }), + key_type: Box::new(AbiType::Number { size: Some(32) }), value_type: Box::new(AbiType::Address), } )); @@ -82,7 +82,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 10, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Number { size: Some(32) }), + key_type: Box::new(AbiType::Number { size: Some(32) }), value_type: Box::new(AbiType::Bytes { length: Some(20) }), } )); diff --git a/tests/cryptoadz_custom_image_37b.rs b/tests/cryptoadz_custom_image_37b.rs index 74644fa..2fcc01c 100644 --- a/tests/cryptoadz_custom_image_37b.rs +++ b/tests/cryptoadz_custom_image_37b.rs @@ -25,7 +25,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 0, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Bytes { length: Some(1) }), + key_type: Box::new(AbiType::Bytes { length: Some(1) }), value_type: Box::new(AbiType::Number { size: Some(16) }), } )); @@ -35,7 +35,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 1, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Bytes { length: None }), + key_type: Box::new(AbiType::Bytes { length: None }), value_type: Box::new(AbiType::Bytes { length: Some(20) }), } )); diff --git a/tests/curve_v1_adapter_2_assets.rs b/tests/curve_v1_adapter_2_assets.rs index 3cc8425..104f908 100644 --- a/tests/curve_v1_adapter_2_assets.rs +++ b/tests/curve_v1_adapter_2_assets.rs @@ -6,8 +6,8 @@ use storage_layout_extractor as sle; use storage_layout_extractor::{ extractor::{ chain::{ - version::{ChainVersion, EthereumVersion}, Chain, + version::{ChainVersion, EthereumVersion}, }, contract::Contract, }, @@ -22,7 +22,7 @@ mod common; /// Tests the library on the bytecode of the CurveV1Adapter2Assets contract /// deployed [here](https://etherscan.io/address/0xaa6b42aab40c3cfe6c84b563ba37b462e6a447ec#code). -const BYTECODE_STRING: &str = "608060405234801561001057600080fd5b50600436106103af5760003560e01c806376a2f0f0116101f4578063cc2b27d71161011a578063e3103273116100ad578063f446c1d01161007c578063f446c1d0146108ba578063f851a440146108c2578063fc0c546a146108ca578063fee3f7f9146108f157600080fd5b8063e31032731461085a578063ec026ca71461086d578063ed8e84f314610880578063ef14101e1461089357600080fd5b8063d96c7fce116100e9578063d96c7fce14610824578063dd62ed3e1461082c578063ddca3f431461083f578063e2e7d2641461084757600080fd5b8063cc2b27d7146107c8578063ce30bbdb146107db578063cf023dd0146107ea578063d21220a7146107fd57600080fd5b8063b4b577ad11610192578063bd90df7011610161578063bd90df7014610740578063c12c21c014610767578063c21ee1621461078e578063c6610657146107b557600080fd5b8063b4b577ad1461070a578063b739953e14610712578063b9947eb014610725578063bb7b8b801461073857600080fd5b806382c63066116101ce57806382c63066146106a15780638ba51dfc146106c857806395d89b41146106ef578063a6417ed6146106f757600080fd5b806376a2f0f01461066b57806378aa73a41461067357806379bea6641461068e57600080fd5b80632c5788d2116102d95780635409491a1161027757806363543f061161024657806363543f061461060257806364a89bca1461060a5780636e1d82711461063157806370a082311461065857600080fd5b80635409491a146105ad57806357d78875146105b55780635b36389c146105dc5780635e0d443f146105ef57600080fd5b806333d2ebf2116102b357806333d2ebf21461056c5780633df021241461057f5780634469e30e146105925780634903b0d11461059a57600080fd5b80632c5788d21461052a5780632f7a18811461053d578063313ce5671461056457600080fd5b806314052288116103515780631af4de83116103205780631af4de83146104d55780632081066c146104e857806323746eb8146104f057806325be124e1461050357600080fd5b806314052288146104aa57806314f05979146104b257806318160ddd146104ba5780631a4d01d2146104c257600080fd5b806307211ef71161038d57806307211ef71461043b5780630b4c7e4d1461044e5780630dfe1681146104635780630f6ba8e31461048a57600080fd5b8063065a80d8146103b457806306871163146103da57806306fdde0314610426575b600080fd5b6103c76103c2366004614819565b6108f9565b6040519081526020015b60405180910390f35b6104017f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016103d1565b61042e61091c565b6040516103d191906148aa565b6103c76104493660046148bd565b6109d4565b61046161045c36600461490a565b610aa3565b005b6104017f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba081565b61049d610498366004614935565b610b40565b6040516103d19190614996565b6103c7610bfe565b61049d610c8f565b6103c7610d25565b6104616104d03660046149a4565b610d92565b6104616104e33660046148bd565b610e25565b6103c7611133565b6104016104fe366004614819565b6111a0565b6104017f000000000000000000000000000000000000000000000000000000000000000081565b6103c76105383660046149c9565b6111ab565b6104017f000000000000000000000000c59135f449bb623501145443c70a30ee648fa30481565b6103c761185e565b61046161057a3660046149f5565b6118cb565b61046161058d366004614a1f565b61195f565b61049d611a30565b6103c76105a8366004614a61565b611aa2565b6103c7611c3c565b6104017f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec781565b6104616105ea366004614a7a565b611ca9565b6103c76105fd3660046148bd565b611d23565b6103c7611dab565b6104017f000000000000000000000000bebc44782c7db0a1a60cb6fe97d0b483032ff1c781565b6104017f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f81565b6103c7610666366004614ac0565b611e18565b6103c7611e91565b61067b600281565b60405161ffff90911681526020016103d1565b61046161069c3660046148bd565b611efe565b6104017f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca81565b6104017f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba081565b61042e61217a565b610461610705366004614a1f565b6121e7565b6103c7612271565b610401610720366004614819565b6122de565b610401610733366004614a61565b6122e9565b6103c76122ff565b6104017f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca81565b6104017f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b81565b6103c77f000000000000000000000000000000000000000000000000000000000000000281565b6104016107c3366004614a61565b61236c565b6103c76107d63660046149c9565b612382565b60056040516103d19190614add565b6104616107f83660046149a4565b61243f565b6104017f0000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e49081565b61049d6125b9565b6103c761083a366004614b1e565b61262b565b6103c76126ac565b6103c7610855366004614a61565b612719565b61046161086836600461490a565b61278f565b61046161087b3660046149f5565b61281e565b6103c761088e366004614b65565b612a7f565b6104017f000000000000000000000000000000000000000000000000000000000000000081565b6103c7612af6565b610401612b63565b6104017f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca81565b6103c7612bf4565b6000610916826fffffffffffffffffffffffffffffffff16611aa2565b92915050565b60607f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa158015610989573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526109cf9190810190614c53565b905090565b6040517f07211ef7000000000000000000000000000000000000000000000000000000008152600f84810b600483015283900b6024820152604481018290526000907f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff16906307211ef7906064015b602060405180830381865afa158015610a75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a999190614ca4565b90505b9392505050565b60026000541415610b15576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b60026000908155610b3790600184358110916020860135919091119080612de5565b50506001600055565b610b486147e9565b6040517f0f6ba8e300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca1690630f6ba8e390610bbe90879087908790600401614cbd565b6040805180830381865afa158015610bda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a999190614ce4565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1663140522886040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cf9190614ca4565b610c976147e9565b7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff166314f059796040518163ffffffff1660e01b81526004016040805180830381865afa158015610d01573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cf9190614ce4565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b60026000541415610dff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b0c565b60026000908155610e0f83612f2b565b9050610e1a81613042565b505060016000555050565b60026000541415610e92576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b0c565b600260009081556040517fe958b7040000000000000000000000000000000000000000000000000000000081523360048201527f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b73ffffffffffffffffffffffffffffffffffffffff169063e958b70490602401602060405180830381865afa158015610f23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f479190614d64565b90506000610f548561315f565b90506000610f618561315f565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301529192506000918416906370a0823190602401602060405180830381865afa158015610fd3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff79190614ca4565b90506001811115611125577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0160006b033b2e3c9fd0803ce800000061103d8784614d81565b6110479190614de5565b604051600f8a810b602483015289900b60448201526064810184905260848101829052909150611122908690869086907fa6417ed6000000000000000000000000000000000000000000000000000000009060a4015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152600180613275565b50505b505060016000555050505050565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff16632081066c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b600061091682612f2b565b60007f00000000000000000000000000000000000000000000000000000000000000026002141561137c5781600f0b6000146112ae57604080518082018252600081526020810185905290517fed8e84f300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca169163ed8e84f3916112689190600190600401614e20565b602060405180830381865afa158015611285573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a99190614ca4565b611375565b6040805180820182528481526000602082015290517fed8e84f300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca169163ed8e84f3916113349190600190600401614e20565b602060405180830381865afa158015611351573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113759190614ca4565b9050610916565b7f0000000000000000000000000000000000000000000000000000000000000002600314156115625781600f0b6000146114d55781600f0b60011461144857604080516060810182526000808252602082015280820185905290517f3883e11900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca1691633883e119916112689190600190600401614e3d565b604080516060810182526000808252602082018690528183015290517f3883e11900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca1691633883e119916112689190600190600401614e3d565b604080516060810182528481526000602082018190528183015290517f3883e11900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca1691633883e119916113349190600190600401614e3d565b7f0000000000000000000000000000000000000000000000000000000000000002600414156117fc5781600f0b6000146117685781600f0b6001146116d45781600f0b6002146116405760408051608081018252600080825260208201819052818301526060810185905290517fcf701ff700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca169163cf701ff7916112689190600190600401614e77565b60408051608081018252600080825260208201819052818301869052606082015290517fcf701ff700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca169163cf701ff7916112689190600190600401614e77565b60408051608081018252600080825260208201869052818301819052606082015290517fcf701ff700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca169163cf701ff7916112689190600190600401614e77565b60408051608081018252848152600060208201819052818301819052606082015290517fcf701ff700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca169163cf701ff7916113349190600190600401614e77565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e636f7272656374206e436f696e73000000000000000000000000000000006044820152606401610b0c565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b60026000541415611938576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b0c565b6002600090815561194883612f2b565b9050611955838284613555565b5050600160005550565b600260005414156119cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b0c565b600260009081556119dc85612f2b565b905060006119e985612f2b565b905061112582826000368080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052506001935091506137ff9050565b611a386147e9565b7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff16634469e30e6040518163ffffffff1660e01b81526004016040805180830381865afa158015610d01573d6000803e3d6000fd5b6040517f4903b0d1000000000000000000000000000000000000000000000000000000008152600481018290526000907f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1690634903b0d190602401602060405180830381865afa925050508015611b6a575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252611b6791810190614ca4565b60015b610916577f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1663065a80d8611bbb611bb685612c61565b612d17565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b168152600f9190910b60048201526024015b602060405180830381865afa158015611c13573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109169190614ca4565b919050565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff16635409491a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b60026000541415611d16576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b0c565b6002600055610b376138ce565b6040517f5e0d443f000000000000000000000000000000000000000000000000000000008152600f84810b600483015283900b6024820152604481018290526000907f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1690635e0d443f90606401610a58565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff166363543f066040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301526000917f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca909116906370a0823190602401611bf6565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff166376a2f0f06040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b60026000541415611f6b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b0c565b600260009081556040517fe958b7040000000000000000000000000000000000000000000000000000000081523360048201527f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b73ffffffffffffffffffffffffffffffffffffffff169063e958b70490602401602060405180830381865afa158015611ffc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120209190614d64565b9050600061202d85612f2b565b9050600061203a85612f2b565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301529192506000918416906370a0823190602401602060405180830381865afa1580156120ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120d09190614ca4565b90506001811115611125577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0160006b033b2e3c9fd0803ce80000006121168784614d81565b6121209190614de5565b604051600f8a810b602483015289900b60448201526064810184905260848101829052909150611122908690869086907f3df02124000000000000000000000000000000000000000000000000000000009060a40161109d565b60607f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015610989573d6000803e3d6000fd5b60026000541415612254576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b0c565b600260009081556122648561315f565b905060006119e98561315f565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1663b4b577ad6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b60006109168261315f565b60006109166122fa611bb684612c61565b61315f565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1663bb7b8b806040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b600061091661237d611bb684612c61565b612f2b565b6040517fcc2b27d700000000000000000000000000000000000000000000000000000000815260048101839052600f82900b60248201526000907f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff169063cc2b27d7906044015b602060405180830381865afa15801561241b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9c9190614ca4565b600260005414156124ac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b0c565b600260009081556124bc83612f2b565b6040517fe958b70400000000000000000000000000000000000000000000000000000000815233600482015290915060009073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b169063e958b70490602401602060405180830381865afa15801561254c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125709190614d64565b90506125ac81837f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca6125a3888a89613aee565b60016000613275565b5050600160005550505050565b6125c16147e9565b7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1663d96c7fce6040518163ffffffff1660e01b81526004016040805180830381865afa158015610d01573d6000803e3d6000fd5b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015282811660248301526000917f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca9091169063dd62ed3e906044016123fe565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1663ddca3f436040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b6040517fe2e7d264000000000000000000000000000000000000000000000000000000008152600481018290526000907f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff169063e2e7d26490602401611bf6565b600260005414156127fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b0c565b60026000908155610b3790600184358110916020860135919091119080613f4b565b6002600054141561288b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b0c565b6002600090815561289b83612f2b565b6040517fe958b70400000000000000000000000000000000000000000000000000000000815233600482015290915060009073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b169063e958b70490602401602060405180830381865afa15801561292b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061294f9190614d64565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80831660048301529192506000918416906370a0823190602401602060405180830381865afa1580156129c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129e59190614ca4565b90506001811115612a73577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0160006b033b2e3c9fd0803ce8000000612a2b8684614d81565b612a359190614de5565b9050612a7083857f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca612a688a8787613aee565b600180613275565b50505b50506001600055505050565b6040517fed8e84f300000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca169063ed8e84f3906123fe9086908690600401614eb1565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1663f446c1d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1663f851a4406040518163ffffffff1660e01b8152600401602060405180830381865afa158015612bd0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cf9190614d64565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1663fee3f7f96040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821115612d13576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e206160448201527f6e20696e743235360000000000000000000000000000000000000000000000006064820152608401610b0c565b5090565b60007fffffffffffffffffffffffffffffffff800000000000000000000000000000008212801590612d5957506f7fffffffffffffffffffffffffffffff8213155b612d13576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203160448201527f32382062697473000000000000000000000000000000000000000000000000006064820152608401610b0c565b6040517fe958b7040000000000000000000000000000000000000000000000000000000081523360048201526000907f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b73ffffffffffffffffffffffffffffffffffffffff169063e958b70490602401602060405180830381865afa158015612e72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e969190614d64565b9050612ea485858585614108565b612ece817f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca61424e565b612f0e6000368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506142f492505050565b50612f1b85858585614108565b612f24816143f2565b5050505050565b600081600f0b60001415612f6057507f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba0612ff5565b81600f0b60011415612f9357507f0000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e490612ff5565b81600f0b60021415612fc657507f0000000000000000000000000000000000000000000000000000000000000000612ff5565b81600f0b60031415612ff557507f00000000000000000000000000000000000000000000000000000000000000005b73ffffffffffffffffffffffffffffffffffffffff8116611c37576040517fd1da79bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517fe958b7040000000000000000000000000000000000000000000000000000000081523360048201526000907f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b73ffffffffffffffffffffffffffffffffffffffff169063e958b70490602401602060405180830381865afa1580156130cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130f39190614d64565b905061315a817f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca846000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525092508291506132759050565b505050565b600081600f0b6000141561319457507f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba0612ff5565b81600f0b600114156131c757507f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f612ff5565b81600f0b600214156131fa57507f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48612ff5565b81600f0b60031415612ff557507f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec773ffffffffffffffffffffffffffffffffffffffff8116611c37576040517fd1da79bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60606000803373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000c59135f449bb623501145443c70a30ee648fa30416146133de576040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a811660048301528916906370a0823190602401602060405180830381865afa158015613323573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133479190614ca4565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b81166004830152919350908816906370a0823190602401602060405180830381865afa1580156133b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133db9190614ca4565b90505b841561340e5761340e887fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6144cc565b6040517f6ce4074a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b1690636ce4074a906134a49033907f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca908b90600401614ec9565b6000604051808303816000875af11580156134c3573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526135099190810190614c53565b9250841561353b5761353b887fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6144cc565b613549898989858589614575565b50509695505050505050565b6040517fe958b7040000000000000000000000000000000000000000000000000000000081523360048201526000907f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b73ffffffffffffffffffffffffffffffffffffffff169063e958b70490602401602060405180830381865afa1580156135e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136069190614d64565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80831660048301529192506000917f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca16906370a0823190602401602060405180830381865afa158015613698573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136bc9190614ca4565b90506001811115612f24577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff016137f7827f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca867f1a4d01d200000000000000000000000000000000000000000000000000000000858a6b033b2e3c9fd0803ce80000006137498b84614d81565b6137539190614de5565b6040516024810193909352600f9190910b60448301526064820152608401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915260006001613275565b505050505050565b6040517fe958b70400000000000000000000000000000000000000000000000000000000815233600482015260609060009073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b169063e958b70490602401602060405180830381865afa15801561388f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138b39190614d64565b90506138c3818888888888613275565b979650505050505050565b6040517fe958b7040000000000000000000000000000000000000000000000000000000081523360048201526000907f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b73ffffffffffffffffffffffffffffffffffffffff169063e958b70490602401602060405180830381865afa15801561395b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061397f9190614d64565b90506139ab817f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba061424e565b6139d5817f0000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e49061424e565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1615613aa157613a3b817f000000000000000000000000000000000000000000000000000000000000000061424e565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1615613aa157613aa1817f000000000000000000000000000000000000000000000000000000000000000061424e565b613ae16000368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506142f492505050565b50613aeb816143f2565b50565b60607f000000000000000000000000000000000000000000000000000000000000000260021415613ca75783600f0b600014613be4576040516000602482015260448101849052606481018390527f0b4c7e4d00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152613ca0565b6040516024810184905260006044820152606481018390527f0b4c7e4d00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091525b9050610a9c565b7f000000000000000000000000000000000000000000000000000000000000000260031415613dc15783600f0b600014613d785783600f0b600114613d2f57604051600060248201819052604482015260648101849052608481018390527f4515cef3000000000000000000000000000000000000000000000000000000009060a401613b62565b604051600060248201819052604482018590526064820152608481018390527f4515cef3000000000000000000000000000000000000000000000000000000009060a401613b62565b604051602481018490526000604482018190526064820152608481018390527f4515cef3000000000000000000000000000000000000000000000000000000009060a401613c22565b7f0000000000000000000000000000000000000000000000000000000000000002600414156117fc5783600f0b600014613efb5783600f0b600114613eab5783600f0b600214613e5b576040516000602482018190526044820181905260648201526084810184905260a481018390527f029b2f34000000000000000000000000000000000000000000000000000000009060c401613b62565b6040516000602482018190526044820181905260648201859052608482015260a481018390527f029b2f34000000000000000000000000000000000000000000000000000000009060c401613b62565b6040516000602482018190526044820185905260648201819052608482015260a481018390527f029b2f34000000000000000000000000000000000000000000000000000000009060c401613b62565b6040516024810184905260006044820181905260648201819052608482015260a481018390527f029b2f34000000000000000000000000000000000000000000000000000000009060c401613c22565b6040517fe958b7040000000000000000000000000000000000000000000000000000000081523360048201526000907f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b73ffffffffffffffffffffffffffffffffffffffff169063e958b70490602401602060405180830381865afa158015613fd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ffc9190614d64565b9050841561402e5761402e817f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba061424e565b831561405e5761405e817f0000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e49061424e565b821561408e5761408e817f000000000000000000000000000000000000000000000000000000000000000061424e565b81156140be576140be817f000000000000000000000000000000000000000000000000000000000000000061424e565b6140fe6000368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506142f492505050565b50612f24816143f2565b8315614158576141587f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6144cc565b82156141a8576141a87f0000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e4907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6144cc565b81156141f8576141f87f00000000000000000000000000000000000000000000000000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6144cc565b8015614248576142487f00000000000000000000000000000000000000000000000000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6144cc565b50505050565b6040517f51e3f16000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015282811660248301527f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b16906351e3f160906044015b600060405180830381600087803b1580156142e057600080fd5b505af11580156137f7573d6000803e3d6000fd5b6040517f6ce4074a00000000000000000000000000000000000000000000000000000000815260609073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b1690636ce4074a9061438d9033907f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca908790600401614ec9565b6000604051808303816000875af11580156143ac573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526109169190810190614c53565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000c59135f449bb623501145443c70a30ee648fa3041614613aeb576040517f9537301800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301527f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b1690639537301890602401600060405180830381600087803b1580156144b857600080fd5b505af1158015612f24573d6000803e3d6000fd5b6040517f46fb371d00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca811660248301528381166044830152606482018390527f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b16906346fb371d906084016142c6565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000c59135f449bb623501145443c70a30ee648fa3041614614676576040517f654a9eda00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff87811660048301528681166024830152858116604483015260648201859052608482018490527f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b169063654a9eda9060a401600060405180830381600087803b15801561465957600080fd5b505af115801561466d573d6000803e3d6000fd5b505050506137f7565b8015614738576040517f0d8f9cee00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff878116600483015286811660248301527f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b1690630d8f9cee906044016020604051808303816000875af1158015614712573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147369190614f0b565b505b6040517f51e3f16000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff878116600483015285811660248301527f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b16906351e3f16090604401600060405180830381600087803b1580156147c957600080fd5b505af11580156147dd573d6000803e3d6000fd5b50505050505050505050565b60405180604001604052806002906020820280368337509192915050565b8035600f81900b8114611c3757600080fd5b60006020828403121561482b57600080fd5b610a9c82614807565b60005b8381101561484f578181015183820152602001614837565b838111156142485750506000910152565b60008151808452614878816020860160208601614834565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610a9c6020830184614860565b6000806000606084860312156148d257600080fd5b6148db84614807565b92506148e960208501614807565b9150604084013590509250925092565b806040810183101561091657600080fd5b6000806060838503121561491d57600080fd5b61492784846148f9565b946040939093013593505050565b600080600060a0848603121561494a57600080fd5b61495485856148f9565b925061496385604086016148f9565b9150608084013590509250925092565b8060005b6002811015614248578151845260209384019390910190600101614977565b604081016109168284614973565b6000806000606084860312156149b957600080fd5b833592506148e960208501614807565b600080604083850312156149dc57600080fd5b823591506149ec60208401614807565b90509250929050565b60008060408385031215614a0857600080fd5b614a1183614807565b946020939093013593505050565b60008060008060808587031215614a3557600080fd5b614a3e85614807565b9350614a4c60208601614807565b93969395505050506040820135916060013590565b600060208284031215614a7357600080fd5b5035919050565b60008060608385031215614a8d57600080fd5b823591506149ec84602085016148f9565b73ffffffffffffffffffffffffffffffffffffffff81168114613aeb57600080fd5b600060208284031215614ad257600080fd5b8135610a9c81614a9e565b6020810160108310614b18577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b60008060408385031215614b3157600080fd5b8235614b3c81614a9e565b91506020830135614b4c81614a9e565b809150509250929050565b8015158114613aeb57600080fd5b60008060608385031215614b7857600080fd5b614b8284846148f9565b91506040830135614b4c81614b57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600067ffffffffffffffff80841115614bdc57614bdc614b92565b604051601f85017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715614c2257614c22614b92565b81604052809350858152868686011115614c3b57600080fd5b614c49866020830187614834565b5050509392505050565b600060208284031215614c6557600080fd5b815167ffffffffffffffff811115614c7c57600080fd5b8201601f81018413614c8d57600080fd5b614c9c84825160208401614bc1565b949350505050565b600060208284031215614cb657600080fd5b5051919050565b60a08101604085833760408201600081526040858237506080919091019190915292915050565b600060408284031215614cf657600080fd5b82601f830112614d0557600080fd5b6040516040810181811067ffffffffffffffff82111715614d2857614d28614b92565b8060405250806040840185811115614d3f57600080fd5b845b81811015614d59578051835260209283019201614d41565b509195945050505050565b600060208284031215614d7657600080fd5b8151610a9c81614a9e565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614de0577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b500290565b600082614e1b577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60608101614e2e8285614973565b82151560408301529392505050565b60808101818460005b6003811015614e65578151835260209283019290910190600101614e46565b50505082151560608301529392505050565b60a08101818460005b6004811015614e9f578151835260209283019290910190600101614e80565b50505082151560808301529392505050565b60608101604084833791151560409190910152919050565b600073ffffffffffffffffffffffffffffffffffffffff808616835280851660208401525060606040830152614f026060830184614860565b95945050505050565b600060208284031215614f1d57600080fd5b8151610a9c81614b5756fea2646970667358221220ef0693e8900e50d6f1975553a9fb7ab796b741730a062c5dbb05af62515f319364736f6c634300080a0033"; +const BYTECODE_STRING: &str = "608060405234801561001057600080fd5b50600436106103af5760003560e01c806376a2f0f0116101f4578063cc2b27d71161011a578063e3103273116100ad578063f446c1d01161007c578063f446c1d0146108ba578063f851a440146108c2578063fc0c546a146108ca578063fee3f7f9146108f157600080fd5b8063e31032731461085a578063ec026ca71461086d578063ed8e84f314610880578063ef14101e1461089357600080fd5b8063d96c7fce116100e9578063d96c7fce14610824578063dd62ed3e1461082c578063ddca3f431461083f578063e2e7d2641461084757600080fd5b8063cc2b27d7146107c8578063ce30bbdb146107db578063cf023dd0146107ea578063d21220a7146107fd57600080fd5b8063b4b577ad11610192578063bd90df7011610161578063bd90df7014610740578063c12c21c014610767578063c21ee1621461078e578063c6610657146107b557600080fd5b8063b4b577ad1461070a578063b739953e14610712578063b9947eb014610725578063bb7b8b801461073857600080fd5b806382c63066116101ce57806382c63066146106a15780638ba51dfc146106c857806395d89b41146106ef578063a6417ed6146106f757600080fd5b806376a2f0f01461066b57806378aa73a41461067357806379bea6641461068e57600080fd5b80632c5788d2116102d95780635409491a1161027757806363543f061161024657806363543f061461060257806364a89bca1461060a5780636e1d82711461063157806370a082311461065857600080fd5b80635409491a146105ad57806357d78875146105b55780635b36389c146105dc5780635e0d443f146105ef57600080fd5b806333d2ebf2116102b357806333d2ebf21461056c5780633df021241461057f5780634469e30e146105925780634903b0d11461059a57600080fd5b80632c5788d21461052a5780632f7a18811461053d578063313ce5671461056457600080fd5b806314052288116103515780631af4de83116103205780631af4de83146104d55780632081066c146104e857806323746eb8146104f057806325be124e1461050357600080fd5b806314052288146104aa57806314f05979146104b257806318160ddd146104ba5780631a4d01d2146104c257600080fd5b806307211ef71161038d57806307211ef71461043b5780630b4c7e4d1461044e5780630dfe1681146104635780630f6ba8e31461048a57600080fd5b8063065a80d8146103b457806306871163146103da57806306fdde0314610426575b600080fd5b6103c76103c2366004614819565b6108f9565b6040519081526020015b60405180910390f35b6104017f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016103d1565b61042e61091c565b6040516103d191906148aa565b6103c76104493660046148bd565b6109d4565b61046161045c36600461490a565b610aa3565b005b6104017f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba081565b61049d610498366004614935565b610b40565b6040516103d19190614996565b6103c7610bfe565b61049d610c8f565b6103c7610d25565b6104616104d03660046149a4565b610d92565b6104616104e33660046148bd565b610e25565b6103c7611133565b6104016104fe366004614819565b6111a0565b6104017f000000000000000000000000000000000000000000000000000000000000000081565b6103c76105383660046149c9565b6111ab565b6104017f000000000000000000000000c59135f449bb623501145443c70a30ee648fa30481565b6103c761185e565b61046161057a3660046149f5565b6118cb565b61046161058d366004614a1f565b61195f565b61049d611a30565b6103c76105a8366004614a61565b611aa2565b6103c7611c3c565b6104017f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec781565b6104616105ea366004614a7a565b611ca9565b6103c76105fd3660046148bd565b611d23565b6103c7611dab565b6104017f000000000000000000000000bebc44782c7db0a1a60cb6fe97d0b483032ff1c781565b6104017f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f81565b6103c7610666366004614ac0565b611e18565b6103c7611e91565b61067b600281565b60405161ffff90911681526020016103d1565b61046161069c3660046148bd565b611efe565b6104017f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca81565b6104017f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba081565b61042e61217a565b610461610705366004614a1f565b6121e7565b6103c7612271565b610401610720366004614819565b6122de565b610401610733366004614a61565b6122e9565b6103c76122ff565b6104017f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca81565b6104017f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b81565b6103c77f000000000000000000000000000000000000000000000000000000000000000281565b6104016107c3366004614a61565b61236c565b6103c76107d63660046149c9565b612382565b60056040516103d19190614add565b6104616107f83660046149a4565b61243f565b6104017f0000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e49081565b61049d6125b9565b6103c761083a366004614b1e565b61262b565b6103c76126ac565b6103c7610855366004614a61565b612719565b61046161086836600461490a565b61278f565b61046161087b3660046149f5565b61281e565b6103c761088e366004614b65565b612a7f565b6104017f000000000000000000000000000000000000000000000000000000000000000081565b6103c7612af6565b610401612b63565b6104017f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca81565b6103c7612bf4565b6000610916826fffffffffffffffffffffffffffffffff16611aa2565b92915050565b60607f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa158015610989573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526109cf9190810190614c53565b905090565b6040517f07211ef7000000000000000000000000000000000000000000000000000000008152600f84810b600483015283900b6024820152604481018290526000907f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff16906307211ef7906064015b602060405180830381865afa158015610a75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a999190614ca4565b90505b9392505050565b60026000541415610b15576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b60026000908155610b3790600184358110916020860135919091119080612de5565b50506001600055565b610b486147e9565b6040517f0f6ba8e300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca1690630f6ba8e390610bbe90879087908790600401614cbd565b6040805180830381865afa158015610bda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a999190614ce4565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1663140522886040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cf9190614ca4565b610c976147e9565b7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff166314f059796040518163ffffffff1660e01b81526004016040805180830381865afa158015610d01573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cf9190614ce4565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b60026000541415610dff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b0c565b60026000908155610e0f83612f2b565b9050610e1a81613042565b505060016000555050565b60026000541415610e92576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b0c565b600260009081556040517fe958b7040000000000000000000000000000000000000000000000000000000081523360048201527f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b73ffffffffffffffffffffffffffffffffffffffff169063e958b70490602401602060405180830381865afa158015610f23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f479190614d64565b90506000610f548561315f565b90506000610f618561315f565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301529192506000918416906370a0823190602401602060405180830381865afa158015610fd3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff79190614ca4565b90506001811115611125577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0160006b033b2e3c9fd0803ce800000061103d8784614d81565b6110479190614de5565b604051600f8a810b602483015289900b60448201526064810184905260848101829052909150611122908690869086907fa6417ed6000000000000000000000000000000000000000000000000000000009060a4015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152600180613275565b50505b505060016000555050505050565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff16632081066c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b600061091682612f2b565b60007f00000000000000000000000000000000000000000000000000000000000000026002141561137c5781600f0b6000146112ae57604080518082018252600081526020810185905290517fed8e84f300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca169163ed8e84f3916112689190600190600401614e20565b602060405180830381865afa158015611285573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a99190614ca4565b611375565b6040805180820182528481526000602082015290517fed8e84f300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca169163ed8e84f3916113349190600190600401614e20565b602060405180830381865afa158015611351573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113759190614ca4565b9050610916565b7f0000000000000000000000000000000000000000000000000000000000000002600314156115625781600f0b6000146114d55781600f0b60011461144857604080516060810182526000808252602082015280820185905290517f3883e11900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca1691633883e119916112689190600190600401614e3d565b604080516060810182526000808252602082018690528183015290517f3883e11900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca1691633883e119916112689190600190600401614e3d565b604080516060810182528481526000602082018190528183015290517f3883e11900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca1691633883e119916113349190600190600401614e3d565b7f0000000000000000000000000000000000000000000000000000000000000002600414156117fc5781600f0b6000146117685781600f0b6001146116d45781600f0b6002146116405760408051608081018252600080825260208201819052818301526060810185905290517fcf701ff700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca169163cf701ff7916112689190600190600401614e77565b60408051608081018252600080825260208201819052818301869052606082015290517fcf701ff700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca169163cf701ff7916112689190600190600401614e77565b60408051608081018252600080825260208201869052818301819052606082015290517fcf701ff700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca169163cf701ff7916112689190600190600401614e77565b60408051608081018252848152600060208201819052818301819052606082015290517fcf701ff700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca169163cf701ff7916113349190600190600401614e77565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e636f7272656374206e436f696e73000000000000000000000000000000006044820152606401610b0c565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b60026000541415611938576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b0c565b6002600090815561194883612f2b565b9050611955838284613555565b5050600160005550565b600260005414156119cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b0c565b600260009081556119dc85612f2b565b905060006119e985612f2b565b905061112582826000368080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052506001935091506137ff9050565b611a386147e9565b7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff16634469e30e6040518163ffffffff1660e01b81526004016040805180830381865afa158015610d01573d6000803e3d6000fd5b6040517f4903b0d1000000000000000000000000000000000000000000000000000000008152600481018290526000907f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1690634903b0d190602401602060405180830381865afa925050508015611b6a575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252611b6791810190614ca4565b60015b610916577f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1663065a80d8611bbb611bb685612c61565b612d17565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b168152600f9190910b60048201526024015b602060405180830381865afa158015611c13573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109169190614ca4565b919050565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff16635409491a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b60026000541415611d16576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b0c565b6002600055610b376138ce565b6040517f5e0d443f000000000000000000000000000000000000000000000000000000008152600f84810b600483015283900b6024820152604481018290526000907f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1690635e0d443f90606401610a58565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff166363543f066040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301526000917f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca909116906370a0823190602401611bf6565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff166376a2f0f06040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b60026000541415611f6b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b0c565b600260009081556040517fe958b7040000000000000000000000000000000000000000000000000000000081523360048201527f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b73ffffffffffffffffffffffffffffffffffffffff169063e958b70490602401602060405180830381865afa158015611ffc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120209190614d64565b9050600061202d85612f2b565b9050600061203a85612f2b565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301529192506000918416906370a0823190602401602060405180830381865afa1580156120ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120d09190614ca4565b90506001811115611125577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0160006b033b2e3c9fd0803ce80000006121168784614d81565b6121209190614de5565b604051600f8a810b602483015289900b60448201526064810184905260848101829052909150611122908690869086907f3df02124000000000000000000000000000000000000000000000000000000009060a40161109d565b60607f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015610989573d6000803e3d6000fd5b60026000541415612254576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b0c565b600260009081556122648561315f565b905060006119e98561315f565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1663b4b577ad6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b60006109168261315f565b60006109166122fa611bb684612c61565b61315f565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1663bb7b8b806040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b600061091661237d611bb684612c61565b612f2b565b6040517fcc2b27d700000000000000000000000000000000000000000000000000000000815260048101839052600f82900b60248201526000907f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff169063cc2b27d7906044015b602060405180830381865afa15801561241b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9c9190614ca4565b600260005414156124ac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b0c565b600260009081556124bc83612f2b565b6040517fe958b70400000000000000000000000000000000000000000000000000000000815233600482015290915060009073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b169063e958b70490602401602060405180830381865afa15801561254c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125709190614d64565b90506125ac81837f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca6125a3888a89613aee565b60016000613275565b5050600160005550505050565b6125c16147e9565b7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1663d96c7fce6040518163ffffffff1660e01b81526004016040805180830381865afa158015610d01573d6000803e3d6000fd5b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015282811660248301526000917f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca9091169063dd62ed3e906044016123fe565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1663ddca3f436040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b6040517fe2e7d264000000000000000000000000000000000000000000000000000000008152600481018290526000907f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff169063e2e7d26490602401611bf6565b600260005414156127fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b0c565b60026000908155610b3790600184358110916020860135919091119080613f4b565b6002600054141561288b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b0c565b6002600090815561289b83612f2b565b6040517fe958b70400000000000000000000000000000000000000000000000000000000815233600482015290915060009073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b169063e958b70490602401602060405180830381865afa15801561292b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061294f9190614d64565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80831660048301529192506000918416906370a0823190602401602060405180830381865afa1580156129c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129e59190614ca4565b90506001811115612a73577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0160006b033b2e3c9fd0803ce8000000612a2b8684614d81565b612a359190614de5565b9050612a7083857f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca612a688a8787613aee565b600180613275565b50505b50506001600055505050565b6040517fed8e84f300000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca169063ed8e84f3906123fe9086908690600401614eb1565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1663f446c1d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1663f851a4406040518163ffffffff1660e01b8152600401602060405180830381865afa158015612bd0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cf9190614d64565b60007f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1663fee3f7f96040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6b573d6000803e3d6000fd5b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821115612d13576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e206160448201527f6e20696e743235360000000000000000000000000000000000000000000000006064820152608401610b0c565b5090565b60007fffffffffffffffffffffffffffffffff800000000000000000000000000000008212801590612d5957506f7fffffffffffffffffffffffffffffff8213155b612d13576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203160448201527f32382062697473000000000000000000000000000000000000000000000000006064820152608401610b0c565b6040517fe958b7040000000000000000000000000000000000000000000000000000000081523360048201526000907f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b73ffffffffffffffffffffffffffffffffffffffff169063e958b70490602401602060405180830381865afa158015612e72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e969190614d64565b9050612ea485858585614108565b612ece817f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca61424e565b612f0e6000368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506142f492505050565b50612f1b85858585614108565b612f24816143f2565b5050505050565b600081600f0b60001415612f6057507f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba0612ff5565b81600f0b60011415612f9357507f0000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e490612ff5565b81600f0b60021415612fc657507f0000000000000000000000000000000000000000000000000000000000000000612ff5565b81600f0b60031415612ff557507f00000000000000000000000000000000000000000000000000000000000000005b73ffffffffffffffffffffffffffffffffffffffff8116611c37576040517fd1da79bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517fe958b7040000000000000000000000000000000000000000000000000000000081523360048201526000907f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b73ffffffffffffffffffffffffffffffffffffffff169063e958b70490602401602060405180830381865afa1580156130cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130f39190614d64565b905061315a817f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca846000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525092508291506132759050565b505050565b600081600f0b6000141561319457507f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba0612ff5565b81600f0b600114156131c757507f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f612ff5565b81600f0b600214156131fa57507f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48612ff5565b81600f0b60031415612ff557507f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec773ffffffffffffffffffffffffffffffffffffffff8116611c37576040517fd1da79bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60606000803373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000c59135f449bb623501145443c70a30ee648fa30416146133de576040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a811660048301528916906370a0823190602401602060405180830381865afa158015613323573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133479190614ca4565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b81166004830152919350908816906370a0823190602401602060405180830381865afa1580156133b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133db9190614ca4565b90505b841561340e5761340e887fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6144cc565b6040517f6ce4074a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b1690636ce4074a906134a49033907f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca908b90600401614ec9565b6000604051808303816000875af11580156134c3573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526135099190810190614c53565b9250841561353b5761353b887fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6144cc565b613549898989858589614575565b50509695505050505050565b6040517fe958b7040000000000000000000000000000000000000000000000000000000081523360048201526000907f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b73ffffffffffffffffffffffffffffffffffffffff169063e958b70490602401602060405180830381865afa1580156135e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136069190614d64565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80831660048301529192506000917f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca16906370a0823190602401602060405180830381865afa158015613698573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136bc9190614ca4565b90506001811115612f24577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff016137f7827f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca867f1a4d01d200000000000000000000000000000000000000000000000000000000858a6b033b2e3c9fd0803ce80000006137498b84614d81565b6137539190614de5565b6040516024810193909352600f9190910b60448301526064820152608401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915260006001613275565b505050505050565b6040517fe958b70400000000000000000000000000000000000000000000000000000000815233600482015260609060009073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b169063e958b70490602401602060405180830381865afa15801561388f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138b39190614d64565b90506138c3818888888888613275565b979650505050505050565b6040517fe958b7040000000000000000000000000000000000000000000000000000000081523360048201526000907f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b73ffffffffffffffffffffffffffffffffffffffff169063e958b70490602401602060405180830381865afa15801561395b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061397f9190614d64565b90506139ab817f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba061424e565b6139d5817f0000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e49061424e565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1615613aa157613a3b817f000000000000000000000000000000000000000000000000000000000000000061424e565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1615613aa157613aa1817f000000000000000000000000000000000000000000000000000000000000000061424e565b613ae16000368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506142f492505050565b50613aeb816143f2565b50565b60607f000000000000000000000000000000000000000000000000000000000000000260021415613ca75783600f0b600014613be4576040516000602482015260448101849052606481018390527f0b4c7e4d00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152613ca0565b6040516024810184905260006044820152606481018390527f0b4c7e4d00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091525b9050610a9c565b7f000000000000000000000000000000000000000000000000000000000000000260031415613dc15783600f0b600014613d785783600f0b600114613d2f57604051600060248201819052604482015260648101849052608481018390527f4515cef3000000000000000000000000000000000000000000000000000000009060a401613b62565b604051600060248201819052604482018590526064820152608481018390527f4515cef3000000000000000000000000000000000000000000000000000000009060a401613b62565b604051602481018490526000604482018190526064820152608481018390527f4515cef3000000000000000000000000000000000000000000000000000000009060a401613c22565b7f0000000000000000000000000000000000000000000000000000000000000002600414156117fc5783600f0b600014613efb5783600f0b600114613eab5783600f0b600214613e5b576040516000602482018190526044820181905260648201526084810184905260a481018390527f029b2f34000000000000000000000000000000000000000000000000000000009060c401613b62565b6040516000602482018190526044820181905260648201859052608482015260a481018390527f029b2f34000000000000000000000000000000000000000000000000000000009060c401613b62565b6040516000602482018190526044820185905260648201819052608482015260a481018390527f029b2f34000000000000000000000000000000000000000000000000000000009060c401613b62565b6040516024810184905260006044820181905260648201819052608482015260a481018390527f029b2f34000000000000000000000000000000000000000000000000000000009060c401613c22565b6040517fe958b7040000000000000000000000000000000000000000000000000000000081523360048201526000907f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b73ffffffffffffffffffffffffffffffffffffffff169063e958b70490602401602060405180830381865afa158015613fd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ffc9190614d64565b9050841561402e5761402e817f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba061424e565b831561405e5761405e817f0000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e49061424e565b821561408e5761408e817f000000000000000000000000000000000000000000000000000000000000000061424e565b81156140be576140be817f000000000000000000000000000000000000000000000000000000000000000061424e565b6140fe6000368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506142f492505050565b50612f24816143f2565b8315614158576141587f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6144cc565b82156141a8576141a87f0000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e4907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6144cc565b81156141f8576141f87f00000000000000000000000000000000000000000000000000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6144cc565b8015614248576142487f00000000000000000000000000000000000000000000000000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6144cc565b50505050565b6040517f51e3f16000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015282811660248301527f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b16906351e3f160906044015b600060405180830381600087803b1580156142e057600080fd5b505af11580156137f7573d6000803e3d6000fd5b6040517f6ce4074a00000000000000000000000000000000000000000000000000000000815260609073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b1690636ce4074a9061438d9033907f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca908790600401614ec9565b6000604051808303816000875af11580156143ac573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526109169190810190614c53565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000c59135f449bb623501145443c70a30ee648fa3041614613aeb576040517f9537301800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301527f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b1690639537301890602401600060405180830381600087803b1580156144b857600080fd5b505af1158015612f24573d6000803e3d6000fd5b6040517f46fb371d00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca811660248301528381166044830152606482018390527f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b16906346fb371d906084016142c6565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000c59135f449bb623501145443c70a30ee648fa3041614614676576040517f654a9eda00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff87811660048301528681166024830152858116604483015260648201859052608482018490527f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b169063654a9eda9060a401600060405180830381600087803b15801561465957600080fd5b505af115801561466d573d6000803e3d6000fd5b505050506137f7565b8015614738576040517f0d8f9cee00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff878116600483015286811660248301527f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b1690630d8f9cee906044016020604051808303816000875af1158015614712573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147369190614f0b565b505b6040517f51e3f16000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff878116600483015285811660248301527f0000000000000000000000005887ad4cb2352e7f01527035faa3ae0ef2ce2b9b16906351e3f16090604401600060405180830381600087803b1580156147c957600080fd5b505af11580156147dd573d6000803e3d6000fd5b50505050505050505050565b60405180604001604052806002906020820280368337509192915050565b8035600f81900b8114611c3757600080fd5b60006020828403121561482b57600080fd5b610a9c82614807565b60005b8381101561484f578181015183820152602001614837565b838111156142485750506000910152565b60008151808452614878816020860160208601614834565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610a9c6020830184614860565b6000806000606084860312156148d257600080fd5b6148db84614807565b92506148e960208501614807565b9150604084013590509250925092565b806040810183101561091657600080fd5b6000806060838503121561491d57600080fd5b61492784846148f9565b946040939093013593505050565b600080600060a0848603121561494a57600080fd5b61495485856148f9565b925061496385604086016148f9565b9150608084013590509250925092565b8060005b6002811015614248578151845260209384019390910190600101614977565b604081016109168284614973565b6000806000606084860312156149b957600080fd5b833592506148e960208501614807565b600080604083850312156149dc57600080fd5b823591506149ec60208401614807565b90509250929050565b60008060408385031215614a0857600080fd5b614a1183614807565b946020939093013593505050565b60008060008060808587031215614a3557600080fd5b614a3e85614807565b9350614a4c60208601614807565b93969395505050506040820135916060013590565b600060208284031215614a7357600080fd5b5035919050565b60008060608385031215614a8d57600080fd5b823591506149ec84602085016148f9565b73ffffffffffffffffffffffffffffffffffffffff81168114613aeb57600080fd5b600060208284031215614ad257600080fd5b8135610a9c81614a9e565b6020810160108310614b18577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b60008060408385031215614b3157600080fd5b8235614b3c81614a9e565b91506020830135614b4c81614a9e565b809150509250929050565b8015158114613aeb57600080fd5b60008060608385031215614b7857600080fd5b614b8284846148f9565b91506040830135614b4c81614b57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600067ffffffffffffffff80841115614bdc57614bdc614b92565b604051601f85017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715614c2257614c22614b92565b81604052809350858152868686011115614c3b57600080fd5b614c49866020830187614834565b5050509392505050565b600060208284031215614c6557600080fd5b815167ffffffffffffffff811115614c7c57600080fd5b8201601f81018413614c8d57600080fd5b614c9c84825160208401614bc1565b949350505050565b600060208284031215614cb657600080fd5b5051919050565b60a08101604085833760408201600081526040858237506080919091019190915292915050565b600060408284031215614cf657600080fd5b82601f830112614d0557600080fd5b6040516040810181811067ffffffffffffffff82111715614d2857614d28614b92565b8060405250806040840185811115614d3f57600080fd5b845b81811015614d59578051835260209283019201614d41565b509195945050505050565b600060208284031215614d7657600080fd5b8151610a9c81614a9e565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614de0577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b500290565b600082614e1b577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60608101614e2e8285614973565b82151560408301529392505050565b60808101818460005b6003811015614e65578151835260209283019290910190600101614e46565b50505082151560608301529392505050565b60a08101818460005b6004811015614e9f578151835260209283019290910190600101614e80565b50505082151560808301529392505050565b60608101604084833791151560409190910152919050565b600073ffffffffffffffffffffffffffffffffffffffff808616835280851660208401525060606040830152614f026060830184614860565b95945050505050565b600060208284031215614f1d57600080fd5b8151610a9c81614b5756fea2646970667358221220ef0693e8900e50d6f1975553a9fb7ab796b741730a062c5dbb05af62515f319364736f6c634300080a0033"; #[test] fn correctly_generates_a_layout_wth_permissive_errors() -> anyhow::Result<()> { diff --git a/tests/house.rs b/tests/house.rs index 246d88a..c4adbf7 100644 --- a/tests/house.rs +++ b/tests/house.rs @@ -69,7 +69,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 13, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Number { size: Some(256) }), + key_type: Box::new(AbiType::Number { size: Some(256) }), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Number { size: Some(256) }), @@ -106,7 +106,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 16, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Number { size: Some(256) }), + key_type: Box::new(AbiType::Number { size: Some(256) }), value_type: Box::new(AbiType::UInt { size: Some(256) }), } )); @@ -117,7 +117,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 17, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Number { size: Some(256) }), + key_type: Box::new(AbiType::Number { size: Some(256) }), value_type: Box::new(AbiType::Number { size: None }), } )); @@ -128,7 +128,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 18, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Number { size: Some(256) }), + key_type: Box::new(AbiType::Number { size: Some(256) }), value_type: Box::new(AbiType::UInt { size: None }), } )); @@ -139,9 +139,9 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 19, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Number { size: Some(256) }), + key_type: Box::new(AbiType::Number { size: Some(256) }), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::Bytes { length: Some(32) }), + key_type: Box::new(AbiType::Bytes { length: Some(32) }), value_type: Box::new(AbiType::UInt { size: Some(256) }), }), } @@ -153,9 +153,9 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 20, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::Number { size: Some(256) }), + key_type: Box::new(AbiType::Number { size: Some(256) }), value_type: Box::new(AbiType::UInt { size: Some(256) }), }), } @@ -167,9 +167,9 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 21, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::Number { size: Some(256) }), + key_type: Box::new(AbiType::Number { size: Some(256) }), value_type: Box::new(AbiType::UInt { size: None }), }), } @@ -181,11 +181,11 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 22, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::Number { size: Some(256) }), + key_type: Box::new(AbiType::Number { size: Some(256) }), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::Bytes { length: Some(32) }), + key_type: Box::new(AbiType::Bytes { length: Some(32) }), value_type: Box::new(AbiType::UInt { size: Some(256) }), }), }), @@ -198,9 +198,9 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 23, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::Number { size: Some(256) }), + key_type: Box::new(AbiType::Number { size: Some(256) }), value_type: Box::new(AbiType::UInt { size: Some(256) }), }), } @@ -212,9 +212,9 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 24, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::Number { size: Some(256) }), + key_type: Box::new(AbiType::Number { size: Some(256) }), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Number { size: Some(8) }), @@ -231,9 +231,9 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 25, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::Number { size: Some(256) }), + key_type: Box::new(AbiType::Number { size: Some(256) }), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Number { size: Some(8) }), @@ -249,7 +249,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 26, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::UInt { size: None }), } )); @@ -260,7 +260,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 27, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Number { size: None }), } )); @@ -270,7 +270,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 28, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::UInt { size: None }), } )); @@ -280,7 +280,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 29, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Bytes { length: Some(20) }), + key_type: Box::new(AbiType::Bytes { length: Some(20) }), value_type: Box::new(AbiType::Number { size: None }), } )); @@ -300,7 +300,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 31, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Number { size: Some(256) }), + key_type: Box::new(AbiType::Number { size: Some(256) }), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Number { size: Some(8) }), @@ -316,7 +316,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 32, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Number { size: Some(256) }), + key_type: Box::new(AbiType::Number { size: Some(256) }), value_type: Box::new(AbiType::UInt { size: None }), } )); @@ -327,7 +327,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 33, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Number { size: Some(256) }), + key_type: Box::new(AbiType::Number { size: Some(256) }), value_type: Box::new(AbiType::UInt { size: None }), } )); @@ -341,7 +341,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 35, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Number { size: None }), } )); diff --git a/tests/indelible.rs b/tests/indelible.rs index 6100a0c..df7e97d 100644 --- a/tests/indelible.rs +++ b/tests/indelible.rs @@ -44,7 +44,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 4, 0, AbiType::Mapping { - key_type: Box::new(AbiType::UInt { size: Some(256) }), + key_type: Box::new(AbiType::UInt { size: Some(256) }), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Address), @@ -64,7 +64,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 5, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Bytes { length: Some(8) }), @@ -79,7 +79,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 6, 0, AbiType::Mapping { - key_type: Box::new(AbiType::UInt { size: Some(256) }), + key_type: Box::new(AbiType::UInt { size: Some(256) }), value_type: Box::new(AbiType::Bytes { length: Some(20) }), } )); @@ -90,9 +90,9 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 7, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Number { size: Some(8) }), @@ -116,7 +116,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 10, 0, AbiType::Mapping { - key_type: Box::new(AbiType::UInt { size: Some(256) }), + key_type: Box::new(AbiType::UInt { size: Some(256) }), value_type: Box::new(AbiType::DynArray { tp: Box::new(AbiType::Struct { elements: vec![ @@ -134,9 +134,9 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 11, 0, AbiType::Mapping { - key_type: Box::new(AbiType::UInt { size: Some(256) }), + key_type: Box::new(AbiType::UInt { size: Some(256) }), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::Bytes { length: Some(32) }), + key_type: Box::new(AbiType::Bytes { length: Some(32) }), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::DynBytes), @@ -153,7 +153,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 12, 0, AbiType::Mapping { - key_type: Box::new(AbiType::UInt { size: Some(256) }), + key_type: Box::new(AbiType::UInt { size: Some(256) }), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Bytes { length: Some(1) }), @@ -169,9 +169,9 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 13, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Number { size: Some(256) }), + key_type: Box::new(AbiType::Number { size: Some(256) }), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::UInt { size: Some(256) }), + key_type: Box::new(AbiType::UInt { size: Some(256) }), value_type: Box::new(AbiType::DynArray { tp: Box::new(AbiType::UInt { size: Some(256) }), }), diff --git a/tests/kakigori.rs b/tests/kakigori.rs index f1f5a95..4011801 100644 --- a/tests/kakigori.rs +++ b/tests/kakigori.rs @@ -34,7 +34,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 2, 0, AbiType::Mapping { - key_type: Box::new(AbiType::UInt { size: Some(256) }), + key_type: Box::new(AbiType::UInt { size: Some(256) }), value_type: Box::new(AbiType::Address), } )); @@ -44,7 +44,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 3, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::UInt { size: None }), } )); @@ -54,7 +54,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 4, 0, AbiType::Mapping { - key_type: Box::new(AbiType::UInt { size: Some(256) }), + key_type: Box::new(AbiType::UInt { size: Some(256) }), value_type: Box::new(AbiType::Number { size: Some(160) }), } )); @@ -65,9 +65,9 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 5, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Bytes { length: Some(1) }), @@ -112,7 +112,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 15, 0, AbiType::Mapping { - key_type: Box::new(AbiType::UInt { size: Some(256) }), + key_type: Box::new(AbiType::UInt { size: Some(256) }), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::DynBytes), @@ -130,7 +130,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 16, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Bytes { length: Some(1) }), diff --git a/tests/paw_warz.rs b/tests/paw_warz.rs index 962d3ff..4bcc576 100644 --- a/tests/paw_warz.rs +++ b/tests/paw_warz.rs @@ -34,7 +34,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 2, 0, AbiType::Mapping { - key_type: Box::new(AbiType::UInt { size: Some(256) }), + key_type: Box::new(AbiType::UInt { size: Some(256) }), value_type: Box::new(AbiType::Bytes { length: Some(20) }), } )); @@ -44,7 +44,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 3, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Bytes { length: Some(20) }), + key_type: Box::new(AbiType::Bytes { length: Some(20) }), value_type: Box::new(AbiType::UInt { size: None }), } )); @@ -55,7 +55,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 4, 0, AbiType::Mapping { - key_type: Box::new(AbiType::UInt { size: Some(256) }), + key_type: Box::new(AbiType::UInt { size: Some(256) }), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Bytes { length: Some(20) }), @@ -71,9 +71,9 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 5, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Bytes { length: Some(1) }), @@ -96,7 +96,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 8, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Bytes { length: Some(32) }), + key_type: Box::new(AbiType::Bytes { length: Some(32) }), value_type: Box::new(AbiType::DynBytes), } )); diff --git a/tests/sale_clock_auction.rs b/tests/sale_clock_auction.rs index 0dea1f5..b599063 100644 --- a/tests/sale_clock_auction.rs +++ b/tests/sale_clock_auction.rs @@ -43,7 +43,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 3, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Bytes { length: Some(32) }), + key_type: Box::new(AbiType::Bytes { length: Some(32) }), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Address), diff --git a/tests/shardwallet.rs b/tests/shardwallet.rs index 6111fd1..cdecc6f 100644 --- a/tests/shardwallet.rs +++ b/tests/shardwallet.rs @@ -34,7 +34,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 2, 0, AbiType::Mapping { - key_type: Box::new(AbiType::InfiniteType), + key_type: Box::new(AbiType::InfiniteType), value_type: Box::new(AbiType::Address), } )); @@ -44,7 +44,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 3, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::UInt { size: None }), } )); @@ -55,7 +55,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 4, 0, AbiType::Mapping { - key_type: Box::new(AbiType::InfiniteType), + key_type: Box::new(AbiType::InfiniteType), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Bytes { length: Some(20) }), @@ -71,9 +71,9 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 5, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Number { size: Some(8) }), @@ -95,7 +95,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 7, 0, AbiType::Mapping { - key_type: Box::new(AbiType::InfiniteType), + key_type: Box::new(AbiType::InfiniteType), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::Number { size: Some(24) }), @@ -113,7 +113,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 8, 0, AbiType::Mapping { - key_type: Box::new(AbiType::InfiniteType), + key_type: Box::new(AbiType::InfiniteType), value_type: Box::new(AbiType::DynArray { tp: Box::new(AbiType::Bytes { length: Some(8) }), }), @@ -126,9 +126,9 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 9, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Bytes { length: Some(20) }), + key_type: Box::new(AbiType::Bytes { length: Some(20) }), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::InfiniteType), + key_type: Box::new(AbiType::InfiniteType), value_type: Box::new(AbiType::UInt { size: None }), }), } @@ -139,7 +139,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 10, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Bytes { length: None }), } )); diff --git a/tests/simple_contract.rs b/tests/simple_contract.rs index d2b8d3b..193635e 100644 --- a/tests/simple_contract.rs +++ b/tests/simple_contract.rs @@ -23,9 +23,9 @@ fn analyses_simple_contract() -> anyhow::Result<()> { 0, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Bytes { length: Some(16) }), + key_type: Box::new(AbiType::Bytes { length: Some(16) }), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::Bytes { length: Some(16) }), + key_type: Box::new(AbiType::Bytes { length: Some(16) }), value_type: Box::new(AbiType::Bytes { length: Some(32) }), }), } diff --git a/tests/uniswap_permit2.rs b/tests/uniswap_permit2.rs index 260689f..d00a83c 100644 --- a/tests/uniswap_permit2.rs +++ b/tests/uniswap_permit2.rs @@ -29,9 +29,9 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 0, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::Bytes { length: Some(32) }), + key_type: Box::new(AbiType::Bytes { length: Some(32) }), value_type: Box::new(AbiType::Bytes { length: None }), }), } @@ -44,11 +44,11 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 1, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::UInt { size: Some(160) }), diff --git a/tests/uniswap_v2_pair.rs b/tests/uniswap_v2_pair.rs index 30bbf41..4a52693 100644 --- a/tests/uniswap_v2_pair.rs +++ b/tests/uniswap_v2_pair.rs @@ -28,7 +28,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 1, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::UInt { size: None }), }, )); @@ -38,9 +38,9 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 2, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::UInt { size: Some(256) }), }), } @@ -54,7 +54,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 4, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Address), + key_type: Box::new(AbiType::Address), value_type: Box::new(AbiType::Number { size: None }), } )); diff --git a/tests/uniswap_v3_pool.rs b/tests/uniswap_v3_pool.rs index 2f0e211..da97c28 100644 --- a/tests/uniswap_v3_pool.rs +++ b/tests/uniswap_v3_pool.rs @@ -58,7 +58,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 5, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Int { size: None }), + key_type: Box::new(AbiType::Int { size: None }), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::UInt { size: Some(128) }), @@ -80,7 +80,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 6, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Int { size: None }), + key_type: Box::new(AbiType::Int { size: None }), value_type: Box::new(AbiType::Bytes { length: None }), } )); @@ -92,7 +92,7 @@ fn correctly_generates_a_layout() -> anyhow::Result<()> { 7, 0, AbiType::Mapping { - key_type: Box::new(AbiType::Bytes { length: Some(32) }), + key_type: Box::new(AbiType::Bytes { length: Some(32) }), value_type: Box::new(AbiType::Struct { elements: vec![ StructElement::new(0, AbiType::UInt { size: Some(128) }), diff --git a/tests/watchdog.rs b/tests/watchdog.rs index 1ce9843..5deae49 100644 --- a/tests/watchdog.rs +++ b/tests/watchdog.rs @@ -5,8 +5,8 @@ #![cfg(test)] use std::sync::{ - atomic::{AtomicBool, Ordering}, Arc, + atomic::{AtomicBool, Ordering}, }; use storage_layout_extractor::{error, error::Error, watchdog::FlagWatchdog}; From 2dd8811ecbba385377305777d8abced6e0b49ad7 Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 15 Dec 2025 12:33:46 -0500 Subject: [PATCH 3/9] clippy --- src/disassembly/disassembler.rs | 4 ++- src/opcode/control.rs | 5 ++-- src/opcode/macros.rs | 1 - src/tc/debug.rs | 46 ++++++++++++++++-------------- src/tc/expression.rs | 7 ++--- src/tc/lift/mul_shifted.rs | 4 +-- src/tc/lift/packed_encoding.rs | 3 +- src/tc/rule/environment_opcodes.rs | 2 +- src/tc/state/mod.rs | 10 ++++--- src/tc/unification.rs | 2 +- src/utility.rs | 2 +- src/vm/mod.rs | 2 +- src/vm/state/stack.rs | 2 +- src/vm/value/mod.rs | 2 +- 14 files changed, 47 insertions(+), 45 deletions(-) diff --git a/src/disassembly/disassembler.rs b/src/disassembly/disassembler.rs index 2c6ff70..75d0641 100644 --- a/src/disassembly/disassembler.rs +++ b/src/disassembly/disassembler.rs @@ -201,7 +201,9 @@ pub fn disassemble(bytes: &[u8]) -> Result> { // as invalid if !push_bytes.is_empty() && push_bytes.len() != push_size as usize { add_op(ops, control::Invalid::new(last_push)); - push_bytes.iter().for_each(|b| add_op(ops, control::Invalid::new(*b))); + for b in push_bytes.iter() { + add_op(ops, control::Invalid::new(*b)); + } } else if push_size != 0 { let opcode = mem::PushN::new(push_size, push_bytes.clone()) .map_err(|e| e.locate(last_push_start))?; diff --git a/src/opcode/control.rs b/src/opcode/control.rs index 0202a7a..730ec42 100644 --- a/src/opcode/control.rs +++ b/src/opcode/control.rs @@ -232,7 +232,7 @@ impl Opcode for JumpI { // If we get an error here, we need to change what we do based on whether it is // in this thread or the target thread. let result = match payload.payload { - execution::Error::NoConcreteJumpDestination { .. } + execution::Error::NoConcreteJumpDestination | execution::Error::NonExistentJumpTarget { .. } | execution::Error::InvalidJumpTarget { .. } | execution::Error::InvalidOffsetForJump { .. } => Ok(payload), @@ -898,9 +898,10 @@ impl Opcode for Nop { #[cfg(test)] mod test { use crate::{ + bytecode, disassembly::InstructionStream, error::execution, - opcode::{Opcode, control, macros::bytecode, test_util as util}, + opcode::{Opcode, control, test_util as util}, vm::value::{Provenance, RSV, RSVD, known::KnownWord}, }; diff --git a/src/opcode/macros.rs b/src/opcode/macros.rs index ab23f8c..ac50b5e 100644 --- a/src/opcode/macros.rs +++ b/src/opcode/macros.rs @@ -36,4 +36,3 @@ macro_rules! bytecode { } // Export it scoped -pub use bytecode; diff --git a/src/tc/debug.rs b/src/tc/debug.rs index cf353c3..06a5db5 100644 --- a/src/tc/debug.rs +++ b/src/tc/debug.rs @@ -180,32 +180,36 @@ pub fn collect_vars_in_tree_of( while let Some(tv) = tyvar_queue.pop_front() { let inferences = state.inferences_for(tv); - inferences.iter().for_each(|i| match i { - TE::Any | TE::Word { .. } | TE::Conflict { .. } | TE::Bytes => (), - TE::Equal { id } => { - if !seen.contains(id) { - tyvar_queue.push_back(*id); + for i in inferences.iter() { + match i { + TE::Any | TE::Word { .. } | TE::Conflict { .. } | TE::Bytes => (), + TE::Equal { id } => { + if !seen.contains(id) { + tyvar_queue.push_back(*id); + } } - } - TE::FixedArray { element, .. } | TE::DynamicArray { element } => { - if !seen.contains(element) { - tyvar_queue.push_back(*element); + TE::FixedArray { element, .. } | TE::DynamicArray { element } => { + if !seen.contains(element) { + tyvar_queue.push_back(*element); + } } - } - TE::Mapping { key, value } => { - if !seen.contains(key) { - tyvar_queue.push_back(*key); + TE::Mapping { key, value } => { + if !seen.contains(key) { + tyvar_queue.push_back(*key); + } + if !seen.contains(value) { + tyvar_queue.push_back(*value); + } } - if !seen.contains(value) { - tyvar_queue.push_back(*value); + TE::Packed { types, .. } => { + for s in types.iter() { + if !seen.contains(&s.typ) { + tyvar_queue.push_back(s.typ); + } + } } } - TE::Packed { types, .. } => types.iter().for_each(|s| { - if !seen.contains(&s.typ) { - tyvar_queue.push_back(s.typ); - } - }), - }); + } seen.insert(tv); } diff --git a/src/tc/expression.rs b/src/tc/expression.rs index 73eaea2..d6d001a 100644 --- a/src/tc/expression.rs +++ b/src/tc/expression.rs @@ -278,9 +278,11 @@ pub type InferenceSet = HashSet; /// A representation of the special ways in which a word could be used. #[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)] +#[derive(Default)] pub enum WordUse { /// The word is used as data (equivalent to `bytesN`) where we know nothing /// more about it. + #[default] Bytes, /// The word is used numerically, but is not known to be signed or unsigned. @@ -358,11 +360,6 @@ impl WordUse { } } -impl Default for WordUse { - fn default() -> Self { - Self::Bytes - } -} impl Display for WordUse { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { diff --git a/src/tc/lift/mul_shifted.rs b/src/tc/lift/mul_shifted.rs index 439ec39..66571d2 100644 --- a/src/tc/lift/mul_shifted.rs +++ b/src/tc/lift/mul_shifted.rs @@ -88,9 +88,7 @@ impl Lift for MulShiftedValue { _ => return None, }; - let Some(offset) = MulShiftedValue::which_power_of_2(constant) else { - return None; - }; + let offset = MulShiftedValue::which_power_of_2(constant)?; Some(RSVD::Shifted { offset, value }) } diff --git a/src/tc/lift/packed_encoding.rs b/src/tc/lift/packed_encoding.rs index aed2d86..bf637e8 100644 --- a/src/tc/lift/packed_encoding.rs +++ b/src/tc/lift/packed_encoding.rs @@ -67,8 +67,7 @@ impl Lift for PackedEncoding { let elements = unpick_ors(value.clone()); let true = elements .iter() - .map(|e| matches!(e.data(), RSVD::Shifted { .. } | RSVD::SubWord { .. })) - .all(|r| r) + .all(|e| matches!(e.data(), RSVD::Shifted { .. } | RSVD::SubWord { .. })) else { return None; }; diff --git a/src/tc/rule/environment_opcodes.rs b/src/tc/rule/environment_opcodes.rs index d122157..a2da017 100644 --- a/src/tc/rule/environment_opcodes.rs +++ b/src/tc/rule/environment_opcodes.rs @@ -42,7 +42,7 @@ impl InferenceRule for EnvironmentCodesRule { state.infer_for(target, TE::address()); } _ => (), - }; + } Ok(()) } diff --git a/src/tc/state/mod.rs b/src/tc/state/mod.rs index a007452..d10cf14 100644 --- a/src/tc/state/mod.rs +++ b/src/tc/state/mod.rs @@ -3,7 +3,7 @@ use std::{ array, - collections::{HashMap, HashSet}, + collections::HashMap, }; use type_variable::{TypeVariable, TypeVariableSource}; @@ -98,7 +98,7 @@ impl TypeCheckerState { // Register the result self.expressions.entry(new_tv).or_insert(value_for_var); - self.inferences.entry(new_tv).or_insert(HashSet::new()); + self.inferences.entry(new_tv).or_default(); // Return the newly-allocated type variable new_tv @@ -394,7 +394,7 @@ impl TypeCheckerState { // Register the result self.expressions.entry(type_var).or_insert(new_value.clone()); - self.inferences.entry(type_var).or_insert(HashSet::new()); + self.inferences.entry(type_var).or_default(); if is_stable { self.stable_types.insert(value, new_value.clone()); @@ -450,7 +450,9 @@ impl TypeCheckerState { expression: impl Into, ) { let expression = expression.into(); - variables.into_iter().for_each(|v| self.infer(v, expression.clone())); + for v in variables.into_iter() { + self.infer(v, expression.clone()); + } } /// Adds the provided `expression` to the typing expressions for the diff --git a/src/tc/unification.rs b/src/tc/unification.rs index 1722e53..541d5e4 100644 --- a/src/tc/unification.rs +++ b/src/tc/unification.rs @@ -52,7 +52,7 @@ pub fn unify(state: &mut TypeCheckerState, watchdog: &DynWatchdog) -> Result<()> match type_expr { TypeExpression::Equal { id } => forest.union(&type_var, id), _ => forest.add_data(&type_var, HashSet::from([type_expr.clone()])), - }; + } } } diff --git a/src/utility.rs b/src/utility.rs index 46e6145..bc42b91 100644 --- a/src/utility.rs +++ b/src/utility.rs @@ -41,7 +41,7 @@ impl Debug for U256Wrapper { impl PartialOrd for U256Wrapper { fn partial_cmp(&self, other: &Self) -> Option { - self.0.partial_cmp(&other.0) + Some(self.cmp(other)) } } diff --git a/src/vm/mod.rs b/src/vm/mod.rs index 23bb3ad..61c9741 100644 --- a/src/vm/mod.rs +++ b/src/vm/mod.rs @@ -166,7 +166,7 @@ impl VM { let result = instruction.execute(self); match result { - Ok(_) => { + Ok(()) => { self.current_thread_mut() .expect( "We already know a thread is present as we executed an instruction \ diff --git a/src/vm/state/stack.rs b/src/vm/state/stack.rs index f6cd62f..0d0516a 100644 --- a/src/vm/state/stack.rs +++ b/src/vm/state/stack.rs @@ -197,7 +197,7 @@ pub struct LocatedStackHandle<'a> { stack: &'a mut Stack, } -impl<'a> LocatedStackHandle<'a> { +impl LocatedStackHandle<'_> { /// Pushes the provided value onto the top of the stack. /// /// # Errors diff --git a/src/vm/value/mod.rs b/src/vm/value/mod.rs index 80eb6c3..49430b0 100644 --- a/src/vm/value/mod.rs +++ b/src/vm/value/mod.rs @@ -591,7 +591,7 @@ pub enum SymbolicValueData { /// Loading the data at `offset` for `size` in the call data. /// - /// Note that CallData has non-structural identity. + /// Note that `CallData` has non-structural identity. CallData { id: Uuid, offset: BoxedVal, size: BoxedVal }, /// The size of the current call data. From b73d942180663e1bcaafe975ab85011f4f9ac681 Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 15 Dec 2025 12:34:44 -0500 Subject: [PATCH 4/9] clippy --- src/disassembly/disassembler.rs | 2 +- src/opcode/memory.rs | 8 ++--- src/tc/debug.rs | 4 +-- src/tc/mod.rs | 4 ++- src/tc/state/mod.rs | 2 +- src/tc/unification.rs | 60 ++++++++++++++++++++++----------- tests/watchdog.rs | 2 +- 7 files changed, 52 insertions(+), 30 deletions(-) diff --git a/src/disassembly/disassembler.rs b/src/disassembly/disassembler.rs index 75d0641..b61b97c 100644 --- a/src/disassembly/disassembler.rs +++ b/src/disassembly/disassembler.rs @@ -201,7 +201,7 @@ pub fn disassemble(bytes: &[u8]) -> Result> { // as invalid if !push_bytes.is_empty() && push_bytes.len() != push_size as usize { add_op(ops, control::Invalid::new(last_push)); - for b in push_bytes.iter() { + for b in &push_bytes { add_op(ops, control::Invalid::new(*b)); } } else if push_size != 0 { diff --git a/src/opcode/memory.rs b/src/opcode/memory.rs index 4417bea..918d3a9 100644 --- a/src/opcode/memory.rs +++ b/src/opcode/memory.rs @@ -1466,7 +1466,7 @@ mod test { assert_eq!(offset.provenance(), Provenance::Synthetic); } _ => panic!("Invalid data"), - }; + } assert_eq!(item.provenance(), Provenance::Execution); Ok(()) @@ -1519,7 +1519,7 @@ mod test { assert_eq!(size, &input_size); } _ => panic!("Incorrect payload"), - }; + } assert_eq!(loaded.provenance(), Provenance::Execution); Ok(()) @@ -1641,7 +1641,7 @@ mod test { assert_eq!(size, &input_size); } _ => panic!("Incorrect payload"), - }; + } assert_eq!(loaded.provenance(), Provenance::Execution); Ok(()) @@ -1924,7 +1924,7 @@ mod test { assert_eq!(value, &opcode.bytes_as_word()); } _ => panic!("Incorrect payload"), - }; + } } Ok(()) diff --git a/src/tc/debug.rs b/src/tc/debug.rs index 06a5db5..5ab12e9 100644 --- a/src/tc/debug.rs +++ b/src/tc/debug.rs @@ -180,7 +180,7 @@ pub fn collect_vars_in_tree_of( while let Some(tv) = tyvar_queue.pop_front() { let inferences = state.inferences_for(tv); - for i in inferences.iter() { + for i in &inferences { match i { TE::Any | TE::Word { .. } | TE::Conflict { .. } | TE::Bytes => (), TE::Equal { id } => { @@ -202,7 +202,7 @@ pub fn collect_vars_in_tree_of( } } TE::Packed { types, .. } => { - for s in types.iter() { + for s in types { if !seen.contains(&s.typ) { tyvar_queue.push_back(s.typ); } diff --git a/src/tc/mod.rs b/src/tc/mod.rs index 8d73f2b..9c43cd3 100644 --- a/src/tc/mod.rs +++ b/src/tc/mod.rs @@ -863,7 +863,9 @@ pub mod test { #[must_use] pub fn execution_result_with_values(values: Vec) -> ExecutionResult { let mut state_with_values = VMState::new(0, 0, Config::default()); - values.into_iter().for_each(|v| state_with_values.record_value(v)); + for v in values.into_iter() { + state_with_values.record_value(v); + } ExecutionResult { instructions: InstructionStream::try_from(bytecode![Invalid::default()].as_slice()) diff --git a/src/tc/state/mod.rs b/src/tc/state/mod.rs index d10cf14..0672ea6 100644 --- a/src/tc/state/mod.rs +++ b/src/tc/state/mod.rs @@ -450,7 +450,7 @@ impl TypeCheckerState { expression: impl Into, ) { let expression = expression.into(); - for v in variables.into_iter() { + for v in variables { self.infer(v, expression.clone()); } } diff --git a/src/tc/unification.rs b/src/tc/unification.rs index 541d5e4..5af14b3 100644 --- a/src/tc/unification.rs +++ b/src/tc/unification.rs @@ -709,14 +709,16 @@ mod test { let inference_1 = TE::bytes(Some(ADDRESS_WIDTH_BITS)); let inference_2 = TE::bytes(None); let inference_3 = TE::address(); - let inferences = vec![inference_1, inference_2, inference_3]; + let inferences = [inference_1, inference_2, inference_3]; let inference_permutations: Vec> = inferences.iter().permutations(inferences.len()).unique().collect(); // Check that they combine properly, and produce the same result no matter the // order for permutation in inference_permutations { - permutation.into_iter().for_each(|i| state.infer(v_1_tv, i.clone())); + for i in permutation.into_iter() { + state.infer(v_1_tv, i.clone()); + } unify(&mut state, &LazyWatchdog.in_rc())?; let result = util::get_inference(v_1_tv, state.result()); @@ -742,14 +744,16 @@ mod test { let inference_1 = TE::signed_word(Some(64)); let inference_2 = TE::bytes(None); let inference_3 = TE::signed_word(None); - let inferences = vec![inference_1, inference_2, inference_3]; + let inferences = [inference_1, inference_2, inference_3]; let inference_permutations: Vec> = inferences.iter().permutations(inferences.len()).unique().collect(); // Check that they combine properly, and produce the same result no matter the // order for permutation in inference_permutations { - permutation.into_iter().for_each(|i| state.infer(v_1_tv, i.clone())); + for i in permutation.into_iter() { + state.infer(v_1_tv, i.clone()); + } unify(&mut state, &LazyWatchdog.in_rc())?; let result = util::get_inference(v_1_tv, state.result()); @@ -771,14 +775,16 @@ mod test { // Set up some inferences let inference_1 = TE::signed_word(Some(64)); let inference_2 = TE::signed_word(Some(128)); - let inferences = vec![inference_1, inference_2]; + let inferences = [inference_1, inference_2]; let permutations: Vec> = inferences.iter().permutations(inferences.len()).unique().collect(); // Check that they combine properly, and produce the same error no matter the // order for permutation in permutations { - permutation.into_iter().for_each(|i| state.infer(v_1_ty, i.clone())); + for i in permutation.into_iter() { + state.infer(v_1_ty, i.clone()); + } unify(&mut state, &LazyWatchdog.in_rc())?; let result = util::get_inference(v_1_ty, state.result()); @@ -804,14 +810,16 @@ mod test { let inference_2 = TE::DynamicArray { element: element_tv, }; - let inferences = vec![inference_1, inference_2]; + let inferences = [inference_1, inference_2]; let permutations: Vec> = inferences.iter().permutations(inferences.len()).unique().collect(); // Check that they combine properly, and produce the same result no matter the // order for permutation in permutations { - permutation.into_iter().for_each(|i| state.infer(array_tv, i.clone())); + for i in permutation.into_iter() { + state.infer(array_tv, i.clone()); + } unify(&mut state, &LazyWatchdog.in_rc())?; let result = util::get_inference(array_tv, state.result()); @@ -842,14 +850,16 @@ mod test { let inference_2 = TE::DynamicArray { element: element_tv, }; - let inferences = vec![inference_1, inference_2]; + let inferences = [inference_1, inference_2]; let permutations: Vec> = inferences.iter().permutations(inferences.len()).unique().collect(); // Check that they combine properly, and produce the same result no matter the // order for permutation in permutations { - permutation.into_iter().for_each(|i| state.infer(array_tv, i.clone())); + for i in permutation.into_iter() { + state.infer(array_tv, i.clone()); + } unify(&mut state, &LazyWatchdog.in_rc())?; let result = util::get_inference(array_tv, state.result()); @@ -879,14 +889,16 @@ mod test { let elem_inference_2 = TE::signed_word(Some(64)); state.infer(elem_1_tv, elem_inference_1); state.infer(elem_2_tv, elem_inference_2); - let inferences = vec![array_inference_1, array_inference_2]; + let inferences = [array_inference_1, array_inference_2]; let permutations: Vec> = inferences.iter().permutations(inferences.len()).unique().collect(); // Check that we get the same result, and that they combine properly for permutation in permutations { // Register the array inferences in the state - permutation.into_iter().for_each(|i| state.infer(array_tv, i.clone())); + for i in permutation.into_iter() { + state.infer(array_tv, i.clone()); + } // Check the result is right unify(&mut state, &LazyWatchdog.in_rc())?; @@ -921,14 +933,16 @@ mod test { let elem_inference_2 = TE::signed_word(Some(64)); state.infer(elem_1_tv, elem_inference_1); state.infer(elem_2_tv, elem_inference_2); - let inferences = vec![array_inference_1, array_inference_2]; + let inferences = [array_inference_1, array_inference_2]; let permutations: Vec> = inferences.iter().permutations(inferences.len()).unique().collect(); // Check that we get the same result, and that they combine properly for permutation in permutations { // Register the array inferences in the state - permutation.into_iter().for_each(|i| state.infer(array_tv, i.clone())); + for i in permutation.into_iter() { + state.infer(array_tv, i.clone()); + } // Check the array is right unify(&mut state, &LazyWatchdog.in_rc())?; @@ -974,14 +988,16 @@ mod test { let elem_inference_2 = TE::signed_word(Some(64)); state.infer(elem_1_tv, elem_inference_1); state.infer(elem_2_tv, elem_inference_2); - let inferences = vec![array_inference_1, array_inference_2]; + let inferences = [array_inference_1, array_inference_2]; let permutations: Vec> = inferences.iter().permutations(inferences.len()).unique().collect(); // Check that we get the same result, and that they combine properly for permutation in permutations { // Register the array inferences in the state - permutation.into_iter().for_each(|i| state.infer(array_tv, i.clone())); + for i in permutation.into_iter() { + state.infer(array_tv, i.clone()); + } unify(&mut state, &LazyWatchdog.in_rc())?; let result = util::get_inference(array_tv, state.result()); @@ -1023,14 +1039,16 @@ mod test { let elem_inference_2 = TE::signed_word(Some(64)); state.infer(elem_1_tv, elem_inference_1); state.infer(elem_2_tv, elem_inference_2); - let inferences = vec![array_inference_1, array_inference_2]; + let inferences = [array_inference_1, array_inference_2]; let permutations: Vec> = inferences.iter().permutations(inferences.len()).unique().collect(); // Check that we get the same result, and that they combine properly for permutation in permutations { // Register the array inferences in the state - permutation.into_iter().for_each(|i| state.infer(array_tv, i.clone())); + for i in permutation.into_iter() { + state.infer(array_tv, i.clone()); + } unify(&mut state, &LazyWatchdog.in_rc())?; let result = util::get_inference(array_tv, state.result()); @@ -1074,14 +1092,16 @@ mod test { let elem_inference_2 = TE::signed_word(Some(64)); state.infer(elem_1_tv, elem_inference_1); state.infer(elem_2_tv, elem_inference_2); - let inferences = vec![array_inference_1, array_inference_2]; + let inferences = [array_inference_1, array_inference_2]; let permutations: Vec> = inferences.iter().permutations(inferences.len()).unique().collect(); // Check that we get the same result, and that they combine properly for permutation in permutations { // Register the array inferences in the state - permutation.into_iter().for_each(|i| state.infer(array_tv, i.clone())); + for i in permutation.into_iter() { + state.infer(array_tv, i.clone()); + } unify(&mut state, &LazyWatchdog.in_rc())?; let result = util::get_inference(array_tv, state.result()); diff --git a/tests/watchdog.rs b/tests/watchdog.rs index 5deae49..4235a3f 100644 --- a/tests/watchdog.rs +++ b/tests/watchdog.rs @@ -36,7 +36,7 @@ fn kills_extractor_when_needed() -> anyhow::Result<()> { let error = errors.payloads().first().unwrap(); match &error.payload { - Error::Execution(error::execution::Error::StoppedByWatchdog { .. }) => (), + Error::Execution(error::execution::Error::StoppedByWatchdog) => (), _ => panic!("Wrong payload"), } From 683f51cd1c7e43c62b112e8323233ca77803ff65 Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 15 Dec 2025 12:36:03 -0500 Subject: [PATCH 5/9] clippy --- src/lib.rs | 1 + src/tc/mod.rs | 2 +- src/tc/unification.rs | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 69183e7..d12cef0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -127,6 +127,7 @@ #![warn(clippy::all, clippy::cargo, clippy::pedantic)] #![allow(clippy::module_name_repetitions)] // Allows for better API naming +#![allow(clippy::multiple_crate_versions)] // Transitive dependency versions may differ pub mod constant; pub mod data; diff --git a/src/tc/mod.rs b/src/tc/mod.rs index 9c43cd3..d378342 100644 --- a/src/tc/mod.rs +++ b/src/tc/mod.rs @@ -863,7 +863,7 @@ pub mod test { #[must_use] pub fn execution_result_with_values(values: Vec) -> ExecutionResult { let mut state_with_values = VMState::new(0, 0, Config::default()); - for v in values.into_iter() { + for v in values { state_with_values.record_value(v); } diff --git a/src/tc/unification.rs b/src/tc/unification.rs index 5af14b3..6e1667c 100644 --- a/src/tc/unification.rs +++ b/src/tc/unification.rs @@ -716,7 +716,7 @@ mod test { // Check that they combine properly, and produce the same result no matter the // order for permutation in inference_permutations { - for i in permutation.into_iter() { + for i in permutation { state.infer(v_1_tv, i.clone()); } @@ -751,7 +751,7 @@ mod test { // Check that they combine properly, and produce the same result no matter the // order for permutation in inference_permutations { - for i in permutation.into_iter() { + for i in permutation { state.infer(v_1_tv, i.clone()); } @@ -782,7 +782,7 @@ mod test { // Check that they combine properly, and produce the same error no matter the // order for permutation in permutations { - for i in permutation.into_iter() { + for i in permutation { state.infer(v_1_ty, i.clone()); } @@ -817,7 +817,7 @@ mod test { // Check that they combine properly, and produce the same result no matter the // order for permutation in permutations { - for i in permutation.into_iter() { + for i in permutation { state.infer(array_tv, i.clone()); } @@ -857,7 +857,7 @@ mod test { // Check that they combine properly, and produce the same result no matter the // order for permutation in permutations { - for i in permutation.into_iter() { + for i in permutation { state.infer(array_tv, i.clone()); } @@ -896,7 +896,7 @@ mod test { // Check that we get the same result, and that they combine properly for permutation in permutations { // Register the array inferences in the state - for i in permutation.into_iter() { + for i in permutation { state.infer(array_tv, i.clone()); } @@ -940,7 +940,7 @@ mod test { // Check that we get the same result, and that they combine properly for permutation in permutations { // Register the array inferences in the state - for i in permutation.into_iter() { + for i in permutation { state.infer(array_tv, i.clone()); } @@ -995,7 +995,7 @@ mod test { // Check that we get the same result, and that they combine properly for permutation in permutations { // Register the array inferences in the state - for i in permutation.into_iter() { + for i in permutation { state.infer(array_tv, i.clone()); } @@ -1046,7 +1046,7 @@ mod test { // Check that we get the same result, and that they combine properly for permutation in permutations { // Register the array inferences in the state - for i in permutation.into_iter() { + for i in permutation { state.infer(array_tv, i.clone()); } @@ -1099,7 +1099,7 @@ mod test { // Check that we get the same result, and that they combine properly for permutation in permutations { // Register the array inferences in the state - for i in permutation.into_iter() { + for i in permutation { state.infer(array_tv, i.clone()); } From 4597f4c56de381bc6003c53ac06bee03edad1fc6 Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 15 Dec 2025 12:38:26 -0500 Subject: [PATCH 6/9] version --- .github/workflows/ci.yml | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3527206..1f6dec1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ on: # Environment variables that will be set on all runners env: - RUST_VERSION: 1.81.0 # Specify the Rust version to be used on CI. + RUST_VERSION: 1.82.0 # Specify the Rust version to be used on CI. CARGO_TERM_COLOR: always # Always colour Cargo's output. CARGO_INCREMENTAL: 0 # Always run without incremental builds on CI. CARGO_PROFILE_DEV_DEBUG: 0 # Don't embed debug info even though the build is a dev build. diff --git a/Cargo.toml b/Cargo.toml index 81a4150..469eb45 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ readme = "README.md" # to let authors opt in to backwards-incompatible changes. Crates using one edition can interoperate with crates using # another edition, thereby ensuring that there's no ecosystem split. edition = "2021" -rust-version = "1.81.0" +rust-version = "1.82.0" # Prevent publishing by accident. publish = false From 135c2e8de682384dc60c24d5725a699f27f3e3ff Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 15 Dec 2025 12:39:17 -0500 Subject: [PATCH 7/9] lint --- src/tc/expression.rs | 4 +--- src/tc/state/mod.rs | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/tc/expression.rs b/src/tc/expression.rs index d6d001a..ce776b2 100644 --- a/src/tc/expression.rs +++ b/src/tc/expression.rs @@ -277,8 +277,7 @@ impl Display for TypeExpression { pub type InferenceSet = HashSet; /// A representation of the special ways in which a word could be used. -#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)] -#[derive(Default)] +#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Default)] pub enum WordUse { /// The word is used as data (equivalent to `bytesN`) where we know nothing /// more about it. @@ -360,7 +359,6 @@ impl WordUse { } } - impl Display for WordUse { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { let str = match self { diff --git a/src/tc/state/mod.rs b/src/tc/state/mod.rs index 0672ea6..47749bb 100644 --- a/src/tc/state/mod.rs +++ b/src/tc/state/mod.rs @@ -1,10 +1,7 @@ //! This module contains the definition of the type checker state and other //! supporting types. -use std::{ - array, - collections::HashMap, -}; +use std::{array, collections::HashMap}; use type_variable::{TypeVariable, TypeVariableSource}; From 576573c228921e28056b53f9d9add366e7ccf192 Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 15 Dec 2025 12:43:38 -0500 Subject: [PATCH 8/9] version --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f6dec1..ce16d25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,8 +106,8 @@ jobs: - name: Install rust uses: actions-rs/toolchain@v1 with: - toolchain: nightly profile: minimal + toolchain: ${{ env.RUST_VERSION }} override: true components: rustfmt - name: Restore Cache From 59f12bd50f431e79607686ba7ac58b0e42f956ed Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 15 Dec 2025 12:48:05 -0500 Subject: [PATCH 9/9] rm nightly fmt rules and move to stable --- rustfmt.toml | 5 ----- src/disassembly/disassembler.rs | 2 +- src/disassembly/mod.rs | 2 +- src/extractor/mod.rs | 2 +- src/extractor/state.rs | 2 +- src/opcode/arithmetic.rs | 4 ++-- src/opcode/control.rs | 8 ++++---- src/opcode/environment.rs | 6 +++--- src/opcode/logic.rs | 6 +++--- src/opcode/memory.rs | 6 +++--- src/opcode/mod.rs | 2 +- src/opcode/util.rs | 2 +- src/tc/debug.rs | 4 ++-- src/tc/lift/dynamic_array_access.rs | 6 +++--- src/tc/lift/mapping_index.rs | 6 +++--- src/tc/lift/mapping_offset.rs | 6 +++--- src/tc/lift/mul_shifted.rs | 6 +++--- src/tc/lift/packed_encoding.rs | 4 ++-- src/tc/lift/proxy_slots.rs | 6 +++--- src/tc/lift/recognise_hashed_slots.rs | 6 +++--- src/tc/lift/storage_slots.rs | 6 +++--- src/tc/lift/sub_word.rs | 8 ++++---- src/tc/mod.rs | 12 ++++++------ src/tc/rule/arithmetic_operations.rs | 4 ++-- src/tc/rule/bit_shifts.rs | 2 +- src/tc/rule/boolean_operations.rs | 2 +- src/tc/rule/call_data.rs | 22 +++++++++------------- src/tc/rule/create.rs | 2 +- src/tc/rule/dynamic_array_write.rs | 2 +- src/tc/rule/environment_opcodes.rs | 2 +- src/tc/rule/ext_code.rs | 2 +- src/tc/rule/external_calls.rs | 2 +- src/tc/rule/mapping_access.rs | 4 ++-- src/tc/rule/masked_word.rs | 20 ++++++++------------ src/tc/rule/offset_size.rs | 2 +- src/tc/rule/packed_encoding.rs | 2 +- src/tc/rule/s_load_is_inner_types.rs | 2 +- src/tc/rule/sha3.rs | 2 +- src/tc/rule/storage_key.rs | 2 +- src/tc/rule/storage_write.rs | 2 +- src/tc/state/mod.rs | 6 +++--- src/tc/state/type_variable.rs | 2 +- src/tc/unification.rs | 6 +++--- src/vm/mod.rs | 4 ++-- src/vm/state/memory.rs | 4 ++-- src/vm/state/mod.rs | 4 ++-- src/vm/state/stack.rs | 2 +- src/vm/state/storage.rs | 4 ++-- src/vm/thread.rs | 2 +- src/vm/value/mod.rs | 2 +- src/watchdog.rs | 2 +- tests/common/mod.rs | 4 ++-- tests/curve_v1_adapter_2_assets.rs | 2 +- tests/watchdog.rs | 2 +- 54 files changed, 113 insertions(+), 126 deletions(-) diff --git a/rustfmt.toml b/rustfmt.toml index 8bd3e7d..312c1db 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -5,13 +5,11 @@ # High-level configuration, telling rustfmt which featureset to use. edition = "2021" -version = "Two" # Configuration controlling general code style. brace_style = "SameLineWhere" chain_width = 70 combine_control_expr = true -condense_wildcard_suffixes = true control_brace_style = "AlwaysSameLine" empty_item_single_line = true enum_discrim_align_threshold = 20 @@ -19,8 +17,6 @@ fn_single_line = false force_multiline_blocks = false format_strings = true hex_literal_case = "Lower" -indent_style = "Block" -inline_attribute_width = 0 match_arm_blocks = true reorder_impl_items = true single_line_let_else_max_width = 70 @@ -53,4 +49,3 @@ comment_width = 80 format_code_in_doc_comments = true normalize_comments = true normalize_doc_attributes = true -wrap_comments = true diff --git a/src/disassembly/disassembler.rs b/src/disassembly/disassembler.rs index b61b97c..4b42d4a 100644 --- a/src/disassembly/disassembler.rs +++ b/src/disassembly/disassembler.rs @@ -19,7 +19,7 @@ use crate::{ disassembly::{Error, Result}, }, opcode::{ - DynOpcode, Opcode, arithmetic as arith, control, environment as env, logic, memory as mem, + arithmetic as arith, control, environment as env, logic, memory as mem, DynOpcode, Opcode, }, }; diff --git a/src/disassembly/mod.rs b/src/disassembly/mod.rs index a6eead0..4e6161a 100644 --- a/src/disassembly/mod.rs +++ b/src/disassembly/mod.rs @@ -341,7 +341,7 @@ mod test { constant::{DUP_OPCODE_BASE_VALUE, LOG_OPCODE_BASE_VALUE, SWAP_OPCODE_BASE_VALUE}, disassembly::InstructionStream, error::disassembly, - opcode::{Opcode, control, memory}, + opcode::{control, memory, Opcode}, }; #[test] diff --git a/src/extractor/mod.rs b/src/extractor/mod.rs index 2dc6c29..c3dacc7 100644 --- a/src/extractor/mod.rs +++ b/src/extractor/mod.rs @@ -5,7 +5,6 @@ pub mod contract; pub mod state; use crate::{ - StorageLayout, disassembly::InstructionStream, error, extractor::{contract::Contract, state::State}, @@ -14,6 +13,7 @@ use crate::{ vm, vm::VM, watchdog::DynWatchdog, + StorageLayout, }; /// Creates a new extractor wrapping the provided `contract`, and with the diff --git a/src/extractor/state.rs b/src/extractor/state.rs index dc68377..0c1ca6d 100644 --- a/src/extractor/state.rs +++ b/src/extractor/state.rs @@ -3,13 +3,13 @@ use std::fmt::Debug; use crate::{ - StorageLayout, disassembly::InstructionStream, tc, tc::TypeChecker, vm, vm::{ExecutionResult, VM}, watchdog::DynWatchdog, + StorageLayout, }; /// A marker trait that says that the type implementing it is an extractor diff --git a/src/opcode/arithmetic.rs b/src/opcode/arithmetic.rs index 2e75c8f..d6f776c 100644 --- a/src/opcode/arithmetic.rs +++ b/src/opcode/arithmetic.rs @@ -2,7 +2,7 @@ use crate::{ opcode::{ExecuteResult, Opcode}, - vm::{VM, value::RSVD}, + vm::{value::RSVD, VM}, }; /// The `ADD` opcode performs addition. @@ -685,7 +685,7 @@ impl Opcode for SignExtend { #[cfg(test)] mod test { use crate::{ - opcode::{Opcode, arithmetic, test_util as util}, + opcode::{arithmetic, test_util as util, Opcode}, vm::value::{Provenance, RSV, RSVD}, }; diff --git a/src/opcode/control.rs b/src/opcode/control.rs index 730ec42..5b6e898 100644 --- a/src/opcode/control.rs +++ b/src/opcode/control.rs @@ -2,10 +2,10 @@ use crate::{ error::{container::Locatable, execution, execution::Error}, - opcode::{ExecuteResult, Opcode, util}, + opcode::{util, ExecuteResult, Opcode}, vm::{ + value::{known::KnownWord, Provenance, RuntimeBoxedVal, RSVD}, VM, - value::{Provenance, RSVD, RuntimeBoxedVal, known::KnownWord}, }, }; @@ -901,8 +901,8 @@ mod test { bytecode, disassembly::InstructionStream, error::execution, - opcode::{Opcode, control, test_util as util}, - vm::value::{Provenance, RSV, RSVD, known::KnownWord}, + opcode::{control, test_util as util, Opcode}, + vm::value::{known::KnownWord, Provenance, RSV, RSVD}, }; #[test] diff --git a/src/opcode/environment.rs b/src/opcode/environment.rs index 6a8055e..d6dfb05 100644 --- a/src/opcode/environment.rs +++ b/src/opcode/environment.rs @@ -5,8 +5,8 @@ use crate::{ error::disassembly, opcode::{ExecuteResult, Opcode}, vm::{ + value::{RuntimeBoxedVal, RSVD}, VM, - value::{RSVD, RuntimeBoxedVal}, }, }; @@ -1266,8 +1266,8 @@ impl Opcode for SelfDestruct { #[cfg(test)] mod test { use crate::{ - opcode::{Opcode, environment, test_util as util}, - vm::value::{Provenance, RSV, RSVD, RuntimeBoxedVal}, + opcode::{environment, test_util as util, Opcode}, + vm::value::{Provenance, RuntimeBoxedVal, RSV, RSVD}, }; #[test] diff --git a/src/opcode/logic.rs b/src/opcode/logic.rs index cdef09e..50681b7 100644 --- a/src/opcode/logic.rs +++ b/src/opcode/logic.rs @@ -3,8 +3,8 @@ use crate::{ opcode::{ExecuteResult, Opcode}, vm::{ + value::{known::KnownWord, Provenance, RSVD}, VM, - value::{Provenance, RSVD, known::KnownWord}, }, }; @@ -836,8 +836,8 @@ impl Opcode for Sar { #[cfg(test)] mod test { use crate::{ - opcode::{Opcode, logic, test_util as util}, - vm::value::{Provenance, RSV, RSVD, known::KnownWord}, + opcode::{logic, test_util as util, Opcode}, + vm::value::{known::KnownWord, Provenance, RSV, RSVD}, }; #[test] diff --git a/src/opcode/memory.rs b/src/opcode/memory.rs index 918d3a9..4723d8a 100644 --- a/src/opcode/memory.rs +++ b/src/opcode/memory.rs @@ -10,8 +10,8 @@ use crate::{ error::{container::Locatable, disassembly, execution::Error}, opcode::{ExecuteResult, Opcode}, vm::{ + value::{known::KnownWord, Provenance, RSV, RSVD}, VM, - value::{Provenance, RSV, RSVD, known::KnownWord}, }, }; @@ -1438,10 +1438,10 @@ mod test { use rand::random; use crate::{ - opcode::{Opcode, memory, test_util as util}, + opcode::{memory, test_util as util, Opcode}, vm::{ state::memory::MemStoreSize, - value::{Provenance, RSV, RSVD, RuntimeBoxedVal, known::KnownWord}, + value::{known::KnownWord, Provenance, RuntimeBoxedVal, RSV, RSVD}, }, }; diff --git a/src/opcode/mod.rs b/src/opcode/mod.rs index e171ee9..f85d73b 100644 --- a/src/opcode/mod.rs +++ b/src/opcode/mod.rs @@ -100,7 +100,7 @@ pub type ExecuteResult = Result<()>; mod test_util { use crate::{ disassembly::InstructionStream, - vm::{Config, VM, value::RuntimeBoxedVal}, + vm::{value::RuntimeBoxedVal, Config, VM}, watchdog::LazyWatchdog, }; diff --git a/src/opcode/util.rs b/src/opcode/util.rs index 89eeb1e..02f9bcb 100644 --- a/src/opcode/util.rs +++ b/src/opcode/util.rs @@ -5,8 +5,8 @@ use crate::{ error::{container::Locatable, execution}, opcode::control::JumpDest, vm::{ + value::{RuntimeBoxedVal, RSVD}, VM, - value::{RSVD, RuntimeBoxedVal}, }, }; diff --git a/src/tc/debug.rs b/src/tc/debug.rs index 5ab12e9..37caebb 100644 --- a/src/tc/debug.rs +++ b/src/tc/debug.rs @@ -5,10 +5,10 @@ use std::collections::{HashSet, VecDeque}; use crate::{ tc::{ expression::{InferenceSet, TE}, - state::{TypeCheckerState, type_variable::TypeVariable}, + state::{type_variable::TypeVariable, TypeCheckerState}, unification::UnificationForest, }, - vm::value::{TCBoxedVal, TCSVD, known::KnownWord}, + vm::value::{known::KnownWord, TCBoxedVal, TCSVD}, }; /// Gets the type variable for the storage slot at `index` in `state`. diff --git a/src/tc/lift/dynamic_array_access.rs b/src/tc/lift/dynamic_array_access.rs index 34edadc..f947e03 100644 --- a/src/tc/lift/dynamic_array_access.rs +++ b/src/tc/lift/dynamic_array_access.rs @@ -3,7 +3,7 @@ use crate::{ tc::{lift::Lift, state::TypeCheckerState}, - vm::value::{RSVD, RuntimeBoxedVal}, + vm::value::{RuntimeBoxedVal, RSVD}, }; /// This pass detects and lifts expressions that perform dynamic array indices @@ -97,10 +97,10 @@ impl Lift for DynamicArrayIndex { mod test { use crate::{ tc::{ - lift::{Lift, dynamic_array_access::DynamicArrayIndex}, + lift::{dynamic_array_access::DynamicArrayIndex, Lift}, state::TypeCheckerState, }, - vm::value::{Provenance, RSV, RSVD, known::KnownWord}, + vm::value::{known::KnownWord, Provenance, RSV, RSVD}, }; #[test] diff --git a/src/tc/lift/mapping_index.rs b/src/tc/lift/mapping_index.rs index a617ba7..7efdb3b 100644 --- a/src/tc/lift/mapping_index.rs +++ b/src/tc/lift/mapping_index.rs @@ -3,7 +3,7 @@ use crate::{ tc::{lift::Lift, state::TypeCheckerState}, - vm::value::{RSVD, RuntimeBoxedVal}, + vm::value::{RuntimeBoxedVal, RSVD}, }; /// This pass detects and folds expressions that represent indices into mappings @@ -82,10 +82,10 @@ impl Lift for MappingIndex { mod test { use crate::{ tc::{ - lift::{Lift, mapping_index::MappingIndex}, + lift::{mapping_index::MappingIndex, Lift}, state::TypeCheckerState, }, - vm::value::{Provenance, RSV, RSVD, known::KnownWord}, + vm::value::{known::KnownWord, Provenance, RSV, RSVD}, }; #[test] diff --git a/src/tc/lift/mapping_offset.rs b/src/tc/lift/mapping_offset.rs index defe14b..f589872 100644 --- a/src/tc/lift/mapping_offset.rs +++ b/src/tc/lift/mapping_offset.rs @@ -3,7 +3,7 @@ use crate::{ tc::{lift::Lift, state::TypeCheckerState}, - vm::value::{RSVD, RuntimeBoxedVal}, + vm::value::{RuntimeBoxedVal, RSVD}, }; /// This pass detects and folds expressions that access values in mappings that @@ -59,10 +59,10 @@ impl Lift for MappingOffset { mod test { use crate::{ tc::{ - lift::{Lift, mapping_offset::MappingOffset}, + lift::{mapping_offset::MappingOffset, Lift}, state::TypeCheckerState, }, - vm::value::{Provenance, RSV, RSVD, known::KnownWord}, + vm::value::{known::KnownWord, Provenance, RSV, RSVD}, }; #[test] diff --git a/src/tc/lift/mul_shifted.rs b/src/tc/lift/mul_shifted.rs index 66571d2..5671b83 100644 --- a/src/tc/lift/mul_shifted.rs +++ b/src/tc/lift/mul_shifted.rs @@ -4,7 +4,7 @@ use crate::{ constant::WORD_SIZE_BITS, tc::{lift::Lift, state::TypeCheckerState}, - vm::value::{RSVD, RuntimeBoxedVal, known::KnownWord}, + vm::value::{known::KnownWord, RuntimeBoxedVal, RSVD}, }; /// This pass detects and lifts expressions that move values around inside a @@ -101,10 +101,10 @@ impl Lift for MulShiftedValue { mod test { use crate::{ tc::{ - lift::{Lift, mul_shifted::MulShiftedValue}, + lift::{mul_shifted::MulShiftedValue, Lift}, state::TypeCheckerState, }, - vm::value::{Provenance, SV, SVD, known::KnownWord}, + vm::value::{known::KnownWord, Provenance, SV, SVD}, }; #[test] diff --git a/src/tc/lift/packed_encoding.rs b/src/tc/lift/packed_encoding.rs index bf637e8..d1545ee 100644 --- a/src/tc/lift/packed_encoding.rs +++ b/src/tc/lift/packed_encoding.rs @@ -6,7 +6,7 @@ use itertools::Itertools; use crate::{ tc::{lift::Lift, state::TypeCheckerState}, - vm::value::{PackedSpan, RSV, RSVD, RuntimeBoxedVal}, + vm::value::{PackedSpan, RuntimeBoxedVal, RSV, RSVD}, }; /// This pass detects and lifts expressions that represent the packing of @@ -139,7 +139,7 @@ impl Lift for PackedEncoding { mod test { use crate::{ tc::{ - lift::{Lift, packed_encoding::PackedEncoding}, + lift::{packed_encoding::PackedEncoding, Lift}, state::TypeCheckerState, }, vm::value::{PackedSpan, Provenance, RSV, RSVD}, diff --git a/src/tc/lift/proxy_slots.rs b/src/tc/lift/proxy_slots.rs index b18e792..32bfb8e 100644 --- a/src/tc/lift/proxy_slots.rs +++ b/src/tc/lift/proxy_slots.rs @@ -8,7 +8,7 @@ use sha3::{Digest, Keccak256}; use crate::{ constant::SOLIDITY_STRING_POINTER, tc::{lift::Lift, state::TypeCheckerState}, - vm::value::{RSV, RSVD, RuntimeBoxedVal, known::KnownWord}, + vm::value::{known::KnownWord, RuntimeBoxedVal, RSV, RSVD}, }; /// This pass detects and folds expressions that access slots constructed using @@ -241,10 +241,10 @@ mod test { use crate::{ tc::{ - lift::{Lift, proxy_slots::ProxySlots}, + lift::{proxy_slots::ProxySlots, Lift}, state::TypeCheckerState, }, - vm::value::{Provenance, RSV, RSVD, known::KnownWord}, + vm::value::{known::KnownWord, Provenance, RSV, RSVD}, }; #[test] diff --git a/src/tc/lift/recognise_hashed_slots.rs b/src/tc/lift/recognise_hashed_slots.rs index 45c9cf2..020439a 100644 --- a/src/tc/lift/recognise_hashed_slots.rs +++ b/src/tc/lift/recognise_hashed_slots.rs @@ -10,7 +10,7 @@ use sha3::{Digest, Keccak256}; use crate::{ tc::{lift::Lift, state::TypeCheckerState}, - vm::value::{RSV, RSVD, RuntimeBoxedVal, known::KnownWord}, + vm::value::{known::KnownWord, RuntimeBoxedVal, RSV, RSVD}, }; /// The number of storage indices for which hashes will be generated (and hence @@ -116,10 +116,10 @@ impl Lift for StorageSlotHashes { mod test { use crate::{ tc::{ - lift::{Lift, recognise_hashed_slots::StorageSlotHashes}, + lift::{recognise_hashed_slots::StorageSlotHashes, Lift}, state::TypeCheckerState, }, - vm::value::{Provenance, RSV, RSVD, known::KnownWord}, + vm::value::{known::KnownWord, Provenance, RSV, RSVD}, }; #[test] diff --git a/src/tc/lift/storage_slots.rs b/src/tc/lift/storage_slots.rs index ac1e853..6e0b96e 100644 --- a/src/tc/lift/storage_slots.rs +++ b/src/tc/lift/storage_slots.rs @@ -3,7 +3,7 @@ use crate::{ tc::{lift::Lift, state::TypeCheckerState}, - vm::value::{RSV, RSVD, RuntimeBoxedVal}, + vm::value::{RuntimeBoxedVal, RSV, RSVD}, }; /// This pass detects and wraps expressions that access constant storage slots @@ -105,10 +105,10 @@ impl Lift for StorageSlots { mod test { use crate::{ tc::{ - lift::{Lift, storage_slots::StorageSlots}, + lift::{storage_slots::StorageSlots, Lift}, state::TypeCheckerState, }, - vm::value::{Provenance, RSV, RSVD, known::KnownWord}, + vm::value::{known::KnownWord, Provenance, RSV, RSVD}, }; #[test] diff --git a/src/tc/lift/sub_word.rs b/src/tc/lift/sub_word.rs index 1f58545..ee49810 100644 --- a/src/tc/lift/sub_word.rs +++ b/src/tc/lift/sub_word.rs @@ -6,10 +6,10 @@ use itertools::Itertools; use crate::{ constant::WORD_SIZE_BITS, tc::{ - lift::{Lift, mul_shifted::MulShiftedValue}, + lift::{mul_shifted::MulShiftedValue, Lift}, state::TypeCheckerState, }, - vm::value::{RSVD, RuntimeBoxedVal, SVD}, + vm::value::{RuntimeBoxedVal, RSVD, SVD}, }; /// This pass detects and folds expressions that mask word-size values where the @@ -209,10 +209,10 @@ impl SubWord { mod test { use crate::{ tc::{ - lift::{Lift, sub_word::SubWordValue}, + lift::{sub_word::SubWordValue, Lift}, state::TypeCheckerState, }, - vm::value::{Provenance, SV, SVD, known::KnownWord}, + vm::value::{known::KnownWord, Provenance, SV, SVD}, }; #[test] diff --git a/src/tc/mod.rs b/src/tc/mod.rs index d378342..32eefc8 100644 --- a/src/tc/mod.rs +++ b/src/tc/mod.rs @@ -7,7 +7,6 @@ use itertools::Itertools; use state::type_variable::TypeVariable; use crate::{ - StorageLayout, constant::BYTE_SIZE_BITS, error::{ container::Locatable, @@ -15,17 +14,18 @@ use crate::{ }, tc::{ abi::{AbiType, StructElement}, - expression::{Span, TE, TypeExpression, WordUse}, + expression::{Span, TypeExpression, WordUse, TE}, lift::LiftingPasses, rule::InferenceRules, state::TypeCheckerState, }, utility::U256Wrapper, vm::{ - ExecutionResult, value::{RuntimeBoxedVal, TCBoxedVal, TCSVD}, + ExecutionResult, }, watchdog::DynWatchdog, + StorageLayout, }; pub mod abi; @@ -668,9 +668,9 @@ pub mod test { use std::collections::VecDeque; use crate::{ - tc::{Config, TypeChecker, abi::AbiType}, + tc::{abi::AbiType, Config, TypeChecker}, utility::U256W, - vm::value::{Provenance, RSV, RSVD, known::KnownWord}, + vm::value::{known::KnownWord, Provenance, RSV, RSVD}, watchdog::LazyWatchdog, }; @@ -844,7 +844,7 @@ pub mod test { disassembly::InstructionStream, error::execution, opcode::control::Invalid, - vm::{Config, ExecutionResult, state::VMState, value::RuntimeBoxedVal}, + vm::{state::VMState, value::RuntimeBoxedVal, Config, ExecutionResult}, }; /// Creates a default execution result. diff --git a/src/tc/rule/arithmetic_operations.rs b/src/tc/rule/arithmetic_operations.rs index 1d7ef28..9857673 100644 --- a/src/tc/rule/arithmetic_operations.rs +++ b/src/tc/rule/arithmetic_operations.rs @@ -68,10 +68,10 @@ mod test { use crate::{ tc::{ expression::TE, - rule::{InferenceRule, arithmetic_operations::ArithmeticOperationRule}, + rule::{arithmetic_operations::ArithmeticOperationRule, InferenceRule}, state::TypeCheckerState, }, - vm::value::{Provenance, RSV, RSVD, TCSVD, known::KnownWord}, + vm::value::{known::KnownWord, Provenance, RSV, RSVD, TCSVD}, }; #[test] diff --git a/src/tc/rule/bit_shifts.rs b/src/tc/rule/bit_shifts.rs index 90b7c78..00d9fb2 100644 --- a/src/tc/rule/bit_shifts.rs +++ b/src/tc/rule/bit_shifts.rs @@ -53,7 +53,7 @@ mod test { use crate::{ tc::{ expression::TE, - rule::{InferenceRule, bit_shifts::BitShiftRule}, + rule::{bit_shifts::BitShiftRule, InferenceRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, diff --git a/src/tc/rule/boolean_operations.rs b/src/tc/rule/boolean_operations.rs index 5c2d329..359d7d3 100644 --- a/src/tc/rule/boolean_operations.rs +++ b/src/tc/rule/boolean_operations.rs @@ -58,7 +58,7 @@ mod test { use crate::{ tc::{ expression::TE, - rule::{InferenceRule, boolean_operations::BooleanOpsRule}, + rule::{boolean_operations::BooleanOpsRule, InferenceRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, diff --git a/src/tc/rule/call_data.rs b/src/tc/rule/call_data.rs index 7038e1c..72f424b 100644 --- a/src/tc/rule/call_data.rs +++ b/src/tc/rule/call_data.rs @@ -5,7 +5,7 @@ use crate::{ constant::BYTE_SIZE_BITS, error::unification::Result, tc::{expression::TE, rule::InferenceRule, state::TypeCheckerState}, - vm::value::{TCBoxedVal, TCSVD, known::KnownWord}, + vm::value::{known::KnownWord, TCBoxedVal, TCSVD}, }; /// This rule creates equations as described below for expressions of the @@ -52,10 +52,10 @@ mod test { constant::BYTE_SIZE_BITS, tc::{ expression::TE, - rule::{InferenceRule, call_data::CallDataRule}, + rule::{call_data::CallDataRule, InferenceRule}, state::TypeCheckerState, }, - vm::value::{Provenance, RSV, RSVD, TCSVD, known::KnownWord}, + vm::value::{known::KnownWord, Provenance, RSV, RSVD, TCSVD}, }; #[test] @@ -104,11 +104,9 @@ mod test { assert!(state.inferences(offset_tv).is_empty()); assert!(state.inferences(size_tv).is_empty()); assert_eq!(state.inferences(call_data_tv).len(), 1); - assert!( - state - .inferences(call_data_tv) - .contains(&TE::bytes(Some(16 * BYTE_SIZE_BITS))) - ); + assert!(state + .inferences(call_data_tv) + .contains(&TE::bytes(Some(16 * BYTE_SIZE_BITS)))); Ok(()) } @@ -155,11 +153,9 @@ mod test { assert!(state.inferences(right_val_tv).is_empty()); assert!(state.inferences(size_tv).is_empty()); assert_eq!(state.inferences(call_data_tv).len(), 1); - assert!( - state - .inferences(call_data_tv) - .contains(&TE::bytes(Some(16 * BYTE_SIZE_BITS))) - ); + assert!(state + .inferences(call_data_tv) + .contains(&TE::bytes(Some(16 * BYTE_SIZE_BITS)))); Ok(()) } diff --git a/src/tc/rule/create.rs b/src/tc/rule/create.rs index a46c2e1..fa8f95a 100644 --- a/src/tc/rule/create.rs +++ b/src/tc/rule/create.rs @@ -47,7 +47,7 @@ mod test { constant::WORD_SIZE_BITS, tc::{ expression::TE, - rule::{InferenceRule, create::CreateContractRule}, + rule::{create::CreateContractRule, InferenceRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, diff --git a/src/tc/rule/dynamic_array_write.rs b/src/tc/rule/dynamic_array_write.rs index efc311e..8ddf237 100644 --- a/src/tc/rule/dynamic_array_write.rs +++ b/src/tc/rule/dynamic_array_write.rs @@ -58,7 +58,7 @@ mod test { use crate::{ tc::{ expression::TE, - rule::{InferenceRule, dynamic_array_write::DynamicArrayWriteRule}, + rule::{dynamic_array_write::DynamicArrayWriteRule, InferenceRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, diff --git a/src/tc/rule/environment_opcodes.rs b/src/tc/rule/environment_opcodes.rs index a2da017..e789cff 100644 --- a/src/tc/rule/environment_opcodes.rs +++ b/src/tc/rule/environment_opcodes.rs @@ -53,7 +53,7 @@ mod test { use crate::{ tc::{ expression::TE, - rule::{InferenceRule, environment_opcodes::EnvironmentCodesRule}, + rule::{environment_opcodes::EnvironmentCodesRule, InferenceRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, diff --git a/src/tc/rule/ext_code.rs b/src/tc/rule/ext_code.rs index d32285d..e2d2404 100644 --- a/src/tc/rule/ext_code.rs +++ b/src/tc/rule/ext_code.rs @@ -59,7 +59,7 @@ mod test { use crate::{ tc::{ expression::TE, - rule::{InferenceRule, ext_code::ExtCodeRule}, + rule::{ext_code::ExtCodeRule, InferenceRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, diff --git a/src/tc/rule/external_calls.rs b/src/tc/rule/external_calls.rs index fe3dd1e..15793fe 100644 --- a/src/tc/rule/external_calls.rs +++ b/src/tc/rule/external_calls.rs @@ -104,7 +104,7 @@ mod test { use crate::{ tc::{ expression::TE, - rule::{InferenceRule, external_calls::ExternalCallRule}, + rule::{external_calls::ExternalCallRule, InferenceRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, diff --git a/src/tc/rule/mapping_access.rs b/src/tc/rule/mapping_access.rs index abd5cff..58d6afb 100644 --- a/src/tc/rule/mapping_access.rs +++ b/src/tc/rule/mapping_access.rs @@ -65,10 +65,10 @@ mod test { constant::WORD_SIZE_BITS, tc::{ expression::{Span, TE}, - rule::{InferenceRule, mapping_access::MappingAccessRule}, + rule::{mapping_access::MappingAccessRule, InferenceRule}, state::TypeCheckerState, }, - vm::value::{Provenance, RSV, RSVD, TCSVD, known::KnownWord}, + vm::value::{known::KnownWord, Provenance, RSV, RSVD, TCSVD}, }; #[test] diff --git a/src/tc/rule/masked_word.rs b/src/tc/rule/masked_word.rs index f5c7410..515e6da 100644 --- a/src/tc/rule/masked_word.rs +++ b/src/tc/rule/masked_word.rs @@ -52,8 +52,8 @@ impl InferenceRule for MaskedWordRule { mod test { use crate::{ tc::{ - expression::{Span, TE, WordUse}, - rule::{InferenceRule, masked_word::MaskedWordRule}, + expression::{Span, WordUse, TE}, + rule::{masked_word::MaskedWordRule, InferenceRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, @@ -84,17 +84,13 @@ mod test { // Check that we end up with the correct equations assert_eq!(state.inferences(value_tv).len(), 1); - assert!( - state - .inferences(value_tv) - .contains(&TE::packed_of(vec![Span::new(mask_tv, 64, 128)])) - ); + assert!(state + .inferences(value_tv) + .contains(&TE::packed_of(vec![Span::new(mask_tv, 64, 128)]))); assert_eq!(state.inferences(mask_tv).len(), 1); - assert!( - state - .inferences(mask_tv) - .contains(&TE::word(Some(128), WordUse::Bytes)) - ); + assert!(state + .inferences(mask_tv) + .contains(&TE::word(Some(128), WordUse::Bytes))); Ok(()) } diff --git a/src/tc/rule/offset_size.rs b/src/tc/rule/offset_size.rs index 0ced94e..0037176 100644 --- a/src/tc/rule/offset_size.rs +++ b/src/tc/rule/offset_size.rs @@ -42,7 +42,7 @@ mod test { use crate::{ tc::{ expression::TE, - rule::{InferenceRule, offset_size::OffsetSizeRule}, + rule::{offset_size::OffsetSizeRule, InferenceRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, diff --git a/src/tc/rule/packed_encoding.rs b/src/tc/rule/packed_encoding.rs index 86d700e..b246fa5 100644 --- a/src/tc/rule/packed_encoding.rs +++ b/src/tc/rule/packed_encoding.rs @@ -49,7 +49,7 @@ mod test { use crate::{ tc::{ expression::{Span, TE}, - rule::{InferenceRule, packed_encoding::PackedEncodingRule}, + rule::{packed_encoding::PackedEncodingRule, InferenceRule}, state::TypeCheckerState, }, vm::value::{PackedSpan, Provenance, RSV, RSVD, TCSVD}, diff --git a/src/tc/rule/s_load_is_inner_types.rs b/src/tc/rule/s_load_is_inner_types.rs index 18b28f3..0a86f2a 100644 --- a/src/tc/rule/s_load_is_inner_types.rs +++ b/src/tc/rule/s_load_is_inner_types.rs @@ -47,7 +47,7 @@ mod test { use crate::{ tc::{ expression::TE, - rule::{InferenceRule, s_load_is_inner_types::SLoadIsInnerTypesRule}, + rule::{s_load_is_inner_types::SLoadIsInnerTypesRule, InferenceRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, diff --git a/src/tc/rule/sha3.rs b/src/tc/rule/sha3.rs index c71b2a3..b5b3b6a 100644 --- a/src/tc/rule/sha3.rs +++ b/src/tc/rule/sha3.rs @@ -36,7 +36,7 @@ mod test { constant::WORD_SIZE_BITS, tc::{ expression::TE, - rule::{InferenceRule, sha3::HashRule}, + rule::{sha3::HashRule, InferenceRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, diff --git a/src/tc/rule/storage_key.rs b/src/tc/rule/storage_key.rs index c2c820d..9ec7766 100644 --- a/src/tc/rule/storage_key.rs +++ b/src/tc/rule/storage_key.rs @@ -33,7 +33,7 @@ mod test { use crate::{ tc::{ expression::TE, - rule::{InferenceRule, storage_key::StorageKeyRule}, + rule::{storage_key::StorageKeyRule, InferenceRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, diff --git a/src/tc/rule/storage_write.rs b/src/tc/rule/storage_write.rs index 4b0f7da..a47a42b 100644 --- a/src/tc/rule/storage_write.rs +++ b/src/tc/rule/storage_write.rs @@ -49,7 +49,7 @@ mod test { use crate::{ tc::{ expression::TE, - rule::{InferenceRule, storage_write::StorageWriteRule}, + rule::{storage_write::StorageWriteRule, InferenceRule}, state::TypeCheckerState, }, vm::value::{Provenance, RSV, RSVD, TCSVD}, diff --git a/src/tc/state/mod.rs b/src/tc/state/mod.rs index 47749bb..2495a22 100644 --- a/src/tc/state/mod.rs +++ b/src/tc/state/mod.rs @@ -7,10 +7,10 @@ use type_variable::{TypeVariable, TypeVariableSource}; use crate::{ tc::{ - expression::{InferenceSet, TE, TypeExpression}, + expression::{InferenceSet, TypeExpression, TE}, unification::UnificationForest, }, - vm::value::{PackedSpan, Provenance, RSVD, RuntimeBoxedVal, TCBoxedVal, TCSV, TCSVD}, + vm::value::{PackedSpan, Provenance, RuntimeBoxedVal, TCBoxedVal, RSVD, TCSV, TCSVD}, }; pub mod type_variable; @@ -684,7 +684,7 @@ mod test { use crate::{ tc::{ - expression::{TE, TypeExpression}, + expression::{TypeExpression, TE}, state::TypeCheckerState, }, vm::value::{Provenance, RSV}, diff --git a/src/tc/state/type_variable.rs b/src/tc/state/type_variable.rs index 995ef41..dbf252b 100644 --- a/src/tc/state/type_variable.rs +++ b/src/tc/state/type_variable.rs @@ -4,8 +4,8 @@ use std::{ fmt::{Display, Formatter}, sync::{ - Arc, atomic::{AtomicUsize, Ordering}, + Arc, }, }; diff --git a/src/tc/unification.rs b/src/tc/unification.rs index 6e1667c..25b1fef 100644 --- a/src/tc/unification.rs +++ b/src/tc/unification.rs @@ -16,8 +16,8 @@ use crate::{ unification::{Error, Result}, }, tc::{ - expression::{InferenceSet, Span, TE, TypeExpression, WordUse}, - state::{TypeCheckerState, type_variable::TypeVariable}, + expression::{InferenceSet, Span, TypeExpression, WordUse, TE}, + state::{type_variable::TypeVariable, TypeCheckerState}, }, watchdog::DynWatchdog, }; @@ -660,7 +660,7 @@ mod test { use crate::{ constant::ADDRESS_WIDTH_BITS, tc::{ - expression::{Span, TE, WordUse}, + expression::{Span, WordUse, TE}, state::TypeCheckerState, unification::{merge, unify}, }, diff --git a/src/vm/mod.rs b/src/vm/mod.rs index 61c9741..f28b033 100644 --- a/src/vm/mod.rs +++ b/src/vm/mod.rs @@ -22,9 +22,9 @@ use crate::{ opcode::DynOpcode, vm::{ data::JumpTargets, - state::{VMState, stack::LocatedStackHandle}, + state::{stack::LocatedStackHandle, VMState}, thread::VMThread, - value::{Provenance, RSV, RSVD, RuntimeBoxedVal, known::KnownWord}, + value::{known::KnownWord, Provenance, RuntimeBoxedVal, RSV, RSVD}, }, watchdog::DynWatchdog, }; diff --git a/src/vm/state/memory.rs b/src/vm/state/memory.rs index fb44ed4..4cd847d 100644 --- a/src/vm/state/memory.rs +++ b/src/vm/state/memory.rs @@ -4,7 +4,7 @@ use std::{collections::HashMap, hash::Hash}; use crate::{ constant::WORD_SIZE_BITS, - vm::value::{Provenance, RSV, RSVD, RuntimeBoxedVal, known::KnownWord}, + vm::value::{known::KnownWord, Provenance, RuntimeBoxedVal, RSV, RSVD}, }; /// A representation of the transient memory of the symbolic virtual machine. @@ -327,7 +327,7 @@ mod test { constant::DEFAULT_MEMORY_SINGLE_OPERATION_MAX_BYTES, vm::{ state::memory::{MemStoreSize, Memory}, - value::{Provenance, RSV, RSVD, RuntimeBoxedVal, known::KnownWord}, + value::{known::KnownWord, Provenance, RuntimeBoxedVal, RSV, RSVD}, }, }; diff --git a/src/vm/state/mod.rs b/src/vm/state/mod.rs index ac1150f..36cd259 100644 --- a/src/vm/state/mod.rs +++ b/src/vm/state/mod.rs @@ -6,10 +6,10 @@ pub mod stack; pub mod storage; use crate::vm::{ - Config, data::VisitedOpcodes, state::{memory::Memory, stack::Stack, storage::Storage}, value::RuntimeBoxedVal, + Config, }; /// The state representation for the [`super::VM`]. @@ -203,9 +203,9 @@ impl VMState { #[cfg(test)] mod test { use crate::vm::{ - Config, state::VMState, value::{RSV, RSVD}, + Config, }; #[test] diff --git a/src/vm/state/stack.rs b/src/vm/state/stack.rs index 0d0516a..b9e072f 100644 --- a/src/vm/state/stack.rs +++ b/src/vm/state/stack.rs @@ -257,7 +257,7 @@ mod test { constant::MAXIMUM_STACK_DEPTH, vm::{ state::stack::Stack, - value::{Provenance, RSV, RuntimeBoxedVal}, + value::{Provenance, RuntimeBoxedVal, RSV}, }, }; diff --git a/src/vm/state/storage.rs b/src/vm/state/storage.rs index cd12930..87c115a 100644 --- a/src/vm/state/storage.rs +++ b/src/vm/state/storage.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; -use crate::vm::value::{Provenance, RSV, RSVD, RuntimeBoxedVal}; +use crate::vm::value::{Provenance, RuntimeBoxedVal, RSV, RSVD}; /// A representation of the persistent storage of the symbolic virtual machine. /// @@ -210,7 +210,7 @@ impl Default for Storage { mod test { use crate::vm::{ state::storage::Storage, - value::{Provenance, RSV, RSVD, RuntimeBoxedVal, known::KnownWord}, + value::{known::KnownWord, Provenance, RuntimeBoxedVal, RSV, RSVD}, }; /// Creates a new synthetic value for testing purposes. diff --git a/src/vm/thread.rs b/src/vm/thread.rs index bb1076a..e3051b3 100644 --- a/src/vm/thread.rs +++ b/src/vm/thread.rs @@ -102,7 +102,7 @@ impl From for VMState { mod test { use crate::{ disassembly::InstructionStream, - vm::{Config, state::VMState, thread::VMThread}, + vm::{state::VMState, thread::VMThread, Config}, }; #[test] diff --git a/src/vm/value/mod.rs b/src/vm/value/mod.rs index 49430b0..78ce3f4 100644 --- a/src/vm/value/mod.rs +++ b/src/vm/value/mod.rs @@ -1645,7 +1645,7 @@ mod test { use ethnum::U256; use uuid::Uuid; - use crate::vm::value::{Provenance, RSV, RSVD, known::KnownWord}; + use crate::vm::value::{known::KnownWord, Provenance, RSV, RSVD}; #[test] fn equality_ignores_instruction_pointer() { diff --git a/src/watchdog.rs b/src/watchdog.rs index 86bd804..3bee0e1 100644 --- a/src/watchdog.rs +++ b/src/watchdog.rs @@ -16,8 +16,8 @@ use std::{ fmt::Debug, rc::Rc, sync::{ - Arc, atomic::{AtomicBool, Ordering}, + Arc, }, }; diff --git a/tests/common/mod.rs b/tests/common/mod.rs index c70f779..b8f3788 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -10,12 +10,12 @@ use serde::{Deserialize, Serialize}; use storage_layout_extractor as sle; use storage_layout_extractor::{ extractor::{ - InitialExtractor, chain::{ - Chain, version::{ChainVersion, EthereumVersion}, + Chain, }, contract::Contract, + InitialExtractor, }, tc, vm, watchdog::{DynWatchdog, LazyWatchdog}, diff --git a/tests/curve_v1_adapter_2_assets.rs b/tests/curve_v1_adapter_2_assets.rs index 104f908..cf9961e 100644 --- a/tests/curve_v1_adapter_2_assets.rs +++ b/tests/curve_v1_adapter_2_assets.rs @@ -6,8 +6,8 @@ use storage_layout_extractor as sle; use storage_layout_extractor::{ extractor::{ chain::{ - Chain, version::{ChainVersion, EthereumVersion}, + Chain, }, contract::Contract, }, diff --git a/tests/watchdog.rs b/tests/watchdog.rs index 4235a3f..d615c38 100644 --- a/tests/watchdog.rs +++ b/tests/watchdog.rs @@ -5,8 +5,8 @@ #![cfg(test)] use std::sync::{ - Arc, atomic::{AtomicBool, Ordering}, + Arc, }; use storage_layout_extractor::{error, error::Error, watchdog::FlagWatchdog};