@keep-network/tbtc-v2 1.0.0-dev.5 → 1.0.0-dev.6

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 (160) 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 +19 -19
  10. package/artifacts/BridgeGovernanceParameters.json +7 -7
  11. package/artifacts/Deposit.json +7 -7
  12. package/artifacts/DepositSweep.json +7 -7
  13. package/artifacts/DonationVault.json +188 -0
  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 +9 -9
  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 +3 -3
  23. package/artifacts/MaintainerProxy.json +15 -15
  24. package/artifacts/MovingFunds.json +7 -7
  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 +7 -7
  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 +9 -9
  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/WalletRegistry.json +5 -5
  43. package/artifacts/WalletRegistryGovernance.json +2 -2
  44. package/artifacts/Wallets.json +7 -7
  45. package/artifacts/solcInputs/{b63dab89a2e89a0f54eb7f775a5bd516.json → 79a96d1cf4af176d93e6844dc248dcff.json} +2 -2
  46. package/artifacts/solcInputs/{c88caf1374ff7ffc912d8c7e982bd645.json → fccb130292c8c7cc958ab4fa31a3e180.json} +2 -2
  47. package/build/contracts/GovernanceUtils.sol/GovernanceUtils.dbg.json +1 -1
  48. package/build/contracts/bank/Bank.sol/Bank.dbg.json +1 -1
  49. package/build/contracts/bank/IReceiveBalanceApproval.sol/IReceiveBalanceApproval.dbg.json +1 -1
  50. package/build/contracts/bridge/BitcoinTx.sol/BitcoinTx.dbg.json +1 -1
  51. package/build/contracts/bridge/BitcoinTx.sol/BitcoinTx.json +2 -2
  52. package/build/contracts/bridge/Bridge.sol/Bridge.dbg.json +1 -1
  53. package/build/contracts/bridge/Bridge.sol/Bridge.json +2 -2
  54. package/build/contracts/bridge/BridgeGovernance.sol/BridgeGovernance.dbg.json +1 -1
  55. package/build/contracts/bridge/BridgeGovernance.sol/BridgeGovernance.json +2 -2
  56. package/build/contracts/bridge/BridgeGovernanceParameters.sol/BridgeGovernanceParameters.dbg.json +1 -1
  57. package/build/contracts/bridge/BridgeState.sol/BridgeState.dbg.json +1 -1
  58. package/build/contracts/bridge/BridgeState.sol/BridgeState.json +2 -2
  59. package/build/contracts/bridge/Deposit.sol/Deposit.dbg.json +1 -1
  60. package/build/contracts/bridge/Deposit.sol/Deposit.json +2 -2
  61. package/build/contracts/bridge/DepositSweep.sol/DepositSweep.dbg.json +1 -1
  62. package/build/contracts/bridge/DepositSweep.sol/DepositSweep.json +2 -2
  63. package/build/contracts/bridge/EcdsaLib.sol/EcdsaLib.dbg.json +1 -1
  64. package/build/contracts/bridge/Fraud.sol/Fraud.dbg.json +1 -1
  65. package/build/contracts/bridge/Fraud.sol/Fraud.json +2 -2
  66. package/build/contracts/bridge/Heartbeat.sol/Heartbeat.dbg.json +1 -1
  67. package/build/contracts/bridge/IRelay.sol/IRelay.dbg.json +1 -1
  68. package/build/contracts/bridge/MovingFunds.sol/MovingFunds.dbg.json +1 -1
  69. package/build/contracts/bridge/MovingFunds.sol/MovingFunds.json +2 -2
  70. package/build/contracts/bridge/Redemption.sol/OutboundTx.dbg.json +1 -1
  71. package/build/contracts/bridge/Redemption.sol/OutboundTx.json +2 -2
  72. package/build/contracts/bridge/Redemption.sol/Redemption.dbg.json +1 -1
  73. package/build/contracts/bridge/Redemption.sol/Redemption.json +2 -2
  74. package/build/contracts/bridge/VendingMachine.sol/VendingMachine.dbg.json +1 -1
  75. package/build/contracts/bridge/Wallets.sol/Wallets.dbg.json +1 -1
  76. package/build/contracts/bridge/Wallets.sol/Wallets.json +2 -2
  77. package/build/contracts/maintainer/MaintainerProxy.sol/MaintainerProxy.dbg.json +1 -1
  78. package/build/contracts/maintainer/MaintainerProxy.sol/MaintainerProxy.json +2 -2
  79. package/build/contracts/relay/LightRelay.sol/ILightRelay.dbg.json +1 -1
  80. package/build/contracts/relay/LightRelay.sol/LightRelay.dbg.json +1 -1
  81. package/build/contracts/relay/LightRelay.sol/RelayUtils.dbg.json +1 -1
  82. package/build/contracts/token/TBTC.sol/TBTC.dbg.json +1 -1
  83. package/build/contracts/vault/DonationVault.sol/DonationVault.dbg.json +1 -1
  84. package/build/contracts/vault/IVault.sol/IVault.dbg.json +1 -1
  85. package/build/contracts/vault/TBTCOptimisticMinting.sol/TBTCOptimisticMinting.dbg.json +1 -1
  86. package/build/contracts/vault/TBTCVault.sol/TBTCVault.dbg.json +1 -1
  87. package/build/contracts/vault/TBTCVault.sol/TBTCVault.json +2 -2
  88. package/contracts/bridge/Bridge.sol +1 -1
  89. package/contracts/bridge/BridgeState.sol +1 -1
  90. package/deploy/01_deploy_light_relay.ts +1 -1
  91. package/deploy/05_deploy_bank.ts +1 -2
  92. package/deploy/06_deploy_bridge.ts +1 -1
  93. package/deploy/{11_deploy_tbtc_vault.ts → 07_deploy_tbtc_vault.ts} +0 -0
  94. package/deploy/08_deploy_donation_vault.ts +34 -0
  95. package/deploy/{12_deploy_bridge_governance.ts → 09_deploy_bridge_governance.ts} +3 -2
  96. package/deploy/{13_deploy_maintainer_proxy.ts → 10_deploy_maintainer_proxy.ts} +0 -0
  97. package/deploy/{14_bank_update_bridge.ts → 11_bank_update_bridge.ts} +0 -0
  98. package/deploy/{15_authorize_spv_maintainer_in_bridge.ts → 12_authorize_tbtc_vault_in_bridge.ts} +7 -5
  99. package/deploy/{22_authorize_maintainer_proxy_in_bridge.ts → 13_authorize_maintainer_proxy_in_bridge.ts} +0 -0
  100. package/deploy/{10_set_deposit_params.ts → 14_set_deposit_parameters.ts} +1 -1
  101. package/deploy/15_set_wallet_parameters.ts +42 -0
  102. package/deploy/{07_disable_fraud_challenges.ts → 16_disable_fraud_challenges.ts} +7 -8
  103. package/deploy/{08_disable_redemptions.ts → 17_disable_redemptions.ts} +6 -4
  104. package/deploy/{09_disable_moving_funds.ts → 18_disable_moving_funds.ts} +16 -7
  105. package/deploy/19_authorize_spv_maintainer_in_bridge.ts +31 -0
  106. package/deploy/{16_transfer_bank_ownership.ts → 20_transfer_bank_ownership.ts} +1 -1
  107. package/deploy/{17_transfer_bridge_governance.ts → 21_transfer_bridge_governance.ts} +11 -1
  108. package/deploy/{18_transfer_bridge_governance_ownership.ts → 22_transfer_bridge_governance_ownership.ts} +0 -0
  109. package/deploy/{19_transfer_tbtc_vault_ownership.ts → 23_transfer_tbtc_vault_ownership.ts} +0 -0
  110. package/deploy/{20_transfer_maintainer_proxy_ownership.ts → 24_transfer_maintainer_proxy_ownership.ts} +0 -0
  111. package/deploy/{21_transfer_proxy_admin_ownership.ts → 25_transfer_proxy_admin_ownership.ts} +0 -0
  112. package/deploy/{23_authorize_maintainer_proxy_in_reimbursement_pool.ts → 26_authorize_maintainer_proxy_in_reimbursement_pool.ts} +7 -0
  113. package/deploy/{24_authorize_bridge_in_reimbursement_pool.ts → 27_authorize_bridge_in_reimbursement_pool.ts} +7 -0
  114. package/deploy/{25_deploy_proxy_admin_with_deputy.ts → 28_deploy_proxy_admin_with_deputy.ts} +0 -0
  115. package/export/artifacts/contracts/bridge/Bridge.sol/Bridge.json +6 -6
  116. package/export/artifacts/contracts/bridge/BridgeGovernance.sol/BridgeGovernance.json +5 -5
  117. package/export/artifacts/contracts/maintainer/MaintainerProxy.sol/MaintainerProxy.json +5 -5
  118. package/export/artifacts/contracts/test/BridgeStub.sol/BridgeStub.json +6 -6
  119. package/export/artifacts/contracts/test/SystemTestRelay.sol/SystemTestRelay.json +5 -5
  120. package/export/artifacts/contracts/vault/TBTCVault.sol/TBTCVault.json +5 -5
  121. package/export/deploy/01_deploy_light_relay.js +1 -1
  122. package/export/deploy/05_deploy_bank.js +1 -1
  123. package/export/deploy/06_deploy_bridge.js +1 -1
  124. package/export/deploy/{11_deploy_tbtc_vault.js → 07_deploy_tbtc_vault.js} +0 -0
  125. package/export/deploy/08_deploy_donation_vault.js +83 -0
  126. package/export/deploy/{12_deploy_bridge_governance.js → 09_deploy_bridge_governance.js} +3 -2
  127. package/export/deploy/{13_deploy_maintainer_proxy.js → 10_deploy_maintainer_proxy.js} +0 -0
  128. package/export/deploy/{14_bank_update_bridge.js → 11_bank_update_bridge.js} +0 -0
  129. package/export/deploy/12_authorize_tbtc_vault_in_bridge.js +63 -0
  130. package/export/deploy/{22_authorize_maintainer_proxy_in_bridge.js → 13_authorize_maintainer_proxy_in_bridge.js} +0 -0
  131. package/export/deploy/{10_set_deposit_params.js → 14_set_deposit_parameters.js} +1 -1
  132. package/export/deploy/15_set_wallet_parameters.js +67 -0
  133. package/export/deploy/{07_disable_fraud_challenges.js → 16_disable_fraud_challenges.js} +4 -6
  134. package/export/deploy/{08_disable_redemptions.js → 17_disable_redemptions.js} +3 -2
  135. package/export/deploy/{09_disable_moving_funds.js → 18_disable_moving_funds.js} +13 -5
  136. package/export/deploy/{15_authorize_spv_maintainer_in_bridge.js → 19_authorize_spv_maintainer_in_bridge.js} +10 -0
  137. package/export/deploy/{16_transfer_bank_ownership.js → 20_transfer_bank_ownership.js} +1 -1
  138. package/export/deploy/{17_transfer_bridge_governance.js → 21_transfer_bridge_governance.js} +11 -1
  139. package/export/deploy/{18_transfer_bridge_governance_ownership.js → 22_transfer_bridge_governance_ownership.js} +0 -0
  140. package/export/deploy/{19_transfer_tbtc_vault_ownership.js → 23_transfer_tbtc_vault_ownership.js} +0 -0
  141. package/export/deploy/{20_transfer_maintainer_proxy_ownership.js → 24_transfer_maintainer_proxy_ownership.js} +0 -0
  142. package/export/deploy/{21_transfer_proxy_admin_ownership.js → 25_transfer_proxy_admin_ownership.js} +0 -0
  143. package/export/deploy/{23_authorize_maintainer_proxy_in_reimbursement_pool.js → 26_authorize_maintainer_proxy_in_reimbursement_pool.js} +7 -0
  144. package/export/deploy/{24_authorize_bridge_in_reimbursement_pool.js → 27_authorize_bridge_in_reimbursement_pool.js} +7 -0
  145. package/export/deploy/{25_deploy_proxy_admin_with_deputy.js → 28_deploy_proxy_admin_with_deputy.js} +0 -0
  146. package/export/hardhat.config.js +19 -8
  147. package/export/typechain/factories/BridgeGovernance__factory.js +1 -1
  148. package/export/typechain/factories/BridgeState__factory.js +1 -1
  149. package/export/typechain/factories/BridgeStub__factory.js +1 -1
  150. package/export/typechain/factories/Bridge__factory.js +1 -1
  151. package/export/typechain/factories/DepositSweep__factory.js +1 -1
  152. package/export/typechain/factories/Deposit__factory.js +1 -1
  153. package/export/typechain/factories/Fraud__factory.js +1 -1
  154. package/export/typechain/factories/MaintainerProxy__factory.js +1 -1
  155. package/export/typechain/factories/MovingFunds__factory.js +1 -1
  156. package/export/typechain/factories/Redemption__factory.js +1 -1
  157. package/export/typechain/factories/SystemTestRelay__factory.js +1 -1
  158. package/export/typechain/factories/TBTCVault__factory.js +1 -1
  159. package/export/typechain/factories/Wallets__factory.js +1 -1
  160. package/package.json +1 -1
