Moralis.executeFunction (Authentication Failed)

Hey,

Need some assistance please…

Using Walletconnect everything goes well until after the signing when the following error occurs

I/chromium: [INFO:CONSOLE(6931)] “Uncaught Error: Authentication failed”, source: https://unpkg.com/moralis/dist/moralis.js (6931)

What is missing?

const options = {
contractAddress: ‘0xB1Bcf905495AFf06e854904d7b2d6647ab00Cd1d’,
functionName: ‘mintToken’,
chain: ‘eth’,
abi: abi,
awaitReceipt: false,
params: {
recipient: wallet_address,
tokenURI: nft,
},
};

const tx = await Moralis.executeFunction(options);

tx.on(“transactionHash”, (hash) => { console.log(“transaction”+hash) })
.on(“receipt”, (receipt) => { console.log(“receipt”+receipt) })
.on(“confirmation”, (confirmationNumber, receipt) => { console.log(“confirmation”+confirmationNumber+"-"+receipt)})
.on(“error”, (error) => { console.log(“ERROR:”+error) });

So are you connecting to the wallet or executing transaction? also in Moralis.executeFunction you don’t need to specify the chain just make sure your wallet is connected to the right chain

Hey YosephKS,

Thank you for your reply,

The wallet is connected and the contract approved.
It is after the approval that we get the error from tx.

Do you have the transaction hash that failed? and which chain is it so I can take a look

Hey,

The contract address is 0xB1Bcf905495AFf06e854904d7b2d6647ab00Cd1d (Rariable)

Not receiving the transaction hash from tx only the error is triggered.

This happens after we confirm the transaction (Rinkeby testnet)

Hmmm based on the contract you gave me, I seem unable to find the mintToken function here

Sorry we made an error :upside_down_face:

Thank you for shedding some light. We understand things better now as we are new to this.

Thanks again.

2 Likes