This repository contains a smart contract designed for the Starknet blockchain, tailored for managing non-fungible tokens (NFTs) with a linkage to IPFS for metadata storage.
To build and deploy this smart contract on Starknet, you will need the following tools:
-
Starkli: Command-line tool for Starknet to compile and deploy your contracts.
- Installation guide: Starkli Installation
-
Scarb: The build toolchain and package manager for Cairo and Starknet ecosystems.
- Installation guide: Scarb Installation
- Account creation: Accounts
Please follow the linked guides to install each necessary component before attempting to build or deploy the smart contract.
In addition to the standard ERC721 methods, this contract implements a few non-standard methods for enhanced functionality:
-
mint
: A method to mint new NFTs, restricted to be called by the contract's admin only. It allows batch minting up to a definedMAX_MINT_AMOUNT
. -
max_supply
: Retrieves the maximum supply of tokens that can be minted. -
total_supply
: Provides the total number of tokens that have been minted. -
set_base_uri
: Sets a base URI that will be common for all tokens. .
To deploy this smart contract to Starknet, you will use starkli
to declare the contract class and deploy its instances on Starknet after compiling the contract with Scarb
.
scarb build
starkli declare target/dev/erc721_ipfs_example_ERC721IPFSTemplate.contract_class.json
starkli deploy {{CONTRACT_CLASS_HASH}} {{admin_account_address}} {{name}} {{symbol}} {{max_supply}}
Contributions of all kinds are welcome. If you want to tip me a beer, you can send me some ETH to 0x02dc32837907CA92B5B99e7C2470fFF9c62FAB91F2cc1Ef1416A07171F1eF8C5