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

Multicall3 (work in progress) #1468

Open
wants to merge 66 commits into
base: master
Choose a base branch
from

Conversation

BlinkyStitt
Copy link
Collaborator

@BlinkyStitt BlinkyStitt commented Mar 12, 2022

What I did

Make Multicall a bit more robust and added support for Multicall3

How I did it

Modified multicall.py

How to verify it

Use the multicall helper on any chain and any block.

Checklist

  • use state overrides if possible
  • split call up if unable to use multicall
  • deploy with singleton deployer if it doesn't exist
  • check for deployment by singleton deployer
  • switch to using multicall3
  • I have confirmed that my PR passes all linting checks
  • I have included test cases
  • I have updated the documentation
  • I have added an entry to the changelog

If we copy instead of deepcopy, then when the network name is overwritten with the RPC url, later calls do not set "explorer" or "chain_id" (since line 87 is looking for names and not RPCs).

Without this change, the `active_network` config is missing: `, 'chainid': '1', 'explorer': 'https://api.etherscan.io/api'}`

```
>>> print(CONFIG.active_network)
{'name': 'Hardhat (Mainnet Fork)', 'id': 'hardhat-fork', 'cmd': 'npx hardhat node', 'host': 'http://127.0.0.1', 'multicall2': '0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696', 'cmd_settings': {'port': 8545, 'fork': 'https://turbo-eth.stytt.com/', 'chain_id': 1}, 'settings': {'gas_limit': 'max', 'gas_buffer': 1, 'gas_price': 0, 'max_fee': None, 'priority_fee': None, 'reverting_tx_gas_limit': 'max', 'default_contract_owner': True, 'cmd_settings': None}, 'chainid': '1', 'explorer': 'https://api.etherscan.io/api'}

>>> network.disconnect()
Terminating local RPC client...

>>> network.connect("hardhat-fork")
Launching 'npx hardhat node --port 8545 --fork https://turbo-eth.stytt.com/'...

>>> print(CONFIG.active_network)
{'name': 'Hardhat (Mainnet Fork)', 'id': 'hardhat-fork', 'cmd': 'npx hardhat node', 'host': 'http://127.0.0.1', 'multicall2': '0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696', 'cmd_settings': {'port': 8545, 'fork': 'https://turbo-eth.stytt.com/', 'chain_id': 1}, 'settings': {'gas_limit': 'max', 'gas_buffer': 1, 'gas_price': 0, 'max_fee': None, 'priority_fee': None, 'reverting_tx_gas_limit': 'max', 'default_contract_owner': True, 'cmd_settings': None}, 'chainid': '1', 'explorer': 'https://api.etherscan.io/api'}
```
@BlinkyStitt
Copy link
Collaborator Author

BlinkyStitt commented Mar 12, 2022

this has patch-3 and a fix for Contract.init merged into it because I need those fixes to test my script that uses this code. We can merge them all separately if you'd prefer.

Copy link

@VersoriumX VersoriumX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VersoriumX

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VersoriumX

Copy link

@VersoriumX VersoriumX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VersoriumX

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

Successfully merging this pull request may close these issues.

None yet

2 participants