2023-03-06 19:51:16 +01:00
2023-03-06 19:51:16 +01:00
2023-03-06 19:51:16 +01:00
2023-03-06 19:51:16 +01:00
2023-03-06 19:51:16 +01:00
2023-03-06 19:51:16 +01:00
2023-03-06 19:51:16 +01:00
2023-03-06 19:51:16 +01:00

status-badge License: GPL v3

Mint sniper

Having issues? Contact Querty#0001 on Discord

Installation

Requirements

Then, run the command bellow to install the sniper:

cargo install --git https://git.enzofoucaud.fr/open-source/mint-sniper.git
cd mint-sniper && cp .env.example .env && cp src/abi/abi.example.json src/abi/abi.json

Replace the values in the .env file with your own.

  • NETWORK_RPC is your provider URL. You can use Infura or Alchemy
  • NETWORK_WSS is your websocket provider URL. You can use Infura or Alchemy
  • PRIVATE_KEY is your wallet's private key

Copy the contract's abi in the file src/abi.json.

Usage

To run the sniper, you have to provide the following arguments:

  • --contract-address is the address of the contract you want to snipe
  • --mint-method is the name of the method used to mint the NFT
  • --price is the price of one NFT in wei, you can get it from here
  • --quantity is the quantity of NFT you want to buy
  • --timestamp is the timestamp of the sale in seconds, you can get it from here
  • --retry-max is the maximum number of retries if the transaction fails
  • --backrun is the backrun mode. If set, the sniper will monitor the mempool and wait for the transaction that activate the sale. You can set timestamp to 0 in this mode. If not set, the sniper will wait for the sale to start and then send the transaction.

The mint function must have one parameter, the quantity that you want to buy. If it's a free mint you can set the price to 0.

Example

If the mint function is:

function mint(uint256 qty) public payable

You can run the sniper with:

cargo run -- --contract-address 0x9601482fD8EacE73745Dd7353e17c19F4Ce9142d --mint-method mint --price 1000000000000000 --amount 2 --timestamp 1676816130 --retry-max 5

If backrun is set, you have to change the mint activation method directly in the code (see src/mempool.rs lines 18 and 32).

TODO

  • Add support for multiple mint functions directly from the abi
  • Add the max fees feature
  • Add the gas price escalator to avoid the transaction to be stuck in the mempool
Description
No description provided
Readme 43 KiB
Languages
Rust 100%