@keep-network/tbtc-v2 1.0.1-dev.0 → 1.0.1-dev.2
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/BLS.json +1 -1
- package/artifacts/Bank.json +11 -11
- package/artifacts/BeaconAuthorization.json +1 -1
- package/artifacts/BeaconDkg.json +1 -1
- package/artifacts/BeaconDkgValidator.json +1 -1
- package/artifacts/BeaconInactivity.json +1 -1
- package/artifacts/BeaconSortitionPool.json +3 -3
- package/artifacts/Bridge.json +31 -31
- package/artifacts/BridgeGovernance.json +16 -16
- package/artifacts/BridgeGovernanceParameters.json +6 -6
- package/artifacts/Deposit.json +6 -6
- package/artifacts/DepositSweep.json +6 -6
- package/artifacts/DonationVault.json +7 -7
- package/artifacts/EcdsaDkgValidator.json +1 -1
- package/artifacts/EcdsaInactivity.json +1 -1
- package/artifacts/EcdsaSortitionPool.json +3 -3
- package/artifacts/Fraud.json +6 -6
- package/artifacts/KeepRegistry.json +1 -1
- package/artifacts/KeepStake.json +2 -2
- package/artifacts/KeepToken.json +2 -2
- package/artifacts/KeepTokenStaking.json +1 -1
- package/artifacts/LightRelay.json +2 -2
- package/artifacts/MaintainerProxy.json +12 -12
- package/artifacts/MovingFunds.json +6 -6
- package/artifacts/NuCypherStakingEscrow.json +1 -1
- package/artifacts/NuCypherToken.json +2 -2
- package/artifacts/RandomBeacon.json +2 -2
- package/artifacts/RandomBeaconChaosnet.json +2 -2
- package/artifacts/RandomBeaconGovernance.json +2 -2
- package/artifacts/Redemption.json +6 -6
- package/artifacts/ReimbursementPool.json +2 -2
- package/artifacts/T.json +2 -2
- package/artifacts/TBTC.json +2 -2
- package/artifacts/TBTCToken.json +2 -2
- package/artifacts/TBTCVault.json +13 -13
- package/artifacts/TokenStaking.json +1 -1
- package/artifacts/TokenholderGovernor.json +9 -9
- package/artifacts/TokenholderTimelock.json +8 -8
- package/artifacts/VendingMachine.json +2 -2
- package/artifacts/VendingMachineKeep.json +1 -1
- package/artifacts/VendingMachineNuCypher.json +1 -1
- package/artifacts/WalletRegistry.json +5 -5
- package/artifacts/WalletRegistryGovernance.json +2 -2
- package/artifacts/Wallets.json +6 -6
- package/deploy/03_deploy_vending_machine.ts +0 -6
- package/deploy/24_transfer_tbtc_ownership.ts +31 -0
- package/deploy/{24_transfer_maintainer_proxy_ownership.ts → 25_transfer_maintainer_proxy_ownership.ts} +0 -0
- package/deploy/{25_transfer_proxy_admin_ownership.ts → 26_transfer_proxy_admin_ownership.ts} +0 -0
- package/deploy/{26_authorize_maintainer_proxy_in_reimbursement_pool.ts → 27_authorize_maintainer_proxy_in_reimbursement_pool.ts} +0 -0
- package/deploy/{27_authorize_bridge_in_reimbursement_pool.ts → 28_authorize_bridge_in_reimbursement_pool.ts} +0 -0
- package/deploy/{28_deploy_proxy_admin_with_deputy.ts → 29_deploy_proxy_admin_with_deputy.ts} +0 -0
- package/deploy/80_upgrade_bridge_v2.ts +85 -0
- package/export/deploy/03_deploy_vending_machine.js +7 -10
- package/export/deploy/24_transfer_tbtc_ownership.js +72 -0
- package/export/deploy/{24_transfer_maintainer_proxy_ownership.js → 25_transfer_maintainer_proxy_ownership.js} +0 -0
- package/export/deploy/{25_transfer_proxy_admin_ownership.js → 26_transfer_proxy_admin_ownership.js} +0 -0
- package/export/deploy/{26_authorize_maintainer_proxy_in_reimbursement_pool.js → 27_authorize_maintainer_proxy_in_reimbursement_pool.js} +0 -0
- package/export/deploy/{27_authorize_bridge_in_reimbursement_pool.js → 28_authorize_bridge_in_reimbursement_pool.js} +0 -0
- package/export/deploy/{28_deploy_proxy_admin_with_deputy.js → 29_deploy_proxy_admin_with_deputy.js} +0 -0
- package/export/deploy/80_upgrade_bridge_v2.js +169 -0
- package/export/hardhat.config.js +8 -8
- package/package.json +4 -4
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
39
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
40
|
+
if (!m) return o;
|
|
41
|
+
var i = m.call(o), r, ar = [], e;
|
|
42
|
+
try {
|
|
43
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
44
|
+
}
|
|
45
|
+
catch (error) { e = { error: error }; }
|
|
46
|
+
finally {
|
|
47
|
+
try {
|
|
48
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
49
|
+
}
|
|
50
|
+
finally { if (e) throw e.error; }
|
|
51
|
+
}
|
|
52
|
+
return ar;
|
|
53
|
+
};
|
|
54
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
+
var func = function (hre) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
57
|
+
var ethers, helpers, deployments, getNamedAccounts, get, _a, deployer, treasury, Bank, LightRelay, WalletRegistry, ReimbursementPool, txProofDifficultyFactor, Deposit, DepositSweep, Redemption, Wallets, Fraud, MovingFunds, _b, bridge, proxyDeployment, _c, _d, _e;
|
|
58
|
+
var _f, _g;
|
|
59
|
+
return __generator(this, function (_h) {
|
|
60
|
+
switch (_h.label) {
|
|
61
|
+
case 0:
|
|
62
|
+
ethers = hre.ethers, helpers = hre.helpers, deployments = hre.deployments, getNamedAccounts = hre.getNamedAccounts;
|
|
63
|
+
get = deployments.get;
|
|
64
|
+
return [4 /*yield*/, getNamedAccounts()];
|
|
65
|
+
case 1:
|
|
66
|
+
_a = _h.sent(), deployer = _a.deployer, treasury = _a.treasury;
|
|
67
|
+
return [4 /*yield*/, deployments.get("Bank")];
|
|
68
|
+
case 2:
|
|
69
|
+
Bank = _h.sent();
|
|
70
|
+
return [4 /*yield*/, deployments.get("LightRelay")];
|
|
71
|
+
case 3:
|
|
72
|
+
LightRelay = _h.sent();
|
|
73
|
+
return [4 /*yield*/, deployments.get("WalletRegistry")];
|
|
74
|
+
case 4:
|
|
75
|
+
WalletRegistry = _h.sent();
|
|
76
|
+
return [4 /*yield*/, deployments.get("ReimbursementPool")];
|
|
77
|
+
case 5:
|
|
78
|
+
ReimbursementPool = _h.sent();
|
|
79
|
+
txProofDifficultyFactor = 6;
|
|
80
|
+
return [4 /*yield*/, get("Deposit")];
|
|
81
|
+
case 6:
|
|
82
|
+
Deposit = _h.sent();
|
|
83
|
+
return [4 /*yield*/, get("DepositSweep")];
|
|
84
|
+
case 7:
|
|
85
|
+
DepositSweep = _h.sent();
|
|
86
|
+
return [4 /*yield*/, get("Redemption")];
|
|
87
|
+
case 8:
|
|
88
|
+
Redemption = _h.sent();
|
|
89
|
+
return [4 /*yield*/, get("Wallets")];
|
|
90
|
+
case 9:
|
|
91
|
+
Wallets = _h.sent();
|
|
92
|
+
return [4 /*yield*/, get("Fraud")];
|
|
93
|
+
case 10:
|
|
94
|
+
Fraud = _h.sent();
|
|
95
|
+
return [4 /*yield*/, get("MovingFunds")];
|
|
96
|
+
case 11:
|
|
97
|
+
MovingFunds = _h.sent();
|
|
98
|
+
_d = (_c = helpers.upgrades).upgradeProxy;
|
|
99
|
+
_e = ["Bridge",
|
|
100
|
+
"Bridge"];
|
|
101
|
+
_f = {
|
|
102
|
+
contractName: "Bridge",
|
|
103
|
+
initializerArgs: [
|
|
104
|
+
Bank.address,
|
|
105
|
+
LightRelay.address,
|
|
106
|
+
treasury,
|
|
107
|
+
WalletRegistry.address,
|
|
108
|
+
ReimbursementPool.address,
|
|
109
|
+
txProofDifficultyFactor,
|
|
110
|
+
]
|
|
111
|
+
};
|
|
112
|
+
_g = {};
|
|
113
|
+
return [4 /*yield*/, ethers.getSigner(deployer)];
|
|
114
|
+
case 12: return [4 /*yield*/, _d.apply(_c, _e.concat([(_f.factoryOpts = (_g.signer = _h.sent(),
|
|
115
|
+
_g.libraries = {
|
|
116
|
+
Deposit: Deposit.address,
|
|
117
|
+
DepositSweep: DepositSweep.address,
|
|
118
|
+
Redemption: Redemption.address,
|
|
119
|
+
Wallets: Wallets.address,
|
|
120
|
+
Fraud: Fraud.address,
|
|
121
|
+
MovingFunds: MovingFunds.address,
|
|
122
|
+
},
|
|
123
|
+
_g),
|
|
124
|
+
_f.proxyOpts = {
|
|
125
|
+
kind: "transparent",
|
|
126
|
+
// Allow external libraries linking. We need to ensure manually that the
|
|
127
|
+
// external libraries we link are upgrade safe, as the OpenZeppelin plugin
|
|
128
|
+
// doesn't perform such a validation yet.
|
|
129
|
+
// See: https://docs.openzeppelin.com/upgrades-plugins/1.x/faq#why-cant-i-use-external-libraries
|
|
130
|
+
unsafeAllow: ["external-library-linking"],
|
|
131
|
+
},
|
|
132
|
+
_f)]))];
|
|
133
|
+
case 13:
|
|
134
|
+
_b = __read.apply(void 0, [_h.sent(), 2]), bridge = _b[0], proxyDeployment = _b[1];
|
|
135
|
+
if (!hre.network.tags.etherscan) return [3 /*break*/, 15];
|
|
136
|
+
// We use `verify` instead of `verify:verify` as the `verify` task is defined
|
|
137
|
+
// in "@openzeppelin/hardhat-upgrades" to perform Etherscan verification
|
|
138
|
+
// of Proxy and Implementation contracts.
|
|
139
|
+
return [4 /*yield*/, hre.run("verify", {
|
|
140
|
+
address: proxyDeployment.address,
|
|
141
|
+
constructorArgsParams: proxyDeployment.args,
|
|
142
|
+
})];
|
|
143
|
+
case 14:
|
|
144
|
+
// We use `verify` instead of `verify:verify` as the `verify` task is defined
|
|
145
|
+
// in "@openzeppelin/hardhat-upgrades" to perform Etherscan verification
|
|
146
|
+
// of Proxy and Implementation contracts.
|
|
147
|
+
_h.sent();
|
|
148
|
+
_h.label = 15;
|
|
149
|
+
case 15:
|
|
150
|
+
if (!hre.network.tags.tenderly) return [3 /*break*/, 17];
|
|
151
|
+
return [4 /*yield*/, hre.tenderly.verify({
|
|
152
|
+
name: "Bridge",
|
|
153
|
+
address: bridge.address,
|
|
154
|
+
})];
|
|
155
|
+
case 16:
|
|
156
|
+
_h.sent();
|
|
157
|
+
_h.label = 17;
|
|
158
|
+
case 17: return [2 /*return*/];
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
exports.default = func;
|
|
164
|
+
func.tags = ["UpgradeBridge"];
|
|
165
|
+
// When running an upgrade uncomment the skip below and run the command:
|
|
166
|
+
// yarn deploy --tags UpgradeBridge --network <NETWORK>
|
|
167
|
+
func.skip = function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
168
|
+
return [2 /*return*/, true];
|
|
169
|
+
}); }); };
|
package/export/hardhat.config.js
CHANGED
|
@@ -104,7 +104,7 @@ var config = {
|
|
|
104
104
|
accounts: process.env.ACCOUNTS_PRIVATE_KEYS
|
|
105
105
|
? process.env.ACCOUNTS_PRIVATE_KEYS.split(",")
|
|
106
106
|
: undefined,
|
|
107
|
-
tags: ["
|
|
107
|
+
tags: ["tenderly"],
|
|
108
108
|
},
|
|
109
109
|
mainnet: {
|
|
110
110
|
url: process.env.CHAIN_API_URL || "",
|
|
@@ -164,39 +164,39 @@ var config = {
|
|
|
164
164
|
},
|
|
165
165
|
governance: {
|
|
166
166
|
default: 2,
|
|
167
|
-
goerli:
|
|
167
|
+
goerli: 0,
|
|
168
168
|
mainnet: "0x9f6e831c8f8939dc0c830c6e492e7cef4f9c2f5f", // Threshold Council
|
|
169
169
|
},
|
|
170
170
|
chaosnetOwner: {
|
|
171
171
|
default: 3,
|
|
172
|
-
goerli:
|
|
172
|
+
goerli: 0,
|
|
173
173
|
// Not used for mainnet deployment scripts of `@keepn-network/tbtc-v2`.
|
|
174
174
|
// Used by `@keep-network/random-beacon` and `@keep-network/ecdsa`
|
|
175
175
|
// when deploying `SortitionPool`s.
|
|
176
176
|
},
|
|
177
177
|
esdm: {
|
|
178
178
|
default: 4,
|
|
179
|
-
goerli:
|
|
179
|
+
goerli: 0,
|
|
180
180
|
mainnet: "0x9f6e831c8f8939dc0c830c6e492e7cef4f9c2f5f", // Threshold Council
|
|
181
181
|
},
|
|
182
182
|
keepTechnicalWalletTeam: {
|
|
183
183
|
default: 5,
|
|
184
|
-
goerli:
|
|
184
|
+
goerli: 0,
|
|
185
185
|
mainnet: "0xB3726E69Da808A689F2607939a2D9E958724FC2A",
|
|
186
186
|
},
|
|
187
187
|
keepCommunityMultiSig: {
|
|
188
188
|
default: 6,
|
|
189
|
-
goerli:
|
|
189
|
+
goerli: 0,
|
|
190
190
|
mainnet: "0x19FcB32347ff4656E4E6746b4584192D185d640d",
|
|
191
191
|
},
|
|
192
192
|
treasury: {
|
|
193
193
|
default: 7,
|
|
194
|
-
goerli:
|
|
194
|
+
goerli: 0,
|
|
195
195
|
mainnet: "0x87F005317692D05BAA4193AB0c961c69e175f45f", // Token Holder DAO
|
|
196
196
|
},
|
|
197
197
|
spvMaintainer: {
|
|
198
198
|
default: 8,
|
|
199
|
-
goerli:
|
|
199
|
+
goerli: 0,
|
|
200
200
|
// We are not setting SPV maintainer for mainnet in deployment scripts.
|
|
201
201
|
},
|
|
202
202
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keep-network/tbtc-v2",
|
|
3
|
-
"version": "1.0.1-dev.
|
|
3
|
+
"version": "1.0.1-dev.2+main.2b8297e3991b73f10a9923546d1fcb66752535d8",
|
|
4
4
|
"license": "GPL-3.0-only",
|
|
5
5
|
"files": [
|
|
6
6
|
"artifacts/",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@keep-network/bitcoin-spv-sol": "3.4.0-solc-0.8",
|
|
35
|
-
"@keep-network/ecdsa": "2.1.0-dev.
|
|
35
|
+
"@keep-network/ecdsa": "2.1.0-dev.6",
|
|
36
36
|
"@keep-network/random-beacon": "2.1.0-dev.5",
|
|
37
37
|
"@keep-network/tbtc": "1.1.2-dev.1",
|
|
38
38
|
"@openzeppelin/contracts": "^4.6.0",
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@defi-wonderland/smock": "^2.3.4",
|
|
44
|
-
"@keep-network/hardhat-helpers": "
|
|
44
|
+
"@keep-network/hardhat-helpers": "0.6.0-pre.18",
|
|
45
45
|
"@keep-network/hardhat-local-networks-config": "^0.1.0-pre.4",
|
|
46
46
|
"@nomiclabs/hardhat-ethers": "^2.0.6",
|
|
47
47
|
"@nomiclabs/hardhat-etherscan": "^3.1.0",
|
|
48
48
|
"@nomiclabs/hardhat-waffle": "^2.0.2",
|
|
49
|
-
"@openzeppelin/hardhat-upgrades": "
|
|
49
|
+
"@openzeppelin/hardhat-upgrades": "1.22.0",
|
|
50
50
|
"@tenderly/hardhat-tenderly": ">=1.0.12 <1.2.0",
|
|
51
51
|
"@thesis-co/eslint-config": "github:thesis/eslint-config",
|
|
52
52
|
"@typechain/ethers-v5": "^8.0.5",
|