Skip to content

Commit

Permalink
Merge pull request #235 from chainbound/lore/feat/middleware-interface
Browse files Browse the repository at this point in the history
feat: contracts middleware interface
  • Loading branch information
merklefruit authored Sep 30, 2024
2 parents 94ee1e2 + 18f2554 commit 2cd43db
Show file tree
Hide file tree
Showing 10 changed files with 1,105 additions and 945 deletions.
18 changes: 10 additions & 8 deletions bolt-contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ coordination of validators, operators, and vaults within the Bolt network.

Key features include:

1. Registration of Symbiotic Operators and Vaults / EigenLayer Operators and Strategies
2. Whitelisting of collateral assets used to back commitments
3. Retrieval of operator stake and proposer status from their pubkey
4. Integration with Symbiotic/EigenLayer
1. Retrieval of operator stake and proposer status from their pubkey
2. Integration with Symbiotic
3. Integration with Eigenlayer

Specific functionalities about the restaking protocols are handled inside
the `IBoltMiddleware` contracts, such as `BoltSymbioticMiddleware` and `BoltEigenlayerMiddleware`.

### Symbiotic Integration guide for Staking Pools

Expand All @@ -61,9 +63,9 @@ on how to spin up a Vault and start receiving stake from your node operators.

Opting into Bolt works as any other Symbiotic middleware integration. Here are the steps:

1. Make sure your vault collateral is whitelisted in `BoltManager` by calling `isSymbioticCollateralWhitelisted`.
2. Register as a vault in `BoltManager` by calling `registerSymbioticVault`.
3. Verify that your vault is active in `BoltManager` by calling `isSymbioticVaultEnabled`.
1. Make sure your vault collateral is whitelisted in `BoltSymbioticMiddleware` by calling `isCollateralWhitelisted`.
2. Register as a vault in `BoltSymbioticMiddleware` by calling `registerVault`.
3. Verify that your vault is active in `BoltSymbioticMiddleware` by calling `isVaultEnabled`.
4. Set the network limit for your vault in Symbiotic with `Vault.delegator().setNetworkLimit()`.
5. You can now start approving operators that opt in to your vault directly in Symbiotic.
6. When you assign shares to operators, they are able to provide commitments on behalf of your collateral.
Expand All @@ -78,7 +80,7 @@ The opt-in process requires the following steps:
1. register in Symbiotic with `OperatorRegistry.registerOperator()`.
2. opt-in to the Bolt network with `OperatorNetworkOptInService.optIn(networkAddress)`.
3. opt-in to any vault with `OperatorVaultOptInService.optIn(vaultAddress)`.
4. register in Bolt with `BoltManager.registerSymbioticOperator(operatorAddress)`.
4. register in Bolt with `BoltSymbioticMiddleware.registerOperator(operatorAddress)`.
5. get approved by the vault.
6. start providing commitments with the stake provided by the vault.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import {Script, console} from "forge-std/Script.sol";

import {BoltValidators} from "../src/contracts/BoltValidators.sol";
import {BoltManager} from "../src/contracts/BoltManager.sol";
import {BoltEigenLayerMiddleware} from "../src/contracts/BoltEigenLayerMiddleware.sol";
import {BoltSymbioticMiddleware} from "../src/contracts/BoltSymbioticMiddleware.sol";

/// @notice Script to deploy the BoltManager and BoltValidators contracts.
contract DeployBoltManager is Script {
contract DeployBolt is Script {
function run(
address symbioticNetwork,
address symbioticOperatorRegistry,
Expand All @@ -24,19 +26,22 @@ contract DeployBoltManager is Script {
BoltValidators validators = new BoltValidators(sender);
console.log("BoltValidators deployed at", address(validators));

BoltManager manager = new BoltManager(
address(sender),
BoltManager manager = new BoltManager(sender, address(validators));
console.log("BoltManager deployed at", address(manager));

BoltEigenLayerMiddleware eigenLayerMiddleware = new BoltEigenLayerMiddleware(
sender, address(validators), eigenlayerAVSDirectory, eigenlayerDelegationManager, eigenlayerStrategyManager
);
console.log("BoltEigenLayerMiddleware deployed at", address(eigenLayerMiddleware));
BoltSymbioticMiddleware symbioticMiddleware = new BoltSymbioticMiddleware(
sender,
address(validators),
symbioticNetwork,
symbioticOperatorRegistry,
symbioticOperatorNetOptIn,
symbioticVaultRegistry,
eigenlayerAVSDirectory,
eigenlayerDelegationManager,
eigenlayerStrategyManager
symbioticVaultRegistry
);
console.log("BoltManager deployed at", address(manager));

console.log("BoltSymbioticMiddleware deployed at", address(eigenLayerMiddleware));
vm.stopBroadcast();
}
}
Loading

0 comments on commit 2cd43db

Please sign in to comment.