Giter VIP home page Giter VIP logo

multicall's Introduction

DEPRECATED

This repository is no longer maintained. An active fork can be found at https://github.com/mds1/multicall. Note that this is an external repository not maintained by any entity funded or directed by MakerDAO governance.

Multicall Multicall

Multicall aggregates results from multiple contract constant function calls.

This reduces the number of separate JSON RPC requests that need to be sent (especially useful if using remote nodes like Infura), while also providing the guarantee that all values returned are from the same block (like an atomic read) and returning the block number the values are from (giving them important context so that results from old blocks can be ignored if they're from an out-of-date node).

This smart contract is intended to be used with Multicall.js in front-end dapps.

Multicall Contract Addresses

Chain Address
Mainnet 0xeefba1e63905ef1d7acba5a8513c70307c1ce441
Kovan 0x2cc8688c5f75e365aaeeb4ea8d6a480405a48d2a
Rinkeby 0x42ad527de7d4e9d9d011ac45b31d8551f8fe9821
Görli 0x77dca2c955b15e9de4dbbcf1246b4b85b651e50e
Ropsten 0x53c43764255c17bd724f74c4ef150724ac50a3ed
xDai 0xb5b692a88bdfc81ca69dcb1d924f59f0413a602a
Polygon 0x11ce4B23bD875D7F5C6a31084f55fDe1e9A87507
Mumbai 0x08411ADd0b5AA8ee47563b146743C13b3556c9Cc

Multicall2 Contract Addresses

Multicall2 is the same as Multicall, but provides addition functions that allow calls within the batch to fail. Useful for situations where a call may fail depending on the state of the contract.

Chain Address
Mainnet 0x5ba1e12693dc8f9c48aad8770482f4739beed696
Kovan 0x5ba1e12693dc8f9c48aad8770482f4739beed696
Rinkeby 0x5ba1e12693dc8f9c48aad8770482f4739beed696
Görli 0x5ba1e12693dc8f9c48aad8770482f4739beed696
Ropsten 0x5ba1e12693dc8f9c48aad8770482f4739beed696

Third-Party Deployments

The following addresses have been submitted by external contributors and have not been vetted by Multicall maintainers.

Chain Address
RSK Mainnet 0x6c62bf5440de2cb157205b15c424bceb5c3368f5
RSK Testnet 0x9e469e1fc7fb4c5d17897b68eaf1afc9df39f103
BSC Mainnet 0x41263cba59eb80dc200f3e2544eda4ed6a90e76c
BSC Testnet 0xae11C5B5f29A6a25e955F0CB8ddCc416f522AF5C

multicall's People

Contributors

ethanbennett avatar gbalabasquer avatar jfrankfurt avatar jparklev avatar levity avatar maraoz avatar mds1 avatar michaelelliot avatar moodysalem avatar willpote avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

multicall's Issues

Polygon Testnet (Mumbai) block number lags behind provider current block number.

Hello,
I am using the multicall contract on Mumbai with address: 0x08411ADd0b5AA8ee47563b146743C13b3556c9Cc
When calling the method aggregate the block number returned in the result sometimes is not the current block number and I have to make multiple more calls, so the result in the contract to be for the current block.
The current block is taken from the web3 provider.
How can I optimise it ?

Thank you.

deploy to matic

Hello! I'm interested in using multicall on matic (mainnet and mumbai). I don't see any deploy instructions or else I would just open a PR with the deployment.

HELP - Failed to fetch multicall chunk

Hi,
I have written an installer that allows Uniswap to be deployed on any Ethereum compatible blockchain.

It works great except for one error line 190 in Uniswap's multicall/updater file

Failed to fetch multicall chunk 
0:
address: "0x1dBED22153ccbd80199D7477A606705463dE1CD8"
callData: "0x4d2301cc000000000000000000000000987652e1c2b3b953354a43171063499dce16dc8f"
1:
address: "0x3ddb118094cAe8407993750a39E10A83DEA0F3eD"
callData: "0x0178b8bf3b868d39384389b1a67e1519e1c2a74478fdecf09c083a1e25730fda5a48241d"

I would love some assistance with this, I am unsure why it does not work. As you will see in my installer I have diligently deployed all of the contracts and have provided significant config.

Any information/assistance would be greatly appreciated.

Many thanks
Tim

Added HECO Testnet + Mainnet Deployments

HECO Testnet (chainid 256): 0x14ED652dF3A270904f16Add0780F7A9d6a68dE52
HECO Mainnet (chainid 128): 0x41C0A3059De6bE4f1913630db94d93aB5a2904B4

If anyone cares. =)

Is withSigner required when calling aggregate method?

When I call the “aggregate” function to query the balance of a token, it always prompts “sending a transaction requires a signer (operation="sendTransaction", code=UNSUPPORTED_OPERATION, version=contracts/5.4.0)”.

Any one help? Thanks!

stackoverflow problem

function poll() {
this.state.handler = setTimeout(async () => {
poll.call({

this can be stackoverflow?

Can not call the function Aggregate - Multicall2.sol on BSC testnet

Hello there,

I already deployed the multicall2.sol smart contract on BSC Testnet
https://testnet.bscscan.com/address/0x8F3273Fb89B075b1645095ABaC6ed17B2d4Bc576#code
then call the contract by using the following typescript code:

  try {
    const multi = getMulticallContract(options.web3 || web3NoAccount)
    const itf = new Interface(abi)

    const calldata = calls.map((call) => [call.address.toLowerCase(), itf.encodeFunctionData(call.name, call.params)])
    const { returnData } = await multi.methods.aggregate(calldata).call(undefined, options.blockNumber)
    const res = returnData.map((call, i) => itf.decodeFunctionResult(calls[i].name, call))

    return res
  } catch (error) {
    throw new Error(error)
  }
}

I got the error

Uncaught (in promise) Error: Error: Returned error: execution reverted: Multicall aggregate: call failed

It's weird. Because the function works properly on Mainnet. Can anyone help me?

More networks .. anyone with the coins?

I know we are are all lost in the multi-chain of madness , rather multi-chain muticall of madness , we need any help we can get. anyone with the coins please do the needful and deploy.

IOTEX_TESTNET: 4690,
SOLANA: 245022934,
SOLANA_DEVNET: 245022926,
KAVA: 2222,
KAVA_TESTNET: 2221,
SYSCOIN: 57,
SYSCOIN_TESTNET: 5700,
HOO: 70,
TELOS: 40,
TELOS_TESTNET: 41,``

Big batch gets timeout

Hello I'm using this contracts to query the reserves for all pairs in automated market makers.
This pairs are very big in ethereum chain(≈60000) and it makes the contract give a timeout message. I just divide the calls in smaller batches but it becomes infeasible in binance smart chain where the pairs are 10 times greater and it would take a lot of time.

How can i make larger batches?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.