-
Notifications
You must be signed in to change notification settings - Fork 0
/
IACP99SecurityModule.sol
66 lines (58 loc) · 2.09 KB
/
IACP99SecurityModule.sol
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
// SPDX-License-Identifier: BUSL-1.1
// SPDX-FileCopyrightText: Copyright 2024 ADDPHO
pragma solidity 0.8.25;
import {IACP99Manager, ValidatorUptimeInfo} from "./IACP99Manager.sol";
/**
* @notice Information about a validator registration
* @param nodeID The NodeID of the validator node
* @param validationID The ValidationID of the validation
* @param weight The initial weight assigned to the validator
* @param startTime The timestamp when the validation started
*/
struct ValidatorRegistrationInfo {
bytes32 nodeID;
bytes32 validationID;
uint64 weight;
uint64 startTime;
}
/**
* @notice Information about a change in a validator's weight
* @param nodeID The NodeID of the validator node
* @param validationID The ValidationID of the validation
* @param nonce A sequential number to order weight changes
* @param newWeight The new weight assigned to the validator
* @param uptime The uptime information for the validator
*/
struct ValidatorWeightChangeInfo {
bytes32 nodeID;
bytes32 validationID;
uint64 nonce;
uint64 newWeight;
ValidatorUptimeInfo uptimeInfo;
}
/*
* @title IACP99SecurityModule
* @author ADDPHO
* @notice The IACP99SecurityModule interface is the interface for the ACP99 security modules.
* @custom:security-contact [email protected]
*/
interface IACP99SecurityModule {
error ACP99SecurityModule__ZeroAddressManager();
error ACP99SecurityModule__OnlyManager(address sender, address manager);
/// @notice Get the address of the ACP99Manager contract secured by this module
function getManagerAddress() external view returns (address);
/**
* @notice Handle a validator registration
* @param validatorInfo The information about the validator
*/
function handleValidatorRegistration(
ValidatorRegistrationInfo memory validatorInfo
) external;
/**
* @notice Handle a validator weight change
* @param weightChangeInfo The information about the validator weight change
*/
function handleValidatorWeightChange(
ValidatorWeightChangeInfo memory weightChangeInfo
) external;
}