-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathValidator.sol
More file actions
645 lines (548 loc) · 23.3 KB
/
Validator.sol
File metadata and controls
645 lines (548 loc) · 23.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
// SPDX-License-Identifier: MIT
// solhint-disable var-name-mixedcase
pragma solidity =0.8.30;
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {AccessControlUpgradeable} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {CommonTypes} from "filecoin-solidity/v0.8/types/CommonTypes.sol";
import {IFilecoinPayV1} from "./interfaces/IFilecoinPayV1.sol";
import {IValidator} from "./interfaces/IValidator.sol";
import {ISLIScorer} from "./interfaces/ISLIScorer.sol";
import {IPoRepMarket} from "./interfaces/IPoRepMarket.sol";
import {ISPRegistry} from "./interfaces/ISPRegistry.sol";
import {Operator} from "./abstracts/Operator.sol";
import {PoRepTypes} from "./types/PoRepTypes.sol";
import {Client} from "./Client.sol";
/**
* @title Validator
* @dev Implements validator and operator logic for managing Filecoin Pay rails
* @notice Validator contract for Filecoin Pay
*/
contract Validator is Initializable, AccessControlUpgradeable, IValidator, Operator {
/**
* @notice Error indicating that the caller is not the FilecoinPay contract
*/
error CallerIsNotFilecoinPay();
/**
* @notice Error indicating that the caller is not the Client Smart Contract
*/
error CallerIsNotClientSC();
/**
* @notice Error indicating that the admin address provided during initialization is the zero address
*/
error InvalidAdminAddress();
/**
* @notice Error indicating that the FilecoinPay address provided during initialization is the zero address
*/
error InvalidFilecoinPayAddress();
/**
* @notice Error indicating that the SLIScorer address provided during initialization is the zero address
*/
error InvalidSLIScorerAddress();
/**
* @notice Error indicating that the client smart contract address provided during initialization is the zero address
*/
error InvalidClientSCAddress();
/**
* @notice Error indicating that the PoRepMarket address provided during initialization is the zero address
*/
error InvalidPoRepMarketAddress();
/**
* @notice Error indicating that the PoRep service bot address provided during initialization is the zero address
*/
error InvalidPoRepServiceAddress();
/**
* @notice Error indicating that the SPRegistry address provided during initialization is the zero address
*/
error InvalidSPRegistryAddress();
/**
* @notice Error indicating that the caller is not the client
*/
error CallerIsNotClient();
/**
* @notice Error indicating that a payment rail has already been created for this validator
*/
error RailAlreadyCreated();
/**
* @notice Error indicating that an invalid deal ID was provided
*/
error InvalidDealId();
/**
* @notice Error indicating that the operator is not approved
*/
error OperatorNotApproved();
/**
* @notice Error indicating that the maximum lockup period is less than the minimum required lockup period
*/
error MaxLockupPeriodLessThanMinimum();
/**
* @notice Error indicating that the lockup allowance is not set properly
*/
error InvalidLockupAllowance();
/**
* @notice Error indicating that the rate allowance is not set properly
*/
error InvalidRateAllowance();
/**
* @notice Error indicating that the number of sectors in the deal is zero, which is invalid
*/
error InvalidSectorCount();
/**
* @notice Error indicating that the caller is not authorized to perform the action
*/
error UnauthorizedCaller();
/**
* @notice Error indicating that the provided end epoch is negative, which is invalid
*/
error NegativeEndEpoch();
/**
* @notice Error indicating that the calculated amount per epoch is zero, which is invalid
*/
error InvalidZeroAmount();
/**
* @notice Error indicating that the deal associated with this validator has not been completed yet
* @param dealId The ID of the deal that is not completed
*/
error DealNotCompleted(uint256 dealId);
/**
* @notice Error indicating that an invalid rail ID was provided
* @dev We expect only one rail ID to be valid for per validator
* @param expected The expected rail ID
* @param actual The actual rail ID provided in the function call
*/
error InvalidRailId(uint256 expected, uint256 actual);
/**
* @notice Error indicating that the minimum time between settlements is invalid
*/
error InvalidMinEpochsBetweenSettlements();
/**
* @notice Error indicating that the maximum time between settlements is exceeded
*/
error MinEpochsBetweenSettlementsExceeded();
// solhint-disable gas-indexed-events
/**
* @notice Event emitted when a payment rail is terminated
* @param railId The ID of the terminated rail
* @param terminator The address that initiated the termination
* @param endEpoch The Filecoin epoch at which the rail was terminated
*/
event RailTerminated(uint256 indexed railId, address indexed terminator, uint256 endEpoch);
/**
* @notice Event emitted when the lockup period of a rail is updated
* @param railId The ID of the rail
* @param newLockupPeriod The new lockup period for the rail
*/
event LockupPeriodUpdated(uint256 indexed railId, uint256 newLockupPeriod);
/**
* @notice Event emitted when the payment rate of a rail is modified
* @param railId The ID of the rail
* @param newRate The new payment rate for the rail
*/
event RailPaymentModified(uint256 indexed railId, uint256 newRate);
/**
* @notice Event emitted when the deal end epoch is updated
* @param dealId The ID of the deal
* @param endEpoch The Filecoin epoch at which the deal ended
*/
event DealEndEpochUpdated(uint256 indexed dealId, CommonTypes.ChainEpoch endEpoch);
/**
* @notice Event emitted when a rail is disabled for future payments
* @param railId The ID of the rail that has been disabled
*/
event RailDisabled(uint256 indexed railId);
/**
* @notice Event emitted when the minimum time between settlements is updated
* @param dealId The ID of the deal associated with the validator
* @param minTimeBetweenSettlementsInEpochs The new minimum time between settlements in epochs
*/
event MinEpochsBetweenSettlementsUpdated(uint256 indexed dealId, uint256 minTimeBetweenSettlementsInEpochs);
// solhint-enable gas-indexed-events
/// @custom:storage-location erc7201:porepmarket.storage.ValidatorStorage
struct ValidatorStorage {
uint256 railId;
uint256 dealId;
address filecoinPay;
address SLIScorer;
address clientSC;
address poRepMarket;
address SPRegistry;
CommonTypes.FilActorId providerId;
CommonTypes.ChainEpoch dealEndEpoch;
uint256 amountPerEpoch;
uint256 earlyTerminatedEpoch;
uint256 minTimeBetweenSettlementsInEpochs;
}
/**
* @notice Role for PoRep bot which is responsible for automating validator functions
*/
bytes32 public constant POREP_SERVICE_ROLE = keccak256("POREP_SERVICE_ROLE");
/**
* @notice Number of epochs in one month
* @dev 30 days * 24 hours/day * 60 minutes/hour * 2 epochs/minute = 86_400 epochs
*/
uint256 private constant EPOCHS_IN_MONTH = 86_400;
/**
* @notice Number of epochs in one year
* @dev 365 days * 24 hours/day * 60 minutes/hour * 2 epochs/minute = 1_051_200 epochs
*/
uint256 private constant EPOCHS_IN_YEAR = 1_051_200;
/**
* @notice Storage location for ValidatorStorage struct
* @dev keccak256(abi.encode(uint256(keccak256("porepmarket.storage.ValidatorStorage")) - 1)) & ~bytes32(uint256(0xff))
*/
bytes32 private constant VALIDATOR_STORAGE_LOCATION =
0xf51cddbeb47ca42a561371db80eaffa401732269b8af46b255e3f43a7c044000;
/**
* @notice Modifier to check that the provided rail ID is valid before executing the function
* @param railId The rail ID to validate
*/
modifier isRailIdValid(uint256 railId) {
_checkRailIdValid(railId);
_;
}
/**
* @notice Constructor
* @dev Constructor disables initializers
*/
constructor() {
_disableInitializers();
}
// solhint-disable func-param-name-mixedcase
/**
* @notice Initializes the contract
* @param _admin Address to be granted the default admin role
* @param _porepService Address of the PoRep service bot
* @param _filecoinPay Address of the FilecoinPay contract
* @param _SLIScorer Address of the SLIScorer contract
* @param _clientSC Address of the client smart contract
* @param _poRepMarket Address of the PoRepMarket contract
* @param _SPRegistry Address of the SPRegistry contract
* @param _dealId The ID of the deal for which this validator is being initialized
*/
function initialize(
address _admin,
address _porepService,
address _filecoinPay,
address _SLIScorer,
address _clientSC,
address _poRepMarket,
address _SPRegistry,
uint256 _dealId
) external initializer {
_validateInitializeAddresses(
_admin, _porepService, _filecoinPay, _SLIScorer, _clientSC, _SPRegistry, _poRepMarket
);
__AccessControl_init();
_grantRole(DEFAULT_ADMIN_ROLE, _admin);
_grantRole(POREP_SERVICE_ROLE, _porepService);
ValidatorStorage storage $ = _getValidatorStorage();
PoRepTypes.DealProposal memory dealProposal = IPoRepMarket(_poRepMarket).getDealProposal(_dealId);
$.providerId = dealProposal.provider;
$.filecoinPay = _filecoinPay;
$.SLIScorer = _SLIScorer;
$.clientSC = _clientSC;
$.poRepMarket = _poRepMarket;
$.SPRegistry = _SPRegistry;
$.dealId = _dealId;
$.minTimeBetweenSettlementsInEpochs = EPOCHS_IN_MONTH;
IPoRepMarket(_poRepMarket).updateValidator(_dealId);
}
// solhint-enable func-param-name-mixedcase
// solhint-disable function-max-lines, gas-strict-inequalities
/**
* @notice Validates a proposed payment amount for a payment rail
* @dev Only callable by the FilecoinPay contract
* @param railId ID of the payment rail
* @param proposedAmount Proposed payment amount to validate
* @param fromEpoch The epoch up to and including which the rail has already been settled
* @param toEpoch The epoch up to and including which validation is requested; payment will be validated for (toEpoch - fromEpoch) epochs
* @param rate Rate used for payment calculation
* @return result ValidationResult struct containing validation outcome
*/
function validatePayment(uint256 railId, uint256 proposedAmount, uint256 fromEpoch, uint256 toEpoch, uint256 rate)
external
returns (IValidator.ValidationResult memory result)
{
ValidatorStorage storage $ = _getValidatorStorage();
if (msg.sender != $.filecoinPay) {
revert CallerIsNotFilecoinPay();
}
_checkRailIdValid(railId);
// forge-lint: disable-next-line(unsafe-typecast)
uint256 dealEndEpoch = uint256(uint64(CommonTypes.ChainEpoch.unwrap($.dealEndEpoch)));
if (dealEndEpoch == 0) {
revert DealNotCompleted($.dealId);
}
if ($.earlyTerminatedEpoch != 0 && $.earlyTerminatedEpoch < dealEndEpoch) {
dealEndEpoch = $.earlyTerminatedEpoch;
}
if (toEpoch < fromEpoch + $.minTimeBetweenSettlementsInEpochs) {
result.settleUpto = fromEpoch;
result.note = "too early for settlement";
return result;
}
PoRepTypes.DealProposal memory dealProposal = IPoRepMarket($.poRepMarket).getDealProposal($.dealId);
uint256 score = ISLIScorer($.SLIScorer).calculateScore($.providerId, dealProposal.requirements);
bool scoreMatches = score == 100;
bool dataSizeMatches = Client($.clientSC).isDataSizeMatching($.dealId);
if (!scoreMatches || !dataSizeMatches) {
result.settleUpto = toEpoch;
result.note =
!scoreMatches ? "score below required threshold" : "data size does not match the deal proposal";
return result;
}
if (fromEpoch >= dealEndEpoch) {
result.settleUpto = fromEpoch;
result.note = "deal ended";
return result;
}
if (toEpoch > dealEndEpoch) {
result.modifiedAmount = rate * (dealEndEpoch - fromEpoch);
result.note = "payment limited to deal endepoch";
result.settleUpto = dealEndEpoch;
} else {
result.modifiedAmount = proposedAmount;
result.note = "payment validated successfully";
result.settleUpto = toEpoch;
}
}
// solhint-enable function-max-lines, gas-strict-inequalities
/**
* @notice Creates a payment rail with the specified parameters and set initial lockup period
* @dev Only callable by the client
* @dev Sets railID in contract state and updates the PoRepMarket with the created rail ID
* @param token The ERC20 token to use for the payment rail
*/
function createRail(IERC20 token) external override {
ValidatorStorage storage $ = _getValidatorStorage();
PoRepTypes.DealProposal memory dealProposal = IPoRepMarket($.poRepMarket).getDealProposal($.dealId);
if (msg.sender != dealProposal.client) {
revert CallerIsNotClient();
}
if ($.railId != 0) {
revert RailAlreadyCreated();
}
(bool isApproved, uint256 rateAllowance, uint256 lockupAllowance,,, uint256 maxLockupPeriod) =
IFilecoinPayV1($.filecoinPay).operatorApprovals(token, dealProposal.client, address(this));
if (!isApproved) {
revert OperatorNotApproved();
}
/// NOTE: to be discussed - might be shorter period than a month
if (maxLockupPeriod < EPOCHS_IN_MONTH) {
revert MaxLockupPeriodLessThanMinimum();
}
if (lockupAllowance == 0) {
revert InvalidLockupAllowance();
}
if (rateAllowance == 0) {
revert InvalidRateAllowance();
}
address payee = ISPRegistry($.SPRegistry).getPayee($.providerId);
uint256 railId = _createRail(IFilecoinPayV1($.filecoinPay), token, dealProposal.client, payee, 0, address(0));
$.railId = railId;
IPoRepMarket($.poRepMarket).updateRailId($.dealId, railId);
_setInitialLockup(railId, EPOCHS_IN_MONTH);
}
/**
* @notice Modifies the payment rate
* @dev Only callable by POREP_SERVICE bot
* @param railId The ID of the rail to modify
*/
function modifyRailPayment(uint256 railId) external override onlyRole(POREP_SERVICE_ROLE) isRailIdValid(railId) {
ValidatorStorage storage $ = _getValidatorStorage();
uint256 newRate = _calculateAmountPerEpoch();
$.amountPerEpoch = newRate;
_modifyRailPayment(IFilecoinPayV1($.filecoinPay), railId, newRate, 0);
emit RailPaymentModified(railId, newRate);
}
/**
* @notice Disables future payments for a payment rail by terminating the rail
* @dev Only callable by POREP_SERVICE bot
* @dev After calling this method, the lockup period cannot be changed, and the rail's rate and fixed lockup may only be reduced
* @param railId The ID of the rail to terminate
*/
function disableFutureRailPayments(uint256 railId) external onlyRole(POREP_SERVICE_ROLE) isRailIdValid(railId) {
ValidatorStorage storage $ = _getValidatorStorage();
$.earlyTerminatedEpoch = block.number;
_terminateRail(IFilecoinPayV1($.filecoinPay), railId);
emit RailDisabled(railId);
}
/**
* @notice Updates the lockup period of a payment rail
* @dev Only callable by the admin
* @param railId The ID of the rail to modify
* @param newLockupPeriod New lockup period to set
*/
function updateLockupPeriod(uint256 railId, uint256 newLockupPeriod)
external
override
onlyRole(DEFAULT_ADMIN_ROLE)
isRailIdValid(railId)
{
ValidatorStorage storage $ = _getValidatorStorage();
_updateLockupPeriod(IFilecoinPayV1($.filecoinPay), railId, newLockupPeriod, 0);
emit LockupPeriodUpdated(railId, newLockupPeriod);
}
/**
* @notice Terminates a payment rail, preventing further payments after the rail's lockup period. After calling this method, the lockup period cannot be changed, and the rail's rate and fixed lockup may only be reduced.
* @param railId The ID of the rail to terminate.
*/
function terminateRail(uint256 railId) external override isRailIdValid(railId) {
ValidatorStorage storage $ = _getValidatorStorage();
if (!hasRole(POREP_SERVICE_ROLE, msg.sender) && !hasRole(DEFAULT_ADMIN_ROLE, msg.sender)) {
revert UnauthorizedCaller();
}
_terminateRail(IFilecoinPayV1($.filecoinPay), railId);
}
/**
* @notice Invoked when a payment rail is terminated
* @dev Only callable by the FilecoinPay contract
* @param railId The ID of the terminated rail
* @param terminator Address that initiated the termination
* @param endEpoch Filecoin epoch at which the rail was terminated
*/
function railTerminated(uint256 railId, address terminator, uint256 endEpoch)
external
override
isRailIdValid(railId)
{
ValidatorStorage storage $ = _getValidatorStorage();
if (msg.sender != $.filecoinPay) {
revert CallerIsNotFilecoinPay();
}
IPoRepMarket($.poRepMarket).terminateDeal($.dealId, terminator, endEpoch);
emit RailTerminated(railId, terminator, endEpoch);
}
/**
* @notice Sets the end epoch for the deal associated with this validator
* @dev Only callable by POREP_SERVICE bot
* @param dealId The ID of the deal
* @param endEpoch The Filecoin epoch at which the deal ended
*/
function setDealEndEpoch(uint256 dealId, CommonTypes.ChainEpoch endEpoch) external onlyRole(POREP_SERVICE_ROLE) {
ValidatorStorage storage $ = _getValidatorStorage();
if (dealId != $.dealId) {
revert InvalidDealId();
}
int64 unwrappedEndEpoch = CommonTypes.ChainEpoch.unwrap(endEpoch);
if (unwrappedEndEpoch < 0) {
revert NegativeEndEpoch();
}
$.dealEndEpoch = endEpoch;
emit DealEndEpochUpdated(dealId, endEpoch);
}
/**
* @notice Sets the minimum time between settlements in epochs
* @dev Only callable by the admin
* @param minEpochs Minimum time between settlements in epochs
*/
function setMinEpochsBetweenSettlements(uint256 minEpochs) external onlyRole(DEFAULT_ADMIN_ROLE) {
if (minEpochs == 0) {
revert InvalidMinEpochsBetweenSettlements();
}
if (minEpochs > EPOCHS_IN_YEAR) {
revert MinEpochsBetweenSettlementsExceeded();
}
ValidatorStorage storage $ = _getValidatorStorage();
$.minTimeBetweenSettlementsInEpochs = minEpochs;
emit MinEpochsBetweenSettlementsUpdated($.dealId, minEpochs);
}
/**
* @notice Retrieves the minimum time between settlements in epochs
* @return minTimeBetweenSettlementsInEpochs Minimum time between settlements in epochs
*/
function getMinEpochsBetweenSettlements() external view returns (uint256 minTimeBetweenSettlementsInEpochs) {
minTimeBetweenSettlementsInEpochs = _getValidatorStorage().minTimeBetweenSettlementsInEpochs;
}
/**
* @notice Checks that the provided rail ID matches the expected rail ID stored in contract state
* @param railId The rail ID to validate
*/
function _checkRailIdValid(uint256 railId) internal view {
ValidatorStorage storage $ = _getValidatorStorage();
if (railId != $.railId) {
revert InvalidRailId({expected: $.railId, actual: railId});
}
}
/**
* @notice Sets the initial lockup period for a payment rail
* @param railId The ID of the rail for which to set the initial lockup period
* @param lockupPeriod The lockup period to set
*/
function _setInitialLockup(uint256 railId, uint256 lockupPeriod) internal {
ValidatorStorage storage $ = _getValidatorStorage();
_updateLockupPeriod(IFilecoinPayV1($.filecoinPay), railId, lockupPeriod, 0);
emit LockupPeriodUpdated(railId, lockupPeriod);
}
/**
* @notice Calculates the amount to be paid per epoch for the deal
* @return Amount to be paid per epoch
*/
function _calculateAmountPerEpoch() internal view returns (uint256) {
ValidatorStorage storage $ = _getValidatorStorage();
PoRepTypes.DealProposal memory dealProposal = IPoRepMarket($.poRepMarket).getDealProposal($.dealId);
CommonTypes.FilActorId[] memory allocationIds = Client($.clientSC).getClientAllocationIdsPerDeal($.dealId);
uint256 sectorCount = allocationIds.length;
uint256 pricePerSectorPerMonth = dealProposal.terms.pricePerSectorPerMonth;
if (sectorCount == 0) {
revert InvalidSectorCount();
}
uint256 amount = (pricePerSectorPerMonth * sectorCount) / EPOCHS_IN_MONTH;
if (amount == 0) {
revert InvalidZeroAmount();
}
return amount;
}
/**
* @notice Validates that the provided addresses for initialization are not zero addresses
* @param _admin Address to be granted the default admin role
* @param _porepService Address of the PoRep service bot
* @param _filecoinPay Address of the FilecoinPay contract
* @param _SLIScorer Address of the SLIScorer contract
* @param _clientSC Address of the client smart contract
* @param _SPRegistry Address of the SPRegistry contract
* @param _poRepMarket Address of the PoRepMarket contract
*/
function _validateInitializeAddresses(
address _admin,
address _porepService,
address _filecoinPay,
address _SLIScorer,
address _clientSC,
address _SPRegistry,
address _poRepMarket
) internal pure {
if (_admin == address(0)) {
revert InvalidAdminAddress();
}
if (_porepService == address(0)) {
revert InvalidPoRepServiceAddress();
}
if (_filecoinPay == address(0)) {
revert InvalidFilecoinPayAddress();
}
if (_SLIScorer == address(0)) {
revert InvalidSLIScorerAddress();
}
if (_clientSC == address(0)) {
revert InvalidClientSCAddress();
}
if (_SPRegistry == address(0)) {
revert InvalidSPRegistryAddress();
}
if (_poRepMarket == address(0)) {
revert InvalidPoRepMarketAddress();
}
}
// solhint-disable
/**
* @notice Retrieves the ValidatorStorage struct from the designated storage location
* @return $ Reference to the ValidatorStorage struct
*/
function _getValidatorStorage() private pure returns (ValidatorStorage storage $) {
assembly {
$.slot := VALIDATOR_STORAGE_LOCATION
}
}
// solhint-enable
}