@@ -51,11 +51,20 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
51
51
  walletParameters.walletClosingPeriod
52
52
  )
53
53
 
54
- // To emphasize the fact that moving funds is disabled, we set the
55
- // movingFundsTimeout to uint32 max value (2^32-1 = 4294967295) and
56
- // movingFundsTimeoutSlashingAmount to zero.
54
+ // To emphasize the fact that moving funds is disabled, we set:
55
+ // - movingFundsTimeout to uint32 max value (2^32-1 = 4294967295),
56
+ // - movedFundsSweepTimeout to uint32 max value,
57
+ // - movingFundsTimeoutSlashingAmount to 0,
58
+ // - movedFundsSweepTimeoutSlashingAmount to 0,
59
+ // - movingFundsTimeoutNotifierRewardMultiplier to 0,
60
+ // - movedFundsSweepTimeoutNotifierRewardMultiplier to 0.
57
61
  const movingFundsTimeout = ethers.BigNumber.from("4294967295")
62
+ const movedFundsSweepTimeout = ethers.BigNumber.from("4294967295")
58
63
  const movingFundsTimeoutSlashingAmount = ethers.BigNumber.from("0")
64
+ const movedFundsSweepTimeoutSlashingAmount = ethers.BigNumber.from("0")
65
+ const movingFundsTimeoutNotifierRewardMultiplier = ethers.BigNumber.from("0")
66
+ const movedFundsSweepTimeoutNotifierRewardMultiplier =
67
+ ethers.BigNumber.from("0")
59
68
 
