Hello, new to Moralis. I followed the tutorial, creating my basic html file and moralis js file with functions. Trying to interact with the mint function from my token contract. I can login and out of Metamask but when I hit the send button I get this error message.
js code:
`// connect to Moralis server
const serverUrl = âhttps://pbblhhajgpzo.usemoralis.com:2053/serverâ;
const appId = âWbj56pqggKjgxMscXtwspYjJpO1JBBdLznoacFvOâ;
Moralis.start({ serverUrl, appId });
// LOG IN WITH METAMASK
async function login() {
let user = Moralis.User.current();
if (!user) {
try {
user = await Moralis.authenticate({ signingMessage: âAuthenticateâ })
await Moralis.enableWeb3();
console.log(user)
console.log(user.get(âethAddressâ))
} catch (error) {
console.log(error)
}
}
}
async function logOut() {
await Moralis.User.logOut();
console.log(âlogged outâ);
}
async function mint() {
const web3 = await Moralis.enable();
let options = {
contractAddress: â0x0x6634c175D94696ff0067B57551A87A1a3419449fdb7fAB4d8114a439Ccc0c4eCE68bf1DaED3B7b04â,
functionName: âmintâ,
abi:[
{
âconstantâ: false,
âinputsâ: [
{
âinternalTypeâ: âuint256â,
ânameâ: âamountâ,
âtypeâ: âuint256â
}
],
ânameâ: âmintâ,
âoutputsâ: [
{
âinternalTypeâ: âboolâ,
ânameâ: ââ,
âtypeâ: âboolâ
}
],
âpayableâ: false,
âstateMutabilityâ: ânonpayableâ,
âtypeâ: âfunctionâ
},
],
params: {
amount:""
},
};
await Moralis.executeFunction(options);
}
// bind button click handlers
document.getElementById(âbtn-loginâ).onclick = login;
document.getElementById(âbtn-logoutâ).onclick = logOut;
document.getElementById(âbtn-mintâ).onclick = mint;
``
Mint Tokens
<button type ="button" class="btn btn-primary" id="btn-login">Connect Wallet</button>
<button type ="button" class="btn btn-danger" id="btn-logout">Logout</button>
<br>
<br>
<button type ="button" class="btn btn-success" id=âbtn-sendâ>Mint</button>
<script type="text/javascript" src="./main.js"></script>
```