Hi, I’m trying to execute a write function on my contract here’s my code and the ABI but I’m getting an error:
cannot estimate gas; transaction may fail or may require manual gas limit
const handleOk = async () => {
//setConfirmLoading(true);
let options = {
chain: "rinkeby",
contractAddress: props.contractAddress,
functionName: "setPriceForAll",
abi: props.abi,
params : {
_priceList : [0],
_id : [0]
}
}
try {
let tx = await Moralis.executeFunction(options)
.then(() => {
console.log(tx);
setShowModal(false);
})
} catch (error) {
console.log(error.message);
}
}
my abi function
"inputs": [
{
"internalType": "uint256[]",
"name": "_priceList",
"type": "uint256[]"
},
{
"internalType": "uint256[]",
"name": "_id",
"type": "uint256[]"
}
],
"name": "setPriceForAll",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
my props.address is not null, my function works correctly in remix (in other words my smart contract is working) and the error occur when calling the function with Moralis.