Closed Muhammad-Altabba closed 2 months ago
It turns out only registered facets functions of a diamonds proxy would be callable. And getName
is not available in the proxy contract. So, no issues with web3.js.
Calling methods in a diamonds proxy contract works well and here is an example:
it('using diamonds proxy contract', async () => {
const web3 = new Web3('https://eth-sepolia.g.alchemy.com/v2/VCOFgnRGJF_vdAY2ZjgSksL6-6pYvRkz');
const contract = new Contract(ABI, '0x9A6DE0f62Aa270A8bCB1e2610078650D539B1Ef9', web3);
const l2TransactionBaseCost = await contract.methods
.l2TransactionBaseCost(BigInt(18556727650), BigInt(14414298), 800)
.call();
expect(l2TransactionBaseCost).toBeGreaterThan(BigInt(0));
});
However, the error parsing in web3.js would better to be able to handle Error(string)
and Panic(uint256)
. So, an MR will be opened for this.
description
There is an issue specifically with diamonds proxy contract. Probably some or all other proxy contracts work. When calling the proxy contract address an error is throw:
Note: As shown above the
Cause:
is empty and no text after it.The diamonds proxy standard is defined in the EIP 2535: https://eips.ethereum.org/EIPS/eip-2535
Fixing this is needed for the zkSync plugin. Kindly check: https://github.com/ChainSafe/web3-plugin-zksync/commit/37b161514ce78b8b7f4f230a82ee2d09f409626c
Steps to reproduce the behavior