60
69
  // Fetch the current values of other moving funds parameters to keep them unchanged.
61
70
  const movingFundsParameters = await read("Bridge", "movingFundsParameters")
@@ -69,12 +78,12 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
69
78
  movingFundsParameters.movingFundsTimeoutResetDelay,
70
79
  movingFundsTimeout,
71
80
  movingFundsTimeoutSlashingAmount,
72
- movingFundsParameters.movingFundsTimeoutNotifierRewardMultiplier,
81
+ movingFundsTimeoutNotifierRewardMultiplier,
73
82
  movingFundsParameters.movingFundsCommitmentGasOffset,
74
83
  movingFundsParameters.movedFundsSweepTxMaxTotalFee,
75
- movingFundsParameters.movedFundsSweepTimeout,
76
- movingFundsParameters.movedFundsSweepTimeoutSlashingAmount,
77
- movingFundsParameters.movedFundsSweepTimeoutNotifierRewardMultiplier
84
+ movedFundsSweepTimeout,
85
+ movedFundsSweepTimeoutSlashingAmount,
86
+ movedFundsSweepTimeoutNotifierRewardMultiplier
78
87
  )
79
88
  }
80
89
 
@@ -0,0 +1,31 @@
1
+ import { HardhatRuntimeEnvironment } from "hardhat/types"
2
+ import { DeployFunction } from "hardhat-deploy/types"
3
+
4
+ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
5
+ const { getNamedAccounts, deployments } = hre
6
+ const { execute } = deployments
7
+ const { deployer, spvMaintainer } = await getNamedAccounts()
8
+
9
+ await execute(
10
+ "Bridge",
11
+ { from: deployer, log: true, waitConfirmations: 1 },
12
+ "setSpvMaintainerStatus",
13
+ spvMaintainer,
14
+ true
15
+ )
16
+ }
17
+
18
+ export default func
19
+
20
+ func.tags = ["AuthorizeSpvMaintainer"]
21
+ func.dependencies = ["Bridge"]
22
+
23
+ // SPV maintainer can submit SPV proofs to the Bridge. We authorize spvMaintainer
24
+ // account for Hardhat network (unit tests) and Goerli (testnet) but we DO NOT
25
+ // want to authorize it for Mainnet deployment. SPV maintainer will be authorized
26
+ // separately by the Governance when sweeping will be activated.
27
+ //
28
+ // Note that at this point MaintainerProxy contract is already authorized in the
29
+ // Bridge (see AuthorizeMaintainerProxyInBridge tag).
30
+ func.skip = async (hre: HardhatRuntimeEnvironment): Promise<boolean> =>
31
+ hre.network.name === "mainnet"
@@ -11,5 +11,5 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
11
11
  export default func
