Hello!
I have next code:
const abi = [
{
“inputs”: [
{
“internalType”: “uint256”,
“name”: “biddingTime”,
“type”: “uint256”
},
{
“internalType”: “uint256”,
“name”: “revealTime”,
“type”: “uint256”
},
{
“internalType”: “address”,
“name”: “token”,
“type”: “address”
}
],
“name”: “newGame”,
“outputs”: [
{
“internalType”: “uint256”,
“name”: “id”,
“type”: “uint256”
}
],
“stateMutability”: “nonpayable”,
“type”: “function”
}
]
const newGame = async () => {
const options = {
contractAddress: contractAddress,
functionName: “newGame”,
abi: abi,
params: {
biddingTime: “1641793392”,
revealTime: “1642225392”,
token: “0xe9e7cea3dedca5984780bafc599bd69add087d56”
},
};
const web3 = await $moralis.enableWeb3();
const exec = await $moralis.executeFunction(options);
console.log(exec);
}
All work well, but there isn’t return value.
Result is (no returned id):
{
“blockHash”: “0x8792fb87a6f202d97e9b55f11682b38a9a0a5e5b5287105ade09cab4b4128118”,
“blockNumber”: 15608278,
“contractAddress”: null,
“cumulativeGasUsed”: 6487709,
“from”: “0x03dd4a084f2b4ba0ccab37639222d1508d2ea5dc”,
“gasUsed”: 113530,
“logsBloom”: “0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000”,
“status”: true,
“to”: “0xd731361f848ee8ed734be1b6baf3b8f3ca127ae0”,
“transactionHash”: “0x92d721348a826fdc022e51f5fa287ec7fcc33f3712712231058d0613d800d62d”,
“transactionIndex”: 8,
“type”: “0x0”,
“events”: {}
}
Can you tell me please, what could be wrong?
BR,
Andrey