@keep-network/tbtc-v2 0.1.1-dev.46 → 0.1.1-dev.47

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 (56) hide show
  1. package/artifacts/Bank.json +11 -11
  2. package/artifacts/Bridge.json +135 -150
  3. package/artifacts/Deposit.json +4 -4
  4. package/artifacts/EcdsaDkgValidator.json +1 -1
  5. package/artifacts/EcdsaInactivity.json +1 -1
  6. package/artifacts/Fraud.json +2 -2
  7. package/artifacts/KeepRegistry.json +1 -1
  8. package/artifacts/KeepStake.json +2 -2
  9. package/artifacts/KeepToken.json +2 -2
  10. package/artifacts/KeepTokenStaking.json +1 -1
  11. package/artifacts/MovingFunds.json +2 -2
  12. package/artifacts/NuCypherStakingEscrow.json +1 -1
  13. package/artifacts/NuCypherToken.json +2 -2
  14. package/artifacts/RandomBeaconStub.json +1 -1
  15. package/artifacts/Redemption.json +4 -4
  16. package/artifacts/ReimbursementPool.json +2 -2
  17. package/artifacts/Relay.json +11 -11
  18. package/artifacts/SortitionPool.json +2 -2
  19. package/artifacts/Sweep.json +4 -4
  20. package/artifacts/T.json +2 -2
  21. package/artifacts/TBTC.json +13 -13
  22. package/artifacts/TBTCToken.json +13 -13
  23. package/artifacts/TokenStaking.json +1 -1
  24. package/artifacts/TokenholderGovernor.json +9 -9
  25. package/artifacts/TokenholderTimelock.json +8 -8
  26. package/artifacts/VendingMachine.json +14 -14
  27. package/artifacts/VendingMachineKeep.json +1 -1
  28. package/artifacts/VendingMachineNuCypher.json +1 -1
  29. package/artifacts/WalletRegistry.json +2 -2
  30. package/artifacts/WalletRegistryGovernance.json +2 -2
  31. package/artifacts/Wallets.json +4 -4
  32. package/artifacts/solcInputs/{75d54bcf8c4f0b65acb7ec6a1fb9af9d.json → d31b3d6fef87d6f4300c2a5aea432ae5.json} +4 -1
  33. package/build/contracts/GovernanceUtils.sol/GovernanceUtils.dbg.json +1 -1
  34. package/build/contracts/bank/Bank.sol/Bank.dbg.json +1 -1
  35. package/build/contracts/bridge/BitcoinTx.sol/BitcoinTx.dbg.json +1 -1
  36. package/build/contracts/bridge/Bridge.sol/Bridge.dbg.json +1 -1
  37. package/build/contracts/bridge/Bridge.sol/Bridge.json +66 -73
  38. package/build/contracts/bridge/BridgeState.sol/BridgeState.dbg.json +1 -1
  39. package/build/contracts/bridge/Deposit.sol/Deposit.dbg.json +1 -1
  40. package/build/contracts/bridge/EcdsaLib.sol/EcdsaLib.dbg.json +1 -1
  41. package/build/contracts/bridge/Fraud.sol/Fraud.dbg.json +1 -1
  42. package/build/contracts/bridge/IRelay.sol/IRelay.dbg.json +1 -1
  43. package/build/contracts/bridge/MovingFunds.sol/MovingFunds.dbg.json +1 -1
  44. package/build/contracts/bridge/Redemption.sol/OutboundTx.dbg.json +1 -1
  45. package/build/contracts/bridge/Redemption.sol/Redemption.dbg.json +1 -1
  46. package/build/contracts/bridge/Sweep.sol/Sweep.dbg.json +1 -1
  47. package/build/contracts/bridge/VendingMachine.sol/VendingMachine.dbg.json +1 -1
  48. package/build/contracts/bridge/Wallets.sol/Wallets.dbg.json +1 -1
  49. package/build/contracts/token/TBTC.sol/TBTC.dbg.json +1 -1
  50. package/build/contracts/vault/IVault.sol/IVault.dbg.json +1 -1
  51. package/build/contracts/vault/TBTCVault.sol/TBTCVault.dbg.json +1 -1
  52. package/contracts/bridge/Bridge.sol +13 -8
  53. package/deploy/07_transfer_ownership.ts +1 -3
  54. package/deploy/08_transfer_governance.ts +20 -0
  55. package/export.json +34 -41
  56. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/09e5fe1834fb92f92c380a4c77e206a4.json"
3
+ "buildInfo": "../../../build-info/30a38f39887300a2a7418e4640a6057b.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/09e5fe1834fb92f92c380a4c77e206a4.json"
3
+ "buildInfo": "../../../build-info/30a38f39887300a2a7418e4640a6057b.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/09e5fe1834fb92f92c380a4c77e206a4.json"
3
+ "buildInfo": "../../../build-info/30a38f39887300a2a7418e4640a6057b.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/09e5fe1834fb92f92c380a4c77e206a4.json"
3
+ "buildInfo": "../../../build-info/30a38f39887300a2a7418e4640a6057b.json"
4
4
  }
