@hyperlane-xyz/core 3.13.0-next.0 → 3.13.0
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/contracts/avs/ECDSAStakeRegistry.sol +119 -29
- package/contracts/avs/ECDSAStakeRegistryStorage.sol +5 -1
- package/contracts/interfaces/avs/vendored/IECDSAStakeRegistryEventsAndErrors.sol +15 -2
- package/contracts/token/extensions/HypXERC20Lockbox.sol +8 -2
- package/contracts/token/libs/TokenMessage.sol +0 -7
- package/dist/buildArtifact.js +1 -1
- package/dist/buildArtifact.json +1 -1
- package/dist/contracts/avs/ECDSAStakeRegistry.d.ts +94 -15
- package/dist/contracts/avs/ECDSAStakeRegistry.d.ts.map +1 -1
- package/dist/contracts/avs/ECDSAStakeRegistryStorage.d.ts +18 -0
- package/dist/contracts/avs/ECDSAStakeRegistryStorage.d.ts.map +1 -1
- package/dist/contracts/interfaces/avs/vendored/IECDSAStakeRegistryEventsAndErrors.d.ts +18 -0
- package/dist/contracts/interfaces/avs/vendored/IECDSAStakeRegistryEventsAndErrors.d.ts.map +1 -1
- package/dist/factories/contracts/avs/ECDSAStakeRegistryStorage__factory.d.ts +29 -0
- package/dist/factories/contracts/avs/ECDSAStakeRegistryStorage__factory.d.ts.map +1 -1
- package/dist/factories/contracts/avs/ECDSAStakeRegistryStorage__factory.js +36 -0
- package/dist/factories/contracts/avs/ECDSAStakeRegistryStorage__factory.js.map +1 -1
- package/dist/factories/contracts/avs/ECDSAStakeRegistry__factory.d.ts +76 -5
- package/dist/factories/contracts/avs/ECDSAStakeRegistry__factory.d.ts.map +1 -1
- package/dist/factories/contracts/avs/ECDSAStakeRegistry__factory.js +98 -6
- package/dist/factories/contracts/avs/ECDSAStakeRegistry__factory.js.map +1 -1
- package/dist/factories/contracts/avs/HyperlaneServiceManager__factory.d.ts +1 -1
- package/dist/factories/contracts/avs/HyperlaneServiceManager__factory.js +1 -1
- package/dist/factories/contracts/hooks/warp-route/RateLimitedHook__factory.d.ts +1 -1
- package/dist/factories/contracts/hooks/warp-route/RateLimitedHook__factory.js +1 -1
- package/dist/factories/contracts/interfaces/avs/vendored/IECDSAStakeRegistryEventsAndErrors__factory.d.ts +29 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IECDSAStakeRegistryEventsAndErrors__factory.d.ts.map +1 -1
- package/dist/factories/contracts/interfaces/avs/vendored/IECDSAStakeRegistryEventsAndErrors__factory.js +36 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IECDSAStakeRegistryEventsAndErrors__factory.js.map +1 -1
- package/dist/factories/contracts/isms/warp-route/RateLimitedIsm__factory.d.ts +1 -1
- package/dist/factories/contracts/isms/warp-route/RateLimitedIsm__factory.js +1 -1
- package/dist/factories/contracts/test/TestRemoteChallenger__factory.d.ts +1 -1
- package/dist/factories/contracts/test/TestRemoteChallenger__factory.js +1 -1
- package/dist/factories/contracts/test/avs/TestHyperlaneServiceManager__factory.d.ts +1 -1
- package/dist/factories/contracts/test/avs/TestHyperlaneServiceManager__factory.js +1 -1
- package/dist/factories/contracts/token/HypERC20Collateral__factory.d.ts +1 -1
- package/dist/factories/contracts/token/HypERC20Collateral__factory.js +1 -1
- package/dist/factories/contracts/token/HypERC20__factory.d.ts +1 -1
- package/dist/factories/contracts/token/HypERC20__factory.js +1 -1
- package/dist/factories/contracts/token/HypERC721Collateral__factory.d.ts +1 -1
- package/dist/factories/contracts/token/HypERC721Collateral__factory.js +1 -1
- package/dist/factories/contracts/token/HypERC721__factory.d.ts +1 -1
- package/dist/factories/contracts/token/HypERC721__factory.js +1 -1
- package/dist/factories/contracts/token/HypNative__factory.d.ts +1 -1
- package/dist/factories/contracts/token/HypNative__factory.js +1 -1
- package/dist/factories/contracts/token/extensions/FastHypERC20Collateral__factory.d.ts +1 -1
- package/dist/factories/contracts/token/extensions/FastHypERC20Collateral__factory.js +1 -1
- package/dist/factories/contracts/token/extensions/FastHypERC20__factory.d.ts +1 -1
- package/dist/factories/contracts/token/extensions/FastHypERC20__factory.js +1 -1
- package/dist/factories/contracts/token/extensions/HypERC20CollateralVaultDeposit__factory.d.ts +1 -1
- package/dist/factories/contracts/token/extensions/HypERC20CollateralVaultDeposit__factory.js +1 -1
- package/dist/factories/contracts/token/extensions/HypERC721URICollateral__factory.d.ts +1 -1
- package/dist/factories/contracts/token/extensions/HypERC721URICollateral__factory.js +1 -1
- package/dist/factories/contracts/token/extensions/HypERC721URIStorage__factory.d.ts +1 -1
- package/dist/factories/contracts/token/extensions/HypERC721URIStorage__factory.js +1 -1
- package/dist/factories/contracts/token/extensions/HypFiatToken__factory.d.ts +1 -1
- package/dist/factories/contracts/token/extensions/HypFiatToken__factory.js +1 -1
- package/dist/factories/contracts/token/extensions/HypNativeScaled__factory.d.ts +1 -1
- package/dist/factories/contracts/token/extensions/HypNativeScaled__factory.js +1 -1
- package/dist/factories/contracts/token/extensions/HypXERC20Lockbox__factory.d.ts +1 -1
- package/dist/factories/contracts/token/extensions/HypXERC20Lockbox__factory.d.ts.map +1 -1
- package/dist/factories/contracts/token/extensions/HypXERC20Lockbox__factory.js +1 -1
- package/dist/factories/contracts/token/extensions/HypXERC20Lockbox__factory.js.map +1 -1
- package/dist/factories/contracts/token/extensions/HypXERC20__factory.d.ts +1 -1
- package/dist/factories/contracts/token/extensions/HypXERC20__factory.js +1 -1
- package/package.json +2 -2
|
@@ -44,13 +44,14 @@ contract ECDSAStakeRegistry is
|
|
|
44
44
|
__ECDSAStakeRegistry_init(_serviceManager, _thresholdWeight, _quorum);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
/// @notice Registers a new operator using a provided signature
|
|
47
|
+
/// @notice Registers a new operator using a provided signature and signing key
|
|
48
48
|
/// @param _operatorSignature Contains the operator's signature, salt, and expiry
|
|
49
|
+
/// @param _signingKey The signing key to add to the operator's history
|
|
49
50
|
function registerOperatorWithSignature(
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
ISignatureUtils.SignatureWithSaltAndExpiry memory _operatorSignature,
|
|
52
|
+
address _signingKey
|
|
52
53
|
) external {
|
|
53
|
-
_registerOperatorWithSig(
|
|
54
|
+
_registerOperatorWithSig(msg.sender, _operatorSignature, _signingKey);
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
/// @notice Deregisters an existing operator
|
|
@@ -58,6 +59,18 @@ contract ECDSAStakeRegistry is
|
|
|
58
59
|
_deregisterOperator(msg.sender);
|
|
59
60
|
}
|
|
60
61
|
|
|
62
|
+
/**
|
|
63
|
+
* @notice Updates the signing key for an operator
|
|
64
|
+
* @dev Only callable by the operator themselves
|
|
65
|
+
* @param _newSigningKey The new signing key to set for the operator
|
|
66
|
+
*/
|
|
67
|
+
function updateOperatorSigningKey(address _newSigningKey) external {
|
|
68
|
+
if (!_operatorRegistered[msg.sender]) {
|
|
69
|
+
revert OperatorNotRegistered();
|
|
70
|
+
}
|
|
71
|
+
_updateOperatorSigningKey(msg.sender, _newSigningKey);
|
|
72
|
+
}
|
|
73
|
+
|
|
61
74
|
/**
|
|
62
75
|
* @notice Updates the StakeRegistry's view of one or more operators' stakes adding a new entry in their history of stake checkpoints,
|
|
63
76
|
* @dev Queries stakes from the Eigenlayer core DelegationManager contract
|
|
@@ -107,18 +120,18 @@ contract ECDSAStakeRegistry is
|
|
|
107
120
|
|
|
108
121
|
/// @notice Verifies if the provided signature data is valid for the given data hash.
|
|
109
122
|
/// @param _dataHash The hash of the data that was signed.
|
|
110
|
-
/// @param _signatureData Encoded signature data consisting of an array of
|
|
123
|
+
/// @param _signatureData Encoded signature data consisting of an array of operators, an array of signatures, and a reference block number.
|
|
111
124
|
/// @return The function selector that indicates the signature is valid according to ERC1271 standard.
|
|
112
125
|
function isValidSignature(
|
|
113
126
|
bytes32 _dataHash,
|
|
114
127
|
bytes memory _signatureData
|
|
115
128
|
) external view returns (bytes4) {
|
|
116
129
|
(
|
|
117
|
-
address[] memory
|
|
130
|
+
address[] memory operators,
|
|
118
131
|
bytes[] memory signatures,
|
|
119
132
|
uint32 referenceBlock
|
|
120
133
|
) = abi.decode(_signatureData, (address[], bytes[], uint32));
|
|
121
|
-
_checkSignatures(_dataHash,
|
|
134
|
+
_checkSignatures(_dataHash, operators, signatures, referenceBlock);
|
|
122
135
|
return IERC1271Upgradeable.isValidSignature.selector;
|
|
123
136
|
}
|
|
124
137
|
|
|
@@ -128,6 +141,37 @@ contract ECDSAStakeRegistry is
|
|
|
128
141
|
return _quorum;
|
|
129
142
|
}
|
|
130
143
|
|
|
144
|
+
/**
|
|
145
|
+
* @notice Retrieves the latest signing key for a given operator.
|
|
146
|
+
* @param _operator The address of the operator.
|
|
147
|
+
* @return The latest signing key of the operator.
|
|
148
|
+
*/
|
|
149
|
+
function getLastestOperatorSigningKey(
|
|
150
|
+
address _operator
|
|
151
|
+
) external view returns (address) {
|
|
152
|
+
return address(uint160(_operatorSigningKeyHistory[_operator].latest()));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @notice Retrieves the latest signing key for a given operator at a specific block number.
|
|
157
|
+
* @param _operator The address of the operator.
|
|
158
|
+
* @param _blockNumber The block number to get the operator's signing key.
|
|
159
|
+
* @return The signing key of the operator at the given block.
|
|
160
|
+
*/
|
|
161
|
+
function getOperatorSigningKeyAtBlock(
|
|
162
|
+
address _operator,
|
|
163
|
+
uint256 _blockNumber
|
|
164
|
+
) external view returns (address) {
|
|
165
|
+
return
|
|
166
|
+
address(
|
|
167
|
+
uint160(
|
|
168
|
+
_operatorSigningKeyHistory[_operator].getAtBlock(
|
|
169
|
+
_blockNumber
|
|
170
|
+
)
|
|
171
|
+
)
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
131
175
|
/// @notice Retrieves the last recorded weight for a given operator.
|
|
132
176
|
/// @param _operator The address of the operator.
|
|
133
177
|
/// @return uint256 - The latest weight of the operator.
|
|
@@ -313,9 +357,11 @@ contract ECDSAStakeRegistry is
|
|
|
313
357
|
|
|
314
358
|
/// @dev registers an operator through a provided signature
|
|
315
359
|
/// @param _operatorSignature Contains the operator's signature, salt, and expiry
|
|
360
|
+
/// @param _signingKey The signing key to add to the operator's history
|
|
316
361
|
function _registerOperatorWithSig(
|
|
317
362
|
address _operator,
|
|
318
|
-
ISignatureUtils.SignatureWithSaltAndExpiry memory _operatorSignature
|
|
363
|
+
ISignatureUtils.SignatureWithSaltAndExpiry memory _operatorSignature,
|
|
364
|
+
address _signingKey
|
|
319
365
|
) internal virtual {
|
|
320
366
|
if (_operatorRegistered[_operator]) {
|
|
321
367
|
revert OperatorAlreadyRegistered();
|
|
@@ -324,6 +370,7 @@ contract ECDSAStakeRegistry is
|
|
|
324
370
|
_operatorRegistered[_operator] = true;
|
|
325
371
|
int256 delta = _updateOperatorWeight(_operator);
|
|
326
372
|
_updateTotalWeight(delta);
|
|
373
|
+
_updateOperatorSigningKey(_operator, _signingKey);
|
|
327
374
|
IServiceManager(_serviceManager).registerOperatorToAVS(
|
|
328
375
|
_operator,
|
|
329
376
|
_operatorSignature
|
|
@@ -331,6 +378,28 @@ contract ECDSAStakeRegistry is
|
|
|
331
378
|
emit OperatorRegistered(_operator, _serviceManager);
|
|
332
379
|
}
|
|
333
380
|
|
|
381
|
+
/// @dev Internal function to update an operator's signing key
|
|
382
|
+
/// @param _operator The address of the operator to update the signing key for
|
|
383
|
+
/// @param _newSigningKey The new signing key to set for the operator
|
|
384
|
+
function _updateOperatorSigningKey(
|
|
385
|
+
address _operator,
|
|
386
|
+
address _newSigningKey
|
|
387
|
+
) internal {
|
|
388
|
+
address oldSigningKey = address(
|
|
389
|
+
uint160(_operatorSigningKeyHistory[_operator].latest())
|
|
390
|
+
);
|
|
391
|
+
if (_newSigningKey == oldSigningKey) {
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
_operatorSigningKeyHistory[_operator].push(uint160(_newSigningKey));
|
|
395
|
+
emit SigningKeyUpdate(
|
|
396
|
+
_operator,
|
|
397
|
+
block.number,
|
|
398
|
+
_newSigningKey,
|
|
399
|
+
oldSigningKey
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
|
|
334
403
|
/// @notice Updates the weight of an operator and returns the previous and current weights.
|
|
335
404
|
/// @param _operator The address of the operator to update the weight of.
|
|
336
405
|
function _updateOperatorWeight(
|
|
@@ -401,30 +470,33 @@ contract ECDSAStakeRegistry is
|
|
|
401
470
|
/**
|
|
402
471
|
* @notice Common logic to verify a batch of ECDSA signatures against a hash, using either last stake weight or at a specific block.
|
|
403
472
|
* @param _dataHash The hash of the data the signers endorsed.
|
|
404
|
-
* @param
|
|
473
|
+
* @param _operators A collection of addresses that endorsed the data hash.
|
|
405
474
|
* @param _signatures A collection of signatures matching the signers.
|
|
406
475
|
* @param _referenceBlock The block number for evaluating stake weight; use max uint32 for latest weight.
|
|
407
476
|
*/
|
|
408
477
|
function _checkSignatures(
|
|
409
478
|
bytes32 _dataHash,
|
|
410
|
-
address[] memory
|
|
479
|
+
address[] memory _operators,
|
|
411
480
|
bytes[] memory _signatures,
|
|
412
481
|
uint32 _referenceBlock
|
|
413
482
|
) internal view {
|
|
414
|
-
uint256 signersLength =
|
|
415
|
-
address
|
|
483
|
+
uint256 signersLength = _operators.length;
|
|
484
|
+
address currentOperator;
|
|
485
|
+
address lastOperator;
|
|
486
|
+
address signer;
|
|
416
487
|
uint256 signedWeight;
|
|
417
488
|
|
|
418
489
|
_validateSignaturesLength(signersLength, _signatures.length);
|
|
419
490
|
for (uint256 i; i < signersLength; i++) {
|
|
420
|
-
|
|
491
|
+
currentOperator = _operators[i];
|
|
492
|
+
signer = _getOperatorSigningKey(currentOperator, _referenceBlock);
|
|
421
493
|
|
|
422
|
-
_validateSortedSigners(
|
|
423
|
-
_validateSignature(
|
|
494
|
+
_validateSortedSigners(lastOperator, currentOperator);
|
|
495
|
+
_validateSignature(signer, _dataHash, _signatures[i]);
|
|
424
496
|
|
|
425
|
-
|
|
497
|
+
lastOperator = currentOperator;
|
|
426
498
|
uint256 operatorWeight = _getOperatorWeight(
|
|
427
|
-
|
|
499
|
+
currentOperator,
|
|
428
500
|
_referenceBlock
|
|
429
501
|
);
|
|
430
502
|
signedWeight += operatorWeight;
|
|
@@ -474,6 +546,27 @@ contract ECDSAStakeRegistry is
|
|
|
474
546
|
}
|
|
475
547
|
}
|
|
476
548
|
|
|
549
|
+
/// @notice Retrieves the operator weight for a signer, either at the last checkpoint or a specified block.
|
|
550
|
+
/// @param _operator The operator to query their signing key history for
|
|
551
|
+
/// @param _referenceBlock The block number to query the operator's weight at, or the maximum uint32 value for the last checkpoint.
|
|
552
|
+
/// @return The weight of the operator.
|
|
553
|
+
function _getOperatorSigningKey(
|
|
554
|
+
address _operator,
|
|
555
|
+
uint32 _referenceBlock
|
|
556
|
+
) internal view returns (address) {
|
|
557
|
+
if (_referenceBlock >= block.number) {
|
|
558
|
+
revert InvalidReferenceBlock();
|
|
559
|
+
}
|
|
560
|
+
return
|
|
561
|
+
address(
|
|
562
|
+
uint160(
|
|
563
|
+
_operatorSigningKeyHistory[_operator].getAtBlock(
|
|
564
|
+
_referenceBlock
|
|
565
|
+
)
|
|
566
|
+
)
|
|
567
|
+
);
|
|
568
|
+
}
|
|
569
|
+
|
|
477
570
|
/// @notice Retrieves the operator weight for a signer, either at the last checkpoint or a specified block.
|
|
478
571
|
/// @param _signer The address of the signer whose weight is returned.
|
|
479
572
|
/// @param _referenceBlock The block number to query the operator's weight at, or the maximum uint32 value for the last checkpoint.
|
|
@@ -482,11 +575,10 @@ contract ECDSAStakeRegistry is
|
|
|
482
575
|
address _signer,
|
|
483
576
|
uint32 _referenceBlock
|
|
484
577
|
) internal view returns (uint256) {
|
|
485
|
-
if (_referenceBlock
|
|
486
|
-
|
|
487
|
-
} else {
|
|
488
|
-
return _operatorWeightHistory[_signer].getAtBlock(_referenceBlock);
|
|
578
|
+
if (_referenceBlock >= block.number) {
|
|
579
|
+
revert InvalidReferenceBlock();
|
|
489
580
|
}
|
|
581
|
+
return _operatorWeightHistory[_signer].getAtBlock(_referenceBlock);
|
|
490
582
|
}
|
|
491
583
|
|
|
492
584
|
/// @notice Retrieve the total stake weight at a specific block or the latest if not specified.
|
|
@@ -496,11 +588,10 @@ contract ECDSAStakeRegistry is
|
|
|
496
588
|
function _getTotalWeight(
|
|
497
589
|
uint32 _referenceBlock
|
|
498
590
|
) internal view returns (uint256) {
|
|
499
|
-
if (_referenceBlock
|
|
500
|
-
|
|
501
|
-
} else {
|
|
502
|
-
return _totalWeightHistory.getAtBlock(_referenceBlock);
|
|
591
|
+
if (_referenceBlock >= block.number) {
|
|
592
|
+
revert InvalidReferenceBlock();
|
|
503
593
|
}
|
|
594
|
+
return _totalWeightHistory.getAtBlock(_referenceBlock);
|
|
504
595
|
}
|
|
505
596
|
|
|
506
597
|
/// @notice Retrieves the threshold stake for a given reference block.
|
|
@@ -510,11 +601,10 @@ contract ECDSAStakeRegistry is
|
|
|
510
601
|
function _getThresholdStake(
|
|
511
602
|
uint32 _referenceBlock
|
|
512
603
|
) internal view returns (uint256) {
|
|
513
|
-
if (_referenceBlock
|
|
514
|
-
|
|
515
|
-
} else {
|
|
516
|
-
return _thresholdWeightHistory.getAtBlock(_referenceBlock);
|
|
604
|
+
if (_referenceBlock >= block.number) {
|
|
605
|
+
revert InvalidReferenceBlock();
|
|
517
606
|
}
|
|
607
|
+
return _thresholdWeightHistory.getAtBlock(_referenceBlock);
|
|
518
608
|
}
|
|
519
609
|
|
|
520
610
|
/// @notice Validates that the cumulative stake of signed messages meets or exceeds the required threshold.
|
|
@@ -30,6 +30,10 @@ abstract contract ECDSAStakeRegistryStorage is
|
|
|
30
30
|
/// @notice Defines the duration after which the stake's weight expires.
|
|
31
31
|
uint256 internal _stakeExpiry;
|
|
32
32
|
|
|
33
|
+
/// @notice Maps an operator to their signing key history using checkpoints
|
|
34
|
+
mapping(address => CheckpointsUpgradeable.History)
|
|
35
|
+
internal _operatorSigningKeyHistory;
|
|
36
|
+
|
|
33
37
|
/// @notice Tracks the total stake history over time using checkpoints
|
|
34
38
|
CheckpointsUpgradeable.History internal _totalWeightHistory;
|
|
35
39
|
|
|
@@ -51,5 +55,5 @@ abstract contract ECDSAStakeRegistryStorage is
|
|
|
51
55
|
// slither-disable-next-line shadowing-state
|
|
52
56
|
/// @dev Reserves storage slots for future upgrades
|
|
53
57
|
// solhint-disable-next-line
|
|
54
|
-
uint256[
|
|
58
|
+
uint256[40] private __gap;
|
|
55
59
|
}
|
|
@@ -12,8 +12,6 @@ struct Quorum {
|
|
|
12
12
|
StrategyParams[] strategies; // An array of strategy parameters to define the quorum
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
/// part of mock interfaces for vendoring necessary Eigenlayer contracts for the hyperlane AVS
|
|
16
|
-
/// @author Layr Labs, Inc.
|
|
17
15
|
interface IECDSAStakeRegistryEventsAndErrors {
|
|
18
16
|
/// @notice Emitted when the system registers an operator
|
|
19
17
|
/// @param _operator The address of the registered operator
|
|
@@ -61,7 +59,19 @@ interface IECDSAStakeRegistryEventsAndErrors {
|
|
|
61
59
|
/// @notice Emits when setting a new threshold weight.
|
|
62
60
|
event ThresholdWeightUpdated(uint256 _thresholdWeight);
|
|
63
61
|
|
|
62
|
+
/// @notice Emitted when an operator's signing key is updated
|
|
63
|
+
/// @param operator The address of the operator whose signing key was updated
|
|
64
|
+
/// @param updateBlock The block number at which the signing key was updated
|
|
65
|
+
/// @param newSigningKey The operator's signing key after the update
|
|
66
|
+
/// @param oldSigningKey The operator's signing key before the update
|
|
67
|
+
event SigningKeyUpdate(
|
|
68
|
+
address indexed operator,
|
|
69
|
+
uint256 indexed updateBlock,
|
|
70
|
+
address indexed newSigningKey,
|
|
71
|
+
address oldSigningKey
|
|
72
|
+
);
|
|
64
73
|
/// @notice Indicates when the lengths of the signers array and signatures array do not match.
|
|
74
|
+
|
|
65
75
|
error LengthMismatch();
|
|
66
76
|
|
|
67
77
|
/// @notice Indicates encountering an invalid length for the signers or signatures array.
|
|
@@ -76,6 +86,9 @@ interface IECDSAStakeRegistryEventsAndErrors {
|
|
|
76
86
|
/// @notice Thrown when missing operators in an update
|
|
77
87
|
error MustUpdateAllOperators();
|
|
78
88
|
|
|
89
|
+
/// @notice Reference blocks must be for blocks that have already been confirmed
|
|
90
|
+
error InvalidReferenceBlock();
|
|
91
|
+
|
|
79
92
|
/// @notice Indicates operator weights were out of sync and the signed weight exceed the total
|
|
80
93
|
error InvalidSignedWeight();
|
|
81
94
|
|
|
@@ -19,8 +19,14 @@ contract HypXERC20Lockbox is HypERC20Collateral {
|
|
|
19
19
|
xERC20 = lockbox.XERC20();
|
|
20
20
|
|
|
21
21
|
// grant infinite approvals to lockbox
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
require(
|
|
23
|
+
IERC20(wrappedToken).approve(_lockbox, MAX_INT),
|
|
24
|
+
"erc20 lockbox approve failed"
|
|
25
|
+
);
|
|
26
|
+
require(
|
|
27
|
+
xERC20.approve(_lockbox, MAX_INT),
|
|
28
|
+
"xerc20 lockbox approve failed"
|
|
29
|
+
);
|
|
24
30
|
}
|
|
25
31
|
|
|
26
32
|
function _transferFromSender(
|
|
@@ -10,13 +10,6 @@ library TokenMessage {
|
|
|
10
10
|
return abi.encodePacked(_recipient, _amount, _metadata);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
function format(
|
|
14
|
-
bytes32 _recipient,
|
|
15
|
-
uint256 _amount
|
|
16
|
-
) internal pure returns (bytes memory) {
|
|
17
|
-
return abi.encodePacked(_recipient, _amount);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
13
|
function recipient(bytes calldata message) internal pure returns (bytes32) {
|
|
21
14
|
return bytes32(message[0:32]);
|
|
22
15
|
}
|