Hello.
I’ve compiled my own geth (from go-ethereum v1.13.5) as described at fhEVM-go Integration
(docs.zama.ai/fhevm-go/getting-started/integration).
The node started successfully, the EncryptedERC20 contract was deployed successfully (I’ve used Zama Hardhat template).
Now I want to connect to the network like this:
const networkUrl = "http://127.0.0.1:8545/";
const provider = new ethers.JsonRpcProvider(networkUrl);
async function createFhevmInstance() {
const network = await provider.getNetwork()
const chainId = network.chainId.toString()
const ret = await provider.call({
// fhe lib address, may need to be changed depending on network
to: "0x000000000000000000000000000000000000005d", // 93 in geth
// first four bytes of keccak256('fhePubKey(bytes1)') + 1 byte for library
data: "0xd9d47bb001",
})
const decoded = ethers.AbiCoder.defaultAbiCoder().decode(["bytes"], ret);
const publicKey = decoded[0];
return createInstance({ chainId: chainId, publicKey: publicKey });
}
And I’ve got an error:
Error: missing revert data (action="call", data=null, reason=null, transaction={ "data": "0xd9d47bb001", "to": "0x000000000000000000000000000000000000005d" }, invocation=null, revert=null, code=CALL_EXCEPTION, version=6.13.2)
at makeError (file:///home/pyro/dev/projects/vitim/swafe/sw_wallet/node_modules/ethers/lib.esm/utils/errors.js:124:21)
at getBuiltinCallException (file:///home/pyro/dev/projects/vitim/swafe/sw_wallet/node_modules/ethers/lib.esm/abi/abi-coder.js:102:12)
at AbiCoder.getBuiltinCallException (file:///home/pyro/dev/projects/vitim/swafe/sw_wallet/node_modules/ethers/lib.esm/abi/abi-coder.js:203:16)
at JsonRpcProvider.getRpcError (file:///home/pyro/dev/projects/vitim/swafe/sw_wallet/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js:672:32)
at file:///home/pyro/dev/projects/vitim/swafe/sw_wallet/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js:298:45
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'CALL_EXCEPTION',
action: 'call',
data: null,
reason: null,
transaction: {
to: '0x000000000000000000000000000000000000005d',
data: '0xd9d47bb001'
},
invocation: null,
revert: null,
shortMessage: 'missing revert data',
info: {
error: { code: -32000, message: 'serialize: no public key available' },
payload: {
method: 'eth_call',
params: [
{
to: '0x000000000000000000000000000000000000005d',
data: '0xd9d47bb001'
},
'latest'
],
id: 3,
jsonrpc: '2.0'
}
}
}
May be I have to change parameters in provider.call?
How do I know the correct value for params.data?