Skip to content

Commit 0a25e0d

Browse files
committed
fix transaction receipt
1 parent bd14849 commit 0a25e0d

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/createRollupPrepareTransactionReceipt.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ import {
77
DecodeEventLogReturnType,
88
} from 'viem';
99

10-
import { rollupCreatorABI as rollupCreatorV3Dot1ABI } from './contracts/RollupCreator';
10+
import { rollupCreatorABI as rollupCreatorV3Dot2ABI } from './contracts/RollupCreator/v3.2';
11+
import { rollupCreatorABI as rollupCreatorV3Dot1ABI } from './contracts/RollupCreator/v3.1';
1112
import { rollupCreatorABI as rollupCreatorV2Dot1ABI } from './contracts/RollupCreator/v2.1';
1213

1314
import { CoreContracts } from './types/CoreContracts';
1415

1516
function findRollupCreatedEventLog(txReceipt: TransactionReceipt): Log<bigint, number> {
17+
// v3.2
18+
const v3Dot2EventSelector = getEventSelector(
19+
getAbiItem({ abi: rollupCreatorV3Dot2ABI, name: 'RollupCreated' }),
20+
);
1621
// v3.1
1722
const v3Dot1EventSelector = getEventSelector(
1823
getAbiItem({ abi: rollupCreatorV3Dot1ABI, name: 'RollupCreated' }),
@@ -24,7 +29,11 @@ function findRollupCreatedEventLog(txReceipt: TransactionReceipt): Log<bigint, n
2429

2530
const log = txReceipt.logs.find((log) => {
2631
const topic = log.topics[0];
27-
return topic === v3Dot1EventSelector || topic === v2Dot1EventSelector;
32+
return (
33+
topic === v3Dot2EventSelector ||
34+
topic === v3Dot1EventSelector ||
35+
topic === v2Dot1EventSelector
36+
);
2837
});
2938

3039
if (typeof log === 'undefined') {
@@ -37,6 +46,8 @@ function findRollupCreatedEventLog(txReceipt: TransactionReceipt): Log<bigint, n
3746
}
3847

3948
type DecodeRollupCreatedEventLogReturnType = DecodeEventLogReturnType<
49+
// v3.2
50+
| typeof rollupCreatorV3Dot2ABI
4051
// v3.1
4152
| typeof rollupCreatorV3Dot1ABI
4253
// v2.1 and v1.1 are the same, so we only need to handle v2.1
@@ -51,6 +62,8 @@ function decodeRollupCreatedEventLog(
5162

5263
// try parsing from multiple RollupCreator versions
5364
[
65+
// v3.2
66+
rollupCreatorV3Dot2ABI,
5467
// v3.1
5568
rollupCreatorV3Dot1ABI,
5669
// v2.1 and v1.1 are the same, so we only need to handle v2.1

0 commit comments

Comments
 (0)