Skip to content

Latest commit

 

History

History

06-nextjs-smartcontract-lottery


Logo

Full Blockchain, Solidity & Full-Stack Web3 development with JavaScript

Everything related to my progress through this course from Patrick Collins
Go to the video »


Trying out / testing

To get a local copy up and running follow these simple example steps.

You will need to install either npm or yarn to run the commands, and git to clone the repository.

Installation

  1. Clone the whole repo:
    git clone https://github.com/0xpolarzero/full-blockchain-solidity-course-js.git
  2. Navigate into the subdirectory:
    cd 06-nextjs-smartcontract-lottery
  3. Install NPM packages using yarn or npm install.

Usage

  1. You can update the contracts addresses in constants/contractAddresses.json to match the deployment addresses from 05-hardhat-smartcontract-lottery:
{
  "5": ["goerli_contract_address"],
  "31337": ["localhost_contract_address"]
}

To get it to work locally, you will need to navigate to 05-hardhat-smartcontract-lottery to run a local node with yarn hardhat node and deploy the contracts with yarn hardhat run scripts/deploy.js --network localhost.

  1. Launch the local development server with yarn dev or npm run dev.
  2. You can also visit the deployed website by clicking this link.

Achievements

  • Using Next.js to build a Front End for the lottery smart contract
  • Using Moralis & React hooks to pass data/events through components
  • Writing to/reading local storage to keep track of wallets connected
  • Using web3uikit to connect a wallet to the provider & dispatch notifications about transactions
  • Basic styling with TailwindCSS
  • Hosting the website on IPFS
    • Directly pinning the website to a node
    • Using Fleek to host on IPFS & Filecoin

Skills

Solidity JavaScript ReactJS NextJS Moralis IPFS