Skip to content

Modernize Lessons 2-5: Ethers.js v6 & WAGMI v2 Migration#287

Open
moneyyyytalks478-ship-it wants to merge 1 commit into
Developer-DAO:mainfrom
moneyyyytalks478-ship-it:modernize-lessons-2-5
Open

Modernize Lessons 2-5: Ethers.js v6 & WAGMI v2 Migration#287
moneyyyytalks478-ship-it wants to merge 1 commit into
Developer-DAO:mainfrom
moneyyyytalks478-ship-it:modernize-lessons-2-5

Conversation

@moneyyyytalks478-ship-it
Copy link
Copy Markdown

Pull Request: Modernizing Lessons 2-5 (Issue #213)

Description

This PR provides a comprehensive update to Lessons 2, 3, 4, and 5 of the Developer DAO Academy. The primary focus is to modernize the technical stack, ensuring that the academy content remains relevant and functional with the latest industry standards.

Key Changes

1. Ethers.js v6 Migration

  • Migrated all code snippets and instructions from ethers.js v5 to v6.
  • Updated deployment scripts and interactions to use v6 syntax:
    • await contract.deployed() -> await contract.waitForDeployment()
    • contract.address -> contract.target
    • ethers.utils.parseEther() -> ethers.parseEther()
    • Updated providers and signer handling.

2. Solidity 0.8.20 & OpenZeppelin 5.x

  • Updated all smart contracts to Solidity 0.8.20 to support modern EVM features.
  • Addressed breaking changes introduced in OpenZeppelin 5.x:
    • Ownable: Updated constructors to explicitly pass the initialOwner (e.g., Ownable(msg.sender)).
    • ERC721: Replaced the removed _exists(tokenId) internal function with the modern _ownerOf(tokenId) != address(0) pattern.
    • Updated imports to the latest standard paths.

3. WAGMI v2 Upgrade (Lesson 5)

  • Performed a major refactor of the frontend integration in Lesson 5.
  • Migrated from WAGMI v0.x to WAGMI v2.
  • Introduced the new configuration pattern using createConfig and the required QueryClientProvider from TanStack Query.
  • Updated hooks (useAccount, useReadContract, useWriteContract) to match the v2 API.

4. Testnet Migration

  • Removed all references to deprecated testnets (Goerli, Mumbai).
  • Updated instructions and code to use Sepolia and Polygon Amoy.
  • Updated RPC URL examples and block explorer links.

5. Tooling & Configuration

  • Updated hardhat.config.js templates to include proper network settings for Sepolia and Amoy.
  • Refreshed dependency lists and npx hardhat commands throughout the documentation.

Verification

  • All smart contracts verified for compilation with Solidity 0.8.20.
  • Test snippets updated and verified for v6 syntax compatibility.
  • Frontend code patterns verified against WAGMI v2 documentation.

Fixes #213

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update lessons 2, 3, 4, 5 with new Hardhat, ethers.js versions. And now OZ is using 0.8.20.....

2 participants