Coder Social home page Coder Social logo

mds1 / multicall Goto Github PK

View Code? Open in Web Editor NEW

This project forked from makerdao/multicall

896.0 6.0 149.0 443 KB

Multicall: Aggregate multiple constant function call results into one

Home Page: https://multicall3.com

License: MIT License

Solidity 100.00%

multicall's Issues

`estimateGas` using `gasleft()`

Would it be possible to add another utility function equivalent to do multiple eth_estimateGas with some gasleft() magic ✨

Guess its too hard to get it right

Deployment of MulticallV3 to Boba, Cronos, Aurora, Astar, Metis

Hi there, I'm Jacky from Ape Board!

Ape Board is heavily using Multicall and really love the improvements on MulticallV3!

Do you by any chance have some time to deploy it on Boba, Cronos, Aurora, Astar and Metis?

I saw that the deployment gas used was around 872,776 (rounded up to 900,000),
So I've sent along some deployment costs to 0x05f32B3cC3888453ff71B01135B34FF8e41263F2 on these chains.

Chain Funds sent Transaction
BOBA 0.0009 ETH https://blockexplorer.boba.network/tx/0xc3242...09a696
CRONOS 4.5 CRO https://cronos.org/explorer/tx/0x193fd...72e92b
AURORA 0.000027 ETH https://aurorascan.dev/tx/0x0af59...1ac04e
ASTAR 0.0009 ASTR https://blockscout.com/astar/tx/0xe2d31...cbff25
METIS 0.0072 METIS https://andromeda-explorer.metis.io/tx/0x18149...fdb4e8

Please let me know if the funds are not enough, so I could send more!

Deployment of MulticallV3 to Fuse Network

https://fuse.io is a low-cost EVM chain that we at Beefy Finance have contracts deployed on, and would like to take advantage of the static address.

I've funded the 0x05f32B3cC3888453ff71B01135B34FF8e41263F2 address with 1 FUSE, which should be more than enough to deploy the MulticallV3 contract. Chain ID 122

Thank you!

Restrictive pragma makes it difficult to use this repository

Unless I am misunderstanding how I should this, I think that the current pragma is unnecessarily restrictive by being locked to 0.8.12. I am getting this compiler error in my project, which uses v0.8.17:

Compiler run failed
error[5333]: ParserError: Source file requires different compiler version (current compiler is 0.8.17+commit.8df45f5f.Darwin.appleclang) - note that nightly builds are considered to be strictly less than the released version
 --> lib/multicall/src/Multicall3.sol:2:1:
  |
2 | pragma solidity 0.8.12;
  | ^^^

Is there any specific reason for locking in the pragma to v0.8.12 and not writing it like this?

pragma solidity >=0.8.12 <0.9.0;

It also happens that this is a version that contains an important bug related to abi.encodeCall, which is highly relevant in the context of Multicall.

Query: why are all aggregate functions `payable`?

Hi,

I'm new to multicall functions, and trying to use it with my own project in Next.js & ethers.js.

With stateMutability as payable, I got a transaction object as result of calling aggregate functions.
If I want to get the results data, they only way I found is to modify the aggregate function's stateMutability to view in the ABI file.

May I know why these functions are set as payable in the first place?
I guess users wants the results data more?

OR, did I use it the wrong way?
If so, what is the correct way for calling aggregate functions with stateMutability as payable?

Thanks in advance.

Deployment of Multicall3 to additional networks

Hey guys, great work with Multicall3! I am currently integrating the contracts with our DefiYield app, moving from v2 to v3. All is great, however, we are missing a few networks. Those are:

OKC: https://www.oklink.com/en/okc
Klaytn: https://scope.klaytn.com/
Milkomeda: https://explorer-mainnet-cardano-evm.c1.milkomeda.com/
KCC: https://explorer.kcc.io/
AURORA https://aurorascan.dev/

Can you guys please deploy on these networks? We will be happy to send funds to cover the deployment cost.

Disclose possible attack vector with 'Payable' Multicall usage

I am working on setting up a way of receiving security advisories for contracts / protocol exploits through our DeFi Threat Matrix repo. Part of this was creating an example advisory through GitHub's security options.

