@helium/helium-admin-cli 0.7.11 → 0.7.13
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/lib/cjs/create-and-approve-makers.js +323 -0
- package/lib/cjs/create-and-approve-makers.js.map +1 -0
- package/lib/cjs/create-maker.js +122 -213
- package/lib/cjs/create-maker.js.map +1 -1
- package/lib/esm/src/create-and-approve-makers.js +282 -0
- package/lib/esm/src/create-and-approve-makers.js.map +1 -0
- package/lib/esm/src/create-maker.js +131 -222
- package/lib/esm/src/create-maker.js.map +1 -1
- package/lib/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/types/src/create-and-approve-makers.d.ts +2 -0
- package/lib/types/src/create-and-approve-makers.d.ts.map +1 -0
- package/lib/types/src/create-maker.d.ts.map +1 -1
- package/package.json +13 -13
package/lib/cjs/create-maker.js
CHANGED
|
@@ -36,88 +36,60 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
exports.run = void 0;
|
|
39
|
-
const
|
|
40
|
-
const KeyTypes_1 = require("@helium/address/build/KeyTypes");
|
|
39
|
+
const anchor = __importStar(require("@coral-xyz/anchor"));
|
|
41
40
|
const helium_entity_manager_sdk_1 = require("@helium/helium-entity-manager-sdk");
|
|
42
41
|
const helium_sub_daos_sdk_1 = require("@helium/helium-sub-daos-sdk");
|
|
43
|
-
const voter_stake_registry_sdk_1 = require("@helium/voter-stake-registry-sdk");
|
|
44
42
|
const spl_utils_1 = require("@helium/spl-utils");
|
|
45
|
-
const anchor = __importStar(require("@coral-xyz/anchor"));
|
|
46
43
|
const spl_account_compression_1 = require("@solana/spl-account-compression");
|
|
47
44
|
const web3_js_1 = require("@solana/web3.js");
|
|
48
45
|
const fs_1 = __importDefault(require("fs"));
|
|
49
46
|
const os_1 = __importDefault(require("os"));
|
|
50
47
|
const yargs_1 = __importDefault(require("yargs/yargs"));
|
|
51
48
|
const utils_1 = require("./utils");
|
|
52
|
-
const sdk_1 = __importDefault(require("@sqds/sdk"));
|
|
53
49
|
function run(args = process.argv) {
|
|
54
50
|
return __awaiter(this, void 0, void 0, function* () {
|
|
55
51
|
const yarg = (0, yargs_1.default)(args).options({
|
|
56
52
|
wallet: {
|
|
57
|
-
alias:
|
|
58
|
-
describe:
|
|
53
|
+
alias: "k",
|
|
54
|
+
describe: "Anchor wallet keypair",
|
|
59
55
|
default: `${os_1.default.homedir()}/.config/solana/id.json`,
|
|
60
56
|
},
|
|
61
|
-
executeTransaction: {
|
|
62
|
-
type: 'boolean',
|
|
63
|
-
},
|
|
64
57
|
url: {
|
|
65
|
-
alias:
|
|
66
|
-
default:
|
|
67
|
-
describe:
|
|
58
|
+
alias: "u",
|
|
59
|
+
default: "http://127.0.0.1:8899",
|
|
60
|
+
describe: "The solana url",
|
|
68
61
|
},
|
|
69
|
-
|
|
62
|
+
name: {
|
|
63
|
+
alias: "n",
|
|
64
|
+
type: "string",
|
|
70
65
|
required: true,
|
|
71
|
-
describe:
|
|
72
|
-
type: 'string',
|
|
66
|
+
describe: "The name of the maker",
|
|
73
67
|
},
|
|
74
|
-
|
|
75
|
-
type:
|
|
76
|
-
describe:
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
fromFile: {
|
|
80
|
-
describe: 'Load makers from a json file and create in bulk',
|
|
81
|
-
required: false,
|
|
82
|
-
type: 'string',
|
|
68
|
+
issuingAuthority: {
|
|
69
|
+
type: "string",
|
|
70
|
+
describe: "Key that can issue hotspots on behalf of this maker",
|
|
71
|
+
required: true,
|
|
83
72
|
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
required:
|
|
88
|
-
describe: 'The name of the maker',
|
|
73
|
+
updateAuthority: {
|
|
74
|
+
type: "string",
|
|
75
|
+
describe: "Key that can update the maker's issuing authority",
|
|
76
|
+
required: true,
|
|
89
77
|
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
required: false,
|
|
78
|
+
metadataUrl: {
|
|
79
|
+
type: "string",
|
|
80
|
+
describe: "URL to metadata for this maker. Should be JSON with at least { name, image, description }",
|
|
81
|
+
required: true,
|
|
95
82
|
},
|
|
96
83
|
makerCount: {
|
|
97
|
-
alias:
|
|
98
|
-
type:
|
|
99
|
-
describe:
|
|
100
|
-
required: false,
|
|
101
|
-
},
|
|
102
|
-
merkleBasePath: {
|
|
103
|
-
type: 'string',
|
|
104
|
-
describe: 'Base path for merkle keypairs',
|
|
105
|
-
default: `${__dirname}/../keypairs`,
|
|
106
|
-
},
|
|
107
|
-
symbol: {
|
|
108
|
-
alias: 's',
|
|
109
|
-
type: 'string',
|
|
84
|
+
alias: "c",
|
|
85
|
+
type: "number",
|
|
86
|
+
describe: "Estimated number of hotspots this maker will have",
|
|
110
87
|
required: true,
|
|
111
|
-
describe: 'The symbol of the entity config',
|
|
112
|
-
},
|
|
113
|
-
multisig: {
|
|
114
|
-
type: 'string',
|
|
115
|
-
describe: 'Address of the squads multisig to be authority. If not provided, your wallet will be the authority',
|
|
116
88
|
},
|
|
117
|
-
|
|
118
|
-
type:
|
|
119
|
-
describe:
|
|
120
|
-
default:
|
|
89
|
+
merkleBasePath: {
|
|
90
|
+
type: "string",
|
|
91
|
+
describe: "Base path for merkle keypairs",
|
|
92
|
+
default: `${__dirname}`,
|
|
121
93
|
},
|
|
122
94
|
});
|
|
123
95
|
const argv = yield yarg.argv;
|
|
@@ -125,96 +97,99 @@ function run(args = process.argv) {
|
|
|
125
97
|
process.env.ANCHOR_PROVIDER_URL = argv.url;
|
|
126
98
|
anchor.setProvider(anchor.AnchorProvider.local(argv.url));
|
|
127
99
|
const provider = anchor.getProvider();
|
|
128
|
-
const wallet = new anchor.Wallet((0, utils_1.loadKeypair)(argv.wallet));
|
|
129
100
|
const name = argv.name;
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
name,
|
|
134
|
-
address: argv.makerKey,
|
|
135
|
-
count: argv.makerCount || 300000,
|
|
136
|
-
staked: true,
|
|
137
|
-
},
|
|
138
|
-
];
|
|
139
|
-
if (argv.fromFile) {
|
|
140
|
-
makers = JSON.parse(fs_1.default.readFileSync(argv.fromFile, 'utf-8'));
|
|
141
|
-
// Append a special fallthrough maker for hotspots that don't have a maker
|
|
142
|
-
const solAddr = provider.wallet.publicKey;
|
|
143
|
-
const helAddr = new address_1.default(0, 0, KeyTypes_1.ED25519_KEY_TYPE, solAddr.toBuffer());
|
|
144
|
-
makers.push({
|
|
145
|
-
name: 'Migrated Helium Hotspot',
|
|
146
|
-
address: helAddr.b58,
|
|
147
|
-
count: 50000,
|
|
148
|
-
staked: true,
|
|
149
|
-
});
|
|
150
|
-
}
|
|
101
|
+
const count = argv.makerCount;
|
|
102
|
+
const issuingAuthority = new web3_js_1.PublicKey(argv.issuingAuthority);
|
|
103
|
+
const updateAuthority = new web3_js_1.PublicKey(argv.updateAuthority);
|
|
151
104
|
const hemProgram = yield (0, helium_entity_manager_sdk_1.init)(provider);
|
|
152
|
-
const hsdProgram = yield (0, helium_sub_daos_sdk_1.init)(provider);
|
|
153
|
-
const vsrProgram = yield (0, voter_stake_registry_sdk_1.init)(provider);
|
|
154
105
|
const conn = provider.connection;
|
|
155
|
-
const
|
|
156
|
-
const subdao = (yield (0, helium_sub_daos_sdk_1.subDaoKey)(subdaoMint))[0];
|
|
157
|
-
const entityConfigKey = (yield (0, helium_entity_manager_sdk_1.rewardableEntityConfigKey)(subdao, symbol.toUpperCase()))[0];
|
|
158
|
-
const subdaoAcc = yield hsdProgram.account.subDaoV0.fetch(subdao);
|
|
159
|
-
const dao = yield hsdProgram.account.daoV0.fetch(subdaoAcc.dao);
|
|
160
|
-
let subdaoPayer = provider.wallet.publicKey;
|
|
106
|
+
const daoK = (0, helium_sub_daos_sdk_1.daoKey)(spl_utils_1.HNT_MINT)[0];
|
|
161
107
|
let daoPayer = provider.wallet.publicKey;
|
|
162
|
-
const squads = sdk_1.default.endpoint(process.env.ANCHOR_PROVIDER_URL, wallet, {
|
|
163
|
-
commitmentOrConfig: 'finalized',
|
|
164
|
-
});
|
|
165
|
-
let authority = provider.wallet.publicKey;
|
|
166
|
-
let multisig = argv.multisig ? new web3_js_1.PublicKey(argv.multisig) : null;
|
|
167
|
-
if (multisig) {
|
|
168
|
-
authority = squads.getAuthorityPDA(multisig, argv.authorityIndex);
|
|
169
|
-
subdaoPayer = authority;
|
|
170
|
-
daoPayer = authority;
|
|
171
|
-
console.log('SQUAD AUTH', authority.toBase58());
|
|
172
|
-
}
|
|
173
|
-
const createInstructions = [];
|
|
174
|
-
const approveInstructions = [];
|
|
175
|
-
const updateAuthority = dao.authority;
|
|
176
108
|
let totalSol = 0;
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
Solana addr: ${makerAuthority.toBase58()}.
|
|
198
|
-
Size: ${size}, buffer: ${buffer}, canopy: ${canopy}.
|
|
109
|
+
const instructions = [];
|
|
110
|
+
const [size, buffer, canopy] = utils_1.merkleSizes.find(([height]) => Math.pow(2, height) > count * 2);
|
|
111
|
+
const space = (0, spl_account_compression_1.getConcurrentMerkleTreeAccountSize)(size, buffer, canopy);
|
|
112
|
+
const maker = yield (0, helium_entity_manager_sdk_1.makerKey)(daoK, name)[0];
|
|
113
|
+
const rent = yield provider.connection.getMinimumBalanceForRentExemption(space);
|
|
114
|
+
totalSol += rent;
|
|
115
|
+
let merkle;
|
|
116
|
+
const merklePath = `${argv.merkleBasePath}/merkle-${maker.toBase58()}.json`;
|
|
117
|
+
if (fs_1.default.existsSync(merklePath)) {
|
|
118
|
+
merkle = (0, utils_1.loadKeypair)(merklePath);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
merkle = web3_js_1.Keypair.generate();
|
|
122
|
+
fs_1.default.writeFileSync(merklePath, JSON.stringify(Array.from(merkle.secretKey)));
|
|
123
|
+
}
|
|
124
|
+
if (!(yield (0, utils_1.exists)(conn, maker))) {
|
|
125
|
+
console.log(`
|
|
126
|
+
Creating maker with address: ${maker.toBase58()}
|
|
127
|
+
Issuing Authority: ${issuingAuthority.toBase58()}.
|
|
128
|
+
Capacity: 2^${size}, buffer: ${buffer}, canopy: ${canopy}.
|
|
199
129
|
Space: ${space} bytes
|
|
200
130
|
Cost: ~${(0, spl_utils_1.humanReadable)(new anchor.BN(rent), 9)} Sol
|
|
201
131
|
`);
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
132
|
+
if (space > 10000000) {
|
|
133
|
+
throw new Error(`Space ${space} more than 10mb for tree ${size}, ${buffer}, ${canopy}}`);
|
|
134
|
+
}
|
|
135
|
+
const create = yield hemProgram.methods
|
|
136
|
+
.initializeMakerV0({
|
|
137
|
+
name: name,
|
|
138
|
+
metadataUrl: argv.metadataUrl,
|
|
139
|
+
issuingAuthority,
|
|
140
|
+
// Temp, since we need to set maker tree
|
|
141
|
+
updateAuthority: provider.wallet.publicKey,
|
|
142
|
+
})
|
|
143
|
+
.accounts({
|
|
144
|
+
maker,
|
|
145
|
+
payer: daoPayer,
|
|
146
|
+
dao: daoK,
|
|
147
|
+
})
|
|
148
|
+
.instruction();
|
|
149
|
+
const setTree = yield hemProgram.methods
|
|
150
|
+
.setMakerTreeV0({
|
|
151
|
+
maxDepth: size,
|
|
152
|
+
maxBufferSize: buffer,
|
|
153
|
+
})
|
|
154
|
+
.accounts({
|
|
155
|
+
maker,
|
|
156
|
+
merkleTree: merkle.publicKey,
|
|
157
|
+
payer: daoPayer,
|
|
158
|
+
updateAuthority: provider.wallet.publicKey,
|
|
159
|
+
})
|
|
160
|
+
.instruction();
|
|
161
|
+
if (!(yield (0, utils_1.exists)(conn, merkle.publicKey))) {
|
|
162
|
+
yield (0, spl_utils_1.sendInstructions)(provider, [
|
|
163
|
+
web3_js_1.SystemProgram.createAccount({
|
|
164
|
+
fromPubkey: provider.wallet.publicKey,
|
|
165
|
+
newAccountPubkey: merkle.publicKey,
|
|
166
|
+
lamports: yield provider.connection.getMinimumBalanceForRentExemption(space),
|
|
167
|
+
space: space,
|
|
168
|
+
programId: spl_account_compression_1.SPL_ACCOUNT_COMPRESSION_PROGRAM_ID,
|
|
169
|
+
}),
|
|
170
|
+
], [merkle]);
|
|
171
|
+
}
|
|
172
|
+
instructions.push(...[create, setTree].filter(spl_utils_1.truthy));
|
|
173
|
+
if (!updateAuthority.equals(provider.wallet.publicKey)) {
|
|
174
|
+
instructions.push(yield hemProgram.methods
|
|
175
|
+
.updateMakerV0({
|
|
176
|
+
issuingAuthority,
|
|
210
177
|
updateAuthority,
|
|
211
178
|
})
|
|
212
|
-
.accounts({
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
179
|
+
.accounts({ maker, updateAuthority: provider.wallet.publicKey })
|
|
180
|
+
.instruction());
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
const makerAcc = yield hemProgram.account.makerV0.fetch(maker);
|
|
185
|
+
instructions.push(yield hemProgram.methods
|
|
186
|
+
.updateMakerV0({
|
|
187
|
+
issuingAuthority,
|
|
188
|
+
updateAuthority,
|
|
189
|
+
})
|
|
190
|
+
.accounts({ maker, updateAuthority: makerAcc.updateAuthority })
|
|
191
|
+
.instruction());
|
|
192
|
+
if (makerAcc.merkleTree.equals(web3_js_1.SystemProgram.programId)) {
|
|
218
193
|
const setTree = yield hemProgram.methods
|
|
219
194
|
.setMakerTreeV0({
|
|
220
195
|
maxDepth: size,
|
|
@@ -238,85 +213,19 @@ function run(args = process.argv) {
|
|
|
238
213
|
}),
|
|
239
214
|
], [merkle]);
|
|
240
215
|
}
|
|
241
|
-
|
|
242
|
-
}
|
|
243
|
-
else {
|
|
244
|
-
const makerAcc = yield hemProgram.account.makerV0.fetch(maker);
|
|
245
|
-
innerCreateInstrs.push(yield hemProgram.methods
|
|
246
|
-
.updateMakerV0({
|
|
247
|
-
issuingAuthority: makerAuthority,
|
|
248
|
-
updateAuthority,
|
|
249
|
-
})
|
|
250
|
-
.accounts({ maker, updateAuthority: makerAcc.updateAuthority })
|
|
251
|
-
.instruction());
|
|
252
|
-
if (makerAcc.merkleTree.equals(web3_js_1.SystemProgram.programId)) {
|
|
253
|
-
const setTree = yield hemProgram.methods
|
|
254
|
-
.setMakerTreeV0({
|
|
255
|
-
maxDepth: size,
|
|
256
|
-
maxBufferSize: buffer,
|
|
257
|
-
})
|
|
258
|
-
.accounts({
|
|
259
|
-
maker,
|
|
260
|
-
merkleTree: merkle.publicKey,
|
|
261
|
-
payer: daoPayer,
|
|
262
|
-
updateAuthority,
|
|
263
|
-
})
|
|
264
|
-
.instruction();
|
|
265
|
-
if (!(yield (0, utils_1.exists)(conn, merkle.publicKey))) {
|
|
266
|
-
yield (0, spl_utils_1.sendInstructions)(provider, [
|
|
267
|
-
web3_js_1.SystemProgram.createAccount({
|
|
268
|
-
fromPubkey: provider.wallet.publicKey,
|
|
269
|
-
newAccountPubkey: merkle.publicKey,
|
|
270
|
-
lamports: yield provider.connection.getMinimumBalanceForRentExemption(space),
|
|
271
|
-
space: space,
|
|
272
|
-
programId: spl_account_compression_1.SPL_ACCOUNT_COMPRESSION_PROGRAM_ID,
|
|
273
|
-
}),
|
|
274
|
-
], [merkle]);
|
|
275
|
-
}
|
|
276
|
-
innerCreateInstrs.push(setTree);
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
createInstructions.push(innerCreateInstrs);
|
|
280
|
-
const innerApproveInstrs = [];
|
|
281
|
-
let approve;
|
|
282
|
-
if (staked &&
|
|
283
|
-
!(yield (0, utils_1.exists)(conn, (0, helium_entity_manager_sdk_1.makerApprovalKey)(entityConfigKey, maker)[0]))) {
|
|
284
|
-
const authority = (yield hemProgram.account.rewardableEntityConfigV0.fetch(entityConfigKey)).authority;
|
|
285
|
-
approve = yield hemProgram.methods
|
|
286
|
-
.approveMakerV0()
|
|
287
|
-
.accounts({
|
|
288
|
-
maker,
|
|
289
|
-
rewardableEntityConfig: entityConfigKey,
|
|
290
|
-
authority,
|
|
291
|
-
payer: subdaoPayer,
|
|
292
|
-
})
|
|
293
|
-
.instruction();
|
|
294
|
-
innerApproveInstrs.push(approve);
|
|
295
|
-
}
|
|
296
|
-
approveInstructions.push(innerApproveInstrs);
|
|
297
|
-
}
|
|
298
|
-
console.log('Total sol needed: ', (0, spl_utils_1.humanReadable)(new anchor.BN(totalSol), 9));
|
|
299
|
-
if (multisig) {
|
|
300
|
-
// Approve instructions must execute after ALL create instructions
|
|
301
|
-
const instrs = createInstructions.flat().filter(spl_utils_1.truthy);
|
|
302
|
-
const approveInstrs = approveInstructions.flat().filter(spl_utils_1.truthy);
|
|
303
|
-
for (const chunk of (0, spl_utils_1.chunks)([...instrs, ...approveInstrs], 3)) {
|
|
304
|
-
yield (0, utils_1.sendInstructionsOrSquads)({
|
|
305
|
-
provider,
|
|
306
|
-
instructions: chunk,
|
|
307
|
-
signers: [],
|
|
308
|
-
executeTransaction: argv.executeTransaction,
|
|
309
|
-
squads,
|
|
310
|
-
multisig,
|
|
311
|
-
authorityIndex: argv.authorityIndex,
|
|
312
|
-
});
|
|
216
|
+
instructions.push(setTree);
|
|
313
217
|
}
|
|
314
218
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}
|
|
219
|
+
console.log("Total sol needed: ", (0, spl_utils_1.humanReadable)(new anchor.BN(totalSol), 9));
|
|
220
|
+
const balance = yield provider.connection.getBalance(provider.wallet.publicKey);
|
|
221
|
+
if (balance < totalSol) {
|
|
222
|
+
throw new Error(`Insufficient balance: ${(0, spl_utils_1.humanReadable)(new anchor.BN(Math.floor(balance)), 9)} < ${(0, spl_utils_1.humanReadable)(new anchor.BN(totalSol), 9)}`);
|
|
319
223
|
}
|
|
224
|
+
yield (0, spl_utils_1.sendInstructions)(provider, yield (0, spl_utils_1.withPriorityFees)({
|
|
225
|
+
connection: provider.connection,
|
|
226
|
+
instructions,
|
|
227
|
+
feePayer: provider.wallet.publicKey
|
|
228
|
+
}));
|
|
320
229
|
});
|
|
321
230
|
}
|
|
322
231
|
exports.run = run;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-maker.js","sourceRoot":"","sources":["../../src/create-maker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"create-maker.js","sourceRoot":"","sources":["../../src/create-maker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4C;AAC5C,iFAG2C;AAC3C,qEAGqC;AACrC,iDAM2B;AAC3B,6EAGyC;AACzC,6CAKyB;AACzB,4CAAoB;AACpB,4CAAoB;AACpB,wDAAgC;AAChC,mCAIiB;AAEjB,SAAsB,GAAG,CAAC,OAAY,OAAO,CAAC,IAAI;;QAChD,MAAM,IAAI,GAAG,IAAA,eAAK,EAAC,IAAI,CAAC,CAAC,OAAO,CAAC;YAC/B,MAAM,EAAE;gBACN,KAAK,EAAE,GAAG;gBACV,QAAQ,EAAE,uBAAuB;gBACjC,OAAO,EAAE,GAAG,YAAE,CAAC,OAAO,EAAE,yBAAyB;aAClD;YACD,GAAG,EAAE;gBACH,KAAK,EAAE,GAAG;gBACV,OAAO,EAAE,uBAAuB;gBAChC,QAAQ,EAAE,gBAAgB;aAC3B;YACD,IAAI,EAAE;gBACJ,KAAK,EAAE,GAAG;gBACV,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,uBAAuB;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