Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ZetaChain to wagmi/chains #92

Closed
fadeev opened this issue Jan 30, 2024 · 6 comments
Closed

Add ZetaChain to wagmi/chains #92

fadeev opened this issue Jan 30, 2024 · 6 comments
Assignees

Comments

@fadeev
Copy link
Member

fadeev commented Jan 30, 2024

No description provided.

@Kali-Decoder
Copy link
Collaborator

Hey @fadeev can you assign this issue to me !!!

@Kali-Decoder
Copy link
Collaborator

I found a solution that involves adding a custom chain to the wallet using Wagmi's defineChain method. This method includes properties such as:

  1. id: The chain ID (e.g., 7000 for Zetachain).
  2. name: The name of the chain (e.g., 'Zetachain').
  3. nativeCurrency: Information about the native currency of the chain.
  4. rpcUrls: The RPC URLs for connecting to the chain.
  5. blockExplorer: Details about the block explorer for the chain.
  6. Optional contract addresses: This can include addresses for services like ENS Registry, ENS Universal Resolver, and Multicall3.
export const mainnet = defineChain({
  id: 7000,
  name: 'zetachain_mainnet',
  nativeCurrency: { name: 'Zetachain', symbol: 'ZETA', decimals: 18 },
  rpcUrls: {
    default: { http: ['https://zetachain-evm.blockpi.network/v1/rpc/public'] },
  },
  blockExplorers: {
    default: { name: 'zetachain', url: 'https://explorer.zetachain.com/' },
  },
  contracts: {
    ensRegistry: {
      address: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e',
    },
    ensUniversalResolver: {
      address: '0xE4Acdd618deED4e6d2f03b9bf62dc6118FC9A4da',
      blockCreated: 16773775,
    },
    multicall3: {
      address: '0xca11bde05977b3631167028862be2a173976ca11',
      blockCreated: 14353601,
    },
  },
})

Contract address we need to find. Let me know if I can proceed with that

@fadeev

@fadeev
Copy link
Member Author

fadeev commented Jun 3, 2024

@Kali-Decoder looks good. Let's also add testnet. I don't think we have ENS yet, but we definitely have multicall3: https://www.multicall3.com/deployments

@Kali-Decoder
Copy link
Collaborator

Yeah sure,
I will do that for TESTNET ALSO

@Kali-Decoder
Copy link
Collaborator

I have make chain object 👍

export const mainnet = defineChain({
  id: 7000,
  name: "zetachain_mainnet",
  nativeCurrency: { name: "Zetachain", symbol: "ZETA", decimals: 18 },
  rpcUrls: {
    default: { http: ["https://zetachain-evm.blockpi.network/v1/rpc/public"] },
  },
  blockExplorers: {
    default: { name: "zetachain", url: "https://explorer.zetachain.com/" },
  },
  contracts: {
    multicall3: {
      address: "0xca11bde05977b3631167028862be2a173976ca11",
      blockCreated: 14353601,
    },
  },
});

export const testnet = defineChain({
  id: 7001,
  name: "zetachain_testnet",
  nativeCurrency: {
    name: "ZetaChain Athens 3 Testnet",
    symbol: "ZETA",
    decimals: 18,
  },
  rpcUrls: {
    default: {
      http: ["https://zetachain-athens-evm.blockpi.network/v1/rpc/public"],
    },
  },
  blockExplorers: {
    default: {
      name: "zetachain",
      url: "https://athens.explorer.zetachain.com/",
    },
  },
  contracts: {
    multicall3: {
      address: "0xca11bde05977b3631167028862be2a173976ca11",
      blockCreated: 14353601,
    },
  },
});


Now can I start development for adding chain in wagmi ??
@fadeev

@fadeev
Copy link
Member Author

fadeev commented Jun 4, 2024

@Kali-Decoder yes, please, go ahead.

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

No branches or pull requests

2 participants