Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

119
Vistas
issues importing ethers.getcontractfactory

I am running a function that is supposed to mint an NFT from the browser. I am able to execute the script from within node.js CLI . When I try to do it from the browser I get:

Uncaught (in promise) TypeError: ethers.getContractFactory is not a function

Here is how I am importing it currently:

import { ethers } from "https://cdn-cors.ethers.io/lib/ethers-5.5.4.esm.min.js";

As I understand, "getContractFactory" is actually a hardhat helper. How should I import it? I am not using a compiler like webpack since I had issues with it.

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

As you mentioned getContractFactory() is a helper function which hardhat added to the ethers object and is only available in your hardhat environment. The function is used to actually deploy a new contract.

What you want to use in the browser is probably ethers.Contract() to "import" an already deployed contract for interacting with it.

const mintingContract = new ethers.Contract(
                    nftContractAddress,
                    ABI,
                    signer)
about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda