Skip to content

Does the repository support ethers ^6.6.0 #60

@xuht724

Description

@xuht724

I am using

const { Multicall } = require("ethereum-multicall");
const poolABI = require('./utils/uniswapPairV2ABI.json');
const { ethers } = require("ethers");
const { wsURL } = require("./config.js");
const { Web3 } = require("web3");

const rpcURL = "My RPC URL";
// const web3 = new Web3(rpcURL);
const calls = [
    { methodName: 'token0', methodParameters: [] },
    { methodName: 'token1', methodParameters: [] },
    { methodName: 'factory', methodParameters: [] }
];

// A pair address
const contractAddress = "0xB6909B960DbbE7392D405429eB2b3649752b4838";

const callObject = {
    reference: "result0",
    contractAddress: contractAddress,
    abi: poolABI,
    calls: calls
};

const provider = new ethers.JsonRpcProvider(rpcURL);
console.log(provider);

const myMulticall = new Multicall({
    ethersProvider: provider,
    tryAggregate: true,
});
async function getResult() {
    let resp = await myMulticall.call(callObject);
    console.log(resp.results.result0.callsReturnContext);

}
getResult();

It throws out the error
Error: invalid signer or provider (argument="signerOrProvider", value={}, code=INVALID_ARGUMENT, version=contracts/5.7.0)

The ethers version is 6.6.1. I want to ask if the error is caused by the version conflict.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions