Hi, I’m trying to send busd on bsc-testnet by executefunction on Moralis.executeFunction
using template from eth-boilerplate
Contract address’s link here: https://testnet.bscscan.com/address/0xeD24FC36d5Ee211Ea25A80239Fb8C4Cfd80f12Ee#code
import { useMoralis } from "react-moralis";
import { useState } from "react";
import { notification } from "antd";
const abi = [
{
"anonymous": false, "inputs": [{ "name": "_to", "type": "address" }, { "name": "_value", "type": "uint256" }], "name": "transfer",
"type": "event"
}
]
export default function BUSDTest() {
const { Moralis } = useMoralis();
const [responses, setResponses] = useState({});
const options = {
abi: abi,
contractAddress: "0xeD24FC36d5Ee211Ea25A80239Fb8C4Cfd80f12Ee",
functionName: "transfer",
params: {
_to: "0x44dCF968b595768C7f8C5486899790C44d809F50",
_value: 1
},
}
const openNotification = ({ message, description }) => {
notification.open({
placement: "bottomRight",
message,
description,
});
};
return (<div>
<button onClick={async () => {
const tx = await Moralis.executeFunction({ awaitReceipt: false, ...options });
tx.on("receipt", (receipt) => {
setResponses({ ...responses, "name": { result: null, isLoading: false } });
openNotification({
message: "📃 New Receipt",
description: `${receipt.transactionHash}`,
});
console.log("🔊 New Receipt: ", receipt);
})
}}>Send 1 BUSD</button>
</div>)
}
I got an error
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘apply’)
after click the button
what is it? I don’t know how to fix this.