@hyperlane-xyz/core 3.11.1 → 3.12.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/README.md +18 -2
- package/contracts/avs/ECDSAServiceManagerBase.sol +273 -0
- package/contracts/avs/ECDSAStakeRegistry.sol +536 -0
- package/contracts/avs/ECDSAStakeRegistryStorage.sol +55 -0
- package/contracts/avs/HyperlaneServiceManager.sol +297 -0
- package/contracts/hooks/PolygonPosHook.sol +83 -0
- package/contracts/interfaces/avs/IRemoteChallenger.sol +24 -0
- package/contracts/interfaces/avs/vendored/IAVSDirectory.sol +24 -0
- package/contracts/interfaces/avs/vendored/IDelegationManager.sol +32 -0
- package/contracts/interfaces/avs/vendored/IECDSAStakeRegistryEventsAndErrors.sol +99 -0
- package/contracts/interfaces/avs/vendored/IPaymentCoordinator.sol +46 -0
- package/contracts/interfaces/avs/vendored/IServiceManager.sol +28 -0
- package/contracts/interfaces/avs/vendored/IServiceManagerUI.sol +67 -0
- package/contracts/interfaces/avs/vendored/ISignatureUtils.sol +27 -0
- package/contracts/interfaces/avs/vendored/ISlasher.sol +11 -0
- package/contracts/interfaces/avs/vendored/IStrategy.sol +107 -0
- package/contracts/isms/hook/PolygonPosIsm.sol +58 -0
- package/contracts/libs/EnumerableMapEnrollment.sol +115 -0
- package/contracts/test/TestRemoteChallenger.sol +21 -0
- package/contracts/test/avs/TestAVSDirectory.sol +87 -0
- package/contracts/test/avs/TestDelegationManager.sol +33 -0
- package/contracts/test/avs/TestHyperlaneServiceManager.sol +30 -0
- package/contracts/test/avs/TestPaymentCoordinator.sol +20 -0
- package/contracts/test/avs/TestSlasher.sol +8 -0
- package/contracts/token/extensions/HypFiatTokenCollateral.sol +1 -0
- package/contracts/token/extensions/HypXERC20Collateral.sol +1 -0
- package/dist/@openzeppelin/contracts/crosschain/index.d.ts +3 -0
- package/dist/@openzeppelin/contracts/crosschain/index.d.ts.map +1 -0
- package/dist/@openzeppelin/contracts/crosschain/index.js +2 -0
- package/dist/@openzeppelin/contracts/crosschain/index.js.map +1 -0
- package/dist/@openzeppelin/contracts/crosschain/polygon/CrossChainEnabledPolygonChild.d.ts +66 -0
- package/dist/@openzeppelin/contracts/crosschain/polygon/CrossChainEnabledPolygonChild.d.ts.map +1 -0
- package/dist/@openzeppelin/contracts/crosschain/polygon/CrossChainEnabledPolygonChild.js +2 -0
- package/dist/@openzeppelin/contracts/crosschain/polygon/CrossChainEnabledPolygonChild.js.map +1 -0
- package/dist/@openzeppelin/contracts/crosschain/polygon/index.d.ts +2 -0
- package/dist/@openzeppelin/contracts/crosschain/polygon/index.d.ts.map +1 -0
- package/dist/@openzeppelin/contracts/crosschain/polygon/index.js +2 -0
- package/dist/@openzeppelin/contracts/crosschain/polygon/index.js.map +1 -0
- package/dist/@openzeppelin/contracts/index.d.ts +2 -0
- package/dist/@openzeppelin/contracts/index.d.ts.map +1 -1
- package/dist/@openzeppelin/contracts/vendor/index.d.ts +2 -0
- package/dist/@openzeppelin/contracts/vendor/index.d.ts.map +1 -1
- package/dist/@openzeppelin/contracts/vendor/polygon/IFxMessageProcessor.d.ts +66 -0
- package/dist/@openzeppelin/contracts/vendor/polygon/IFxMessageProcessor.d.ts.map +1 -0
- package/dist/@openzeppelin/contracts/vendor/polygon/IFxMessageProcessor.js +2 -0
- package/dist/@openzeppelin/contracts/vendor/polygon/IFxMessageProcessor.js.map +1 -0
- package/dist/@openzeppelin/contracts/vendor/polygon/index.d.ts +2 -0
- package/dist/@openzeppelin/contracts/vendor/polygon/index.d.ts.map +1 -0
- package/dist/@openzeppelin/contracts/vendor/polygon/index.js +2 -0
- package/dist/@openzeppelin/contracts/vendor/polygon/index.js.map +1 -0
- package/dist/@openzeppelin/contracts-upgradeable/interfaces/IERC1271Upgradeable.d.ts +54 -0
- package/dist/@openzeppelin/contracts-upgradeable/interfaces/IERC1271Upgradeable.d.ts.map +1 -0
- package/dist/@openzeppelin/contracts-upgradeable/interfaces/IERC1271Upgradeable.js +2 -0
- package/dist/@openzeppelin/contracts-upgradeable/interfaces/IERC1271Upgradeable.js.map +1 -0
- package/dist/@openzeppelin/contracts-upgradeable/interfaces/index.d.ts +1 -0
- package/dist/@openzeppelin/contracts-upgradeable/interfaces/index.d.ts.map +1 -1
- package/dist/buildArtifact.js +1 -1
- package/dist/buildArtifact.json +1 -1
- package/dist/contracts/avs/ECDSAServiceManagerBase.d.ts +423 -0
- package/dist/contracts/avs/ECDSAServiceManagerBase.d.ts.map +1 -0
- package/dist/contracts/avs/ECDSAServiceManagerBase.js +2 -0
- package/dist/contracts/avs/ECDSAServiceManagerBase.js.map +1 -0
- package/dist/contracts/avs/ECDSAStakeRegistry.d.ts +693 -0
- package/dist/contracts/avs/ECDSAStakeRegistry.d.ts.map +1 -0
- package/dist/contracts/avs/ECDSAStakeRegistry.js +2 -0
- package/dist/contracts/avs/ECDSAStakeRegistry.js.map +1 -0
- package/dist/contracts/avs/ECDSAStakeRegistryStorage.d.ts +157 -0
- package/dist/contracts/avs/ECDSAStakeRegistryStorage.d.ts.map +1 -0
- package/dist/contracts/avs/ECDSAStakeRegistryStorage.js +2 -0
- package/dist/contracts/avs/ECDSAStakeRegistryStorage.js.map +1 -0
- package/dist/contracts/avs/HyperlaneServiceManager.d.ts +736 -0
- package/dist/contracts/avs/HyperlaneServiceManager.d.ts.map +1 -0
- package/dist/contracts/avs/HyperlaneServiceManager.js +2 -0
- package/dist/contracts/avs/HyperlaneServiceManager.js.map +1 -0
- package/dist/contracts/avs/index.d.ts +5 -0
- package/dist/contracts/avs/index.d.ts.map +1 -0
- package/dist/contracts/avs/index.js +2 -0
- package/dist/contracts/avs/index.js.map +1 -0
- package/dist/contracts/hooks/PolygonPosHook.d.ts +518 -0
- package/dist/contracts/hooks/PolygonPosHook.d.ts.map +1 -0
- package/dist/contracts/hooks/PolygonPosHook.js +2 -0
- package/dist/contracts/hooks/PolygonPosHook.js.map +1 -0
- package/dist/contracts/hooks/index.d.ts +1 -0
- package/dist/contracts/hooks/index.d.ts.map +1 -1
- package/dist/contracts/index.d.ts +2 -0
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/interfaces/avs/IRemoteChallenger.d.ts +81 -0
- package/dist/contracts/interfaces/avs/IRemoteChallenger.d.ts.map +1 -0
- package/dist/contracts/interfaces/avs/IRemoteChallenger.js +2 -0
- package/dist/contracts/interfaces/avs/IRemoteChallenger.js.map +1 -0
- package/dist/contracts/interfaces/avs/index.d.ts +4 -0
- package/dist/contracts/interfaces/avs/index.d.ts.map +1 -0
- package/dist/contracts/interfaces/avs/index.js +2 -0
- package/dist/contracts/interfaces/avs/index.js.map +1 -0
- package/dist/contracts/interfaces/avs/vendored/IAVSDirectory.d.ts +160 -0
- package/dist/contracts/interfaces/avs/vendored/IAVSDirectory.d.ts.map +1 -0
- package/dist/contracts/interfaces/avs/vendored/IAVSDirectory.js +2 -0
- package/dist/contracts/interfaces/avs/vendored/IAVSDirectory.js.map +1 -0
- package/dist/contracts/interfaces/avs/vendored/IDelegationManager.d.ts +93 -0
- package/dist/contracts/interfaces/avs/vendored/IDelegationManager.d.ts.map +1 -0
- package/dist/contracts/interfaces/avs/vendored/IDelegationManager.js +2 -0
- package/dist/contracts/interfaces/avs/vendored/IDelegationManager.js.map +1 -0
- package/dist/contracts/interfaces/avs/vendored/IECDSAStakeRegistryEventsAndErrors.d.ts +157 -0
- package/dist/contracts/interfaces/avs/vendored/IECDSAStakeRegistryEventsAndErrors.d.ts.map +1 -0
- package/dist/contracts/interfaces/avs/vendored/IECDSAStakeRegistryEventsAndErrors.js +2 -0
- package/dist/contracts/interfaces/avs/vendored/IECDSAStakeRegistryEventsAndErrors.js.map +1 -0
- package/dist/contracts/interfaces/avs/vendored/IPaymentCoordinator.d.ts +96 -0
- package/dist/contracts/interfaces/avs/vendored/IPaymentCoordinator.d.ts.map +1 -0
- package/dist/contracts/interfaces/avs/vendored/IPaymentCoordinator.js +2 -0
- package/dist/contracts/interfaces/avs/vendored/IPaymentCoordinator.js.map +1 -0
- package/dist/contracts/interfaces/avs/vendored/IServiceManager.d.ts +250 -0
- package/dist/contracts/interfaces/avs/vendored/IServiceManager.d.ts.map +1 -0
- package/dist/contracts/interfaces/avs/vendored/IServiceManager.js +2 -0
- package/dist/contracts/interfaces/avs/vendored/IServiceManager.js.map +1 -0
- package/dist/contracts/interfaces/avs/vendored/IServiceManagerUI.d.ts +189 -0
- package/dist/contracts/interfaces/avs/vendored/IServiceManagerUI.d.ts.map +1 -0
- package/dist/contracts/interfaces/avs/vendored/IServiceManagerUI.js +2 -0
- package/dist/contracts/interfaces/avs/vendored/IServiceManagerUI.js.map +1 -0
- package/dist/contracts/interfaces/avs/vendored/ISlasher.d.ts +66 -0
- package/dist/contracts/interfaces/avs/vendored/ISlasher.d.ts.map +1 -0
- package/dist/contracts/interfaces/avs/vendored/ISlasher.js +2 -0
- package/dist/contracts/interfaces/avs/vendored/ISlasher.js.map +1 -0
- package/dist/contracts/interfaces/avs/vendored/IStrategy.d.ts +295 -0
- package/dist/contracts/interfaces/avs/vendored/IStrategy.d.ts.map +1 -0
- package/dist/contracts/interfaces/avs/vendored/IStrategy.js +2 -0
- package/dist/contracts/interfaces/avs/vendored/IStrategy.js.map +1 -0
- package/dist/contracts/interfaces/avs/vendored/index.d.ts +9 -0
- package/dist/contracts/interfaces/avs/vendored/index.d.ts.map +1 -0
- package/dist/contracts/interfaces/avs/vendored/index.js +2 -0
- package/dist/contracts/interfaces/avs/vendored/index.js.map +1 -0
- package/dist/contracts/interfaces/index.d.ts +2 -0
- package/dist/contracts/interfaces/index.d.ts.map +1 -1
- package/dist/contracts/isms/hook/PolygonPosIsm.d.ts +243 -0
- package/dist/contracts/isms/hook/PolygonPosIsm.d.ts.map +1 -0
- package/dist/contracts/isms/hook/PolygonPosIsm.js +2 -0
- package/dist/contracts/isms/hook/PolygonPosIsm.js.map +1 -0
- package/dist/contracts/isms/hook/index.d.ts +1 -0
- package/dist/contracts/isms/hook/index.d.ts.map +1 -1
- package/dist/contracts/libs/EnumerableMapEnrollment.d.ts +73 -0
- package/dist/contracts/libs/EnumerableMapEnrollment.d.ts.map +1 -0
- package/dist/contracts/libs/EnumerableMapEnrollment.js +2 -0
- package/dist/contracts/libs/EnumerableMapEnrollment.js.map +1 -0
- package/dist/contracts/libs/index.d.ts +1 -0
- package/dist/contracts/libs/index.d.ts.map +1 -1
- package/dist/contracts/test/TestRemoteChallenger.d.ts +81 -0
- package/dist/contracts/test/TestRemoteChallenger.d.ts.map +1 -0
- package/dist/contracts/test/TestRemoteChallenger.js +2 -0
- package/dist/contracts/test/TestRemoteChallenger.js.map +1 -0
- package/dist/contracts/test/avs/TestAVSDirectory.d.ts +235 -0
- package/dist/contracts/test/avs/TestAVSDirectory.d.ts.map +1 -0
- package/dist/contracts/test/avs/TestAVSDirectory.js +2 -0
- package/dist/contracts/test/avs/TestAVSDirectory.js.map +1 -0
- package/dist/contracts/test/avs/TestDelegationManager.d.ts +154 -0
- package/dist/contracts/test/avs/TestDelegationManager.d.ts.map +1 -0
- package/dist/contracts/test/avs/TestDelegationManager.js +2 -0
- package/dist/contracts/test/avs/TestDelegationManager.js.map +1 -0
- package/dist/contracts/test/avs/TestHyperlaneServiceManager.d.ts +767 -0
- package/dist/contracts/test/avs/TestHyperlaneServiceManager.d.ts.map +1 -0
- package/dist/contracts/test/avs/TestHyperlaneServiceManager.js +2 -0
- package/dist/contracts/test/avs/TestHyperlaneServiceManager.js.map +1 -0
- package/dist/contracts/test/avs/TestPaymentCoordinator.d.ts +96 -0
- package/dist/contracts/test/avs/TestPaymentCoordinator.d.ts.map +1 -0
- package/dist/contracts/test/avs/TestPaymentCoordinator.js +2 -0
- package/dist/contracts/test/avs/TestPaymentCoordinator.js.map +1 -0
- package/dist/contracts/test/avs/TestSlasher.d.ts +66 -0
- package/dist/contracts/test/avs/TestSlasher.d.ts.map +1 -0
- package/dist/contracts/test/avs/TestSlasher.js +2 -0
- package/dist/contracts/test/avs/TestSlasher.js.map +1 -0
- package/dist/contracts/test/avs/index.d.ts +6 -0
- package/dist/contracts/test/avs/index.d.ts.map +1 -0
- package/dist/contracts/test/avs/index.js +2 -0
- package/dist/contracts/test/avs/index.js.map +1 -0
- package/dist/contracts/test/index.d.ts +3 -0
- package/dist/contracts/test/index.d.ts.map +1 -1
- package/dist/factories/@openzeppelin/contracts/crosschain/index.d.ts +2 -0
- package/dist/factories/@openzeppelin/contracts/crosschain/index.d.ts.map +1 -0
- package/dist/factories/@openzeppelin/contracts/crosschain/index.js +5 -0
- package/dist/factories/@openzeppelin/contracts/crosschain/index.js.map +1 -0
- package/dist/factories/@openzeppelin/contracts/crosschain/polygon/CrossChainEnabledPolygonChild__factory.d.ts +31 -0
- package/dist/factories/@openzeppelin/contracts/crosschain/polygon/CrossChainEnabledPolygonChild__factory.d.ts.map +1 -0
- package/dist/factories/@openzeppelin/contracts/crosschain/polygon/CrossChainEnabledPolygonChild__factory.js +44 -0
- package/dist/factories/@openzeppelin/contracts/crosschain/polygon/CrossChainEnabledPolygonChild__factory.js.map +1 -0
- package/dist/factories/@openzeppelin/contracts/crosschain/polygon/index.d.ts +2 -0
- package/dist/factories/@openzeppelin/contracts/crosschain/polygon/index.d.ts.map +1 -0
- package/dist/factories/@openzeppelin/contracts/crosschain/polygon/index.js +5 -0
- package/dist/factories/@openzeppelin/contracts/crosschain/polygon/index.js.map +1 -0
- package/dist/factories/@openzeppelin/contracts/index.d.ts +1 -0
- package/dist/factories/@openzeppelin/contracts/index.d.ts.map +1 -1
- package/dist/factories/@openzeppelin/contracts/index.js +1 -0
- package/dist/factories/@openzeppelin/contracts/index.js.map +1 -1
- package/dist/factories/@openzeppelin/contracts/vendor/index.d.ts +1 -0
- package/dist/factories/@openzeppelin/contracts/vendor/index.d.ts.map +1 -1
- package/dist/factories/@openzeppelin/contracts/vendor/index.js +1 -0
- package/dist/factories/@openzeppelin/contracts/vendor/index.js.map +1 -1
- package/dist/factories/@openzeppelin/contracts/vendor/polygon/IFxMessageProcessor__factory.d.ts +27 -0
- package/dist/factories/@openzeppelin/contracts/vendor/polygon/IFxMessageProcessor__factory.d.ts.map +1 -0
- package/dist/factories/@openzeppelin/contracts/vendor/polygon/IFxMessageProcessor__factory.js +39 -0
- package/dist/factories/@openzeppelin/contracts/vendor/polygon/IFxMessageProcessor__factory.js.map +1 -0
- package/dist/factories/@openzeppelin/contracts/vendor/polygon/index.d.ts +2 -0
- package/dist/factories/@openzeppelin/contracts/vendor/polygon/index.d.ts.map +1 -0
- package/dist/factories/@openzeppelin/contracts/vendor/polygon/index.js +5 -0
- package/dist/factories/@openzeppelin/contracts/vendor/polygon/index.js.map +1 -0
- package/dist/factories/@openzeppelin/contracts-upgradeable/interfaces/IERC1271Upgradeable__factory.d.ts +27 -0
- package/dist/factories/@openzeppelin/contracts-upgradeable/interfaces/IERC1271Upgradeable__factory.d.ts.map +1 -0
- package/dist/factories/@openzeppelin/contracts-upgradeable/interfaces/IERC1271Upgradeable__factory.js +40 -0
- package/dist/factories/@openzeppelin/contracts-upgradeable/interfaces/IERC1271Upgradeable__factory.js.map +1 -0
- package/dist/factories/@openzeppelin/contracts-upgradeable/interfaces/index.d.ts +1 -0
- package/dist/factories/@openzeppelin/contracts-upgradeable/interfaces/index.d.ts.map +1 -1
- package/dist/factories/@openzeppelin/contracts-upgradeable/interfaces/index.js +1 -0
- package/dist/factories/@openzeppelin/contracts-upgradeable/interfaces/index.js.map +1 -1
- package/dist/factories/contracts/avs/ECDSAServiceManagerBase__factory.d.ts +221 -0
- package/dist/factories/contracts/avs/ECDSAServiceManagerBase__factory.d.ts.map +1 -0
- package/dist/factories/contracts/avs/ECDSAServiceManagerBase__factory.js +291 -0
- package/dist/factories/contracts/avs/ECDSAServiceManagerBase__factory.js.map +1 -0
- package/dist/factories/contracts/avs/ECDSAStakeRegistryStorage__factory.d.ts +205 -0
- package/dist/factories/contracts/avs/ECDSAStakeRegistryStorage__factory.d.ts.map +1 -0
- package/dist/factories/contracts/avs/ECDSAStakeRegistryStorage__factory.js +266 -0
- package/dist/factories/contracts/avs/ECDSAStakeRegistryStorage__factory.js.map +1 -0
- package/dist/factories/contracts/avs/ECDSAStakeRegistry__factory.d.ts +577 -0
- package/dist/factories/contracts/avs/ECDSAStakeRegistry__factory.d.ts.map +1 -0
- package/dist/factories/contracts/avs/ECDSAStakeRegistry__factory.js +762 -0
- package/dist/factories/contracts/avs/ECDSAStakeRegistry__factory.js.map +1 -0
- package/dist/factories/contracts/avs/HyperlaneServiceManager__factory.d.ts +444 -0
- package/dist/factories/contracts/avs/HyperlaneServiceManager__factory.d.ts.map +1 -0
- package/dist/factories/contracts/avs/HyperlaneServiceManager__factory.js +587 -0
- package/dist/factories/contracts/avs/HyperlaneServiceManager__factory.js.map +1 -0
- package/dist/factories/contracts/avs/index.d.ts +5 -0
- package/dist/factories/contracts/avs/index.d.ts.map +1 -0
- package/dist/factories/contracts/avs/index.js +8 -0
- package/dist/factories/contracts/avs/index.js.map +1 -0
- package/dist/factories/contracts/hooks/PolygonPosHook__factory.d.ts +316 -0
- package/dist/factories/contracts/hooks/PolygonPosHook__factory.d.ts.map +1 -0
- package/dist/factories/contracts/hooks/PolygonPosHook__factory.js +423 -0
- package/dist/factories/contracts/hooks/PolygonPosHook__factory.js.map +1 -0
- package/dist/factories/contracts/hooks/index.d.ts +1 -0
- package/dist/factories/contracts/hooks/index.d.ts.map +1 -1
- package/dist/factories/contracts/hooks/index.js +1 -0
- package/dist/factories/contracts/hooks/index.js.map +1 -1
- package/dist/factories/contracts/index.d.ts +1 -0
- package/dist/factories/contracts/index.d.ts.map +1 -1
- package/dist/factories/contracts/index.js +1 -0
- package/dist/factories/contracts/index.js.map +1 -1
- package/dist/factories/contracts/interfaces/avs/IRemoteChallenger__factory.d.ts +29 -0
- package/dist/factories/contracts/interfaces/avs/IRemoteChallenger__factory.d.ts.map +1 -0
- package/dist/factories/contracts/interfaces/avs/IRemoteChallenger__factory.js +42 -0
- package/dist/factories/contracts/interfaces/avs/IRemoteChallenger__factory.js.map +1 -0
- package/dist/factories/contracts/interfaces/avs/index.d.ts +3 -0
- package/dist/factories/contracts/interfaces/avs/index.d.ts.map +1 -0
- package/dist/factories/contracts/interfaces/avs/index.js +6 -0
- package/dist/factories/contracts/interfaces/avs/index.js.map +1 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IAVSDirectory__factory.d.ts +71 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IAVSDirectory__factory.d.ts.map +1 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IAVSDirectory__factory.js +96 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IAVSDirectory__factory.js.map +1 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IDelegationManager__factory.d.ts +54 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IDelegationManager__factory.d.ts.map +1 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IDelegationManager__factory.js +75 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IDelegationManager__factory.js.map +1 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IECDSAStakeRegistryEventsAndErrors__factory.d.ts +205 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IECDSAStakeRegistryEventsAndErrors__factory.d.ts.map +1 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IECDSAStakeRegistryEventsAndErrors__factory.js +266 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IECDSAStakeRegistryEventsAndErrors__factory.js.map +1 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IPaymentCoordinator__factory.d.ts +49 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IPaymentCoordinator__factory.d.ts.map +1 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IPaymentCoordinator__factory.js +68 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IPaymentCoordinator__factory.js.map +1 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IServiceManagerUI__factory.d.ts +90 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IServiceManagerUI__factory.d.ts.map +1 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IServiceManagerUI__factory.js +122 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IServiceManagerUI__factory.js.map +1 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IServiceManager__factory.d.ts +130 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IServiceManager__factory.d.ts.map +1 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IServiceManager__factory.js +174 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IServiceManager__factory.js.map +1 -0
- package/dist/factories/contracts/interfaces/avs/vendored/ISlasher__factory.d.ts +19 -0
- package/dist/factories/contracts/interfaces/avs/vendored/ISlasher__factory.d.ts.map +1 -0
- package/dist/factories/contracts/interfaces/avs/vendored/ISlasher__factory.js +29 -0
- package/dist/factories/contracts/interfaces/avs/vendored/ISlasher__factory.js.map +1 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IStrategy__factory.d.ts +173 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IStrategy__factory.d.ts.map +1 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IStrategy__factory.js +235 -0
- package/dist/factories/contracts/interfaces/avs/vendored/IStrategy__factory.js.map +1 -0
- package/dist/factories/contracts/interfaces/avs/vendored/index.d.ts +9 -0
- package/dist/factories/contracts/interfaces/avs/vendored/index.d.ts.map +1 -0
- package/dist/factories/contracts/interfaces/avs/vendored/index.js +12 -0
- package/dist/factories/contracts/interfaces/avs/vendored/index.js.map +1 -0
- package/dist/factories/contracts/interfaces/index.d.ts +1 -0
- package/dist/factories/contracts/interfaces/index.d.ts.map +1 -1
- package/dist/factories/contracts/interfaces/index.js +1 -0
- package/dist/factories/contracts/interfaces/index.js.map +1 -1
- package/dist/factories/contracts/isms/hook/PolygonPosIsm__factory.d.ts +153 -0
- package/dist/factories/contracts/isms/hook/PolygonPosIsm__factory.d.ts.map +1 -0
- package/dist/factories/contracts/isms/hook/PolygonPosIsm__factory.js +212 -0
- package/dist/factories/contracts/isms/hook/PolygonPosIsm__factory.js.map +1 -0
- package/dist/factories/contracts/isms/hook/index.d.ts +1 -0
- package/dist/factories/contracts/isms/hook/index.d.ts.map +1 -1
- package/dist/factories/contracts/isms/hook/index.js +1 -0
- package/dist/factories/contracts/isms/hook/index.js.map +1 -1
- package/dist/factories/contracts/libs/EnumerableMapEnrollment__factory.d.ts +67 -0
- package/dist/factories/contracts/libs/EnumerableMapEnrollment__factory.d.ts.map +1 -0
- package/dist/factories/contracts/libs/EnumerableMapEnrollment__factory.js +101 -0
- package/dist/factories/contracts/libs/EnumerableMapEnrollment__factory.js.map +1 -0
- package/dist/factories/contracts/libs/index.d.ts +1 -0
- package/dist/factories/contracts/libs/index.d.ts.map +1 -1
- package/dist/factories/contracts/libs/index.js +1 -0
- package/dist/factories/contracts/libs/index.js.map +1 -1
- package/dist/factories/contracts/test/TestRemoteChallenger__factory.d.ts +49 -0
- package/dist/factories/contracts/test/TestRemoteChallenger__factory.d.ts.map +1 -0
- package/dist/factories/contracts/test/TestRemoteChallenger__factory.js +76 -0
- package/dist/factories/contracts/test/TestRemoteChallenger__factory.js.map +1 -0
- package/dist/factories/contracts/test/avs/TestAVSDirectory__factory.d.ts +157 -0
- package/dist/factories/contracts/test/avs/TestAVSDirectory__factory.d.ts.map +1 -0
- package/dist/factories/contracts/test/avs/TestAVSDirectory__factory.js +216 -0
- package/dist/factories/contracts/test/avs/TestAVSDirectory__factory.js.map +1 -0
- package/dist/factories/contracts/test/avs/TestDelegationManager__factory.d.ts +112 -0
- package/dist/factories/contracts/test/avs/TestDelegationManager__factory.d.ts.map +1 -0
- package/dist/factories/contracts/test/avs/TestDelegationManager__factory.js +159 -0
- package/dist/factories/contracts/test/avs/TestDelegationManager__factory.js.map +1 -0
- package/dist/factories/contracts/test/avs/TestHyperlaneServiceManager__factory.d.ts +458 -0
- package/dist/factories/contracts/test/avs/TestHyperlaneServiceManager__factory.d.ts.map +1 -0
- package/dist/factories/contracts/test/avs/TestHyperlaneServiceManager__factory.js +605 -0
- package/dist/factories/contracts/test/avs/TestHyperlaneServiceManager__factory.js.map +1 -0
- package/dist/factories/contracts/test/avs/TestPaymentCoordinator__factory.d.ts +61 -0
- package/dist/factories/contracts/test/avs/TestPaymentCoordinator__factory.d.ts.map +1 -0
- package/dist/factories/contracts/test/avs/TestPaymentCoordinator__factory.js +91 -0
- package/dist/factories/contracts/test/avs/TestPaymentCoordinator__factory.js.map +1 -0
- package/dist/factories/contracts/test/avs/TestSlasher__factory.d.ts +31 -0
- package/dist/factories/contracts/test/avs/TestSlasher__factory.d.ts.map +1 -0
- package/dist/factories/contracts/test/avs/TestSlasher__factory.js +52 -0
- package/dist/factories/contracts/test/avs/TestSlasher__factory.js.map +1 -0
- package/dist/factories/contracts/test/avs/index.d.ts +6 -0
- package/dist/factories/contracts/test/avs/index.d.ts.map +1 -0
- package/dist/factories/contracts/test/avs/index.js +9 -0
- package/dist/factories/contracts/test/avs/index.js.map +1 -0
- package/dist/factories/contracts/test/index.d.ts +2 -0
- package/dist/factories/contracts/test/index.d.ts.map +1 -1
- package/dist/factories/contracts/test/index.js +2 -0
- package/dist/factories/contracts/test/index.js.map +1 -1
- package/dist/factories/contracts/token/extensions/HypFiatTokenCollateral__factory.d.ts +1 -1
- package/dist/factories/contracts/token/extensions/HypFiatTokenCollateral__factory.js +1 -1
- package/dist/factories/contracts/token/extensions/HypXERC20Collateral__factory.d.ts +1 -1
- package/dist/factories/contracts/token/extensions/HypXERC20Collateral__factory.js +1 -1
- package/dist/factories/fx-portal/contracts/index.d.ts +2 -0
- package/dist/factories/fx-portal/contracts/index.d.ts.map +1 -0
- package/dist/factories/fx-portal/contracts/index.js +5 -0
- package/dist/factories/fx-portal/contracts/index.js.map +1 -0
- package/dist/factories/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/FxBaseRootTunnel__factory.d.ts +83 -0
- package/dist/factories/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/FxBaseRootTunnel__factory.d.ts.map +1 -0
- package/dist/factories/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/FxBaseRootTunnel__factory.js +113 -0
- package/dist/factories/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/FxBaseRootTunnel__factory.js.map +1 -0
- package/dist/factories/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/ICheckpointManager__factory.d.ts +51 -0
- package/dist/factories/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/ICheckpointManager__factory.d.ts.map +1 -0
- package/dist/factories/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/ICheckpointManager__factory.js +78 -0
- package/dist/factories/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/ICheckpointManager__factory.js.map +1 -0
- package/dist/factories/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/IFxStateSender__factory.d.ts +23 -0
- package/dist/factories/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/IFxStateSender__factory.d.ts.map +1 -0
- package/dist/factories/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/IFxStateSender__factory.js +34 -0
- package/dist/factories/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/IFxStateSender__factory.js.map +1 -0
- package/dist/factories/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/index.d.ts +4 -0
- package/dist/factories/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/index.d.ts.map +1 -0
- package/dist/factories/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/index.js +7 -0
- package/dist/factories/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/index.js.map +1 -0
- package/dist/factories/fx-portal/contracts/tunnel/index.d.ts +2 -0
- package/dist/factories/fx-portal/contracts/tunnel/index.d.ts.map +1 -0
- package/dist/factories/fx-portal/contracts/tunnel/index.js +5 -0
- package/dist/factories/fx-portal/contracts/tunnel/index.js.map +1 -0
- package/dist/factories/fx-portal/index.d.ts +2 -0
- package/dist/factories/fx-portal/index.d.ts.map +1 -0
- package/dist/factories/fx-portal/index.js +5 -0
- package/dist/factories/fx-portal/index.js.map +1 -0
- package/dist/factories/index.d.ts +1 -0
- package/dist/factories/index.d.ts.map +1 -1
- package/dist/factories/index.js +1 -0
- package/dist/factories/index.js.map +1 -1
- package/dist/fx-portal/contracts/index.d.ts +3 -0
- package/dist/fx-portal/contracts/index.d.ts.map +1 -0
- package/dist/fx-portal/contracts/index.js +2 -0
- package/dist/fx-portal/contracts/index.js.map +1 -0
- package/dist/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/FxBaseRootTunnel.d.ts +172 -0
- package/dist/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/FxBaseRootTunnel.d.ts.map +1 -0
- package/dist/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/FxBaseRootTunnel.js +2 -0
- package/dist/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/FxBaseRootTunnel.js.map +1 -0
- package/dist/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/ICheckpointManager.d.ts +122 -0
- package/dist/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/ICheckpointManager.d.ts.map +1 -0
- package/dist/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/ICheckpointManager.js +2 -0
- package/dist/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/ICheckpointManager.js.map +1 -0
- package/dist/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/IFxStateSender.d.ts +66 -0
- package/dist/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/IFxStateSender.d.ts.map +1 -0
- package/dist/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/IFxStateSender.js +2 -0
- package/dist/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/IFxStateSender.js.map +1 -0
- package/dist/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/index.d.ts +4 -0
- package/dist/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/index.d.ts.map +1 -0
- package/dist/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/index.js +2 -0
- package/dist/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol/index.js.map +1 -0
- package/dist/fx-portal/contracts/tunnel/index.d.ts +3 -0
- package/dist/fx-portal/contracts/tunnel/index.d.ts.map +1 -0
- package/dist/fx-portal/contracts/tunnel/index.js +2 -0
- package/dist/fx-portal/contracts/tunnel/index.js.map +1 -0
- package/dist/fx-portal/index.d.ts +3 -0
- package/dist/fx-portal/index.d.ts.map +1 -0
- package/dist/fx-portal/index.js +2 -0
- package/dist/fx-portal/index.js.map +1 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -1
- package/package.json +7 -5
|
@@ -0,0 +1,536 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.12;
|
|
3
|
+
|
|
4
|
+
import {ECDSAStakeRegistryStorage, Quorum, StrategyParams} from "./ECDSAStakeRegistryStorage.sol";
|
|
5
|
+
import {IStrategy} from "../interfaces/avs/vendored/IStrategy.sol";
|
|
6
|
+
import {IDelegationManager} from "../interfaces/avs/vendored/IDelegationManager.sol";
|
|
7
|
+
import {ISignatureUtils} from "../interfaces/avs/vendored/ISignatureUtils.sol";
|
|
8
|
+
import {IServiceManager} from "../interfaces/avs/vendored/IServiceManager.sol";
|
|
9
|
+
|
|
10
|
+
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
|
|
11
|
+
import {CheckpointsUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/CheckpointsUpgradeable.sol";
|
|
12
|
+
import {SignatureCheckerUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/SignatureCheckerUpgradeable.sol";
|
|
13
|
+
import {IERC1271Upgradeable} from "@openzeppelin/contracts-upgradeable/interfaces/IERC1271Upgradeable.sol";
|
|
14
|
+
|
|
15
|
+
/// @title ECDSA Stake Registry
|
|
16
|
+
/// @author Layr Labs, Inc.
|
|
17
|
+
/// @dev THIS CONTRACT IS NOT AUDITED
|
|
18
|
+
/// @notice Manages operator registration and quorum updates for an AVS using ECDSA signatures.
|
|
19
|
+
contract ECDSAStakeRegistry is
|
|
20
|
+
IERC1271Upgradeable,
|
|
21
|
+
OwnableUpgradeable,
|
|
22
|
+
ECDSAStakeRegistryStorage
|
|
23
|
+
{
|
|
24
|
+
using SignatureCheckerUpgradeable for address;
|
|
25
|
+
using CheckpointsUpgradeable for CheckpointsUpgradeable.History;
|
|
26
|
+
|
|
27
|
+
/// @dev Constructor to create ECDSAStakeRegistry.
|
|
28
|
+
/// @param _delegationManager Address of the DelegationManager contract that this registry interacts with.
|
|
29
|
+
constructor(
|
|
30
|
+
IDelegationManager _delegationManager
|
|
31
|
+
) ECDSAStakeRegistryStorage(_delegationManager) {
|
|
32
|
+
// _disableInitializers();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/// @notice Initializes the contract with the given parameters.
|
|
36
|
+
/// @param _serviceManager The address of the service manager.
|
|
37
|
+
/// @param _thresholdWeight The threshold weight in basis points.
|
|
38
|
+
/// @param _quorum The quorum struct containing the details of the quorum thresholds.
|
|
39
|
+
function initialize(
|
|
40
|
+
address _serviceManager,
|
|
41
|
+
uint256 _thresholdWeight,
|
|
42
|
+
Quorum memory _quorum
|
|
43
|
+
) external initializer {
|
|
44
|
+
__ECDSAStakeRegistry_init(_serviceManager, _thresholdWeight, _quorum);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/// @notice Registers a new operator using a provided signature
|
|
48
|
+
/// @param _operatorSignature Contains the operator's signature, salt, and expiry
|
|
49
|
+
function registerOperatorWithSignature(
|
|
50
|
+
address _operator,
|
|
51
|
+
ISignatureUtils.SignatureWithSaltAndExpiry memory _operatorSignature
|
|
52
|
+
) external {
|
|
53
|
+
_registerOperatorWithSig(_operator, _operatorSignature);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/// @notice Deregisters an existing operator
|
|
57
|
+
function deregisterOperator() external {
|
|
58
|
+
_deregisterOperator(msg.sender);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @notice Updates the StakeRegistry's view of one or more operators' stakes adding a new entry in their history of stake checkpoints,
|
|
63
|
+
* @dev Queries stakes from the Eigenlayer core DelegationManager contract
|
|
64
|
+
* @param _operators A list of operator addresses to update
|
|
65
|
+
*/
|
|
66
|
+
function updateOperators(address[] memory _operators) external {
|
|
67
|
+
_updateOperators(_operators);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @notice Updates the quorum configuration and the set of operators
|
|
72
|
+
* @dev Only callable by the contract owner.
|
|
73
|
+
* It first updates the quorum configuration and then updates the list of operators.
|
|
74
|
+
* @param _quorum The new quorum configuration, including strategies and their new weights
|
|
75
|
+
* @param _operators The list of operator addresses to update stakes for
|
|
76
|
+
*/
|
|
77
|
+
function updateQuorumConfig(
|
|
78
|
+
Quorum memory _quorum,
|
|
79
|
+
address[] memory _operators
|
|
80
|
+
) external onlyOwner {
|
|
81
|
+
_updateQuorumConfig(_quorum);
|
|
82
|
+
_updateOperators(_operators);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/// @notice Updates the weight an operator must have to join the operator set
|
|
86
|
+
/// @dev Access controlled to the contract owner
|
|
87
|
+
/// @param _newMinimumWeight The new weight an operator must have to join the operator set
|
|
88
|
+
function updateMinimumWeight(
|
|
89
|
+
uint256 _newMinimumWeight,
|
|
90
|
+
address[] memory _operators
|
|
91
|
+
) external onlyOwner {
|
|
92
|
+
_updateMinimumWeight(_newMinimumWeight);
|
|
93
|
+
_updateOperators(_operators);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @notice Sets a new cumulative threshold weight for message validation by operator set signatures.
|
|
98
|
+
* @dev This function can only be invoked by the owner of the contract. It delegates the update to
|
|
99
|
+
* an internal function `_updateStakeThreshold`.
|
|
100
|
+
* @param _thresholdWeight The updated threshold weight required to validate a message. This is the
|
|
101
|
+
* cumulative weight that must be met or exceeded by the sum of the stakes of the signatories for
|
|
102
|
+
* a message to be deemed valid.
|
|
103
|
+
*/
|
|
104
|
+
function updateStakeThreshold(uint256 _thresholdWeight) external onlyOwner {
|
|
105
|
+
_updateStakeThreshold(_thresholdWeight);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/// @notice Verifies if the provided signature data is valid for the given data hash.
|
|
109
|
+
/// @param _dataHash The hash of the data that was signed.
|
|
110
|
+
/// @param _signatureData Encoded signature data consisting of an array of signers, an array of signatures, and a reference block number.
|
|
111
|
+
/// @return The function selector that indicates the signature is valid according to ERC1271 standard.
|
|
112
|
+
function isValidSignature(
|
|
113
|
+
bytes32 _dataHash,
|
|
114
|
+
bytes memory _signatureData
|
|
115
|
+
) external view returns (bytes4) {
|
|
116
|
+
(
|
|
117
|
+
address[] memory signers,
|
|
118
|
+
bytes[] memory signatures,
|
|
119
|
+
uint32 referenceBlock
|
|
120
|
+
) = abi.decode(_signatureData, (address[], bytes[], uint32));
|
|
121
|
+
_checkSignatures(_dataHash, signers, signatures, referenceBlock);
|
|
122
|
+
return IERC1271Upgradeable.isValidSignature.selector;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/// @notice Retrieves the current stake quorum details.
|
|
126
|
+
/// @return Quorum - The current quorum of strategies and weights
|
|
127
|
+
function quorum() external view returns (Quorum memory) {
|
|
128
|
+
return _quorum;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/// @notice Retrieves the last recorded weight for a given operator.
|
|
132
|
+
/// @param _operator The address of the operator.
|
|
133
|
+
/// @return uint256 - The latest weight of the operator.
|
|
134
|
+
function getLastCheckpointOperatorWeight(
|
|
135
|
+
address _operator
|
|
136
|
+
) external view returns (uint256) {
|
|
137
|
+
return _operatorWeightHistory[_operator].latest();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/// @notice Retrieves the last recorded total weight across all operators.
|
|
141
|
+
/// @return uint256 - The latest total weight.
|
|
142
|
+
function getLastCheckpointTotalWeight() external view returns (uint256) {
|
|
143
|
+
return _totalWeightHistory.latest();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/// @notice Retrieves the last recorded threshold weight
|
|
147
|
+
/// @return uint256 - The latest threshold weight.
|
|
148
|
+
function getLastCheckpointThresholdWeight()
|
|
149
|
+
external
|
|
150
|
+
view
|
|
151
|
+
returns (uint256)
|
|
152
|
+
{
|
|
153
|
+
return _thresholdWeightHistory.latest();
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/// @notice Retrieves the operator's weight at a specific block number.
|
|
157
|
+
/// @param _operator The address of the operator.
|
|
158
|
+
/// @param _blockNumber The block number to get the operator weight for the quorum
|
|
159
|
+
/// @return uint256 - The weight of the operator at the given block.
|
|
160
|
+
function getOperatorWeightAtBlock(
|
|
161
|
+
address _operator,
|
|
162
|
+
uint32 _blockNumber
|
|
163
|
+
) external view returns (uint256) {
|
|
164
|
+
return _operatorWeightHistory[_operator].getAtBlock(_blockNumber);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/// @notice Retrieves the total weight at a specific block number.
|
|
168
|
+
/// @param _blockNumber The block number to get the total weight for the quorum
|
|
169
|
+
/// @return uint256 - The total weight at the given block.
|
|
170
|
+
function getLastCheckpointTotalWeightAtBlock(
|
|
171
|
+
uint32 _blockNumber
|
|
172
|
+
) external view returns (uint256) {
|
|
173
|
+
return _totalWeightHistory.getAtBlock(_blockNumber);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/// @notice Retrieves the threshold weight at a specific block number.
|
|
177
|
+
/// @param _blockNumber The block number to get the threshold weight for the quorum
|
|
178
|
+
/// @return uint256 - The threshold weight the given block.
|
|
179
|
+
function getLastCheckpointThresholdWeightAtBlock(
|
|
180
|
+
uint32 _blockNumber
|
|
181
|
+
) external view returns (uint256) {
|
|
182
|
+
return _thresholdWeightHistory.getAtBlock(_blockNumber);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function operatorRegistered(
|
|
186
|
+
address _operator
|
|
187
|
+
) external view returns (bool) {
|
|
188
|
+
return _operatorRegistered[_operator];
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/// @notice Returns the weight an operator must have to contribute to validating an AVS
|
|
192
|
+
function minimumWeight() external view returns (uint256) {
|
|
193
|
+
return _minimumWeight;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/// @notice Calculates the current weight of an operator based on their delegated stake in the strategies considered in the quorum
|
|
197
|
+
/// @param _operator The address of the operator.
|
|
198
|
+
/// @return uint256 - The current weight of the operator; returns 0 if below the threshold.
|
|
199
|
+
function getOperatorWeight(
|
|
200
|
+
address _operator
|
|
201
|
+
) public view returns (uint256) {
|
|
202
|
+
StrategyParams[] memory strategyParams = _quorum.strategies;
|
|
203
|
+
uint256 weight;
|
|
204
|
+
IStrategy[] memory strategies = new IStrategy[](strategyParams.length);
|
|
205
|
+
for (uint256 i; i < strategyParams.length; i++) {
|
|
206
|
+
strategies[i] = strategyParams[i].strategy;
|
|
207
|
+
}
|
|
208
|
+
uint256[] memory shares = DELEGATION_MANAGER.getOperatorShares(
|
|
209
|
+
_operator,
|
|
210
|
+
strategies
|
|
211
|
+
);
|
|
212
|
+
for (uint256 i; i < strategyParams.length; i++) {
|
|
213
|
+
weight += shares[i] * strategyParams[i].multiplier;
|
|
214
|
+
}
|
|
215
|
+
weight = weight / BPS;
|
|
216
|
+
|
|
217
|
+
if (weight >= _minimumWeight) {
|
|
218
|
+
return weight;
|
|
219
|
+
} else {
|
|
220
|
+
return 0;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/// @notice Initializes state for the StakeRegistry
|
|
225
|
+
/// @param _serviceManagerAddr The AVS' ServiceManager contract's address
|
|
226
|
+
function __ECDSAStakeRegistry_init(
|
|
227
|
+
address _serviceManagerAddr,
|
|
228
|
+
uint256 _thresholdWeight,
|
|
229
|
+
Quorum memory _quorum
|
|
230
|
+
) internal onlyInitializing {
|
|
231
|
+
_serviceManager = _serviceManagerAddr;
|
|
232
|
+
_updateStakeThreshold(_thresholdWeight);
|
|
233
|
+
_updateQuorumConfig(_quorum);
|
|
234
|
+
__Ownable_init();
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/// @notice Updates the set of operators for the first quorum.
|
|
238
|
+
/// @param operatorsPerQuorum An array of operator address arrays, one for each quorum.
|
|
239
|
+
/// @dev This interface maintains compatibility with avs-sync which handles multiquorums while this registry has a single quorum
|
|
240
|
+
function updateOperatorsForQuorum(
|
|
241
|
+
address[][] memory operatorsPerQuorum,
|
|
242
|
+
bytes memory
|
|
243
|
+
) external {
|
|
244
|
+
_updateAllOperators(operatorsPerQuorum[0]);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/// @dev Updates the list of operators if the provided list has the correct number of operators.
|
|
248
|
+
/// Reverts if the provided list of operators does not match the expected total count of operators.
|
|
249
|
+
/// @param _operators The list of operator addresses to update.
|
|
250
|
+
function _updateAllOperators(address[] memory _operators) internal {
|
|
251
|
+
if (_operators.length != _totalOperators) {
|
|
252
|
+
revert MustUpdateAllOperators();
|
|
253
|
+
}
|
|
254
|
+
_updateOperators(_operators);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/// @dev Updates the weights for a given list of operator addresses.
|
|
258
|
+
/// When passing an operator that isn't registered, then 0 is added to their history
|
|
259
|
+
/// @param _operators An array of addresses for which to update the weights.
|
|
260
|
+
function _updateOperators(address[] memory _operators) internal {
|
|
261
|
+
int256 delta;
|
|
262
|
+
for (uint256 i; i < _operators.length; i++) {
|
|
263
|
+
delta += _updateOperatorWeight(_operators[i]);
|
|
264
|
+
}
|
|
265
|
+
_updateTotalWeight(delta);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/// @dev Updates the stake threshold weight and records the history.
|
|
269
|
+
/// @param _thresholdWeight The new threshold weight to set and record in the history.
|
|
270
|
+
function _updateStakeThreshold(uint256 _thresholdWeight) internal {
|
|
271
|
+
_thresholdWeightHistory.push(_thresholdWeight);
|
|
272
|
+
emit ThresholdWeightUpdated(_thresholdWeight);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/// @dev Updates the weight an operator must have to join the operator set
|
|
276
|
+
/// @param _newMinimumWeight The new weight an operator must have to join the operator set
|
|
277
|
+
function _updateMinimumWeight(uint256 _newMinimumWeight) internal {
|
|
278
|
+
uint256 oldMinimumWeight = _minimumWeight;
|
|
279
|
+
_minimumWeight = _newMinimumWeight;
|
|
280
|
+
emit MinimumWeightUpdated(oldMinimumWeight, _newMinimumWeight);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/// @notice Updates the quorum configuration
|
|
284
|
+
/// @dev Replaces the current quorum configuration with `_newQuorum` if valid.
|
|
285
|
+
/// Reverts with `InvalidQuorum` if the new quorum configuration is not valid.
|
|
286
|
+
/// Emits `QuorumUpdated` event with the old and new quorum configurations.
|
|
287
|
+
/// @param _newQuorum The new quorum configuration to set.
|
|
288
|
+
function _updateQuorumConfig(Quorum memory _newQuorum) internal {
|
|
289
|
+
if (!_isValidQuorum(_newQuorum)) {
|
|
290
|
+
revert InvalidQuorum();
|
|
291
|
+
}
|
|
292
|
+
Quorum memory oldQuorum = _quorum;
|
|
293
|
+
delete _quorum;
|
|
294
|
+
for (uint256 i; i < _newQuorum.strategies.length; i++) {
|
|
295
|
+
_quorum.strategies.push(_newQuorum.strategies[i]);
|
|
296
|
+
}
|
|
297
|
+
emit QuorumUpdated(oldQuorum, _newQuorum);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/// @dev Internal function to deregister an operator
|
|
301
|
+
/// @param _operator The operator's address to deregister
|
|
302
|
+
function _deregisterOperator(address _operator) internal {
|
|
303
|
+
if (!_operatorRegistered[_operator]) {
|
|
304
|
+
revert OperatorNotRegistered();
|
|
305
|
+
}
|
|
306
|
+
_totalOperators--;
|
|
307
|
+
delete _operatorRegistered[_operator];
|
|
308
|
+
int256 delta = _updateOperatorWeight(_operator);
|
|
309
|
+
_updateTotalWeight(delta);
|
|
310
|
+
IServiceManager(_serviceManager).deregisterOperatorFromAVS(_operator);
|
|
311
|
+
emit OperatorDeregistered(_operator, address(_serviceManager));
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/// @dev registers an operator through a provided signature
|
|
315
|
+
/// @param _operatorSignature Contains the operator's signature, salt, and expiry
|
|
316
|
+
function _registerOperatorWithSig(
|
|
317
|
+
address _operator,
|
|
318
|
+
ISignatureUtils.SignatureWithSaltAndExpiry memory _operatorSignature
|
|
319
|
+
) internal virtual {
|
|
320
|
+
if (_operatorRegistered[_operator]) {
|
|
321
|
+
revert OperatorAlreadyRegistered();
|
|
322
|
+
}
|
|
323
|
+
_totalOperators++;
|
|
324
|
+
_operatorRegistered[_operator] = true;
|
|
325
|
+
int256 delta = _updateOperatorWeight(_operator);
|
|
326
|
+
_updateTotalWeight(delta);
|
|
327
|
+
IServiceManager(_serviceManager).registerOperatorToAVS(
|
|
328
|
+
_operator,
|
|
329
|
+
_operatorSignature
|
|
330
|
+
);
|
|
331
|
+
emit OperatorRegistered(_operator, _serviceManager);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/// @notice Updates the weight of an operator and returns the previous and current weights.
|
|
335
|
+
/// @param _operator The address of the operator to update the weight of.
|
|
336
|
+
function _updateOperatorWeight(
|
|
337
|
+
address _operator
|
|
338
|
+
) internal virtual returns (int256) {
|
|
339
|
+
int256 delta;
|
|
340
|
+
uint256 newWeight;
|
|
341
|
+
uint256 oldWeight = _operatorWeightHistory[_operator].latest();
|
|
342
|
+
if (!_operatorRegistered[_operator]) {
|
|
343
|
+
delta -= int256(oldWeight);
|
|
344
|
+
if (delta == 0) {
|
|
345
|
+
return delta;
|
|
346
|
+
}
|
|
347
|
+
_operatorWeightHistory[_operator].push(0);
|
|
348
|
+
} else {
|
|
349
|
+
newWeight = getOperatorWeight(_operator);
|
|
350
|
+
delta = int256(newWeight) - int256(oldWeight);
|
|
351
|
+
if (delta == 0) {
|
|
352
|
+
return delta;
|
|
353
|
+
}
|
|
354
|
+
_operatorWeightHistory[_operator].push(newWeight);
|
|
355
|
+
}
|
|
356
|
+
emit OperatorWeightUpdated(_operator, oldWeight, newWeight);
|
|
357
|
+
return delta;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/// @dev Internal function to update the total weight of the stake
|
|
361
|
+
/// @param delta The change in stake applied last total weight
|
|
362
|
+
/// @return oldTotalWeight The weight before the update
|
|
363
|
+
/// @return newTotalWeight The updated weight after applying the delta
|
|
364
|
+
function _updateTotalWeight(
|
|
365
|
+
int256 delta
|
|
366
|
+
) internal returns (uint256 oldTotalWeight, uint256 newTotalWeight) {
|
|
367
|
+
oldTotalWeight = _totalWeightHistory.latest();
|
|
368
|
+
int256 newWeight = int256(oldTotalWeight) + delta;
|
|
369
|
+
newTotalWeight = uint256(newWeight);
|
|
370
|
+
_totalWeightHistory.push(newTotalWeight);
|
|
371
|
+
emit TotalWeightUpdated(oldTotalWeight, newTotalWeight);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* @dev Verifies that a specified quorum configuration is valid. A valid quorum has:
|
|
376
|
+
* 1. Weights that sum to exactly 10,000 basis points, ensuring proportional representation.
|
|
377
|
+
* 2. Unique strategies without duplicates to maintain quorum integrity.
|
|
378
|
+
* @param _quorum The quorum configuration to be validated.
|
|
379
|
+
* @return bool True if the quorum configuration is valid, otherwise false.
|
|
380
|
+
*/
|
|
381
|
+
function _isValidQuorum(
|
|
382
|
+
Quorum memory _quorum
|
|
383
|
+
) internal pure returns (bool) {
|
|
384
|
+
StrategyParams[] memory strategies = _quorum.strategies;
|
|
385
|
+
address lastStrategy;
|
|
386
|
+
address currentStrategy;
|
|
387
|
+
uint256 totalMultiplier;
|
|
388
|
+
for (uint256 i; i < strategies.length; i++) {
|
|
389
|
+
currentStrategy = address(strategies[i].strategy);
|
|
390
|
+
if (lastStrategy >= currentStrategy) revert NotSorted();
|
|
391
|
+
lastStrategy = currentStrategy;
|
|
392
|
+
totalMultiplier += strategies[i].multiplier;
|
|
393
|
+
}
|
|
394
|
+
if (totalMultiplier != BPS) {
|
|
395
|
+
return false;
|
|
396
|
+
} else {
|
|
397
|
+
return true;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* @notice Common logic to verify a batch of ECDSA signatures against a hash, using either last stake weight or at a specific block.
|
|
403
|
+
* @param _dataHash The hash of the data the signers endorsed.
|
|
404
|
+
* @param _signers A collection of addresses that endorsed the data hash.
|
|
405
|
+
* @param _signatures A collection of signatures matching the signers.
|
|
406
|
+
* @param _referenceBlock The block number for evaluating stake weight; use max uint32 for latest weight.
|
|
407
|
+
*/
|
|
408
|
+
function _checkSignatures(
|
|
409
|
+
bytes32 _dataHash,
|
|
410
|
+
address[] memory _signers,
|
|
411
|
+
bytes[] memory _signatures,
|
|
412
|
+
uint32 _referenceBlock
|
|
413
|
+
) internal view {
|
|
414
|
+
uint256 signersLength = _signers.length;
|
|
415
|
+
address lastSigner;
|
|
416
|
+
uint256 signedWeight;
|
|
417
|
+
|
|
418
|
+
_validateSignaturesLength(signersLength, _signatures.length);
|
|
419
|
+
for (uint256 i; i < signersLength; i++) {
|
|
420
|
+
address currentSigner = _signers[i];
|
|
421
|
+
|
|
422
|
+
_validateSortedSigners(lastSigner, currentSigner);
|
|
423
|
+
_validateSignature(currentSigner, _dataHash, _signatures[i]);
|
|
424
|
+
|
|
425
|
+
lastSigner = currentSigner;
|
|
426
|
+
uint256 operatorWeight = _getOperatorWeight(
|
|
427
|
+
currentSigner,
|
|
428
|
+
_referenceBlock
|
|
429
|
+
);
|
|
430
|
+
signedWeight += operatorWeight;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
_validateThresholdStake(signedWeight, _referenceBlock);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/// @notice Validates that the number of signers equals the number of signatures, and neither is zero.
|
|
437
|
+
/// @param _signersLength The number of signers.
|
|
438
|
+
/// @param _signaturesLength The number of signatures.
|
|
439
|
+
function _validateSignaturesLength(
|
|
440
|
+
uint256 _signersLength,
|
|
441
|
+
uint256 _signaturesLength
|
|
442
|
+
) internal pure {
|
|
443
|
+
if (_signersLength != _signaturesLength) {
|
|
444
|
+
revert LengthMismatch();
|
|
445
|
+
}
|
|
446
|
+
if (_signersLength == 0) {
|
|
447
|
+
revert InvalidLength();
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/// @notice Ensures that signers are sorted in ascending order by address.
|
|
452
|
+
/// @param _lastSigner The address of the last signer.
|
|
453
|
+
/// @param _currentSigner The address of the current signer.
|
|
454
|
+
function _validateSortedSigners(
|
|
455
|
+
address _lastSigner,
|
|
456
|
+
address _currentSigner
|
|
457
|
+
) internal pure {
|
|
458
|
+
if (_lastSigner >= _currentSigner) {
|
|
459
|
+
revert NotSorted();
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/// @notice Validates a given signature against the signer's address and data hash.
|
|
464
|
+
/// @param _signer The address of the signer to validate.
|
|
465
|
+
/// @param _dataHash The hash of the data that is signed.
|
|
466
|
+
/// @param _signature The signature to validate.
|
|
467
|
+
function _validateSignature(
|
|
468
|
+
address _signer,
|
|
469
|
+
bytes32 _dataHash,
|
|
470
|
+
bytes memory _signature
|
|
471
|
+
) internal view {
|
|
472
|
+
if (!_signer.isValidSignatureNow(_dataHash, _signature)) {
|
|
473
|
+
revert InvalidSignature();
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/// @notice Retrieves the operator weight for a signer, either at the last checkpoint or a specified block.
|
|
478
|
+
/// @param _signer The address of the signer whose weight is returned.
|
|
479
|
+
/// @param _referenceBlock The block number to query the operator's weight at, or the maximum uint32 value for the last checkpoint.
|
|
480
|
+
/// @return The weight of the operator.
|
|
481
|
+
function _getOperatorWeight(
|
|
482
|
+
address _signer,
|
|
483
|
+
uint32 _referenceBlock
|
|
484
|
+
) internal view returns (uint256) {
|
|
485
|
+
if (_referenceBlock == type(uint32).max) {
|
|
486
|
+
return _operatorWeightHistory[_signer].latest();
|
|
487
|
+
} else {
|
|
488
|
+
return _operatorWeightHistory[_signer].getAtBlock(_referenceBlock);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/// @notice Retrieve the total stake weight at a specific block or the latest if not specified.
|
|
493
|
+
/// @dev If the `_referenceBlock` is the maximum value for uint32, the latest total weight is returned.
|
|
494
|
+
/// @param _referenceBlock The block number to retrieve the total stake weight from.
|
|
495
|
+
/// @return The total stake weight at the given block or the latest if the given block is the max uint32 value.
|
|
496
|
+
function _getTotalWeight(
|
|
497
|
+
uint32 _referenceBlock
|
|
498
|
+
) internal view returns (uint256) {
|
|
499
|
+
if (_referenceBlock == type(uint32).max) {
|
|
500
|
+
return _totalWeightHistory.latest();
|
|
501
|
+
} else {
|
|
502
|
+
return _totalWeightHistory.getAtBlock(_referenceBlock);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/// @notice Retrieves the threshold stake for a given reference block.
|
|
507
|
+
/// @param _referenceBlock The block number to query the threshold stake for.
|
|
508
|
+
/// If set to the maximum uint32 value, it retrieves the latest threshold stake.
|
|
509
|
+
/// @return The threshold stake in basis points for the reference block.
|
|
510
|
+
function _getThresholdStake(
|
|
511
|
+
uint32 _referenceBlock
|
|
512
|
+
) internal view returns (uint256) {
|
|
513
|
+
if (_referenceBlock == type(uint32).max) {
|
|
514
|
+
return _thresholdWeightHistory.latest();
|
|
515
|
+
} else {
|
|
516
|
+
return _thresholdWeightHistory.getAtBlock(_referenceBlock);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/// @notice Validates that the cumulative stake of signed messages meets or exceeds the required threshold.
|
|
521
|
+
/// @param _signedWeight The cumulative weight of the signers that have signed the message.
|
|
522
|
+
/// @param _referenceBlock The block number to verify the stake threshold for
|
|
523
|
+
function _validateThresholdStake(
|
|
524
|
+
uint256 _signedWeight,
|
|
525
|
+
uint32 _referenceBlock
|
|
526
|
+
) internal view {
|
|
527
|
+
uint256 totalWeight = _getTotalWeight(_referenceBlock);
|
|
528
|
+
if (_signedWeight > totalWeight) {
|
|
529
|
+
revert InvalidSignedWeight();
|
|
530
|
+
}
|
|
531
|
+
uint256 thresholdStake = _getThresholdStake(_referenceBlock);
|
|
532
|
+
if (thresholdStake > _signedWeight) {
|
|
533
|
+
revert InsufficientSignedStake();
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.12;
|
|
3
|
+
|
|
4
|
+
import {IDelegationManager} from "../interfaces/avs/vendored/IDelegationManager.sol";
|
|
5
|
+
import {CheckpointsUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/CheckpointsUpgradeable.sol";
|
|
6
|
+
import {IECDSAStakeRegistryEventsAndErrors, Quorum, StrategyParams} from "../interfaces/avs/vendored/IECDSAStakeRegistryEventsAndErrors.sol";
|
|
7
|
+
|
|
8
|
+
/// @author Layr Labs, Inc.
|
|
9
|
+
abstract contract ECDSAStakeRegistryStorage is
|
|
10
|
+
IECDSAStakeRegistryEventsAndErrors
|
|
11
|
+
{
|
|
12
|
+
/// @notice Manages staking delegations through the DelegationManager interface
|
|
13
|
+
IDelegationManager internal immutable DELEGATION_MANAGER;
|
|
14
|
+
|
|
15
|
+
/// @dev The total amount of multipliers to weigh stakes
|
|
16
|
+
uint256 internal constant BPS = 10_000;
|
|
17
|
+
|
|
18
|
+
/// @notice The size of the current operator set
|
|
19
|
+
uint256 internal _totalOperators;
|
|
20
|
+
|
|
21
|
+
/// @notice Stores the current quorum configuration
|
|
22
|
+
Quorum internal _quorum;
|
|
23
|
+
|
|
24
|
+
/// @notice Specifies the weight required to become an operator
|
|
25
|
+
uint256 internal _minimumWeight;
|
|
26
|
+
|
|
27
|
+
/// @notice Holds the address of the service manager
|
|
28
|
+
address internal _serviceManager;
|
|
29
|
+
|
|
30
|
+
/// @notice Defines the duration after which the stake's weight expires.
|
|
31
|
+
uint256 internal _stakeExpiry;
|
|
32
|
+
|
|
33
|
+
/// @notice Tracks the total stake history over time using checkpoints
|
|
34
|
+
CheckpointsUpgradeable.History internal _totalWeightHistory;
|
|
35
|
+
|
|
36
|
+
/// @notice Tracks the threshold bps history using checkpoints
|
|
37
|
+
CheckpointsUpgradeable.History internal _thresholdWeightHistory;
|
|
38
|
+
|
|
39
|
+
/// @notice Maps operator addresses to their respective stake histories using checkpoints
|
|
40
|
+
mapping(address => CheckpointsUpgradeable.History)
|
|
41
|
+
internal _operatorWeightHistory;
|
|
42
|
+
|
|
43
|
+
/// @notice Maps an operator to their registration status
|
|
44
|
+
mapping(address => bool) internal _operatorRegistered;
|
|
45
|
+
|
|
46
|
+
/// @param _delegationManager Connects this registry with the DelegationManager
|
|
47
|
+
constructor(IDelegationManager _delegationManager) {
|
|
48
|
+
DELEGATION_MANAGER = _delegationManager;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// slither-disable-next-line shadowing-state
|
|
52
|
+
/// @dev Reserves storage slots for future upgrades
|
|
53
|
+
// solhint-disable-next-line
|
|
54
|
+
uint256[42] private __gap;
|
|
55
|
+
}
|