Skip to content

Commit

Permalink
feat: config for symbiotic mainnet deployment (#565)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaspitz authored Jan 15, 2025
1 parent 02ac227 commit eb0bf6f
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 3 deletions.
2 changes: 1 addition & 1 deletion contracts/lib/core
Submodule core updated 81 files
+23 −1 .gitignore
+2 −1 README.md
+5 −0 foundry.toml
+1 −0 out/DelegatorFactory.sol/DelegatorFactory.json
+1 −0 out/DelegatorHints.sol/BaseDelegatorHints.json
+1 −0 out/DelegatorHints.sol/FullRestakeDelegatorHints.json
+1 −0 out/DelegatorHints.sol/NetworkRestakeDelegatorHints.json
+1 −0 out/DelegatorHints.sol/OperatorNetworkSpecificDelegatorHints.json
+1 −0 out/DelegatorHints.sol/OperatorSpecificDelegatorHints.json
+1 −0 out/FullRestakeDelegator.sol/FullRestakeDelegator.json
+1 −0 out/MetadataService.sol/MetadataService.json
+1 −0 out/NetworkMiddlewareService.sol/NetworkMiddlewareService.json
+1 −0 out/NetworkRegistry.sol/NetworkRegistry.json
+1 −0 out/NetworkRestakeDelegator.sol/NetworkRestakeDelegator.json
+1 −0 out/OperatorNetworkSpecificDelegator.sol/OperatorNetworkSpecificDelegator.json
+1 −0 out/OperatorRegistry.sol/OperatorRegistry.json
+1 −0 out/OperatorSpecificDelegator.sol/OperatorSpecificDelegator.json
+1 −0 out/OptInService.sol/OptInService.json
+1 −0 out/OptInServiceHints.sol/OptInServiceHints.json
+1 −0 out/Slasher.sol/Slasher.json
+1 −0 out/SlasherFactory.sol/SlasherFactory.json
+1 −0 out/SlasherHints.sol/BaseSlasherHints.json
+1 −0 out/SlasherHints.sol/SlasherHints.json
+1 −0 out/SlasherHints.sol/VetoSlasherHints.json
+1 −0 out/Vault.sol/Vault.json
+1 −0 out/VaultConfigurator.sol/VaultConfigurator.json
+1 −0 out/VaultFactory.sol/VaultFactory.json
+1 −0 out/VaultHints.sol/VaultHints.json
+1 −0 out/VaultTokenized.sol/VaultTokenized.json
+1 −0 out/VetoSlasher.sol/VetoSlasher.json
+1 −1 package.json
+15 −0 script/deploy/Core.s.sol
+33 −2 script/deploy/Vault.s.sol
+33 −2 script/deploy/VaultTokenized.s.sol
+536 −0 script/integration/SymbioticCoreBindings.sol
+1,204 −0 script/integration/SymbioticCoreInit.sol
+148 −0 script/integration/SymbioticInit.sol
+146 −0 script/integration/examples/OnboardNetwork.s.sol
+2 −2 specs/Vault.md
+1 −1 src/contracts/common/Registry.sol
+1 −1 src/contracts/common/StaticDelegateCallable.sol
+122 −0 src/contracts/delegator/OperatorNetworkSpecificDelegator.sol
+73 −2 src/contracts/hints/DelegatorHints.sol
+2 −0 src/contracts/vault/VaultStorage.sol
+65 −0 src/interfaces/delegator/IOperatorNetworkSpecificDelegator.sol
+14 −0 test/DelegatorFactory.t.sol
+3 −1 test/POC.t.sol
+194 −116 test/POCBase.t.sol
+14 −0 test/SlasherFactory.t.sol
+14 −0 test/VaultConfigurator.t.sol
+14 −0 test/VaultFactory.t.sol
+29 −15 test/delegator/FullRestakeDelegator.t.sol
+29 −15 test/delegator/NetworkRestakeDelegator.t.sol
+1,529 −0 test/delegator/OperatorNetworkSpecificDelegator.t.sol
+26 −11 test/delegator/OperatorSpecificDelegator.t.sol
+536 −0 test/integration/SymbioticCoreBindings.sol
+451 −0 test/integration/SymbioticCoreConstants.sol
+39 −0 test/integration/SymbioticCoreImports.sol
+39 −0 test/integration/SymbioticCoreImportsContracts.sol
+1,539 −0 test/integration/SymbioticCoreInit.sol
+393 −0 test/integration/SymbioticCoreIntegration.sol
+247 −0 test/integration/SymbioticCoreIntegrationExample.t.sol
+10 −0 test/integration/SymbioticCounter.sol
+179 −0 test/integration/SymbioticInit.sol
+1 −1 test/mocks/DAILikeToken.sol
+1 −1 test/mocks/FakeEntity.sol
+1 −1 test/mocks/FeeOnTransferToken.sol
+1 −1 test/mocks/PermitToken.sol
+1 −1 test/mocks/RebaseToken.sol
+1 −1 test/mocks/SimpleBurner.sol
+4 −4 test/mocks/SimpleFullRestakeDelegatorHook.sol
+4 −4 test/mocks/SimpleNetworkRestakeDelegatorHook.sol
+17 −0 test/mocks/SimpleOperatorNetworkSpecificDelegatorHook.sol
+4 −4 test/mocks/SimpleOperatorSpecificDelegatorHook.sol
+1 −1 test/mocks/SimpleRegistry.sol
+1 −1 test/mocks/Token.sol
+9 −9 test/service/OptInService.t.sol
+30 −16 test/slasher/Slasher.t.sol
+45 −31 test/slasher/VetoSlasher.t.sol
+37 −23 test/vault/Vault.t.sol
+38 −24 test/vault/VaultTokenized.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";
import {MevCommitMiddleware} from "../../../contracts/validator-registry/middleware/MevCommitMiddleware.sol";
import {IRegistry} from "symbiotic-core/interfaces/common/IRegistry.sol";
import {INetworkRegistry} from "symbiotic-core/interfaces/INetworkRegistry.sol";
import {SymbioticHoleskyDevnetConsts} from "./ReleaseAddrConsts.s.sol";
import {SymbioticHoleskyDevnetConsts, SymbioticMainnetConsts} from "./ReleaseAddrConsts.s.sol";
import {IBaseDelegator} from "symbiotic-core/interfaces/delegator/IBaseDelegator.sol";
import {INetworkMiddlewareService} from "symbiotic-core/interfaces/service/INetworkMiddlewareService.sol";
import {MainnetConstants} from "../../MainnetConstants.sol";

contract BaseDeploy is Script {
function deployMevCommitMiddleware(
Expand Down Expand Up @@ -55,6 +56,44 @@ contract BaseDeploy is Script {
}
}

contract DeployMainnet is BaseDeploy {
IRegistry constant public NETWORK_REGISTRY = IRegistry(SymbioticMainnetConsts.NETWORK_REGISTRY);
IRegistry constant public OPERATOR_REGISTRY = IRegistry(SymbioticMainnetConsts.OPERATOR_REGISTRY);
IRegistry constant public VAULT_FACTORY = IRegistry(SymbioticMainnetConsts.VAULT_FACTORY);
IRegistry constant public DELEGATOR_FACTORY = IRegistry(SymbioticMainnetConsts.DELEGATOR_FACTORY);
IRegistry constant public SLASHER_FACTORY = IRegistry(SymbioticMainnetConsts.SLASHER_FACTORY);
IRegistry constant public BURNER_ROUTER_FACTORY = IRegistry(SymbioticMainnetConsts.BURNER_ROUTER_FACTORY);

address constant public OWNER = MainnetConstants.PRIMEV_TEAM_MULTISIG;
address constant public NETWORK = MainnetConstants.PRIMEV_TEAM_MULTISIG;
uint256 constant public SLASH_PERIOD_SECONDS = 1 days;
address constant public SLASH_ORACLE = MainnetConstants.PRIMEV_TEAM_MULTISIG;
address constant public SLASH_RECEIVER = MainnetConstants.COMMITMENT_HOLDINGS_MULTISIG;
uint256 constant public MIN_BURNER_ROUTER_DELAY = 2 days;

function run() external {
require(block.chainid == 1, "must deploy on mainnet");
vm.startBroadcast();

deployMevCommitMiddleware(
NETWORK_REGISTRY,
OPERATOR_REGISTRY,
VAULT_FACTORY,
DELEGATOR_FACTORY,
SLASHER_FACTORY,
BURNER_ROUTER_FACTORY,
NETWORK,
SLASH_PERIOD_SECONDS,
SLASH_ORACLE,
SLASH_RECEIVER,
MIN_BURNER_ROUTER_DELAY,
OWNER
);

vm.stopBroadcast();
}
}

contract DeployHolesky is BaseDeploy {

IRegistry constant public NETWORK_REGISTRY = IRegistry(SymbioticHoleskyDevnetConsts.NETWORK_REGISTRY);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
// SPDX-License-Identifier: BSL 1.1
pragma solidity 0.8.26;

/// @notice Relevant constants communicated by Symbiotic team as canonical mainnet addresses.
/// @notice Last updated 1-14-2025
library SymbioticMainnetConsts {
address internal constant NETWORK_REGISTRY = 0xC773b1011461e7314CF05f97d95aa8e92C1Fd8aA;
address internal constant OPERATOR_REGISTRY = 0xAd817a6Bc954F678451A71363f04150FDD81Af9F;
address internal constant VAULT_FACTORY = 0xAEb6bdd95c502390db8f52c8909F703E9Af6a346;
address internal constant DELEGATOR_FACTORY = 0x985Ed57AF9D475f1d83c1c1c8826A0E5A34E8C7B;
address internal constant SLASHER_FACTORY = 0x685c2eD7D59814d2a597409058Ee7a92F21e48Fd;
address internal constant BURNER_ROUTER_FACTORY = 0x99F2B89fB3C363fBafD8d826E5AA77b28bAB70a0;
}

/// @notice Constants from https://docs.symbiotic.fi/deployments/current
/// @notice Last updated 11-30-2024
library SymbioticHoleskyDevnetConsts {
Expand Down

0 comments on commit eb0bf6f

Please sign in to comment.