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)
Built Distribution
Close
Hashes for multicall3-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc28a0325520527b24b1772e4be2da7be4793a9a1800ad25d8c9d8f1d367ae94 |
|
MD5 | b799533bdcfa01335ab546e53bcc6170 |
|
BLAKE2b-256 | c3935f8d7cd8ffb6be8ae897e20246779b817a543c36410192ddb1890954f855 |