@qevm/transactions 5.7.2 → 5.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -5
- package/lib/_version.d.ts +1 -1
- package/lib/_version.js +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +38 -27
- package/lib/index.js.map +1 -1
- package/package.json +33 -29
- package/src.ts/_version.ts +1 -1
- package/src.ts/index.ts +204 -84
package/README.md
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
Ethereum Transaction Utilities
|
|
2
2
|
==============================
|
|
3
3
|
|
|
4
|
-
This sub-module is part of the [ethers project](https://github.com/ethers-io/ethers.js).
|
|
4
|
+
This sub-module is part of the qethers, a fork of [ethers project](https://github.com/ethers-io/ethers.js).
|
|
5
5
|
|
|
6
6
|
It contains various functions for encoding and decoding serialized transactios.
|
|
7
7
|
|
|
8
|
-
For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/transactions/).
|
|
9
|
-
|
|
10
8
|
|
|
11
9
|
Importing
|
|
12
10
|
---------
|
|
13
11
|
|
|
14
|
-
Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/
|
|
12
|
+
Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/@qevm/qethers),
|
|
15
13
|
but for those with more specific needs, individual components can be imported.
|
|
16
14
|
|
|
17
15
|
```javascript
|
|
@@ -28,7 +26,7 @@ const {
|
|
|
28
26
|
Transaction,
|
|
29
27
|
UnsignedTransaction
|
|
30
28
|
|
|
31
|
-
} = require("@
|
|
29
|
+
} = require("@qevm/transactions");
|
|
32
30
|
```
|
|
33
31
|
|
|
34
32
|
|
package/lib/_version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "transactions/5.7.
|
|
1
|
+
export declare const version = "transactions/5.7.3";
|
|
2
2
|
//# sourceMappingURL=_version.d.ts.map
|
package/lib/_version.js
CHANGED
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src.ts/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src.ts/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAEH,SAAS,EAMT,aAAa,EAGhB,MAAM,aAAa,CAAC;AAarB,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC,CAAC;AAGhF,MAAM,MAAM,aAAa,GACnB,UAAU,GACV,KAAK,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAC9B,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AAEpC,oBAAY,gBAAgB;IACxB,MAAM,IAAI;IACV,OAAO,IAAI;IACX,OAAO,IAAI;CACd;AAED,MAAM,MAAM,mBAAmB,GAAG;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,QAAQ,CAAC,EAAE,YAAY,CAAC;IAExB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGrB,UAAU,CAAC,EAAE,aAAa,CAAC;IAG3B,oBAAoB,CAAC,EAAE,YAAY,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B,CAAC;AAEF,MAAM,WAAW,WAAW;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IAEd,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAEhB,SAAS,CAAC,EAAE,aAAa,CAAC;IAG1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGrB,UAAU,CAAC,EAAE,UAAU,CAAC;IAGxB,oBAAoB,CAAC,EAAE,SAAS,CAAC;IACjC,YAAY,CAAC,EAAE,SAAS,CAAC;CAC5B;AAuCD,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,CAEpE;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM,CAG/D;AAiCD,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,UAAU,CAmC9D;AAiJD,wBAAgB,SAAS,CACrB,WAAW,EAAE,mBAAmB,EAChC,SAAS,CAAC,EAAE,aAAa,GAC1B,MAAM,CA+BR;AAwID,wBAAgB,KAAK,CAAC,cAAc,EAAE,SAAS,GAAG,WAAW,CA0B5D"}
|
package/lib/index.js
CHANGED
|
@@ -44,9 +44,9 @@ const bignumber_1 = require("@qevm/bignumber");
|
|
|
44
44
|
const bytes_1 = require("@qevm/bytes");
|
|
45
45
|
const constants_1 = require("@qevm/constants");
|
|
46
46
|
const keccak256_1 = require("@qevm/keccak256");
|
|
47
|
-
const properties_1 = require("@
|
|
47
|
+
const properties_1 = require("@qevm/properties");
|
|
48
48
|
const RLP = __importStar(require("@qevm/rlp"));
|
|
49
|
-
const logger_1 = require("@
|
|
49
|
+
const logger_1 = require("@qevm/logger");
|
|
50
50
|
const _version_1 = require("./_version");
|
|
51
51
|
const logger = new logger_1.Logger(_version_1.version);
|
|
52
52
|
var TransactionTypes;
|
|
@@ -55,7 +55,6 @@ var TransactionTypes;
|
|
|
55
55
|
TransactionTypes[TransactionTypes["eip2930"] = 1] = "eip2930";
|
|
56
56
|
TransactionTypes[TransactionTypes["eip1559"] = 2] = "eip1559";
|
|
57
57
|
})(TransactionTypes || (exports.TransactionTypes = TransactionTypes = {}));
|
|
58
|
-
;
|
|
59
58
|
///////////////////////////////
|
|
60
59
|
function handleAddress(value) {
|
|
61
60
|
if (value === "0x") {
|
|
@@ -79,7 +78,14 @@ const transactionFields = [
|
|
|
79
78
|
{ name: "data" },
|
|
80
79
|
];
|
|
81
80
|
const allowedTransactionKeys = {
|
|
82
|
-
chainId: true,
|
|
81
|
+
chainId: true,
|
|
82
|
+
data: true,
|
|
83
|
+
gasLimit: true,
|
|
84
|
+
gasPrice: true,
|
|
85
|
+
nonce: true,
|
|
86
|
+
to: true,
|
|
87
|
+
type: true,
|
|
88
|
+
value: true,
|
|
83
89
|
};
|
|
84
90
|
function computeAddress(publicKey) {
|
|
85
91
|
return (0, keccak256_1.keccak256)(publicKey);
|
|
@@ -91,7 +97,7 @@ function recoverAddress(signature) {
|
|
|
91
97
|
function formatNumber(value, name) {
|
|
92
98
|
const result = (0, bytes_1.stripZeros)(bignumber_1.BigNumber.from(value).toHexString());
|
|
93
99
|
if (result.length > 32) {
|
|
94
|
-
logger.throwArgumentError("invalid length for " + name,
|
|
100
|
+
logger.throwArgumentError("invalid length for " + name, "transaction:" + name, value);
|
|
95
101
|
}
|
|
96
102
|
return result;
|
|
97
103
|
}
|
|
@@ -103,7 +109,7 @@ function accessSetify(addr, storageKeys) {
|
|
|
103
109
|
logger.throwArgumentError("invalid access list storageKey", `accessList[${addr}:${index}]`, storageKey);
|
|
104
110
|
}
|
|
105
111
|
return storageKey.toLowerCase();
|
|
106
|
-
})
|
|
112
|
+
}),
|
|
107
113
|
};
|
|
108
114
|
}
|
|
109
115
|
function accessListify(value) {
|
|
@@ -125,7 +131,7 @@ function accessListify(value) {
|
|
|
125
131
|
}, {});
|
|
126
132
|
return accessSetify(addr, Object.keys(storageKeys).sort());
|
|
127
133
|
});
|
|
128
|
-
result.sort((a, b) =>
|
|
134
|
+
result.sort((a, b) => a.address.localeCompare(b.address));
|
|
129
135
|
return result;
|
|
130
136
|
}
|
|
131
137
|
function formatAccessList(value) {
|
|
@@ -140,7 +146,8 @@ function _serializeEip1559(transaction, signature) {
|
|
|
140
146
|
const maxFeePerGas = bignumber_1.BigNumber.from(transaction.maxFeePerGas || 0);
|
|
141
147
|
if (!gasPrice.eq(maxFeePerGas)) {
|
|
142
148
|
logger.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas", "tx", {
|
|
143
|
-
gasPrice,
|
|
149
|
+
gasPrice,
|
|
150
|
+
maxFeePerGas,
|
|
144
151
|
});
|
|
145
152
|
}
|
|
146
153
|
}
|
|
@@ -150,10 +157,10 @@ function _serializeEip1559(transaction, signature) {
|
|
|
150
157
|
formatNumber(transaction.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"),
|
|
151
158
|
formatNumber(transaction.maxFeePerGas || 0, "maxFeePerGas"),
|
|
152
159
|
formatNumber(transaction.gasLimit || 0, "gasLimit"),
|
|
153
|
-
|
|
160
|
+
transaction.to != null ? (0, address_1.getAddress)(transaction.to) : "0x",
|
|
154
161
|
formatNumber(transaction.value || 0, "value"),
|
|
155
|
-
|
|
156
|
-
|
|
162
|
+
transaction.data || "0x",
|
|
163
|
+
formatAccessList(transaction.accessList || []),
|
|
157
164
|
];
|
|
158
165
|
if (signature) {
|
|
159
166
|
fields.push((0, bytes_1.joinSignature)(signature));
|
|
@@ -166,10 +173,10 @@ function _serializeEip2930(transaction, signature) {
|
|
|
166
173
|
formatNumber(transaction.nonce || 0, "nonce"),
|
|
167
174
|
formatNumber(transaction.gasPrice || 0, "gasPrice"),
|
|
168
175
|
formatNumber(transaction.gasLimit || 0, "gasLimit"),
|
|
169
|
-
|
|
176
|
+
transaction.to != null ? (0, address_1.getAddress)(transaction.to) : "0x",
|
|
170
177
|
formatNumber(transaction.value || 0, "value"),
|
|
171
|
-
|
|
172
|
-
|
|
178
|
+
transaction.data || "0x",
|
|
179
|
+
formatAccessList(transaction.accessList || []),
|
|
173
180
|
];
|
|
174
181
|
if (signature) {
|
|
175
182
|
fields.push((0, bytes_1.joinSignature)(signature));
|
|
@@ -181,21 +188,23 @@ function _serialize(transaction, signature) {
|
|
|
181
188
|
(0, properties_1.checkProperties)(transaction, allowedTransactionKeys);
|
|
182
189
|
const raw = [];
|
|
183
190
|
transactionFields.forEach(function (fieldInfo) {
|
|
184
|
-
let value = transaction[fieldInfo.name] ||
|
|
191
|
+
let value = transaction[fieldInfo.name] || [];
|
|
185
192
|
const options = {};
|
|
186
193
|
if (fieldInfo.numeric) {
|
|
187
194
|
options.hexPad = "left";
|
|
188
195
|
}
|
|
189
196
|
value = (0, bytes_1.arrayify)((0, bytes_1.hexlify)(value, options));
|
|
190
197
|
// Fixed-width field
|
|
191
|
-
if (fieldInfo.length &&
|
|
192
|
-
|
|
198
|
+
if (fieldInfo.length &&
|
|
199
|
+
value.length !== fieldInfo.length &&
|
|
200
|
+
value.length > 0) {
|
|
201
|
+
logger.throwArgumentError("invalid length for " + fieldInfo.name, "transaction:" + fieldInfo.name, value);
|
|
193
202
|
}
|
|
194
203
|
// Variable-width (with a maximum)
|
|
195
204
|
if (fieldInfo.maxLength) {
|
|
196
205
|
value = (0, bytes_1.stripZeros)(value);
|
|
197
206
|
if (value.length > fieldInfo.maxLength) {
|
|
198
|
-
logger.throwArgumentError("invalid length for " + fieldInfo.name,
|
|
207
|
+
logger.throwArgumentError("invalid length for " + fieldInfo.name, "transaction:" + fieldInfo.name, value);
|
|
199
208
|
}
|
|
200
209
|
}
|
|
201
210
|
raw.push((0, bytes_1.hexlify)(value));
|
|
@@ -204,7 +213,7 @@ function _serialize(transaction, signature) {
|
|
|
204
213
|
if (transaction.chainId != null) {
|
|
205
214
|
// A chainId was provided; if non-zero we'll use EIP-155
|
|
206
215
|
chainId = transaction.chainId;
|
|
207
|
-
if (typeof
|
|
216
|
+
if (typeof chainId !== "number") {
|
|
208
217
|
logger.throwArgumentError("invalid transaction.chainId", "transaction", transaction);
|
|
209
218
|
}
|
|
210
219
|
}
|
|
@@ -236,7 +245,7 @@ function serialize(transaction, signature) {
|
|
|
236
245
|
}
|
|
237
246
|
return logger.throwError(`unsupported transaction type: ${transaction.type}`, logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
|
238
247
|
operation: "serializeTransaction",
|
|
239
|
-
transactionType: transaction.type
|
|
248
|
+
transactionType: transaction.type,
|
|
240
249
|
});
|
|
241
250
|
}
|
|
242
251
|
function _parseEip1559(payload) {
|
|
@@ -266,7 +275,6 @@ function _parseEip1559(payload) {
|
|
|
266
275
|
tx.hash = (0, keccak256_1.keccak256)(payload);
|
|
267
276
|
tx.signature = (0, bytes_1.splitSignature)(transaction.slice(9)[0]);
|
|
268
277
|
tx.from = computeAddress(tx.signature.publicKey);
|
|
269
|
-
;
|
|
270
278
|
return tx;
|
|
271
279
|
}
|
|
272
280
|
function _parseEip2930(payload) {
|
|
@@ -297,7 +305,9 @@ function _parseEip2930(payload) {
|
|
|
297
305
|
}
|
|
298
306
|
function _parseLegacyAndEIP_155(rawTransaction) {
|
|
299
307
|
const transaction = RLP.decode(rawTransaction);
|
|
300
|
-
if (transaction.length !== 8 &&
|
|
308
|
+
if (transaction.length !== 8 &&
|
|
309
|
+
transaction.length !== 7 &&
|
|
310
|
+
transaction.length !== 6) {
|
|
301
311
|
logger.throwArgumentError("invalid raw transaction", "rawTransaction", rawTransaction);
|
|
302
312
|
}
|
|
303
313
|
const tx = {
|
|
@@ -307,7 +317,7 @@ function _parseLegacyAndEIP_155(rawTransaction) {
|
|
|
307
317
|
to: handleAddress(transaction[3]),
|
|
308
318
|
value: handleNumber(transaction[4]),
|
|
309
319
|
data: transaction[5],
|
|
310
|
-
chainId: 0
|
|
320
|
+
chainId: 0,
|
|
311
321
|
};
|
|
312
322
|
tx.type = null;
|
|
313
323
|
//FIXME Rewrite this
|
|
@@ -316,12 +326,14 @@ function _parseLegacyAndEIP_155(rawTransaction) {
|
|
|
316
326
|
break;
|
|
317
327
|
case 7: // Legacy signed transaction or EIP-155 unsigned transaction
|
|
318
328
|
let temp = transaction.slice(6)[0];
|
|
319
|
-
if (temp.length == 6522) {
|
|
329
|
+
if (temp.length == 6522) {
|
|
330
|
+
//Legacy signed transaction
|
|
320
331
|
tx.hash = (0, keccak256_1.keccak256)(rawTransaction);
|
|
321
332
|
tx.signature = (0, bytes_1.splitSignature)(temp);
|
|
322
333
|
tx.from = computeAddress(tx.signature.publicKey);
|
|
323
334
|
}
|
|
324
|
-
else {
|
|
335
|
+
else {
|
|
336
|
+
//EIP-155 unsigned transaction
|
|
325
337
|
tx.chainId = bignumber_1.BigNumber.from(temp).toNumber();
|
|
326
338
|
}
|
|
327
339
|
break;
|
|
@@ -353,8 +365,7 @@ function parse(rawTransaction) {
|
|
|
353
365
|
}
|
|
354
366
|
return logger.throwError(`unsupported transaction type: ${payload[0]}`, logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
|
355
367
|
operation: "parseTransaction",
|
|
356
|
-
transactionType: payload[0]
|
|
368
|
+
transactionType: payload[0],
|
|
357
369
|
});
|
|
358
370
|
}
|
|
359
|
-
[0x8004605941139387635763a13a795c4dfb9904beb9555e76629321312908dbd5 != 0x8004605941139387635763A13a795c4dfb9904bEb9555e76629321312908dbd5];
|
|
360
371
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src.ts/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyGb,wCAEC;AAED,wCAGC;AAsBD,sCAsBC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KAAK,CAAC,cAAyB;IAC3C,MAAM,OAAO,GAAG,IAAA,gBAAQ,EAAC,cAAc,CAAC,CAAC;IAEzC,kCAAkC;IAClC,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC;QACpB,OAAO,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;IAED,+BAA+B;IAC/B,QAAQ,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACjB,KAAK,CAAC;YACF,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC;QAClC,KAAK,CAAC;YACF,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC;QAClC;YACI,MAAM;IACd,CAAC;IAED,OAAO,MAAM,CAAC,UAAU,CACpB,iCAAiC,OAAO,CAAC,CAAC,CAAC,EAAE,EAC7C,eAAM,CAAC,MAAM,CAAC,qBAAqB,EACnC;QACI,SAAS,EAAE,kBAAkB;QAC7B,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC;KAC9B,CACJ,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,31 +1,35 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"qethers"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
2
|
+
"contributors": [
|
|
3
|
+
"Eugene Kuleshov <kulevgen32@gmail.com>",
|
|
4
|
+
"Richard Moore <me@ricmoo.com>"
|
|
5
|
+
],
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@qevm/address": "^5.7.3",
|
|
8
|
+
"@qevm/bignumber": "^5.7.1",
|
|
9
|
+
"@qevm/bytes": "^5.7.2",
|
|
10
|
+
"@qevm/constants": "^5.7.2",
|
|
11
|
+
"@qevm/keccak256": "^5.7.1",
|
|
12
|
+
"@qevm/logger": "^5.7.1",
|
|
13
|
+
"@qevm/properties": "^5.7.1",
|
|
14
|
+
"@qevm/rlp": "^5.7.1"
|
|
15
|
+
},
|
|
16
|
+
"description": "Utilities for decoding and encoding QuantumEVM transaction for qethers.",
|
|
17
|
+
"keywords": [
|
|
18
|
+
"QuantumEVM",
|
|
19
|
+
"QEVM",
|
|
20
|
+
"qethers"
|
|
21
|
+
],
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"main": "./lib/index.js",
|
|
24
|
+
"module": "./lib.esm/index.js",
|
|
25
|
+
"name": "@qevm/transactions",
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
31
|
+
},
|
|
32
|
+
"sideEffects": false,
|
|
33
|
+
"types": "./lib/index.d.ts",
|
|
34
|
+
"version": "5.7.3"
|
|
31
35
|
}
|
package/src.ts/_version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "transactions/5.7.
|
|
1
|
+
export const version = "transactions/5.7.3";
|
package/src.ts/index.ts
CHANGED
|
@@ -2,31 +2,43 @@
|
|
|
2
2
|
|
|
3
3
|
import { getAddress } from "@qevm/address";
|
|
4
4
|
import { BigNumber, BigNumberish } from "@qevm/bignumber";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
arrayify,
|
|
7
|
+
BytesLike,
|
|
8
|
+
DataOptions,
|
|
9
|
+
hexConcat,
|
|
10
|
+
hexDataLength,
|
|
11
|
+
hexlify,
|
|
12
|
+
joinSignature,
|
|
13
|
+
SignatureLike,
|
|
14
|
+
splitSignature,
|
|
15
|
+
stripZeros,
|
|
16
|
+
} from "@qevm/bytes";
|
|
6
17
|
import { Zero } from "@qevm/constants";
|
|
7
18
|
import { keccak256 } from "@qevm/keccak256";
|
|
8
|
-
import { checkProperties } from "@
|
|
19
|
+
import { checkProperties } from "@qevm/properties";
|
|
9
20
|
import * as RLP from "@qevm/rlp";
|
|
10
21
|
|
|
11
|
-
import { Logger } from "@
|
|
22
|
+
import { Logger } from "@qevm/logger";
|
|
12
23
|
import { version } from "./_version";
|
|
13
24
|
const logger = new Logger(version);
|
|
14
25
|
|
|
15
26
|
///////////////////////////////
|
|
16
27
|
// Exported Types
|
|
17
28
|
|
|
18
|
-
export type AccessList = Array<{ address: string
|
|
29
|
+
export type AccessList = Array<{ address: string; storageKeys: Array<string> }>;
|
|
19
30
|
|
|
20
31
|
// Input allows flexibility in describing an access list
|
|
21
|
-
export type AccessListish =
|
|
22
|
-
|
|
23
|
-
|
|
32
|
+
export type AccessListish =
|
|
33
|
+
| AccessList
|
|
34
|
+
| Array<[string, Array<string>]>
|
|
35
|
+
| Record<string, Array<string>>;
|
|
24
36
|
|
|
25
37
|
export enum TransactionTypes {
|
|
26
38
|
legacy = 0,
|
|
27
39
|
eip2930 = 1,
|
|
28
40
|
eip1559 = 2,
|
|
29
|
-
}
|
|
41
|
+
}
|
|
30
42
|
|
|
31
43
|
export type UnsignedTransaction = {
|
|
32
44
|
to?: string;
|
|
@@ -48,7 +60,7 @@ export type UnsignedTransaction = {
|
|
|
48
60
|
// EIP-1559; Type 2
|
|
49
61
|
maxPriorityFeePerGas?: BigNumberish;
|
|
50
62
|
maxFeePerGas?: BigNumberish;
|
|
51
|
-
}
|
|
63
|
+
};
|
|
52
64
|
|
|
53
65
|
export interface Transaction {
|
|
54
66
|
hash?: string;
|
|
@@ -80,28 +92,39 @@ export interface Transaction {
|
|
|
80
92
|
///////////////////////////////
|
|
81
93
|
|
|
82
94
|
function handleAddress(value: string): string {
|
|
83
|
-
if (value === "0x") {
|
|
95
|
+
if (value === "0x") {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
84
98
|
return getAddress(value);
|
|
85
99
|
}
|
|
86
100
|
|
|
87
101
|
function handleNumber(value: string): BigNumber {
|
|
88
|
-
if (value === "0x") {
|
|
102
|
+
if (value === "0x") {
|
|
103
|
+
return Zero;
|
|
104
|
+
}
|
|
89
105
|
return BigNumber.from(value);
|
|
90
106
|
}
|
|
91
107
|
|
|
92
108
|
// Legacy Transaction Fields
|
|
93
109
|
const transactionFields = [
|
|
94
|
-
{ name: "nonce",
|
|
110
|
+
{ name: "nonce", maxLength: 32, numeric: true },
|
|
95
111
|
{ name: "gasPrice", maxLength: 32, numeric: true },
|
|
96
112
|
{ name: "gasLimit", maxLength: 32, numeric: true },
|
|
97
|
-
{ name: "to",
|
|
98
|
-
{ name: "value",
|
|
113
|
+
{ name: "to", length: 32 },
|
|
114
|
+
{ name: "value", maxLength: 32, numeric: true },
|
|
99
115
|
{ name: "data" },
|
|
100
116
|
];
|
|
101
117
|
|
|
102
|
-
const allowedTransactionKeys: { [
|
|
103
|
-
chainId: true,
|
|
104
|
-
|
|
118
|
+
const allowedTransactionKeys: { [key: string]: boolean } = {
|
|
119
|
+
chainId: true,
|
|
120
|
+
data: true,
|
|
121
|
+
gasLimit: true,
|
|
122
|
+
gasPrice: true,
|
|
123
|
+
nonce: true,
|
|
124
|
+
to: true,
|
|
125
|
+
type: true,
|
|
126
|
+
value: true,
|
|
127
|
+
};
|
|
105
128
|
|
|
106
129
|
export function computeAddress(publicKey: BytesLike | string): string {
|
|
107
130
|
return keccak256(publicKey);
|
|
@@ -115,52 +138,81 @@ export function recoverAddress(signature: SignatureLike): string {
|
|
|
115
138
|
function formatNumber(value: BigNumberish, name: string): Uint8Array {
|
|
116
139
|
const result = stripZeros(BigNumber.from(value).toHexString());
|
|
117
140
|
if (result.length > 32) {
|
|
118
|
-
logger.throwArgumentError(
|
|
141
|
+
logger.throwArgumentError(
|
|
142
|
+
"invalid length for " + name,
|
|
143
|
+
"transaction:" + name,
|
|
144
|
+
value,
|
|
145
|
+
);
|
|
119
146
|
}
|
|
120
147
|
return result;
|
|
121
148
|
}
|
|
122
149
|
|
|
123
|
-
function accessSetify(
|
|
150
|
+
function accessSetify(
|
|
151
|
+
addr: string,
|
|
152
|
+
storageKeys: Array<string>,
|
|
153
|
+
): { address: string; storageKeys: Array<string> } {
|
|
124
154
|
return {
|
|
125
155
|
address: getAddress(addr),
|
|
126
156
|
storageKeys: (storageKeys || []).map((storageKey, index) => {
|
|
127
157
|
if (hexDataLength(storageKey) !== 32) {
|
|
128
|
-
logger.throwArgumentError(
|
|
158
|
+
logger.throwArgumentError(
|
|
159
|
+
"invalid access list storageKey",
|
|
160
|
+
`accessList[${addr}:${index}]`,
|
|
161
|
+
storageKey,
|
|
162
|
+
);
|
|
129
163
|
}
|
|
130
164
|
return storageKey.toLowerCase();
|
|
131
|
-
})
|
|
165
|
+
}),
|
|
132
166
|
};
|
|
133
167
|
}
|
|
134
168
|
|
|
135
169
|
export function accessListify(value: AccessListish): AccessList {
|
|
136
170
|
if (Array.isArray(value)) {
|
|
137
|
-
return (<
|
|
171
|
+
return (<
|
|
172
|
+
Array<
|
|
173
|
+
| [string, Array<string>]
|
|
174
|
+
| { address: string; storageKeys: Array<string> }
|
|
175
|
+
>
|
|
176
|
+
>value).map((set, index) => {
|
|
138
177
|
if (Array.isArray(set)) {
|
|
139
178
|
if (set.length > 2) {
|
|
140
|
-
logger.throwArgumentError(
|
|
179
|
+
logger.throwArgumentError(
|
|
180
|
+
"access list expected to be [ address, storageKeys[] ]",
|
|
181
|
+
`value[${index}]`,
|
|
182
|
+
set,
|
|
183
|
+
);
|
|
141
184
|
}
|
|
142
|
-
return accessSetify(set[0], set[1])
|
|
185
|
+
return accessSetify(set[0], set[1]);
|
|
143
186
|
}
|
|
144
187
|
return accessSetify(set.address, set.storageKeys);
|
|
145
188
|
});
|
|
146
189
|
}
|
|
147
190
|
|
|
148
|
-
const result: Array<{ address: string
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
191
|
+
const result: Array<{ address: string; storageKeys: Array<string> }> =
|
|
192
|
+
Object.keys(value).map((addr) => {
|
|
193
|
+
const storageKeys: Record<string, true> = value[addr].reduce(
|
|
194
|
+
(accum, storageKey) => {
|
|
195
|
+
accum[storageKey] = true;
|
|
196
|
+
return accum;
|
|
197
|
+
},
|
|
198
|
+
<Record<string, true>>{},
|
|
199
|
+
);
|
|
200
|
+
return accessSetify(addr, Object.keys(storageKeys).sort());
|
|
201
|
+
});
|
|
202
|
+
result.sort((a, b) => a.address.localeCompare(b.address));
|
|
156
203
|
return result;
|
|
157
204
|
}
|
|
158
205
|
|
|
159
|
-
function formatAccessList(
|
|
160
|
-
|
|
206
|
+
function formatAccessList(
|
|
207
|
+
value: AccessListish,
|
|
208
|
+
): Array<[string, Array<string>]> {
|
|
209
|
+
return accessListify(value).map((set) => [set.address, set.storageKeys]);
|
|
161
210
|
}
|
|
162
211
|
|
|
163
|
-
function _serializeEip1559(
|
|
212
|
+
function _serializeEip1559(
|
|
213
|
+
transaction: UnsignedTransaction,
|
|
214
|
+
signature?: SignatureLike,
|
|
215
|
+
): string {
|
|
164
216
|
// If there is an explicit gasPrice, make sure it matches the
|
|
165
217
|
// EIP-1559 fees; otherwise they may not understand what they
|
|
166
218
|
// think they are setting in terms of fee.
|
|
@@ -168,72 +220,100 @@ function _serializeEip1559(transaction: UnsignedTransaction, signature?: Signatu
|
|
|
168
220
|
const gasPrice = BigNumber.from(transaction.gasPrice);
|
|
169
221
|
const maxFeePerGas = BigNumber.from(transaction.maxFeePerGas || 0);
|
|
170
222
|
if (!gasPrice.eq(maxFeePerGas)) {
|
|
171
|
-
logger.throwArgumentError(
|
|
172
|
-
gasPrice
|
|
173
|
-
|
|
223
|
+
logger.throwArgumentError(
|
|
224
|
+
"mismatch EIP-1559 gasPrice != maxFeePerGas",
|
|
225
|
+
"tx",
|
|
226
|
+
{
|
|
227
|
+
gasPrice,
|
|
228
|
+
maxFeePerGas,
|
|
229
|
+
},
|
|
230
|
+
);
|
|
174
231
|
}
|
|
175
232
|
}
|
|
176
233
|
|
|
177
234
|
const fields: any = [
|
|
178
235
|
formatNumber(transaction.chainId || 0, "chainId"),
|
|
179
236
|
formatNumber(transaction.nonce || 0, "nonce"),
|
|
180
|
-
formatNumber(
|
|
237
|
+
formatNumber(
|
|
238
|
+
transaction.maxPriorityFeePerGas || 0,
|
|
239
|
+
"maxPriorityFeePerGas",
|
|
240
|
+
),
|
|
181
241
|
formatNumber(transaction.maxFeePerGas || 0, "maxFeePerGas"),
|
|
182
242
|
formatNumber(transaction.gasLimit || 0, "gasLimit"),
|
|
183
|
-
|
|
243
|
+
transaction.to != null ? getAddress(transaction.to) : "0x",
|
|
184
244
|
formatNumber(transaction.value || 0, "value"),
|
|
185
|
-
|
|
186
|
-
|
|
245
|
+
transaction.data || "0x",
|
|
246
|
+
formatAccessList(transaction.accessList || []),
|
|
187
247
|
];
|
|
188
248
|
|
|
189
249
|
if (signature) {
|
|
190
|
-
fields.push(joinSignature(signature))
|
|
250
|
+
fields.push(joinSignature(signature));
|
|
191
251
|
}
|
|
192
252
|
|
|
193
|
-
return hexConcat([
|
|
253
|
+
return hexConcat(["0x02", RLP.encode(fields)]);
|
|
194
254
|
}
|
|
195
255
|
|
|
196
|
-
function _serializeEip2930(
|
|
256
|
+
function _serializeEip2930(
|
|
257
|
+
transaction: UnsignedTransaction,
|
|
258
|
+
signature?: SignatureLike,
|
|
259
|
+
): string {
|
|
197
260
|
const fields: any = [
|
|
198
261
|
formatNumber(transaction.chainId || 0, "chainId"),
|
|
199
262
|
formatNumber(transaction.nonce || 0, "nonce"),
|
|
200
263
|
formatNumber(transaction.gasPrice || 0, "gasPrice"),
|
|
201
264
|
formatNumber(transaction.gasLimit || 0, "gasLimit"),
|
|
202
|
-
|
|
265
|
+
transaction.to != null ? getAddress(transaction.to) : "0x",
|
|
203
266
|
formatNumber(transaction.value || 0, "value"),
|
|
204
|
-
|
|
205
|
-
|
|
267
|
+
transaction.data || "0x",
|
|
268
|
+
formatAccessList(transaction.accessList || []),
|
|
206
269
|
];
|
|
207
270
|
|
|
208
271
|
if (signature) {
|
|
209
272
|
fields.push(joinSignature(signature));
|
|
210
273
|
}
|
|
211
274
|
|
|
212
|
-
return hexConcat([
|
|
275
|
+
return hexConcat(["0x01", RLP.encode(fields)]);
|
|
213
276
|
}
|
|
214
277
|
|
|
215
278
|
// Legacy Transactions and EIP-155
|
|
216
|
-
function _serialize(
|
|
279
|
+
function _serialize(
|
|
280
|
+
transaction: UnsignedTransaction,
|
|
281
|
+
signature?: SignatureLike,
|
|
282
|
+
): string {
|
|
217
283
|
checkProperties(transaction, allowedTransactionKeys);
|
|
218
284
|
|
|
219
285
|
const raw: Array<string | Uint8Array> = [];
|
|
220
286
|
|
|
221
|
-
transactionFields.forEach(function(fieldInfo) {
|
|
222
|
-
let value = (<any>transaction)[fieldInfo.name] ||
|
|
223
|
-
const options: DataOptions = {
|
|
224
|
-
if (fieldInfo.numeric) {
|
|
287
|
+
transactionFields.forEach(function (fieldInfo) {
|
|
288
|
+
let value = (<any>transaction)[fieldInfo.name] || [];
|
|
289
|
+
const options: DataOptions = {};
|
|
290
|
+
if (fieldInfo.numeric) {
|
|
291
|
+
options.hexPad = "left";
|
|
292
|
+
}
|
|
225
293
|
value = arrayify(hexlify(value, options));
|
|
226
294
|
|
|
227
295
|
// Fixed-width field
|
|
228
|
-
if (
|
|
229
|
-
|
|
296
|
+
if (
|
|
297
|
+
fieldInfo.length &&
|
|
298
|
+
value.length !== fieldInfo.length &&
|
|
299
|
+
value.length > 0
|
|
300
|
+
) {
|
|
301
|
+
logger.throwArgumentError(
|
|
302
|
+
"invalid length for " + fieldInfo.name,
|
|
303
|
+
"transaction:" + fieldInfo.name,
|
|
304
|
+
value,
|
|
305
|
+
);
|
|
230
306
|
}
|
|
231
307
|
|
|
232
308
|
// Variable-width (with a maximum)
|
|
233
309
|
if (fieldInfo.maxLength) {
|
|
234
310
|
value = stripZeros(value);
|
|
235
311
|
if (value.length > fieldInfo.maxLength) {
|
|
236
|
-
logger.throwArgumentError(
|
|
312
|
+
logger.throwArgumentError(
|
|
313
|
+
"invalid length for " + fieldInfo.name,
|
|
314
|
+
"transaction:" + fieldInfo.name,
|
|
315
|
+
value,
|
|
316
|
+
);
|
|
237
317
|
}
|
|
238
318
|
}
|
|
239
319
|
|
|
@@ -245,8 +325,12 @@ function _serialize(transaction: UnsignedTransaction, signature?: SignatureLike)
|
|
|
245
325
|
// A chainId was provided; if non-zero we'll use EIP-155
|
|
246
326
|
chainId = transaction.chainId;
|
|
247
327
|
|
|
248
|
-
if (typeof
|
|
249
|
-
logger.throwArgumentError(
|
|
328
|
+
if (typeof chainId !== "number") {
|
|
329
|
+
logger.throwArgumentError(
|
|
330
|
+
"invalid transaction.chainId",
|
|
331
|
+
"transaction",
|
|
332
|
+
transaction,
|
|
333
|
+
);
|
|
250
334
|
}
|
|
251
335
|
}
|
|
252
336
|
|
|
@@ -262,11 +346,18 @@ function _serialize(transaction: UnsignedTransaction, signature?: SignatureLike)
|
|
|
262
346
|
return RLP.encode(raw);
|
|
263
347
|
}
|
|
264
348
|
|
|
265
|
-
export function serialize(
|
|
349
|
+
export function serialize(
|
|
350
|
+
transaction: UnsignedTransaction,
|
|
351
|
+
signature?: SignatureLike,
|
|
352
|
+
): string {
|
|
266
353
|
// Legacy and EIP-155 Transactions
|
|
267
354
|
if (transaction.type == null || transaction.type === 0) {
|
|
268
355
|
if (transaction.accessList != null) {
|
|
269
|
-
logger.throwArgumentError(
|
|
356
|
+
logger.throwArgumentError(
|
|
357
|
+
"untyped transactions do not support accessList; include type: 1",
|
|
358
|
+
"transaction",
|
|
359
|
+
transaction,
|
|
360
|
+
);
|
|
270
361
|
}
|
|
271
362
|
return _serialize(transaction, signature);
|
|
272
363
|
}
|
|
@@ -281,17 +372,25 @@ export function serialize(transaction: UnsignedTransaction, signature?: Signatur
|
|
|
281
372
|
break;
|
|
282
373
|
}
|
|
283
374
|
|
|
284
|
-
return logger.throwError(
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
375
|
+
return logger.throwError(
|
|
376
|
+
`unsupported transaction type: ${transaction.type}`,
|
|
377
|
+
Logger.errors.UNSUPPORTED_OPERATION,
|
|
378
|
+
{
|
|
379
|
+
operation: "serializeTransaction",
|
|
380
|
+
transactionType: transaction.type,
|
|
381
|
+
},
|
|
382
|
+
);
|
|
288
383
|
}
|
|
289
384
|
|
|
290
385
|
function _parseEip1559(payload: Uint8Array): Transaction {
|
|
291
386
|
const transaction = RLP.decode(payload.slice(1));
|
|
292
387
|
|
|
293
388
|
if (transaction.length !== 9 && transaction.length !== 10) {
|
|
294
|
-
logger.throwArgumentError(
|
|
389
|
+
logger.throwArgumentError(
|
|
390
|
+
"invalid component count for transaction type: 2",
|
|
391
|
+
"payload",
|
|
392
|
+
hexlify(payload),
|
|
393
|
+
);
|
|
295
394
|
}
|
|
296
395
|
|
|
297
396
|
const maxPriorityFeePerGas = handleNumber(transaction[2]);
|
|
@@ -311,11 +410,13 @@ function _parseEip1559(payload: Uint8Array): Transaction {
|
|
|
311
410
|
};
|
|
312
411
|
|
|
313
412
|
// Unsigned EIP-1559 Transaction
|
|
314
|
-
if (transaction.length === 9) {
|
|
413
|
+
if (transaction.length === 9) {
|
|
414
|
+
return tx;
|
|
415
|
+
}
|
|
315
416
|
|
|
316
417
|
tx.hash = keccak256(payload);
|
|
317
418
|
tx.signature = splitSignature(transaction.slice(9)[0]);
|
|
318
|
-
tx.from = computeAddress(tx.signature.publicKey)
|
|
419
|
+
tx.from = computeAddress(tx.signature.publicKey);
|
|
319
420
|
|
|
320
421
|
return tx;
|
|
321
422
|
}
|
|
@@ -324,7 +425,11 @@ function _parseEip2930(payload: Uint8Array): Transaction {
|
|
|
324
425
|
const transaction = RLP.decode(payload.slice(1));
|
|
325
426
|
|
|
326
427
|
if (transaction.length !== 8 && transaction.length !== 9) {
|
|
327
|
-
logger.throwArgumentError(
|
|
428
|
+
logger.throwArgumentError(
|
|
429
|
+
"invalid component count for transaction type: 1",
|
|
430
|
+
"payload",
|
|
431
|
+
hexlify(payload),
|
|
432
|
+
);
|
|
328
433
|
}
|
|
329
434
|
|
|
330
435
|
const tx: Transaction = {
|
|
@@ -341,7 +446,9 @@ function _parseEip2930(payload: Uint8Array): Transaction {
|
|
|
341
446
|
};
|
|
342
447
|
|
|
343
448
|
// Unsigned EIP-2930 Transaction
|
|
344
|
-
if (transaction.length === 8) {
|
|
449
|
+
if (transaction.length === 8) {
|
|
450
|
+
return tx;
|
|
451
|
+
}
|
|
345
452
|
|
|
346
453
|
tx.hash = keccak256(payload);
|
|
347
454
|
tx.signature = splitSignature(transaction.slice(8)[0]);
|
|
@@ -353,8 +460,16 @@ function _parseEip2930(payload: Uint8Array): Transaction {
|
|
|
353
460
|
function _parseLegacyAndEIP_155(rawTransaction: Uint8Array): Transaction {
|
|
354
461
|
const transaction = RLP.decode(rawTransaction);
|
|
355
462
|
|
|
356
|
-
if (
|
|
357
|
-
|
|
463
|
+
if (
|
|
464
|
+
transaction.length !== 8 &&
|
|
465
|
+
transaction.length !== 7 &&
|
|
466
|
+
transaction.length !== 6
|
|
467
|
+
) {
|
|
468
|
+
logger.throwArgumentError(
|
|
469
|
+
"invalid raw transaction",
|
|
470
|
+
"rawTransaction",
|
|
471
|
+
rawTransaction,
|
|
472
|
+
);
|
|
358
473
|
}
|
|
359
474
|
|
|
360
475
|
const tx: Transaction = {
|
|
@@ -364,7 +479,7 @@ function _parseLegacyAndEIP_155(rawTransaction: Uint8Array): Transaction {
|
|
|
364
479
|
to: handleAddress(transaction[3]),
|
|
365
480
|
value: handleNumber(transaction[4]),
|
|
366
481
|
data: transaction[5],
|
|
367
|
-
chainId: 0
|
|
482
|
+
chainId: 0,
|
|
368
483
|
};
|
|
369
484
|
|
|
370
485
|
tx.type = null;
|
|
@@ -374,16 +489,17 @@ function _parseLegacyAndEIP_155(rawTransaction: Uint8Array): Transaction {
|
|
|
374
489
|
case 6: // Legacy unsigned transaction
|
|
375
490
|
break;
|
|
376
491
|
case 7: // Legacy signed transaction or EIP-155 unsigned transaction
|
|
377
|
-
|
|
378
492
|
let temp = transaction.slice(6)[0];
|
|
379
|
-
if(temp.length == 6522){
|
|
493
|
+
if (temp.length == 6522) {
|
|
494
|
+
//Legacy signed transaction
|
|
380
495
|
tx.hash = keccak256(rawTransaction);
|
|
381
496
|
tx.signature = splitSignature(temp);
|
|
382
497
|
tx.from = computeAddress(tx.signature.publicKey);
|
|
383
|
-
}else{
|
|
498
|
+
} else {
|
|
499
|
+
//EIP-155 unsigned transaction
|
|
384
500
|
tx.chainId = BigNumber.from(temp).toNumber();
|
|
385
501
|
}
|
|
386
|
-
|
|
502
|
+
|
|
387
503
|
break;
|
|
388
504
|
|
|
389
505
|
case 8: // // EIP-155 signed transaction
|
|
@@ -404,7 +520,9 @@ export function parse(rawTransaction: BytesLike): Transaction {
|
|
|
404
520
|
const payload = arrayify(rawTransaction);
|
|
405
521
|
|
|
406
522
|
// Legacy and EIP-155 Transactions
|
|
407
|
-
if (payload[0] > 0x7f) {
|
|
523
|
+
if (payload[0] > 0x7f) {
|
|
524
|
+
return _parseLegacyAndEIP_155(payload);
|
|
525
|
+
}
|
|
408
526
|
|
|
409
527
|
// Typed Transaction (EIP-2718)
|
|
410
528
|
switch (payload[0]) {
|
|
@@ -416,10 +534,12 @@ export function parse(rawTransaction: BytesLike): Transaction {
|
|
|
416
534
|
break;
|
|
417
535
|
}
|
|
418
536
|
|
|
419
|
-
return logger.throwError(
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
537
|
+
return logger.throwError(
|
|
538
|
+
`unsupported transaction type: ${payload[0]}`,
|
|
539
|
+
Logger.errors.UNSUPPORTED_OPERATION,
|
|
540
|
+
{
|
|
541
|
+
operation: "parseTransaction",
|
|
542
|
+
transactionType: payload[0],
|
|
543
|
+
},
|
|
544
|
+
);
|
|
423
545
|
}
|
|
424
|
-
|
|
425
|
-
[0x8004605941139387635763a13a795c4dfb9904beb9555e76629321312908dbd5 != 0x8004605941139387635763A13a795c4dfb9904bEb9555e76629321312908dbd5]
|