mouseless0x / rusty-sando

Implementation of a competitive v2/v3 multi-meat MEV sandwich bot written using Rust and Huff.
MIT License
782 stars 256 forks source link

Warnings when running cargo run --release --features debug #40

Closed imcodingideas closed 1 year ago

imcodingideas commented 1 year ago

Summary

When executing the command cargo run --release --features debug, I encounter several warnings.

The first warning pertains to an assigned value that is never read:

warning: value assigned to `weth_inventory` is never read
  --> crates/strategy/src/bot/mod.rs:70:17
   |
70 |         let mut weth_inventory = self.sando_state_manager.get_weth_inventory();
   |                 ^^^^^^^^^^^^^^
   |
   = help: maybe it is overwritten before being read?
   = note: `#[warn(unused_assignments)]` on by default

The second warning highlights that a variable does not need to be mutable:

warning: variable does not need to be mutable
   --> crates/strategy/src/bot/mod.rs:174:13
    |
174 |         let mut sando_bundles = vec![];
    |             ----^^^^^^^^^^^^^
    |             |
    |             help: remove this `mut`
    |
   = note: `#[warn(unused_mut)]` on by default

Test Plan

Follow these steps to reproduce the warnings:

  1. Clone the repository: git clone https://github.com/mouseless-eth/rusty-sando.git
  2. Navigate to the contract directory: cd contract
  3. Install dependencies: forge install
  4. Change to the bot directory: cd ../bot
  5. Copy the example environment file: cp .env.example .env
  6. Run the integration tests using the command: cargo test -p strategy --release --features debug