Skip to content

Commit d03d174

Browse files
bayulaksana479andrewklau
authored andcommitted
fix(app): fix aurora evm txn parsing
1 parent ca4ed21 commit d03d174

File tree

3 files changed

+67
-8
lines changed

3 files changed

+67
-8
lines changed

apps/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"classnames": "^2.5.1",
5050
"clipboard": "^2.0.11",
5151
"dayjs": "1.11.13",
52-
"ethers": "^5.7.2",
52+
"ethers": "^6.16.0",
5353
"formik": "^2.4.6",
5454
"highcharts": "^11.4.8",
5555
"highcharts-react-official": "^3.2.1",

apps/app/src/components/app/Transactions/Receipts/RlpTransaction.tsx

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,34 @@ const RlpTransaction = ({ method, pretty, receiver }: Props) => {
7373
}
7474

7575
try {
76-
const input = ethers?.utils?.base64?.decode(parsed?.tx_bytes_b64);
77-
const data = ethers?.utils?.parseTransaction(input);
76+
const input = ethers.decodeBase64(parsed?.tx_bytes_b64);
77+
const data = ethers.Transaction.from(ethers.hexlify(input));
7878
const parsedData = {
79-
...data,
79+
authorization: data?.authorizationList?.map((auth) => ({
80+
address: auth.address,
81+
chainId: auth.chainId?.toString(),
82+
nonce: auth.nonce?.toString(),
83+
signature: {
84+
r: auth.signature.r,
85+
s: auth.signature.s,
86+
v: auth.signature.v,
87+
},
88+
})),
89+
chainId: data?.chainId?.toString(),
90+
data: data?.data,
91+
from: data?.from,
8092
gasLimit: data?.gasLimit?.toString(),
8193
gasPrice: data?.gasPrice?.toString(),
94+
hash: data?.hash,
95+
maxFeePerGas: data?.maxFeePerGas?.toString(),
96+
maxPriorityFeePerGas: data?.maxPriorityFeePerGas?.toString(),
97+
nonce: data?.nonce,
98+
signature: {
99+
r: data?.signature?.r,
100+
s: data?.signature?.s,
101+
v: data?.signature?.v,
102+
},
103+
to: data?.to?.toString(),
82104
value: data?.value?.toString(),
83105
};
84106

@@ -98,11 +120,35 @@ const RlpTransaction = ({ method, pretty, receiver }: Props) => {
98120
const buffer = Buffer.from(parsed.tx_bytes_b64, 'base64');
99121
const submitArgs = deserializeUnchecked(schema, SubmitArgs, buffer);
100122

101-
const data = ethers?.utils?.parseTransaction(submitArgs.tx_data);
123+
const data = ethers.Transaction.from(
124+
ethers.hexlify(new Uint8Array(submitArgs.tx_data)),
125+
);
102126
const parsedData = {
103-
...data,
127+
authorization: data?.authorizationList?.map((auth) => ({
128+
address: auth.address,
129+
chainId: auth.chainId?.toString(),
130+
nonce: auth.nonce?.toString(),
131+
signature: {
132+
r: auth.signature.r,
133+
s: auth.signature.s,
134+
v: auth.signature.v,
135+
},
136+
})),
137+
chainId: data?.chainId?.toString(),
138+
data: data?.data,
139+
from: data?.from,
104140
gasLimit: data?.gasLimit?.toString(),
105141
gasPrice: data?.gasPrice?.toString(),
142+
hash: data?.hash,
143+
maxFeePerGas: data?.maxFeePerGas?.toString(),
144+
maxPriorityFeePerGas: data?.maxPriorityFeePerGas?.toString(),
145+
nonce: data?.nonce,
146+
signature: {
147+
r: data?.signature?.r,
148+
s: data?.signature?.s,
149+
v: data?.signature?.v,
150+
},
151+
to: data?.to?.toString(),
106152
value: data?.value?.toString(),
107153
};
108154

@@ -139,8 +185,8 @@ const RlpTransaction = ({ method, pretty, receiver }: Props) => {
139185
return data;
140186
}
141187

142-
const input = ethers?.utils?.base64?.decode(tx_bytes_b64);
143-
const txData = ethers?.utils?.parseTransaction(input);
188+
const input = ethers.decodeBase64(tx_bytes_b64);
189+
const txData = ethers.Transaction.from(ethers.hexlify(input));
144190
const parsed = {
145191
...txData,
146192
gasLimit: txData?.gasLimit?.toString(),

yarn.lock

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20680,6 +20680,19 @@ ethers@6.15.0:
2068020680
tslib "2.7.0"
2068120681
ws "8.17.1"
2068220682

20683+
ethers@^6.16.0:
20684+
version "6.16.0"
20685+
resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.16.0.tgz#fff9b4f05d7a359c774ad6e91085a800f7fccf65"
20686+
integrity sha512-U1wulmetNymijEhpSEQ7Ct/P/Jw9/e7R1j5XIbPRydgV2DjLVMsULDlNksq3RQnFgKoLlZf88ijYtWEXcPa07A==
20687+
dependencies:
20688+
"@adraffy/ens-normalize" "1.10.1"
20689+
"@noble/curves" "1.2.0"
20690+
"@noble/hashes" "1.3.2"
20691+
"@types/node" "22.7.5"
20692+
aes-js "4.0.0-beta.5"
20693+
tslib "2.7.0"
20694+
ws "8.17.1"
20695+
2068320696
event-target-shim@^5.0.0:
2068420697
version "5.0.1"
2068520698
resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789"

0 commit comments

Comments
 (0)