ethPM & Etherscan Verified Contracts
Interact with the top 20 erc20 tokens right from your terminal.
tl;dr
> from web3.auto.infura import w3
> w3.pm.set_registry('erc20.snakecharmers.eth')
> dai_pkg = w3.pm.get_package("dai-dai")
> dai = dai_pkg.deployments.get_instance("DSToken")
# Now you can interact with dai like any erc20 tokens.
> dai.functions.totalSupply().call()
78512091351850936215202968Step by Step
Install Python
Create your directory & virtual environment
> mkdir ethpm-tutorial && cd ethpm-tutorial
> python -m venv venv
> export WEB3_INFURA_PROJECT_ID="YOUR_INFURA_API_KEY"
> source venv/bin/activateInstall web3.py & iPython
web3.py Setup
Set the active registry
Grab the Dai package
Grab the Dai contract instance
Play with your Dai!
Generate your own Etherscan verified contract package
Last updated
Was this helpful?