@keep-network/tbtc-v2 1.0.3-dev.1 → 1.0.3-dev.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.
Files changed (140) hide show
  1. package/artifacts/BLS.json +1 -1
  2. package/artifacts/Bank.json +3 -3
  3. package/artifacts/BeaconAuthorization.json +1 -1
  4. package/artifacts/BeaconDkg.json +1 -1
  5. package/artifacts/BeaconDkgValidator.json +1 -1
  6. package/artifacts/BeaconInactivity.json +1 -1
  7. package/artifacts/BeaconSortitionPool.json +3 -3
  8. package/artifacts/Bridge.json +5 -5
  9. package/artifacts/BridgeGovernance.json +2 -2
  10. package/artifacts/BridgeGovernanceParameters.json +2 -2
  11. package/artifacts/Deposit.json +2 -2
  12. package/artifacts/DepositSweep.json +2 -2
  13. package/artifacts/DonationVault.json +3 -3
  14. package/artifacts/EcdsaDkgValidator.json +1 -1
  15. package/artifacts/EcdsaInactivity.json +1 -1
  16. package/artifacts/EcdsaSortitionPool.json +3 -3
  17. package/artifacts/Fraud.json +2 -2
  18. package/artifacts/KeepRegistry.json +1 -1
  19. package/artifacts/KeepStake.json +2 -2
  20. package/artifacts/KeepToken.json +2 -2
  21. package/artifacts/KeepTokenStaking.json +1 -1
  22. package/artifacts/LightRelay.json +18 -18
  23. package/artifacts/MaintainerProxy.json +19 -19
  24. package/artifacts/MovingFunds.json +2 -2
  25. package/artifacts/NuCypherStakingEscrow.json +1 -1
  26. package/artifacts/NuCypherToken.json +2 -2
  27. package/artifacts/RandomBeacon.json +2 -2
  28. package/artifacts/RandomBeaconChaosnet.json +2 -2
  29. package/artifacts/RandomBeaconGovernance.json +2 -2
  30. package/artifacts/Redemption.json +2 -2
  31. package/artifacts/ReimbursementPool.json +2 -2
  32. package/artifacts/T.json +2 -2
  33. package/artifacts/TBTC.json +3 -3
  34. package/artifacts/TBTCToken.json +3 -3
  35. package/artifacts/TBTCVault.json +23 -23
  36. package/artifacts/TokenStaking.json +1 -1
  37. package/artifacts/TokenholderGovernor.json +9 -9
  38. package/artifacts/TokenholderTimelock.json +8 -8
  39. package/artifacts/VendingMachine.json +3 -3
  40. package/artifacts/VendingMachineKeep.json +1 -1
  41. package/artifacts/VendingMachineNuCypher.json +1 -1
  42. package/artifacts/VendingMachineV2.json +360 -0
  43. package/artifacts/VendingMachineV3.json +405 -0
  44. package/artifacts/WalletRegistry.json +5 -5
  45. package/artifacts/WalletRegistryGovernance.json +2 -2
  46. package/artifacts/Wallets.json +2 -2
  47. package/artifacts/solcInputs/{5835b0a74f2a5433fcfb8074d31a6e8a.json → b0025f1f7efe4824592ac0c9793776c3.json} +6 -0
  48. package/build/contracts/GovernanceUtils.sol/GovernanceUtils.dbg.json +1 -1
  49. package/build/contracts/bank/Bank.sol/Bank.dbg.json +1 -1
  50. package/build/contracts/bank/IReceiveBalanceApproval.sol/IReceiveBalanceApproval.dbg.json +1 -1
  51. package/build/contracts/bridge/BitcoinTx.sol/BitcoinTx.dbg.json +1 -1
  52. package/build/contracts/bridge/Bridge.sol/Bridge.dbg.json +1 -1
  53. package/build/contracts/bridge/BridgeGovernanceParameters.sol/BridgeGovernanceParameters.dbg.json +1 -1
  54. package/build/contracts/bridge/BridgeState.sol/BridgeState.dbg.json +1 -1
  55. package/build/contracts/bridge/Deposit.sol/Deposit.dbg.json +1 -1
  56. package/build/contracts/bridge/DepositSweep.sol/DepositSweep.dbg.json +1 -1
  57. package/build/contracts/bridge/EcdsaLib.sol/EcdsaLib.dbg.json +1 -1
  58. package/build/contracts/bridge/Fraud.sol/Fraud.dbg.json +1 -1
  59. package/build/contracts/bridge/Heartbeat.sol/Heartbeat.dbg.json +1 -1
  60. package/build/contracts/bridge/IRelay.sol/IRelay.dbg.json +1 -1
  61. package/build/contracts/bridge/MovingFunds.sol/MovingFunds.dbg.json +1 -1
  62. package/build/contracts/bridge/Redemption.sol/OutboundTx.dbg.json +1 -1
  63. package/build/contracts/bridge/Redemption.sol/Redemption.dbg.json +1 -1
  64. package/build/contracts/bridge/VendingMachine.sol/VendingMachine.dbg.json +1 -1
  65. package/build/contracts/bridge/VendingMachineV2.sol/VendingMachineV2.dbg.json +4 -0
  66. package/build/contracts/bridge/VendingMachineV2.sol/VendingMachineV2.json +245 -0
  67. package/build/contracts/bridge/VendingMachineV3.sol/VendingMachineV3.dbg.json +4 -0
  68. package/build/contracts/bridge/VendingMachineV3.sol/VendingMachineV3.json +282 -0
  69. package/build/contracts/bridge/Wallets.sol/Wallets.dbg.json +1 -1
  70. package/build/contracts/l2/L2TBTC.sol/L2TBTC.dbg.json +1 -1
  71. package/build/contracts/maintainer/MaintainerProxy.sol/MaintainerProxy.dbg.json +1 -1
  72. package/build/contracts/relay/LightRelay.sol/ILightRelay.dbg.json +1 -1
  73. package/build/contracts/relay/LightRelay.sol/LightRelay.dbg.json +1 -1
  74. package/build/contracts/relay/LightRelay.sol/RelayUtils.dbg.json +1 -1
  75. package/build/contracts/token/TBTC.sol/TBTC.dbg.json +1 -1
  76. package/build/contracts/vault/DonationVault.sol/DonationVault.dbg.json +1 -1
  77. package/build/contracts/vault/IVault.sol/IVault.dbg.json +1 -1
  78. package/build/contracts/vault/TBTCOptimisticMinting.sol/TBTCOptimisticMinting.dbg.json +1 -1
  79. package/build/contracts/vault/TBTCVault.sol/TBTCVault.dbg.json +1 -1
  80. package/contracts/bridge/VendingMachineV2.sol +114 -0
  81. package/contracts/bridge/VendingMachineV3.sol +134 -0
  82. package/deploy/06_deploy_bridge.ts +7 -0
  83. package/deploy/09_deploy_bridge_governance.ts +2 -0
  84. package/deploy/24_transfer_tbtc_ownership.ts +7 -14
  85. package/deploy/30_deploy_vending_machine_v2.ts +34 -0
  86. package/deploy/31_deploy_vending_machine_v3.ts +34 -0
  87. package/deploy/32_transfer_vending_machine_v2_ownership.ts +19 -0
  88. package/deploy/33_transfer_vending_machine_v3_ownership.ts +19 -0
  89. package/export/artifacts/@keep-network/bitcoin-spv-sol/contracts/BTCUtils.sol/BTCUtils.json +20 -20
  90. package/export/artifacts/@keep-network/ecdsa/contracts/EcdsaDkgValidator.sol/EcdsaDkgValidator.json +1986 -1986
  91. package/export/artifacts/@keep-network/ecdsa/contracts/libraries/EcdsaDkg.sol/EcdsaDkg.json +20 -20
  92. package/export/artifacts/@keep-network/ecdsa/contracts/libraries/EcdsaInactivity.sol/EcdsaInactivity.json +1836 -1836
  93. package/export/artifacts/@keep-network/random-beacon/contracts/ReimbursementPool.sol/ReimbursementPool.json +545 -545
  94. package/export/artifacts/@keep-network/sortition-pools/contracts/Chaosnet.sol/Chaosnet.json +506 -506
  95. package/export/artifacts/@keep-network/sortition-pools/contracts/Rewards.sol/Rewards.json +23 -23
  96. package/export/artifacts/@keep-network/sortition-pools/contracts/SortitionPool.sol/SortitionPool.json +2456 -2456
  97. package/export/artifacts/@keep-network/sortition-pools/contracts/SortitionTree.sol/SortitionTree.json +465 -465
  98. package/export/artifacts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol/ERC1967Proxy.json +568 -568
  99. package/export/artifacts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/ProxyAdmin.json +603 -603
  100. package/export/artifacts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json +1001 -1001
  101. package/export/artifacts/@openzeppelin/contracts/token/ERC721/ERC721.sol/ERC721.json +1877 -1877
  102. package/export/artifacts/@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol/ERC20Upgradeable.json +654 -654
  103. package/export/artifacts/@thesis/solidity-contracts/contracts/token/ERC20WithPermit.sol/ERC20WithPermit.json +2534 -2534
  104. package/export/artifacts/@thesis/solidity-contracts/contracts/token/MisfundRecovery.sol/MisfundRecovery.json +736 -736
  105. package/export/artifacts/contracts/bank/Bank.sol/Bank.json +1872 -1872
  106. package/export/artifacts/contracts/bridge/Bridge.sol/Bridge.json +7083 -7083
  107. package/export/artifacts/contracts/bridge/VendingMachine.sol/VendingMachine.json +1257 -1257
  108. package/export/artifacts/contracts/bridge/VendingMachineV2.sol/VendingMachineV2.json +6199 -0
  109. package/export/artifacts/contracts/bridge/VendingMachineV3.sol/VendingMachineV3.json +7151 -0
  110. package/export/artifacts/contracts/l2/L2TBTC.sol/L2TBTC.json +3002 -3002
  111. package/export/artifacts/contracts/maintainer/MaintainerProxy.sol/MaintainerProxy.json +2393 -2393
  112. package/export/artifacts/contracts/relay/LightRelay.sol/LightRelay.json +1922 -1922
  113. package/export/artifacts/contracts/test/BankStub.sol/BankStub.json +1874 -1874
  114. package/export/artifacts/contracts/test/BridgeStub.sol/BridgeStub.json +8122 -8122
  115. package/export/artifacts/contracts/test/GoerliLightRelay.sol/GoerliLightRelay.json +1922 -1922
  116. package/export/artifacts/contracts/test/HeartbeatStub.sol/HeartbeatStub.json +130 -130
  117. package/export/artifacts/contracts/test/LightRelayStub.sol/LightRelayStub.json +2047 -2047
  118. package/export/artifacts/contracts/test/ReceiveApprovalStub.sol/ReceiveApprovalStub.json +354 -354
  119. package/export/artifacts/contracts/test/SystemTestRelay.sol/SystemTestRelay.json +568 -568
  120. package/export/artifacts/contracts/test/TestERC20.sol/TestERC20.json +2291 -2291
  121. package/export/artifacts/contracts/test/TestERC721.sol/TestERC721.json +1698 -1698
  122. package/export/artifacts/contracts/test/TestEcdsaLib.sol/TestEcdsaLib.json +189 -189
  123. package/export/artifacts/contracts/token/TBTC.sol/TBTC.json +2847 -2847
  124. package/export/artifacts/contracts/vault/DonationVault.sol/DonationVault.json +858 -858
  125. package/export/artifacts/contracts/vault/TBTCVault.sol/TBTCVault.json +3476 -3476
  126. package/export/deploy/06_deploy_bridge.js +30 -8
  127. package/export/deploy/09_deploy_bridge_governance.js +11 -7
  128. package/export/deploy/24_transfer_tbtc_ownership.js +14 -14
  129. package/export/deploy/30_deploy_vending_machine_v2.js +86 -0
  130. package/export/deploy/31_deploy_vending_machine_v3.js +86 -0
  131. package/export/deploy/32_transfer_vending_machine_v2_ownership.js +60 -0
  132. package/export/deploy/33_transfer_vending_machine_v3_ownership.js +60 -0
  133. package/export/hardhat.config.js +6 -0
  134. package/export/typechain/VendingMachineV2.js +2 -0
  135. package/export/typechain/VendingMachineV3.js +2 -0
  136. package/export/typechain/factories/VendingMachineV2__factory.js +324 -0
  137. package/export/typechain/factories/VendingMachineV3__factory.js +361 -0
  138. package/export/typechain/index.js +5 -1
  139. package/export.json +3362 -3358
  140. package/package.json +1 -1
@@ -153,7 +153,29 @@ var func = function (hre) {
153
153
  _f)]))];
154
154
  case 13:
155
155
  _b = __read.apply(void 0, [_h.sent(), 2]), bridge = _b[0], proxyDeployment = _b[1];
156
- if (!hre.network.tags.etherscan) return [3 /*break*/, 15];
156
+ if (!hre.network.tags.etherscan) return [3 /*break*/, 21];
157
+ return [4 /*yield*/, helpers.etherscan.verify(Deposit)];
158
+ case 14:
159
+ _h.sent();
160
+ return [4 /*yield*/, helpers.etherscan.verify(DepositSweep)];
161
+ case 15:
162
+ _h.sent();
163
+ return [4 /*yield*/, helpers.etherscan.verify(Redemption)];
164
+ case 16:
165
+ _h.sent();
166
+ return [4 /*yield*/, helpers.etherscan.verify(Wallets)];
167
+ case 17:
168
+ _h.sent();
169
+ return [4 /*yield*/, helpers.etherscan.verify(Fraud)];
170
+ case 18:
171
+ _h.sent();
172
+ return [4 /*yield*/, helpers.etherscan.verify(MovingFunds)
173
+ // We use `verify` instead of `verify:verify` as the `verify` task is defined
174
+ // in "@openzeppelin/hardhat-upgrades" to perform Etherscan verification
175
+ // of Proxy and Implementation contracts.
176
+ ];
177
+ case 19:
178
+ _h.sent();
157
179
  // We use `verify` instead of `verify:verify` as the `verify` task is defined
158
180
  // in "@openzeppelin/hardhat-upgrades" to perform Etherscan verification
159
181
  // of Proxy and Implementation contracts.
@@ -161,22 +183,22 @@ var func = function (hre) {
161
183
  address: proxyDeployment.address,
162
184
  constructorArgsParams: proxyDeployment.args,
163
185
  })];
164
- case 14:
186
+ case 20:
165
187
  // We use `verify` instead of `verify:verify` as the `verify` task is defined
166
188
  // in "@openzeppelin/hardhat-upgrades" to perform Etherscan verification
167
189
  // of Proxy and Implementation contracts.
168
190
  _h.sent();
169
- _h.label = 15;
170
- case 15:
171
- if (!hre.network.tags.tenderly) return [3 /*break*/, 17];
191
+ _h.label = 21;
192
+ case 21:
193
+ if (!hre.network.tags.tenderly) return [3 /*break*/, 23];
172
194
  return [4 /*yield*/, hre.tenderly.verify({
173
195
  name: "Bridge",
174
196
  address: bridge.address,
175
197
  })];
176
- case 16:
198
+ case 22:
177
199
  _h.sent();
178
- _h.label = 17;
179
- case 17: return [2 /*return*/];
200
+ _h.label = 23;
201
+ case 23: return [2 /*return*/];
180
202
  }
181
203
  });
182
204
  });
@@ -72,24 +72,28 @@ var func = function (hre) {
72
72
  })];
73
73
  case 4:
74
74
  bridgeGovernance = _a.sent();
75
- if (!hre.network.tags.etherscan) return [3 /*break*/, 6];
76
- return [4 /*yield*/, helpers.etherscan.verify(bridgeGovernance)];
75
+ if (!hre.network.tags.etherscan) return [3 /*break*/, 7];
76
+ return [4 /*yield*/, helpers.etherscan.verify(bridgeGovernanceParameters)];
77
77
  case 5:
78
78
  _a.sent();
79
- _a.label = 6;
79
+ return [4 /*yield*/, helpers.etherscan.verify(bridgeGovernance)];
80
80
  case 6:
81
- if (!hre.network.tags.tenderly) return [3 /*break*/, 8];
81
+ _a.sent();
82
+ _a.label = 7;
83
+ case 7:
84
+ if (!hre.network.tags.tenderly) return [3 /*break*/, 9];
82
85
  return [4 /*yield*/, hre.tenderly.verify({
83
86
  name: "BridgeGovernance",
84
87
  address: bridgeGovernance.address,
85
88
  })];
86
- case 7:
89
+ case 8:
87
90
  _a.sent();
88
- _a.label = 8;
89
- case 8: return [2 /*return*/];
91
+ _a.label = 9;
92
+ case 9: return [2 /*return*/];
90
93
  }