@@ -15,7 +15,7 @@
15
15
 
16
16
  pragma solidity ^0.8.9;
17
17
 
18
- import "@openzeppelin/contracts/access/Ownable.sol";
18
+ import "@keep-network/random-beacon/contracts/Governable.sol";
19
19
 
20
20
  import {IWalletOwner as EcdsaWalletOwner} from "@keep-network/ecdsa/contracts/api/IWalletOwner.sol";
21
21
 
@@ -57,7 +57,7 @@ import "../bank/Bank.sol";
57
57
  /// TODO: Revisit all events and look which parameters should be indexed.
58
58
  /// TODO: Align the convention around `param` and `dev` endings. They should
59
59
  /// not have a punctuation mark.
60
- contract Bridge is Ownable, EcdsaWalletOwner {
60
+ contract Bridge is Governable, EcdsaWalletOwner {
61
61
  using BridgeState for BridgeState.Storage;
62
62
  using Deposit for BridgeState.Storage;
63
63
  using Sweep for BridgeState.Storage;
@@ -236,6 +236,8 @@ contract Bridge is Ownable, EcdsaWalletOwner {
236
236
  self.walletMaxAge = 26 weeks; // ~6 months
237
237
  self.walletMaxBtcTransfer = 10e8; // 10 BTC
238
238
  self.walletClosingPeriod = 40 days;
239
+
240
+ _transferGovernance(msg.sender);
239
241
  }
240
242
 
241
243
  /// @notice Used by the depositor to reveal information about their P2(W)SH
@@ -790,7 +792,10 @@ contract Bridge is Ownable, EcdsaWalletOwner {
790
792
  /// @param vault The address of the vault
791
793
  /// @param isTrusted flag indicating whether the vault is trusted or not
792
794
  /// @dev Can only be called by the Governance.
793
- function setVaultStatus(address vault, bool isTrusted) external onlyOwner {
795
+ function setVaultStatus(address vault, bool isTrusted)
796
+ external
797
+ onlyGovernance
798
+ {
794
799
  self.isVaultTrusted[vault] = isTrusted;
795
800
  emit VaultStatusUpdated(vault, isTrusted);
796
801
  }
@@ -823,7 +828,7 @@ contract Bridge is Ownable, EcdsaWalletOwner {
823
828
  uint64 depositDustThreshold,
824
829
  uint64 depositTreasuryFeeDivisor,
825
830
  uint64 depositTxMaxFee
826
- ) external onlyOwner {
831
+ ) external onlyGovernance {
827
832
  self.updateDepositParameters(
828
833
  depositDustThreshold,
829
834
  depositTreasuryFeeDivisor,
@@ -871,7 +876,7 @@ contract Bridge is Ownable, EcdsaWalletOwner {
871
876
  uint64 redemptionTreasuryFeeDivisor,
872
877
  uint64 redemptionTxMaxFee,
873
878
  uint256 redemptionTimeout
874
- ) external onlyOwner {
879
+ ) external onlyGovernance {
875
880
  self.updateRedemptionParameters(
876
881
  redemptionDustThreshold,
877
882
  redemptionTreasuryFeeDivisor,
@@ -897,7 +902,7 @@ contract Bridge is Ownable, EcdsaWalletOwner {
897
902
  function updateMovingFundsParameters(
898
903
  uint64 movingFundsTxMaxTotalFee,
899
904
  uint32 movingFundsTimeout
900
- ) external onlyOwner {
905
+ ) external onlyGovernance {
901
906
  self.updateMovingFundsParameters(
902
907
  movingFundsTxMaxTotalFee,
903
908
  movingFundsTimeout
@@ -935,7 +940,7 @@ contract Bridge is Ownable, EcdsaWalletOwner {
935
940
  uint32 walletMaxAge,
936
941
  uint64 walletMaxBtcTransfer,
937
942
  uint32 walletClosingPeriod
938
- ) external onlyOwner {
943
+ ) external onlyGovernance {
939
944
  self.updateWalletParameters(
940
945
  walletCreationPeriod,
941
946
  walletMinBtcBalance,
@@ -968,7 +973,7 @@ contract Bridge is Ownable, EcdsaWalletOwner {
968
973
  uint256 fraudNotifierRewardMultiplier,
969
974
  uint256 fraudChallengeDefeatTimeout,
970
975
  uint256 fraudChallengeDepositAmount
971
- ) external onlyOwner {
976
+ ) external onlyGovernance {
972
977
  self.updateFraudParameters(
973
978
  fraudSlashingAmount,
974
979
  fraudNotifierRewardMultiplier,
@@ -6,12 +6,10 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
6
6
  const { deployer, governance } = await getNamedAccounts()
7
7
 
8
8
  await helpers.ownable.transferOwnership("Bank", governance, deployer)
9
-
10
- await helpers.ownable.transferOwnership("Bridge", governance, deployer)
11
9
  }
12
10
 
13
11
  export default func
14
12
 
15
13
  func.tags = ["TransferOwnership"]
16
- func.dependencies = ["Bank", "Bridge"]
14
+ func.dependencies = ["Bank"]
17
15
  func.runAtTheEnd = true
@@ -0,0 +1,20 @@
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 { deployer, governance } = await getNamedAccounts()
7
+
8
+ await deployments.execute(
9
+ "Bridge",
10
+ { from: deployer },
11
+ "transferGovernance",
12
+ governance
13
+ )
14
+ }
15
+
16
+ export default func
17
+
18
+ func.tags = ["TransferGovernance"]
19
+ func.dependencies = ["Bridge"]
20
+ func.runAtTheEnd = true
package/export.json CHANGED
@@ -14209,6 +14209,25 @@
14209
14209
  "name": "FraudParametersUpdated",
14210
14210
  "type": "event"
14211
14211
  },
14212
+ {
14213
+ "anonymous": false,
14214
+ "inputs": [
14215
+ {
14216
+ "indexed": false,
14217
+ "internalType": "address",
14218
+ "name": "oldGovernance",
14219
+ "type": "address"
14220
+ },
14221
+ {
14222
+ "indexed": false,
14223
+ "internalType": "address",
14224
+ "name": "newGovernance",
14225
+ "type": "address"
14226
+ }
14227
+ ],
14228
+ "name": "GovernanceTransferred",
14229
+ "type": "event"
14230
+ },
14212
14231
  {
14213
14232
  "anonymous": false,
14214
14233
  "inputs": [
@@ -14310,25 +14329,6 @@
14310
14329
  "name": "NewWalletRequested",
14311
14330
  "type": "event"
14312
14331
  },
14313
- {
14314
- "anonymous": false,
14315
- "inputs": [
14316
- {
14317
- "indexed": true,
14318
- "internalType": "address",
14319
- "name": "previousOwner",
14320
- "type": "address"
14321
- },
14322
- {
14323
- "indexed": true,
14324
- "internalType": "address",
14325
- "name": "newOwner",
14326
- "type": "address"
14327
- }
14328
- ],
14329
- "name": "OwnershipTransferred",
14330
- "type": "event"
14331
- },
14332
14332
  {
14333
14333
  "anonymous": false,
14334
14334
  "inputs": [
@@ -14822,6 +14822,19 @@
14822
14822
  "stateMutability": "view",
14823
14823
  "type": "function"
14824
14824
  },
14825
+ {
14826
+ "inputs": [],
14827
+ "name": "governance",
14828
+ "outputs": [
14829
+ {
14830
+ "internalType": "address",
14831
+ "name": "",
14832
+ "type": "address"
14833
+ }
14834
+ ],
14835
+ "stateMutability": "view",
14836
+ "type": "function"
14837
+ },
14825
14838
  {
14826
14839
  "inputs": [
14827
14840
  {
@@ -14969,19 +14982,6 @@
14969
14982
  "stateMutability": "nonpayable",
14970
14983
  "type": "function"
14971
14984
  },
14972
- {
14973
- "inputs": [],
14974
- "name": "owner",
14975
- "outputs": [
14976
- {
14977
- "internalType": "address",
14978
- "name": "",
14979
- "type": "address"
14980
- }
14981
- ],
14982
- "stateMutability": "view",
14983
- "type": "function"
14984
- },
14985
14985
  {
14986
14986
  "inputs": [
14987
14987
  {
@@ -15056,13 +15056,6 @@
15056
15056
  "stateMutability": "view",
15057
15057
  "type": "function"
15058
15058
  },
15059
- {
15060
- "inputs": [],
15061
- "name": "renounceOwnership",
15062
- "outputs": [],
15063
- "stateMutability": "nonpayable",
15064
- "type": "function"
15065
- },
15066
15059
  {
15067
15060
  "inputs": [
15068
15061
  {
@@ -15639,11 +15632,11 @@
15639
15632
  "inputs": [
15640
15633
  {
15641
15634
  "internalType": "address",
15642
- "name": "newOwner",
15635
+ "name": "newGovernance",
15643
15636
  "type": "address"
15644
15637
  }
15645
15638
  ],
15646
- "name": "transferOwnership",
15639
+ "name": "transferGovernance",
15647
15640
  "outputs": [],
15648
15641
  "stateMutability": "nonpayable",
15649
15642
  "type": "function"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keep-network/tbtc-v2",
3
- "version": "0.1.1-dev.46+main.90853bcc69b37e76f1ab229667fb2263eb931959",
3
+ "version": "0.1.1-dev.47+main.dc6d5b7dff5d86505ab703bc7d29abfd9529c96f",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "artifacts/",