@keep-network/tbtc-v2 1.6.0-dev.20 → 1.6.0-dev.22

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 (135) 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/LightRelay.json +18 -18
  19. package/artifacts/LightRelayMaintainerProxy.json +8 -8
  20. package/artifacts/MaintainerProxy.json +19 -19
  21. package/artifacts/MovingFunds.json +2 -2
  22. package/artifacts/NuCypherToken.json +2 -2
  23. package/artifacts/RandomBeacon.json +2 -2
  24. package/artifacts/RandomBeaconChaosnet.json +2 -2
  25. package/artifacts/RandomBeaconGovernance.json +2 -2
  26. package/artifacts/Redemption.json +2 -2
  27. package/artifacts/ReimbursementPool.json +2 -2
  28. package/artifacts/T.json +2 -2
  29. package/artifacts/TBTC.json +3 -3
  30. package/artifacts/TBTCToken.json +3 -3
  31. package/artifacts/TBTCVault.json +23 -23
  32. package/artifacts/TokenStaking.json +1 -1
  33. package/artifacts/TokenholderGovernor.json +9 -9
  34. package/artifacts/TokenholderTimelock.json +8 -8
  35. package/artifacts/VendingMachine.json +3 -3
  36. package/artifacts/VendingMachineNuCypher.json +1 -1
  37. package/artifacts/VendingMachineV2.json +3 -3
  38. package/artifacts/VendingMachineV3.json +3 -3
  39. package/artifacts/WalletProposalValidator.json +2 -2
  40. package/artifacts/WalletRegistry.json +5 -5
  41. package/artifacts/WalletRegistryGovernance.json +8 -8
  42. package/artifacts/Wallets.json +2 -2
  43. package/artifacts/solcInputs/{3820d7396bf453fe963a951f7b59372d.json → dd1c38c53a7547fe3e334d72c1e4d8e1.json} +3 -3
  44. package/build/contracts/GovernanceUtils.sol/GovernanceUtils.dbg.json +1 -1
  45. package/build/contracts/bank/Bank.sol/Bank.dbg.json +1 -1
  46. package/build/contracts/bank/IReceiveBalanceApproval.sol/IReceiveBalanceApproval.dbg.json +1 -1
  47. package/build/contracts/bridge/BitcoinTx.sol/BitcoinTx.dbg.json +1 -1
  48. package/build/contracts/bridge/Bridge.sol/Bridge.dbg.json +1 -1
  49. package/build/contracts/bridge/BridgeGovernanceParameters.sol/BridgeGovernanceParameters.dbg.json +1 -1
  50. package/build/contracts/bridge/BridgeState.sol/BridgeState.dbg.json +1 -1
  51. package/build/contracts/bridge/Deposit.sol/Deposit.dbg.json +1 -1
  52. package/build/contracts/bridge/DepositSweep.sol/DepositSweep.dbg.json +1 -1
  53. package/build/contracts/bridge/EcdsaLib.sol/EcdsaLib.dbg.json +1 -1
  54. package/build/contracts/bridge/Fraud.sol/Fraud.dbg.json +1 -1
  55. package/build/contracts/bridge/Heartbeat.sol/Heartbeat.dbg.json +1 -1
  56. package/build/contracts/bridge/IRelay.sol/IRelay.dbg.json +1 -1
  57. package/build/contracts/bridge/MovingFunds.sol/MovingFunds.dbg.json +1 -1
  58. package/build/contracts/bridge/Redemption.sol/OutboundTx.dbg.json +1 -1
  59. package/build/contracts/bridge/Redemption.sol/Redemption.dbg.json +1 -1
  60. package/build/contracts/bridge/VendingMachine.sol/VendingMachine.dbg.json +1 -1
  61. package/build/contracts/bridge/VendingMachineV2.sol/VendingMachineV2.dbg.json +1 -1
  62. package/build/contracts/bridge/VendingMachineV3.sol/VendingMachineV3.dbg.json +1 -1
  63. package/build/contracts/bridge/WalletProposalValidator.sol/WalletProposalValidator.dbg.json +1 -1
  64. package/build/contracts/bridge/Wallets.sol/Wallets.dbg.json +1 -1
  65. package/build/contracts/integrator/AbstractTBTCDepositor.sol/AbstractTBTCDepositor.dbg.json +1 -1
  66. package/build/contracts/integrator/AbstractTBTCDepositor.sol/AbstractTBTCDepositor.json +0 -44
  67. package/build/contracts/integrator/IBridge.sol/IBridge.dbg.json +1 -1
  68. package/build/contracts/integrator/IBridge.sol/IBridgeTypes.dbg.json +1 -1
  69. package/build/contracts/integrator/ITBTCVault.sol/ITBTCVault.dbg.json +1 -1
  70. package/build/contracts/l2/L2TBTC.sol/L2TBTC.dbg.json +1 -1
  71. package/build/contracts/l2/L2WormholeGateway.sol/IWormholeTokenBridge.dbg.json +1 -1
  72. package/build/contracts/l2/L2WormholeGateway.sol/L2WormholeGateway.dbg.json +1 -1
  73. package/build/contracts/maintainer/MaintainerProxy.sol/MaintainerProxy.dbg.json +1 -1
  74. package/build/contracts/relay/LightRelay.sol/ILightRelay.dbg.json +1 -1
  75. package/build/contracts/relay/LightRelay.sol/LightRelay.dbg.json +1 -1
  76. package/build/contracts/relay/LightRelay.sol/RelayUtils.dbg.json +1 -1
  77. package/build/contracts/relay/LightRelayMaintainerProxy.sol/LightRelayMaintainerProxy.dbg.json +1 -1
  78. package/build/contracts/test/BankStub.sol/BankStub.dbg.json +1 -1
  79. package/build/contracts/test/BridgeStub.sol/BridgeStub.dbg.json +1 -1
  80. package/build/contracts/test/HeartbeatStub.sol/HeartbeatStub.dbg.json +1 -1
  81. package/build/contracts/test/LightRelayStub.sol/LightRelayStub.dbg.json +1 -1
  82. package/build/contracts/test/ReceiveApprovalStub.sol/ReceiveApprovalStub.dbg.json +1 -1
  83. package/build/contracts/test/SepoliaLightRelay.sol/SepoliaLightRelay.dbg.json +1 -1
  84. package/build/contracts/test/SystemTestRelay.sol/SystemTestRelay.dbg.json +1 -1
  85. package/build/contracts/test/TestBitcoinTx.sol/TestBitcoinTx.dbg.json +1 -1
  86. package/build/contracts/test/TestERC20.sol/TestERC20.dbg.json +1 -1
  87. package/build/contracts/test/TestERC721.sol/TestERC721.dbg.json +1 -1
  88. package/build/contracts/test/TestEcdsaLib.sol/TestEcdsaLib.dbg.json +1 -1
  89. package/build/contracts/test/TestTBTCDepositor.sol/MockBridge.dbg.json +1 -1
  90. package/build/contracts/test/TestTBTCDepositor.sol/MockBridge.json +2 -2
  91. package/build/contracts/test/TestTBTCDepositor.sol/MockTBTCVault.dbg.json +1 -1
  92. package/build/contracts/test/TestTBTCDepositor.sol/MockTBTCVault.json +2 -2
  93. package/build/contracts/test/TestTBTCDepositor.sol/TestTBTCDepositor.dbg.json +1 -1
  94. package/build/contracts/test/TestTBTCDepositor.sol/TestTBTCDepositor.json +2 -46
  95. package/build/contracts/test/WormholeBridgeStub.sol/WormholeBridgeStub.dbg.json +1 -1
  96. package/build/contracts/token/TBTC.sol/TBTC.dbg.json +1 -1
  97. package/build/contracts/vault/DonationVault.sol/DonationVault.dbg.json +1 -1
  98. package/build/contracts/vault/IVault.sol/IVault.dbg.json +1 -1
  99. package/build/contracts/vault/TBTCOptimisticMinting.sol/TBTCOptimisticMinting.dbg.json +1 -1
  100. package/build/contracts/vault/TBTCVault.sol/TBTCVault.dbg.json +1 -1
  101. package/contracts/integrator/AbstractTBTCDepositor.sol +1 -23
  102. package/contracts/test/TestTBTCDepositor.sol +13 -2
  103. package/export/artifacts/@keep-network/ecdsa/contracts/WalletRegistry.sol/WalletRegistry.json +7 -7
  104. package/export/artifacts/contracts/bridge/VendingMachine.sol/VendingMachine.json +6 -6
  105. package/export/artifacts/contracts/bridge/VendingMachineV2.sol/VendingMachineV2.json +6 -6
  106. package/export/artifacts/contracts/bridge/VendingMachineV3.sol/VendingMachineV3.json +6 -6
  107. package/export/artifacts/contracts/l2/L2TBTC.sol/L2TBTC.json +40 -40
  108. package/export/artifacts/contracts/l2/L2WormholeGateway.sol/L2WormholeGateway.json +47 -47
  109. package/export/artifacts/contracts/maintainer/MaintainerProxy.sol/MaintainerProxy.json +88 -88
  110. package/export/artifacts/contracts/relay/LightRelay.sol/LightRelay.json +57 -57
  111. package/export/artifacts/contracts/relay/LightRelayMaintainerProxy.sol/LightRelayMaintainerProxy.json +31 -31
  112. package/export/artifacts/contracts/test/BankStub.sol/BankStub.json +2 -2
  113. package/export/artifacts/contracts/test/BridgeStub.sol/BridgeStub.json +30 -30
  114. package/export/artifacts/contracts/test/HeartbeatStub.sol/HeartbeatStub.json +2 -2
  115. package/export/artifacts/contracts/test/LightRelayStub.sol/LightRelayStub.json +59 -59
  116. package/export/artifacts/contracts/test/ReceiveApprovalStub.sol/ReceiveApprovalStub.json +7 -7
  117. package/export/artifacts/contracts/test/SepoliaLightRelay.sol/SepoliaLightRelay.json +59 -59
  118. package/export/artifacts/contracts/test/SystemTestRelay.sol/SystemTestRelay.json +14 -14
  119. package/export/artifacts/contracts/test/TestBitcoinTx.sol/TestBitcoinTx.json +5 -5
  120. package/export/artifacts/contracts/test/TestERC20.sol/TestERC20.json +6 -6
  121. package/export/artifacts/contracts/test/TestERC721.sol/TestERC721.json +8 -8
  122. package/export/artifacts/contracts/test/TestEcdsaLib.sol/TestEcdsaLib.json +2 -2
  123. package/export/artifacts/contracts/test/TestTBTCDepositor.sol/MockBridge.json +38 -38
  124. package/export/artifacts/contracts/test/TestTBTCDepositor.sol/MockTBTCVault.json +31 -25
  125. package/export/artifacts/contracts/test/TestTBTCDepositor.sol/TestTBTCDepositor.json +936 -1261
  126. package/export/artifacts/contracts/test/WormholeBridgeStub.sol/WormholeBridgeStub.json +37 -37
  127. package/export/artifacts/contracts/token/TBTC.sol/TBTC.json +2 -2
  128. package/export/artifacts/contracts/vault/DonationVault.sol/DonationVault.json +11 -11
  129. package/export/artifacts/contracts/vault/TBTCVault.sol/TBTCVault.json +135 -135
  130. package/export/typechain/factories/AbstractTBTCDepositor__factory.js +0 -44
  131. package/export/typechain/factories/MockBridge__factory.js +1 -1
  132. package/export/typechain/factories/MockTBTCVault__factory.js +1 -1
  133. package/export/typechain/factories/TestTBTCDepositor__factory.js +1 -45
  134. package/export/typechain/factories/WalletRegistry__factory.js +1 -1
  135. package/package.json +2 -2