91
94
  });
92
95
  });
93
96
  };
94
97
  exports.default = func;
95
98
  func.tags = ["BridgeGovernance"];
99
+ func.dependencies = ["Bridge"];
@@ -38,30 +38,30 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  var func = function (hre) {
40
40
  return __awaiter(this, void 0, void 0, function () {
41
- var getNamedAccounts, deployments, helpers, deployer, VendingMachine, TBTCVault;
41
+ var getNamedAccounts, deployments, helpers, deployer, TBTCVault;
42
42
  return __generator(this, function (_a) {
43
43
  switch (_a.label) {
44
44
  case 0:
45
45
  getNamedAccounts = hre.getNamedAccounts, deployments = hre.deployments, helpers = hre.helpers;
46
- return [4 /*yield*/, getNamedAccounts()];
46
+ return [4 /*yield*/, getNamedAccounts()
47
+ // In unit tests we cover VendingMachine, VendingMachineV2, and TBTCVault
48
+ // contracts. All those tests require minting TBTC. To make the test setup
49
+ // easier, we leave the responsibility of transferring the TBTC ownership
50
+ // to the test. In system tests and on Goerli, TBTCVault is the owner of TBTC
51
+ // token, just like on v1.0 mainnet, after transferring the ownership from the
52
+ // VendingMachine.
53
+ ];
47
54
  case 1:
48
55
  deployer = (_a.sent()).deployer;
49
- if (!(hre.network.name === "hardhat")) return [3 /*break*/, 4];
50
- return [4 /*yield*/, deployments.get("VendingMachine")];
56
+ if (!(hre.network.name !== "hardhat")) return [3 /*break*/, 4];
57
+ return [4 /*yield*/, deployments.get("TBTCVault")];
51
58
  case 2:
52
- VendingMachine = _a.sent();
53
- return [4 /*yield*/, helpers.ownable.transferOwnership("TBTC", VendingMachine.address, deployer)];
54
- case 3:
55
- _a.sent();
56
- return [3 /*break*/, 7];
57
- case 4: return [4 /*yield*/, deployments.get("TBTCVault")];
58
- case 5:
59
59
  TBTCVault = _a.sent();
60
60
  return [4 /*yield*/, helpers.ownable.transferOwnership("TBTC", TBTCVault.address, deployer)];
61
- case 6:
61
+ case 3:
62
62
  _a.sent();
63
- _a.label = 7;
64
- case 7: return [2 /*return*/];
63
+ _a.label = 4;
64
+ case 4: return [2 /*return*/];
65
65
  }
66
66
  });
67
67
  });
@@ -0,0 +1,86 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ var func = function (hre) {
40
+ return __awaiter(this, void 0, void 0, function () {
41
+ var deployments, helpers, getNamedAccounts, deploy, deployer, TBTCToken, TBTC, vendingMachineV2;
42
+ return __generator(this, function (_a) {
43
+ switch (_a.label) {
44
+ case 0:
45
+ deployments = hre.deployments, helpers = hre.helpers, getNamedAccounts = hre.getNamedAccounts;
46
+ deploy = deployments.deploy;
47
+ return [4 /*yield*/, getNamedAccounts()];
48
+ case 1:
49
+ deployer = (_a.sent()).deployer;
50
+ return [4 /*yield*/, deployments.get("TBTCToken")];
51
+ case 2:
52
+ TBTCToken = _a.sent();
53
+ return [4 /*yield*/, deployments.get("TBTC")]; // tBTC v2
54
+ case 3:
55
+ TBTC = _a.sent() // tBTC v2
56
+ ;
57
+ return [4 /*yield*/, deploy("VendingMachineV2", {
58
+ from: deployer,
59
+ args: [TBTCToken.address, TBTC.address],
60
+ log: true,
61
+ waitConfirmations: 1,
62
+ })];
63
+ case 4:
64
+ vendingMachineV2 = _a.sent();
65
+ if (!hre.network.tags.etherscan) return [3 /*break*/, 6];
66
+ return [4 /*yield*/, helpers.etherscan.verify(vendingMachineV2)];
67
+ case 5:
68
+ _a.sent();
69
+ _a.label = 6;
70
+ case 6:
71
+ if (!hre.network.tags.tenderly) return [3 /*break*/, 8];
72
+ return [4 /*yield*/, hre.tenderly.verify({
73
+ name: "VendingMachineV2",
74
+ address: vendingMachineV2.address,
75
+ })];
76
+ case 7:
77
+ _a.sent();
78
+ _a.label = 8;
79
+ case 8: return [2 /*return*/];
80
+ }
81
+ });
82
+ });
83
+ };
84
+ exports.default = func;
85
+ func.tags = ["VendingMachineV2"];
86
+ func.dependencies = ["TBTCToken", "TBTC"];
@@ -0,0 +1,86 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ var func = function (hre) {
40
+ return __awaiter(this, void 0, void 0, function () {
41
+ var deployments, helpers, getNamedAccounts, deploy, deployer, TBTCToken, TBTC, vendingMachineV3;
42
+ return __generator(this, function (_a) {
43
+ switch (_a.label) {
44
+ case 0:
45
+ deployments = hre.deployments, helpers = hre.helpers, getNamedAccounts = hre.getNamedAccounts;
46
+ deploy = deployments.deploy;
47
+ return [4 /*yield*/, getNamedAccounts()];
48
+ case 1:
49
+ deployer = (_a.sent()).deployer;
50
+ return [4 /*yield*/, deployments.get("TBTCToken")];
51
+ case 2:
52
+ TBTCToken = _a.sent();
53
+ return [4 /*yield*/, deployments.get("TBTC")]; // tBTC v2
54
+ case 3:
55
+ TBTC = _a.sent() // tBTC v2
56
+ ;
57
+ return [4 /*yield*/, deploy("VendingMachineV3", {
58
+ from: deployer,
59
+ args: [TBTCToken.address, TBTC.address],
60
+ log: true,
61
+ waitConfirmations: 1,
62
+ })];
63
+ case 4:
64
+ vendingMachineV3 = _a.sent();
65
+ if (!hre.network.tags.etherscan) return [3 /*break*/, 6];
66
+ return [4 /*yield*/, helpers.etherscan.verify(vendingMachineV3)];
67
+ case 5:
68
+ _a.sent();
69
+ _a.label = 6;
70
+ case 6:
71
+ if (!hre.network.tags.tenderly) return [3 /*break*/, 8];
72
+ return [4 /*yield*/, hre.tenderly.verify({
73
+ name: "VendingMachineV",
74
+ address: vendingMachineV3.address,
75
+ })];
76
+ case 7:
77
+ _a.sent();
78
+ _a.label = 8;
79
+ case 8: return [2 /*return*/];
80
+ }
81
+ });
82
+ });
83
+ };
84
+ exports.default = func;
85
+ func.tags = ["VendingMachineV3"];
86
+ func.dependencies = ["TBTCToken", "TBTC"];
@@ -0,0 +1,60 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ var func = function (hre) {
40
+ return __awaiter(this, void 0, void 0, function () {
41
+ var getNamedAccounts, helpers, _a, deployer, v1Redeemer;
42
+ return __generator(this, function (_b) {
43
+ switch (_b.label) {
44
+ case 0:
45
+ getNamedAccounts = hre.getNamedAccounts, helpers = hre.helpers;
46
+ return [4 /*yield*/, getNamedAccounts()];
47
+ case 1:
48
+ _a = _b.sent(), deployer = _a.deployer, v1Redeemer = _a.v1Redeemer;
49
+ return [4 /*yield*/, helpers.ownable.transferOwnership("VendingMachineV2", v1Redeemer, deployer)];
50
+ case 2:
51
+ _b.sent();
52
+ return [2 /*return*/];
53
+ }
54
+ });
55
+ });
56
+ };
57
+ exports.default = func;
58
+ func.tags = ["TransferVendingMachineV2Ownership"];
59
+ func.dependencies = ["VendingMachineV2"];
60
+ func.runAtTheEnd = true;
@@ -0,0 +1,60 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ var func = function (hre) {
40
+ return __awaiter(this, void 0, void 0, function () {
41
+ var getNamedAccounts, helpers, _a, deployer, governance;
42
+ return __generator(this, function (_b) {
43
+ switch (_b.label) {
44
+ case 0:
45
+ getNamedAccounts = hre.getNamedAccounts, helpers = hre.helpers;
46
+ return [4 /*yield*/, getNamedAccounts()];
47
+ case 1:
48
+ _a = _b.sent(), deployer = _a.deployer, governance = _a.governance;
49
+ return [4 /*yield*/, helpers.ownable.transferOwnership("VendingMachineV3", governance, deployer)];
50
+ case 2:
51
+ _b.sent();
52
+ return [2 /*return*/];
53
+ }
54
+ });
55
+ });
56
+ };
57
+ exports.default = func;
58
+ func.tags = ["TransferVendingMachineV3Ownership"];
59
+ func.dependencies = ["VendingMachineV3"];
60
+ func.runAtTheEnd = true;
@@ -161,6 +161,7 @@ var config = {
161
161
  deployer: {
162
162
  default: 1,
163
163
  goerli: 0,
164
+ mainnet: 0, // "0x123694886DBf5Ac94DDA07135349534536D14cAf"
164
165
  },
165
166
  governance: {
166
167
  default: 2,
@@ -199,6 +200,11 @@ var config = {
199
200
  goerli: 0,
200
201
  // We are not setting SPV maintainer for mainnet in deployment scripts.
201
202
  },
203
+ v1Redeemer: {
204
+ default: 9,
205
+ goerli: 0,
206
+ mainnet: "0x8Bac178fA95Cb56D11A94d4f1b2B1F5Fc48A30eA",
207
+ },
202
208
  },
203
209
  dependencyCompiler: {
204
210
  paths: [
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });