2.6 KiB
2.6 KiB
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_RPCis your provider URL. You can use Infura or AlchemyNETWORK_WSSis your websocket provider URL. You can use Infura or AlchemyPRIVATE_KEYis 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-addressis the address of the contract you want to snipe--mint-methodis the name of the method used to mint the NFT--priceis the price of one NFT in wei, you can get it from here--quantityis the quantity of NFT you want to buy--timestampis the timestamp of the sale in seconds, you can get it from here--retry-maxis the maximum number of retries if the transaction fails--backrunis 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