Testing Our Router Contract: Steps and Methodology

December 16, 2023

time
min
MEVbot
Trading System
Trading bot

We are testing on different tokens, but have chosen XCEPT and USDT for demonstration purposes

Network Environment:

We’re utilizing a network that forks from the Ethereum mainnet. This approach simulates the mainnet’s current state, functioning as a local development network. The advantage is the ability to interact with already deployed protocols and test complex interactions in a local environment. A 80 gwei gas fee was applied

Transaction Process:

Two modes were executed at the same time:

  • Mode 1: Buy with Tip
  • Mode 2: Buy without tip

These purchases occur on two different versions of the Uniswap LP : one on V2 and the other on V3. Following the purchases, the tokens are sold.

There are checks in place, such as approval of the token before the token is sold via the same process

Other Checks that take place by the owner are:

  • Should not transfer ownership if not the owner
  • Should transfer ownership
  • Should upgrade contract
  • Should not upgrade contract if not the owner
  • Should upgrade contract with new owner
  • Should recover eth
  • Should recover token