@gzeoneth/gov-tracker 0.1.0 → 0.1.1-0
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 +75 -119
- package/dist/calldata/address-utils.d.ts +22 -0
- package/dist/calldata/address-utils.d.ts.map +1 -0
- package/dist/calldata/address-utils.js +84 -0
- package/dist/calldata/address-utils.js.map +1 -0
- package/dist/calldata/decoder.d.ts +27 -0
- package/dist/calldata/decoder.d.ts.map +1 -0
- package/dist/calldata/decoder.js +238 -0
- package/dist/calldata/decoder.js.map +1 -0
- package/dist/calldata/index.d.ts +13 -0
- package/dist/calldata/index.d.ts.map +1 -0
- package/dist/calldata/index.js +46 -0
- package/dist/calldata/index.js.map +1 -0
- package/dist/calldata/parameter-decoder.d.ts +44 -0
- package/dist/calldata/parameter-decoder.d.ts.map +1 -0
- package/dist/calldata/parameter-decoder.js +163 -0
- package/dist/calldata/parameter-decoder.js.map +1 -0
- package/dist/calldata/retryable-ticket.d.ts +55 -0
- package/dist/calldata/retryable-ticket.d.ts.map +1 -0
- package/dist/calldata/retryable-ticket.js +104 -0
- package/dist/calldata/retryable-ticket.js.map +1 -0
- package/dist/calldata/signature-lookup.d.ts +46 -0
- package/dist/calldata/signature-lookup.d.ts.map +1 -0
- package/dist/calldata/signature-lookup.js +160 -0
- package/dist/calldata/signature-lookup.js.map +1 -0
- package/dist/cli/lib/cli.d.ts +74 -6
- package/dist/cli/lib/cli.d.ts.map +1 -1
- package/dist/cli/lib/cli.js +240 -69
- package/dist/cli/lib/cli.js.map +1 -1
- package/dist/cli/monitor.js +258 -111
- package/dist/cli/monitor.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +48 -3
- package/dist/index.js.map +1 -1
- package/dist/simulation/address-alias.d.ts +35 -0
- package/dist/simulation/address-alias.d.ts.map +1 -0
- package/dist/simulation/address-alias.js +46 -0
- package/dist/simulation/address-alias.js.map +1 -0
- package/dist/simulation/index.d.ts +9 -0
- package/dist/simulation/index.d.ts.map +1 -0
- package/dist/simulation/index.js +26 -0
- package/dist/simulation/index.js.map +1 -0
- package/dist/simulation/simulation-data.d.ts +77 -0
- package/dist/simulation/simulation-data.d.ts.map +1 -0
- package/dist/simulation/simulation-data.js +327 -0
- package/dist/simulation/simulation-data.js.map +1 -0
- package/dist/stages/l2-to-l1-message.d.ts +2 -2
- package/dist/stages/l2-to-l1-message.d.ts.map +1 -1
- package/dist/stages/l2-to-l1-message.js +5 -3
- package/dist/stages/l2-to-l1-message.js.map +1 -1
- package/dist/stages/retryables.d.ts +2 -2
- package/dist/stages/retryables.d.ts.map +1 -1
- package/dist/stages/retryables.js +5 -3
- package/dist/stages/retryables.js.map +1 -1
- package/dist/stages/timelock.d.ts.map +1 -1
- package/dist/stages/timelock.js +5 -3
- package/dist/stages/timelock.js.map +1 -1
- package/dist/tracker/execute.d.ts.map +1 -1
- package/dist/tracker/execute.js +34 -22
- package/dist/tracker/execute.js.map +1 -1
- package/dist/tracker.d.ts.map +1 -1
- package/dist/tracker.js +6 -2
- package/dist/tracker.js.map +1 -1
- package/dist/types/calldata.d.ts +91 -0
- package/dist/types/calldata.d.ts.map +1 -0
- package/dist/types/calldata.js +9 -0
- package/dist/types/calldata.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/simulation.d.ts +101 -0
- package/dist/types/simulation.d.ts.map +1 -0
- package/dist/types/simulation.js +9 -0
- package/dist/types/simulation.js.map +1 -0
- package/dist/types/tracking.d.ts +2 -1
- package/dist/types/tracking.d.ts.map +1 -1
- package/dist/utils/error-classification.d.ts +13 -0
- package/dist/utils/error-classification.d.ts.map +1 -0
- package/dist/utils/error-classification.js +28 -0
- package/dist/utils/error-classification.js.map +1 -0
- package/dist/utils/stage-helpers.d.ts +1 -1
- package/dist/utils/stage-helpers.d.ts.map +1 -1
- package/dist/utils/stage-helpers.js +1 -1
- package/dist/utils/stage-helpers.js.map +1 -1
- package/dist/utils/urls.d.ts +24 -1
- package/dist/utils/urls.d.ts.map +1 -1
- package/dist/utils/urls.js +50 -0
- package/dist/utils/urls.js.map +1 -1
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
# @gzeoneth/gov-tracker
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Terminology
|
|
3
|
+
[](https://www.npmjs.com/package/@gzeoneth/gov-tracker)
|
|
4
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
| SDK Term | Description |
|
|
10
|
-
|----------|-------------|
|
|
11
|
-
| Constitutional | Core proposals requiring L1 round-trip (8-day L2 timelock) |
|
|
12
|
-
| Non-Constitutional | Treasury proposals, L2-only execution (3-day L2 timelock) |
|
|
13
|
-
| Election | Security Council election proposals |
|
|
6
|
+
Track and execute Arbitrum DAO governance proposal lifecycle stages.
|
|
14
7
|
|
|
15
8
|
## Installation
|
|
16
9
|
|
|
@@ -36,24 +29,21 @@ for (const stage of result.stages) {
|
|
|
36
29
|
console.log(`${stage.type}: ${stage.status}`);
|
|
37
30
|
}
|
|
38
31
|
|
|
39
|
-
// Track from timelock operation
|
|
40
|
-
const result = await tracker.trackFromTimelock(timelockAddress, { operationId: "0x..." });
|
|
41
|
-
|
|
42
32
|
// Track from transaction hash
|
|
43
33
|
const results = await tracker.trackByTxHash("0x...");
|
|
44
34
|
```
|
|
45
35
|
|
|
46
36
|
## Stages
|
|
47
37
|
|
|
48
|
-
| # | StageType | Description
|
|
49
|
-
|---|---------------------- |
|
|
50
|
-
| 1 | `PROPOSAL_CREATED` | Proposal submitted on-chain
|
|
51
|
-
| 2 | `VOTING_ACTIVE` | Voting period (~14-16 days)
|
|
52
|
-
| 3 | `PROPOSAL_QUEUED` | Queued in L2 timelock
|
|
53
|
-
| 4 | `L2_TIMELOCK` | L2 timelock delay + execution (3-8 days)
|
|
54
|
-
| 5 | `L2_TO_L1_MESSAGE` | Cross-chain message + challenge (~6.4 days)
|
|
55
|
-
| 6 | `L1_TIMELOCK` | L1 timelock delay + execution (3 days)
|
|
56
|
-
| 7 | `RETRYABLE_EXECUTED` | Retryable tickets redeemed on L2
|
|
38
|
+
| # | StageType | Description |
|
|
39
|
+
|---|---------------------- | ------------------------------------------- |
|
|
40
|
+
| 1 | `PROPOSAL_CREATED` | Proposal submitted on-chain |
|
|
41
|
+
| 2 | `VOTING_ACTIVE` | Voting period (~14-16 days) |
|
|
42
|
+
| 3 | `PROPOSAL_QUEUED` | Queued in L2 timelock |
|
|
43
|
+
| 4 | `L2_TIMELOCK` | L2 timelock delay + execution (3-8 days) |
|
|
44
|
+
| 5 | `L2_TO_L1_MESSAGE` | Cross-chain message + challenge (~6.4 days) |
|
|
45
|
+
| 6 | `L1_TIMELOCK` | L1 timelock delay + execution (3 days) |
|
|
46
|
+
| 7 | `RETRYABLE_EXECUTED` | Retryable tickets redeemed on L2 |
|
|
57
47
|
|
|
58
48
|
Statuses: `NOT_STARTED`, `PENDING`, `READY`, `COMPLETED`, `FAILED`, `SKIPPED`
|
|
59
49
|
|
|
@@ -73,34 +63,56 @@ if (readyStage) {
|
|
|
73
63
|
}
|
|
74
64
|
```
|
|
75
65
|
|
|
76
|
-
##
|
|
66
|
+
## Calldata Decoding & Simulation
|
|
77
67
|
|
|
78
|
-
|
|
68
|
+
Decode proposal calldata and prepare simulation data for Tenderly, Foundry, or other tools.
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
import {
|
|
72
|
+
decodeCalldata,
|
|
73
|
+
extractAllSimulationsFromDecoded,
|
|
74
|
+
getAddressLabel
|
|
75
|
+
} from "@gzeoneth/gov-tracker";
|
|
76
|
+
|
|
77
|
+
// Decode proposal actions
|
|
78
|
+
const stage = result.stages[0]; // PROPOSAL_CREATED
|
|
79
|
+
const { calldatas, targets } = stage.data;
|
|
80
|
+
|
|
81
|
+
for (let i = 0; i < calldatas.length; i++) {
|
|
82
|
+
const decoded = await decodeCalldata(calldatas[i], targets[i], 0, "arb1");
|
|
83
|
+
|
|
84
|
+
console.log(`${decoded.functionName}`);
|
|
85
|
+
console.log(`Target: ${getAddressLabel(targets[i], "arb1")}`);
|
|
86
|
+
|
|
87
|
+
// Extract simulation data
|
|
88
|
+
const sims = extractAllSimulationsFromDecoded(decoded, "arb1");
|
|
89
|
+
for (const sim of sims) {
|
|
90
|
+
console.log(`Network: ${sim.simulation.networkId}`);
|
|
91
|
+
console.log(`From: ${sim.simulation.from}`);
|
|
92
|
+
console.log(`To: ${sim.simulation.to}`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
See [Examples](./docs/EXAMPLES.md#calldata-decoding--simulation) for Tenderly and Foundry integration.
|
|
98
|
+
|
|
99
|
+
## CLI
|
|
79
100
|
|
|
80
101
|
```bash
|
|
81
|
-
#
|
|
102
|
+
# Track a proposal by transaction hash
|
|
82
103
|
npx @gzeoneth/gov-tracker track --tx 0x...
|
|
83
104
|
|
|
84
|
-
#
|
|
85
|
-
gov-tracker track --tx 0x...
|
|
105
|
+
# Decode and inspect calldata
|
|
106
|
+
npx @gzeoneth/gov-tracker track --tx 0x... --inspect-only
|
|
107
|
+
|
|
108
|
+
# Show simulation data for Tenderly/Foundry integration
|
|
109
|
+
npx @gzeoneth/gov-tracker track --tx 0x... --show-simulation
|
|
86
110
|
|
|
87
111
|
# Execute ready stages
|
|
88
|
-
gov-tracker track --tx 0x... --write --private-key $PRIVATE_KEY
|
|
112
|
+
npx @gzeoneth/gov-tracker track --tx 0x... --write --private-key $PRIVATE_KEY
|
|
89
113
|
|
|
90
114
|
# Discover and track all proposals
|
|
91
|
-
gov-tracker run
|
|
92
|
-
|
|
93
|
-
# Run with custom chunk sizes for log searches
|
|
94
|
-
gov-tracker run --l1-chunk-size 500000 --l2-chunk-size 5000000
|
|
95
|
-
|
|
96
|
-
# Run with concurrent tracking (faster for many proposals)
|
|
97
|
-
gov-tracker run --concurrency 4
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
For development, you can also use:
|
|
101
|
-
```bash
|
|
102
|
-
yarn monitor:track --tx 0x...
|
|
103
|
-
yarn monitor:run
|
|
115
|
+
npx @gzeoneth/gov-tracker run
|
|
104
116
|
```
|
|
105
117
|
|
|
106
118
|
## Environment
|
|
@@ -112,90 +124,34 @@ NOVA_RPC=https://nova.arbitrum.io/rpc
|
|
|
112
124
|
PRIVATE_KEY=0x... # For execution
|
|
113
125
|
```
|
|
114
126
|
|
|
115
|
-
##
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
yarn test # Utils tests (~1.5s, pre-commit)
|
|
119
|
-
yarn test:unit # Smoke tests (~45s, quick CI)
|
|
120
|
-
yarn test:integration # Full RPC tests (~10min)
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
## Publishing to npm
|
|
124
|
-
|
|
125
|
-
This section is for maintainers publishing new versions of the package.
|
|
126
|
-
|
|
127
|
-
### Prerequisites
|
|
128
|
-
|
|
129
|
-
1. **npm account**: You must have an npm account with publish access to the `@gzeoneth` scope
|
|
130
|
-
2. **Authentication**: Log in to npm locally:
|
|
131
|
-
```bash
|
|
132
|
-
npm login
|
|
133
|
-
```
|
|
134
|
-
3. **Clean state**: Ensure your working directory is clean (no uncommitted changes)
|
|
135
|
-
|
|
136
|
-
### Publishing Steps
|
|
137
|
-
|
|
138
|
-
1. **Update version**: Bump the version number in `package.json` using npm's version command:
|
|
139
|
-
```bash
|
|
140
|
-
# Patch release (0.1.0 -> 0.1.1)
|
|
141
|
-
npm version patch
|
|
142
|
-
|
|
143
|
-
# Minor release (0.1.0 -> 0.2.0)
|
|
144
|
-
npm version minor
|
|
127
|
+
## Documentation
|
|
145
128
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
129
|
+
- [Getting Started](./docs/GETTING_STARTED.md) - Installation and basic usage
|
|
130
|
+
- [API Reference](./docs/API.md) - Complete API documentation
|
|
131
|
+
- [Examples](./docs/EXAMPLES.md) - Common patterns and use cases
|
|
132
|
+
- [Architecture](./docs/ARCHITECTURE.md) - SDK internals and design
|
|
150
133
|
|
|
151
|
-
|
|
152
|
-
```bash
|
|
153
|
-
yarn test:all
|
|
154
|
-
```
|
|
134
|
+
## Development
|
|
155
135
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
4. **Publish to npm**:
|
|
163
|
-
```bash
|
|
164
|
-
npm publish --access public
|
|
165
|
-
```
|
|
166
|
-
Note: The `--access public` flag is required for scoped packages to be publicly accessible.
|
|
167
|
-
|
|
168
|
-
The `prepublishOnly` hook will automatically run linting, format checking, and build before publishing.
|
|
169
|
-
|
|
170
|
-
5. **Push to GitHub**: Push the version commit and tag to the repository:
|
|
171
|
-
```bash
|
|
172
|
-
git push && git push --tags
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
### Verification
|
|
136
|
+
```bash
|
|
137
|
+
yarn build # Compile TypeScript
|
|
138
|
+
yarn test # Run fast tests (no RPC)
|
|
139
|
+
yarn test:coverage # Run tests with coverage
|
|
140
|
+
yarn lint # Run ESLint
|
|
141
|
+
```
|
|
176
142
|
|
|
177
|
-
|
|
143
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for development workflow and publishing instructions.
|
|
178
144
|
|
|
179
|
-
|
|
180
|
-
```bash
|
|
181
|
-
npm view @gzeoneth/gov-tracker
|
|
182
|
-
```
|
|
145
|
+
## Terminology
|
|
183
146
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
```
|
|
147
|
+
| SDK Term | Description |
|
|
148
|
+
|----------|-------------|
|
|
149
|
+
| Constitutional | Core proposals requiring L1 round-trip (8-day L2 timelock) |
|
|
150
|
+
| Non-Constitutional | Treasury proposals, L2-only execution (3-day L2 timelock) |
|
|
151
|
+
| Election | Security Council election proposals |
|
|
190
152
|
|
|
191
|
-
|
|
192
|
-
```bash
|
|
193
|
-
npx @gzeoneth/gov-tracker --help
|
|
194
|
-
```
|
|
153
|
+
See [Arbitrum governance docs](https://docs.arbitrum.foundation/concepts/lifecycle-anatomy-aip-proposal) for more details.
|
|
195
154
|
|
|
196
|
-
|
|
155
|
+
## License
|
|
197
156
|
|
|
198
|
-
-
|
|
199
|
-
- **Version already exists**: The version in `package.json` has already been published. Bump the version number.
|
|
200
|
-
- **Build failures**: The `prepublishOnly` hook will fail if linting, formatting, or build fails. Fix the errors and try again.
|
|
201
|
-
- **Missing files**: Check the `files` array in `package.json` includes all necessary files (currently set to `["dist"]`).
|
|
157
|
+
Apache-2.0
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Address Utilities
|
|
3
|
+
*
|
|
4
|
+
* Chain-aware address labeling for known governance contracts.
|
|
5
|
+
*/
|
|
6
|
+
import type { ChainContext, KnownAddress } from "../types/calldata";
|
|
7
|
+
/**
|
|
8
|
+
* Get known address label
|
|
9
|
+
*
|
|
10
|
+
* @param address - Contract address
|
|
11
|
+
* @param chain - Chain context
|
|
12
|
+
* @returns Label if known, undefined otherwise
|
|
13
|
+
*/
|
|
14
|
+
export declare function getAddressLabel(address: string, chain: ChainContext): string | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Get all known addresses for a chain
|
|
17
|
+
*
|
|
18
|
+
* @param chain - Chain context
|
|
19
|
+
* @returns Array of known address entries
|
|
20
|
+
*/
|
|
21
|
+
export declare function getKnownAddresses(chain: ChainContext): KnownAddress[];
|
|
22
|
+
//# sourceMappingURL=address-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address-utils.d.ts","sourceRoot":"","sources":["../../src/calldata/address-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAiDpE;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAaxF;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,EAAE,CASrE"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Address Utilities
|
|
4
|
+
*
|
|
5
|
+
* Chain-aware address labeling for known governance contracts.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.getAddressLabel = getAddressLabel;
|
|
9
|
+
exports.getKnownAddresses = getKnownAddresses;
|
|
10
|
+
/**
|
|
11
|
+
* Known addresses registry organized by chain
|
|
12
|
+
*/
|
|
13
|
+
const KNOWN_ADDRESSES = {
|
|
14
|
+
arb1: {
|
|
15
|
+
// Governors
|
|
16
|
+
"0xf07DeD9dC292157749B6Fd268E37DF6EA38395B9": "Core Governor",
|
|
17
|
+
"0x789fC99093B09aD01C34DC7251D0C89ce743e5a4": "Treasury Governor",
|
|
18
|
+
"0x8a1cDA8dee421cD06023470608605934c16A05a0": "Nominee Election Governor",
|
|
19
|
+
"0x467923B9AE90BDB36BA88eCA11604D45F13b712C": "Member Election Governor",
|
|
20
|
+
// Timelocks
|
|
21
|
+
"0x34d45e99f7D8c45ed05B5cA72D54bbD1fb3F98f0": "L2 Core Timelock",
|
|
22
|
+
"0xbFc1FECa8B09A5c5D3EFfE7429eBE24b9c09EF58": "L2 Treasury Timelock",
|
|
23
|
+
// Other contracts
|
|
24
|
+
"0x912CE59144191C1204E64559FE8253a0e49E6548": "ARB Token",
|
|
25
|
+
"0xCF57572261c7c2BCF21ffD220ea7d1a27D40A827": "Arb1 UpgradeExecutor",
|
|
26
|
+
"0xD509E5f5aEe2A205F554f36E8a7d56094494eDFC": "Security Council Manager",
|
|
27
|
+
// Precompiles
|
|
28
|
+
"0x0000000000000000000000000000000000000064": "ArbSys",
|
|
29
|
+
"0x000000000000000000000000000000000000006E": "ArbRetryableTx",
|
|
30
|
+
},
|
|
31
|
+
nova: {
|
|
32
|
+
"0x86a02dD71363c440b21F4c0E5B2Ad01Ffe1A7482": "Nova UpgradeExecutor",
|
|
33
|
+
},
|
|
34
|
+
ethereum: {
|
|
35
|
+
// Timelock
|
|
36
|
+
"0xE6841D92B0C345144506576eC13ECf5103aC7f49": "L1 Timelock",
|
|
37
|
+
// UpgradeExecutor
|
|
38
|
+
"0x3ffFbAdAF827559da092217e474760E2b2c3CeDd": "L1 UpgradeExecutor",
|
|
39
|
+
// Delayed Inboxes
|
|
40
|
+
"0x4Dbd4fc535Ac27206064B68FfCf827b0A60BAB3f": "Arb1 Delayed Inbox",
|
|
41
|
+
"0xc4448b71118c9071Bcb9734A0EAc55D18A153949": "Nova Delayed Inbox",
|
|
42
|
+
// Special addresses
|
|
43
|
+
"0xa723C008e76E379c55599D2E4d93879BeaFDa79C": "Retryable Ticket Magic",
|
|
44
|
+
// Outboxes
|
|
45
|
+
"0x0B9857ae2D4A3DBe74ffE1d7DF045bb7F96E4840": "Arb1 Outbox",
|
|
46
|
+
"0xD4B80C3D7240325D18E645B49e6535A3Bf95cc58": "Nova Outbox",
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Get known address label
|
|
51
|
+
*
|
|
52
|
+
* @param address - Contract address
|
|
53
|
+
* @param chain - Chain context
|
|
54
|
+
* @returns Label if known, undefined otherwise
|
|
55
|
+
*/
|
|
56
|
+
function getAddressLabel(address, chain) {
|
|
57
|
+
const chainAddresses = KNOWN_ADDRESSES[chain];
|
|
58
|
+
if (!chainAddresses)
|
|
59
|
+
return undefined;
|
|
60
|
+
const lowerAddress = address.toLowerCase();
|
|
61
|
+
for (const [addr, label] of Object.entries(chainAddresses)) {
|
|
62
|
+
if (addr.toLowerCase() === lowerAddress) {
|
|
63
|
+
return label;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Get all known addresses for a chain
|
|
70
|
+
*
|
|
71
|
+
* @param chain - Chain context
|
|
72
|
+
* @returns Array of known address entries
|
|
73
|
+
*/
|
|
74
|
+
function getKnownAddresses(chain) {
|
|
75
|
+
const chainAddresses = KNOWN_ADDRESSES[chain];
|
|
76
|
+
if (!chainAddresses)
|
|
77
|
+
return [];
|
|
78
|
+
return Object.entries(chainAddresses).map(([address, label]) => ({
|
|
79
|
+
address,
|
|
80
|
+
label,
|
|
81
|
+
chain,
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=address-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address-utils.js","sourceRoot":"","sources":["../../src/calldata/address-utils.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AA0DH,0CAaC;AAQD,8CASC;AApFD;;GAEG;AACH,MAAM,eAAe,GAAiD;IACpE,IAAI,EAAE;QACJ,YAAY;QACZ,4CAA4C,EAAE,eAAe;QAC7D,4CAA4C,EAAE,mBAAmB;QACjE,4CAA4C,EAAE,2BAA2B;QACzE,4CAA4C,EAAE,0BAA0B;QAExE,YAAY;QACZ,4CAA4C,EAAE,kBAAkB;QAChE,4CAA4C,EAAE,sBAAsB;QAEpE,kBAAkB;QAClB,4CAA4C,EAAE,WAAW;QACzD,4CAA4C,EAAE,sBAAsB;QACpE,4CAA4C,EAAE,0BAA0B;QAExE,cAAc;QACd,4CAA4C,EAAE,QAAQ;QACtD,4CAA4C,EAAE,gBAAgB;KAC/D;IACD,IAAI,EAAE;QACJ,4CAA4C,EAAE,sBAAsB;KACrE;IACD,QAAQ,EAAE;QACR,WAAW;QACX,4CAA4C,EAAE,aAAa;QAE3D,kBAAkB;QAClB,4CAA4C,EAAE,oBAAoB;QAElE,kBAAkB;QAClB,4CAA4C,EAAE,oBAAoB;QAClE,4CAA4C,EAAE,oBAAoB;QAElE,oBAAoB;QACpB,4CAA4C,EAAE,wBAAwB;QAEtE,WAAW;QACX,4CAA4C,EAAE,aAAa;QAC3D,4CAA4C,EAAE,aAAa;KAC5D;CACF,CAAC;AAEF;;;;;;GAMG;AACH,SAAgB,eAAe,CAAC,OAAe,EAAE,KAAmB;IAClE,MAAM,cAAc,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IAC9C,IAAI,CAAC,cAAc;QAAE,OAAO,SAAS,CAAC;IAEtC,MAAM,YAAY,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAE3C,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;QAC3D,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,YAAY,EAAE,CAAC;YACxC,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,KAAmB;IACnD,MAAM,cAAc,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IAC9C,IAAI,CAAC,cAAc;QAAE,OAAO,EAAE,CAAC;IAE/B,OAAO,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;QAC/D,OAAO;QACP,KAAK;QACL,KAAK;KACN,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calldata Decoder
|
|
3
|
+
*
|
|
4
|
+
* Main decoder that orchestrates recursive calldata decoding with
|
|
5
|
+
* nested call handling and retryable ticket detection.
|
|
6
|
+
*/
|
|
7
|
+
import type { ChainContext, DecodedCalldata } from "../types/calldata";
|
|
8
|
+
/**
|
|
9
|
+
* Decode calldata with recursive nested decoding support
|
|
10
|
+
*
|
|
11
|
+
* @param calldata - Hex-encoded calldata string
|
|
12
|
+
* @param targetAddress - Optional target contract (for context)
|
|
13
|
+
* @param depth - Current recursion depth (internal, default: 0)
|
|
14
|
+
* @param chainContext - Chain for address resolution (default: "arb1")
|
|
15
|
+
* @returns Decoded calldata with nested calls
|
|
16
|
+
*/
|
|
17
|
+
export declare function decodeCalldata(calldata: string, targetAddress?: string, depth?: number, chainContext?: ChainContext): Promise<DecodedCalldata>;
|
|
18
|
+
/**
|
|
19
|
+
* Decode multiple calldatas with their targets
|
|
20
|
+
*
|
|
21
|
+
* @param calldatas - Array of calldata hex strings
|
|
22
|
+
* @param targets - Array of target addresses (same length as calldatas)
|
|
23
|
+
* @param chainContext - Chain for address resolution
|
|
24
|
+
* @returns Array of decoded calldata results
|
|
25
|
+
*/
|
|
26
|
+
export declare function decodeCalldataArray(calldatas: string[], targets: string[], chainContext?: ChainContext): Promise<DecodedCalldata[]>;
|
|
27
|
+
//# sourceMappingURL=decoder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decoder.d.ts","sourceRoot":"","sources":["../../src/calldata/decoder.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAoB,MAAM,mBAAmB,CAAC;AAuBzF;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,MAAM,EACtB,KAAK,SAAI,EACT,YAAY,GAAE,YAAqB,GAClC,OAAO,CAAC,eAAe,CAAC,CAgF1B;AA2ID;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,MAAM,EAAE,EACnB,OAAO,EAAE,MAAM,EAAE,EACjB,YAAY,GAAE,YAAqB,GAClC,OAAO,CAAC,eAAe,EAAE,CAAC,CAS5B"}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Calldata Decoder
|
|
4
|
+
*
|
|
5
|
+
* Main decoder that orchestrates recursive calldata decoding with
|
|
6
|
+
* nested call handling and retryable ticket detection.
|
|
7
|
+
*/
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.decodeCalldata = decodeCalldata;
|
|
13
|
+
exports.decodeCalldataArray = decodeCalldataArray;
|
|
14
|
+
const debug_1 = __importDefault(require("debug"));
|
|
15
|
+
const signature_lookup_1 = require("./signature-lookup");
|
|
16
|
+
const parameter_decoder_1 = require("./parameter-decoder");
|
|
17
|
+
const retryable_ticket_1 = require("./retryable-ticket");
|
|
18
|
+
const address_utils_1 = require("./address-utils");
|
|
19
|
+
const debug = (0, debug_1.default)("gov-tracker:calldata");
|
|
20
|
+
/**
|
|
21
|
+
* Maximum recursion depth for nested calldata decoding
|
|
22
|
+
*/
|
|
23
|
+
const MAX_DEPTH = 3;
|
|
24
|
+
/**
|
|
25
|
+
* Selector for sendTxToL1 - indicates L2→L1 message, nested content is on L1
|
|
26
|
+
*/
|
|
27
|
+
const SEND_TX_TO_L1_SELECTOR = "0x928c169a";
|
|
28
|
+
/**
|
|
29
|
+
* Decode calldata with recursive nested decoding support
|
|
30
|
+
*
|
|
31
|
+
* @param calldata - Hex-encoded calldata string
|
|
32
|
+
* @param targetAddress - Optional target contract (for context)
|
|
33
|
+
* @param depth - Current recursion depth (internal, default: 0)
|
|
34
|
+
* @param chainContext - Chain for address resolution (default: "arb1")
|
|
35
|
+
* @returns Decoded calldata with nested calls
|
|
36
|
+
*/
|
|
37
|
+
async function decodeCalldata(calldata, targetAddress, depth = 0, chainContext = "arb1") {
|
|
38
|
+
// Handle empty or invalid calldata
|
|
39
|
+
if (!calldata || calldata === "0x" || calldata.length < 10) {
|
|
40
|
+
return {
|
|
41
|
+
selector: "",
|
|
42
|
+
functionName: null,
|
|
43
|
+
signature: null,
|
|
44
|
+
parameters: null,
|
|
45
|
+
raw: calldata || "0x",
|
|
46
|
+
decodingSource: "failed",
|
|
47
|
+
chainContext,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
// Extract selector (first 4 bytes = 10 chars including 0x)
|
|
51
|
+
const selector = calldata.slice(0, 10).toLowerCase();
|
|
52
|
+
// Lookup signature
|
|
53
|
+
const { signature, source } = await (0, signature_lookup_1.lookupSignature)(selector);
|
|
54
|
+
if (!signature) {
|
|
55
|
+
debug("Unknown signature for selector: %s", selector);
|
|
56
|
+
return {
|
|
57
|
+
selector,
|
|
58
|
+
functionName: null,
|
|
59
|
+
signature: null,
|
|
60
|
+
parameters: null,
|
|
61
|
+
raw: calldata,
|
|
62
|
+
decodingSource: "failed",
|
|
63
|
+
chainContext,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const functionName = (0, signature_lookup_1.extractFunctionName)(signature);
|
|
67
|
+
// Determine chain context for nested content
|
|
68
|
+
// sendTxToL1 means nested content is on L1
|
|
69
|
+
const isSendTxToL1 = selector === SEND_TX_TO_L1_SELECTOR;
|
|
70
|
+
const nestedContext = isSendTxToL1 ? "ethereum" : chainContext;
|
|
71
|
+
// Decode parameters
|
|
72
|
+
const decoded = (0, parameter_decoder_1.decodeParameters)(calldata, signature, chainContext);
|
|
73
|
+
if (!decoded) {
|
|
74
|
+
debug("Failed to decode parameters for: %s", signature);
|
|
75
|
+
return {
|
|
76
|
+
selector,
|
|
77
|
+
functionName,
|
|
78
|
+
signature,
|
|
79
|
+
parameters: null,
|
|
80
|
+
raw: calldata,
|
|
81
|
+
decodingSource: source,
|
|
82
|
+
chainContext,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
const { params, decoded: rawDecoded } = decoded;
|
|
86
|
+
// For sendTxToL1, fix first param (target address) to use L1 context
|
|
87
|
+
if (isSendTxToL1 && params[0]?.type === "address") {
|
|
88
|
+
const addr = String(rawDecoded[0]);
|
|
89
|
+
const label = (0, address_utils_1.getAddressLabel)(addr, "ethereum");
|
|
90
|
+
if (label)
|
|
91
|
+
params[0].addressLabel = label;
|
|
92
|
+
}
|
|
93
|
+
// Process nested content if not at max depth
|
|
94
|
+
if (depth < MAX_DEPTH) {
|
|
95
|
+
await processNestedParams(params, Array.from(rawDecoded), nestedContext, depth);
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
selector,
|
|
99
|
+
functionName,
|
|
100
|
+
signature,
|
|
101
|
+
parameters: params,
|
|
102
|
+
raw: calldata,
|
|
103
|
+
decodingSource: source,
|
|
104
|
+
decodingTarget: targetAddress,
|
|
105
|
+
chainContext,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Process parameters to decode nested calldata
|
|
110
|
+
*/
|
|
111
|
+
async function processNestedParams(params, rawDecoded, chainContext, depth) {
|
|
112
|
+
// Find address[] parameter (for batch operations, provides targets)
|
|
113
|
+
const addressArrayParam = params.find((p) => p.type === "address[]");
|
|
114
|
+
let targets = [];
|
|
115
|
+
if (addressArrayParam) {
|
|
116
|
+
const rawValue = rawDecoded[params.indexOf(addressArrayParam)];
|
|
117
|
+
if (Array.isArray(rawValue)) {
|
|
118
|
+
targets = rawValue.map((a) => String(a));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// Find preceding address parameter for simple forwarding (e.g. sendTxToL1(address, bytes))
|
|
122
|
+
// We'll update this as we iterate
|
|
123
|
+
let lastAddressValue;
|
|
124
|
+
for (let paramIdx = 0; paramIdx < params.length; paramIdx++) {
|
|
125
|
+
const param = params[paramIdx];
|
|
126
|
+
const rawValue = rawDecoded[paramIdx];
|
|
127
|
+
// Capture address for context propagation to subsequent bytes params
|
|
128
|
+
if (param.type === "address") {
|
|
129
|
+
lastAddressValue = String(rawValue);
|
|
130
|
+
}
|
|
131
|
+
// Handle bytes[] array (e.g., scheduleBatch calldatas)
|
|
132
|
+
if (param.type === "bytes[]" && param._rawBytesArray) {
|
|
133
|
+
const nestedArray = [];
|
|
134
|
+
for (let i = 0; i < param._rawBytesArray.length; i++) {
|
|
135
|
+
const bytesItem = param._rawBytesArray[i];
|
|
136
|
+
const target = targets[i]; // Use target from parallel array
|
|
137
|
+
// Check for retryable ticket magic
|
|
138
|
+
if (target && (0, retryable_ticket_1.isRetryableTicketMagic)(target)) {
|
|
139
|
+
const retryable = (0, retryable_ticket_1.decodeRetryableTicket)(bytesItem);
|
|
140
|
+
if (retryable) {
|
|
141
|
+
const l2Chain = (0, retryable_ticket_1.retryableChainToContext)(retryable.chain);
|
|
142
|
+
const chainName = (0, retryable_ticket_1.getRetryableChainName)(retryable.chain);
|
|
143
|
+
// Decode l2Calldata with L2 chain context
|
|
144
|
+
let nestedL2Call;
|
|
145
|
+
if ((0, parameter_decoder_1.isLikelyCalldata)(retryable.l2Calldata)) {
|
|
146
|
+
nestedL2Call = await decodeCalldata(retryable.l2Calldata, retryable.l2Target, depth + 1, l2Chain);
|
|
147
|
+
}
|
|
148
|
+
// Create retryable structure with decoded L2 call
|
|
149
|
+
const retryableDecoded = {
|
|
150
|
+
selector: "",
|
|
151
|
+
functionName: `Retryable Ticket → ${chainName}`,
|
|
152
|
+
signature: null,
|
|
153
|
+
parameters: [
|
|
154
|
+
{
|
|
155
|
+
name: "inbox",
|
|
156
|
+
type: "address",
|
|
157
|
+
value: retryable.targetInbox,
|
|
158
|
+
isNested: false,
|
|
159
|
+
addressLabel: (0, address_utils_1.getAddressLabel)(retryable.targetInbox, "ethereum"),
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: "l2Target",
|
|
163
|
+
type: "address",
|
|
164
|
+
value: retryable.l2Target,
|
|
165
|
+
isNested: false,
|
|
166
|
+
addressLabel: (0, address_utils_1.getAddressLabel)(retryable.l2Target, l2Chain),
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: "l2Value",
|
|
170
|
+
type: "uint256",
|
|
171
|
+
value: retryable.l2Value,
|
|
172
|
+
isNested: false,
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: "gasLimit",
|
|
176
|
+
type: "uint256",
|
|
177
|
+
value: retryable.gasLimit,
|
|
178
|
+
isNested: false,
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: "maxFeePerGas",
|
|
182
|
+
type: "uint256",
|
|
183
|
+
value: retryable.maxFeePerGas,
|
|
184
|
+
isNested: false,
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: "l2Calldata",
|
|
188
|
+
type: "bytes",
|
|
189
|
+
value: retryable.l2Calldata,
|
|
190
|
+
isNested: !!nestedL2Call,
|
|
191
|
+
nested: nestedL2Call,
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
raw: bytesItem,
|
|
195
|
+
decodingSource: "local",
|
|
196
|
+
chainContext: "ethereum", // Retryable tickets are created on L1
|
|
197
|
+
};
|
|
198
|
+
nestedArray.push(retryableDecoded);
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
// Normal calldata decoding
|
|
203
|
+
if ((0, parameter_decoder_1.isLikelyCalldata)(bytesItem)) {
|
|
204
|
+
const decodedItem = await decodeCalldata(bytesItem, target, depth + 1, chainContext);
|
|
205
|
+
nestedArray.push(decodedItem);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (nestedArray.length > 0) {
|
|
209
|
+
param.nestedArray = nestedArray;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
// Handle single bytes parameter
|
|
213
|
+
else if (param.type === "bytes" && param.isNested) {
|
|
214
|
+
const rawBytes = String(rawValue);
|
|
215
|
+
if ((0, parameter_decoder_1.isLikelyCalldata)(rawBytes)) {
|
|
216
|
+
// Use lastAddressValue as target if available
|
|
217
|
+
param.nested = await decodeCalldata(rawBytes, lastAddressValue, depth + 1, chainContext);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Decode multiple calldatas with their targets
|
|
224
|
+
*
|
|
225
|
+
* @param calldatas - Array of calldata hex strings
|
|
226
|
+
* @param targets - Array of target addresses (same length as calldatas)
|
|
227
|
+
* @param chainContext - Chain for address resolution
|
|
228
|
+
* @returns Array of decoded calldata results
|
|
229
|
+
*/
|
|
230
|
+
async function decodeCalldataArray(calldatas, targets, chainContext = "arb1") {
|
|
231
|
+
const results = [];
|
|
232
|
+
for (let i = 0; i < calldatas.length; i++) {
|
|
233
|
+
const decoded = await decodeCalldata(calldatas[i], targets[i], 0, chainContext);
|
|
234
|
+
results.push(decoded);
|
|
235
|
+
}
|
|
236
|
+
return results;
|
|
237
|
+
}
|
|
238
|
+
//# sourceMappingURL=decoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decoder.js","sourceRoot":"","sources":["../../src/calldata/decoder.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAmCH,wCAqFC;AAmJD,kDAaC;AAtRD,kDAA0B;AAE1B,yDAA0E;AAC1E,2DAAyE;AACzE,yDAK4B;AAC5B,mDAAkD;AAElD,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,sBAAsB,CAAC,CAAC;AAE5C;;GAEG;AACH,MAAM,SAAS,GAAG,CAAC,CAAC;AAEpB;;GAEG;AACH,MAAM,sBAAsB,GAAG,YAAY,CAAC;AAE5C;;;;;;;;GAQG;AACI,KAAK,UAAU,cAAc,CAClC,QAAgB,EAChB,aAAsB,EACtB,KAAK,GAAG,CAAC,EACT,eAA6B,MAAM;IAEnC,mCAAmC;IACnC,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;QAC3D,OAAO;YACL,QAAQ,EAAE,EAAE;YACZ,YAAY,EAAE,IAAI;YAClB,SAAS,EAAE,IAAI;YACf,U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AAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC;QAChF,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calldata Decoding Module
|
|
3
|
+
*
|
|
4
|
+
* Exports for recursive calldata decoding, signature lookup,
|
|
5
|
+
* and address utilities.
|
|
6
|
+
*/
|
|
7
|
+
export { decodeCalldata, decodeCalldataArray } from "./decoder";
|
|
8
|
+
export { lookupSignature, lookupLocalSignature, lookup4byteDirectory, extractFunctionName, clearSignatureCache, } from "./signature-lookup";
|
|
9
|
+
export { parseParamTypes, isLikelyCalldata, formatDecodedValue, decodeParameters, } from "./parameter-decoder";
|
|
10
|
+
export { getAddressLabel, getKnownAddresses } from "./address-utils";
|
|
11
|
+
export { getAddressExplorerUrl, getTxExplorerUrl, getChainLabel } from "../utils/urls";
|
|
12
|
+
export { RETRYABLE_TICKET_MAGIC, ARB1_DELAYED_INBOX, NOVA_DELAYED_INBOX, isRetryableTicketMagic, detectChainFromInbox, decodeRetryableTicket, getRetryableChainName, retryableChainToContext, } from "./retryable-ticket";
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/calldata/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGhE,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGrE,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGvF,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC"}
|