Skip to content

Commit 09ca998

Browse files
feat: support EIP-7702 transactions (#94)
* feat: support EIP-7702 transactions * chore: `black .` --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 627e63d commit 09ca998

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

evmspec/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
TransactionLegacy,
4141
Transaction1559,
4242
Transaction2930,
43+
Transaction4844,
44+
Transaction7702,
4345
Transaction,
4446
AnyTransaction,
4547
)
@@ -73,4 +75,6 @@
7375
"TransactionLegacy",
7476
"Transaction2930",
7577
"Transaction1559",
78+
"Transaction4844",
79+
"Transaction7702",
7680
]

evmspec/structs/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
TransactionLegacy,
1010
Transaction1559,
1111
Transaction2930,
12+
Transaction4844,
13+
Transaction7702,
1214
)
1315

1416
__all__ = [
@@ -28,4 +30,6 @@
2830
"TransactionLegacy",
2931
"Transaction2930",
3032
"Transaction1559",
33+
"Transaction4844",
34+
"Transaction7702",
3135
]

evmspec/structs/transaction.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,20 @@ class Transaction4844(Transaction1559, tag="0x3", frozen=True, kw_only=True, for
252252
blobVersionedHashes: Tuple[HexBytes32, ...]
253253

254254

255+
@final
256+
class Transaction7702(Transaction1559, tag="0x4", frozen=True, kw_only=True, forbid_unknown_fields=True, omit_defaults=True, repr_omit_defaults=True): # type: ignore [call-arg]
257+
"""
258+
Represents a type-7702 (EIP-7702) Ethereum transaction to set an EOA's bytecode.
259+
"""
260+
261+
type: ClassVar[HexBytes] = HexBytes("4")
262+
263+
255264
Transaction = Union[
256-
TransactionLegacy, Transaction2930, Transaction1559, Transaction4844
265+
TransactionLegacy,
266+
Transaction2930,
267+
Transaction1559,
268+
Transaction4844,
269+
Transaction7702,
257270
]
258271
AnyTransaction = Union[Transaction, TransactionRLP]

0 commit comments

Comments
 (0)