-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d5b5b93
commit c77a480
Showing
12 changed files
with
84 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,6 @@ pragma solidity 0.8.25; | |
|
||
import {PoSValidatorManager} from "./PoSValidatorManager.sol"; | ||
import {PoSValidatorManagerSettings} from "./interfaces/IPoSValidatorManager.sol"; | ||
import {ValidatorRegistrationInput} from "./interfaces/IValidatorManager.sol"; | ||
import {INativeTokenStakingManager} from "./interfaces/INativeTokenStakingManager.sol"; | ||
import {INativeMinter} from | ||
"@avalabs/[email protected]/contracts/interfaces/INativeMinter.sol"; | ||
import {ICMInitializable} from "@utilities/ICMInitializable.sol"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,10 +6,8 @@ | |
pragma solidity 0.8.25; | ||
|
||
import { | ||
ValidatorManagerSettings, | ||
ValidatorRegistrationInput | ||
ValidatorManagerSettings | ||
} from "./interfaces/IValidatorManager.sol"; | ||
import {IPoAValidatorManager} from "./interfaces/IPoAValidatorManager.sol"; | ||
import {ICMInitializable} from "@utilities/ICMInitializable.sol"; | ||
import {OwnableUpgradeable} from | ||
"@openzeppelin/[email protected]/access/OwnableUpgradeable.sol"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,14 +7,10 @@ pragma solidity 0.8.25; | |
|
||
import {ValidatorMessages} from "./ValidatorMessages.sol"; | ||
import { | ||
InitialValidator, | ||
IValidatorManager, | ||
PChainOwner, | ||
ConversionData, | ||
Validator, | ||
ValidatorChurnPeriod, | ||
ValidatorManagerSettings, | ||
ValidatorRegistrationInput, | ||
ValidatorStatus | ||
} from "./interfaces/IValidatorManager.sol"; | ||
import { | ||
|
@@ -26,6 +22,7 @@ import {ContextUpgradeable} from | |
import {Initializable} from | ||
"@openzeppelin/[email protected]/proxy/utils/Initializable.sol"; | ||
import {IACP99SecurityModule} from "./interfaces/IACP99SecurityModule.sol"; | ||
import {ValidatorRegistrationInput, ConversionData, PChainOwner, InitialValidator} from "./interfaces/IACP99ValidatorManager.sol"; | ||
|
||
/** | ||
* @dev Implementation of the {IValidatorManager} interface. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
contracts/validator-manager/interfaces/IACP99ValidatorManager.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// (c) 2024, Ava Labs, Inc. All rights reserved. | ||
// See the file LICENSE for licensing terms. | ||
|
||
// SPDX-License-Identifier: Ecosystem | ||
|
||
pragma solidity 0.8.25; | ||
|
||
/** | ||
* @dev Specifies the owner of a validator's remaining balance or disable owner on the P-Chain. | ||
* P-Chain addresses are also 20-bytes, so we use the address type to represent them. | ||
*/ | ||
struct PChainOwner { | ||
uint32 threshold; | ||
address[] addresses; | ||
} | ||
|
||
/** | ||
* @dev Specifies an initial validator, used in the conversion data. | ||
*/ | ||
struct InitialValidator { | ||
bytes nodeID; | ||
bytes blsPublicKey; | ||
uint64 weight; | ||
} | ||
|
||
/** | ||
* @dev Description of the conversion data used to convert | ||
* a subnet to an L1 on the P-Chain. | ||
* This data is the pre-image of a hash that is authenticated by the P-Chain | ||
* and verified by the Validator Manager. | ||
*/ | ||
struct ConversionData { | ||
bytes32 subnetID; | ||
bytes32 validatorManagerBlockchainID; | ||
address validatorManagerAddress; | ||
InitialValidator[] initialValidators; | ||
} | ||
|
||
/** | ||
* @dev Specifies a validator to register. | ||
*/ | ||
struct ValidatorRegistrationInput { | ||
bytes nodeID; | ||
bytes blsPublicKey; | ||
uint64 registrationExpiry; | ||
PChainOwner remainingBalanceOwner; | ||
PChainOwner disableOwner; | ||
} | ||
|
||
interface IACP99ValidatorManager { | ||
function initializeValidatorSet( | ||
ConversionData calldata conversionData, | ||
uint32 messageIndex | ||
) external; | ||
|
||
function initializeValidatorRegistration( | ||
ValidatorRegistrationInput calldata input, | ||
uint64 weight, | ||
bytes calldata args | ||
) external returns (bytes32); | ||
|
||
function completeValidatorRegistration(uint32 messageIndex) external; | ||
|
||
function initializeEndValidation(bytes32 validationID, bytes calldata args) external; | ||
|
||
function completeEndValidation(uint32 messageIndex) external; | ||
|
||
function initializeValidatorWeightChange(bytes32 validationID, uint64 weight, bytes calldata args) external; | ||
|
||
function completeValidatorWeightChange(bytes32 validationID, bytes calldata args) external; | ||
} |
38 changes: 0 additions & 38 deletions
38
contracts/validator-manager/interfaces/IERC20TokenStakingManager.sol
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
contracts/validator-manager/interfaces/INativeTokenStakingManager.sol
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
contracts/validator-manager/interfaces/IPoAValidatorManager.sol
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters