Skip to content

Ethereum Name Service (ENS) converter plugin for the Ape Framework


Notifications You must be signed in to change notification settings


Repository files navigation

Quick Start

Ape plugin for ENS argument conversion and contracts



via pip

You can install the latest release via pip:

pip install ape-ens

via setuptools

You can clone the repository and use setuptools for the most up-to-date version:

git clone
cd ape-ens
python3 install

Quick Usage

The ENS plugin requires a mainnet connection to resolve ENS names because ENS contracts are only deployed to mainnet. Thus, the first thing you should do is ensure you have configured a mainnet provider. For example, if you use infura or alchemy, install the associated plugin:

ape plugins install infura

Afterwards, you should see it in the output of the list command:

$ ape plugins list

Installed Plugins:
  infura      0.4.0

After your provider plugin of choice is installed, configure it to be your default mainnet provider in your ape-config.yaml file:

    default_provider: infura

Finally, you can start the ape console using any network of your choice:

ape console --network :rinkeby:infura

Then, convert an ens domain to an AddressType:

In [1]: from ape.types import AddressType
In [2]: convert("vitalik.eth", AddressType)
Out[2]: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'

Get the Ethereum Name Service (ENS) namehash using the namehash function:

from ape_ens.utils import namehash
# or
# from ape_ens.utils.namehash import namehash
>> namehash("eth").hex()

>> namehash("foo.eth")

>> namehash("").hex()

The ENS plugin temporarily connects to mainnet, caches the address resolution, and then your original network uses the result.