Skip to content

Conversation

@nhussein11
Copy link
Collaborator

Note: This page will require a final gif once we learn how to do that
Note: The snippets should ideally be fetched from https://github.com/polkadot-developers/revm-hardhat-examples, but I couldn't do that due to the gh issue I'm facing

📝 Description

Provide a clear and concise description of your changes.

🔍 Review Preference

Choose one:

  • ✅ I have time to handle formatting/style feedback myself
  • ⚡ Docs team handles formatting (check "Allow edits from maintainers")

🤖 AI-Ready Docs

If content changed, regenerate AI files:

  • ✅ I ran python3 scripts/generate_llms.py
  • ⚡ Docs team will regenerate (check "Allow edits from maintainers")

✅ Checklist

@nhussein11 nhussein11 self-assigned this Oct 30, 2025
@nhussein11 nhussein11 requested a review from a team as a code owner October 30, 2025 23:07
Copilot AI review requested due to automatic review settings October 30, 2025 23:07
@nhussein11 nhussein11 added B0 - Needs Review Pull request is ready for review C1 - Medium Medium priority task A0 - New Content Pull request contains new content pages labels Oct 30, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a comprehensive tutorial for building a smart contract dApp on Polkadot Hub, progressing from creating and deploying a smart contract with Hardhat to building a full frontend with Next.js and Viem. The tutorial provides a complete "zero to hero" learning experience for developers new to building on Polkadot Hub.

  • Creates a complete tutorial covering smart contract deployment with Hardhat and dApp development with Next.js and Viem
  • Includes practical code examples for wallet connection, contract interaction (read/write operations), and error handling
  • Provides structured project setup with clear file organization and component architecture

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Deploy the contract to Polkadot Hub TestNet:

```bash
npx hardhat ignition deploy ./ignition/modules/Storage.ts --network polkadotHub
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Network name inconsistency: the command uses polkadotHub but the configuration defines polkadotTestNet. This will cause deployment to fail.

Suggested change
npx hardhat ignition deploy ./ignition/modules/Storage.ts --network polkadotHub
npx hardhat ignition deploy ./ignition/modules/Storage.ts --network polkadotTestNet

Copilot uses AI. Check for mistakes.

```typescript title="contract.ts"
import { getContract } from 'viem';
import { publicClient, getWalletClient } from '../viem';
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect import path: should be '../utils/viem' since the viem.ts file is located in the utils directory according to the project structure.

Suggested change
import { publicClient, getWalletClient } from '../viem';
import { publicClient, getWalletClient } from '../utils/viem';

Copilot uses AI. Check for mistakes.
"use client";

import React, { useState, useEffect } from "react";
import { polkadotTestnet } from "../../viem";
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect import path: should be '../utils/viem' since the viem.ts file is in the utils directory, not two levels up.

Suggested change
import { polkadotTestnet } from "../../viem";
import { polkadotTestnet } from "../utils/viem";

Copilot uses AI. Check for mistakes.
'use client';

import React, { useState, useEffect } from 'react';
import { publicClient } from '../../viem';
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent import paths: line 544 imports from '../../viem' but should be '../utils/viem' to match the project structure and be consistent with line 545.

Suggested change
import { publicClient } from '../../viem';
import { publicClient } from '../../utils/viem';

Copilot uses AI. Check for mistakes.
"use client";

import React, { useState, useEffect } from "react";
import { publicClient, getWalletClient } from '../../viem';
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent import paths: line 617 imports from '../../viem' but should be '../utils/viem' to match the project structure and be consistent with line 618.

Suggested change
import { publicClient, getWalletClient } from '../../viem';
import { publicClient, getWalletClient } from '../../utils/viem';

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@brunopgalvao brunopgalvao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice read. Looking forward to the GIFs.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A0 - New Content Pull request contains new content pages B0 - Needs Review Pull request is ready for review C1 - Medium Medium priority task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants