The IrysTheBeraNFT contract is an ERC721 NFT contract that allows users to mint up to two NFTs per wallet: one main NFT and one community NFT.
The dynamic nature of these NFTs is enabled through Irys's mutability features, allowing the NFT metadata to evolve based on the user's BGT token balance.
This contract can be replaced or extended with any standard ERC721 implementation.
- Two NFTs per Wallet: Users can mint two NFTs: a main NFT (
mintMainNFT()
function) and a community NFT (mintCommunityNFT()
function). Each wallet is restricted to minting exactly one of each. - Soulbound NFTs: The NFTs are non-transferable.
- Dynamic Metadata: When minting, the user's BGT token balance is snapshotted and stored onchain, allowing the NFT's metadata to evolve as their balance changes. The metadata URL is initially set to
"NOT_SET"
and is dynamically updated later through an offchain action. - Integration with BGT Token: When deploying the contract, the address of the BGT token must be provided. The contract tracks each user's BGT balance at the time of minting, and the NFT evolves based on these values.
- NodeJS
v20.11.0
or greater - Wallet With bArtrio Berachain - (See Berachain Faucet)
# FROM: ./apps/contract
pnpm install;
# FROM: ./apps/contract
cp .env.example .env;
Replace this value
File: ./apps/contract/.env
# Contracts and wallets"
WALLET_PRIVATE_KEY="<0xYOUR_WALLET_PRIVATE_KEY>"
# FROM: ./apps/contract
pnpm deploy:berachain;
# FROM: ./apps/contract
pnpm verify:berachain 0xD06d8FD4632003D54d78EAfFe9D444B3c80Fb3E3 "0xbDa130737BDd9618301681329bF2e46A016ff9Ad"
# FROM: ./apps/contract
pnpm test;