Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support new delegator type #16

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 0 additions & 110 deletions src/extensions/operators/ApprovalRegisterOperators.sol

This file was deleted.

61 changes: 0 additions & 61 deletions src/extensions/operators/ForcePauseApprovalRegisterOperators.sol

This file was deleted.

63 changes: 0 additions & 63 deletions src/interfaces/extensions/operators/IApprovalRegisterOperators.sol

This file was deleted.

10 changes: 7 additions & 3 deletions src/managers/VaultManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ abstract contract VaultManager is NetworkStorage, SlashingWindowStorage, Capture
enum DelegatorType {
FULL_RESTAKE,
NETWORK_RESTAKE,
OPERATOR_SPECIFIC
OPERATOR_SPECIFIC,
OPERATOR_NETWORK_SPECIFIC
}

// keccak256(abi.encode(uint256(keccak256("symbiotic.storage.VaultManager")) - 1)) & ~bytes32(uint256(0xff))
Expand Down Expand Up @@ -732,9 +733,12 @@ abstract contract VaultManager is NetworkStorage, SlashingWindowStorage, Capture

function _validateOperatorVault(address operator, address vault) internal view {
address delegator = IVault(vault).delegator();
uint64 delegatorType = IEntity(delegator).TYPE();
if (
IEntity(delegator).TYPE() != uint64(DelegatorType.OPERATOR_SPECIFIC)
|| IOperatorSpecificDelegator(delegator).operator() != operator
(
delegatorType != uint64(DelegatorType.OPERATOR_SPECIFIC)
&& delegatorType != uint64(DelegatorType.OPERATOR_NETWORK_SPECIFIC)
) || IOperatorSpecificDelegator(delegator).operator() != operator
) {
revert NotOperatorSpecificVault();
}
Expand Down
Loading