question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multicall - how to encode a function and passing parameters

See original GitHub issue

I am new to this and I really need help on how to make a multicall request. I will appreciate for following helps.

  1. How can I encode a ABI function to send to the parameters to “aggregate” ABI?
  2. How to pass parameters as tuple[]?

Below is multicall ABI in json:

{ "constant": true, "inputs": [ { "components": [ { "name": "target", "type": "address" }, { "name": "callData", "type": "bytes" } ], "name": "calls", "type": "tuple[]" } ], "name": "aggregate", "outputs": [ { "name": "blockNumber", "type": "uint256" }, { "name": "returnData", "type": "bytes[]" } ], "payable": false, "stateMutability": "view", "type": "function" }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
duongvanthaicommented, Dec 13, 2022

Because Calls is array of tuples, and tuple in this representation is array too Tell me please what result you have now

Thank you very much. I got it. 💯

1reaction
6od9icommented, Dec 13, 2022

Because Calls is array of tuples, and tuple in this representation is array too Tell me please what result you have now

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multicall - how to encode a function and passing parameters
Hereunder is my test code to encode the "decimals" ABI of the ERC20 and then pass to the "aggregate" but it is not...
Read more >
Multicall - Uniswap Docs
Call multiple functions in the current contract and return the data from all of them if they all succeed. The msg.value should not...
Read more >
How to do multicall in Solidity with abi.encodeWIthSelector ...
Ok. the RoleMultiCall contract must be granted the TIMELOCK_ADMIN_ROLE role. So in the Hardhat task: ... await timeLockContract.grant( await ...
Read more >
Multi Call | Solidity 0.8 - YouTube
Solidity application example - Aggregate many queries to contracts with a single function call.#Solidity #SmartContract #Ethereum #スマート ...
Read more >
Encoding and Decoding Calldata with eth_abi - Degen Code
The ABI lists, among other things, a full description of the arguments for each function, including their data type and ordering.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found