mirror of
https://github.com/datahaven-xyz/datahaven
synced 2026-05-24 01:38:32 +00:00
## Summary - Flatten `ServiceManagerBase` middleware layer directly into `DataHavenServiceManager` - Remove all unused EigenLayer integration code to keep the contract minimal - Fix access control on `deregisterOperatorFromOperatorSets` (was missing `onlyOwner`) ## Motivation The `ServiceManagerBase` from eigenlayer-middleware was designed for the old `AVSDirectory` model and included many generic functions DataHaven doesn't use. This refactor: - Reduces code complexity and contract size - Removes ~200 lines of unused code - Makes the codebase easier to audit and maintain - Keeps only what DataHaven actually needs ## Changes ### Architecture Before: DataHavenServiceManager → ServiceManagerBase → ServiceManagerBaseStorage → OwnableUpgradeable After: DataHavenServiceManager → OwnableUpgradeable, IAVSRegistrar, IDataHavenServiceManager ### Removed (unused) - `IServiceManager` and `IServiceManagerUI` interfaces (old AVSDirectory model) - `ServiceManagerBase` and `ServiceManagerBaseStorage` middleware - `PermissionController` integration (5 proxy functions) - `createOperatorSets()` - only needed at initialization - `avs()` - never called ### Kept (with fixes) - `deregisterOperatorFromOperatorSets()` - added `onlyOwner` modifier (security fix) - `updateAVSMetadataURI()` - needed for EigenLayer registration ### Files Deleted - `src/interfaces/IServiceManager.sol` - `src/interfaces/IServiceManagerUI.sol` - `src/middleware/ServiceManagerBase.sol` - `src/middleware/ServiceManagerBaseStorage.sol` - `test/mocks/ServiceManagerMock.sol` - `test/ServiceManagerBase.t.sol` ## Test Plan - [x] `forge build` passes - [x] `forge test` - all 10 tests pass - [x] Contract bindings regenerated - [x] State diff regenerated
1 line
No EOL
1.2 KiB
JSON
1 line
No EOL
1.2 KiB
JSON
{"network": "anvil","BeefyClient": "0x99bbA657f2BbC93c02D617f8bA121cB8Fc104Acf","AgentExecutor": "0x0E801D84Fa97b50751Dbf25036d067dCf18858bF","Gateway": "0x9d4454B023096f34B160D6B654540c56A1F81688","ServiceManager": "0x809d550fca64d94Bd9F66E60752A544199cfAC3D","ServiceManagerImplementation": "0x36C02dA8a0983159322a80FFE9F24b1acfF8B570","RewardsAgent": "0xac06641381166cf085281c45292147f833C622d7","DelegationManager": "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82","StrategyManager": "0x9A676e781A523b5d0C0e43731313A708CB607508","AVSDirectory": "0x0B306BF915C4d645ff596e518fAf3F9669b97016","EigenPodManager": "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1","EigenPodBeacon": "0x4ed7c70F96B99c776995fB64377f0d4aB3B0e1C1","RewardsCoordinator": "0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AE","AllocationManager": "0x68B1D87F95878fE05B998F19b66F4baba5De1aed","PermissionController": "0x3Aa5ebB10DC797CAC828524e59A333d0A371443c","ETHPOSDeposit": "0xC7f2Cf4845C6db0e1a1e91ED41Bcd0FcC1b0E141","BaseStrategyImplementation": "0xf5059a5D33d5853360D16C683c16e67980206f36","DeployedStrategies": [{"address": "0x998abeb3E57409262aE5b751f60747921B33613E","underlyingToken": "0x95401dc811bb5740090279Ba06cfA8fcF6113778","tokenCreator": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"}]} |