A non-transferable NFT smart contract for issuing certificates on the Mandala Chain. This contract allows authorized entities to mint certificate NFTs with metadata and images stored on IPFS.
The contract inherits from:
ERC721URIStorage: For storing token metadataOwnable: For access control# Clone the repository:
git clone <your-repo-url>
cd certificate-nft
# Install dependencies:
forge install
# Set up environment variables:
# Create .env file with your configuration
RPC_URL="https://mlg1.mandalachain.io"
PRIVATE_KEY="your-private-key" # Compile the contract:
forge build
# Deploy to Mandala Chain:
forge create src/CertificateNFT.sol:CertificateNFT \
--rpc-url "https://mlg1.mandalachain.io" \
--private-key $PRIVATE_KEY \
--broadcast # To mint a new certificate NFT:
# Export contract address
export NFT_CONTRACT="your-contract-address"
# Mint NFT
cast send $NFT_CONTRACT "mintNFT(address,string)" \
$RECIPIENT_ADDRESS \
"https://ipfs.io/ipfs/your-image-hash" \
--rpc-url $RPC_URL \
--private-key $PRIVATE_KEY 0xcDCf9295EB880C166E73Ef9D42f07eD9c2E1B7Eeforge test
The tests cover: