# output # Compiled n Solidity file successfully Save the file and compile your contract to make sure everything is good to deploy using the command below:.address recipient: address that will receive freshly minted NFT //tokenURI: describes the NFT's metadata function mintNFT( address recipient, string memory tokenURI) * import('hardhat/config').HardhatUserConfigĪccounts: [`0x$ Delete the code inside, and copy-paste the code below:.Now you are ready to edit your with the following: Just copy the URL, no account or login is required! If you want to deploy your ERC-721 directly on the mainnet, you can use Ankr's Public RPC↗ for Optimism. For that, we will be using the Kovan testnet RPC provided by Optimism. This is the private key of the account you intend to use on the Optimism Network from MetaMask.īefore setting up the file, we will need a gateway to communicate to the Ethereum blockchain. env file in your project’s root folder and set the environment variable as follows. Npm install -save -dev /hardhat -upgrades Npm install -save -dev /hardhat -ethers ethers We will now install a Hardhat plugin that brings the Ethereum library ethers.js, which allows you to interact with the Ethereum blockchain in a simple way.Next, we are going to create two new directories to house our smart contract and deployment script.Your project should now contain the following files and folders:, node_modules, package.json and package-lock.json. Run npx hardhat and choose "create an empty ".It might take a minute or two to install everything! npm install -save -dev hardhat Once your project is ready, install Hardhat, an Ethereum development environment for testing and deploying smart contracts to the blockchain.Now, initialize your new npm project in the erc721-token-mint directory by running the following command in the terminal of your preferred code editor.To do so, create a new directory called erc721-token-mint. To get started with the hardhat installation, we first need to set up our dev environment. Step 3: Set Up Your Development Environment Wait a few moments and your wallet should be funded! To request funds, go to Optimism Kovan Faucet↗ and sign in with GitHub to acquire some tokens. If you want to launch your ERC721 contract directly to mainnet, replace the RPC URL with Ankr's Public RPC -> /optimism Enable the Testnet option and search for Optimism Kovan and connect your wallet with the given RPC.Once MetaMask is installed and running, follow these simple steps to connect with Optimism Kovan Testnet: If you do not own a wallet, the first thing that needs to be done is to download and install the browser extension of MetaMask↗. Step 1: Connect Metamask to Optimism Kovan Testnet Pretty handy, right? Ready to give optimism a try? This increases the transaction speed and throughput and decreases the cost per transaction. It uses a technology called rollups, specifically Optimistic rollups, where the transactions are executed off the chain and get bundled into a single transaction before being pushed to the main blockchain. Optimism is a layer 2 scaling solution for ETH, meaning it functions on top of the Ethereum mainnet (L1). PS: I know I just threw a ton of new words at you in the previous section and if any of the above was confusing, don't worry as we'll discuss each one of them in detail.īut before we get our hands dirty, let's take a quick rundown on what Optimism is? What is Optimistic Ethereum? We've already discussed how you can make a fungible token using ERC20↗, but what if you want to create tokens that are not alike at all? What we are BuildingĬryptoKitties really braced the growth and use case of NFTs we see today and in this tutorial, we will walk through creating and deploying an ERC-721 smart contract and minting the token on Optimism Kovan-Testnet using Solidity↗, Hardhat↗ and Pinata↗.īy the end of this tutorial - you'll be able to mint an NFT and display it on Quixotic↗ (an NFT marketplace on Optimism) from your deployed ERC721 contract. Before the dawn of ERC-721, tokens on blockchain were only fungible, meaning they can be traded or exchanged with another identical one of the same value, much like a dollar bill. Originally built on the Ethereum blockchain, CryptoKitties was the first non-fungible token (NFT) that allowed the creation of unique digital collectibles as kitties, using the ERC-721 smart contract. Mention NFT revolution and you will most likely stumble upon this project over and over again: CryptoKitties.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |