This project is a simple fullstack dApp that allows users to mint a blockchain name as an NFT on Polygon 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)
- Clone the repo
git clone https://github.com/nunocgoncalves/intro-polygon-zkevm.git
- Install dependencies
yarn
- Copy the .env.example file and add your private key
cp .env.example .env
-
Get some Goerli test ETH (faucet)
-
Bridge to the zkEVM testnet using the zkEVM Bridge
-
Setup Hardhat
- Add zkEVM to the
hardhat.config.js
networks: {
zkEVM: {
url: `https://rpc.public.zkevm-test.net`,
},
},
npx hardhat run scripts/deploy.js --network zkEVM
- Get the contract ABI
- Copy the contract ABI from
artifacts/contracts/Domains.sol/Domains.json
toapp/src/utils/
- Rename it to contractABI.json
- 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
andswitchNetwork
inapp/src/App.js
- Add contract address in
app/src/App.js