@keep-network/tbtc-v2 0.1.1-dev.71 → 0.1.1-dev.74

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 (88) hide show
  1. package/artifacts/Bank.json +15 -15
  2. package/artifacts/Bridge.json +1 -1
  3. package/artifacts/DefaultProxyAdmin.json +5 -5
  4. package/artifacts/Deposit.json +10 -10
  5. package/artifacts/DepositSweep.json +13 -13
  6. package/artifacts/EcdsaDkgValidator.json +9 -9
  7. package/artifacts/EcdsaInactivity.json +8 -8
  8. package/artifacts/Fraud.json +23 -23
  9. package/artifacts/KeepRegistry.json +1 -1
  10. package/artifacts/KeepStake.json +2 -2
  11. package/artifacts/KeepToken.json +2 -2
  12. package/artifacts/KeepTokenStaking.json +1 -1
  13. package/artifacts/MovingFunds.json +31 -31
  14. package/artifacts/NuCypherStakingEscrow.json +1 -1
  15. package/artifacts/NuCypherToken.json +2 -2
  16. package/artifacts/RandomBeaconStub.json +5 -5
  17. package/artifacts/Redemption.json +22 -22
  18. package/artifacts/ReimbursementPool.json +5 -5
  19. package/artifacts/Relay.json +9 -9
  20. package/artifacts/SortitionPool.json +9 -9
  21. package/artifacts/T.json +2 -2
  22. package/artifacts/TBTC.json +17 -17
  23. package/artifacts/TBTCToken.json +15 -15
  24. package/artifacts/TokenStaking.json +1 -1
  25. package/artifacts/TokenholderGovernor.json +9 -9
  26. package/artifacts/TokenholderTimelock.json +8 -8
  27. package/artifacts/VendingMachine.json +18 -18
  28. package/artifacts/VendingMachineKeep.json +1 -1
  29. package/artifacts/VendingMachineNuCypher.json +1 -1
  30. package/artifacts/WalletRegistry.json +17 -17
  31. package/artifacts/WalletRegistry_Implementation.json +73 -73
  32. package/artifacts/WalletRegistry_Proxy.json +17 -17
  33. package/artifacts/Wallets.json +12 -12
  34. package/artifacts/solcInputs/3d39c8183330efd748c005f3c281bf2c.json +272 -0
  35. package/build/contracts/GovernanceUtils.sol/GovernanceUtils.dbg.json +1 -1
  36. package/build/contracts/GovernanceUtils.sol/GovernanceUtils.json +2 -2
  37. package/build/contracts/bank/Bank.sol/Bank.dbg.json +1 -1
  38. package/build/contracts/bank/Bank.sol/Bank.json +2 -2
  39. package/build/contracts/bridge/BitcoinTx.sol/BitcoinTx.dbg.json +1 -1
  40. package/build/contracts/bridge/BitcoinTx.sol/BitcoinTx.json +2 -2
  41. package/build/contracts/bridge/Bridge.sol/Bridge.dbg.json +1 -1
  42. package/build/contracts/bridge/Bridge.sol/Bridge.json +2 -2
  43. package/build/contracts/bridge/BridgeState.sol/BridgeState.dbg.json +1 -1
  44. package/build/contracts/bridge/BridgeState.sol/BridgeState.json +2 -2
  45. package/build/contracts/bridge/Deposit.sol/Deposit.dbg.json +1 -1
  46. package/build/contracts/bridge/Deposit.sol/Deposit.json +2 -2
  47. package/build/contracts/bridge/DepositSweep.sol/DepositSweep.dbg.json +1 -1
  48. package/build/contracts/bridge/DepositSweep.sol/DepositSweep.json +2 -2
  49. package/build/contracts/bridge/EcdsaLib.sol/EcdsaLib.dbg.json +1 -1
  50. package/build/contracts/bridge/Fraud.sol/Fraud.dbg.json +1 -1
  51. package/build/contracts/bridge/Fraud.sol/Fraud.json +2 -2
  52. package/build/contracts/bridge/Heartbeat.sol/Heartbeat.dbg.json +1 -1
  53. package/build/contracts/bridge/Heartbeat.sol/Heartbeat.json +2 -2
  54. package/build/contracts/bridge/IRelay.sol/IRelay.dbg.json +1 -1
  55. package/build/contracts/bridge/MovingFunds.sol/MovingFunds.dbg.json +1 -1
  56. package/build/contracts/bridge/MovingFunds.sol/MovingFunds.json +2 -2
  57. package/build/contracts/bridge/Redemption.sol/OutboundTx.dbg.json +1 -1
  58. package/build/contracts/bridge/Redemption.sol/OutboundTx.json +2 -2
  59. package/build/contracts/bridge/Redemption.sol/Redemption.dbg.json +1 -1
  60. package/build/contracts/bridge/Redemption.sol/Redemption.json +2 -2
  61. package/build/contracts/bridge/VendingMachine.sol/VendingMachine.dbg.json +1 -1
  62. package/build/contracts/bridge/VendingMachine.sol/VendingMachine.json +2 -2
  63. package/build/contracts/bridge/Wallets.sol/Wallets.dbg.json +1 -1
  64. package/build/contracts/bridge/Wallets.sol/Wallets.json +2 -2
  65. package/build/contracts/token/TBTC.sol/TBTC.dbg.json +1 -1
  66. package/build/contracts/token/TBTC.sol/TBTC.json +2 -2
  67. package/build/contracts/vault/DonationVault.sol/DonationVault.dbg.json +1 -1
  68. package/build/contracts/vault/DonationVault.sol/DonationVault.json +2 -2
  69. package/build/contracts/vault/IVault.sol/IVault.dbg.json +1 -1
  70. package/build/contracts/vault/TBTCVault.sol/TBTCVault.dbg.json +1 -1
  71. package/build/contracts/vault/TBTCVault.sol/TBTCVault.json +2 -2
  72. package/contracts/GovernanceUtils.sol +3 -3
  73. package/contracts/bank/Bank.sol +2 -2
  74. package/contracts/bridge/BitcoinTx.sol +7 -7
  75. package/contracts/bridge/Bridge.sol +193 -199
  76. package/contracts/bridge/BridgeState.sol +43 -44
  77. package/contracts/bridge/Deposit.sol +5 -7
  78. package/contracts/bridge/DepositSweep.sol +12 -12
  79. package/contracts/bridge/Fraud.sol +25 -25
  80. package/contracts/bridge/Heartbeat.sol +1 -1
  81. package/contracts/bridge/MovingFunds.sol +72 -72
  82. package/contracts/bridge/Redemption.sol +32 -39
  83. package/contracts/bridge/Wallets.sol +29 -29
  84. package/contracts/vault/DonationVault.sol +9 -9
  85. package/contracts/vault/IVault.sol +4 -4
  86. package/contracts/vault/TBTCVault.sol +14 -14
  87. package/package.json +3 -3
  88. package/artifacts/solcInputs/55619e5b15411ce6622d6da869c273a1.json +0 -269
@@ -16,12 +16,8 @@
16
16
  pragma solidity ^0.8.9;
17
17
 
18
18
  import "@keep-network/random-beacon/contracts/Governable.sol";
19
-
20
19
  import {IWalletOwner as EcdsaWalletOwner} from "@keep-network/ecdsa/contracts/api/IWalletOwner.sol";
21
20
 
22
- // TODO: We used RC version of @openzeppelin/contracts-upgradeable to use `reinitializer`
23
- // in upgrades. We should revisit this part before mainnet deployment and use
24
- // a final release package if it's ready.
25
21
  import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
26
22
 
27
23
  import "./IRelay.sol";
@@ -58,9 +54,6 @@ import "../bank/Bank.sol";
58
54
  /// @dev Bridge is an upgradeable component of the Bank. The order of
