is not a function [SOLVED]

Supp guys… When click to mint returns is not a function. My contractAbi is the problem? How can I solve this, pls

it could be the abi if the abi doesn’t have that mint function

i just copy contractAbi from remix. My abi is not valid? Maybe could be a wrong config?

This is my mint function

async function mint() {
    let tokenId = parseInt(document.getElementById("token_id_input").value);
    let address = document.getElementById("address_input").value
    let amount = parseInt(document.getElementById("amount_input").value)
    const accounts = await web3.eth.getAccounts();
    const contract = new web3.eth.Contract(contractAbi, CONTRACT_ADDRESS);, tokenId, amount).send({from: accounts[0], value: 0})
    .on("receipt", function(receipt){
        alert("Mint done")

that contractAbi could be a problem, depending what you have there

This is my abi.js. The mint function exists…

It looks like it has too many [ at the beginning

if you click on the original file, its okay, without many [

ABI has only one [ ]. Just remove one pair of [ ]

Solved… my bad!! I didn’t pay attention to it.

1 Like