A Hardhat repository for automated refindments of Burnt Pix NFTs.
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
- Rename
.env.example
to.env
and set yourPRIVATE_KEY
- Add your
TOKEN_ID
and names to/consts/constants.ts
- Set
burntPix
andmaximumRefines
in/scripts/refineBurntPix.ts
- Adjust
ITERATION_NUMBER
andMAX_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!
- 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 aSmart Contract Execution
ofMethod: 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
andTOKEN_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 the0x
prefix in front. - How much will it cost: Depending on the current gas price ranging from
0.75 Gwei
to5 Gwei
, a transaction with 2000 refinements will range from0.015 LYX
to0.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.
# Mainnet
npx hardhat --network luksoMainnet run scripts/refineBurntPix.ts
# Testnet
npx hardhat --network luksoTestnet run scripts/refineBurntPix.ts
-----------------------------------------------------------------------------------------------
--- 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.