Skip to content

Docs addresses #3014

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

Merged
merged 7 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
18 changes: 9 additions & 9 deletions docs/ens_overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ Get the Address for an ENS Name

from ens.auto import ns
eth_address = ns.address('jasoncarver.eth')
assert eth_address == '0x5B2063246F2191f18F2675ceDB8b28102e957458'
assert eth_address == '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD'

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('0x5B2063246F2191f18F2675ceDB8b28102e957458')
domain = ns.name('0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD')

# 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

# confirm that the name resolves back to the address that you looked up:
assert ns.address(domain) == '0x5B2063246F2191f18F2675ceDB8b28102e957458'
assert ns.address(domain) == '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD'

.. 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,7 +233,7 @@ you must already be the owner of the domain (or its parent).

.. code-block:: python

ns.setup_address('jasoncarver.eth', '0x5B2063246F2191f18F2675ceDB8b28102e957458')
ns.setup_address('jasoncarver.eth', '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD')

In the common case where you want to point the name to the owning address, you can skip the address.

Expand All @@ -250,7 +250,7 @@ You can claim arbitrarily deep subdomains.
# wait for the transaction to be mined, then:
assert (
ns.address('supreme.executive.power.derives.from.a.mandate.from.the.masses.jasoncarver.eth')
== '0x5B2063246F2191f18F2675ceDB8b28102e957458'
== '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD'
)

.. warning:: Gas costs scale up with the number of subdomains!
Expand All @@ -265,7 +265,7 @@ this is referred to as "reverse" resolution. The ENS Reverse Resolver is used fo

.. code-block:: python

ns.setup_name('jasoncarver.eth', '0x5B2063246F2191f18F2675ceDB8b28102e957458')
ns.setup_name('jasoncarver.eth', '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD')

If you don't supply the address, :meth:`~ens.ENS.setup_name` will assume you want the
address returned by :meth:`~ens.ENS.address`.
Expand All @@ -281,7 +281,7 @@ Wait for the transaction to be mined, then:

.. code-block:: python

assert ns.name('0x5B2063246F2191f18F2675ceDB8b28102e957458') == 'jasoncarver.eth'
assert ns.name('0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD') == 'jasoncarver.eth'

....

Expand All @@ -298,7 +298,7 @@ You'll need to setup the address first, and then the text can be set:

.. code-block:: python

ns.setup_address('jasoncarver.eth', '0x5B2063246F2191f18F2675ceDB8b28102e957458')
ns.setup_address('jasoncarver.eth', '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD')
ns.set_text('jasoncarver.eth', 'url', 'https://example.com')

A transaction dictionary can be passed as the last argument if desired:
Expand Down Expand Up @@ -336,7 +336,7 @@ You can get the resolver for an ENS name via the :meth:`~ens.ENS.resolver` metho

>>> resolver = ns.resolver('jasoncarver.eth')
>>> resolver.address
'0x5FfC014343cd971B7eb70732021E26C35B744cc4'
'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://0x808B53bF4D70A24bA5cb720D37A4835621A9df00:1/ethregistrar@1.0.0``
- ``ethpm://0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD:1/ethregistrar@1.0.0``

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': '0x4F5B11C860B37B68De6d14FB7e7b5f18A9a1BD00',
... 'address': '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
... }
... }
... }
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='0x4F5B11C860B37B68De6d14FB7e7b5f18A9a1BD00',
... address='0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
... ),
... )
>>> assert expected_manifest == built_manifest
Expand Down
6 changes: 3 additions & 3 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ representation. Block numbers
'gasUsed': 0,
'hash': '0x767c2bfb3bdee3f78676c1285cd757bcd5d8c272cef2eb30d9733800a78c0b6d',
'logsBloom': '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
'miner': '0xad5c1768e5974c231b2148169da064e61910f31a',
'miner': '0xad5C1768e5974C231b2148169da064e61910f31a',
'mixHash': '0x31d9ec7e3855aeba37fd92aa1639845e70b360a60f77f12eff530429ef8cfcba',
'nonce': '0x549f882c5f356f85',
'number': 12345,
Expand Down Expand Up @@ -75,7 +75,7 @@ Checking the balance of an account

To find the amount of ether owned by an account, use the :meth:`~web3.eth.Eth.get_balance` method.
At the time of writing, the account with the `most ether <https://etherscan.io/accounts/1>`_
has a public address of 0x742d35Cc6634C0532925a3b844Bc454e4438f44e.
has a public address of `0x742d35Cc6634C0532925a3b844Bc454e4438f44e`.

.. code-block:: python

Expand Down Expand Up @@ -1231,7 +1231,7 @@ The script can be run with: ``python ./eventscanner.py <your JSON-RPC API URL>``

