Skip to content

Create NFT smart contract

This article will teach you how to create a 721 standard NFT Token.

Compile the Smart contract

Open https://remix.ethereum.org

Delete the default file and create a new NFT.sol

Copy the contract code from the following warehouse to NFT.sol

https://github.com/mathwallet/BSC-Contracts/blob/main/Contracts/NFT.sol

The construction function in the NFTToken contract needs to be customized.

For example: create a ColorNFT series, this NFT token is called RED

BaseURI points to a meta data URL, the specific format can be referred to: http://developer.mathwallet.org/bsc/nfttest/#In the json returned by this URL, the image of the NFT also needs to be defined:

http://developer.mathwallet.org/bsc/nfttest/red.jpg

The picture needs to be accessible so that it can be displayed directly in the wallet and NFT trading market

Compiler version selection 0.5.5

Deployment contract

After configuring the contract, complete the contract verification on Bscscan, see the specific stepshttp://blog.mathwallet.xyz/?p=4181

After verification is complete, first use the addMinter method to add an address

Then you can use the address, give any address according to the serial number Mint NFT

然后即可使用该地址,按序号Mint NFT给任意地址了

Then you can view the NFT token information on the block explorer

https://testnet.bscscan.com