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

feat(contracts): EL middleware #22

Merged
merged 27 commits into from
Jan 22, 2025
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6aab4bd
wip: init middleware
merklefruit Jan 13, 2025
795844b
forge install: eigenlayer-contracts
merklefruit Jan 13, 2025
ab4791f
chore: add contracts CI workflow
merklefruit Jan 14, 2025
0eaf3f0
feat: initial allocation manager hooks
merklefruit Jan 14, 2025
4613d47
feat: added strategies logic
merklefruit Jan 14, 2025
0d46606
feat: port method to get collaterals
merklefruit Jan 14, 2025
b710421
chore: fix compile errors
merklefruit Jan 14, 2025
b3b41f2
chore: compile errors due to remappings
merklefruit Jan 15, 2025
fe7c334
chore: init fork tests
merklefruit Jan 15, 2025
67387c7
feat: use restaking protocols enum
merklefruit Jan 15, 2025
fb84b67
chore: fmt
merklefruit Jan 15, 2025
163412b
feat: move to individual restaking protocol vars, extract operators lib
merklefruit Jan 16, 2025
96af82e
feat: initial registration EL tests
merklefruit Jan 16, 2025
d64fc67
forge install: core
merklefruit Jan 17, 2025
8035096
chore: revert install symbiotic/core
merklefruit Jan 17, 2025
76511aa
forge install: middleware-sdk
merklefruit Jan 17, 2025
5f143a3
feat: migrate to PausableEnumerableSet
merklefruit Jan 20, 2025
36ea5df
chore: init flow for depositing shares
merklefruit Jan 20, 2025
606f515
feat: working collateral deposit test
merklefruit Jan 20, 2025
2ed71ec
chore: rm operators registry test file
merklefruit Jan 21, 2025
be9c436
feat: refactor middleware to use strategy timestamps
merklefruit Jan 21, 2025
6c102f4
fix: tests
merklefruit Jan 21, 2025
a584f21
feat: impl getOperatorStake
merklefruit Jan 21, 2025
dbc819d
feat: add backwards compatible opt-in
merklefruit Jan 22, 2025
4a505d4
feat: add extraData to operator registration
merklefruit Jan 22, 2025
f6368eb
feat: first EL mainnet opt-in test
merklefruit Jan 22, 2025
8662901
feat: added more middleware tests
merklefruit Jan 22, 2025
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
Prev Previous commit
Next Next commit
chore: fix compile errors
merklefruit committed Jan 14, 2025
commit b7104217d56dfcceed8e539389626db1905c8d4f
2 changes: 1 addition & 1 deletion smart-contracts/foundry.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[profile.default]
solc = "0.8.25"
solc = "0.8.27"
via_ir = true
src = "src"
out = "out"
Original file line number Diff line number Diff line change
@@ -83,7 +83,9 @@ contract BoltEigenLayerMiddlewareV1 is OwnableUpgradeable, UUPSUpgradeable, IAVS
/// @param operator The operator address to get the collaterals and amounts staked for
/// @return collaterals The collaterals staked by the operator
/// @dev Assumes that the operator is registered and enabled
function getOperatorCollaterals(address operator) public view returns (address[] memory, uint256[] memory) {
function getOperatorCollaterals(
address operator
) public view returns (address[] memory, uint256[] memory) {
address[] memory collateralTokens = new address[](whitelistedStrategies.length());
uint256[] memory amounts = new uint256[](whitelistedStrategies.length());

@@ -99,7 +101,7 @@ contract BoltEigenLayerMiddlewareV1 is OwnableUpgradeable, UUPSUpgradeable, IAVS
// get the collateral tokens and amounts for the operator across all strategies
for (uint256 i = 0; i < strategies.length(); i++) {
collateralTokens[i] = address(strategies[i].underlyingToken());
amounts[i] = strategy.sharesToUnderlyingView(shares);
amounts[i] = strategies[i].sharesToUnderlyingView(shares);
}

return (collateralTokens, amounts);
@@ -108,7 +110,7 @@ contract BoltEigenLayerMiddlewareV1 is OwnableUpgradeable, UUPSUpgradeable, IAVS
/// @notice Slash an operator in the AVS
/// @param params The parameters for slashing the operator
function slashOperator(
SlashingParams calldata params
IAllocationManagerTypes.SlashingParams calldata params
) public {
// TODO: Implement slashing logic