@@ -96,14 +96,6 @@ abstract contract AbstractTBTCDepositor {
96
96
  // slither-disable-next-line unused-state
97
97
  uint256[47] private __gap;
98
98
 
99
- event DepositInitialized(uint256 indexed depositKey, uint32 initializedAt);
100
-
101
- event DepositFinalized(
102
- uint256 indexed depositKey,
103
- uint256 tbtcAmount,
104
- uint32 finalizedAt
105
- );
106
-
107
99
  /// @notice Initializes the contract. MUST BE CALLED from the child
108
100
  /// contract initializer.
109
101
  // slither-disable-next-line dead-code
@@ -150,12 +142,6 @@ abstract contract AbstractTBTCDepositor {
150
142
  reveal.fundingOutputIndex
151
143
  );
152
144
 
153
- emit DepositInitialized(
154
- depositKey,
155
- /* solhint-disable-next-line not-rely-on-time */
156
- uint32(block.timestamp)
157
- );
158
-
159
145
  // The Bridge does not allow to reveal the same deposit twice and
160
146
  // revealed deposits stay there forever. The transaction will revert
161
147
  // if the deposit has already been revealed so, there is no need to do
@@ -166,7 +152,7 @@ abstract contract AbstractTBTCDepositor {
166
152
  }
167
153
 
168
154
  /// @notice Finalizes a deposit by calculating the amount of TBTC minted
169
- /// for the deposit
155
+ /// for the deposit.
170
156
  /// @param depositKey Deposit key identifying the deposit.
171
157
  /// @return initialDepositAmount Amount of funding transaction deposit. In
172
158
  /// TBTC token decimals precision.
@@ -211,14 +197,6 @@ abstract contract AbstractTBTCDepositor {
211
197
 
212
198
  tbtcAmount = _calculateTbtcAmount(deposit.amount, deposit.treasuryFee);
213
199
 
214
- // slither-disable-next-line reentrancy-events
215
- emit DepositFinalized(
216
- depositKey,
217
- tbtcAmount,
218
- /* solhint-disable-next-line not-rely-on-time */
219
- uint32(block.timestamp)
220
- );
221
-
222
200
  extraData = deposit.extraData;
223
201
  }
224
202
 
@@ -8,6 +8,8 @@ import "../integrator/AbstractTBTCDepositor.sol";
8
8
  import "../integrator/IBridge.sol";
9
9
  import "../integrator/ITBTCVault.sol";
10
10
 
11
+ import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
12
+
11
13
  contract TestTBTCDepositor is AbstractTBTCDepositor {
12
14
  event InitializeDepositReturned(uint256 depositKey);
13
15
 
@@ -168,7 +170,10 @@ contract MockTBTCVault is ITBTCVault {
168
170
  return (request.requestedAt, request.finalizedAt);
169
171
  }
170
172
 
171
- function createOptimisticMintingRequest(uint256 depositKey) external {
173
+ /// @dev The function is virtual to allow other projects using this mock
174
+ /// for AbtractTBTCDepositor-based contract tests to add any custom
175
+ /// logic needed.
176
+ function createOptimisticMintingRequest(uint256 depositKey) public virtual {
172
177
  require(
173
178
  _requests[depositKey].requestedAt == 0,
174
179
  "Request already exists"
@@ -177,7 +182,13 @@ contract MockTBTCVault is ITBTCVault {
177
182
  _requests[depositKey].requestedAt = uint64(block.timestamp);
178
183
  }
179
184
 
180
- function finalizeOptimisticMintingRequest(uint256 depositKey) public {
185
+ /// @dev The function is virtual to allow other projects using this mock
186
+ /// for AbtractTBTCDepositor-based contract tests to add any custom
187
+ /// logic needed.
188
+ function finalizeOptimisticMintingRequest(uint256 depositKey)
189
+ public
190
+ virtual
191
+ {
181
192
  require(
182
193
  _requests[depositKey].requestedAt != 0,
183
194
  "Request does not exist"