Skip to main content

Python 3 interface Mutlicall3 smart contract

Project description

multicall3

Python 3 interface for Multicall3.

Usage

w3 = AsyncWeb3(AsyncHTTPProvider("https://ethereum.publicnode.com"))

multicall3 = Multicall3(w3=w3)
contract = w3.eth.contract(
    address=Web3.to_checksum_address(USDC),
    abi=ERC20_ABI,
)

results = await multicall3.aggregate3(
    contract.functions.name(),
    contract.functions.symbol(),
    contract.functions.decimals(),
)
assert results[0] == "USD Coin"
assert results[1] == "USDC"
assert results[2] == 6

Contributing

Install pdm using pipx:

pipx install pdm --python $(which python)

Install dependencies:

pdm install

Activate the virtualenv:

$(pdm venv activate)

Run the test:

pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

multicall3-0.1.0.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

multicall3-0.1.0-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page