Skip to content

fhildeb/burnt-pix-bot

Repository files navigation

burnt-pix-bot

A Hardhat repository for automated refindments of Burnt Pix NFTs.

Burnt Pix Preview

Installation

This repository uses the bun toolkit to manage packages and run scripts.Make sure to install it first.

# Download repository
git clone https://github.com/fhildeb/burnt-pix-bot.git

# Open the folder
cd burnt-pix-bot

# Install dependencies
bun install

Preparation

  1. Rename .env.example to .env and set your PRIVATE_KEY
  2. Add your TOKEN_ID and names to /consts/constants.ts
  3. Set burntPix and maximumRefines in /scripts/refineBurntPix.ts
  4. Adjust ITERATION_NUMBER and MAX_GAS_PRICE in /consts/constants.ts

CAUTION: Never share your private key with anyone or upload it to public repositories. Anyone who possesses it can access your funds, assets, or even gain access to your Universal Profile if the controller has administrative rights!

Further Information

  • How to save gas: Dont call refine transactions using the Universal Profile. It will use significantly more gas because the transaction has to go through the smart contract account. Therefore, provide the PRIVATE_KEY of a separate Wallet or the Universal Profile Controller. You can further optimize on the iteration number, as described below.
  • How to get the token ID To get the TOKEN_ID of your Burnt Pix NFT, connect your Universal Profile or wallet to the Burnt Pix Webpage and click refine. It will pop up a transaction screen showing a Smart Contract Execution of Method: 0xea255583. The [0] value is the token ID of the Burnt Pix and can be copied.
  • How to get Byte32 values: Both, the ITERATION_NUMBER and TOKEN_ID values have to be defined as Byte32 values as hexadecimal strings. You can use the Byte32 Converter to set custom iterations. Always make sure iterations and token IDs have the 0x prefix in front.
  • How much will it cost: Depending on the current gas price ranging from 0.75 Gwei to 5 Gwei, a transaction with 2000 refinements will range from 0.015 LYX to 0.1 LYX.
  • How to optimize iterations: The number of iterations that can be completed within one block or transaction depends on how many pixels need to be refined. This number is different for every Burnt Pix NFT. If you choose a number that's too high, iterations will abort mid-way and cost you extra gas. If you plan on doing many refinements, you can raise the iteration number to find the sweet spot of maximum iterations. A high number without abortions will make refinements faster and save gas, as fewer transactions must be fired.

Execution

Starting the Script

# Mainnet
npx hardhat --network luksoMainnet run scripts/refineBurntPix.ts

# Testnet
npx hardhat --network luksoTestnet run scripts/refineBurntPix.ts

Terminal Output

-----------------------------------------------------------------------------------------------
--- Current Controller:  0xE929859839B0e624f88c169dcAdf5c662967691d
--- Current LYX Balance:  5.219111508945610286
--- Current Gas Price:  1.39763443
--- Getting Metadata for:  0x000000000000000000000000f5603116f71d29e26b9f4cdcc6242a888ccc9900
-----------------------------------------------------------------------------------------------
Iterations: 987000
GasUsed: 7.38B
FeesBurnt: 7.55LYX
TipsPaid: 3.91LYX
-----------------------------------------------------------------------------------------------
--- Checking conditions for refinement...
--- Calling refine...
-----------------------------------------------------------------------------------------------
[23:05:19] Previous refinement is still processing. Skipping this round.
-----------------------------------------------------------------------------------------------
Refine called successfully. Waiting for next round...

EXIT: Use Ctrl+C to terminate the script.

References

Mainnet Links

Testnet Links

About

Automated Refinements for Burnt Pix NFTs.

Resources

Stars

Watchers

Forks