In doing some preliminary research for finding a potential security issue with contracts, I came across this issue raised originally in the Uniswap V3 repo concerning the usage of msg.value with having payable

This is present when Multicall is used on any contract which reads the value of msg.value. Multicall is a pattern to call several contract endpoints in one transaction, using delegatecall. A contract endpoint may implicitly assume that it is called in a single transaction, by looking at msg.value. Since the value is defined per transaction, calling the same endpoint twice in one multicall means that the same msg.value may be read several times, even though the value was only transferred once.

Adding additional documentation concerning this issue is my suggestion, I looked at the contract's and did not find any disclaimer, I do not know how you would like to document it, etc. Perhaps a @custom:natspec like :disclaimer or :advisory, all up to you.

The draft reference advisory can be found below:

GHSA-hf8w-qgj8-v7h3

cheers

feature request - get code multi

Hi, thank you for the development of multicall3, it is very useful.

I have a request for a feature that can further reduce node calls. Rather than hitting the eth rpc method eth_getCode, we can instead implement a getCodeMulti method, something like the below:

    struct ReturnCode {
         address addr;
         bytes code;
     } 

    function getCodeMulti(address[] calldata addresses) public payable returns (ReturnCode[] memory returnContracts) {
         uint256 length = addresses.length;
         returnContracts = new ReturnCode[](length);
         address addr;
         for (uint256 i=0; i < length;) {
             addr = addresses[i];
             returnContracts[i] = ReturnCode(addr, addr.code);
             unchecked {++ i;}
         }
     }

This function would allow for users to get bytecode from multiple contract addresses with only one rpc call. This may be out of scope for this project as it would require redeployment accross all networks, but happy to open a PR or contribute where I can if this feature seems like something worth adding.

Deploy to Optimism Göerli

Hi, awesome contract!

From Optimism docs:

Deprecation notice
We are transitioning our test network to Goerli. We expect Optimistic Kovan to exist until August 15th, 2022.

Could you please deploy it to Optimism Göerli? Thank you!

Make this an ERC (or have I missed it?)

Multicall is let's say, "Awesome" and solves many problems for all users, it will be ideal if it is more widely known. Have you thought about creating an ERC? Or have I missed it?

Feat: provide machine readable deployments file

Providing a json file may be useful, as I am using this for an EIP

Perhaps using the chains canonical ChainId as an identifier would be more appropriate (as then you could use get_chainId from the contract to test against the address mapped to the chain_id prefix

e.g.:

[
  {
    "Network": "Address",
    "Mainnet": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Kovan": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Rinkeby": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Görli": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Ropsten": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Sepolia": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Optimism": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Optimism Kovan": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Arbitrum": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Arbitrum Rinkeby": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Polygon": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Mumbai": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Gnosis Chain (xDai)": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Avalanche": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Avalanche Fuji": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Fantom Testnet": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Fantom Opera": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "BNB Smart Chain": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "BNB Smart Chain Testnet": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Moonbeam": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Moonriver": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Moonbase Alpha Testnet": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Harmony": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Cronos": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Fuse": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Songbird Canary Network": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Coston Testnet": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Boba": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Aurora": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Astar": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "OKC": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Heco Chain": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Metis": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "RSK": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "RSK Testnet": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Evmos": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Evmos Testnet": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Thundercore": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Thundercore Testnet": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Oasis": "0xcA11bde05977b3631167028862bE2a173976CA11",
    "Celo": "0xcA11bde05977b3631167028862bE2a173976CA11"
  }
]

Mantle Testnet

Can you please deploy multicallv3 on mantle testnet

I already sent 50 BIT as funds to 0x05f32B3cC3888453ff71B01135B34FF8e41263F2 address

Revert reason

Hey @mds1! Is it possible to get the revert reason from the individual calls if any fail? I'm playing around with ethers.js callStatic to pull out the info but the best I can get so far is which call failed, but not why it failed.

Examples in the README

Hey Matt, thanks for building this. I just started playing with it today, and it's awesome.

I was wondering if you know of any good example repositories that could be included in the README? I think that it would be helpful to provide some - for instance, a repo that uses multicall to query the token balances of multiple addresses is probably a common use case.

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.