Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does the repository support ethers ^6.6.0 #60

Open
xuht724 opened this issue Jun 25, 2023 · 6 comments
Open

Does the repository support ethers ^6.6.0 #60

xuht724 opened this issue Jun 25, 2023 · 6 comments

Comments

@xuht724
Copy link

xuht724 commented Jun 25, 2023

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.

@joshstevens19
Copy link
Owner

most likely will take a look this week

@odlainepre
Copy link

Right now only use "nodeUrl" with ethers ^6.6.0:

const multicall = new Multicall({ nodeUrl: REST_RPC.POLYGON, tryAggregate: true, })

@joshstevens19
Copy link
Owner

oops let this one slip i guess ethers ^6.6.0 did some breaking changes will add to my list and support thanks for the code above

@bradens
Copy link

bradens commented Nov 21, 2023

Would really like to see this as well. Is anyone actively working on this?

@joshstevens19
Copy link
Owner

no but its pretty easy change PR welcome we can keep support for old one as well as you pass in the instance we can just add support for ethers 6 @bradens

@bradens
Copy link

bradens commented Nov 27, 2023

no but its pretty easy change PR welcome we can keep support for old one as well as you pass in the instance we can just add support for ethers 6 @bradens

Got a PR up for you here: #72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants