I am getting this error in runtime when using usePrepareContractWrite my code is as follows from the wagmi documentation:
const { config } = usePrepareContractWrite({
address: "0x07a06AD39f......................"
abi: [{ "inputs": [
{
"internalType": "address",
"name": "operator",
"type": "address"
},
{
"internalType": "bool",
"name": "approved",
"type": "bool"
}
],
"name": "setApprovalForAll",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}],
functionName: 'setApprovalForAll',
});
const { data, write } = useContractWrite(config)
const { isLoading, isSuccess }= useWaitForTransaction({
confirmations: 1,
hash: data?.hash,
onSuccess() {
console.log("transaction success");
}
});
const getPermission = async () => {
-> write({
args: ["0xaD1beE8B47464…………………………..", true],
from: address,
});
}