Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace jasoncarver.eth with ens.eth #3022

Merged
merged 4 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions docs/ens_overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
fselmo marked this conversation as resolved.
Show resolved Hide resolved

# 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 <https://docs.ens.domains/dapp-developer-guide/resolving-names#reverse-resolution>`_,
Expand Down Expand Up @@ -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!
Expand All @@ -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.
Expand All @@ -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'

....

Expand All @@ -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,
Expand All @@ -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'

....
Expand All @@ -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'

Expand Down
6 changes: 3 additions & 3 deletions docs/ethpm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ Examples...

- ``ethpm://packages.zeppelinos.eth/owned@1.0.0``

- ``ethpm://0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD:1/ethregistrar@1.0.0``
- ``ethpm://0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7:1/ethregistrar@1.0.0``
reedsa marked this conversation as resolved.
Show resolved Hide resolved

To specify a specific asset within a package, you can namespace the target asset.

Expand Down Expand Up @@ -796,7 +796,7 @@ This is the simplest builder function for adding a deployment to a manifest. All
... 'blockchain://1234567890123456789012345678901234567890123456789012345678901234/block/1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef': {
... 'Owned': {
... 'contractType': 'Owned',
... 'address': '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
... 'address': '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7',
... }
... }
... }
Expand All @@ -807,7 +807,7 @@ This is the simplest builder function for adding a deployment to a manifest. All
... block_uri='blockchain://1234567890123456789012345678901234567890123456789012345678901234/block/1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
... contract_instance='Owned',
... contract_type='Owned',
... address='0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
... address='0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7',
... ),
... )
>>> assert expected_manifest == built_manifest
Expand Down
2 changes: 1 addition & 1 deletion docs/web3.contract.rst
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ Methods

>>> math_contract.functions.increment(5).build_transaction({'maxFeePerGas': 2000000000, 'maxPriorityFeePerGas': 1000000000})
{
'to': '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
'to': '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7',
'data': '0x7cf5dab00000000000000000000000000000000000000000000000000000000000000005',
'value': 0,
'gas': 43242,
Expand Down
20 changes: 10 additions & 10 deletions docs/web3.eth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ The following properties are available on the ``web3.eth`` namespace.
.. code-block:: python

>>> web3.eth.accounts
['0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD']
['0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7']


.. py:attribute:: Eth.block_number
Expand Down Expand Up @@ -736,15 +736,15 @@ The following methods are available on the ``web3.eth`` namespace.

# simple example (web3.py and / or client determines gas and fees, typically defaults to a dynamic fee transaction post London fork)
>>> web3.eth.send_transaction({
'to': '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
'to': '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7',
'from': web3.eth.coinbase,
'value': 12345
})

# Dynamic fee transaction, introduced by EIP-1559:
HexBytes('0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331')
>>> web3.eth.send_transaction({
'to': '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
'to': '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7',
'from': web3.eth.coinbase,
'value': 12345,
'gas': 21000,
Expand All @@ -756,7 +756,7 @@ The following methods are available on the ``web3.eth`` namespace.
# Legacy transaction (less efficient)
HexBytes('0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331')
>>> web3.eth.send_transaction({
'to': '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
'to': '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7',
'from': web3.eth.coinbase,
'value': 12345,
'gas': 21000,
Expand Down Expand Up @@ -800,7 +800,7 @@ The following methods are available on the ``web3.eth`` namespace.
maxFeePerGas=3000000000,
maxPriorityFeePerGas=2000000000,
gas=100000,
to='0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
to='0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7',
value=12345,
data=b'',
type=2, # (optional) the type is now implicitly set based on appropriate transaction params
Expand Down Expand Up @@ -855,13 +855,13 @@ The following methods are available on the ``web3.eth`` namespace.
.. code-block:: python

>>> tx = web3.eth.send_transaction({
'to': '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
'to': '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7',
'from': web3.eth.coinbase,
'value': 1000
})
HexBytes('0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331')
>>> web3.eth.replace_transaction('0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331', {
'to': '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
'to': '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7',
'from': web3.eth.coinbase,
'value': 2000
})
Expand All @@ -886,7 +886,7 @@ The following methods are available on the ``web3.eth`` namespace.
.. code-block:: python

>>> tx = web3.eth.send_transaction({
'to': '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
'to': '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7',
'from': web3.eth.coinbase,
'value': 1000
})
Expand All @@ -909,12 +909,12 @@ The following methods are available on the ``web3.eth`` namespace.
.. code-block:: python

>>> web3.eth.sign(
'0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
'0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7',
text='some-text-tö-sign')
'0x1a8bbe6eab8c72a219385681efefe565afd3accee35f516f8edf5ae82208fbd45a58f9f9116d8d88ba40fcd29076d6eada7027a3b412a9db55a0164547810cc401'

>>> web3.eth.sign(
'0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
'0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7',
data=b'some-text-t\xc3\xb6-sign')
'0x1a8bbe6eab8c72a219385681efefe565afd3accee35f516f8edf5ae82208fbd45a58f9f9116d8d88ba40fcd29076d6eada7027a3b412a9db55a0164547810cc401'

Expand Down
10 changes: 5 additions & 5 deletions docs/web3.geth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ The following methods are available on the ``web3.geth.personal`` namespace.
.. code-block:: python

>>> web3.geth.personal.list_accounts()
['0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD']
['0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7']


.. py:method:: list_wallets()
Expand Down Expand Up @@ -239,7 +239,7 @@ The following methods are available on the ``web3.geth.personal`` namespace.

.. code-block:: python

>>> web3.geth.personal.lock_account('0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD')
>>> web3.geth.personal.lock_account('0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7')
True


Expand All @@ -253,7 +253,7 @@ The following methods are available on the ``web3.geth.personal`` namespace.
.. code-block:: python

>>> web3.geth.personal.new_account('the-passphrase')
'0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD'
'0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7'


.. py:method:: send_transaction(transaction, passphrase)
Expand Down Expand Up @@ -287,9 +287,9 @@ The following methods are available on the ``web3.geth.personal`` namespace.

.. code-block:: python

>>> web3.geth.personal.unlock_account('0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD', 'wrong-passphrase')
>>> web3.geth.personal.unlock_account('0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7', 'wrong-passphrase')
False
>>> web3.geth.personal.unlock_account('0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD', 'the-passphrase')
>>> web3.geth.personal.unlock_account('0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7', 'the-passphrase')
True


Expand Down
1 change: 1 addition & 0 deletions newsfragments/3020.docs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Replace references to ``jasoncarver.eth`` with ``ens.eth``.