59
55
  /// functionalities in this contract is: deposit, sweep, redemption,
60
56
  /// moving funds, wallet lifecycle, frauds, parameters.
61
- ///
62
- /// TODO: Align the convention around `param` and `dev` endings. They should
63
- /// not have a punctuation mark.
64
57
  contract Bridge is Governable, EcdsaWalletOwner, Initializable {
65
58
  using BridgeState for BridgeState.Storage;
66
59
  using Deposit for BridgeState.Storage;
@@ -225,14 +218,14 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
225
218
  );
226
219
 
227
220
  /// @dev Initializes upgradable contract on deployment.
228
- /// @param _bank Address of the Bank the Bridge belongs to
221
+ /// @param _bank Address of the Bank the Bridge belongs to.
229
222
  /// @param _relay Address of the Bitcoin relay providing the current Bitcoin
230
- /// network difficulty
223
+ /// network difficulty.
231
224
  /// @param _treasury Address where the deposit and redemption treasury fees
232
- /// will be sent to
233
- /// @param _ecdsaWalletRegistry Address of the ECDSA Wallet Registry contract
225
+ /// will be sent to.
226
+ /// @param _ecdsaWalletRegistry Address of the ECDSA Wallet Registry contract.
234
227
  /// @param _txProofDifficultyFactor The number of confirmations on the Bitcoin
