Intro Polygon zkEVM

This project is a simple fullstack dApp that allows users to mint a blockchain name as an NFT on Polygon zkEVM.

What is zkEVM?

  • Polygon zkEVM is a decentralized Ethereum Layer 2 scalability solution that uses cryptographic zero-knowledge proofs to offer validity and quick finality to off-chain transaction computation, also known as a ZK-Rollup. (learn more)

Getting started

  1. Clone the repo
git clone https://github.com/nunocgoncalves/intro-polygon-zkevm.git
  1. Install dependencies
yarn
  1. Copy the .env.example file and add your private key
cp .env.example .env
  1. Get some Goerli test ETH (faucet)

  2. Bridge to the zkEVM testnet using the zkEVM Bridge

  3. Setup Hardhat

  • Add zkEVM to the hardhat.config.js
networks: {
    zkEVM: {
      url: `https://rpc.public.zkevm-test.net`,
    },
},

Deploy the contract

npx hardhat run scripts/deploy.js --network zkEVM

Connect the contract to the frontend

  1. Get the contract ABI
  • Copy the contract ABI from artifacts/contracts/Domains.sol/Domains.json to app/src/utils/
  • Rename it to contractABI.json
  1. Add the zkEVM network to the frontend
  • Add it to the network utils app/src/utils/networks.js
const networks = {
    ...
    "0x5a2": "Polygon zkEVM Testnet",
}
  • Tweak useEffect and switchNetwork in app/src/App.js
  1. Add contract address in app/src/App.js

Resources