From 305b3c30812f516dce33537ec054a9c6c64a3603 Mon Sep 17 00:00:00 2001 From: Stuart Reed Date: Thu, 6 Jul 2023 12:31:10 -0600 Subject: [PATCH] Replace jasoncarver.eth with ens.eth (#3022) * Replace jasoncarver.eth with ens.eth * Set proper current address for ens.eth * Revert non-ens docs * Update bytes representation of address --- docs/ens_overview.rst | 36 ++++++++++++++++++------------------ newsfragments/3020.docs.rst | 1 + 2 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 newsfragments/3020.docs.rst diff --git a/docs/ens_overview.rst b/docs/ens_overview.rst index 654260b415..77db889dbf 100644 --- a/docs/ens_overview.rst +++ b/docs/ens_overview.rst @@ -188,8 +188,8 @@ Get the Address for an ENS Name .. code-block:: python from ens.auto import ns - eth_address = ns.address('jasoncarver.eth') - assert eth_address == '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD' + eth_address = ns.address('ens.eth') + assert eth_address == '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7' The ``ENS`` module has no opinion as to which TLD you can use, but will not infer a TLD if it is not provided with the name. @@ -199,13 +199,13 @@ Get the ENS Name for an Address .. code-block:: python - domain = ns.name('0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD') + domain = ns.name('0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7') # name() also accepts the bytes version of the address - assert ns.name(b'[ c$o!\x91\xf1\x8f&u\xce\xdb\x8b(\x10.\x95tX') == domain + assert ns.name(b'\xfe\x89\xccz\xbb,A\x83h:\xb7\x16S\xc4\xcd\xc9\xb0-D\xb7') == domain # confirm that the name resolves back to the address that you looked up: - assert ns.address(domain) == '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD' + assert ns.address(domain) == '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7' .. note:: For accuracy, and as a recommendation from the ENS documentation on `reverse resolution `_, @@ -233,24 +233,24 @@ you must already be the owner of the domain (or its parent). .. code-block:: python - ns.setup_address('jasoncarver.eth', '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD') + ns.setup_address('ens.eth', '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7') In the common case where you want to point the name to the owning address, you can skip the address. .. code-block:: python - ns.setup_address('jasoncarver.eth') + ns.setup_address('ens.eth') You can claim arbitrarily deep subdomains. .. code-block:: python - ns.setup_address('supreme.executive.power.derives.from.a.mandate.from.the.masses.jasoncarver.eth') + ns.setup_address('supreme.executive.power.derives.from.a.mandate.from.the.masses.ens.eth') # wait for the transaction to be mined, then: assert ( - ns.address('supreme.executive.power.derives.from.a.mandate.from.the.masses.jasoncarver.eth') - == '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD' + ns.address('supreme.executive.power.derives.from.a.mandate.from.the.masses.ens.eth') + == '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7' ) .. warning:: Gas costs scale up with the number of subdomains! @@ -265,14 +265,14 @@ this is referred to as "reverse" resolution. The ENS Reverse Resolver is used fo .. code-block:: python - ns.setup_name('jasoncarver.eth', '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD') + ns.setup_name('ens.eth', '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7') If you don't supply the address, :meth:`~ens.ENS.setup_name` will assume you want the address returned by :meth:`~ens.ENS.address`. .. code-block:: python - ns.setup_name('jasoncarver.eth') + ns.setup_name('ens.eth') If the name doesn't already point to an address, :meth:`~ens.ENS.setup_name` will call :meth:`~ens.ENS.setup_address` for you. @@ -281,7 +281,7 @@ Wait for the transaction to be mined, then: .. code-block:: python - assert ns.name('0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD') == 'jasoncarver.eth' + assert ns.name('0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7') == 'ens.eth' .... @@ -298,15 +298,15 @@ You'll need to setup the address first, and then the text can be set: .. code-block:: python - ns.setup_address('jasoncarver.eth', '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD') - ns.set_text('jasoncarver.eth', 'url', 'https://example.com') + ns.setup_address('ens.eth', '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7') + ns.set_text('ens.eth', 'url', 'https://example.com') A transaction dictionary can be passed as the last argument if desired: .. code-block:: python transaction_dict = {'from': '0x123...'} - ns.set_text('jasoncarver.eth', 'url', 'https://example.com', transaction_dict) + ns.set_text('ens.eth', 'url', 'https://example.com', transaction_dict) If the transaction dictionary is not passed, sensible defaults will be used, and if a transaction dictionary is passed but does not have a ``from`` value, @@ -319,7 +319,7 @@ Anyone can read the data from an ENS Record: .. code-block:: python - url = ns.get_text('jasoncarver.eth', 'url') + url = ns.get_text('ens.eth', 'url') assert url == 'https://example.com' .... @@ -334,7 +334,7 @@ You can get the resolver for an ENS name via the :meth:`~ens.ENS.resolver` metho .. code-block:: python - >>> resolver = ns.resolver('jasoncarver.eth') + >>> resolver = ns.resolver('ens.eth') >>> resolver.address '0x5B2063246F2191f18F2675ceDB8b28102e957458' diff --git a/newsfragments/3020.docs.rst b/newsfragments/3020.docs.rst new file mode 100644 index 0000000000..4842592d7a --- /dev/null +++ b/newsfragments/3020.docs.rst @@ -0,0 +1 @@ +Replace references to ``jasoncarver.eth`` with ``ens.eth``. \ No newline at end of file