235
- /// chain required to successfully evaluate an SPV proof
228
+ /// chain required to successfully evaluate an SPV proof.
236
229
  function initialize(
237
230
  address _bank,
238
231
  address _relay,
@@ -258,6 +251,7 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
258
251
  self.txProofDifficultyFactor = _txProofDifficultyFactor;
259
252
 
260
253
  // TODO: Revisit initial values.
254
+ // https://github.com/keep-network/tbtc-v2/issues/258
261
255
  self.depositDustThreshold = 1000000; // 1000000 satoshi = 0.01 BTC
262
256
  self.depositTxMaxFee = 10000; // 10000 satoshi
263
257
  self.depositTreasuryFeeDivisor = 2000; // 1/2000 == 5bps == 0.05% == 0.0005
@@ -302,13 +296,13 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
302
296
  /// outputs. The deposit may be routed to one of the trusted vaults.
303
297
  /// When a deposit is routed to a vault, vault gets notified when
304
298
  /// the deposit gets swept and it may execute the appropriate action.
305
- /// @param fundingTx Bitcoin funding transaction data, see `BitcoinTx.Info`
306
- /// @param reveal Deposit reveal data, see `RevealInfo struct
299
+ /// @param fundingTx Bitcoin funding transaction data, see `BitcoinTx.Info`.
300
+ /// @param reveal Deposit reveal data, see `RevealInfo struct.
307
301
  /// @dev Requirements:
308
- /// - `reveal.walletPubKeyHash` must identify a `Live` wallet
309
- /// - `reveal.vault` must be 0x0 or point to a trusted vault
302
+ /// - `reveal.walletPubKeyHash` must identify a `Live` wallet,
303
+ /// - `reveal.vault` must be 0x0 or point to a trusted vault,
310
304
  /// - `reveal.fundingOutputIndex` must point to the actual P2(W)SH
311
- /// output of the BTC deposit transaction
305
+ /// output of the BTC deposit transaction,
312
306
  /// - `reveal.depositor` must be the Ethereum address used in the
313
307
  /// P2(W)SH BTC deposit transaction,
314
308
  /// - `reveal.blindingFactor` must be the blinding factor used in the
@@ -343,11 +337,11 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
343
337
  /// during the reveal transaction, minus their fee share.
344
338
  ///
345
339
  /// It is possible to prove the given sweep only one time.
346
- /// @param sweepTx Bitcoin sweep transaction data
347
- /// @param sweepProof Bitcoin sweep proof data
340
+ /// @param sweepTx Bitcoin sweep transaction data.
341
+ /// @param sweepProof Bitcoin sweep proof data.
348
342
  /// @param mainUtxo Data of the wallet's main UTXO, as currently known on
349
343
  /// the Ethereum chain. If no main UTXO exists for the given wallet,
350
- /// this parameter is ignored
344
+ /// this parameter is ignored.
351
345
  /// @param vault Optional address of the vault where all swept deposits
352
346
  /// should be routed to. All deposits swept as part of the transaction
353
347
  /// must have their `vault` parameters set to the same address.
@@ -361,7 +355,7 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
361
355
  /// - `sweepTx` components must match the expected structure. See
362
356
  /// `BitcoinTx.Info` docs for reference. Their values must exactly
363
357
  /// correspond to appropriate Bitcoin transaction fields to produce
364
- /// a provable transaction hash.
358
+ /// a provable transaction hash,
365
359
  /// - The `sweepTx` should represent a Bitcoin transaction with 1..n
366
360
  /// inputs. If the wallet has no main UTXO, all n inputs should
367
361
  /// correspond to P2(W)SH revealed deposits UTXOs. If the wallet has
@@ -369,14 +363,14 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
369
363
  /// main UTXO and remaining n-1 inputs should correspond to P2(W)SH
370
364
  /// revealed deposits UTXOs. That transaction must have only
371
365
  /// one P2(W)PKH output locking funds on the 20-byte wallet public
372
- /// key hash.
366
+ /// key hash,
373
367
  /// - All revealed deposits that are swept by `sweepTx` must have
374
368
  /// their `vault` parameters set to the same address as the address
375
- /// passed in the `vault` function parameter.
369
+ /// passed in the `vault` function parameter,
376
370
  /// - `sweepProof` components must match the expected structure. See
377
371
  /// `BitcoinTx.Proof` docs for reference. The `bitcoinHeaders`
378
372
  /// field must contain a valid number of block headers, not less
379
- /// than the `txProofDifficultyFactor` contract constant.
373
+ /// than the `txProofDifficultyFactor` contract constant,
380
374
  /// - `mainUtxo` components must point to the recent main UTXO
381
375
  /// of the given wallet, as currently known on the Ethereum chain.
382
376
  /// If there is no main UTXO, this parameter is ignored.
@@ -392,12 +386,12 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
392
386
  /// @notice Requests redemption of the given amount from the specified
393
387
  /// wallet to the redeemer Bitcoin output script.
394
388
  /// @param walletPubKeyHash The 20-byte wallet public key hash (computed
395
- /// using Bitcoin HASH160 over the compressed ECDSA public key)
389
+ /// using Bitcoin HASH160 over the compressed ECDSA public key).
396
390
  /// @param mainUtxo Data of the wallet's main UTXO, as currently known on
397
- /// the Ethereum chain
391
+ /// the Ethereum chain.
398
392
  /// @param redeemerOutputScript The redeemer's length-prefixed output
399
393
  /// script (P2PKH, P2WPKH, P2SH or P2WSH) that will be used to lock
400
- /// redeemed BTC
394
+ /// redeemed BTC.
401
395
  /// @param amount Requested amount in satoshi. This is also the TBTC amount
402
396
  /// that is taken from redeemer's balance in the Bank upon request.
403
397
  /// Once the request is handled, the actual amount of BTC locked
@@ -407,15 +401,15 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
407
401
  /// `amount - (amount / redemptionTreasuryFeeDivisor) - redemptionTxMaxFee`.
408
402
  /// Fees values are taken at the moment of request creation.
409
403
  /// @dev Requirements:
410
- /// - Wallet behind `walletPubKeyHash` must be live
404
+ /// - Wallet behind `walletPubKeyHash` must be live,
411
405
  /// - `mainUtxo` components must point to the recent main UTXO
412
- /// of the given wallet, as currently known on the Ethereum chain.
413
- /// - `redeemerOutputScript` must be a proper Bitcoin script
414
- /// - `redeemerOutputScript` cannot have wallet PKH as payload
415
- /// - `amount` must be above or equal the `redemptionDustThreshold`
406
+ /// of the given wallet, as currently known on the Ethereum chain,
407
+ /// - `redeemerOutputScript` must be a proper Bitcoin script,
408
+ /// - `redeemerOutputScript` cannot have wallet PKH as payload,
409
+ /// - `amount` must be above or equal the `redemptionDustThreshold`,
416
410
  /// - Given `walletPubKeyHash` and `redeemerOutputScript` pair can be
417
- /// used for only one pending request at the same time
418
- /// - Wallet must have enough Bitcoin balance to proceed the request
411
+ /// used for only one pending request at the same time,
412
+ /// - Wallet must have enough Bitcoin balance to proceed the request,
419
413
  /// - Redeemer must make an allowance in the Bank that the Bridge
420
414
  /// contract can spend the given `amount`.
421
415
  function requestRedemption(
@@ -441,18 +435,18 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
441
435
  /// transferring the treasury fee sum to the treasury address.
442
436
  ///
443
437
  /// It is possible to prove the given redemption only one time.
444
- /// @param redemptionTx Bitcoin redemption transaction data
445
- /// @param redemptionProof Bitcoin redemption proof data
438
+ /// @param redemptionTx Bitcoin redemption transaction data.
439
+ /// @param redemptionProof Bitcoin redemption proof data.
446
440
  /// @param mainUtxo Data of the wallet's main UTXO, as currently known on
447
- /// the Ethereum chain
441
+ /// the Ethereum chain.
448
442
  /// @param walletPubKeyHash 20-byte public key hash (computed using Bitcoin
449
443
  /// HASH160 over the compressed ECDSA public key) of the wallet which
450
- /// performed the redemption transaction
444
+ /// performed the redemption transaction.
451
445
  /// @dev Requirements:
452
446
  /// - `redemptionTx` components must match the expected structure. See
453
447
  /// `BitcoinTx.Info` docs for reference. Their values must exactly
454
448
  /// correspond to appropriate Bitcoin transaction fields to produce
455
- /// a provable transaction hash.
449
+ /// a provable transaction hash,
456
450
  /// - The `redemptionTx` should represent a Bitcoin transaction with
457
451
  /// exactly 1 input that refers to the wallet's main UTXO. That
458
452
  /// transaction should have 1..n outputs handling existing pending
@@ -460,14 +454,14 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
460
454
  /// There can be also 1 optional output representing the
461
455
  /// change and pointing back to the 20-byte wallet public key hash.
462
456
  /// The change should be always present if the redeemed value sum
463
- /// is lower than the total wallet's BTC balance.
457
+ /// is lower than the total wallet's BTC balance,
464
458
  /// - `redemptionProof` components must match the expected structure.
465
459
  /// See `BitcoinTx.Proof` docs for reference. The `bitcoinHeaders`
466
460
  /// field must contain a valid number of block headers, not less
467
- /// than the `txProofDifficultyFactor` contract constant.
461
+ /// than the `txProofDifficultyFactor` contract constant,
468
462
  /// - `mainUtxo` components must point to the recent main UTXO
469
463
  /// of the given wallet, as currently known on the Ethereum chain.
470
- /// Additionally, the recent main UTXO on Ethereum must be set.
464
+ /// Additionally, the recent main UTXO on Ethereum must be set,
471
465
  /// - `walletPubKeyHash` must be connected with the main UTXO used
472
466
  /// as transaction single input.
473
467
  /// Other remarks:
@@ -495,36 +489,36 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
495
489
  /// request is identified by the key built as
496
490
  /// `keccak256(walletPubKeyHash | redeemerOutputScript)`.
497
491
  /// The results of calling this function:
498
- /// - the pending redemptions value for the wallet will be decreased
492
+ /// - The pending redemptions value for the wallet will be decreased
499
493
  /// by the requested amount (minus treasury fee),
500
- /// - the tokens taken from the redeemer on redemption request will
494
+ /// - The tokens taken from the redeemer on redemption request will
501
495
  /// be returned to the redeemer,
502
- /// - the request will be moved from pending redemptions to
496
+ /// - The request will be moved from pending redemptions to
503
497
  /// timed-out redemptions,
504
- /// - if the state of the wallet is `Live` or `MovingFunds`, the
498
+ /// - If the state of the wallet is `Live` or `MovingFunds`, the
505
499
  /// wallet operators will be slashed and the notifier will be
506
500
  /// rewarded,
507
- /// - if the state of wallet is `Live`, the wallet will be closed or
501
+ /// - If the state of wallet is `Live`, the wallet will be closed or
508
502
  /// marked as `MovingFunds` (depending on the presence or absence
509
503
  /// of the wallet's main UTXO) and the wallet will no longer be
510
504
  /// marked as the active wallet (if it was marked as such).
511
- /// @param walletPubKeyHash 20-byte public key hash of the wallet
512
- /// @param walletMembersIDs Identifiers of the wallet signing group members
505
+ /// @param walletPubKeyHash 20-byte public key hash of the wallet.
506
+ /// @param walletMembersIDs Identifiers of the wallet signing group members.
513
507
  /// @param redeemerOutputScript The redeemer's length-prefixed output
514
- /// script (P2PKH, P2WPKH, P2SH or P2WSH)
508
+ /// script (P2PKH, P2WPKH, P2SH or P2WSH).
515
509
  /// @dev Requirements:
516
- /// - The wallet must be in the Live or MovingFunds or Terminated state
510
+ /// - The wallet must be in the Live or MovingFunds or Terminated state,
517
511
  /// - The redemption request identified by `walletPubKeyHash` and
518
- /// `redeemerOutputScript` must exist
512
+ /// `redeemerOutputScript` must exist,
519
513
  /// - The expression `keccak256(abi.encode(walletMembersIDs))` must
520
514
  /// be exactly the same as the hash stored under `membersIdsHash`
521
515
  /// for the given `walletID`. Those IDs are not directly stored
522
516
  /// in the contract for gas efficiency purposes but they can be
523
517
  /// read from appropriate `DkgResultSubmitted` and `DkgResultApproved`
524
- /// events of the `WalletRegistry` contract
518
+ /// events of the `WalletRegistry` contract,
525
519
  /// - The amount of time defined by `redemptionTimeout` must have
526
520
  /// passed since the redemption was requested (the request must be
527
- /// timed-out)
521
+ /// timed-out).
528
522
  function notifyRedemptionTimeout(
529
523
  bytes20 walletPubKeyHash,
530
524
  uint32[] calldata walletMembersIDs,
@@ -541,42 +535,42 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
541
535
  /// Once all requirements are met, that function registers the
542
536
  /// target wallets commitment and opens the way for moving funds
543
537
  /// proof submission.
544
- /// @param walletPubKeyHash 20-byte public key hash of the source wallet
538
+ /// @param walletPubKeyHash 20-byte public key hash of the source wallet.
545
539
  /// @param walletMainUtxo Data of the source wallet's main UTXO, as
546
- /// currently known on the Ethereum chain
540
+ /// currently known on the Ethereum chain.
547
541
  /// @param walletMembersIDs Identifiers of the source wallet signing group
548
- /// members
542
+ /// members.
549
543
  /// @param walletMemberIndex Position of the caller in the source wallet
550
- /// signing group members list
544
+ /// signing group members list.
551
545
  /// @param targetWallets List of 20-byte public key hashes of the target
552
- /// wallets that the source wallet commits to move the funds to
546
+ /// wallets that the source wallet commits to move the funds to.
553
547
  /// @dev Requirements:
554
- /// - The source wallet must be in the MovingFunds state
555
- /// - The source wallet must not have pending redemption requests
556
- /// - The source wallet must not have pending moved funds sweep requests
557
- /// - The source wallet must not have submitted its commitment already
548
+ /// - The source wallet must be in the MovingFunds state,
549
+ /// - The source wallet must not have pending redemption requests,
550
+ /// - The source wallet must not have pending moved funds sweep requests,
551
+ /// - The source wallet must not have submitted its commitment already,
558
552
  /// - The expression `keccak256(abi.encode(walletMembersIDs))` must
559
553
  /// be exactly the same as the hash stored under `membersIdsHash`
560
554
  /// for the given source wallet in the ECDSA registry. Those IDs are
561
555
  /// not directly stored in the contract for gas efficiency purposes
562
556
  /// but they can be read from appropriate `DkgResultSubmitted`
563
- /// and `DkgResultApproved` events.
564
- /// - The `walletMemberIndex` must be in range [1, walletMembersIDs.length]
557
+ /// and `DkgResultApproved` events,
558
+ /// - The `walletMemberIndex` must be in range [1, walletMembersIDs.length],
565
559
  /// - The caller must be the member of the source wallet signing group
566
- /// at the position indicated by `walletMemberIndex` parameter
560
+ /// at the position indicated by `walletMemberIndex` parameter,
567
561
  /// - The `walletMainUtxo` components must point to the recent main
568
562
  /// UTXO of the source wallet, as currently known on the Ethereum
569
- /// chain.
570
- /// - Source wallet BTC balance must be greater than zero
571
- /// - At least one Live wallet must exist in the system
563
+ /// chain,
564
+ /// - Source wallet BTC balance must be greater than zero,
565
+ /// - At least one Live wallet must exist in the system,
572
566
  /// - Submitted target wallets count must match the expected count
573
567
  /// `N = min(liveWalletsCount, ceil(walletBtcBalance / walletMaxBtcTransfer))`
574
- /// where `N > 0`
575
- /// - Each target wallet must be not equal to the source wallet
568
+ /// where `N > 0`,
569
+ /// - Each target wallet must be not equal to the source wallet,
576
570
  /// - Each target wallet must follow the expected order i.e. all
577
571
  /// target wallets 20-byte public key hashes represented as numbers
578
- /// must form a strictly increasing sequence without duplicates.
579
- /// - Each target wallet must be in Live state
572
+ /// must form a strictly increasing sequence without duplicates,
573
+ /// - Each target wallet must be in Live state.
580
574
  function submitMovingFundsCommitment(
581
575
  bytes20 walletPubKeyHash,
582
576
  BitcoinTx.UTXO calldata walletMainUtxo,
@@ -596,12 +590,12 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
596
590
  /// @notice Resets the moving funds timeout for the given wallet if the
597
591
  /// target wallet commitment cannot be submitted due to a lack
598
592
  /// of live wallets in the system.
599
- /// @param walletPubKeyHash 20-byte public key hash of the moving funds wallet
593
+ /// @param walletPubKeyHash 20-byte public key hash of the moving funds wallet.
600
594
  /// @dev Requirements:
601
- /// - The wallet must be in the MovingFunds state
595
+ /// - The wallet must be in the MovingFunds state,
602
596
  /// - The target wallets commitment must not be already submitted for
603
- /// the given moving funds wallet
604
- /// - Live wallets count must be zero
597
+ /// the given moving funds wallet,
598
+ /// - Live wallets count must be zero.
605
599
  function resetMovingFundsTimeout(bytes20 walletPubKeyHash) external {
606
600
  self.resetMovingFundsTimeout(walletPubKeyHash);
607
601
  }
@@ -618,37 +612,37 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
618
612
  ///
619
613
  /// It is possible to prove the given moving funds transaction only
620
614
  /// one time.
621
- /// @param movingFundsTx Bitcoin moving funds transaction data
622
- /// @param movingFundsProof Bitcoin moving funds proof data
615
+ /// @param movingFundsTx Bitcoin moving funds transaction data.
616
+ /// @param movingFundsProof Bitcoin moving funds proof data.
623
617
  /// @param mainUtxo Data of the wallet's main UTXO, as currently known on
624
- /// the Ethereum chain
618
+ /// the Ethereum chain.
625
619
  /// @param walletPubKeyHash 20-byte public key hash (computed using Bitcoin
626
620
  /// HASH160 over the compressed ECDSA public key) of the wallet
627
- /// which performed the moving funds transaction
621
+ /// which performed the moving funds transaction.
628
622
  /// @dev Requirements:
629
623
  /// - `movingFundsTx` components must match the expected structure. See
630
624
  /// `BitcoinTx.Info` docs for reference. Their values must exactly
631
625
  /// correspond to appropriate Bitcoin transaction fields to produce
632
- /// a provable transaction hash.
626
+ /// a provable transaction hash,
633
627
  /// - The `movingFundsTx` should represent a Bitcoin transaction with
634
628
  /// exactly 1 input that refers to the wallet's main UTXO. That
635
629
  /// transaction should have 1..n outputs corresponding to the
636
630
  /// pre-committed target wallets. Outputs must be ordered in the
637
631
  /// same way as their corresponding target wallets are ordered
638
- /// within the target wallets commitment.
632
+ /// within the target wallets commitment,
639
633
  /// - `movingFundsProof` components must match the expected structure.
640
634
  /// See `BitcoinTx.Proof` docs for reference. The `bitcoinHeaders`
641
635
  /// field must contain a valid number of block headers, not less
642
- /// than the `txProofDifficultyFactor` contract constant.
636
+ /// than the `txProofDifficultyFactor` contract constant,
643
637
  /// - `mainUtxo` components must point to the recent main UTXO
644
638
  /// of the given wallet, as currently known on the Ethereum chain.
645
- /// Additionally, the recent main UTXO on Ethereum must be set.
639
+ /// Additionally, the recent main UTXO on Ethereum must be set,
646
640
  /// - `walletPubKeyHash` must be connected with the main UTXO used
647
- /// as transaction single input.
641
+ /// as transaction single input,
648
642
  /// - The wallet that `walletPubKeyHash` points to must be in the
649
- /// MovingFunds state.
643
+ /// MovingFunds state,
650
644
  /// - The target wallets commitment must be submitted by the wallet
651
- /// that `walletPubKeyHash` points to.
645
+ /// that `walletPubKeyHash` points to,
652
646
  /// - The total Bitcoin transaction fee must be lesser or equal
653
647
  /// to `movingFundsTxMaxTotalFee` governable parameter.
654
648
  function submitMovingFundsProof(
@@ -667,17 +661,17 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
667
661
 
668
662
  /// @notice Notifies about a timed out moving funds process. Terminates
669
663
  /// the wallet and slashes signing group members as a result.
670
- /// @param walletPubKeyHash 20-byte public key hash of the wallet
671
- /// @param walletMembersIDs Identifiers of the wallet signing group members
664
+ /// @param walletPubKeyHash 20-byte public key hash of the wallet.
665
+ /// @param walletMembersIDs Identifiers of the wallet signing group members.
672
666
  /// @dev Requirements:
673
- /// - The wallet must be in the MovingFunds state
674
- /// - The moving funds timeout must be actually exceeded
667
+ /// - The wallet must be in the MovingFunds state,
668
+ /// - The moving funds timeout must be actually exceeded,
675
669
  /// - The expression `keccak256(abi.encode(walletMembersIDs))` must
676
670
  /// be exactly the same as the hash stored under `membersIdsHash`
677
671
  /// for the given `walletID`. Those IDs are not directly stored
678
672
  /// in the contract for gas efficiency purposes but they can be
679
673
  /// read from appropriate `DkgResultSubmitted` and `DkgResultApproved`
680
- /// events of the `WalletRegistry` contract
674
+ /// events of the `WalletRegistry` contract.
681
675
  function notifyMovingFundsTimeout(
682
676
  bytes20 walletPubKeyHash,
683
677
  uint32[] calldata walletMembersIDs
@@ -692,12 +686,12 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
692
686
  /// @param mainUtxo Data of the wallet's main UTXO, as currently known
693
687
  /// on the Ethereum chain.
694
688
  /// @dev Requirements:
695
- /// - The wallet must be in the MovingFunds state
689
+ /// - The wallet must be in the MovingFunds state,
696
690
  /// - The `mainUtxo` components must point to the recent main UTXO
697
691
  /// of the given wallet, as currently known on the Ethereum chain.
698
692
  /// If the wallet has no main UTXO, this parameter can be empty as it
699
- /// is ignored.
700
- /// - The wallet BTC balance must be below the moving funds threshold
693
+ /// is ignored,
694
+ /// - The wallet BTC balance must be below the moving funds threshold.
701
695
  function notifyMovingFundsBelowDust(
702
696
  bytes20 walletPubKeyHash,
703
697
  BitcoinTx.UTXO calldata mainUtxo
@@ -719,29 +713,29 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
719
713
  ///
720
714
  /// It is possible to prove the given sweep transaction only
721
715
  /// one time.
722
- /// @param sweepTx Bitcoin sweep funds transaction data
723
- /// @param sweepProof Bitcoin sweep funds proof data
716
+ /// @param sweepTx Bitcoin sweep funds transaction data.
717
+ /// @param sweepProof Bitcoin sweep funds proof data.
724
718
  /// @param mainUtxo Data of the sweeping wallet's main UTXO, as currently
725
- /// known on the Ethereum chain
719
+ /// known on the Ethereum chain.
726
720
  /// @dev Requirements:
727
721
  /// - `sweepTx` components must match the expected structure. See
728
722
  /// `BitcoinTx.Info` docs for reference. Their values must exactly
729
723
  /// correspond to appropriate Bitcoin transaction fields to produce
730
- /// a provable transaction hash.
724
+ /// a provable transaction hash,
731
725
  /// - The `sweepTx` should represent a Bitcoin transaction with
732
726
  /// the first input pointing to a moved funds sweep request targeted
733
727
  /// to the wallet, and optionally, the second input pointing to the
734
728
  /// wallet's main UTXO, if the sweeping wallet has a main UTXO set.
735
729
  /// There should be only one output locking funds on the sweeping
736
- /// wallet 20-byte public key hash.
730
+ /// wallet 20-byte public key hash,
737
731
  /// - `sweepProof` components must match the expected structure.
738
732
  /// See `BitcoinTx.Proof` docs for reference. The `bitcoinHeaders`
739
733
  /// field must contain a valid number of block headers, not less
740
- /// than the `txProofDifficultyFactor` contract constant.
734
+ /// than the `txProofDifficultyFactor` contract constant,
741
735
  /// - `mainUtxo` components must point to the recent main UTXO
742
736
  /// of the sweeping wallet, as currently known on the Ethereum chain.
743
- /// If there is no main UTXO, this parameter is ignored.
744
- /// - The sweeping wallet must be in the Live or MovingFunds state.
737
+ /// If there is no main UTXO, this parameter is ignored,
738
+ /// - The sweeping wallet must be in the Live or MovingFunds state,
745
739
  /// - The total Bitcoin transaction fee must be lesser or equal
746
740
  /// to `movedFundsSweepTxMaxTotalFee` governable parameter.
747
741
  function submitMovedFundsSweepProof(
@@ -757,21 +751,21 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
757
751
  /// the wallet and slashes signing group members as a result.
758
752
  /// Marks the given sweep request as TimedOut.
759
753
  /// @param movingFundsTxHash 32-byte hash of the moving funds transaction
760
- /// that caused the sweep request to be created
754
+ /// that caused the sweep request to be created.
761
755
  /// @param movingFundsTxOutputIndex Index of the moving funds transaction
762
756
  /// output that is subject of the sweep request.
763
- /// @param walletMembersIDs Identifiers of the wallet signing group members
757
+ /// @param walletMembersIDs Identifiers of the wallet signing group members.
764
758
  /// @dev Requirements:
765
- /// - The moved funds sweep request must be in the Pending state
766
- /// - The moved funds sweep timeout must be actually exceeded
759
+ /// - The moved funds sweep request must be in the Pending state,
760
+ /// - The moved funds sweep timeout must be actually exceeded,
767
761
  /// - The wallet must be either in the Live or MovingFunds or
768
- /// Terminated state
762
+ /// Terminated state,
769
763
  /// - The expression `keccak256(abi.encode(walletMembersIDs))` must
770
764
  /// be exactly the same as the hash stored under `membersIdsHash`
771
765
  /// for the given `walletID`. Those IDs are not directly stored
772
766
  /// in the contract for gas efficiency purposes but they can be
773
767
  /// read from appropriate `DkgResultSubmitted` and `DkgResultApproved`
774
- /// events of the `WalletRegistry` contract
768
+ /// events of the `WalletRegistry` contract.
775
769
  function notifyMovedFundsSweepTimeout(
776
770
  bytes32 movingFundsTxHash,
777
771
  uint32 movingFundsTxOutputIndex,
@@ -796,14 +790,14 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
796
790
  /// UTXO of the given active wallet, as currently known on the
797
791
  /// Ethereum chain. If there is no active wallet at the moment, or
798
792
  /// the active wallet has no main UTXO, this parameter can be
799
- /// empty as it is ignored.
800
- /// - Wallet creation must not be in progress
793
+ /// empty as it is ignored,
794
+ /// - Wallet creation must not be in progress,
801
795
  /// - If the active wallet is set, one of the following
802
796
  /// conditions must be true:
803
797
  /// - The active wallet BTC balance is above the minimum threshold
804
798
  /// and the active wallet is old enough, i.e. the creation period
805
- /// was elapsed since its creation time
806
- /// - The active wallet BTC balance is above the maximum threshold
799
+ /// was elapsed since its creation time,
800
+ /// - The active wallet BTC balance is above the maximum threshold.
807
801
  function requestNewWallet(BitcoinTx.UTXO calldata activeWalletMainUtxo)
808
802
  external
809
803
  {
@@ -816,8 +810,8 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
816
810
  /// @param publicKeyX Wallet's public key's X coordinate.
817
811
  /// @param publicKeyY Wallet's public key's Y coordinate.
818
812
  /// @dev Requirements:
819
- /// - The only caller authorized to call this function is `registry`
820
- /// - Given wallet data must not belong to an already registered wallet
813
+ /// - The only caller authorized to call this function is `registry`,
814
+ /// - Given wallet data must not belong to an already registered wallet.
821
815
  function __ecdsaWalletCreatedCallback(
822
816
  bytes32 ecdsaWalletID,
823
817
  bytes32 publicKeyX,
@@ -828,11 +822,11 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
828
822
 
829
823
  /// @notice A callback function that is called by the ECDSA Wallet Registry
830
824
  /// once a wallet heartbeat failure is detected.
831
- /// @param publicKeyX Wallet's public key's X coordinate
832
- /// @param publicKeyY Wallet's public key's Y coordinate
825
+ /// @param publicKeyX Wallet's public key's X coordinate.
826
+ /// @param publicKeyY Wallet's public key's Y coordinate.
833
827
  /// @dev Requirements:
834
- /// - The only caller authorized to call this function is `registry`
835
- /// - Wallet must be in Live state
828
+ /// - The only caller authorized to call this function is `registry`,
829
+ /// - Wallet must be in Live state.
836
830
  function __ecdsaWalletHeartbeatFailedCallback(
837
831
  bytes32,
838
832
  bytes32 publicKeyX,
@@ -843,19 +837,19 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
843
837
 
844
838
  /// @notice Notifies that the wallet is either old enough or has too few
845
839
  /// satoshi left and qualifies to be closed.
846
- /// @param walletPubKeyHash 20-byte public key hash of the wallet
840
+ /// @param walletPubKeyHash 20-byte public key hash of the wallet.
847
841
  /// @param walletMainUtxo Data of the wallet's main UTXO, as currently
848
842
  /// known on the Ethereum chain.
849
843
  /// @dev Requirements:
850
- /// - Wallet must not be set as the current active wallet
844
+ /// - Wallet must not be set as the current active wallet,
851
845
  /// - Wallet must exceed the wallet maximum age OR the wallet BTC
852
846
  /// balance must be lesser than the minimum threshold. If the latter
853
847
  /// case is true, the `walletMainUtxo` components must point to the
854
848
  /// recent main UTXO of the given wallet, as currently known on the
855
849
  /// Ethereum chain. If the wallet has no main UTXO, this parameter
856
850
  /// can be empty as it is ignored since the wallet balance is
857
- /// assumed to be zero.
858
- /// - Wallet must be in Live state
851
+ /// assumed to be zero,
852
+ /// - Wallet must be in Live state.
859
853
  function notifyCloseableWallet(
860
854
  bytes20 walletPubKeyHash,
861
855
  BitcoinTx.UTXO calldata walletMainUtxo
@@ -866,10 +860,10 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
866
860
  /// @notice Notifies about the end of the closing period for the given wallet.
867
861
  /// Closes the wallet ultimately and notifies the ECDSA registry
868
862
  /// about this fact.
869
- /// @param walletPubKeyHash 20-byte public key hash of the wallet
863
+ /// @param walletPubKeyHash 20-byte public key hash of the wallet.
870
864
  /// @dev Requirements:
871
- /// - The wallet must be in the Closing state
872
- /// - The wallet closing period must have elapsed
865
+ /// - The wallet must be in the Closing state,
866
+ /// - The wallet closing period must have elapsed.
873
867
  function notifyWalletClosingPeriodElapsed(bytes20 walletPubKeyHash)
874
868
  external
875
869
  {
@@ -892,7 +886,7 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
892
886
  /// must deposit ETH that is returned back upon justified fraud
893
887
  /// challenge or confiscated otherwise.
894
888
  /// @param walletPublicKey The public key of the wallet in the uncompressed
895
- /// and unprefixed format (64 bytes)
889
+ /// and unprefixed format (64 bytes).
896
890
  /// @param preimageSha256 The hash that was generated by applying SHA-256
897
891
  /// one time over the preimage used during input signing. The preimage
898
892
  /// is a serialized subset of the transaction and its structure
@@ -900,17 +894,17 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
900
894
  /// Notice that applying SHA-256 over the `preimageSha256` results
901
895
  /// in `sighash`. The path from `preimage` to `sighash` looks like
902
896
  /// this:
903
- /// preimage -> (SHA-256) -> preimageSha256 -> (SHA-256) -> sighash
904
- /// @param signature Bitcoin signature in the R/S/V format
897
+ /// preimage -> (SHA-256) -> preimageSha256 -> (SHA-256) -> sighash.
898
+ /// @param signature Bitcoin signature in the R/S/V format.
905
899
  /// @dev Requirements:
906
900
  /// - Wallet behind `walletPublicKey` must be in Live or MovingFunds
907
- /// or Closing state
901
+ /// or Closing state,
908
902
  /// - The challenger must send appropriate amount of ETH used as
909
- /// fraud challenge deposit
903
+ /// fraud challenge deposit,
910
904
  /// - The signature (represented by r, s and v) must be generated by
911
905
  /// the wallet behind `walletPubKey` during signing of `sighash`
912
- /// which was calculated from `preimageSha256`
913
- /// - Wallet can be challenged for the given signature only once
906
+ /// which was calculated from `preimageSha256`,
907
+ /// - Wallet can be challenged for the given signature only once.
914
908
  function submitFraudChallenge(
915
909
  bytes calldata walletPublicKey,
916
910
  bytes memory preimageSha256,
@@ -932,21 +926,21 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
932
926
  /// resolved and the amount of ether deposited by the challenger is
933
927
  /// sent to the treasury.
934
928
  /// @param walletPublicKey The public key of the wallet in the uncompressed
935
- /// and unprefixed format (64 bytes)
929
+ /// and unprefixed format (64 bytes).
936
930
  /// @param preimage The preimage which produces sighash used to generate the
937
931
  /// ECDSA signature that is the subject of the fraud claim. It is a
938
932
  /// serialized subset of the transaction. The exact subset used as
939
933
  /// the preimage depends on the transaction input the signature is
940
- /// produced for. See BIP-143 for reference
934
+ /// produced for. See BIP-143 for reference.
941
935
  /// @param witness Flag indicating whether the preimage was produced for a
942
- /// witness input. True for witness, false for non-witness input
936
+ /// witness input. True for witness, false for non-witness input.
943
937
  /// @dev Requirements:
944
938
  /// - `walletPublicKey` and `sighash` calculated as `hash256(preimage)`
945
- /// must identify an open fraud challenge
939
+ /// must identify an open fraud challenge,
946
940
  /// - the preimage must be a valid preimage of a transaction generated
947
- /// according to the protocol rules and already proved in the Bridge
941
+ /// according to the protocol rules and already proved in the Bridge,
948
942
  /// - before a defeat attempt is made the transaction that spends the
949
- /// given UTXO must be proven in the Bridge
943
+ /// given UTXO must be proven in the Bridge.
950
944
  function defeatFraudChallenge(
951
945
  bytes calldata walletPublicKey,
952
946
  bytes calldata preimage,
@@ -967,16 +961,16 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
967
961
  /// challenge is marked as resolved and the amount of ether
968
962
  /// deposited by the challenger is sent to the treasury.
969
963
  /// @param walletPublicKey The public key of the wallet in the uncompressed
970
- /// and unprefixed format (64 bytes)
964
+ /// and unprefixed format (64 bytes).
971
965
  /// @param heartbeatMessage Off-chain heartbeat message meeting the heartbeat
972
966
  /// message format requirements which produces sighash used to
973
967
  /// generate the ECDSA signature that is the subject of the fraud
974
- /// claim
968
+ /// claim.
975
969
  /// @dev Requirements:
976
970
  /// - `walletPublicKey` and `sighash` calculated as
977
- /// `hash256(heartbeatMessage)` must identify an open fraud challenge
971
+ /// `hash256(heartbeatMessage)` must identify an open fraud challenge,
978
972
  /// - `heartbeatMessage` must follow a strict format of heartbeat
979
- /// messages
973
+ /// messages.
980
974
  function defeatFraudChallengeWithHeartbeat(
981
975
  bytes calldata walletPublicKey,
982
976
  bytes calldata heartbeatMessage
@@ -998,8 +992,8 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
998
992
  /// deposited is returned to the challenger and the challenger is
999
993
  /// rewarded.
1000
994
  /// @param walletPublicKey The public key of the wallet in the uncompressed
1001
- /// and unprefixed format (64 bytes)
1002
- /// @param walletMembersIDs Identifiers of the wallet signing group members
995
+ /// and unprefixed format (64 bytes).
996
+ /// @param walletMembersIDs Identifiers of the wallet signing group members.
1003
997
  /// @param preimageSha256 The hash that was generated by applying SHA-256
1004
998
  /// one time over the preimage used during input signing. The preimage
1005
999
  /// is a serialized subset of the transaction and its structure
@@ -1007,20 +1001,20 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
1007
1001
  /// Notice that applying SHA-256 over the `preimageSha256` results
1008
1002
  /// in `sighash`. The path from `preimage` to `sighash` looks like
1009
1003
  /// this:
1010
- /// preimage -> (SHA-256) -> preimageSha256 -> (SHA-256) -> sighash
1004
+ /// preimage -> (SHA-256) -> preimageSha256 -> (SHA-256) -> sighash.
1011
1005
  /// @dev Requirements:
1012
1006
  /// - The wallet must be in the Live or MovingFunds or Closing or
1013
- /// Terminated state
1007
+ /// Terminated state,
1014
1008
  /// - The `walletPublicKey` and `sighash` calculated from
1015
- /// `preimageSha256` must identify an open fraud challenge
1009
+ /// `preimageSha256` must identify an open fraud challenge,
1016
1010
  /// - The expression `keccak256(abi.encode(walletMembersIDs))` must
1017
1011
  /// be exactly the same as the hash stored under `membersIdsHash`
1018
1012
  /// for the given `walletID`. Those IDs are not directly stored
1019
1013
  /// in the contract for gas efficiency purposes but they can be
1020
1014
  /// read from appropriate `DkgResultSubmitted` and `DkgResultApproved`
1021
- /// events of the `WalletRegistry` contract
1015
+ /// events of the `WalletRegistry` contract,
1022
1016
  /// - The amount of time indicated by `challengeDefeatTimeout` must pass
1023
- /// after the challenge was reported
1017
+ /// after the challenge was reported.
1024
1018
  function notifyFraudChallengeDefeatTimeout(
1025
1019
  bytes calldata walletPublicKey,
1026
1020
  uint32[] calldata walletMembersIDs,
@@ -1037,14 +1031,14 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
1037
1031
  /// or no longer trusted. Vaults are not trusted by default.
1038
1032
  /// Trusted vault must meet the following criteria:
1039
1033
  /// - `IVault.receiveBalanceIncrease` must have a known, low gas
1040
- /// cost.
1034
+ /// cost,
1041
1035
  /// - `IVault.receiveBalanceIncrease` must never revert.
1042
1036
  /// @dev Without restricting reveal only to trusted vaults, malicious
1043
1037
  /// vaults not meeting the criteria would be able to nuke sweep proof
1044
1038
  /// transactions executed by ECDSA wallet with deposits routed to
1045
1039
  /// them.
1046
- /// @param vault The address of the vault
1047
- /// @param isTrusted flag indicating whether the vault is trusted or not
1040
+ /// @param vault The address of the vault.
1041
+ /// @param isTrusted flag indicating whether the vault is trusted or not.
1048
1042
  /// @dev Can only be called by the Governance.
1049
1043
  function setVaultStatus(address vault, bool isTrusted)
1050
1044
  external
@@ -1060,7 +1054,7 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
1060
1054
  //// deposit. Value of this parameter must take into account the value
1061
1055
  /// of `depositTreasuryFeeDivisor` and `depositTxMaxFee` parameters
1062
1056
  /// in order to make requests that can incur the treasury and
1063
- /// transaction fee and still satisfy the depositor
1057
+ /// transaction fee and still satisfy the depositor.
1064
1058
  /// @param depositTreasuryFeeDivisor New value of the treasury fee divisor.
1065
1059
  /// It is the divisor used to compute the treasury fee taken from
1066
1060
  /// each deposit and transferred to the treasury upon sweep proof
@@ -1068,16 +1062,16 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
1068
1062
  /// `treasuryFee = depositedAmount / depositTreasuryFeeDivisor`
1069
1063
  /// For example, if the treasury fee needs to be 2% of each deposit,
1070
1064
  /// the `depositTreasuryFeeDivisor` should be set to `50`
1071
- /// because `1/50 = 0.02 = 2%`
1065
+ /// because `1/50 = 0.02 = 2%`.
1072
1066
  /// @param depositTxMaxFee New value of the deposit tx max fee in satoshis.
1073
1067
  /// It is the maximum amount of BTC transaction fee that can
1074
1068
  /// be incurred by each swept deposit being part of the given sweep
1075
1069
  /// transaction. If the maximum BTC transaction fee is exceeded,
1076
- /// such transaction is considered a fraud
1070
+ /// such transaction is considered a fraud.
1077
1071
  /// @dev Requirements:
1078
- /// - Deposit dust threshold must be greater than zero
1079
- /// - Deposit treasury fee divisor must be greater than zero
1080
- /// - Deposit transaction max fee must be greater than zero
1072
+ /// - Deposit dust threshold must be greater than zero,
1073
+ /// - Deposit treasury fee divisor must be greater than zero,
1074
+ /// - Deposit transaction max fee must be greater than zero.
1081
1075
  function updateDepositParameters(
1082
1076
  uint64 depositDustThreshold,
1083
1077
  uint64 depositTreasuryFeeDivisor,
@@ -1122,20 +1116,20 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
1122
1116
  /// redeemer in full amount.
1123
1117
  /// @param redemptionTimeoutSlashingAmount New value of the redemption
1124
1118
  /// timeout slashing amount in T, it is the amount slashed from each
1125
- /// wallet member for redemption timeout
1119
+ /// wallet member for redemption timeout.
1126
1120
  /// @param redemptionTimeoutNotifierRewardMultiplier New value of the
1127
1121
  /// redemption timeout notifier reward multiplier as percentage,
1128
1122
  /// it determines the percentage of the notifier reward from the
1129
1123
  /// staking contact the notifier of a redemption timeout receives.
1130
- /// The value must be in the range [0, 100]
1124
+ /// The value must be in the range [0, 100].
1131
1125
  /// @dev Requirements:
1132
1126
  /// - Redemption dust threshold must be greater than moving funds dust
1133
- /// threshold
1134
- /// - Redemption treasury fee divisor must be greater than zero
1135
- /// - Redemption transaction max fee must be greater than zero
1136
- /// - Redemption timeout must be greater than zero
1127
+ /// threshold,
1128
+ /// - Redemption treasury fee divisor must be greater than zero,
1129
+ /// - Redemption transaction max fee must be greater than zero,
1130
+ /// - Redemption timeout must be greater than zero,
1137
1131
  /// - Redemption timeout notifier reward multiplier must be in the
1138
- /// range [0, 100]
1132
+ /// range [0, 100].
1139
1133
  function updateRedemptionParameters(
1140
1134
  uint64 redemptionDustThreshold,
1141
1135
  uint64 redemptionTreasuryFeeDivisor,
@@ -1173,12 +1167,12 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
1173
1167
  /// MovingFunds state.
1174
1168
  /// @param movingFundsTimeoutSlashingAmount New value of the moving funds
1175
1169
  /// timeout slashing amount in T, it is the amount slashed from each
1176
- /// wallet member for moving funds timeout
1170
+ /// wallet member for moving funds timeout.
1177
1171
  /// @param movingFundsTimeoutNotifierRewardMultiplier New value of the
1178
1172
  /// moving funds timeout notifier reward multiplier as percentage,
1179
1173
  /// it determines the percentage of the notifier reward from the
1180
1174
  /// staking contact the notifier of a moving funds timeout receives.
1181
- /// The value must be in the range [0, 100]
1175
+ /// The value must be in the range [0, 100].
1182
1176
  /// @param movedFundsSweepTxMaxTotalFee New value of the moved funds sweep
1183
1177
  /// transaction max total fee in satoshis. It is the maximum amount
1184
1178
  /// of the total BTC transaction fee that is acceptable in a single
@@ -1191,23 +1185,23 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
1191
1185
  /// funds.
1192
1186
  /// @param movedFundsSweepTimeoutSlashingAmount New value of the moved
1193
1187
  /// funds sweep timeout slashing amount in T, it is the amount
1194
- /// slashed from each wallet member for moved funds sweep timeout
1188
+ /// slashed from each wallet member for moved funds sweep timeout.
1195
1189
  /// @param movedFundsSweepTimeoutNotifierRewardMultiplier New value of
1196
1190
  /// the moved funds sweep timeout notifier reward multiplier as
1197
1191
  /// percentage, it determines the percentage of the notifier reward
1198
1192
  /// from the staking contact the notifier of a moved funds sweep
1199
- /// timeout receives. The value must be in the range [0, 100]
1193
+ /// timeout receives. The value must be in the range [0, 100].
1200
1194
  /// @dev Requirements:
1201
- /// - Moving funds transaction max total fee must be greater than zero
1195
+ /// - Moving funds transaction max total fee must be greater than zero,
1202
1196
  /// - Moving funds dust threshold must be greater than zero and lower
1203
- /// than the redemption dust threshold
1204
- /// - Moving funds timeout must be greater than zero
1197
+ /// than the redemption dust threshold,
1198
+ /// - Moving funds timeout must be greater than zero,
1205
1199
  /// - Moving funds timeout notifier reward multiplier must be in the
1206
- /// range [0, 100]
1207
- /// - Moved funds sweep transaction max total fee must be greater than zero
1208
- /// - Moved funds sweep timeout must be greater than zero
1200
+ /// range [0, 100],
1201
+ /// - Moved funds sweep transaction max total fee must be greater than zero,
1202
+ /// - Moved funds sweep timeout must be greater than zero,
1209
1203
  /// - Moved funds sweep timeout notifier reward multiplier must be in the
1210
- /// range [0, 100]
1204
+ /// range [0, 100].
1211
1205
  function updateMovingFundsParameters(
1212
1206
  uint64 movingFundsTxMaxTotalFee,
1213
1207
  uint64 movingFundsDustThreshold,
@@ -1235,29 +1229,29 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
1235
1229
  /// @notice Updates parameters of wallets.
1236
1230
  /// @param walletCreationPeriod New value of the wallet creation period in
1237
1231
  /// seconds, determines how frequently a new wallet creation can be
1238
- /// requested
1232
+ /// requested.
1239
1233
  /// @param walletCreationMinBtcBalance New value of the wallet minimum BTC
1240
- /// balance in satoshi, used to decide about wallet creation
1234
+ /// balance in satoshi, used to decide about wallet creation.
1241
1235
  /// @param walletCreationMaxBtcBalance New value of the wallet maximum BTC
1242
- /// balance in satoshi, used to decide about wallet creation
1236
+ /// balance in satoshi, used to decide about wallet creation.
1243
1237
  /// @param walletClosureMinBtcBalance New value of the wallet minimum BTC
1244
- /// balance in satoshi, used to decide about wallet closure
1238
+ /// balance in satoshi, used to decide about wallet closure.
1245
1239
  /// @param walletMaxAge New value of the wallet maximum age in seconds,
1246
1240
  /// indicates the maximum age of a wallet in seconds, after which
1247
- /// the wallet moving funds process can be requested
1241
+ /// the wallet moving funds process can be requested.
1248
1242
  /// @param walletMaxBtcTransfer New value of the wallet maximum BTC transfer
1249
1243
  /// in satoshi, determines the maximum amount that can be transferred
1250
- // to a single target wallet during the moving funds process
1244
+ // to a single target wallet during the moving funds process.
1251
1245
  /// @param walletClosingPeriod New value of the wallet closing period in
1252
1246
  /// seconds, determines the length of the wallet closing period,
1253
1247
  // i.e. the period when the wallet remains in the Closing state
1254
- // and can be subject of deposit fraud challenges
1248
+ // and can be subject of deposit fraud challenges.
1255
1249
  /// @dev Requirements:
1256
- /// - Wallet minimum BTC balance must be greater than zero
1250
+ /// - Wallet minimum BTC balance must be greater than zero,
1257
1251
  /// - Wallet maximum BTC balance must be greater than the wallet
1258
- /// minimum BTC balance
1259
- /// - Wallet maximum BTC transfer must be greater than zero
1260
- /// - Wallet closing period must be greater than zero
1252
+ /// minimum BTC balance,
1253
+ /// - Wallet maximum BTC transfer must be greater than zero,
1254
+ /// - Wallet closing period must be greater than zero.
1261
1255
  function updateWalletParameters(
1262
1256
  uint32 walletCreationPeriod,
1263
1257
  uint64 walletCreationMinBtcBalance,
@@ -1281,20 +1275,20 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
1281
1275
  /// @notice Updates parameters related to frauds.
1282
1276
  /// @param fraudChallengeDepositAmount New value of the fraud challenge
1283
1277
  /// deposit amount in wei, it is the amount of ETH the party
1284
- /// challenging the wallet for fraud needs to deposit
1278
+ /// challenging the wallet for fraud needs to deposit.
1285
1279
  /// @param fraudChallengeDefeatTimeout New value of the challenge defeat
1286
1280
  /// timeout in seconds, it is the amount of time the wallet has to
1287
- /// defeat a fraud challenge. The value must be greater than zero
1281
+ /// defeat a fraud challenge. The value must be greater than zero.
1288
1282
  /// @param fraudSlashingAmount New value of the fraud slashing amount in T,
1289
1283
  /// it is the amount slashed from each wallet member for committing
1290
- /// a fraud
1284
+ /// a fraud.
1291
1285
  /// @param fraudNotifierRewardMultiplier New value of the fraud notifier
1292
1286
  /// reward multiplier as percentage, it determines the percentage of
1293
1287
  /// the notifier reward from the staking contact the notifier of
1294
- /// a fraud receives. The value must be in the range [0, 100]
1288
+ /// a fraud receives. The value must be in the range [0, 100].
1295
1289
  /// @dev Requirements:
1296
- /// - Fraud challenge defeat timeout must be greater than 0
1297
- /// - Fraud notifier reward multiplier must be in the range [0, 100]
1290
+ /// - Fraud challenge defeat timeout must be greater than 0,
1291
+ /// - Fraud notifier reward multiplier must be in the range [0, 100].
1298
1292
  function updateFraudParameters(
1299
1293
  uint256 fraudChallengeDepositAmount,
1300
1294
  uint256 fraudChallengeDefeatTimeout,
@@ -1334,9 +1328,9 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
1334
1328
  /// to this mapping by the `requestRedemption` method (duplicates
1335
1329
  /// not allowed) and are removed by one of the following methods:
1336
1330
  /// - `submitRedemptionProof` in case the request was handled
1337
- /// successfully
1331
+ /// successfully,
1338
1332
  /// - `notifyRedemptionTimeout` in case the request was reported
1339
- /// to be timed out
1333
+ /// to be timed out.
1340
1334
  function pendingRedemptions(uint256 redemptionKey)
1341
1335
  external
1342
1336
  view
@@ -1378,7 +1372,7 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
1378
1372
 
1379
1373
  /// @notice Gets details about a registered wallet.
1380
1374
  /// @param walletPubKeyHash The 20-byte wallet public key hash (computed
1381
- /// using Bitcoin HASH160 over the compressed ECDSA public key)
1375
+ /// using Bitcoin HASH160 over the compressed ECDSA public key).
1382
1376
  /// @return Wallet details.
1383
1377
  function wallets(bytes20 walletPubKeyHash)
1384
1378
  external
@@ -1419,7 +1413,7 @@ contract Bridge is Governable, EcdsaWalletOwner, Initializable {
1419
1413
  /// is actually an UTXO representing the moved funds and is supposed
1420
1414
  /// to be swept with the current main UTXO of the recipient wallet.
1421
1415
  /// @param requestKey Request key built as
1422
- /// `keccak256(movingFundsTxHash | movingFundsOutputIndex)`
1416
+ /// `keccak256(movingFundsTxHash | movingFundsOutputIndex)`.
1423
1417
  /// @return Details of the moved funds sweep request.
1424
1418
  function movedFundsSweepRequests(uint256 requestKey)
1425
1419
  external