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

108
Vistas
Set up Minting Page with moralis and perform transaction

I am trying to build a very simple web3 application. The goal is to be able to mint a NFT on button click and perform a transaction for a specific amount of ETH with metamask. For that I want to use moralis (but I am also open for alternatives). Also I am using Rinkeby testnetwork for this.

This whole topic is pretty new for me and I am trying to figure out how I can do that but I keep getting error after error.

Login / Logout is already working and I build a simple UI. After connecting to MetaMask I want the user to select the amount he wants to mint from the contract and then click "Mint now". This transaction however keeps failing.

The error is:

  1. MetaMask - RPC Error: execution reverted {code: -32000, message: 'execution reverted'}
  2. moralis.js:42068 Uncaught (in promise) Error: cannot estimate gas; transaction may fail or may require manual gas limit (error={"code":-32000,"message":"execution reverted"}, method="estimateGas", transaction={"from":"X","to":"Y","data":"Z","accessList":null}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.5.2) at Logger.makeError (moralis.js:42068:21) at Logger.throwError (moralis.js:42077:20) at checkError (moralis.js:47333:16) at Web3Provider. (moralis.js:47866:47) at step (moralis.js:47255:23) at Object.throw (moralis.js:47236:53) at rejected (moralis.js:47228:65)

My code is:

async function moralisWeb3() {
// Get the EthersJs library
const ethers = Moralis.web3Library;

// Get a (ethers.js) web3Provider
const web3Provider = await Moralis.enableWeb3();

// Enable web3 and get the initialized web3 instance from Web3.js
await Moralis.enableWeb3();
const web3Js = new Web3(Moralis.provider);

// connector
const web3 = await Moralis.enableWeb3();

const options = {
    contractAddress: contractID,
    functionName: "mint",
    abi: ABI,
    params: {
        _mintAmount: "2"
    }
};

const transaction = await Moralis.executeFunction(options);
const receipt = await transaction.wait();
console.log(receipt);
document.getElementById("btn-mint").onclick = moralisWeb3;
}

Can someone help me to build this?

about 4 years ago · Juan Pablo Isaza
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