12
12
 
13
13
  func.tags = ["TransferBankOwnership"]
14
- func.dependencies = ["Bank"]
14
+ func.dependencies = ["Bank", "BankUpdateBridge"]
15
15
  func.runAtTheEnd = true
@@ -18,5 +18,15 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
18
18
  export default func
19
19
 
20
20
  func.tags = ["TransferBridgeGovernance"]
21
- func.dependencies = ["Bridge"]
21
+ func.dependencies = [
22
+ "Bridge",
23
+ "AuthorizeTBTCVault",
24
+ "AuthorizeMaintainerProxyInBridge",
25
+ "SetDepositParameters",
26
+ "SetWalletParameters",
27
+ "DisableFraudChallenges",
28
+ "DisableRedemptions",
29
+ "DisableMovingFunds",
30
+ "AuthorizeSpvMaintainer",
31
+ ]
22
32
  func.runAtTheEnd = true
@@ -20,3 +20,10 @@ export default func
20
20
 
21
21
  func.tags = ["AuthorizeMaintainerProxyInReimbursementPool"]
22
22
  func.dependencies = ["ReimbursementPool", "MaintainerProxy"]
23
+
24
+ // On mainnet, the ReimbursementPool ownership is passed to the Threshold
25
+ // Council / DAO and that address is not controlled by the dev team.
26
+ // Hence, this step can be executed only for non-mainnet networks such as
27
+ // Hardhat (unit tests) and Goerli (testnet).
28
+ func.skip = async (hre: HardhatRuntimeEnvironment): Promise<boolean> =>
29
+ hre.network.name === "mainnet"
@@ -20,3 +20,10 @@ export default func
20
20
 
21
21
  func.tags = ["AuthorizeBridgeInReimbursementPool"]
22
22
  func.dependencies = ["ReimbursementPool", "Bridge"]
23
+
24
+ // On mainnet, the ReimbursementPool ownership is passed to the Threshold
25
+ // Council / DAO and that address is not controlled by the dev team.
26
+ // Hence, this step can be executed only for non-mainnet networks such as
27
+ // Hardhat (unit tests) and Goerli (testnet).
28
+ func.skip = async (hre: HardhatRuntimeEnvironment): Promise<boolean> =>
29
+ hre.network.name === "mainnet"