alchemyplatform / create-web3-dapp

The complete toolbox to create web3 applications.
https://docs.alchemy.com
GNU Affero General Public License v3.0
858 stars 255 forks source link

Add the possibility to use the chain Sepolia #97

Open remibeaufils opened 1 year ago

remibeaufils commented 1 year ago

Is your feature request related to a problem? Please describe. When trying to use the chain Sepolia, this error occurs:

app-index.js:32 ChainDoesNotSupportContract: Chain "Sepolia" does not support contract "ensUniversalResolver".

This could be due to any of the following:
- The chain does not have the contract "ensUniversalResolver" configured.

Describe the solution you'd like I would like to be able to use the chain Sepolia.

Describe alternatives you've considered For the moment I have to use the chain Goerli.

Additional context I simply init the app with npx create-web3-dapp@latest then I modified frontend/app/layout.tsx like this:

"use client";
import { WagmiConfig, createConfig, sepolia } from "wagmi";
import { ConnectKitProvider, getDefaultConfig } from "connectkit";
import Navbar from "@/components/instructionsComponent/navigation/navbar";
import Footer from "@/components/instructionsComponent/navigation/footer";
import { goerli } from "viem/chains";

const config = createConfig(
  getDefaultConfig({
    // Required API Keys
    alchemyId: process.env.ALCHEMY_API_KEY, // or infuraId
    walletConnectProjectId: process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID!,

    // Required
    appName: "You Create Web3 Dapp",

    // Optional
    appDescription: "Your App Description",
    appUrl: "https://family.co", // your app's url
    appIcon: "https://family.co/logo.png", // your app's logo,no bigger than 1024x1024px (max. 1MB)

    // ChainDoesNotSupportContract: Chain "Sepolia" does not support contract "ensUniversalResolver".
    // This could be due to any of the following:
    // - The chain does not have the contract "ensUniversalResolver" configured.
    chains: [sepolia],
    // chains: [goerli],
  })
);

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <WagmiConfig config={config}>
        <ConnectKitProvider mode="dark">
          <body>
            <div style={{ display: "flex", flexDirection: "column", minHeight: "105vh" }}>
              <Navbar />
              <div style={{flexGrow: 1}}>{children}</div>
              <Footer />
            </div>
          </body>
        </ConnectKitProvider>
      </WagmiConfig>
    </html>
  );
}
mohitvdx commented 1 year ago

should work on sepolia testnet. Please give more info on this "ensUniversalResolver" contract