Skip to content

Commit e7c1bdf

Browse files
committedMar 21, 2025
Implicitly use EIP-7702 if authorizationList is given and non-empty (#4961).
1 parent db490e1 commit e7c1bdf

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed
 

‎src.ts/providers/abstract-signer.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,11 @@ export abstract class AbstractSigner<P extends null | Provider = null | Provider
151151
// The network supports EIP-1559!
152152

153153
// Upgrade transaction from null to eip-1559
154-
pop.type = 2;
154+
if (pop.authorizationList && pop.authorizationList.length) {
155+
pop.type = 4;
156+
} else {
157+
pop.type = 2;
158+
}
155159

156160
if (pop.gasPrice != null) {
157161
// Using legacy gasPrice property on an eip-1559 network,

‎src.ts/transaction/transaction.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,9 @@ export class Transaction implements TransactionLike<string> {
11911191
types.push(this.type);
11921192

11931193
} else {
1194-
if (hasFee) {
1194+
if (this.authorizationList && this.authorizationList.length) {
1195+
types.push(4);
1196+
} else if (hasFee) {
11951197
types.push(2);
11961198
} else if (hasGasPrice) {
11971199
types.push(1);

0 commit comments

Comments
 (0)
Please sign in to comment.