-
Notifications
You must be signed in to change notification settings - Fork 436
Feat/operator sets #579
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
Merged
Merged
Feat/operator sets #579
Changes from 6 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
5dbd94a
feat: operator set scaffold
ypatil12 51ff168
fix: impl/storage compile errors; pending updating of tests
ypatil12 d477943
chore: `forge fmt`
0xClandestine bcf7d21
fix: `OperatorSet` struct misuse
0xClandestine 3ff5cb6
fix: comment
ypatil12 b31d4ed
Merge branch 'feat/operator-sets' of https://github.com/Layr-Labs/eig…
0xClandestine 73cf5e2
chore: verbose use of `OperatorSet`
0xClandestine 5d6a28c
test: `registerOperatorToOperatorSet`
0xClandestine e94c74b
feat: `registerOperatorToOperatorSets`
0xClandestine 331afaa
chore: `forge fmt`
0xClandestine b4724c0
feat: interface changes
0xClandestine 17e9f78
fix: operator set digest
0xClandestine 6bcc71c
fix: `OPERATOR_SET_REGISTRATION_TYPEHASH`
0xClandestine 08aa8fc
chore: `forge fmt`
0xClandestine 0b07f47
test: wrong avs using signature
0xClandestine 97a6dba
fix: optimize for SSTOREs
0xClandestine e9359ad
test: `deregisterOperatorFromOperatorSets`
0xClandestine b92b285
chore: rename `operatorSetStrategies`
0xClandestine 18c7133
test: `addStrategiesToOperatorSet`
0xClandestine b869392
test: `removeStrategiesFromOperatorSet`
0xClandestine c4437c6
test: more coverage
0xClandestine 5d09658
chore: improve natspec
0xClandestine 648cc94
WIP: simp mode
0xClandestine d8c046f
WIP: simp mode
0xClandestine d12ea4c
WIP: simp mode
0xClandestine c926f2f
test: simp mode
0xClandestine 92479e2
test: simp mode
0xClandestine 27ed1a1
test: simp mode
0xClandestine 3b0450e
refactor: simp mode storage
0xClandestine 5f90d78
Revert "refactor: simp mode storage"
0xClandestine f4c3ae5
Reapply "refactor: simp mode storage"
0xClandestine c190c1b
feat: simp mode
0xClandestine 3b984ab
fix(optimize): salt cancellation
0xClandestine b944193
test: improvements
0xClandestine 98d0c4f
test: improvements
0xClandestine d83a870
fix: move `isOperatorSetAVS` update out of loop
0xClandestine 1fa4a42
fix: standby update typehash
0xClandestine 1e9609f
test: cleanup
0xClandestine 1328e23
fix: move mutation out of loop
0xClandestine 0553d18
nit: cleanup
0xClandestine 22ceb9c
fix: remove unused events
ypatil12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -4,8 +4,6 @@ pragma solidity ^0.8.12; | |
import "../interfaces/IAVSDirectory.sol"; | ||
import "../interfaces/IStrategyManager.sol"; | ||
import "../interfaces/IDelegationManager.sol"; | ||
import "../interfaces/ISlasher.sol"; | ||
import "../interfaces/IEigenPodManager.sol"; | ||
|
||
abstract contract AVSDirectoryStorage is IAVSDirectory { | ||
/// @notice The EIP-712 typehash for the contract's domain | ||
|
@@ -16,31 +14,52 @@ abstract contract AVSDirectoryStorage is IAVSDirectory { | |
bytes32 public constant OPERATOR_AVS_REGISTRATION_TYPEHASH = | ||
keccak256("OperatorAVSRegistration(address operator,address avs,bytes32 salt,uint256 expiry)"); | ||
|
||
/// @notice The EIP-712 typehash for the `OperatorSetRegistration` struct used by the contract | ||
bytes32 public constant OPERATOR_SET_REGISTRATION_TYPEHASH = keccak256( | ||
"OperatorSetRegistration(address operator,address avs,uint32 operatorSetID,bytes32 salt,uint256 expiry)" | ||
); | ||
|
||
/// @notice The DelegationManager contract for EigenLayer | ||
IDelegationManager public immutable delegation; | ||
|
||
/// @notice The StrategyManager contract for EigenLayer | ||
IStrategyManager public immutable strategyManager; | ||
|
||
/** | ||
* @notice Original EIP-712 Domain separator for this contract. | ||
* @dev The domain separator may change in the event of a fork that modifies the ChainID. | ||
* Use the getter function `domainSeparator` to get the current domain separator for this contract. | ||
*/ | ||
bytes32 internal _DOMAIN_SEPARATOR; | ||
|
||
/// @notice Mapping: AVS => operator => enum of operator status to the AVS | ||
mapping(address => mapping(address => OperatorAVSRegistrationStatus)) public avsOperatorStatus; | ||
|
||
/// @notice Mapping: operator => 32-byte salt => whether or not the salt has already been used by the operator. | ||
/// @dev Salt is used in the `registerOperatorToAVS` function. | ||
/// @dev Salt is used in the `registerOperatorToAVS` and `registerOperatorToOperatorSet` function. | ||
mapping(address => mapping(bytes32 => bool)) public operatorSaltIsSpent; | ||
|
||
constructor(IDelegationManager _delegation) { | ||
/// @notice Mapping: AVS => whether or not the AVS uses operator set | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: standardize lower or uppercase avs in comments |
||
mapping(address => bool) public isOperatorSetAVS; | ||
|
||
/// @notice Mapping: AVS => operatorSetID => strategy => whether or not the strategy is in the operator set | ||
mapping(address => mapping(uint32 => mapping(IStrategy => bool))) public operatorSetStrategies; | ||
0xClandestine marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/// @notice Mapping: avs => operator => operatorSetID => whether the operator is registered for the operator set | ||
mapping(address => mapping(address => mapping(uint32 => bool))) public operatorSetRegistrations; | ||
|
||
/// @notice Mapping: avs => operator => number of operator sets the operator is registered for the AVS | ||
mapping(address => mapping(address => uint256)) public operatorAVSOperatorSetCount; | ||
|
||
constructor(IDelegationManager _delegation, IStrategyManager _strategyManager) { | ||
delegation = _delegation; | ||
strategyManager = _strategyManager; | ||
} | ||
|
||
/** | ||
* @dev This empty reserved space is put in place to allow future versions to add new | ||
* variables without shifting down storage in the inheritance chain. | ||
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps | ||
*/ | ||
uint256[47] private __gap; | ||
uint256[43] private __gap; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.