# RCC has around 11k Transfer events
# https://etherscan.io/token/0x9b6443b0fb9c241a7fdac375595cea13e6b7807a
RCC_ADDRESS = "0x9b6443b0fB9C241A7fdAC375595cEa13e6B7807A"
RCC_ADDRESS = "0x9b6443b0fb9c241a7fdac375595cea13e6b7807a"

# Reduced ERC-20 ABI, only Transfer event
ABI = """[
Expand Down
7 changes: 4 additions & 3 deletions docs/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ ENS
~~~

`Ethereum Name Service (ENS) <https://ens.domains/>`_ provides the infrastructure
for human-readable addresses. As an example, instead of
``0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359``, you can send funds to
``ethereumfoundation.eth``. web3.py has support for ENS, documented
for human-readable addresses. If an address is registered with the ENS registry,
the domain name can be used in place of the address itself. For example, the registered domain
name ``ethereum.eth`` will resolve to the address
``0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe``. web3.py has support for ENS, documented
Copy link
Contributor Author

@reedsa reedsa Jun 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this to get away from the "sending funds" recommendation 😬

:ref:`here <ens_overview>`.
2 changes: 1 addition & 1 deletion docs/web3.beacon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ Methods
{
'data': {
'chain_id': '5',
'address': '0x8c5fecdc472e27bc447696f431e425d02dd46a8c'
'address': '0x8c5fecdC472E27Bc447696F431E425D02dd46a8c'
}
}

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': '0x6Bc272FCFcf89C14cebFC57B8f1543F5137F97dE',
'to': '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
'data': '0x7cf5dab00000000000000000000000000000000000000000000000000000000000000005',
'value': 0,
'gas': 43242,
Expand Down
22 changes: 11 additions & 11 deletions docs/web3.eth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ The following properties are available on the ``web3.eth`` namespace.
.. code-block:: python

>>> web3.eth.coinbase
'0xd3CdA913deB6f67967B99D67aCDFa1712C293601'
'0xC014BA5EC014ba5ec014Ba5EC014ba5Ec014bA5E'


.. py:attribute:: Eth.mining
Expand Down Expand Up @@ -153,7 +153,7 @@ The following properties are available on the ``web3.eth`` namespace.
.. code-block:: python

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


.. 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': '0xd3CdA913deB6f67967B99D67aCDFa1712C293601',
'to': '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
'from': web3.eth.coinbase,
'value': 12345
})

# Dynamic fee transaction, introduced by EIP-1559:
HexBytes('0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331')
>>> web3.eth.send_transaction({
'to': '0xd3CdA913deB6f67967B99D67aCDFa1712C293601',
'to': '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
'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': '0xd3CdA913deB6f67967B99D67aCDFa1712C293601',
'to': '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
'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='0xd3CdA913deB6f67967B99D67aCDFa1712C293601',
to='0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
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': '0xd3CdA913deB6f67967B99D67aCDFa1712C293601',
'to': '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
'from': web3.eth.coinbase,
'value': 1000
})
HexBytes('0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331')
>>> web3.eth.replace_transaction('0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331', {
'to': '0xd3CdA913deB6f67967B99D67aCDFa1712C293601',
'to': '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
'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': '0xd3CdA913deB6f67967B99D67aCDFa1712C293601',
'to': '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
'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(
'0xd3CdA913deB6f67967B99D67aCDFa1712C293601',
'0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
text='some-text-tö-sign')
'0x1a8bbe6eab8c72a219385681efefe565afd3accee35f516f8edf5ae82208fbd45a58f9f9116d8d88ba40fcd29076d6eada7027a3b412a9db55a0164547810cc401'

>>> web3.eth.sign(
'0xd3CdA913deB6f67967B99D67aCDFa1712C293601',
'0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD',
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()
['0xd3CdA913deB6f67967B99D67aCDFa1712C293601']
['0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD']


.. 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('0xd3CdA913deB6f67967B99D67aCDFa1712C293601')
>>> web3.geth.personal.lock_account('0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD')
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')
'0xd3CdA913deB6f67967B99D67aCDFa1712C293601'
'0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD'


.. 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('0xd3CdA913deB6f67967B99D67aCDFa1712C293601', 'wrong-passphrase')
>>> web3.geth.personal.unlock_account('0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD', 'wrong-passphrase')
False
>>> web3.geth.personal.unlock_account('0xd3CdA913deB6f67967B99D67aCDFa1712C293601', 'the-passphrase')
>>> web3.geth.personal.unlock_account('0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD', 'the-passphrase')
True


Expand Down
1 change: 1 addition & 0 deletions newsfragments/2011.docs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Replaced transaction examples with unused account addresses.