Skip to content

Commit ed49179

Browse files
authored
removed concise and implicit contract (#2505)
* removed concise and implicit contract * newsfragment
1 parent 5db6e49 commit ed49179

File tree

7 files changed

+5
-466
lines changed

7 files changed

+5
-466
lines changed

docs/contracts.rst

+1-55
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ Contract Factories
108108

109109
These factories are not intended to be initialized directly.
110110
Instead, create contract objects using the :meth:`w3.eth.contract() <web3.eth.Eth.contract>`
111-
method. By default, the contract factory is :class:`Contract`. See the
112-
example in :class:`ConciseContract` for specifying an alternate factory.
111+
method. By default, the contract factory is :class:`Contract`.
113112

114113
.. py:class:: Contract(address)
115114
@@ -118,59 +117,6 @@ example in :class:`ConciseContract` for specifying an alternate factory.
118117

119118
The address parameter can be a hex address or an ENS name, like ``mycontract.eth``.
120119

121-
.. py:class:: ConciseContract(Contract())
122-
123-
.. warning:: Deprecated: This method is deprecated in favor of the :class:`~ContractCaller` API
124-
or the verbose syntax
125-
126-
This variation of :class:`Contract` is designed for more succinct read access,
127-
without making write access more wordy. This comes at a cost of losing
128-
access to features like ``deploy()`` and properties like ``address``. It is
129-
recommended to use the classic ``Contract`` for those use cases.
130-
Just to be be clear, `ConciseContract` only exposes contract functions and all
131-
other `Contract` class methods and properties are not available with the `ConciseContract`
132-
API. This includes but is not limited to ``contract.address``, ``contract.abi``, and
133-
``contract.deploy()``.
134-
135-
Create this type of contract by passing a :py:class:`Contract` instance to
136-
:class:`ConciseContract`:
137-
138-
139-
.. code-block:: python
140-
141-
>>> concise = ConciseContract(myContract)
142-
143-
144-
This variation invokes all methods as a call, so if the classic contract had a method like
145-
``contract.functions.owner().call()``, you could call it with ``concise.owner()`` instead.
146-
147-
For access to send a transaction or estimate gas, you can add a keyword argument like so:
148-
149-
150-
.. code-block:: python
151-
152-
>>> concise.withdraw(amount, transact={'from': eth.accounts[1], 'gas': 100000, ...})
153-
154-
>>> # which is equivalent to this transaction in the classic contract:
155-
156-
>>> contract.functions.withdraw(amount).transact({'from': eth.accounts[1], 'gas': 100000, ...})
157-
158-
.. py:class:: ImplicitContract(Contract())
159-
160-
.. warning:: Deprecated: This method is deprecated in favor of the verbose syntax
161-
162-
This variation mirrors :py:class:`ConciseContract`, but it invokes all methods as a
163-
transaction rather than a call, so if the classic contract had a method like
164-
``contract.functions.owner.transact()``, you could call it with ``implicit.owner()`` instead.
165-
166-
Create this type of contract by passing a :py:class:`Contract` instance to
167-
:class:`ImplicitContract`:
168-
169-
170-
.. code-block:: python
171-
172-
>>> concise = ImplicitContract(myContract)
173-
174120

175121
Properties
176122
----------

docs/web3.eth.rst

+1-8
Original file line numberDiff line numberDiff line change
@@ -1455,11 +1455,4 @@ Contracts
14551455
.. py:method:: Eth.set_contract_factory(contractFactoryClass)
14561456
14571457
Modify the default contract factory from ``Contract`` to ``contractFactoryClass``.
1458-
Future calls to ``Eth.contract()`` will then default to ``contractFactoryClass``.
1459-
1460-
An example of an alternative Contract Factory is ``ConciseContract``.
1461-
1462-
.. py:method:: Eth.setContractFactory(contractFactoryClass)
1463-
1464-
.. warning:: Deprecated: This method is deprecated in favor of
1465-
:meth:`~web3.eth.Eth.set_contract_factory()`
1458+
Future calls to ``Eth.contract()`` will then default to ``contractFactoryClass``.

newsfragments/2505.misc.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Removed ConciseContract and ImplicitContract from contract.

tests/core/contracts/test_concise_contract.py

-137
This file was deleted.

tests/core/contracts/test_implicit_contract.py

-119
This file was deleted.

0 commit comments

Comments
 (0)