Coder Social home page Coder Social logo

nft-mint-website's Introduction

NFT Mint Website

This website is built with React, Chakra UI, Solidity, Ethers, Hardhat and deployed to github pages.

Front-end Development

The front end is developed with React library. The website is divided into App, Navbar and Mint components. JSX and useState hook are utilised, alongside Chakra UI, which helps to provide inline styling to the app.

The app is designed to have a navigation bar to help users to click on social media links and to connect to their MetaMask Wallet.

Only after user connect to their MetaMask Wallet, the website will refresh and render the Mint component.

Then, the user can press '+' or '-' button to adject the amount of NFTs they want to mint. The minimum and maximum of NFT to mint is 1 and 10 respectively.

Finally, the user can select 'Mint' button and MetaMask will show a prompt to confirm transaction. Once the user confirms, the transaction will be recorded in the blockchain (in our case, I have deployed the contract to Ethereum Goerli testnet) and can be viewed in Etherscan Goerli network.

โ€‹

Blockchain Development

Smart Contract

Solidity is used to write the smart contract (Mint a NFT) of our app. OpenZeppelin's ERC721 boilerplate contract is imported to help develop the contract.

In the constructor function of the contract, the mint price of each NFT and the maximum supply are set. The initial supply of NFT is 0 and the maximum supply is 10000.

The _safeMint function from the openzeppelin library is called in the mint function of the contract.

Deploy Smart Contract

Hardhat is used to deploy and verify the contract on the Goerli testnet.

The contract address is link.

It has been verified on Etherscan.

Users can see the original deployment transaction and a test mint transaction.

Back-end Calls to Smart Contract

Ethers library is used to make api calls to the Ethereum Goerli network. When user clicks mint, ethers will parse the mint amount from the React front end and then make API call to the Goerli network to complete a transaction.

nft-mint-website's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.