Skip to main content
Change the NFT template’s price, supply, artwork and mint rules, then redeploy it as your own collection.
Ready. This template is published in uzolabs/templates and has been deployed and verified on testnet. It’s a learning template and hasn’t been audited. Use test funds only.

What you’ll build

Your own version of UzoNFT. The settings change without code. The artwork, traits, wallet limits and royalties each need a small contract change. Pick the ones you need.

Prerequisites

Name, price and supply

Set these in .env and deploy again:
.env
NFT_MINT_PRICE is in BOT. The deploy script converts it to wei and passes it to Foundry as NFT_MINT_PRICE_WEI, so you don’t set that yourself. For a free mint, use NFT_MINT_PRICE=0. NFT_MAX_SUPPLY can’t change after deploy. The owner can change the price at any time with setMintPrice.

Change the contract

1

Edit the contract

Edit _svg in contracts/UzoNFT.sol. It receives the token ID and its hue and returns an SVG string.
  • Use single quotes inside the SVG. The SVG sits inside a JSON string, and double quotes would break it.
  • Keep it small. Every byte adds to the deploy cost.
  • If you need a different colour per token, reuse _hue, which gives the same ID the same hue every time.
2

Run the tests

Terminal
The tests decode the JSON and SVG from tokenURI, so a broken quote in your artwork shows up here. Add tests for any new rule, such as a fourth mint from one wallet reverting.
3

Refresh the ABI

Terminal
This rewrites frontend/src/abi.ts, so the web app knows about new functions and errors.
4

Deploy and verify

Terminal
Restart npm run frontend so it reads the new address.

Change the look

Edit the variables at the top of frontend/src/theme.css for colours and fonts, and frontend/src/styles.css for styles that belong only to this app.

Hand over ownership

The owner sets the price and receives withdrawals. To hand that to a multisig, call transferOwnership(newOwner) from the owner wallet. The new owner receives all future withdrawals.
Terminal
Load PRIVATE_KEY from your .env into the shell first, for example with source .env, rather than pasting it into the command.

Verify

Mint one token from the web app and check the gallery shows your new art. On BOTScan, open the token’s page and check its image and attributes. If you added royalties, call royaltyInfo(1, 10000) on the Read contract tab. It should return the owner and 500.

Troubleshooting

A double quote inside the SVG ends the JSON string early. Use single quotes for every SVG attribute.
You must send exactly mintPrice. The owner may have changed it since the page loaded. Reload and try again.
Each parent that defines the function must appear in the override(...) list. With ERC2981 added, supportsInterface needs all three.
USDT on BOT Chain has 6 decimals, so use parseUnits(amount, 6), never parseEther, and move it with OpenZeppelin’s SafeERC20. See USDT and decimals.

Next steps

Gasless app template

Let users act without holding tBOT.

Events without getLogs

Read history without event logs.
Last modified on October 3, 2026