@keep-network/tbtc-v2 0.1.1-dev.52 → 0.1.1-dev.55
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.
- package/artifacts/Bank.json +3 -3
- package/artifacts/Bridge.json +293 -187
- package/artifacts/Deposit.json +7 -7
- package/artifacts/EcdsaDkgValidator.json +1 -1
- package/artifacts/EcdsaInactivity.json +1 -1
- package/artifacts/Fraud.json +10 -10
- package/artifacts/KeepRegistry.json +1 -1
- package/artifacts/KeepStake.json +2 -2
- package/artifacts/KeepToken.json +2 -2
- package/artifacts/KeepTokenStaking.json +1 -1
- package/artifacts/MovingFunds.json +13 -12
- package/artifacts/NuCypherStakingEscrow.json +1 -1
- package/artifacts/NuCypherToken.json +2 -2
- package/artifacts/RandomBeaconStub.json +1 -1
- package/artifacts/Redemption.json +14 -13
- package/artifacts/ReimbursementPool.json +2 -2
- package/artifacts/Relay.json +9 -9
- package/artifacts/SortitionPool.json +2 -2
- package/artifacts/Sweep.json +7 -7
- package/artifacts/T.json +2 -2
- package/artifacts/TBTC.json +3 -3
- package/artifacts/TBTCToken.json +3 -3
- package/artifacts/TokenStaking.json +1 -1
- package/artifacts/TokenholderGovernor.json +9 -9
- package/artifacts/TokenholderTimelock.json +8 -8
- package/artifacts/VendingMachine.json +10 -10
- package/artifacts/VendingMachineKeep.json +1 -1
- package/artifacts/VendingMachineNuCypher.json +1 -1
- package/artifacts/WalletRegistry.json +2 -2
- package/artifacts/WalletRegistryGovernance.json +2 -2
- package/artifacts/Wallets.json +9 -9
- package/artifacts/solcInputs/{dcf2fc19e497270603c798faeb0a9ba9.json → 6d69fc514efd874ebb1cb86b04981772.json} +7 -7
- package/build/contracts/GovernanceUtils.sol/GovernanceUtils.dbg.json +1 -1
- package/build/contracts/bank/Bank.sol/Bank.dbg.json +1 -1
- package/build/contracts/bridge/BitcoinTx.sol/BitcoinTx.dbg.json +1 -1
- package/build/contracts/bridge/BitcoinTx.sol/BitcoinTx.json +2 -2
- package/build/contracts/bridge/Bridge.sol/Bridge.dbg.json +1 -1
- package/build/contracts/bridge/Bridge.sol/Bridge.json +139 -65
- package/build/contracts/bridge/BridgeState.sol/BridgeState.dbg.json +1 -1
- package/build/contracts/bridge/BridgeState.sol/BridgeState.json +37 -13
- package/build/contracts/bridge/Deposit.sol/Deposit.dbg.json +1 -1
- package/build/contracts/bridge/Deposit.sol/Deposit.json +2 -2
- package/build/contracts/bridge/EcdsaLib.sol/EcdsaLib.dbg.json +1 -1
- package/build/contracts/bridge/Fraud.sol/Fraud.dbg.json +1 -1
- package/build/contracts/bridge/Fraud.sol/Fraud.json +2 -2
- package/build/contracts/bridge/IRelay.sol/IRelay.dbg.json +1 -1
- package/build/contracts/bridge/MovingFunds.sol/MovingFunds.dbg.json +1 -1
- package/build/contracts/bridge/MovingFunds.sol/MovingFunds.json +2 -2
- package/build/contracts/bridge/Redemption.sol/OutboundTx.dbg.json +1 -1
- package/build/contracts/bridge/Redemption.sol/OutboundTx.json +2 -2
- package/build/contracts/bridge/Redemption.sol/Redemption.dbg.json +1 -1
- package/build/contracts/bridge/Redemption.sol/Redemption.json +2 -2
- package/build/contracts/bridge/Sweep.sol/Sweep.dbg.json +1 -1
- package/build/contracts/bridge/Sweep.sol/Sweep.json +2 -2
- package/build/contracts/bridge/VendingMachine.sol/VendingMachine.dbg.json +1 -1
- package/build/contracts/bridge/Wallets.sol/Wallets.dbg.json +1 -1
- package/build/contracts/bridge/Wallets.sol/Wallets.json +2 -2
- package/build/contracts/token/TBTC.sol/TBTC.dbg.json +1 -1
- package/build/contracts/vault/IVault.sol/IVault.dbg.json +1 -1
- package/build/contracts/vault/TBTCVault.sol/TBTCVault.dbg.json +1 -1
- package/contracts/bridge/Bridge.sol +147 -64
- package/contracts/bridge/BridgeState.sol +110 -47
- package/contracts/bridge/Fraud.sol +1 -1
- package/contracts/bridge/MovingFunds.sol +16 -3
- package/contracts/bridge/Redemption.sol +34 -12
- package/contracts/bridge/Wallets.sol +5 -9
- package/export.json +105 -44
- package/package.json +1 -1
|
@@ -170,13 +170,17 @@ contract Bridge is Governable, EcdsaWalletOwner {
|
|
|
170
170
|
uint64 redemptionDustThreshold,
|
|
171
171
|
uint64 redemptionTreasuryFeeDivisor,
|
|
172
172
|
uint64 redemptionTxMaxFee,
|
|
173
|
-
uint256 redemptionTimeout
|
|
173
|
+
uint256 redemptionTimeout,
|
|
174
|
+
uint96 redemptionTimeoutSlashingAmount,
|
|
175
|
+
uint256 redemptionTimeoutNotifierRewardMultiplier
|
|
174
176
|
);
|
|
175
177
|
|
|
176
178
|
event MovingFundsParametersUpdated(
|
|
177
179
|
uint64 movingFundsTxMaxTotalFee,
|
|
180
|
+
uint64 movingFundsDustThreshold,
|
|
178
181
|
uint32 movingFundsTimeout,
|
|
179
|
-
|
|
182
|
+
uint96 movingFundsTimeoutSlashingAmount,
|
|
183
|
+
uint256 movingFundsTimeoutNotifierRewardMultiplier
|
|
180
184
|
);
|
|
181
185
|
|
|
182
186
|
event WalletParametersUpdated(
|
|
@@ -190,10 +194,10 @@ contract Bridge is Governable, EcdsaWalletOwner {
|
|
|
190
194
|
);
|
|
191
195
|
|
|
192
196
|
event FraudParametersUpdated(
|
|
193
|
-
|
|
194
|
-
uint256 fraudNotifierRewardMultiplier,
|
|
197
|
+
uint256 fraudChallengeDepositAmount,
|
|
195
198
|
uint256 fraudChallengeDefeatTimeout,
|
|
196
|
-
|
|
199
|
+
uint96 fraudSlashingAmount,
|
|
200
|
+
uint256 fraudNotifierRewardMultiplier
|
|
197
201
|
);
|
|
198
202
|
|
|
199
203
|
constructor(
|
|
@@ -228,13 +232,17 @@ contract Bridge is Governable, EcdsaWalletOwner {
|
|
|
228
232
|
self.redemptionTreasuryFeeDivisor = 2000; // 1/2000 == 5bps == 0.05% == 0.0005
|
|
229
233
|
self.redemptionTxMaxFee = 10000; // 10000 satoshi
|
|
230
234
|
self.redemptionTimeout = 172800; // 48 hours
|
|
235
|
+
self.redemptionTimeoutSlashingAmount = 10000 * 1e18; // 10000 T
|
|
236
|
+
self.redemptionTimeoutNotifierRewardMultiplier = 100; // 100%
|
|
231
237
|
self.movingFundsTxMaxTotalFee = 10000; // 10000 satoshi
|
|
232
|
-
self.movingFundsTimeout = 7 days;
|
|
233
238
|
self.movingFundsDustThreshold = 20000; // 20000 satoshi
|
|
239
|
+
self.movingFundsTimeout = 7 days;
|
|
240
|
+
self.movingFundsTimeoutSlashingAmount = 10000 * 1e18; // 10000 T
|
|
241
|
+
self.movingFundsTimeoutNotifierRewardMultiplier = 100; //100%
|
|
242
|
+
self.fraudChallengeDepositAmount = 2 ether;
|
|
243
|
+
self.fraudChallengeDefeatTimeout = 7 days;
|
|
234
244
|
self.fraudSlashingAmount = 10000 * 1e18; // 10000 T
|
|
235
245
|
self.fraudNotifierRewardMultiplier = 100; // 100%
|
|
236
|
-
self.fraudChallengeDefeatTimeout = 7 days;
|
|
237
|
-
self.fraudChallengeDepositAmount = 2 ether;
|
|
238
246
|
self.walletCreationPeriod = 1 weeks;
|
|
239
247
|
self.walletCreationMinBtcBalance = 1e8; // 1 BTC
|
|
240
248
|
self.walletCreationMaxBtcBalance = 100e8; // 100 BTC
|
|
@@ -436,31 +444,47 @@ contract Bridge is Governable, EcdsaWalletOwner {
|
|
|
436
444
|
/// with the given wallet, that has timed out. The redemption
|
|
437
445
|
/// request is identified by the key built as
|
|
438
446
|
/// `keccak256(walletPubKeyHash | redeemerOutputScript)`.
|
|
439
|
-
/// The results of calling this function:
|
|
440
|
-
/// value for the wallet will be decreased
|
|
441
|
-
///
|
|
442
|
-
///
|
|
443
|
-
///
|
|
444
|
-
///
|
|
445
|
-
///
|
|
446
|
-
///
|
|
447
|
-
///
|
|
448
|
-
///
|
|
449
|
-
///
|
|
447
|
+
/// The results of calling this function:
|
|
448
|
+
/// - the pending redemptions value for the wallet will be decreased
|
|
449
|
+
/// by the requested amount (minus treasury fee),
|
|
450
|
+
/// - the tokens taken from the redeemer on redemption request will
|
|
451
|
+
/// be returned to the redeemer,
|
|
452
|
+
/// - the request will be moved from pending redemptions to
|
|
453
|
+
/// timed-out redemptions,
|
|
454
|
+
/// - if the state of the wallet is `Live` or `MovingFunds`, the
|
|
455
|
+
/// wallet operators will be slashed and the notifier will be
|
|
456
|
+
/// rewarded,
|
|
457
|
+
/// - if the state of wallet is `Live`, the wallet will be closed or
|
|
458
|
+
/// marked as `MovingFunds` (depending on the presence or absence
|
|
459
|
+
/// of the wallet's main UTXO) and the wallet will no longer be
|
|
460
|
+
/// marked as the active wallet (if it was marked as such).
|
|
450
461
|
/// @param walletPubKeyHash 20-byte public key hash of the wallet
|
|
462
|
+
/// @param walletMembersIDs Identifiers of the wallet signing group members
|
|
451
463
|
/// @param redeemerOutputScript The redeemer's length-prefixed output
|
|
452
464
|
/// script (P2PKH, P2WPKH, P2SH or P2WSH)
|
|
453
465
|
/// @dev Requirements:
|
|
466
|
+
/// - The wallet must be in the Live or MovingFunds or Terminated state
|
|
454
467
|
/// - The redemption request identified by `walletPubKeyHash` and
|
|
455
468
|
/// `redeemerOutputScript` must exist
|
|
469
|
+
/// - The expression `keccak256(abi.encode(walletMembersIDs))` must
|
|
470
|
+
/// be exactly the same as the hash stored under `membersIdsHash`
|
|
471
|
+
/// for the given `walletID`. Those IDs are not directly stored
|
|
472
|
+
/// in the contract for gas efficiency purposes but they can be
|
|
473
|
+
/// read from appropriate `DkgResultSubmitted` and `DkgResultApproved`
|
|
474
|
+
/// events of the `WalletRegistry` contract
|
|
456
475
|
/// - The amount of time defined by `redemptionTimeout` must have
|
|
457
476
|
/// passed since the redemption was requested (the request must be
|
|
458
|
-
/// timed-out)
|
|
477
|
+
/// timed-out)
|
|
459
478
|
function notifyRedemptionTimeout(
|
|
460
479
|
bytes20 walletPubKeyHash,
|
|
480
|
+
uint32[] calldata walletMembersIDs,
|
|
461
481
|
bytes calldata redeemerOutputScript
|
|
462
482
|
) external {
|
|
463
|
-
self.notifyRedemptionTimeout(
|
|
483
|
+
self.notifyRedemptionTimeout(
|
|
484
|
+
walletPubKeyHash,
|
|
485
|
+
walletMembersIDs,
|
|
486
|
+
redeemerOutputScript
|
|
487
|
+
);
|
|
464
488
|
}
|
|
465
489
|
|
|
466
490
|
/// @notice Submits the moving funds target wallets commitment.
|
|
@@ -580,11 +604,21 @@ contract Bridge is Governable, EcdsaWalletOwner {
|
|
|
580
604
|
/// @notice Notifies about a timed out moving funds process. Terminates
|
|
581
605
|
/// the wallet and slashes signing group members as a result.
|
|
582
606
|
/// @param walletPubKeyHash 20-byte public key hash of the wallet
|
|
607
|
+
/// @param walletMembersIDs Identifiers of the wallet signing group members
|
|
583
608
|
/// @dev Requirements:
|
|
584
609
|
/// - The wallet must be in the MovingFunds state
|
|
585
610
|
/// - The moving funds timeout must be actually exceeded
|
|
586
|
-
|
|
587
|
-
|
|
611
|
+
/// - The expression `keccak256(abi.encode(walletMembersIDs))` must
|
|
612
|
+
/// be exactly the same as the hash stored under `membersIdsHash`
|
|
613
|
+
/// for the given `walletID`. Those IDs are not directly stored
|
|
614
|
+
/// in the contract for gas efficiency purposes but they can be
|
|
615
|
+
/// read from appropriate `DkgResultSubmitted` and `DkgResultApproved`
|
|
616
|
+
/// events of the `WalletRegistry` contract
|
|
617
|
+
function notifyMovingFundsTimeout(
|
|
618
|
+
bytes20 walletPubKeyHash,
|
|
619
|
+
uint32[] calldata walletMembersIDs
|
|
620
|
+
) external {
|
|
621
|
+
self.notifyMovingFundsTimeout(walletPubKeyHash, walletMembersIDs);
|
|
588
622
|
}
|
|
589
623
|
|
|
590
624
|
/// @notice Notifies about a moving funds wallet whose BTC balance is
|
|
@@ -804,7 +838,7 @@ contract Bridge is Governable, EcdsaWalletOwner {
|
|
|
804
838
|
/// for the given `walletID`. Those IDs are not directly stored
|
|
805
839
|
/// in the contract for gas efficiency purposes but they can be
|
|
806
840
|
/// read from appropriate `DkgResultSubmitted` and `DkgResultApproved`
|
|
807
|
-
/// events
|
|
841
|
+
/// events of the `WalletRegistry` contract
|
|
808
842
|
/// - The amount of time indicated by `challengeDefeatTimeout` must pass
|
|
809
843
|
/// after the challenge was reported
|
|
810
844
|
function notifyFraudChallengeDefeatTimeout(
|
|
@@ -906,22 +940,36 @@ contract Bridge is Governable, EcdsaWalletOwner {
|
|
|
906
940
|
/// request was created via `requestRedemption` call. Reported timed
|
|
907
941
|
/// out requests are cancelled and locked TBTC is returned to the
|
|
908
942
|
/// redeemer in full amount.
|
|
943
|
+
/// @param redemptionTimeoutSlashingAmount New value of the redemption
|
|
944
|
+
/// timeout slashing amount in T, it is the amount slashed from each
|
|
945
|
+
/// wallet member for redemption timeout
|
|
946
|
+
/// @param redemptionTimeoutNotifierRewardMultiplier New value of the
|
|
947
|
+
/// redemption timeout notifier reward multiplier as percentage,
|
|
948
|
+
/// it determines the percentage of the notifier reward from the
|
|
949
|
+
/// staking contact the notifier of a redemption timeout receives.
|
|
950
|
+
/// The value must be in the range [0, 100]
|
|
909
951
|
/// @dev Requirements:
|
|
910
952
|
/// - Redemption dust threshold must be greater than zero
|
|
911
953
|
/// - Redemption treasury fee divisor must be greater than zero
|
|
912
954
|
/// - Redemption transaction max fee must be greater than zero
|
|
913
955
|
/// - Redemption timeout must be greater than zero
|
|
956
|
+
/// - Redemption timeout notifier reward multiplier must be in the
|
|
957
|
+
/// range [0, 100]
|
|
914
958
|
function updateRedemptionParameters(
|
|
915
959
|
uint64 redemptionDustThreshold,
|
|
916
960
|
uint64 redemptionTreasuryFeeDivisor,
|
|
917
961
|
uint64 redemptionTxMaxFee,
|
|
918
|
-
uint256 redemptionTimeout
|
|
962
|
+
uint256 redemptionTimeout,
|
|
963
|
+
uint96 redemptionTimeoutSlashingAmount,
|
|
964
|
+
uint256 redemptionTimeoutNotifierRewardMultiplier
|
|
919
965
|
) external onlyGovernance {
|
|
920
966
|
self.updateRedemptionParameters(
|
|
921
967
|
redemptionDustThreshold,
|
|
922
968
|
redemptionTreasuryFeeDivisor,
|
|
923
969
|
redemptionTxMaxFee,
|
|
924
|
-
redemptionTimeout
|
|
970
|
+
redemptionTimeout,
|
|
971
|
+
redemptionTimeoutSlashingAmount,
|
|
972
|
+
redemptionTimeoutNotifierRewardMultiplier
|
|
925
973
|
);
|
|
926
974
|
}
|
|
927
975
|
|
|
@@ -931,30 +979,44 @@ contract Bridge is Governable, EcdsaWalletOwner {
|
|
|
931
979
|
/// BTC transaction fee that is acceptable in a single moving funds
|
|
932
980
|
/// transaction. This is a _total_ max fee for the entire moving
|
|
933
981
|
/// funds transaction.
|
|
934
|
-
/// @param movingFundsTimeout New value of the moving funds timeout in
|
|
935
|
-
/// seconds. It is the time after which the moving funds process can
|
|
936
|
-
/// be reported as timed out. It is counted from the moment when the
|
|
937
|
-
/// wallet was requested to move their funds and switched to the
|
|
938
|
-
/// MovingFunds state.
|
|
939
982
|
/// @param movingFundsDustThreshold New value of the moving funds dust
|
|
940
983
|
/// threshold. It is the minimal satoshi amount that makes sense to
|
|
941
984
|
// be transferred during the moving funds process. Moving funds
|
|
942
985
|
// wallets having their BTC balance below that value can begin
|
|
943
986
|
// closing immediately as transferring such a low value may not be
|
|
944
987
|
// possible due to BTC network fees.
|
|
988
|
+
/// @param movingFundsTimeout New value of the moving funds timeout in
|
|
989
|
+
/// seconds. It is the time after which the moving funds process can
|
|
990
|
+
/// be reported as timed out. It is counted from the moment when the
|
|
991
|
+
/// wallet was requested to move their funds and switched to the
|
|
992
|
+
/// MovingFunds state.
|
|
993
|
+
/// @param movingFundsTimeoutSlashingAmount New value of the moving funds
|
|
994
|
+
/// timeout slashing amount in T, it is the amount slashed from each
|
|
995
|
+
/// wallet member for moving funds timeout
|
|
996
|
+
/// @param movingFundsTimeoutNotifierRewardMultiplier New value of the
|
|
997
|
+
/// moving funds timeout notifier reward multiplier as percentage,
|
|
998
|
+
/// it determines the percentage of the notifier reward from the
|
|
999
|
+
/// staking contact the notifier of a moving funds timeout receives.
|
|
1000
|
+
/// The value must be in the range [0, 100]
|
|
945
1001
|
/// @dev Requirements:
|
|
946
1002
|
/// - Moving funds transaction max total fee must be greater than zero
|
|
947
|
-
/// - Moving funds timeout must be greater than zero
|
|
948
1003
|
/// - Moving funds dust threshold must be greater than zero
|
|
1004
|
+
/// - Moving funds timeout must be greater than zero
|
|
1005
|
+
/// - Moving funds timeout notifier reward multiplier must be in the
|
|
1006
|
+
/// range [0, 100]
|
|
949
1007
|
function updateMovingFundsParameters(
|
|
950
1008
|
uint64 movingFundsTxMaxTotalFee,
|
|
1009
|
+
uint64 movingFundsDustThreshold,
|
|
951
1010
|
uint32 movingFundsTimeout,
|
|
952
|
-
|
|
1011
|
+
uint96 movingFundsTimeoutSlashingAmount,
|
|
1012
|
+
uint256 movingFundsTimeoutNotifierRewardMultiplier
|
|
953
1013
|
) external onlyGovernance {
|
|
954
1014
|
self.updateMovingFundsParameters(
|
|
955
1015
|
movingFundsTxMaxTotalFee,
|
|
1016
|
+
movingFundsDustThreshold,
|
|
956
1017
|
movingFundsTimeout,
|
|
957
|
-
|
|
1018
|
+
movingFundsTimeoutSlashingAmount,
|
|
1019
|
+
movingFundsTimeoutNotifierRewardMultiplier
|
|
958
1020
|
);
|
|
959
1021
|
}
|
|
960
1022
|
|
|
@@ -1005,6 +1067,12 @@ contract Bridge is Governable, EcdsaWalletOwner {
|
|
|
1005
1067
|
}
|
|
1006
1068
|
|
|
1007
1069
|
/// @notice Updates parameters related to frauds.
|
|
1070
|
+
/// @param fraudChallengeDepositAmount New value of the fraud challenge
|
|
1071
|
+
/// deposit amount in wei, it is the amount of ETH the party
|
|
1072
|
+
/// challenging the wallet for fraud needs to deposit
|
|
1073
|
+
/// @param fraudChallengeDefeatTimeout New value of the challenge defeat
|
|
1074
|
+
/// timeout in seconds, it is the amount of time the wallet has to
|
|
1075
|
+
/// defeat a fraud challenge. The value must be greater than zero
|
|
1008
1076
|
/// @param fraudSlashingAmount New value of the fraud slashing amount in T,
|
|
1009
1077
|
/// it is the amount slashed from each wallet member for committing
|
|
1010
1078
|
/// a fraud
|
|
@@ -1012,26 +1080,20 @@ contract Bridge is Governable, EcdsaWalletOwner {
|
|
|
1012
1080
|
/// reward multiplier as percentage, it determines the percentage of
|
|
1013
1081
|
/// the notifier reward from the staking contact the notifier of
|
|
1014
1082
|
/// a fraud receives. The value must be in the range [0, 100]
|
|
1015
|
-
/// @param fraudChallengeDefeatTimeout New value of the challenge defeat
|
|
1016
|
-
/// timeout in seconds, it is the amount of time the wallet has to
|
|
1017
|
-
/// defeat a fraud challenge. The value must be greater than zero
|
|
1018
|
-
/// @param fraudChallengeDepositAmount New value of the fraud challenge
|
|
1019
|
-
/// deposit amount in wei, it is the amount of ETH the party
|
|
1020
|
-
/// challenging the wallet for fraud needs to deposit
|
|
1021
1083
|
/// @dev Requirements:
|
|
1022
|
-
/// - Fraud notifier reward multiplier must be in the range [0, 100]
|
|
1023
1084
|
/// - Fraud challenge defeat timeout must be greater than 0
|
|
1085
|
+
/// - Fraud notifier reward multiplier must be in the range [0, 100]
|
|
1024
1086
|
function updateFraudParameters(
|
|
1025
|
-
|
|
1026
|
-
uint256 fraudNotifierRewardMultiplier,
|
|
1087
|
+
uint256 fraudChallengeDepositAmount,
|
|
1027
1088
|
uint256 fraudChallengeDefeatTimeout,
|
|
1028
|
-
|
|
1089
|
+
uint96 fraudSlashingAmount,
|
|
1090
|
+
uint256 fraudNotifierRewardMultiplier
|
|
1029
1091
|
) external onlyGovernance {
|
|
1030
1092
|
self.updateFraudParameters(
|
|
1031
|
-
|
|
1032
|
-
fraudNotifierRewardMultiplier,
|
|
1093
|
+
fraudChallengeDepositAmount,
|
|
1033
1094
|
fraudChallengeDefeatTimeout,
|
|
1034
|
-
|
|
1095
|
+
fraudSlashingAmount,
|
|
1096
|
+
fraudNotifierRewardMultiplier
|
|
1035
1097
|
);
|
|
1036
1098
|
}
|
|
1037
1099
|
|
|
@@ -1205,6 +1267,11 @@ contract Bridge is Governable, EcdsaWalletOwner {
|
|
|
1205
1267
|
/// redemption request was created via `requestRedemption` call.
|
|
1206
1268
|
/// Reported timed out requests are cancelled and locked TBTC is
|
|
1207
1269
|
/// returned to the redeemer in full amount.
|
|
1270
|
+
/// @return redemptionTimeoutSlashingAmount The amount of stake slashed
|
|
1271
|
+
/// from each member of a wallet for a redemption timeout.
|
|
1272
|
+
/// @return redemptionTimeoutNotifierRewardMultiplier The percentage of the
|
|
1273
|
+
/// notifier reward from the staking contract the notifier of a
|
|
1274
|
+
/// redemption timeout receives. The value is in the range [0, 100].
|
|
1208
1275
|
function redemptionParameters()
|
|
1209
1276
|
external
|
|
1210
1277
|
view
|
|
@@ -1212,13 +1279,18 @@ contract Bridge is Governable, EcdsaWalletOwner {
|
|
|
1212
1279
|
uint64 redemptionDustThreshold,
|
|
1213
1280
|
uint64 redemptionTreasuryFeeDivisor,
|
|
1214
1281
|
uint64 redemptionTxMaxFee,
|
|
1215
|
-
uint256 redemptionTimeout
|
|
1282
|
+
uint256 redemptionTimeout,
|
|
1283
|
+
uint96 redemptionTimeoutSlashingAmount,
|
|
1284
|
+
uint256 redemptionTimeoutNotifierRewardMultiplier
|
|
1216
1285
|
)
|
|
1217
1286
|
{
|
|
1218
1287
|
redemptionDustThreshold = self.redemptionDustThreshold;
|
|
1219
1288
|
redemptionTreasuryFeeDivisor = self.redemptionTreasuryFeeDivisor;
|
|
1220
1289
|
redemptionTxMaxFee = self.redemptionTxMaxFee;
|
|
1221
1290
|
redemptionTimeout = self.redemptionTimeout;
|
|
1291
|
+
redemptionTimeoutSlashingAmount = self.redemptionTimeoutSlashingAmount;
|
|
1292
|
+
redemptionTimeoutNotifierRewardMultiplier = self
|
|
1293
|
+
.redemptionTimeoutNotifierRewardMultiplier;
|
|
1222
1294
|
}
|
|
1223
1295
|
|
|
1224
1296
|
/// @notice Returns the current values of Bridge moving funds between
|
|
@@ -1227,27 +1299,38 @@ contract Bridge is Governable, EcdsaWalletOwner {
|
|
|
1227
1299
|
/// transaction fee that is acceptable in a single moving funds
|
|
1228
1300
|
/// transaction. This is a _total_ max fee for the entire moving
|
|
1229
1301
|
/// funds transaction.
|
|
1302
|
+
/// @return movingFundsDustThreshold The minimal satoshi amount that makes
|
|
1303
|
+
/// sense to be transferred during the moving funds process. Moving
|
|
1304
|
+
/// funds wallets having their BTC balance below that value can
|
|
1305
|
+
/// begin closing immediately as transferring such a low value may
|
|
1306
|
+
/// not be possible due to BTC network fees.
|
|
1230
1307
|
/// @return movingFundsTimeout Time after which the moving funds process
|
|
1231
1308
|
/// can be reported as timed out. It is counted from the moment
|
|
1232
1309
|
/// when the wallet was requested to move their funds and switched
|
|
1233
1310
|
/// to the MovingFunds state. Value in seconds.
|
|
1234
|
-
/// @return
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1311
|
+
/// @return movingFundsTimeoutSlashingAmount The amount of stake slashed
|
|
1312
|
+
/// from each member of a wallet for a moving funds timeout.
|
|
1313
|
+
/// @return movingFundsTimeoutNotifierRewardMultiplier The percentage of the
|
|
1314
|
+
/// notifier reward from the staking contract the notifier of a
|
|
1315
|
+
/// moving funds timeout receives. The value is in the range [0, 100].
|
|
1239
1316
|
function movingFundsParameters()
|
|
1240
1317
|
external
|
|
1241
1318
|
view
|
|
1242
1319
|
returns (
|
|
1243
1320
|
uint64 movingFundsTxMaxTotalFee,
|
|
1321
|
+
uint64 movingFundsDustThreshold,
|
|
1244
1322
|
uint32 movingFundsTimeout,
|
|
1245
|
-
|
|
1323
|
+
uint96 movingFundsTimeoutSlashingAmount,
|
|
1324
|
+
uint256 movingFundsTimeoutNotifierRewardMultiplier
|
|
1246
1325
|
)
|
|
1247
1326
|
{
|
|
1248
1327
|
movingFundsTxMaxTotalFee = self.movingFundsTxMaxTotalFee;
|
|
1249
|
-
movingFundsTimeout = self.movingFundsTimeout;
|
|
1250
1328
|
movingFundsDustThreshold = self.movingFundsDustThreshold;
|
|
1329
|
+
movingFundsTimeout = self.movingFundsTimeout;
|
|
1330
|
+
movingFundsTimeoutSlashingAmount = self
|
|
1331
|
+
.movingFundsTimeoutSlashingAmount;
|
|
1332
|
+
movingFundsTimeoutNotifierRewardMultiplier = self
|
|
1333
|
+
.movingFundsTimeoutNotifierRewardMultiplier;
|
|
1251
1334
|
}
|
|
1252
1335
|
|
|
1253
1336
|
/// @return walletCreationPeriod Determines how frequently a new wallet
|
|
@@ -1290,29 +1373,29 @@ contract Bridge is Governable, EcdsaWalletOwner {
|
|
|
1290
1373
|
}
|
|
1291
1374
|
|
|
1292
1375
|
/// @notice Returns the current values of Bridge fraud parameters.
|
|
1376
|
+
/// @return fraudChallengeDepositAmount The amount of ETH in wei the party
|
|
1377
|
+
/// challenging the wallet for fraud needs to deposit.
|
|
1378
|
+
/// @return fraudChallengeDefeatTimeout The amount of time the wallet has to
|
|
1379
|
+
/// defeat a fraud challenge.
|
|
1293
1380
|
/// @return fraudSlashingAmount The amount slashed from each wallet member
|
|
1294
1381
|
/// for committing a fraud.
|
|
1295
1382
|
/// @return fraudNotifierRewardMultiplier The percentage of the notifier
|
|
1296
1383
|
/// reward from the staking contract the notifier of a fraud
|
|
1297
1384
|
/// receives. The value is in the range [0, 100].
|
|
1298
|
-
/// @return fraudChallengeDefeatTimeout The amount of time the wallet has to
|
|
1299
|
-
/// defeat a fraud challenge.
|
|
1300
|
-
/// @return fraudChallengeDepositAmount The amount of ETH in wei the party
|
|
1301
|
-
/// challenging the wallet for fraud needs to deposit.
|
|
1302
1385
|
function fraudParameters()
|
|
1303
1386
|
external
|
|
1304
1387
|
view
|
|
1305
1388
|
returns (
|
|
1306
|
-
|
|
1307
|
-
uint256 fraudNotifierRewardMultiplier,
|
|
1389
|
+
uint256 fraudChallengeDepositAmount,
|
|
1308
1390
|
uint256 fraudChallengeDefeatTimeout,
|
|
1309
|
-
|
|
1391
|
+
uint96 fraudSlashingAmount,
|
|
1392
|
+
uint256 fraudNotifierRewardMultiplier
|
|
1310
1393
|
)
|
|
1311
1394
|
{
|
|
1395
|
+
fraudChallengeDepositAmount = self.fraudChallengeDepositAmount;
|
|
1396
|
+
fraudChallengeDefeatTimeout = self.fraudChallengeDefeatTimeout;
|
|
1312
1397
|
fraudSlashingAmount = self.fraudSlashingAmount;
|
|
1313
1398
|
fraudNotifierRewardMultiplier = self.fraudNotifierRewardMultiplier;
|
|
1314
|
-
fraudChallengeDefeatTimeout = self.fraudChallengeDefeatTimeout;
|
|
1315
|
-
fraudChallengeDepositAmount = self.fraudChallengeDepositAmount;
|
|
1316
1399
|
}
|
|
1317
1400
|
|
|
1318
1401
|
/// @notice Returns the addresses of contracts Bridge is interacting with.
|