Closed bytes0xcr6 closed 4 months ago
Because the initcode does not match Ethereum mainnet's multicall3 initcode and the RedBelly testnet explorer does not provide source code verification, I cannot add this deployment to the configuration for safety reasons
However, starting from 6.4.0, you can now write to configuration constants and add your own programmatically:
multicall3ChainAddress[153] = "0x9f75981388Bed36E6D4fBE402Effb1f42e120f43";
multicall3DeploymentBlockNumbers[153] = 19_896;
Thanks for the reply @Rubilmax
I have updated the version to "6.4.0" but I am getting an error when running the next script. Any idea? The error is due to "bind" being undefined, but it looks to be something from the "ethers-multicall-provider" package, as I don´t use "bind" anywhere in the code.
c:\Users\elric\dev\3a-protocol-api\node_modules\ethers-multicall-provider\lib\multicall-provider.js:128
const _perform = provider._perform.bind(provider);
^
TypeError: Cannot read properties of undefined (reading 'bind')
at MulticallWrapper.wrap (c:\Users\elric\dev\3a-protocol-api\node_modules\ethers-multicall-provider\lib\multicall-provider.js:128:44)
at getChainData (c:\Users\elric\dev\3a-protocol-api\utils\get_chain_data.js:21:46)
at Object.
Node.js v20.13.1
- Script:
```Javascript
const ethers = require('ethers');
const {
MulticallWrapper,
multicall3ChainAddress,
multicall3DeploymentBlockNumbers
} = require('ethers-multicall-provider');
require('dotenv').config();
async function getChainData(chain = process.env.CHAIN) {
// Adding new chain and multicall3 contract
multicall3ChainAddress[153] = "0x9f75981388Bed36E6D4fBE402Effb1f42e120f43";
multicall3DeploymentBlockNumbers[153] = 19896;
const provider = new ethers.providers.JsonRpcProvider("https: //governors.testnet.redbelly.network");
const multiCallProvider = MulticallWrapper.wrap(provider);
return {
provider,
jsonData,
multiCallProvider
};
}
module.exports = getChainData;
What version were you using before upgrading? What version of ethers are you using?
The problem was the ethers version.
Solved! Thanks for your help @Rubilmax
Hi!
RedBelly just launched their testnet and I have deployed the MULTICALL3 contract under the next address: 0x9f75981388Bed36E6D4fBE402Effb1f42e120f43
Is there any chance you could add it to the available chains? Please.