ox 0.14.27 → 0.14.29
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/CHANGELOG.md +12 -0
- package/_cjs/tempo/MultisigConfig.js +135 -0
- package/_cjs/tempo/MultisigConfig.js.map +1 -0
- package/_cjs/tempo/SignatureEnvelope.js +128 -6
- package/_cjs/tempo/SignatureEnvelope.js.map +1 -1
- package/_cjs/tempo/index.js +2 -1
- package/_cjs/tempo/index.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/tempo/MultisigConfig.js +363 -0
- package/_esm/tempo/MultisigConfig.js.map +1 -0
- package/_esm/tempo/SignatureEnvelope.js +237 -6
- package/_esm/tempo/SignatureEnvelope.js.map +1 -1
- package/_esm/tempo/index.js +26 -0
- package/_esm/tempo/index.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/tempo/MultisigConfig.d.ts +326 -0
- package/_types/tempo/MultisigConfig.d.ts.map +1 -0
- package/_types/tempo/SignatureEnvelope.d.ts +170 -8
- package/_types/tempo/SignatureEnvelope.d.ts.map +1 -1
- package/_types/tempo/index.d.ts +26 -0
- package/_types/tempo/index.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/package.json +6 -1
- package/tempo/MultisigConfig/package.json +6 -0
- package/tempo/MultisigConfig.test.ts +236 -0
- package/tempo/MultisigConfig.ts +501 -0
- package/tempo/SignatureEnvelope.test.ts +311 -2
- package/tempo/SignatureEnvelope.ts +368 -20
- package/tempo/e2e.test.ts +201 -0
- package/tempo/index.ts +26 -0
- package/version.ts +1 -1
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import * as Address from '../core/Address.js';
|
|
2
|
+
import * as Errors from '../core/Errors.js';
|
|
3
|
+
import * as Hash from '../core/Hash.js';
|
|
4
|
+
import * as Hex from '../core/Hex.js';
|
|
5
|
+
/** Maximum number of owners allowed in a native multisig config. */
|
|
6
|
+
export const maxOwners = 10;
|
|
7
|
+
/** Maximum encoded byte length for one primitive owner approval. */
|
|
8
|
+
export const maxOwnerSignatureBytes = 2049;
|
|
9
|
+
/** Tempo signature type byte for native multisig signatures. */
|
|
10
|
+
export const signatureTypeByte = '0x05';
|
|
11
|
+
/** Zero 32-byte salt (the default when no salt is provided). */
|
|
12
|
+
export const zeroSalt = `0x${'00'.repeat(32)}`;
|
|
13
|
+
/** Domain prefix for the native multisig account address derivation. */
|
|
14
|
+
const accountDomain = 'tempo:multisig:account';
|
|
15
|
+
/** Domain prefix for the native multisig config ID derivation. */
|
|
16
|
+
const configDomain = 'tempo:multisig:config';
|
|
17
|
+
/** Domain prefix for native multisig owner approvals. */
|
|
18
|
+
const signatureDomain = 'tempo:multisig:signature';
|
|
19
|
+
/**
|
|
20
|
+
* Asserts that a native multisig {@link ox#MultisigConfig.Config} is valid.
|
|
21
|
+
*
|
|
22
|
+
* Mirrors the Tempo `validate_multisig_config` rules: owners non-empty and
|
|
23
|
+
* `<= maxOwners`, strictly ascending unique nonzero owner addresses, nonzero
|
|
24
|
+
* owner weights, `threshold >= 1`, total weight `<= u32::MAX`, and
|
|
25
|
+
* `threshold <= total weight`.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts twoslash
|
|
29
|
+
* import { MultisigConfig } from 'ox/tempo'
|
|
30
|
+
*
|
|
31
|
+
* MultisigConfig.assert({
|
|
32
|
+
* threshold: 1,
|
|
33
|
+
* owners: [
|
|
34
|
+
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
35
|
+
* ],
|
|
36
|
+
* })
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @param config - The multisig config.
|
|
40
|
+
*/
|
|
41
|
+
export function assert(config) {
|
|
42
|
+
const { salt, threshold, owners } = config;
|
|
43
|
+
if (typeof salt !== 'undefined' && Hex.size(salt) !== 32)
|
|
44
|
+
throw new InvalidConfigError({ reason: 'salt must be 32 bytes' });
|
|
45
|
+
if (owners.length === 0)
|
|
46
|
+
throw new InvalidConfigError({ reason: 'owners cannot be empty' });
|
|
47
|
+
if (owners.length > maxOwners)
|
|
48
|
+
throw new InvalidConfigError({ reason: 'too many owners' });
|
|
49
|
+
if (Number(threshold) < 1)
|
|
50
|
+
throw new InvalidConfigError({ reason: 'threshold cannot be zero' });
|
|
51
|
+
let totalWeight = 0;
|
|
52
|
+
let previous;
|
|
53
|
+
for (const owner of owners) {
|
|
54
|
+
if (!Address.validate(owner.owner) || Hex.toBigInt(owner.owner) === 0n)
|
|
55
|
+
throw new InvalidConfigError({ reason: 'owner cannot be zero' });
|
|
56
|
+
if (Number(owner.weight) < 1)
|
|
57
|
+
throw new InvalidConfigError({ reason: 'owner weight cannot be zero' });
|
|
58
|
+
const current = Hex.toBigInt(owner.owner);
|
|
59
|
+
if (typeof previous !== 'undefined' && previous >= current)
|
|
60
|
+
throw new InvalidConfigError({
|
|
61
|
+
reason: 'owners must be strictly ascending',
|
|
62
|
+
});
|
|
63
|
+
previous = current;
|
|
64
|
+
totalWeight += Number(owner.weight);
|
|
65
|
+
}
|
|
66
|
+
if (totalWeight > 0xffffffff)
|
|
67
|
+
throw new InvalidConfigError({
|
|
68
|
+
reason: 'total owner weight exceeds u32 max',
|
|
69
|
+
});
|
|
70
|
+
if (Number(threshold) > totalWeight)
|
|
71
|
+
throw new InvalidConfigError({
|
|
72
|
+
reason: 'threshold exceeds total owner weight',
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Normalizes a native multisig {@link ox#MultisigConfig.Config}.
|
|
77
|
+
*
|
|
78
|
+
* Sorts owners into strictly ascending `owner` address order (the canonical
|
|
79
|
+
* form required for config ID derivation) and asserts the config is valid.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```ts twoslash
|
|
83
|
+
* import { MultisigConfig } from 'ox/tempo'
|
|
84
|
+
*
|
|
85
|
+
* const config = MultisigConfig.from({
|
|
86
|
+
* threshold: 2,
|
|
87
|
+
* owners: [
|
|
88
|
+
* { owner: '0x2222222222222222222222222222222222222222', weight: 1 },
|
|
89
|
+
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
90
|
+
* ],
|
|
91
|
+
* })
|
|
92
|
+
* // owners are now sorted ascending by address
|
|
93
|
+
* ```
|
|
94
|
+
*
|
|
95
|
+
* @param config - The multisig config.
|
|
96
|
+
* @returns The normalized multisig config.
|
|
97
|
+
*/
|
|
98
|
+
export function from(config) {
|
|
99
|
+
const owners = [...config.owners].sort((a, b) => Hex.toBigInt(a.owner) < Hex.toBigInt(b.owner) ? -1 : 1);
|
|
100
|
+
const normalized = {
|
|
101
|
+
salt: config.salt ? Hex.padLeft(config.salt, 32) : zeroSalt,
|
|
102
|
+
threshold: config.threshold,
|
|
103
|
+
owners,
|
|
104
|
+
};
|
|
105
|
+
assert(normalized);
|
|
106
|
+
return normalized;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Converts an RLP {@link ox#MultisigConfig.Tuple} back to a
|
|
110
|
+
* {@link ox#MultisigConfig.Config}.
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```ts twoslash
|
|
114
|
+
* import { MultisigConfig } from 'ox/tempo'
|
|
115
|
+
*
|
|
116
|
+
* const config = MultisigConfig.fromTuple([
|
|
117
|
+
* `0x${'00'.repeat(32)}`,
|
|
118
|
+
* '0x01',
|
|
119
|
+
* [['0x1111111111111111111111111111111111111111', '0x01']],
|
|
120
|
+
* ])
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* @param tuple - The RLP tuple.
|
|
124
|
+
* @returns The multisig config.
|
|
125
|
+
*/
|
|
126
|
+
export function fromTuple(tuple) {
|
|
127
|
+
const [salt, threshold, owners] = tuple;
|
|
128
|
+
return {
|
|
129
|
+
salt: salt && salt !== '0x' ? Hex.padLeft(salt, 32) : zeroSalt,
|
|
130
|
+
threshold: threshold === '0x' ? 0 : Hex.toNumber(threshold),
|
|
131
|
+
owners: owners.map((owner) => {
|
|
132
|
+
const [ownerAddress, weight] = owner;
|
|
133
|
+
return {
|
|
134
|
+
owner: ownerAddress,
|
|
135
|
+
weight: !weight || weight === '0x' ? 0 : Hex.toNumber(weight),
|
|
136
|
+
};
|
|
137
|
+
}),
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Derives the stable native multisig account address.
|
|
142
|
+
*
|
|
143
|
+
* `keccak256("tempo:multisig:account" || config_id)[12:32]`.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```ts twoslash
|
|
147
|
+
* import { MultisigConfig } from 'ox/tempo'
|
|
148
|
+
*
|
|
149
|
+
* const genesisConfig = MultisigConfig.from({
|
|
150
|
+
* threshold: 1,
|
|
151
|
+
* owners: [
|
|
152
|
+
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
153
|
+
* ],
|
|
154
|
+
* })
|
|
155
|
+
*
|
|
156
|
+
* const address = MultisigConfig.getAddress(genesisConfig)
|
|
157
|
+
* ```
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ### From an genesis config ID
|
|
161
|
+
*
|
|
162
|
+
* If you already have the permanent `genesisConfigId`, pass it directly:
|
|
163
|
+
*
|
|
164
|
+
* ```ts twoslash
|
|
165
|
+
* import { MultisigConfig } from 'ox/tempo'
|
|
166
|
+
*
|
|
167
|
+
* const genesisConfigId =
|
|
168
|
+
* `0x${'00'.repeat(32)}` as const
|
|
169
|
+
*
|
|
170
|
+
* const address = MultisigConfig.getAddress({ genesisConfigId })
|
|
171
|
+
* ```
|
|
172
|
+
*
|
|
173
|
+
* @param value - The genesis config (positional) or `{ genesisConfigId }`.
|
|
174
|
+
* @returns The multisig account address.
|
|
175
|
+
*/
|
|
176
|
+
export function getAddress(value) {
|
|
177
|
+
const id = typeof value === 'object' && 'genesisConfigId' in value
|
|
178
|
+
? value.genesisConfigId
|
|
179
|
+
: toId(value);
|
|
180
|
+
const hash = Hash.keccak256(Hex.concat(Hex.fromString(accountDomain), id));
|
|
181
|
+
return Address.from(Hex.slice(hash, 12, 32));
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Computes the digest a native multisig owner approves (signs).
|
|
185
|
+
*
|
|
186
|
+
* `keccak256("tempo:multisig:signature" || inner_digest || account || config_id)`,
|
|
187
|
+
* where `inner_digest` is the transaction sign payload
|
|
188
|
+
* ({@link ox#TxEnvelopeTempo.(getSignPayload:function)}).
|
|
189
|
+
*
|
|
190
|
+
* The digest is always keyed on the permanent `account`/`genesisConfigId`
|
|
191
|
+
* derived from the genesis (bootstrap) config — config updates never change
|
|
192
|
+
* these values, so the genesis config is the correct input even for
|
|
193
|
+
* post-update transactions.
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* ```ts twoslash
|
|
197
|
+
* import { MultisigConfig, TxEnvelopeTempo } from 'ox/tempo'
|
|
198
|
+
*
|
|
199
|
+
* const genesisConfig = MultisigConfig.from({
|
|
200
|
+
* threshold: 1,
|
|
201
|
+
* owners: [
|
|
202
|
+
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
203
|
+
* ],
|
|
204
|
+
* })
|
|
205
|
+
*
|
|
206
|
+
* const envelope = TxEnvelopeTempo.from({
|
|
207
|
+
* chainId: 1,
|
|
208
|
+
* calls: [],
|
|
209
|
+
* })
|
|
210
|
+
*
|
|
211
|
+
* const digest = MultisigConfig.getSignPayload({
|
|
212
|
+
* payload: TxEnvelopeTempo.getSignPayload(envelope),
|
|
213
|
+
* genesisConfig,
|
|
214
|
+
* })
|
|
215
|
+
* ```
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* ### From `account` + `genesisConfigId`
|
|
219
|
+
*
|
|
220
|
+
* If you already have the permanent `account` and `genesisConfigId` (for
|
|
221
|
+
* example, recovered from a stored envelope), pass them directly:
|
|
222
|
+
*
|
|
223
|
+
* ```ts twoslash
|
|
224
|
+
* import { MultisigConfig, TxEnvelopeTempo } from 'ox/tempo'
|
|
225
|
+
*
|
|
226
|
+
* const genesisConfig = MultisigConfig.from({
|
|
227
|
+
* threshold: 1,
|
|
228
|
+
* owners: [
|
|
229
|
+
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
230
|
+
* ],
|
|
231
|
+
* })
|
|
232
|
+
* const genesisConfigId = MultisigConfig.toId(genesisConfig)
|
|
233
|
+
* const account = MultisigConfig.getAddress(genesisConfig)
|
|
234
|
+
*
|
|
235
|
+
* const envelope = TxEnvelopeTempo.from({ chainId: 1, calls: [] })
|
|
236
|
+
*
|
|
237
|
+
* const digest = MultisigConfig.getSignPayload({
|
|
238
|
+
* payload: TxEnvelopeTempo.getSignPayload(envelope),
|
|
239
|
+
* account,
|
|
240
|
+
* genesisConfigId,
|
|
241
|
+
* })
|
|
242
|
+
* ```
|
|
243
|
+
*
|
|
244
|
+
* @param value - The digest derivation parameters.
|
|
245
|
+
* @returns The owner approval digest.
|
|
246
|
+
*/
|
|
247
|
+
export function getSignPayload(value) {
|
|
248
|
+
const { payload } = value;
|
|
249
|
+
const account = 'account' in value && value.account
|
|
250
|
+
? value.account
|
|
251
|
+
: getAddress(value.genesisConfig);
|
|
252
|
+
const genesisConfigId = 'genesisConfigId' in value && value.genesisConfigId
|
|
253
|
+
? value.genesisConfigId
|
|
254
|
+
: toId(value.genesisConfig);
|
|
255
|
+
return Hash.keccak256(Hex.concat(Hex.fromString(signatureDomain), Hex.from(payload), account, genesisConfigId));
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Derives the permanent config ID for a native multisig
|
|
259
|
+
* {@link ox#MultisigConfig.Config}.
|
|
260
|
+
*
|
|
261
|
+
* Preimage (fixed-width big-endian, **not** RLP):
|
|
262
|
+
* `keccak256("tempo:multisig:config" || salt || be_u32(threshold) || be_u32(owners.length) || (owner || be_u32(weight)) for each owner)`.
|
|
263
|
+
*
|
|
264
|
+
* @example
|
|
265
|
+
* ```ts twoslash
|
|
266
|
+
* import { MultisigConfig } from 'ox/tempo'
|
|
267
|
+
*
|
|
268
|
+
* const config = MultisigConfig.from({
|
|
269
|
+
* threshold: 1,
|
|
270
|
+
* owners: [
|
|
271
|
+
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
272
|
+
* ],
|
|
273
|
+
* })
|
|
274
|
+
*
|
|
275
|
+
* const genesisConfigId = MultisigConfig.toId(config)
|
|
276
|
+
* ```
|
|
277
|
+
*
|
|
278
|
+
* @param config - The multisig config.
|
|
279
|
+
* @returns The 32-byte config ID.
|
|
280
|
+
*/
|
|
281
|
+
export function toId(config) {
|
|
282
|
+
assert(config);
|
|
283
|
+
const id = Hash.keccak256(Hex.concat(Hex.fromString(configDomain), Hex.padLeft(config.salt ?? zeroSalt, 32), Hex.fromNumber(config.threshold, { size: 4 }), Hex.fromNumber(config.owners.length, { size: 4 }), ...config.owners.flatMap((owner) => [
|
|
284
|
+
owner.owner,
|
|
285
|
+
Hex.fromNumber(owner.weight, { size: 4 }),
|
|
286
|
+
])));
|
|
287
|
+
if (Hex.toBigInt(id) === 0n)
|
|
288
|
+
throw new InvalidConfigError({ reason: 'config ID cannot be zero' });
|
|
289
|
+
return id;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Converts a {@link ox#MultisigConfig.Config} to its RLP tuple form (carried
|
|
293
|
+
* by the multisig signature `init`).
|
|
294
|
+
*
|
|
295
|
+
* Tuple shape: `[salt, threshold, [[owner, weight], ...]]`. The
|
|
296
|
+
* 32-byte `salt` encodes as a full fixed-width string; other integers use
|
|
297
|
+
* canonical RLP encoding (zero values encode as `0x`).
|
|
298
|
+
*
|
|
299
|
+
* @example
|
|
300
|
+
* ```ts twoslash
|
|
301
|
+
* import { MultisigConfig } from 'ox/tempo'
|
|
302
|
+
*
|
|
303
|
+
* const tuple = MultisigConfig.toTuple({
|
|
304
|
+
* threshold: 1,
|
|
305
|
+
* owners: [
|
|
306
|
+
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
307
|
+
* ],
|
|
308
|
+
* })
|
|
309
|
+
* ```
|
|
310
|
+
*
|
|
311
|
+
* @param config - The multisig config.
|
|
312
|
+
* @returns The RLP tuple.
|
|
313
|
+
*/
|
|
314
|
+
export function toTuple(config) {
|
|
315
|
+
assert(config);
|
|
316
|
+
const owners = config.owners.map((owner) => [owner.owner, Hex.fromNumber(owner.weight)]);
|
|
317
|
+
// `salt` is a fixed 32-byte value: it RLP-encodes as a full 32-byte string
|
|
318
|
+
// (including the zero salt), never trimmed like an integer.
|
|
319
|
+
const salt = config.salt ? Hex.padLeft(config.salt, 32) : zeroSalt;
|
|
320
|
+
return [salt, Hex.fromNumber(config.threshold), owners];
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Validates a native multisig {@link ox#MultisigConfig.Config}. Returns `true`
|
|
324
|
+
* if valid, `false` otherwise.
|
|
325
|
+
*
|
|
326
|
+
* @example
|
|
327
|
+
* ```ts twoslash
|
|
328
|
+
* import { MultisigConfig } from 'ox/tempo'
|
|
329
|
+
*
|
|
330
|
+
* const valid = MultisigConfig.validate({
|
|
331
|
+
* threshold: 1,
|
|
332
|
+
* owners: [
|
|
333
|
+
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
334
|
+
* ],
|
|
335
|
+
* })
|
|
336
|
+
* // @log: true
|
|
337
|
+
* ```
|
|
338
|
+
*
|
|
339
|
+
* @param config - The multisig config.
|
|
340
|
+
* @returns Whether the config is valid.
|
|
341
|
+
*/
|
|
342
|
+
export function validate(config) {
|
|
343
|
+
try {
|
|
344
|
+
assert(config);
|
|
345
|
+
return true;
|
|
346
|
+
}
|
|
347
|
+
catch {
|
|
348
|
+
return false;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
/** Thrown when a native multisig config is invalid. */
|
|
352
|
+
export class InvalidConfigError extends Errors.BaseError {
|
|
353
|
+
constructor({ reason }) {
|
|
354
|
+
super(`Invalid native multisig config: ${reason}.`);
|
|
355
|
+
Object.defineProperty(this, "name", {
|
|
356
|
+
enumerable: true,
|
|
357
|
+
configurable: true,
|
|
358
|
+
writable: true,
|
|
359
|
+
value: 'MultisigConfig.InvalidConfigError'
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
//# sourceMappingURL=MultisigConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultisigConfig.js","sourceRoot":"","sources":["../../tempo/MultisigConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAA;AAE7C,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAA;AAC3C,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAA;AACvC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAA;AAGrC,oEAAoE;AACpE,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,CAAA;AAE3B,oEAAoE;AACpE,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAA;AAE1C,gEAAgE;AAChE,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAe,CAAA;AAEhD,gEAAgE;AAChE,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,EAAW,CAAA;AAEvD,wEAAwE;AACxE,MAAM,aAAa,GAAG,wBAAwB,CAAA;AAE9C,kEAAkE;AAClE,MAAM,YAAY,GAAG,uBAAuB,CAAA;AAE5C,yDAAyD;AACzD,MAAM,eAAe,GAAG,0BAA0B,CAAA;AAiClD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,MAAM,CAAsB,MAA0B;IACpE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;IAE1C,IAAI,OAAO,IAAI,KAAK,WAAW,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;QACtD,MAAM,IAAI,kBAAkB,CAAC,EAAE,MAAM,EAAE,uBAA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