Create an ERC721

Simple example of how to deploy a ERC721 contract

In order to instantiate the ERC721 a Web3Connection instance object or a Web3ConnectionOptions object must be provided.

import {Erc721Standard} from '@taikai/dappkit'

/* Deploying your NFT */
const deployer = new Erc721Standard({
  web3Host: 'https://localhost:1337',
  privateKey: 'ub3rPr1v47eK'
});

deployer.connection.start();
deployer.loadAbi();

let receipt;

receipt = await deployer.deployJsonAbi('My NFT Name', '$MyNftSymbol');
console.log('deployed!', receipt);

/* Using your NFT after deployment */
const myNFT = new Erc721Standard(deployer.connection, receipt.contractAddress);

await myNFT.loadContract();

receipt = await myNFT.mint('0xMyAddress', 'tokenId-1');
console.log('Minted!', receipt);

Last updated