@gooddollar/goodprotocol 2.1.2 → 2.1.3
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/artifacts/abis/IBancorExchangeProvider.min.json +1 -1
- package/artifacts/abis/IdentityV3.min.json +1 -1
- package/artifacts/abis/MentoExchange.min.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/IBancorExchangeProvider.dbg.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/IBancorExchangeProvider.json +0 -13
- package/artifacts/contracts/MentoInterfaces.sol/IBroker.dbg.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/IGoodDollarExchangeProvider.dbg.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/IGoodDollarExpansionController.dbg.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/IMentoReserve.dbg.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/ITradingLimits.dbg.json +1 -1
- package/artifacts/contracts/identity/IdentityV3.sol/IdentityV3.dbg.json +1 -1
- package/artifacts/contracts/identity/IdentityV3.sol/IdentityV3.json +2 -40
- package/artifacts/contracts/utils/BuyFromReserveHelper.sol/BuyFromReserveHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyFromReserveHelper.sol/BuyFromReserveHelper.json +2 -2
- package/artifacts/contracts/utils/ProtoclUpgradeV4Mento.sol/MentoExchange.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtoclUpgradeV4Mento.sol/ProtocolUpgradeV4Mento.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtoclUpgradeV4Mento.sol/ProtocolUpgradeV4Mento.json +2 -2
- package/package.json +1 -1
- package/types/contracts/MentoInterfaces.sol/IBancorExchangeProvider.ts +0 -14
- package/types/contracts/identity/IdentityV3.ts +0 -46
- package/types/contracts/utils/index.ts +0 -2
- package/types/factories/contracts/MentoInterfaces.sol/IBancorExchangeProvider__factory.ts +0 -13
- package/types/factories/contracts/identity/IdentityV3__factory.ts +1 -39
- package/types/factories/contracts/utils/BuyFromReserveHelper__factory.ts +1 -1
- package/types/factories/contracts/utils/ProtoclUpgradeV4Mento.sol/ProtocolUpgradeV4Mento__factory.ts +1 -1
- package/types/factories/contracts/utils/index.ts +0 -1
- package/types/hardhat.d.ts +0 -18
- package/artifacts/abis/UpdateReserveRatioAfterXDC.min.json +0 -1
- package/artifacts/contracts/utils/UpdateReserveRatioAfterXDC.sol/MentoExchange.dbg.json +0 -4
- package/artifacts/contracts/utils/UpdateReserveRatioAfterXDC.sol/MentoExchange.json +0 -24
- package/artifacts/contracts/utils/UpdateReserveRatioAfterXDC.sol/UpdateReserveRatioAfterXDC.dbg.json +0 -4
- package/artifacts/contracts/utils/UpdateReserveRatioAfterXDC.sol/UpdateReserveRatioAfterXDC.json +0 -50
- package/contracts/utils/UpdateReserveRatioAfterXDC.sol +0 -64
- package/scripts/proposals/gip-25-xdc-deploy-reserve.ts +0 -425
|
@@ -1,425 +0,0 @@
|
|
|
1
|
-
// Part 2 Reserve
|
|
2
|
-
// upgrade bridge + identity on all networks
|
|
3
|
-
// create uniswap pools on xdc
|
|
4
|
-
// calculate how much G$s each reserve is backing
|
|
5
|
-
// deploy mento reserve to xdc with calculated parameters
|
|
6
|
-
// give mento broker minting rights on xdc
|
|
7
|
-
// deploy distribution helper
|
|
8
|
-
// transfer usdc to xdc reserve
|
|
9
|
-
// update celo reserve parameters accordingly
|
|
10
|
-
|
|
11
|
-
import { network, ethers, upgrades } from "hardhat";
|
|
12
|
-
import { reset } from "@nomicfoundation/hardhat-network-helpers";
|
|
13
|
-
import { defaultsDeep, last } from "lodash";
|
|
14
|
-
import prompt from "prompt";
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
executeViaGuardian,
|
|
18
|
-
executeViaSafe,
|
|
19
|
-
verifyContract,
|
|
20
|
-
verifyProductionSigner
|
|
21
|
-
} from "../multichain-deploy/helpers";
|
|
22
|
-
|
|
23
|
-
import dao from "../../releases/deployment.json";
|
|
24
|
-
import { Controller, IdentityV3, IGoodDollar, IMessagePassingBridge, UBISchemeV2 } from "../../types";
|
|
25
|
-
let { name: networkName } = network;
|
|
26
|
-
const isSimulation = network.name === "hardhat" || network.name === "fork" || network.name === "localhost";
|
|
27
|
-
const bridgeUpgradeImpl = {
|
|
28
|
-
"production-celo": "0xF3eAB7018d74E7Df95A5d8dC70987C0539bDF48f",
|
|
29
|
-
production: "0xFB62aA509a7B260b6697B671C969a184d6c39E90",
|
|
30
|
-
"production-mainnet": "0x12ab702f015D3302f3cc0c4AbA0626A127D06A07",
|
|
31
|
-
"production-xdc": "0xe4CFA18A3d0a7d77fAA42961ee943c9221d61937"
|
|
32
|
-
};
|
|
33
|
-
export const upgradeCeloStep2 = async (network, checksOnly) => {
|
|
34
|
-
let [root] = await ethers.getSigners();
|
|
35
|
-
|
|
36
|
-
const isProduction = networkName.includes("production");
|
|
37
|
-
|
|
38
|
-
if (isProduction) verifyProductionSigner(root);
|
|
39
|
-
|
|
40
|
-
let networkEnv = networkName;
|
|
41
|
-
let guardian = root;
|
|
42
|
-
if (isSimulation) {
|
|
43
|
-
networkEnv = network;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
let release: { [key: string]: any } = dao[networkEnv];
|
|
47
|
-
|
|
48
|
-
console.log("signer:", root.address, { networkEnv, isSimulation, isProduction, release });
|
|
49
|
-
|
|
50
|
-
if (isSimulation) {
|
|
51
|
-
networkEnv = network;
|
|
52
|
-
guardian = await ethers.getImpersonatedSigner(release.GuardiansSafe);
|
|
53
|
-
|
|
54
|
-
await root.sendTransaction({
|
|
55
|
-
value: ethers.utils.parseEther("1"),
|
|
56
|
-
to: release.GuardiansSafe
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const identityImpl = await ethers.deployContract("IdentityV3");
|
|
61
|
-
const reserveUpdate = await ethers.deployContract("UpdateReserveRatioAfterXDC")
|
|
62
|
-
const bridgeImpl = bridgeUpgradeImpl[networkEnv];
|
|
63
|
-
|
|
64
|
-
// Extract the first four bytes as the function selector
|
|
65
|
-
console.log("deployed new impls", { identityImpl: identityImpl.address });
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const proposalActions = [
|
|
69
|
-
[
|
|
70
|
-
release.Identity,
|
|
71
|
-
"upgradeTo(address)",
|
|
72
|
-
ethers.utils.defaultAbiCoder.encode(["address"], [identityImpl.address]),
|
|
73
|
-
"0"
|
|
74
|
-
], //upgrade identity
|
|
75
|
-
[
|
|
76
|
-
release.MpbBridge,
|
|
77
|
-
"upgradeTo(address)",
|
|
78
|
-
ethers.utils.defaultAbiCoder.encode(["address"], [bridgeImpl]),
|
|
79
|
-
"0"
|
|
80
|
-
], //upgrade bridge
|
|
81
|
-
[
|
|
82
|
-
release.Controller,
|
|
83
|
-
"registerScheme(address,bytes32,bytes4,address)",
|
|
84
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
85
|
-
["address", "bytes32", "bytes4", "address"],
|
|
86
|
-
[reserveUpdate.address, ethers.constants.HashZero, "0x0000001f", release.Avatar]
|
|
87
|
-
),
|
|
88
|
-
"0"
|
|
89
|
-
] //give generic call rights to update reserve ratio
|
|
90
|
-
|
|
91
|
-
];
|
|
92
|
-
|
|
93
|
-
console.log({
|
|
94
|
-
networkEnv,
|
|
95
|
-
guardian: guardian.address,
|
|
96
|
-
isSimulation,
|
|
97
|
-
isProduction,
|
|
98
|
-
release
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
const proposalContracts = proposalActions.map(a => a[0]);
|
|
102
|
-
const proposalFunctionSignatures = proposalActions.map(a => a[1]);
|
|
103
|
-
const proposalFunctionInputs = proposalActions.map(a => a[2]);
|
|
104
|
-
const proposalEthValues = proposalActions.map(a => a[3]);
|
|
105
|
-
if (isProduction && !checksOnly) {
|
|
106
|
-
await executeViaSafe(
|
|
107
|
-
proposalContracts,
|
|
108
|
-
proposalEthValues,
|
|
109
|
-
proposalFunctionSignatures,
|
|
110
|
-
proposalFunctionInputs,
|
|
111
|
-
release.GuardiansSafe,
|
|
112
|
-
"celo"
|
|
113
|
-
);
|
|
114
|
-
} else if (!checksOnly) {
|
|
115
|
-
await executeViaGuardian(
|
|
116
|
-
proposalContracts,
|
|
117
|
-
proposalEthValues,
|
|
118
|
-
proposalFunctionSignatures,
|
|
119
|
-
proposalFunctionInputs,
|
|
120
|
-
guardian,
|
|
121
|
-
networkEnv
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
export const upgradeFuseStep2 = async (network, checksOnly) => {
|
|
128
|
-
let [root] = await ethers.getSigners();
|
|
129
|
-
|
|
130
|
-
const isProduction = networkName.includes("production");
|
|
131
|
-
|
|
132
|
-
if (isProduction) verifyProductionSigner(root);
|
|
133
|
-
|
|
134
|
-
let networkEnv = networkName;
|
|
135
|
-
let guardian = root;
|
|
136
|
-
if (isSimulation) {
|
|
137
|
-
networkEnv = network;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
let release: { [key: string]: any } = dao[networkEnv];
|
|
141
|
-
|
|
142
|
-
console.log("signer:", root.address, { networkEnv, isSimulation, isProduction, release });
|
|
143
|
-
|
|
144
|
-
if (isSimulation) {
|
|
145
|
-
networkEnv = network;
|
|
146
|
-
guardian = await ethers.getImpersonatedSigner(release.GuardiansSafe);
|
|
147
|
-
|
|
148
|
-
await root.sendTransaction({
|
|
149
|
-
value: ethers.utils.parseEther("1"),
|
|
150
|
-
to: release.GuardiansSafe
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
const identityImpl = await ethers.deployContract("IdentityV3");
|
|
155
|
-
const bridgeImpl = bridgeUpgradeImpl[networkEnv];
|
|
156
|
-
|
|
157
|
-
// Extract the first four bytes as the function selector
|
|
158
|
-
console.log("deployed new impls", { identityImpl: identityImpl.address });
|
|
159
|
-
|
|
160
|
-
const proposalActions = [
|
|
161
|
-
[
|
|
162
|
-
release.Identity,
|
|
163
|
-
"upgradeTo(address)",
|
|
164
|
-
ethers.utils.defaultAbiCoder.encode(["address"], [identityImpl.address]),
|
|
165
|
-
"0"
|
|
166
|
-
], //upgrade identity
|
|
167
|
-
[
|
|
168
|
-
release.MpbBridge,
|
|
169
|
-
"upgradeTo(address)",
|
|
170
|
-
ethers.utils.defaultAbiCoder.encode(["address"], [bridgeImpl]),
|
|
171
|
-
"0"
|
|
172
|
-
], //upgrade bridge
|
|
173
|
-
];
|
|
174
|
-
|
|
175
|
-
console.log({
|
|
176
|
-
networkEnv,
|
|
177
|
-
guardian: guardian.address,
|
|
178
|
-
isSimulation,
|
|
179
|
-
isProduction,
|
|
180
|
-
release
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
const proposalContracts = proposalActions.map(a => a[0]);
|
|
184
|
-
const proposalFunctionSignatures = proposalActions.map(a => a[1]);
|
|
185
|
-
const proposalFunctionInputs = proposalActions.map(a => a[2]);
|
|
186
|
-
const proposalEthValues = proposalActions.map(a => a[3]);
|
|
187
|
-
if (isProduction && !checksOnly) {
|
|
188
|
-
await executeViaSafe(
|
|
189
|
-
proposalContracts,
|
|
190
|
-
proposalEthValues,
|
|
191
|
-
proposalFunctionSignatures,
|
|
192
|
-
proposalFunctionInputs,
|
|
193
|
-
release.GuardiansSafe,
|
|
194
|
-
"fuse"
|
|
195
|
-
);
|
|
196
|
-
} else if (!checksOnly) {
|
|
197
|
-
await executeViaGuardian(
|
|
198
|
-
proposalContracts,
|
|
199
|
-
proposalEthValues,
|
|
200
|
-
proposalFunctionSignatures,
|
|
201
|
-
proposalFunctionInputs,
|
|
202
|
-
guardian,
|
|
203
|
-
networkEnv
|
|
204
|
-
);
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
export const upgradeEthStep2 = async (network, checksOnly) => {
|
|
209
|
-
let [root] = await ethers.getSigners();
|
|
210
|
-
|
|
211
|
-
const isProduction = networkName.includes("production");
|
|
212
|
-
|
|
213
|
-
if (isProduction) verifyProductionSigner(root);
|
|
214
|
-
|
|
215
|
-
let networkEnv = networkName;
|
|
216
|
-
let guardian = root;
|
|
217
|
-
if (isSimulation) {
|
|
218
|
-
networkEnv = network;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
let release: { [key: string]: any } = dao[networkEnv];
|
|
222
|
-
|
|
223
|
-
console.log("signer:", root.address, { networkEnv, isSimulation, isProduction, release });
|
|
224
|
-
|
|
225
|
-
if (isSimulation) {
|
|
226
|
-
networkEnv = network;
|
|
227
|
-
guardian = await ethers.getImpersonatedSigner(release.GuardiansSafe);
|
|
228
|
-
|
|
229
|
-
await root.sendTransaction({
|
|
230
|
-
value: ethers.utils.parseEther("1"),
|
|
231
|
-
to: release.GuardiansSafe
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
const bridgeImpl = bridgeUpgradeImpl[networkEnv];
|
|
236
|
-
|
|
237
|
-
const proposalActions = [
|
|
238
|
-
[
|
|
239
|
-
release.MpbBridge,
|
|
240
|
-
"upgradeTo(address)",
|
|
241
|
-
ethers.utils.defaultAbiCoder.encode(["address"], [bridgeImpl]),
|
|
242
|
-
"0"
|
|
243
|
-
] //upgrade bridge
|
|
244
|
-
];
|
|
245
|
-
|
|
246
|
-
console.log({
|
|
247
|
-
networkEnv,
|
|
248
|
-
guardian: guardian.address,
|
|
249
|
-
isSimulation,
|
|
250
|
-
isProduction,
|
|
251
|
-
release
|
|
252
|
-
});
|
|
253
|
-
|
|
254
|
-
const proposalContracts = proposalActions.map(a => a[0]);
|
|
255
|
-
const proposalFunctionSignatures = proposalActions.map(a => a[1]);
|
|
256
|
-
const proposalFunctionInputs = proposalActions.map(a => a[2]);
|
|
257
|
-
const proposalEthValues = proposalActions.map(a => a[3]);
|
|
258
|
-
if (isProduction && !checksOnly) {
|
|
259
|
-
await executeViaSafe(
|
|
260
|
-
proposalContracts,
|
|
261
|
-
proposalEthValues,
|
|
262
|
-
proposalFunctionSignatures,
|
|
263
|
-
proposalFunctionInputs,
|
|
264
|
-
release.GuardiansSafe,
|
|
265
|
-
"mainnet"
|
|
266
|
-
);
|
|
267
|
-
} else if (!checksOnly) {
|
|
268
|
-
await executeViaGuardian(
|
|
269
|
-
proposalContracts,
|
|
270
|
-
proposalEthValues,
|
|
271
|
-
proposalFunctionSignatures,
|
|
272
|
-
proposalFunctionInputs,
|
|
273
|
-
guardian,
|
|
274
|
-
networkEnv
|
|
275
|
-
);
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
export const upgradeXdcStep2 = async (network, checksOnly) => {
|
|
280
|
-
let [root] = await ethers.getSigners();
|
|
281
|
-
|
|
282
|
-
const isProduction = networkName.includes("production");
|
|
283
|
-
|
|
284
|
-
if (isProduction) verifyProductionSigner(root);
|
|
285
|
-
|
|
286
|
-
let networkEnv = networkName;
|
|
287
|
-
let guardian = root;
|
|
288
|
-
if (isSimulation) {
|
|
289
|
-
networkEnv = network;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
let release: { [key: string]: any } = dao[networkEnv];
|
|
293
|
-
|
|
294
|
-
console.log("signer:", root.address, { networkEnv, isSimulation, isProduction, release });
|
|
295
|
-
|
|
296
|
-
if (isSimulation) {
|
|
297
|
-
networkEnv = network;
|
|
298
|
-
guardian = await ethers.getImpersonatedSigner(release.GuardiansSafe);
|
|
299
|
-
|
|
300
|
-
await root.sendTransaction({
|
|
301
|
-
value: ethers.utils.parseEther("1"),
|
|
302
|
-
to: release.GuardiansSafe
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
const bridgeImpl = bridgeUpgradeImpl[networkEnv];
|
|
307
|
-
const proposalActions = [
|
|
308
|
-
[release.MpbBridge, "upgradeTo(address)", ethers.utils.defaultAbiCoder.encode(["address"], [bridgeImpl]), "0"] //upgrade bridge
|
|
309
|
-
];
|
|
310
|
-
|
|
311
|
-
console.log({
|
|
312
|
-
networkEnv,
|
|
313
|
-
guardian: guardian.address,
|
|
314
|
-
isSimulation,
|
|
315
|
-
isProduction,
|
|
316
|
-
release
|
|
317
|
-
});
|
|
318
|
-
|
|
319
|
-
const proposalContracts = proposalActions.map(a => a[0]);
|
|
320
|
-
const proposalFunctionSignatures = proposalActions.map(a => a[1]);
|
|
321
|
-
const proposalFunctionInputs = proposalActions.map(a => a[2]);
|
|
322
|
-
const proposalEthValues = proposalActions.map(a => a[3]);
|
|
323
|
-
if (isProduction && !checksOnly) {
|
|
324
|
-
await executeViaSafe(
|
|
325
|
-
proposalContracts,
|
|
326
|
-
proposalEthValues,
|
|
327
|
-
proposalFunctionSignatures,
|
|
328
|
-
proposalFunctionInputs,
|
|
329
|
-
release.GuardiansSafe,
|
|
330
|
-
"xdc"
|
|
331
|
-
);
|
|
332
|
-
} else if (!checksOnly) {
|
|
333
|
-
await executeViaGuardian(
|
|
334
|
-
proposalContracts,
|
|
335
|
-
proposalEthValues,
|
|
336
|
-
proposalFunctionSignatures,
|
|
337
|
-
proposalFunctionInputs,
|
|
338
|
-
guardian,
|
|
339
|
-
networkEnv
|
|
340
|
-
);
|
|
341
|
-
}
|
|
342
|
-
};
|
|
343
|
-
|
|
344
|
-
const calculateReserveParams = async () => {
|
|
345
|
-
const celoProvider = new ethers.providers.JsonRpcProvider("https://forno.celo.org");
|
|
346
|
-
const gd = await ethers.getContractAt("GoodDollar", dao["production-celo"].GoodDollar);
|
|
347
|
-
const celoCusd = (await ethers.getContractAt("IERC20", dao["production-celo"].CUSD)).connect(celoProvider);
|
|
348
|
-
const gdCelo = gd.connect(celoProvider);
|
|
349
|
-
const totalSupplyCelo = await gdCelo.totalSupply();
|
|
350
|
-
const reserveBalance = await celoCusd.balanceOf(dao["production-celo"].MentoReserve);
|
|
351
|
-
const xdcReserveBalance = ethers.utils.parseUnits("200000", 18); //200k in xdc
|
|
352
|
-
const totalUSD = reserveBalance.add(xdcReserveBalance); //reserve + 200k in xdc
|
|
353
|
-
const xdcSupplyShare = xdcReserveBalance.mul(1e8).div(totalUSD);
|
|
354
|
-
const xdcGdSupplyEquivalent = totalSupplyCelo.mul(xdcSupplyShare).div(1e8);
|
|
355
|
-
const price = ethers.utils.parseUnits("0.00013", 8);
|
|
356
|
-
const celoGdSupplyEquivalent = totalSupplyCelo.sub(xdcGdSupplyEquivalent);
|
|
357
|
-
|
|
358
|
-
console.log({
|
|
359
|
-
totalSupplyCelo,
|
|
360
|
-
reserveBalance,
|
|
361
|
-
totalUSD,
|
|
362
|
-
xdcSupplyShare,
|
|
363
|
-
xdcGdSupplyEquivalent,
|
|
364
|
-
celoGdSupplyEquivalent
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
// uint32 reserveRatio = uint32(
|
|
368
|
-
// (cUSDBalance * 1e18 * 1e8) / (price * totalGlobalSupply)
|
|
369
|
-
// );
|
|
370
|
-
//calculate reserve ratio
|
|
371
|
-
const reserveRatioXdc = xdcReserveBalance
|
|
372
|
-
.mul(ethers.BigNumber.from("100000000")) //1e8
|
|
373
|
-
.mul(ethers.BigNumber.from("1000000000000000000")) //1e18
|
|
374
|
-
.div(xdcGdSupplyEquivalent.mul(price));
|
|
375
|
-
console.log(
|
|
376
|
-
"recommended reserve ratio for xdc:",
|
|
377
|
-
reserveRatioXdc.toString(),
|
|
378
|
-
reserveRatioXdc.div("10000000000").toNumber() / 1e8
|
|
379
|
-
);
|
|
380
|
-
|
|
381
|
-
//calcualte reserve ratio for celo
|
|
382
|
-
const reserveRatioCelo = reserveBalance
|
|
383
|
-
.mul(ethers.BigNumber.from("100000000")) //1e8
|
|
384
|
-
.mul(ethers.BigNumber.from("1000000000000000000")) //1e18
|
|
385
|
-
.div(celoGdSupplyEquivalent.mul(price));
|
|
386
|
-
|
|
387
|
-
console.log(
|
|
388
|
-
"recommended reserve ratio for celo:",
|
|
389
|
-
reserveRatioCelo.toString(),
|
|
390
|
-
reserveRatioCelo.div("10000000000").toNumber() / 1e8
|
|
391
|
-
);
|
|
392
|
-
};
|
|
393
|
-
|
|
394
|
-
export const main = async () => {
|
|
395
|
-
// await calculateReserveParams();
|
|
396
|
-
// return;
|
|
397
|
-
prompt.start();
|
|
398
|
-
const { network } = await prompt.get(["network"]);
|
|
399
|
-
|
|
400
|
-
console.log("running step:", { network });
|
|
401
|
-
const chain = last(network.split("-")) || "fuse";
|
|
402
|
-
console.log("detected chain:", chain, network);
|
|
403
|
-
switch (chain) {
|
|
404
|
-
case "mainnet":
|
|
405
|
-
await upgradeEthStep2(network, false);
|
|
406
|
-
|
|
407
|
-
break;
|
|
408
|
-
case "production":
|
|
409
|
-
case "fuse":
|
|
410
|
-
await upgradeFuseStep2(network, false);
|
|
411
|
-
|
|
412
|
-
break;
|
|
413
|
-
case "celo":
|
|
414
|
-
await upgradeCeloStep2(network, false);
|
|
415
|
-
|
|
416
|
-
break;
|
|
417
|
-
}
|
|
418
|
-
};
|
|
419
|
-
|
|
420
|
-
// upgradeCeloFix("production-celo", false).catch(console.log);
|
|
421
|
-
// upgradeEthFix("production-mainnet", false).catch(console.log);
|
|
422
|
-
upgradeFuseFix("production", false).catch(console.log);
|
|
423
|
-
// upgradeXdcFix("production-xdc", false).catch(console.log);
|
|
424
|
-
// verifyUpgradeCeloStep1("production-celo");
|
|
425
|
-
// main().catch(console.log);
|