@keep-network/tbtc-v2 0.1.1-dev.100 → 0.1.1-dev.101

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 (73) hide show
  1. package/artifacts/Bank.json +3 -3
  2. package/artifacts/Bridge.json +5 -5
  3. package/artifacts/BridgeGovernance.json +2931 -0
  4. package/artifacts/BridgeGovernanceParameters.json +1445 -0
  5. package/artifacts/Deposit.json +2 -2
  6. package/artifacts/DepositSweep.json +2 -2
  7. package/artifacts/EcdsaDkgValidator.json +1 -1
  8. package/artifacts/EcdsaInactivity.json +1 -1
  9. package/artifacts/EcdsaSortitionPool.json +2 -2
  10. package/artifacts/Fraud.json +2 -2
  11. package/artifacts/KeepRegistry.json +1 -1
  12. package/artifacts/KeepStake.json +2 -2
  13. package/artifacts/KeepToken.json +2 -2
  14. package/artifacts/KeepTokenStaking.json +1 -1
  15. package/artifacts/MovingFunds.json +2 -2
  16. package/artifacts/NuCypherStakingEscrow.json +1 -1
  17. package/artifacts/NuCypherToken.json +2 -2
  18. package/artifacts/RandomBeaconStub.json +1 -1
  19. package/artifacts/Redemption.json +2 -2
  20. package/artifacts/ReimbursementPool.json +2 -2
  21. package/artifacts/Relay.json +4 -4
  22. package/artifacts/T.json +2 -2
  23. package/artifacts/TBTC.json +3 -3
  24. package/artifacts/TBTCToken.json +3 -3
  25. package/artifacts/TBTCVault.json +9 -9
  26. package/artifacts/TokenStaking.json +1 -1
  27. package/artifacts/TokenholderGovernor.json +9 -9
  28. package/artifacts/TokenholderTimelock.json +8 -8
  29. package/artifacts/VendingMachine.json +10 -10
  30. package/artifacts/VendingMachineKeep.json +1 -1
  31. package/artifacts/VendingMachineNuCypher.json +1 -1
  32. package/artifacts/WalletRegistry.json +5 -5
  33. package/artifacts/WalletRegistryGovernance.json +2 -2
  34. package/artifacts/Wallets.json +2 -2
  35. package/artifacts/solcInputs/{8b65103759482b36742c6820fa66b63b.json → af641e0b3597cdfa29d6ad42d1cd8742.json} +6 -0
  36. package/build/contracts/GovernanceUtils.sol/GovernanceUtils.dbg.json +1 -1
  37. package/build/contracts/bank/Bank.sol/Bank.dbg.json +1 -1
  38. package/build/contracts/bank/IReceiveBalanceApproval.sol/IReceiveBalanceApproval.dbg.json +1 -1
  39. package/build/contracts/bridge/BitcoinTx.sol/BitcoinTx.dbg.json +1 -1
  40. package/build/contracts/bridge/Bridge.sol/Bridge.dbg.json +1 -1
  41. package/build/contracts/bridge/BridgeGovernance.sol/BridgeGovernance.dbg.json +4 -0
  42. package/build/contracts/bridge/BridgeGovernance.sol/BridgeGovernance.json +2246 -0
  43. package/build/contracts/bridge/BridgeGovernanceParameters.sol/BridgeGovernanceParameters.dbg.json +4 -0
  44. package/build/contracts/bridge/BridgeGovernanceParameters.sol/BridgeGovernanceParameters.json +971 -0
  45. package/build/contracts/bridge/BridgeState.sol/BridgeState.dbg.json +1 -1
  46. package/build/contracts/bridge/Deposit.sol/Deposit.dbg.json +1 -1
  47. package/build/contracts/bridge/DepositSweep.sol/DepositSweep.dbg.json +1 -1
  48. package/build/contracts/bridge/EcdsaLib.sol/EcdsaLib.dbg.json +1 -1
  49. package/build/contracts/bridge/Fraud.sol/Fraud.dbg.json +1 -1
  50. package/build/contracts/bridge/Heartbeat.sol/Heartbeat.dbg.json +1 -1
  51. package/build/contracts/bridge/IRelay.sol/IRelay.dbg.json +1 -1
  52. package/build/contracts/bridge/MovingFunds.sol/MovingFunds.dbg.json +1 -1
  53. package/build/contracts/bridge/Redemption.sol/OutboundTx.dbg.json +1 -1
  54. package/build/contracts/bridge/Redemption.sol/Redemption.dbg.json +1 -1
  55. package/build/contracts/bridge/VendingMachine.sol/VendingMachine.dbg.json +1 -1
  56. package/build/contracts/bridge/Wallets.sol/Wallets.dbg.json +1 -1
  57. package/build/contracts/token/TBTC.sol/TBTC.dbg.json +1 -1
  58. package/build/contracts/vault/DonationVault.sol/DonationVault.dbg.json +1 -1
  59. package/build/contracts/vault/IVault.sol/IVault.dbg.json +1 -1
  60. package/build/contracts/vault/TBTCVault.sol/TBTCVault.dbg.json +1 -1
  61. package/contracts/bridge/BridgeGovernance.sol +1533 -0
  62. package/contracts/bridge/BridgeGovernanceParameters.sol +1695 -0
  63. package/deploy/07_deploy_bridge_governance.ts +40 -0
  64. package/deploy/{07_bank_update_bridge.ts → 08_bank_update_bridge.ts} +0 -0
  65. package/deploy/{08_transfer_bank_ownership.ts → 09_transfer_bank_ownership.ts} +0 -0
  66. package/deploy/{09_transfer_tbtc_vault_ownership.ts → 10_transfer_tbtc_vault_ownership.ts} +0 -0
  67. package/deploy/11_transfer_bridge_governance_ownership.ts +19 -0
  68. package/deploy/{10_transfer_bridge_governance.ts → 12_transfer_bridge_governance.ts} +4 -2
  69. package/deploy/{11_initialize_wallet_owner.ts → 13_initialize_wallet_owner.ts} +0 -0
  70. package/deploy/{12_deploy_proxy_admin_with_deputy.ts → 14_deploy_proxy_admin_with_deputy.ts} +0 -0
  71. package/deploy/{11_transfer_proxy_admin_ownership.ts → 15_transfer_proxy_admin_ownership.ts} +0 -0
  72. package/export.json +2707 -0
  73. package/package.json +1 -1
@@ -0,0 +1,1695 @@
1
+ // SPDX-License-Identifier: MIT
2
+
3
+ // ██████████████ ▐████▌ ██████████████
4
+ // ██████████████ ▐████▌ ██████████████
5
+ // ▐████▌ ▐████▌
6
+ // ▐████▌ ▐████▌
7
+ // ██████████████ ▐████▌ ██████████████
8
+ // ██████████████ ▐████▌ ██████████████
9
+ // ▐████▌ ▐████▌
10
+ // ▐████▌ ▐████▌
11
+ // ▐████▌ ▐████▌
12
+ // ▐████▌ ▐████▌
13
+ // ▐████▌ ▐████▌
14
+ // ▐████▌ ▐████▌
15
+
16
+ pragma solidity ^0.8.9;
17
+
18
+ /// @title Bridge Governance library for storing updatable parameters.
19
+ library BridgeGovernanceParameters {
20
+ struct DepositData {
21
+ uint64 newDepositDustThreshold;
22
+ uint256 depositDustThresholdChangeInitiated;
23
+ uint64 newDepositTreasuryFeeDivisor;
24
+ uint256 depositTreasuryFeeDivisorChangeInitiated;
25
+ uint64 newDepositTxMaxFee;
26
+ uint256 depositTxMaxFeeChangeInitiated;
27
+ }
28
+
29
+ struct RedemptionData {
30
+ uint64 newRedemptionDustThreshold;
31
+ uint256 redemptionDustThresholdChangeInitiated;
32
+ uint64 newRedemptionTreasuryFeeDivisor;
33
+ uint256 redemptionTreasuryFeeDivisorChangeInitiated;
34
+ uint64 newRedemptionTxMaxFee;
35
+ uint256 redemptionTxMaxFeeChangeInitiated;
36
+ uint32 newRedemptionTimeout;
37
+ uint256 redemptionTimeoutChangeInitiated;
38
+ uint96 newRedemptionTimeoutSlashingAmount;
39
+ uint256 redemptionTimeoutSlashingAmountChangeInitiated;
40
+ uint32 newRedemptionTimeoutNotifierRewardMultiplier;
41
+ uint256 redemptionTimeoutNotifierRewardMultiplierChangeInitiated;
42
+ }
43
+
44
+ struct MovingFundsData {
45
+ uint64 newMovingFundsTxMaxTotalFee;
46
+ uint256 movingFundsTxMaxTotalFeeChangeInitiated;
47
+ uint64 newMovingFundsDustThreshold;
48
+ uint256 movingFundsDustThresholdChangeInitiated;
49
+ uint32 newMovingFundsTimeoutResetDelay;
50
+ uint256 movingFundsTimeoutResetDelayChangeInitiated;
51
+ uint32 newMovingFundsTimeout;
52
+ uint256 movingFundsTimeoutChangeInitiated;
53
+ uint96 newMovingFundsTimeoutSlashingAmount;
54
+ uint256 movingFundsTimeoutSlashingAmountChangeInitiated;
55
+ uint32 newMovingFundsTimeoutNotifierRewardMultiplier;
56
+ uint256 movingFundsTimeoutNotifierRewardMultiplierChangeInitiated;
57
+ uint64 newMovedFundsSweepTxMaxTotalFee;
58
+ uint256 movedFundsSweepTxMaxTotalFeeChangeInitiated;
59
+ uint32 newMovedFundsSweepTimeout;
60
+ uint256 movedFundsSweepTimeoutChangeInitiated;
61
+ uint96 newMovedFundsSweepTimeoutSlashingAmount;
62
+ uint256 movedFundsSweepTimeoutSlashingAmountChangeInitiated;
63
+ uint32 newMovedFundsSweepTimeoutNotifierRewardMultiplier;
64
+ uint256 movedFundsSweepTimeoutNotifierRewardMultiplierChangeInitiated;
65
+ }
66
+
67
+ struct WalletData {
68
+ uint32 newWalletCreationPeriod;
69
+ uint256 walletCreationPeriodChangeInitiated;
70
+ uint64 newWalletCreationMinBtcBalance;
71
+ uint256 walletCreationMinBtcBalanceChangeInitiated;
72
+ uint64 newWalletCreationMaxBtcBalance;
73
+ uint256 walletCreationMaxBtcBalanceChangeInitiated;
74
+ uint64 newWalletClosureMinBtcBalance;
75
+ uint256 walletClosureMinBtcBalanceChangeInitiated;
76
+ uint32 newWalletMaxAge;
77
+ uint256 walletMaxAgeChangeInitiated;
78
+ uint64 newWalletMaxBtcTransfer;
79
+ uint256 walletMaxBtcTransferChangeInitiated;
80
+ uint32 newWalletClosingPeriod;
81
+ uint256 walletClosingPeriodChangeInitiated;
82
+ }
83
+
84
+ struct FraudData {
85
+ uint96 newFraudChallengeDepositAmount;
86
+ uint256 fraudChallengeDepositAmountChangeInitiated;
87
+ uint32 newFraudChallengeDefeatTimeout;
88
+ uint256 fraudChallengeDefeatTimeoutChangeInitiated;
89
+ uint96 newFraudSlashingAmount;
90
+ uint256 fraudSlashingAmountChangeInitiated;
91
+ uint32 newFraudNotifierRewardMultiplier;
92
+ uint256 fraudNotifierRewardMultiplierChangeInitiated;
93
+ }
94
+
95
+ event DepositDustThresholdUpdateStarted(
96
+ uint64 newDepositDustThreshold,
97
+ uint256 timestamp
98
+ );
99
+ event DepositDustThresholdUpdated(uint64 depositDustThreshold);
100
+
101
+ event DepositTreasuryFeeDivisorUpdateStarted(
102
+ uint64 depositTreasuryFeeDivisor,
103
+ uint256 timestamp
104
+ );
105
+ event DepositTreasuryFeeDivisorUpdated(uint64 depositTreasuryFeeDivisor);
106
+
107
+ event DepositTxMaxFeeUpdateStarted(
108
+ uint64 newDepositTxMaxFee,
109
+ uint256 timestamp
110
+ );
111
+ event DepositTxMaxFeeUpdated(uint64 depositTxMaxFee);
112
+
113
+ event RedemptionDustThresholdUpdateStarted(
114
+ uint64 newRedemptionDustThreshold,
115
+ uint256 timestamp
116
+ );
117
+ event RedemptionDustThresholdUpdated(uint64 redemptionDustThreshold);
118
+
119
+ event RedemptionTreasuryFeeDivisorUpdateStarted(
120
+ uint64 newRedemptionTreasuryFeeDivisor,
121
+ uint256 timestamp
122
+ );
123
+ event RedemptionTreasuryFeeDivisorUpdated(
124
+ uint64 redemptionTreasuryFeeDivisor
125
+ );
126
+
127
+ event RedemptionTxMaxFeeUpdateStarted(
128
+ uint64 newRedemptionTxMaxFee,
129
+ uint256 timestamp
130
+ );
131
+ event RedemptionTxMaxFeeUpdated(uint64 redemptionTxMaxFee);
132
+
133
+ event RedemptionTimeoutUpdateStarted(
134
+ uint32 newRedemptionTimeout,
135
+ uint256 timestamp
136
+ );
137
+ event RedemptionTimeoutUpdated(uint32 redemptionTimeout);
138
+
139
+ event RedemptionTimeoutSlashingAmountUpdateStarted(
140
+ uint96 newRedemptionTimeoutSlashingAmount,
141
+ uint256 timestamp
142
+ );
143
+ event RedemptionTimeoutSlashingAmountUpdated(
144
+ uint96 redemptionTimeoutSlashingAmount
145
+ );
146
+
147
+ event RedemptionTimeoutNotifierRewardMultiplierUpdateStarted(
148
+ uint32 newRedemptionTimeoutNotifierRewardMultiplier,
149
+ uint256 timestamp
150
+ );
151
+ event RedemptionTimeoutNotifierRewardMultiplierUpdated(
152
+ uint32 redemptionTimeoutNotifierRewardMultiplier
153
+ );
154
+
155
+ event MovingFundsTxMaxTotalFeeUpdateStarted(
156
+ uint64 newMovingFundsTxMaxTotalFee,
157
+ uint256 timestamp
158
+ );
159
+ event MovingFundsTxMaxTotalFeeUpdated(uint64 movingFundsTxMaxTotalFee);
160
+
161
+ event MovingFundsDustThresholdUpdateStarted(
162
+ uint64 newMovingFundsDustThreshold,
163
+ uint256 timestamp
164
+ );
165
+ event MovingFundsDustThresholdUpdated(uint64 movingFundsDustThreshold);
166
+
167
+ event MovingFundsTimeoutResetDelayUpdateStarted(
168
+ uint32 newMovingFundsTimeoutResetDelay,
169
+ uint256 timestamp
170
+ );
171
+ event MovingFundsTimeoutResetDelayUpdated(
172
+ uint32 movingFundsTimeoutResetDelay
173
+ );
174
+
175
+ event MovingFundsTimeoutUpdateStarted(
176
+ uint32 newMovingFundsTimeout,
177
+ uint256 timestamp
178
+ );
179
+ event MovingFundsTimeoutUpdated(uint32 movingFundsTimeout);
180
+
181
+ event MovingFundsTimeoutSlashingAmountUpdateStarted(
182
+ uint96 newMovingFundsTimeoutSlashingAmount,
183
+ uint256 timestamp
184
+ );
185
+ event MovingFundsTimeoutSlashingAmountUpdated(
186
+ uint96 movingFundsTimeoutSlashingAmount
187
+ );
188
+
189
+ event MovingFundsTimeoutNotifierRewardMultiplierUpdateStarted(
190
+ uint32 newMovingFundsTimeoutNotifierRewardMultiplier,
191
+ uint256 timestamp
192
+ );
193
+ event MovingFundsTimeoutNotifierRewardMultiplierUpdated(
194
+ uint32 movingFundsTimeoutNotifierRewardMultiplier
195
+ );
196
+
197
+ event MovedFundsSweepTxMaxTotalFeeUpdateStarted(
198
+ uint64 newMovedFundsSweepTxMaxTotalFee,
199
+ uint256 timestamp
200
+ );
201
+ event MovedFundsSweepTxMaxTotalFeeUpdated(
202
+ uint64 movedFundsSweepTxMaxTotalFee
203
+ );
204
+
205
+ event MovedFundsSweepTimeoutUpdateStarted(
206
+ uint32 newMovedFundsSweepTimeout,
207
+ uint256 timestamp
208
+ );
209
+ event MovedFundsSweepTimeoutUpdated(uint32 movedFundsSweepTimeout);
210
+
211
+ event MovedFundsSweepTimeoutSlashingAmountUpdateStarted(
212
+ uint96 newMovedFundsSweepTimeoutSlashingAmount,
213
+ uint256 timestamp
214
+ );
215
+ event MovedFundsSweepTimeoutSlashingAmountUpdated(
216
+ uint96 movedFundsSweepTimeoutSlashingAmount
217
+ );
218
+
219
+ event MovedFundsSweepTimeoutNotifierRewardMultiplierUpdateStarted(
220
+ uint32 newMovedFundsSweepTimeoutNotifierRewardMultiplier,
221
+ uint256 timestamp
222
+ );
223
+ event MovedFundsSweepTimeoutNotifierRewardMultiplierUpdated(
224
+ uint32 movedFundsSweepTimeoutNotifierRewardMultiplier
225
+ );
226
+
227
+ event WalletCreationPeriodUpdateStarted(
228
+ uint32 newWalletCreationPeriod,
229
+ uint256 timestamp
230
+ );
231
+ event WalletCreationPeriodUpdated(uint32 walletCreationPeriod);
232
+
233
+ event WalletCreationMinBtcBalanceUpdateStarted(
234
+ uint64 newWalletCreationMinBtcBalance,
235
+ uint256 timestamp
236
+ );
237
+ event WalletCreationMinBtcBalanceUpdated(
238
+ uint64 walletCreationMinBtcBalance
239
+ );
240
+
241
+ event WalletCreationMaxBtcBalanceUpdateStarted(
242
+ uint64 newWalletCreationMaxBtcBalance,
243
+ uint256 timestamp
244
+ );
245
+ event WalletCreationMaxBtcBalanceUpdated(
246
+ uint64 walletCreationMaxBtcBalance
247
+ );
248
+
249
+ event WalletClosureMinBtcBalanceUpdateStarted(
250
+ uint64 newWalletClosureMinBtcBalance,
251
+ uint256 timestamp
252
+ );
253
+ event WalletClosureMinBtcBalanceUpdated(uint64 walletClosureMinBtcBalance);
254
+
255
+ event WalletMaxAgeUpdateStarted(uint32 newWalletMaxAge, uint256 timestamp);
256
+ event WalletMaxAgeUpdated(uint32 walletMaxAge);
257
+
258
+ event WalletMaxBtcTransferUpdateStarted(
259
+ uint64 newWalletMaxBtcTransfer,
260
+ uint256 timestamp
261
+ );
262
+ event WalletMaxBtcTransferUpdated(uint64 walletMaxBtcTransfer);
263
+
264
+ event WalletClosingPeriodUpdateStarted(
265
+ uint32 newWalletClosingPeriod,
266
+ uint256 timestamp
267
+ );
268
+ event WalletClosingPeriodUpdated(uint32 walletClosingPeriod);
269
+
270
+ event FraudChallengeDepositAmountUpdateStarted(
271
+ uint96 newFraudChallengeDepositAmount,
272
+ uint256 timestamp
273
+ );
274
+ event FraudChallengeDepositAmountUpdated(
275
+ uint96 fraudChallengeDepositAmount
276
+ );
277
+
278
+ event FraudChallengeDefeatTimeoutUpdateStarted(
279
+ uint32 newFraudChallengeDefeatTimeout,
280
+ uint256 timestamp
281
+ );
282
+ event FraudChallengeDefeatTimeoutUpdated(
283
+ uint32 fraudChallengeDefeatTimeout
284
+ );
285
+
286
+ event FraudSlashingAmountUpdateStarted(
287
+ uint96 newFraudSlashingAmount,
288
+ uint256 timestamp
289
+ );
290
+ event FraudSlashingAmountUpdated(uint96 fraudSlashingAmount);
291
+
292
+ event FraudNotifierRewardMultiplierUpdateStarted(
293
+ uint32 newFraudNotifierRewardMultiplier,
294
+ uint256 timestamp
295
+ );
296
+ event FraudNotifierRewardMultiplierUpdated(
297
+ uint32 fraudNotifierRewardMultiplier
298
+ );
299
+
300
+ /// @notice Reverts if called before the governance delay elapses.
301
+ /// @param changeInitiatedTimestamp Timestamp indicating the beginning
302
+ /// of the change.
303
+ modifier onlyAfterGovernanceDelay(
304
+ uint256 changeInitiatedTimestamp,
305
+ uint256 governanceDelay
306
+ ) {
307
+ /* solhint-disable not-rely-on-time */
308
+ require(changeInitiatedTimestamp > 0, "Change not initiated");
309
+ require(
310
+ block.timestamp - changeInitiatedTimestamp >= governanceDelay,
311
+ "Governance delay has not elapsed"
312
+ );
313
+ _;
314
+ /* solhint-enable not-rely-on-time */
315
+ }
316
+
317
+ // --- Deposit
318
+
319
+ /// @notice Begins the deposit dust threshold amount update process.
320
+ /// @dev Can be called only by the contract owner.
321
+ /// @param _newDepositDustThreshold New deposit dust threshold amount.
322
+ function beginDepositDustThresholdUpdate(
323
+ DepositData storage self,
324
+ uint64 _newDepositDustThreshold
325
+ ) external {
326
+ /* solhint-disable not-rely-on-time */
327
+ self.newDepositDustThreshold = _newDepositDustThreshold;
328
+ self.depositDustThresholdChangeInitiated = block.timestamp;
329
+ emit DepositDustThresholdUpdateStarted(
330
+ _newDepositDustThreshold,
331
+ block.timestamp
332
+ );
333
+ /* solhint-enable not-rely-on-time */
334
+ }
335
+
336
+ /// @notice Finalizes the deposit dust threshold amount update process.
337
+ /// @dev Can be called only by the contract owner, after the governance
338
+ /// delay elapses.
339
+ function finalizeDepositDustThresholdUpdate(
340
+ DepositData storage self,
341
+ uint256 governanceDelay
342
+ )
343
+ external
344
+ onlyAfterGovernanceDelay(
345
+ self.depositDustThresholdChangeInitiated,
346
+ governanceDelay
347
+ )
348
+ {
349
+ emit DepositDustThresholdUpdated(self.newDepositDustThreshold);
350
+
351
+ self.newDepositDustThreshold = 0;
352
+ self.depositDustThresholdChangeInitiated = 0;
353
+ }
354
+
355
+ function getNewDepositDustThreshold(DepositData storage self)
356
+ internal
357
+ view
358
+ returns (uint64)
359
+ {
360
+ return self.newDepositDustThreshold;
361
+ }
362
+
363
+ /// @notice Begins the deposit treasury fee divisor amount update process.
364
+ /// @dev Can be called only by the contract owner.
365
+ /// @param _newDepositTreasuryFeeDivisor New deposit treasury fee divisor amount.
366
+ function beginDepositTreasuryFeeDivisorUpdate(
367
+ DepositData storage self,
368
+ uint64 _newDepositTreasuryFeeDivisor
369
+ ) external {
370
+ /* solhint-disable not-rely-on-time */
371
+ self.newDepositTreasuryFeeDivisor = _newDepositTreasuryFeeDivisor;
372
+ self.depositTreasuryFeeDivisorChangeInitiated = block.timestamp;
373
+ emit DepositTreasuryFeeDivisorUpdateStarted(
374
+ _newDepositTreasuryFeeDivisor,
375
+ block.timestamp
376
+ );
377
+ /* solhint-enable not-rely-on-time */
378
+ }
379
+
380
+ /// @notice Finalizes the deposit treasury fee divisor amount update process.
381
+ /// @dev Can be called only by the contract owner, after the governance
382
+ /// delay elapses.
383
+ function finalizeDepositTreasuryFeeDivisorUpdate(
384
+ DepositData storage self,
385
+ uint256 governanceDelay
386
+ )
387
+ external
388
+ onlyAfterGovernanceDelay(
389
+ self.depositTreasuryFeeDivisorChangeInitiated,
390
+ governanceDelay
391
+ )
392
+ {
393
+ emit DepositTreasuryFeeDivisorUpdated(
394
+ self.newDepositTreasuryFeeDivisor
395
+ );
396
+
397
+ self.newDepositTreasuryFeeDivisor = 0;
398
+ self.depositTreasuryFeeDivisorChangeInitiated = 0;
399
+ }
400
+
401
+ function getNewDepositTreasuryFeeDivisor(DepositData storage self)
402
+ internal
403
+ view
404
+ returns (uint64)
405
+ {
406
+ return self.newDepositTreasuryFeeDivisor;
407
+ }
408
+
409
+ /// @notice Begins the deposit tx max fee amount update process.
410
+ /// @dev Can be called only by the contract owner.
411
+ /// @param _newDepositTxMaxFee New deposit tx max fee amount.
412
+ function beginDepositTxMaxFeeUpdate(
413
+ DepositData storage self,
414
+ uint64 _newDepositTxMaxFee
415
+ ) external {
416
+ /* solhint-disable not-rely-on-time */
417
+ self.newDepositTxMaxFee = _newDepositTxMaxFee;
418
+ self.depositTxMaxFeeChangeInitiated = block.timestamp;
419
+ emit DepositTxMaxFeeUpdateStarted(_newDepositTxMaxFee, block.timestamp);
420
+ /* solhint-enable not-rely-on-time */
421
+ }
422
+
423
+ /// @notice Finalizes the deposit tx max fee amount update process.
424
+ /// @dev Can be called only by the contract owner, after the governance
425
+ /// delay elapses.
426
+ function finalizeDepositTxMaxFeeUpdate(
427
+ DepositData storage self,
428
+ uint256 governanceDelay
429
+ )
430
+ external
431
+ onlyAfterGovernanceDelay(
432
+ self.depositTxMaxFeeChangeInitiated,
433
+ governanceDelay
434
+ )
435
+ {
436
+ emit DepositTxMaxFeeUpdated(self.newDepositTxMaxFee);
437
+
438
+ self.newDepositTxMaxFee = 0;
439
+ self.depositTxMaxFeeChangeInitiated = 0;
440
+ }
441
+
442
+ function getNewDepositTxMaxFee(DepositData storage self)
443
+ internal
444
+ view
445
+ returns (uint64)
446
+ {
447
+ return self.newDepositTxMaxFee;
448
+ }
449
+
450
+ // --- Redemption
451
+
452
+ /// @notice Begins the redemption dust threshold amount update process.
453
+ /// @dev Can be called only by the contract owner.
454
+ /// @param _newRedemptionDustThreshold New redemption dust threshold amount.
455
+ function beginRedemptionDustThresholdUpdate(
456
+ RedemptionData storage self,
457
+ uint64 _newRedemptionDustThreshold
458
+ ) external {
459
+ /* solhint-disable not-rely-on-time */
460
+ self.newRedemptionDustThreshold = _newRedemptionDustThreshold;
461
+ self.redemptionDustThresholdChangeInitiated = block.timestamp;
462
+ emit RedemptionDustThresholdUpdateStarted(
463
+ _newRedemptionDustThreshold,
464
+ block.timestamp
465
+ );
466
+ /* solhint-enable not-rely-on-time */
467
+ }
468
+
469
+ /// @notice Finalizes the redemption dust threshold amount update process.
470
+ /// @dev Can be called only by the contract owner, after the governance
471
+ /// delay elapses.
472
+ function finalizeRedemptionDustThresholdUpdate(
473
+ RedemptionData storage self,
474
+ uint256 governanceDelay
475
+ )
476
+ external
477
+ onlyAfterGovernanceDelay(
478
+ self.redemptionDustThresholdChangeInitiated,
479
+ governanceDelay
480
+ )
481
+ {
482
+ emit RedemptionDustThresholdUpdated(self.newRedemptionDustThreshold);
483
+
484
+ self.newRedemptionDustThreshold = 0;
485
+ self.redemptionDustThresholdChangeInitiated = 0;
486
+ }
487
+
488
+ function getNewRedemptionDustThreshold(RedemptionData storage self)
489
+ internal
490
+ view
491
+ returns (uint64)
492
+ {
493
+ return self.newRedemptionDustThreshold;
494
+ }
495
+
496
+ /// @notice Begins the redemption treasury fee divisor amount update process.
497
+ /// @dev Can be called only by the contract owner.
498
+ /// @param _newRedemptionTreasuryFeeDivisor New redemption treasury fee divisor
499
+ /// amount.
500
+ function beginRedemptionTreasuryFeeDivisorUpdate(
501
+ RedemptionData storage self,
502
+ uint64 _newRedemptionTreasuryFeeDivisor
503
+ ) external {
504
+ /* solhint-disable not-rely-on-time */
505
+ self.newRedemptionTreasuryFeeDivisor = _newRedemptionTreasuryFeeDivisor;
506
+ self.redemptionTreasuryFeeDivisorChangeInitiated = block.timestamp;
507
+ emit RedemptionTreasuryFeeDivisorUpdateStarted(
508
+ _newRedemptionTreasuryFeeDivisor,
509
+ block.timestamp
510
+ );
511
+ /* solhint-enable not-rely-on-time */
512
+ }
513
+
514
+ /// @notice Finalizes the redemption treasury fee divisor amount update process.
515
+ /// @dev Can be called only by the contract owner, after the governance
516
+ /// delay elapses.
517
+ function finalizeRedemptionTreasuryFeeDivisorUpdate(
518
+ RedemptionData storage self,
519
+ uint256 governanceDelay
520
+ )
521
+ external
522
+ onlyAfterGovernanceDelay(
523
+ self.redemptionTreasuryFeeDivisorChangeInitiated,
524
+ governanceDelay
525
+ )
526
+ {
527
+ emit RedemptionTreasuryFeeDivisorUpdated(
528
+ self.newRedemptionTreasuryFeeDivisor
529
+ );
530
+
531
+ self.newRedemptionTreasuryFeeDivisor = 0;
532
+ self.redemptionTreasuryFeeDivisorChangeInitiated = 0;
533
+ }
534
+
535
+ function getNewRedemptionTreasuryFeeDivisor(RedemptionData storage self)
536
+ internal
537
+ view
538
+ returns (uint64)
539
+ {
540
+ return self.newRedemptionTreasuryFeeDivisor;
541
+ }
542
+
543
+ /// @notice Begins the redemption tx max fee amount update process.
544
+ /// @dev Can be called only by the contract owner.
545
+ /// @param _newRedemptionTxMaxFee New redemption tx max fee amount.
546
+ function beginRedemptionTxMaxFeeUpdate(
547
+ RedemptionData storage self,
548
+ uint64 _newRedemptionTxMaxFee
549
+ ) external {
550
+ /* solhint-disable not-rely-on-time */
551
+ self.newRedemptionTxMaxFee = _newRedemptionTxMaxFee;
552
+ self.redemptionTxMaxFeeChangeInitiated = block.timestamp;
553
+ emit RedemptionTxMaxFeeUpdateStarted(
554
+ _newRedemptionTxMaxFee,
555
+ block.timestamp
556
+ );
557
+ /* solhint-enable not-rely-on-time */
558
+ }
559
+
560
+ /// @notice Finalizes the redemption tx max fee amount update process.
561
+ /// @dev Can be called only by the contract owner, after the governance
562
+ /// delay elapses.
563
+ function finalizeRedemptionTxMaxFeeUpdate(
564
+ RedemptionData storage self,
565
+ uint256 governanceDelay
566
+ )
567
+ external
568
+ onlyAfterGovernanceDelay(
569
+ self.redemptionTxMaxFeeChangeInitiated,
570
+ governanceDelay
571
+ )
572
+ {
573
+ emit RedemptionTxMaxFeeUpdated(self.newRedemptionTxMaxFee);
574
+
575
+ self.newRedemptionTxMaxFee = 0;
576
+ self.redemptionTxMaxFeeChangeInitiated = 0;
577
+ }
578
+
579
+ function getNewRedemptionTxMaxFee(RedemptionData storage self)
580
+ internal
581
+ view
582
+ returns (uint64)
583
+ {
584
+ return self.newRedemptionTxMaxFee;
585
+ }
586
+
587
+ /// @notice Begins the redemption timeout amount update process.
588
+ /// @dev Can be called only by the contract owner.
589
+ /// @param _newRedemptionTimeout New redemption timeout amount.
590
+ function beginRedemptionTimeoutUpdate(
591
+ RedemptionData storage self,
592
+ uint32 _newRedemptionTimeout
593
+ ) external {
594
+ /* solhint-disable not-rely-on-time */
595
+ self.newRedemptionTimeout = _newRedemptionTimeout;
596
+ self.redemptionTimeoutChangeInitiated = block.timestamp;
597
+ emit RedemptionTimeoutUpdateStarted(
598
+ _newRedemptionTimeout,
599
+ block.timestamp
600
+ );
601
+ /* solhint-enable not-rely-on-time */
602
+ }
603
+
604
+ /// @notice Finalizes the redemption timeout amount update
605
+ /// process.
606
+ /// @dev Can be called only by the contract owner, after the governance
607
+ /// delay elapses.
608
+ function finalizeRedemptionTimeoutUpdate(
609
+ RedemptionData storage self,
610
+ uint256 governanceDelay
611
+ )
612
+ external
613
+ onlyAfterGovernanceDelay(
614
+ self.redemptionTimeoutChangeInitiated,
615
+ governanceDelay
616
+ )
617
+ {
618
+ emit RedemptionTimeoutUpdated(self.newRedemptionTimeout);
619
+
620
+ self.newRedemptionTimeout = 0;
621
+ self.redemptionTimeoutChangeInitiated = 0;
622
+ }
623
+
624
+ function getNewRedemptionTimeout(RedemptionData storage self)
625
+ internal
626
+ view
627
+ returns (uint32)
628
+ {
629
+ return self.newRedemptionTimeout;
630
+ }
631
+
632
+ /// @notice Begins the redemption timeout slashing amount update process.
633
+ /// @dev Can be called only by the contract owner.
634
+ /// @param _newRedemptionTimeoutSlashingAmount New redemption timeout slashing
635
+ /// amount.
636
+ function beginRedemptionTimeoutSlashingAmountUpdate(
637
+ RedemptionData storage self,
638
+ uint96 _newRedemptionTimeoutSlashingAmount
639
+ ) external {
640
+ /* solhint-disable not-rely-on-time */
641
+ self
642
+ .newRedemptionTimeoutSlashingAmount = _newRedemptionTimeoutSlashingAmount;
643
+ self.redemptionTimeoutSlashingAmountChangeInitiated = block.timestamp;
644
+ emit RedemptionTimeoutSlashingAmountUpdateStarted(
645
+ _newRedemptionTimeoutSlashingAmount,
646
+ block.timestamp
647
+ );
648
+ /* solhint-enable not-rely-on-time */
649
+ }
650
+
651
+ /// @notice Finalizes the redemption timeout slashing amount update process.
652
+ /// @dev Can be called only by the contract owner, after the governance
653
+ /// delay elapses.
654
+ function finalizeRedemptionTimeoutSlashingAmountUpdate(
655
+ RedemptionData storage self,
656
+ uint256 governanceDelay
657
+ )
658
+ external
659
+ onlyAfterGovernanceDelay(
660
+ self.redemptionTimeoutSlashingAmountChangeInitiated,
661
+ governanceDelay
662
+ )
663
+ {
664
+ emit RedemptionTimeoutSlashingAmountUpdated(
665
+ self.newRedemptionTimeoutSlashingAmount
666
+ );
667
+
668
+ self.newRedemptionTimeoutSlashingAmount = 0;
669
+ self.redemptionTimeoutSlashingAmountChangeInitiated = 0;
670
+ }
671
+
672
+ function getNewRedemptionTimeoutSlashingAmount(RedemptionData storage self)
673
+ internal
674
+ view
675
+ returns (uint96)
676
+ {
677
+ return self.newRedemptionTimeoutSlashingAmount;
678
+ }
679
+
680
+ /// @notice Begins the redemption timeout notifier reward multiplier amount
681
+ /// update process.
682
+ /// @dev Can be called only by the contract owner.
683
+ /// @param _newRedemptionTimeoutNotifierRewardMultiplier New redemption
684
+ /// timeout notifier reward multiplier amount.
685
+ function beginRedemptionTimeoutNotifierRewardMultiplierUpdate(
686
+ RedemptionData storage self,
687
+ uint32 _newRedemptionTimeoutNotifierRewardMultiplier
688
+ ) internal {
689
+ /* solhint-disable not-rely-on-time */
690
+ self
691
+ .newRedemptionTimeoutNotifierRewardMultiplier = _newRedemptionTimeoutNotifierRewardMultiplier;
692
+ self.redemptionTimeoutNotifierRewardMultiplierChangeInitiated = block
693
+ .timestamp;
694
+ emit RedemptionTimeoutNotifierRewardMultiplierUpdateStarted(
695
+ _newRedemptionTimeoutNotifierRewardMultiplier,
696
+ block.timestamp
697
+ );
698
+ /* solhint-enable not-rely-on-time */
699
+ }
700
+
701
+ /// @notice Finalizes the redemption timeout notifier reward multiplier amount update process.
702
+ /// @dev Can be called only by the contract owner, after the governance
703
+ /// delay elapses.
704
+ function finalizeRedemptionTimeoutNotifierRewardMultiplierUpdate(
705
+ RedemptionData storage self,
706
+ uint256 governanceDelay
707
+ )
708
+ external
709
+ onlyAfterGovernanceDelay(
710
+ self.redemptionTimeoutNotifierRewardMultiplierChangeInitiated,
711
+ governanceDelay
712
+ )
713
+ {
714
+ emit RedemptionTimeoutNotifierRewardMultiplierUpdated(
715
+ self.newRedemptionTimeoutNotifierRewardMultiplier
716
+ );
717
+
718
+ self.newRedemptionTimeoutNotifierRewardMultiplier = 0;
719
+ self.redemptionTimeoutNotifierRewardMultiplierChangeInitiated = 0;
720
+ }
721
+
722
+ function getNewRedemptionTimeoutNotifierRewardMultiplier(
723
+ RedemptionData storage self
724
+ ) internal view returns (uint32) {
725
+ return self.newRedemptionTimeoutNotifierRewardMultiplier;
726
+ }
727
+
728
+ // --- Moving funds
729
+
730
+ /// @notice Begins the moving funds tx max total fee amount update process.
731
+ /// @dev Can be called only by the contract owner.
732
+ /// @param _newMovingFundsTxMaxTotalFee New moving funds tx max total fee amount.
733
+ function beginMovingFundsTxMaxTotalFeeUpdate(
734
+ MovingFundsData storage self,
735
+ uint64 _newMovingFundsTxMaxTotalFee
736
+ ) external {
737
+ /* solhint-disable not-rely-on-time */
738
+ self.newMovingFundsTxMaxTotalFee = _newMovingFundsTxMaxTotalFee;
739
+ self.movingFundsTxMaxTotalFeeChangeInitiated = block.timestamp;
740
+ emit MovingFundsTxMaxTotalFeeUpdateStarted(
741
+ _newMovingFundsTxMaxTotalFee,
742
+ block.timestamp
743
+ );
744
+ /* solhint-enable not-rely-on-time */
745
+ }
746
+
747
+ /// @notice Finalizes the moving funds tx max total fee amount update process.
748
+ /// @dev Can be called only by the contract owner, after the governance
749
+ /// delay elapses.
750
+ function finalizeMovingFundsTxMaxTotalFeeUpdate(
751
+ MovingFundsData storage self,
752
+ uint256 governanceDelay
753
+ )
754
+ external
755
+ onlyAfterGovernanceDelay(
756
+ self.movingFundsTxMaxTotalFeeChangeInitiated,
757
+ governanceDelay
758
+ )
759
+ {
760
+ emit MovingFundsTxMaxTotalFeeUpdated(self.newMovingFundsTxMaxTotalFee);
761
+
762
+ self.newMovingFundsTxMaxTotalFee = 0;
763
+ self.movingFundsTxMaxTotalFeeChangeInitiated = 0;
764
+ }
765
+
766
+ function getNewMovingFundsTxMaxTotalFee(MovingFundsData storage self)
767
+ internal
768
+ view
769
+ returns (uint64)
770
+ {
771
+ return self.newMovingFundsTxMaxTotalFee;
772
+ }
773
+
774
+ /// @notice Begins the moving funds dust threshold amount update process.
775
+ /// @dev Can be called only by the contract owner.
776
+ /// @param _newMovingFundsDustThreshold New moving funds dust threshold amount.
777
+ function beginMovingFundsDustThresholdUpdate(
778
+ MovingFundsData storage self,
779
+ uint64 _newMovingFundsDustThreshold
780
+ ) external {
781
+ /* solhint-disable not-rely-on-time */
782
+ self.newMovingFundsDustThreshold = _newMovingFundsDustThreshold;
783
+ self.movingFundsDustThresholdChangeInitiated = block.timestamp;
784
+ emit MovingFundsDustThresholdUpdateStarted(
785
+ _newMovingFundsDustThreshold,
786
+ block.timestamp
787
+ );
788
+ /* solhint-enable not-rely-on-time */
789
+ }
790
+
791
+ /// @notice Finalizes the moving funds dust threshold amount update process.
792
+ /// @dev Can be called only by the contract owner, after the governance
793
+ /// delay elapses.
794
+ function finalizeMovingFundsDustThresholdUpdate(
795
+ MovingFundsData storage self,
796
+ uint256 governanceDelay
797
+ )
798
+ external
799
+ onlyAfterGovernanceDelay(
800
+ self.movingFundsDustThresholdChangeInitiated,
801
+ governanceDelay
802
+ )
803
+ {
804
+ emit MovingFundsDustThresholdUpdated(self.newMovingFundsDustThreshold);
805
+
806
+ self.newMovingFundsDustThreshold = 0;
807
+ self.movingFundsDustThresholdChangeInitiated = 0;
808
+ }
809
+
810
+ function getNewMovingFundsDustThreshold(MovingFundsData storage self)
811
+ internal
812
+ view
813
+ returns (uint64)
814
+ {
815
+ return self.newMovingFundsDustThreshold;
816
+ }
817
+
818
+ /// @notice Begins the moving funds timeout reset delay amount update process.
819
+ /// @dev Can be called only by the contract owner.
820
+ /// @param _newMovingFundsTimeoutResetDelay New moving funds timeout reset
821
+ /// delay amount.
822
+ function beginMovingFundsTimeoutResetDelayUpdate(
823
+ MovingFundsData storage self,
824
+ uint32 _newMovingFundsTimeoutResetDelay
825
+ ) external {
826
+ /* solhint-disable not-rely-on-time */
827
+ self.newMovingFundsTimeoutResetDelay = _newMovingFundsTimeoutResetDelay;
828
+ self.movingFundsTimeoutResetDelayChangeInitiated = block.timestamp;
829
+ emit MovingFundsTimeoutResetDelayUpdateStarted(
830
+ _newMovingFundsTimeoutResetDelay,
831
+ block.timestamp
832
+ );
833
+ /* solhint-enable not-rely-on-time */
834
+ }
835
+
836
+ /// @notice Finalizes the moving funds timeout reset delay amount update process.
837
+ /// @dev Can be called only by the contract owner, after the governance
838
+ /// delay elapses.
839
+ function finalizeMovingFundsTimeoutResetDelayUpdate(
840
+ MovingFundsData storage self,
841
+ uint256 governanceDelay
842
+ )
843
+ external
844
+ onlyAfterGovernanceDelay(
845
+ self.movingFundsTimeoutResetDelayChangeInitiated,
846
+ governanceDelay
847
+ )
848
+ {
849
+ emit MovingFundsTimeoutResetDelayUpdated(
850
+ self.newMovingFundsTimeoutResetDelay
851
+ );
852
+
853
+ self.newMovingFundsTimeoutResetDelay = 0;
854
+ self.movingFundsTimeoutResetDelayChangeInitiated = 0;
855
+ }
856
+
857
+ function getNewMovingFundsTimeoutResetDelay(MovingFundsData storage self)
858
+ internal
859
+ view
860
+ returns (uint32)
861
+ {
862
+ return self.newMovingFundsTimeoutResetDelay;
863
+ }
864
+
865
+ /// @notice Begins the moving funds timeout amount update process.
866
+ /// @dev Can be called only by the contract owner.
867
+ /// @param _newMovingFundsTimeout New moving funds timeout amount.
868
+ function beginMovingFundsTimeoutUpdate(
869
+ MovingFundsData storage self,
870
+ uint32 _newMovingFundsTimeout
871
+ ) external {
872
+ /* solhint-disable not-rely-on-time */
873
+ self.newMovingFundsTimeout = _newMovingFundsTimeout;
874
+ self.movingFundsTimeoutChangeInitiated = block.timestamp;
875
+ emit MovingFundsTimeoutUpdateStarted(
876
+ _newMovingFundsTimeout,
877
+ block.timestamp
878
+ );
879
+ /* solhint-enable not-rely-on-time */
880
+ }
881
+
882
+ /// @notice Finalizes the moving funds timeout amount update process.
883
+ /// @dev Can be called only by the contract owner, after the governance
884
+ /// delay elapses.
885
+ function finalizeMovingFundsTimeoutUpdate(
886
+ MovingFundsData storage self,
887
+ uint256 governanceDelay
888
+ )
889
+ external
890
+ onlyAfterGovernanceDelay(
891
+ self.movingFundsTimeoutChangeInitiated,
892
+ governanceDelay
893
+ )
894
+ {
895
+ emit MovingFundsTimeoutUpdated(self.newMovingFundsTimeout);
896
+
897
+ self.newMovingFundsTimeout = 0;
898
+ self.movingFundsTimeoutChangeInitiated = 0;
899
+ }
900
+
901
+ function getNewMovingFundsTimeout(MovingFundsData storage self)
902
+ internal
903
+ view
904
+ returns (uint32)
905
+ {
906
+ return self.newMovingFundsTimeout;
907
+ }
908
+
909
+ /// @notice Begins the moving funds timeout slashing amount update process.
910
+ /// @dev Can be called only by the contract owner.
911
+ /// @param _newMovingFundsTimeoutSlashingAmount New moving funds timeout slashing amount.
912
+ function beginMovingFundsTimeoutSlashingAmountUpdate(
913
+ MovingFundsData storage self,
914
+ uint96 _newMovingFundsTimeoutSlashingAmount
915
+ ) external {
916
+ /* solhint-disable not-rely-on-time */
917
+ self
918
+ .newMovingFundsTimeoutSlashingAmount = _newMovingFundsTimeoutSlashingAmount;
919
+ self.movingFundsTimeoutSlashingAmountChangeInitiated = block.timestamp;
920
+ emit MovingFundsTimeoutSlashingAmountUpdateStarted(
921
+ _newMovingFundsTimeoutSlashingAmount,
922
+ block.timestamp
923
+ );
924
+ /* solhint-enable not-rely-on-time */
925
+ }
926
+
927
+ /// @notice Finalizes the moving funds timeout slashing amount update process.
928
+ /// @dev Can be called only by the contract owner, after the governance
929
+ /// delay elapses.
930
+ function finalizeMovingFundsTimeoutSlashingAmountUpdate(
931
+ MovingFundsData storage self,
932
+ uint256 governanceDelay
933
+ )
934
+ external
935
+ onlyAfterGovernanceDelay(
936
+ self.movingFundsTimeoutSlashingAmountChangeInitiated,
937
+ governanceDelay
938
+ )
939
+ {
940
+ emit MovingFundsTimeoutSlashingAmountUpdated(
941
+ self.newMovingFundsTimeoutSlashingAmount
942
+ );
943
+
944
+ self.newMovingFundsTimeoutSlashingAmount = 0;
945
+ self.movingFundsTimeoutSlashingAmountChangeInitiated = 0;
946
+ }
947
+
948
+ function getNewMovingFundsTimeoutSlashingAmount(
949
+ MovingFundsData storage self
950
+ ) external view returns (uint96) {
951
+ return self.newMovingFundsTimeoutSlashingAmount;
952
+ }
953
+
954
+ /// @notice Begins the moving funds timeout notifier reward multiplier amount
955
+ /// update process.
956
+ /// @dev Can be called only by the contract owner.
957
+ /// @param _newMovingFundsTimeoutNotifierRewardMultiplier New moving funds
958
+ /// timeout notifier reward multiplier amount.
959
+ function beginMovingFundsTimeoutNotifierRewardMultiplierUpdate(
960
+ MovingFundsData storage self,
961
+ uint32 _newMovingFundsTimeoutNotifierRewardMultiplier
962
+ ) external {
963
+ /* solhint-disable not-rely-on-time */
964
+ self
965
+ .newMovingFundsTimeoutNotifierRewardMultiplier = _newMovingFundsTimeoutNotifierRewardMultiplier;
966
+ self.movingFundsTimeoutNotifierRewardMultiplierChangeInitiated = block
967
+ .timestamp;
968
+ emit MovingFundsTimeoutNotifierRewardMultiplierUpdateStarted(
969
+ _newMovingFundsTimeoutNotifierRewardMultiplier,
970
+ block.timestamp
971
+ );
972
+ /* solhint-enable not-rely-on-time */
973
+ }
974
+
975
+ /// @notice Finalizes the moving funds timeout notifier reward multiplier
976
+ /// amount update process.
977
+ /// @dev Can be called only by the contract owner, after the governance
978
+ /// delay elapses.
979
+ function finalizeMovingFundsTimeoutNotifierRewardMultiplierUpdate(
980
+ MovingFundsData storage self,
981
+ uint256 governanceDelay
982
+ )
983
+ external
984
+ onlyAfterGovernanceDelay(
985
+ self.movingFundsTimeoutNotifierRewardMultiplierChangeInitiated,
986
+ governanceDelay
987
+ )
988
+ {
989
+ emit MovingFundsTimeoutNotifierRewardMultiplierUpdated(
990
+ self.newMovingFundsTimeoutNotifierRewardMultiplier
991
+ );
992
+
993
+ self.newMovingFundsTimeoutNotifierRewardMultiplier = 0;
994
+ self.movingFundsTimeoutNotifierRewardMultiplierChangeInitiated = 0;
995
+ }
996
+
997
+ function getNewMovingFundsTimeoutNotifierRewardMultiplier(
998
+ MovingFundsData storage self
999
+ ) internal view returns (uint32) {
1000
+ return self.newMovingFundsTimeoutNotifierRewardMultiplier;
1001
+ }
1002
+
1003
+ /// @notice Begins the moved funds sweep tx max total fee amount update process.
1004
+ /// @dev Can be called only by the contract owner.
1005
+ /// @param _newMovedFundsSweepTxMaxTotalFee New moved funds sweep tx max total
1006
+ /// fee amount.
1007
+ function beginMovedFundsSweepTxMaxTotalFeeUpdate(
1008
+ MovingFundsData storage self,
1009
+ uint64 _newMovedFundsSweepTxMaxTotalFee
1010
+ ) external {
1011
+ /* solhint-disable not-rely-on-time */
1012
+ self.newMovedFundsSweepTxMaxTotalFee = _newMovedFundsSweepTxMaxTotalFee;
1013
+ self.movedFundsSweepTxMaxTotalFeeChangeInitiated = block.timestamp;
1014
+ emit MovedFundsSweepTxMaxTotalFeeUpdateStarted(
1015
+ _newMovedFundsSweepTxMaxTotalFee,
1016
+ block.timestamp
1017
+ );
1018
+ /* solhint-enable not-rely-on-time */
1019
+ }
1020
+
1021
+ /// @notice Finalizes the moved funds sweep tx max total fee amount update
1022
+ /// process.
1023
+ /// @dev Can be called only by the contract owner, after the governance
1024
+ /// delay elapses.
1025
+ function finalizeMovedFundsSweepTxMaxTotalFeeUpdate(
1026
+ MovingFundsData storage self,
1027
+ uint256 governanceDelay
1028
+ )
1029
+ external
1030
+ onlyAfterGovernanceDelay(
1031
+ self.movedFundsSweepTxMaxTotalFeeChangeInitiated,
1032
+ governanceDelay
1033
+ )
1034
+ {
1035
+ emit MovedFundsSweepTxMaxTotalFeeUpdated(
1036
+ self.newMovedFundsSweepTxMaxTotalFee
1037
+ );
1038
+
1039
+ self.newMovedFundsSweepTxMaxTotalFee = 0;
1040
+ self.movedFundsSweepTxMaxTotalFeeChangeInitiated = 0;
1041
+ }
1042
+
1043
+ function getNewMovedFundsSweepTxMaxTotalFee(MovingFundsData storage self)
1044
+ internal
1045
+ view
1046
+ returns (uint64)
1047
+ {
1048
+ return self.newMovedFundsSweepTxMaxTotalFee;
1049
+ }
1050
+
1051
+ /// @notice Begins the moved funds sweep timeout amount update process.
1052
+ /// @dev Can be called only by the contract owner.
1053
+ /// @param _newMovedFundsSweepTimeout New moved funds sweep timeout amount.
1054
+ function beginMovedFundsSweepTimeoutUpdate(
1055
+ MovingFundsData storage self,
1056
+ uint32 _newMovedFundsSweepTimeout
1057
+ ) external {
1058
+ /* solhint-disable not-rely-on-time */
1059
+ self.newMovedFundsSweepTimeout = _newMovedFundsSweepTimeout;
1060
+ self.movedFundsSweepTimeoutChangeInitiated = block.timestamp;
1061
+ emit MovedFundsSweepTimeoutUpdateStarted(
1062
+ _newMovedFundsSweepTimeout,
1063
+ block.timestamp
1064
+ );
1065
+ /* solhint-enable not-rely-on-time */
1066
+ }
1067
+
1068
+ /// @notice Finalizes the moved funds sweep timeout amount update process.
1069
+ /// @dev Can be called only by the contract owner, after the governance
1070
+ /// delay elapses.
1071
+ function finalizeMovedFundsSweepTimeoutUpdate(
1072
+ MovingFundsData storage self,
1073
+ uint256 governanceDelay
1074
+ )
1075
+ external
1076
+ onlyAfterGovernanceDelay(
1077
+ self.movedFundsSweepTimeoutChangeInitiated,
1078
+ governanceDelay
1079
+ )
1080
+ {
1081
+ emit MovedFundsSweepTimeoutUpdated(self.newMovedFundsSweepTimeout);
1082
+
1083
+ self.newMovedFundsSweepTimeout = 0;
1084
+ self.movedFundsSweepTimeoutChangeInitiated = 0;
1085
+ }
1086
+
1087
+ function getNewMovedFundsSweepTimeout(MovingFundsData storage self)
1088
+ internal
1089
+ view
1090
+ returns (uint32)
1091
+ {
1092
+ return self.newMovedFundsSweepTimeout;
1093
+ }
1094
+
1095
+ /// @notice Begins the moved funds sweep timeout slashing amount update
1096
+ /// process.
1097
+ /// @dev Can be called only by the contract owner.
1098
+ /// @param _newMovedFundsSweepTimeoutSlashingAmount New moved funds sweep
1099
+ /// timeout slashing amount.
1100
+ function beginMovedFundsSweepTimeoutSlashingAmountUpdate(
1101
+ MovingFundsData storage self,
1102
+ uint96 _newMovedFundsSweepTimeoutSlashingAmount
1103
+ ) external {
1104
+ /* solhint-disable not-rely-on-time */
1105
+ self
1106
+ .newMovedFundsSweepTimeoutSlashingAmount = _newMovedFundsSweepTimeoutSlashingAmount;
1107
+ self.movedFundsSweepTimeoutSlashingAmountChangeInitiated = block
1108
+ .timestamp;
1109
+ emit MovedFundsSweepTimeoutSlashingAmountUpdateStarted(
1110
+ _newMovedFundsSweepTimeoutSlashingAmount,
1111
+ block.timestamp
1112
+ );
1113
+ /* solhint-enable not-rely-on-time */
1114
+ }
1115
+
1116
+ /// @notice Finalizes the moved funds sweep timeout slashing amount
1117
+ /// update process.
1118
+ /// @dev Can be called only by the contract owner, after the governance
1119
+ /// delay elapses.
1120
+ function finalizeMovedFundsSweepTimeoutSlashingAmountUpdate(
1121
+ MovingFundsData storage self,
1122
+ uint256 governanceDelay
1123
+ )
1124
+ external
1125
+ onlyAfterGovernanceDelay(
1126
+ self.movedFundsSweepTimeoutSlashingAmountChangeInitiated,
1127
+ governanceDelay
1128
+ )
1129
+ {
1130
+ emit MovedFundsSweepTimeoutSlashingAmountUpdated(
1131
+ self.newMovedFundsSweepTimeoutSlashingAmount
1132
+ );
1133
+
1134
+ self.newMovedFundsSweepTimeoutSlashingAmount = 0;
1135
+ self.movedFundsSweepTimeoutSlashingAmountChangeInitiated = 0;
1136
+ }
1137
+
1138
+ function getNewMovedFundsSweepTimeoutSlashingAmount(
1139
+ MovingFundsData storage self
1140
+ ) internal view returns (uint96) {
1141
+ return self.newMovedFundsSweepTimeoutSlashingAmount;
1142
+ }
1143
+
1144
+ /// @notice Begins the moved funds sweep timeout notifier reward multiplier
1145
+ /// amount update process.
1146
+ /// @dev Can be called only by the contract owner.
1147
+ /// @param _newMovedFundsSweepTimeoutNotifierRewardMultiplier New moved funds
1148
+ /// sweep timeout notifier reward multiplier amount.
1149
+ function beginMovedFundsSweepTimeoutNotifierRewardMultiplierUpdate(
1150
+ MovingFundsData storage self,
1151
+ uint32 _newMovedFundsSweepTimeoutNotifierRewardMultiplier
1152
+ ) external {
1153
+ /* solhint-disable not-rely-on-time */
1154
+ self
1155
+ .newMovedFundsSweepTimeoutNotifierRewardMultiplier = _newMovedFundsSweepTimeoutNotifierRewardMultiplier;
1156
+ self
1157
+ .movedFundsSweepTimeoutNotifierRewardMultiplierChangeInitiated = block
1158
+ .timestamp;
1159
+ emit MovedFundsSweepTimeoutNotifierRewardMultiplierUpdateStarted(
1160
+ _newMovedFundsSweepTimeoutNotifierRewardMultiplier,
1161
+ block.timestamp
1162
+ );
1163
+ /* solhint-enable not-rely-on-time */
1164
+ }
1165
+
1166
+ /// @notice Finalizes the moved funds sweep timeout notifier reward multiplier
1167
+ /// amount update process.
1168
+ /// @dev Can be called only by the contract owner, after the governance
1169
+ /// delay elapses.
1170
+ function finalizeMovedFundsSweepTimeoutNotifierRewardMultiplierUpdate(
1171
+ MovingFundsData storage self,
1172
+ uint256 governanceDelay
1173
+ )
1174
+ external
1175
+ onlyAfterGovernanceDelay(
1176
+ self.movedFundsSweepTimeoutNotifierRewardMultiplierChangeInitiated,
1177
+ governanceDelay
1178
+ )
1179
+ {
1180
+ emit MovedFundsSweepTimeoutNotifierRewardMultiplierUpdated(
1181
+ self.newMovedFundsSweepTimeoutNotifierRewardMultiplier
1182
+ );
1183
+
1184
+ self.newMovedFundsSweepTimeoutNotifierRewardMultiplier = 0;
1185
+ self.movedFundsSweepTimeoutNotifierRewardMultiplierChangeInitiated = 0;
1186
+ }
1187
+
1188
+ function getNewMovedFundsSweepTimeoutNotifierRewardMultiplier(
1189
+ MovingFundsData storage self
1190
+ ) internal view returns (uint32) {
1191
+ return self.newMovedFundsSweepTimeoutNotifierRewardMultiplier;
1192
+ }
1193
+
1194
+ // --- Wallet params
1195
+
1196
+ /// @notice Begins the wallet creation period amount update process.
1197
+ /// @dev Can be called only by the contract owner.
1198
+ /// @param _newWalletCreationPeriod New wallet creation period amount.
1199
+ function beginWalletCreationPeriodUpdate(
1200
+ WalletData storage self,
1201
+ uint32 _newWalletCreationPeriod
1202
+ ) external {
1203
+ /* solhint-disable not-rely-on-time */
1204
+ self.newWalletCreationPeriod = _newWalletCreationPeriod;
1205
+ self.walletCreationPeriodChangeInitiated = block.timestamp;
1206
+ emit WalletCreationPeriodUpdateStarted(
1207
+ _newWalletCreationPeriod,
1208
+ block.timestamp
1209
+ );
1210
+ /* solhint-enable not-rely-on-time */
1211
+ }
1212
+
1213
+ /// @notice Finalizes the wallet creation period amount update process.
1214
+ /// @dev Can be called only by the contract owner, after the governance
1215
+ /// delay elapses.
1216
+ function finalizeWalletCreationPeriodUpdate(
1217
+ WalletData storage self,
1218
+ uint256 governanceDelay
1219
+ )
1220
+ external
1221
+ onlyAfterGovernanceDelay(
1222
+ self.walletCreationPeriodChangeInitiated,
1223
+ governanceDelay
1224
+ )
1225
+ {
1226
+ emit WalletCreationPeriodUpdated(self.newWalletCreationPeriod);
1227
+
1228
+ self.newWalletCreationPeriod = 0;
1229
+ self.walletCreationPeriodChangeInitiated = 0;
1230
+ }
1231
+
1232
+ function getNewWalletCreationPeriod(WalletData storage self)
1233
+ external
1234
+ view
1235
+ returns (uint32)
1236
+ {
1237
+ return self.newWalletCreationPeriod;
1238
+ }
1239
+
1240
+ /// @notice Begins the wallet creation min btc balance amount update process.
1241
+ /// @dev Can be called only by the contract owner.
1242
+ /// @param _newWalletCreationMinBtcBalance New wallet creation min btc balance
1243
+ /// amount.
1244
+ function beginWalletCreationMinBtcBalanceUpdate(
1245
+ WalletData storage self,
1246
+ uint64 _newWalletCreationMinBtcBalance
1247
+ ) external {
1248
+ /* solhint-disable not-rely-on-time */
1249
+ self.newWalletCreationMinBtcBalance = _newWalletCreationMinBtcBalance;
1250
+ self.walletCreationMinBtcBalanceChangeInitiated = block.timestamp;
1251
+ emit WalletCreationMinBtcBalanceUpdateStarted(
1252
+ _newWalletCreationMinBtcBalance,
1253
+ block.timestamp
1254
+ );
1255
+ /* solhint-enable not-rely-on-time */
1256
+ }
1257
+
1258
+ /// @notice Finalizes the wallet creation min btc balance amount update process.
1259
+ /// @dev Can be called only by the contract owner, after the governance
1260
+ /// delay elapses.
1261
+ function finalizeWalletCreationMinBtcBalanceUpdate(
1262
+ WalletData storage self,
1263
+ uint256 governanceDelay
1264
+ )
1265
+ external
1266
+ onlyAfterGovernanceDelay(
1267
+ self.walletCreationMinBtcBalanceChangeInitiated,
1268
+ governanceDelay
1269
+ )
1270
+ {
1271
+ emit WalletCreationMinBtcBalanceUpdated(
1272
+ self.newWalletCreationMinBtcBalance
1273
+ );
1274
+
1275
+ self.newWalletCreationMinBtcBalance = 0;
1276
+ self.walletCreationMinBtcBalanceChangeInitiated = 0;
1277
+ }
1278
+
1279
+ function getNewWalletCreationMinBtcBalance(WalletData storage self)
1280
+ internal
1281
+ view
1282
+ returns (uint64)
1283
+ {
1284
+ return self.newWalletCreationMinBtcBalance;
1285
+ }
1286
+
1287
+ /// @notice Begins the wallet creation max btc balance amount update process.
1288
+ /// @dev Can be called only by the contract owner.
1289
+ /// @param _newWalletCreationMaxBtcBalance New wallet creation max btc balance
1290
+ /// amount.
1291
+ function beginWalletCreationMaxBtcBalanceUpdate(
1292
+ WalletData storage self,
1293
+ uint64 _newWalletCreationMaxBtcBalance
1294
+ ) external {
1295
+ /* solhint-disable not-rely-on-time */
1296
+ self.newWalletCreationMaxBtcBalance = _newWalletCreationMaxBtcBalance;
1297
+ self.walletCreationMaxBtcBalanceChangeInitiated = block.timestamp;
1298
+ emit WalletCreationMaxBtcBalanceUpdateStarted(
1299
+ _newWalletCreationMaxBtcBalance,
1300
+ block.timestamp
1301
+ );
1302
+ /* solhint-enable not-rely-on-time */
1303
+ }
1304
+
1305
+ /// @notice Finalizes the wallet creation max btc balance amount update process.
1306
+ /// @dev Can be called only by the contract owner, after the governance
1307
+ /// delay elapses.
1308
+ function finalizeWalletCreationMaxBtcBalanceUpdate(
1309
+ WalletData storage self,
1310
+ uint256 governanceDelay
1311
+ )
1312
+ external
1313
+ onlyAfterGovernanceDelay(
1314
+ self.walletCreationMaxBtcBalanceChangeInitiated,
1315
+ governanceDelay
1316
+ )
1317
+ {
1318
+ emit WalletCreationMaxBtcBalanceUpdated(
1319
+ self.newWalletCreationMaxBtcBalance
1320
+ );
1321
+
1322
+ self.newWalletCreationMaxBtcBalance = 0;
1323
+ self.walletCreationMaxBtcBalanceChangeInitiated = 0;
1324
+ }
1325
+
1326
+ function getNewWalletCreationMaxBtcBalance(WalletData storage self)
1327
+ internal
1328
+ view
1329
+ returns (uint64)
1330
+ {
1331
+ return self.newWalletCreationMaxBtcBalance;
1332
+ }
1333
+
1334
+ /// @notice Begins the wallet closure min btc balance amount update process.
1335
+ /// @dev Can be called only by the contract owner.
1336
+ /// @param _newWalletClosureMinBtcBalance New wallet closure min btc balance amount.
1337
+ function beginWalletClosureMinBtcBalanceUpdate(
1338
+ WalletData storage self,
1339
+ uint64 _newWalletClosureMinBtcBalance
1340
+ ) external {
1341
+ /* solhint-disable not-rely-on-time */
1342
+ self.newWalletClosureMinBtcBalance = _newWalletClosureMinBtcBalance;
1343
+ self.walletClosureMinBtcBalanceChangeInitiated = block.timestamp;
1344
+ emit WalletClosureMinBtcBalanceUpdateStarted(
1345
+ _newWalletClosureMinBtcBalance,
1346
+ block.timestamp
1347
+ );
1348
+ /* solhint-enable not-rely-on-time */
1349
+ }
1350
+
1351
+ /// @notice Finalizes the wallet closure min btc balance amount update process.
1352
+ /// @dev Can be called only by the contract owner, after the governance
1353
+ /// delay elapses.
1354
+ function finalizeWalletClosureMinBtcBalanceUpdate(
1355
+ WalletData storage self,
1356
+ uint256 governanceDelay
1357
+ )
1358
+ external
1359
+ onlyAfterGovernanceDelay(
1360
+ self.walletClosureMinBtcBalanceChangeInitiated,
1361
+ governanceDelay
1362
+ )
1363
+ {
1364
+ emit WalletClosureMinBtcBalanceUpdated(
1365
+ self.newWalletClosureMinBtcBalance
1366
+ );
1367
+
1368
+ self.newWalletClosureMinBtcBalance = 0;
1369
+ self.walletClosureMinBtcBalanceChangeInitiated = 0;
1370
+ }
1371
+
1372
+ function getNewWalletClosureMinBtcBalance(WalletData storage self)
1373
+ internal
1374
+ view
1375
+ returns (uint64)
1376
+ {
1377
+ return self.newWalletClosureMinBtcBalance;
1378
+ }
1379
+
1380
+ /// @notice Begins the wallet max age amount update process.
1381
+ /// @dev Can be called only by the contract owner.
1382
+ /// @param _newWalletMaxAge New wallet max age amount.
1383
+ function beginWalletMaxAgeUpdate(
1384
+ WalletData storage self,
1385
+ uint32 _newWalletMaxAge
1386
+ ) external {
1387
+ /* solhint-disable not-rely-on-time */
1388
+ self.newWalletMaxAge = _newWalletMaxAge;
1389
+ self.walletMaxAgeChangeInitiated = block.timestamp;
1390
+ emit WalletMaxAgeUpdateStarted(_newWalletMaxAge, block.timestamp);
1391
+ /* solhint-enable not-rely-on-time */
1392
+ }
1393
+
1394
+ /// @notice Finalizes the wallet max age amount update process.
1395
+ /// @dev Can be called only by the contract owner, after the governance
1396
+ /// delay elapses.
1397
+ function finalizeWalletMaxAgeUpdate(
1398
+ WalletData storage self,
1399
+ uint256 governanceDelay
1400
+ )
1401
+ external
1402
+ onlyAfterGovernanceDelay(
1403
+ self.walletMaxAgeChangeInitiated,
1404
+ governanceDelay
1405
+ )
1406
+ {
1407
+ emit WalletMaxAgeUpdated(self.newWalletMaxAge);
1408
+
1409
+ self.newWalletMaxAge = 0;
1410
+ self.walletMaxAgeChangeInitiated = 0;
1411
+ }
1412
+
1413
+ function getNewWalletMaxAge(WalletData storage self)
1414
+ internal
1415
+ view
1416
+ returns (uint32)
1417
+ {
1418
+ return self.newWalletMaxAge;
1419
+ }
1420
+
1421
+ /// @notice Begins the wallet max btc transfer amount update process.
1422
+ /// @dev Can be called only by the contract owner.
1423
+ /// @param _newWalletMaxBtcTransfer New wallet max btc transfer amount.
1424
+ function beginWalletMaxBtcTransferUpdate(
1425
+ WalletData storage self,
1426
+ uint64 _newWalletMaxBtcTransfer
1427
+ ) external {
1428
+ /* solhint-disable not-rely-on-time */
1429
+ self.newWalletMaxBtcTransfer = _newWalletMaxBtcTransfer;
1430
+ self.walletMaxBtcTransferChangeInitiated = block.timestamp;
1431
+ emit WalletMaxBtcTransferUpdateStarted(
1432
+ _newWalletMaxBtcTransfer,
1433
+ block.timestamp
1434
+ );
1435
+ /* solhint-enable not-rely-on-time */
1436
+ }
1437
+
1438
+ /// @notice Finalizes the wallet max btc transfer amount update process.
1439
+ /// @dev Can be called only by the contract owner, after the governance
1440
+ /// delay elapses.
1441
+ function finalizeWalletMaxBtcTransferUpdate(
1442
+ WalletData storage self,
1443
+ uint256 governanceDelay
1444
+ )
1445
+ external
1446
+ onlyAfterGovernanceDelay(
1447
+ self.walletMaxBtcTransferChangeInitiated,
1448
+ governanceDelay
1449
+ )
1450
+ {
1451
+ emit WalletMaxBtcTransferUpdated(self.newWalletMaxBtcTransfer);
1452
+
1453
+ self.newWalletMaxBtcTransfer = 0;
1454
+ self.walletMaxBtcTransferChangeInitiated = 0;
1455
+ }
1456
+
1457
+ function getNewWalletMaxBtcTransfer(WalletData storage self)
1458
+ internal
1459
+ view
1460
+ returns (uint64)
1461
+ {
1462
+ return self.newWalletMaxBtcTransfer;
1463
+ }
1464
+
1465
+ /// @notice Begins the wallet closing period amount update process.
1466
+ /// @dev Can be called only by the contract owner.
1467
+ /// @param _newWalletClosingPeriod New wallet closing period amount.
1468
+ function beginWalletClosingPeriodUpdate(
1469
+ WalletData storage self,
1470
+ uint32 _newWalletClosingPeriod
1471
+ ) external {
1472
+ /* solhint-disable not-rely-on-time */
1473
+ self.newWalletClosingPeriod = _newWalletClosingPeriod;
1474
+ self.walletClosingPeriodChangeInitiated = block.timestamp;
1475
+ emit WalletClosingPeriodUpdateStarted(
1476
+ _newWalletClosingPeriod,
1477
+ block.timestamp
1478
+ );
1479
+ /* solhint-enable not-rely-on-time */
1480
+ }
1481
+
1482
+ /// @notice Finalizes the wallet closing period amount update process.
1483
+ /// @dev Can be called only by the contract owner, after the governance
1484
+ /// delay elapses.
1485
+ function finalizeWalletClosingPeriodUpdate(
1486
+ WalletData storage self,
1487
+ uint256 governanceDelay
1488
+ )
1489
+ external
1490
+ onlyAfterGovernanceDelay(
1491
+ self.walletClosingPeriodChangeInitiated,
1492
+ governanceDelay
1493
+ )
1494
+ {
1495
+ emit WalletClosingPeriodUpdated(self.newWalletClosingPeriod);
1496
+
1497
+ self.newWalletClosingPeriod = 0;
1498
+ self.walletClosingPeriodChangeInitiated = 0;
1499
+ }
1500
+
1501
+ function getNewWalletClosingPeriod(WalletData storage self)
1502
+ internal
1503
+ view
1504
+ returns (uint32)
1505
+ {
1506
+ return self.newWalletClosingPeriod;
1507
+ }
1508
+
1509
+ // --- Fraud
1510
+
1511
+ /// @notice Begins the fraud challenge deposit amount update process.
1512
+ /// @dev Can be called only by the contract owner.
1513
+ /// @param _newFraudChallengeDepositAmount New fraud challenge deposit amount.
1514
+ function beginFraudChallengeDepositAmountUpdate(
1515
+ FraudData storage self,
1516
+ uint96 _newFraudChallengeDepositAmount
1517
+ ) external {
1518
+ /* solhint-disable not-rely-on-time */
1519
+ self.newFraudChallengeDepositAmount = _newFraudChallengeDepositAmount;
1520
+ self.fraudChallengeDepositAmountChangeInitiated = block.timestamp;
1521
+ emit FraudChallengeDepositAmountUpdateStarted(
1522
+ _newFraudChallengeDepositAmount,
1523
+ block.timestamp
1524
+ );
1525
+ /* solhint-enable not-rely-on-time */
1526
+ }
1527
+
1528
+ /// @notice Finalizes the fraud challenge deposit amount update process.
1529
+ /// @dev Can be called only by the contract owner, after the governance
1530
+ /// delay elapses.
1531
+ function finalizeFraudChallengeDepositAmountUpdate(
1532
+ FraudData storage self,
1533
+ uint256 governanceDelay
1534
+ )
1535
+ external
1536
+ onlyAfterGovernanceDelay(
1537
+ self.fraudChallengeDepositAmountChangeInitiated,
1538
+ governanceDelay
1539
+ )
1540
+ {
1541
+ emit FraudChallengeDepositAmountUpdated(
1542
+ self.newFraudChallengeDepositAmount
1543
+ );
1544
+
1545
+ self.newFraudChallengeDepositAmount = 0;
1546
+ self.fraudChallengeDepositAmountChangeInitiated = 0;
1547
+ }
1548
+
1549
+ function getNewFraudChallengeDepositAmount(FraudData storage self)
1550
+ internal
1551
+ view
1552
+ returns (uint96)
1553
+ {
1554
+ return self.newFraudChallengeDepositAmount;
1555
+ }
1556
+
1557
+ /// @notice Begins the fraud challenge defeat timeout amount update process.
1558
+ /// @dev Can be called only by the contract owner.
1559
+ /// @param _newFraudChallengeDefeatTimeout New fraud challenge defeat timeout
1560
+ /// amount.
1561
+ function beginFraudChallengeDefeatTimeoutUpdate(
1562
+ FraudData storage self,
1563
+ uint32 _newFraudChallengeDefeatTimeout
1564
+ ) external {
1565
+ /* solhint-disable not-rely-on-time */
1566
+ self.newFraudChallengeDefeatTimeout = _newFraudChallengeDefeatTimeout;
1567
+ self.fraudChallengeDefeatTimeoutChangeInitiated = block.timestamp;
1568
+ emit FraudChallengeDefeatTimeoutUpdateStarted(
1569
+ _newFraudChallengeDefeatTimeout,
1570
+ block.timestamp
1571
+ );
1572
+ /* solhint-enable not-rely-on-time */
1573
+ }
1574
+
1575
+ /// @notice Finalizes the fraud challenge defeat timeout amount update process.
1576
+ /// @dev Can be called only by the contract owner, after the governance
1577
+ /// delay elapses.
1578
+ function finalizeFraudChallengeDefeatTimeoutUpdate(
1579
+ FraudData storage self,
1580
+ uint256 governanceDelay
1581
+ )
1582
+ external
1583
+ onlyAfterGovernanceDelay(
1584
+ self.fraudChallengeDefeatTimeoutChangeInitiated,
1585
+ governanceDelay
1586
+ )
1587
+ {
1588
+ emit FraudChallengeDefeatTimeoutUpdated(
1589
+ self.newFraudChallengeDefeatTimeout
1590
+ );
1591
+
1592
+ self.newFraudChallengeDefeatTimeout = 0;
1593
+ self.fraudChallengeDefeatTimeoutChangeInitiated = 0;
1594
+ }
1595
+
1596
+ function getNewFraudChallengeDefeatTimeout(FraudData storage self)
1597
+ internal
1598
+ view
1599
+ returns (uint32)
1600
+ {
1601
+ return self.newFraudChallengeDefeatTimeout;
1602
+ }
1603
+
1604
+ /// @notice Begins the fraud slashing amount update process.
1605
+ /// @dev Can be called only by the contract owner.
1606
+ /// @param _newFraudSlashingAmount New fraud slashing amount.
1607
+ function beginFraudSlashingAmountUpdate(
1608
+ FraudData storage self,
1609
+ uint96 _newFraudSlashingAmount
1610
+ ) external {
1611
+ /* solhint-disable not-rely-on-time */
1612
+ self.newFraudSlashingAmount = _newFraudSlashingAmount;
1613
+ self.fraudSlashingAmountChangeInitiated = block.timestamp;
1614
+ emit FraudSlashingAmountUpdateStarted(
1615
+ _newFraudSlashingAmount,
1616
+ block.timestamp
1617
+ );
1618
+ /* solhint-enable not-rely-on-time */
1619
+ }
1620
+
1621
+ /// @notice Finalizes the fraud slashing amount update process.
1622
+ /// @dev Can be called only by the contract owner, after the governance
1623
+ /// delay elapses.
1624
+ function finalizeFraudSlashingAmountUpdate(
1625
+ FraudData storage self,
1626
+ uint256 governanceDelay
1627
+ )
1628
+ external
1629
+ onlyAfterGovernanceDelay(
1630
+ self.fraudSlashingAmountChangeInitiated,
1631
+ governanceDelay
1632
+ )
1633
+ {
1634
+ emit FraudSlashingAmountUpdated(self.newFraudSlashingAmount);
1635
+
1636
+ self.newFraudSlashingAmount = 0;
1637
+ self.fraudSlashingAmountChangeInitiated = 0;
1638
+ }
1639
+
1640
+ function getNewFraudSlashingAmount(FraudData storage self)
1641
+ internal
1642
+ view
1643
+ returns (uint96)
1644
+ {
1645
+ return self.newFraudSlashingAmount;
1646
+ }
1647
+
1648
+ /// @notice Begins the fraud notifier reward multiplier amount update process.
1649
+ /// @dev Can be called only by the contract owner.
1650
+ /// @param _newFraudNotifierRewardMultiplier New fraud notifier reward multiplier
1651
+ /// amount.
1652
+ function beginFraudNotifierRewardMultiplierUpdate(
1653
+ FraudData storage self,
1654
+ uint32 _newFraudNotifierRewardMultiplier
1655
+ ) external {
1656
+ /* solhint-disable not-rely-on-time */
1657
+ self
1658
+ .newFraudNotifierRewardMultiplier = _newFraudNotifierRewardMultiplier;
1659
+ self.fraudNotifierRewardMultiplierChangeInitiated = block.timestamp;
1660
+ emit FraudNotifierRewardMultiplierUpdateStarted(
1661
+ _newFraudNotifierRewardMultiplier,
1662
+ block.timestamp
1663
+ );
1664
+ /* solhint-enable not-rely-on-time */
1665
+ }
1666
+
1667
+ /// @notice Finalizes the fraud notifier reward multiplier amount update process.
1668
+ /// @dev Can be called only by the contract owner, after the governance
1669
+ /// delay elapses.
1670
+ function finalizeFraudNotifierRewardMultiplierUpdate(
1671
+ FraudData storage self,
1672
+ uint256 governanceDelay
1673
+ )
1674
+ external
1675
+ onlyAfterGovernanceDelay(
1676
+ self.fraudNotifierRewardMultiplierChangeInitiated,
1677
+ governanceDelay
1678
+ )
1679
+ {
1680
+ emit FraudNotifierRewardMultiplierUpdated(
1681
+ self.newFraudNotifierRewardMultiplier
1682
+ );
1683
+
1684
+ self.newFraudNotifierRewardMultiplier = 0;
1685
+ self.fraudNotifierRewardMultiplierChangeInitiated = 0;
1686
+ }
1687
+
1688
+ function getNewFraudNotifierRewardMultiplier(FraudData storage self)
1689
+ internal
1690
+ view
1691
+ returns (uint32)
1692
+ {
1693
+ return self.newFraudNotifierRewardMultiplier;
1694
+ }
1695
+ }