Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Multicall supports writing function calls? #40

Open
fqlx opened this issue Feb 28, 2022 · 1 comment
Open

Multicall supports writing function calls? #40

fqlx opened this issue Feb 28, 2022 · 1 comment

Comments

@fqlx
Copy link

fqlx commented Feb 28, 2022

In the multicall.sol contract: https://github.com/makerdao/multicall/blob/master/src/Multicall.sol#L7

Aggregate results from multiple read-only function calls

As far as I'm aware, it supports writing to function calls. Is this correct? I believe this comment is wrong where it says read-only?
And it does not support payable or passing msg.value?

@fqlx fqlx changed the title Multicall is supports writing function calls? Multicall supports writing function calls? Feb 28, 2022
@brian-man
Copy link

brian-man commented Mar 4, 2022

Agreed. There needs to be multistaticcall() with view. Right?

On Heco, you can see someone added massGetBalance():

    function massGetBalance(IERC20 _token,address[] memory _addressList) public view returns (returnItem memory tokenInfo,balanceItem[] memory balanceList ){
        tokenInfo.decimals = _token.decimals();
        tokenInfo.symbol = _token.symbol();
        tokenInfo.name = _token.name();
        balanceList = new balanceItem[](_addressList.length);
        for (uint256 i=0;i<_addressList.length;i++) {
            balanceList[i] = balanceItem(_addressList[i],_token.balanceOf(_addressList[i]),_addressList[i].balance,isContract(_addressList[i]));
        }
    }

https://hecoinfo.com/address/0x7991A60f01078c451FD6FdA821459B6585a55994#code

Note the view.

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

No branches or pull requests

3 participants
@fqlx @brian-man and others