mirror of
https://github.com/datahaven-xyz/datahaven
synced 2026-05-24 01:38:32 +00:00
In this PR:
1. Implement application-specific functionalities in the
`DataHavenServiceManager` contract:
1. Registering of 3 operator sets: Validators, BSPs and MSPs.
2. Allowlisted sign up of operators.
3. Integration with Snowbridge to send message of new validator set.
2. Basic testing of the above functionalities.
3. Tests now use less mocked contracts (especially from EigenLayer).
4. Refactor of `SignUpOperator` script, which now supports the three
kinds of Operator sets.
33 lines
934 B
Solidity
33 lines
934 B
Solidity
// SPDX-License-Identifier: UNLICENSED
|
|
pragma solidity ^0.8.27;
|
|
|
|
import {SignUpOperatorBase} from "./SignUpOperatorBase.s.sol";
|
|
import {DataHavenServiceManager} from "../../src/DataHavenServiceManager.sol";
|
|
|
|
/**
|
|
* @title SignUpValidator
|
|
* @notice Script to sign up a validator for the DataHaven network
|
|
*/
|
|
contract SignUpValidator is SignUpOperatorBase {
|
|
/**
|
|
* @inheritdoc SignUpOperatorBase
|
|
*/
|
|
function _getOperatorSetId() internal view override returns (uint32) {
|
|
return serviceManager.VALIDATORS_SET_ID();
|
|
}
|
|
|
|
/**
|
|
* @inheritdoc SignUpOperatorBase
|
|
*/
|
|
function _addToAllowlist() internal override {
|
|
vm.broadcast(_avsOwnerPrivateKey);
|
|
serviceManager.addValidatorToAllowlist(_operator);
|
|
}
|
|
|
|
/**
|
|
* @inheritdoc SignUpOperatorBase
|
|
*/
|
|
function _getOperatorTypeName() internal pure override returns (string memory) {
|
|
return "VALIDATOR";
|
|
}
|
|
}
|