2025-04-03 17:06:32 +00:00
|
|
|
// SPDX-License-Identifier: UNLICENSED
|
|
|
|
|
pragma solidity ^0.8.27;
|
|
|
|
|
|
|
|
|
|
import {EmptyContract} from "eigenlayer-contracts/src/test/mocks/EmptyContract.sol";
|
|
|
|
|
import {Config} from "./Config.sol";
|
|
|
|
|
import {Script} from "forge-std/Script.sol";
|
2025-07-16 07:38:58 +00:00
|
|
|
import {TestUtils} from "../../test/utils/TestUtils.sol";
|
2025-04-03 17:06:32 +00:00
|
|
|
|
|
|
|
|
contract DeployParams is Script, Config {
|
|
|
|
|
function getSnowbridgeConfig() public view returns (SnowbridgeConfig memory) {
|
|
|
|
|
SnowbridgeConfig memory config;
|
|
|
|
|
|
|
|
|
|
string memory configPath = string.concat(
|
|
|
|
|
vm.projectRoot(), "/config/", vm.envOr("NETWORK", string("anvil")), ".json"
|
|
|
|
|
);
|
|
|
|
|
string memory configJson = vm.readFile(configPath);
|
|
|
|
|
|
|
|
|
|
config.randaoCommitDelay = vm.parseJsonUint(configJson, ".snowbridge.randaoCommitDelay");
|
|
|
|
|
config.randaoCommitExpiration =
|
|
|
|
|
vm.parseJsonUint(configJson, ".snowbridge.randaoCommitExpiration");
|
|
|
|
|
config.minNumRequiredSignatures =
|
|
|
|
|
vm.parseJsonUint(configJson, ".snowbridge.minNumRequiredSignatures");
|
|
|
|
|
config.startBlock = uint64(vm.parseJsonUint(configJson, ".snowbridge.startBlock"));
|
|
|
|
|
config.rewardsMessageOrigin =
|
|
|
|
|
vm.parseJsonBytes32(configJson, ".snowbridge.rewardsMessageOrigin");
|
|
|
|
|
|
|
|
|
|
// Load validators from file or generate placeholder ones in dev mode
|
|
|
|
|
bool isDevMode = keccak256(abi.encodePacked(vm.envOr("DEV_MODE", string("false"))))
|
|
|
|
|
== keccak256(abi.encodePacked("true"));
|
|
|
|
|
if (isDevMode) {
|
2025-07-16 07:38:58 +00:00
|
|
|
config.initialValidatorHashes = TestUtils.generateMockValidators(10);
|
|
|
|
|
config.nextValidatorHashes = TestUtils.generateMockValidators(10);
|
2025-04-03 17:06:32 +00:00
|
|
|
} else {
|
2025-07-16 07:38:58 +00:00
|
|
|
config.initialValidatorHashes =
|
|
|
|
|
_loadValidatorsFromConfig(configJson, ".snowbridge.initialValidatorHashes");
|
|
|
|
|
config.nextValidatorHashes =
|
|
|
|
|
_loadValidatorsFromConfig(configJson, ".snowbridge.nextValidatorHashes");
|
2025-04-03 17:06:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return config;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getAVSConfig() public view returns (AVSConfig memory) {
|
|
|
|
|
AVSConfig memory config;
|
|
|
|
|
|
|
|
|
|
string memory configPath = string.concat(
|
|
|
|
|
vm.projectRoot(), "/config/", vm.envOr("NETWORK", string("anvil")), ".json"
|
|
|
|
|
);
|
|
|
|
|
string memory configJson = vm.readFile(configPath);
|
|
|
|
|
|
|
|
|
|
// Load from JSON config or use environment variables as fallback
|
|
|
|
|
config.avsOwner = vm.parseJsonAddress(configJson, ".avs.avsOwner");
|
|
|
|
|
config.rewardsInitiator = vm.parseJsonAddress(configJson, ".avs.rewardsInitiator");
|
|
|
|
|
config.vetoCommitteeMember = vm.parseJsonAddress(configJson, ".avs.vetoCommitteeMember");
|
|
|
|
|
config.vetoWindowBlocks = uint32(vm.parseJsonUint(configJson, ".avs.vetoWindowBlocks"));
|
2025-04-16 15:49:35 +00:00
|
|
|
config.validatorsStrategies =
|
|
|
|
|
vm.parseJsonAddressArray(configJson, ".avs.validatorsStrategies");
|
2025-04-03 17:06:32 +00:00
|
|
|
|
|
|
|
|
return config;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getEigenLayerConfig() public view returns (EigenLayerConfig memory) {
|
|
|
|
|
EigenLayerConfig memory config;
|
|
|
|
|
|
|
|
|
|
string memory configPath = string.concat(
|
|
|
|
|
vm.projectRoot(), "/config/", vm.envOr("NETWORK", string("anvil")), ".json"
|
|
|
|
|
);
|
|
|
|
|
string memory configJson = vm.readFile(configPath);
|
|
|
|
|
|
|
|
|
|
// Load from JSON config or use environment variables as fallback
|
2025-04-11 23:54:20 +00:00
|
|
|
config.pauserAddresses = _loadAddressesFromConfig(configJson, ".eigenLayer.pausers");
|
2025-04-03 17:06:32 +00:00
|
|
|
config.unpauserAddress = vm.parseJsonAddress(configJson, ".eigenLayer.unpauser");
|
|
|
|
|
config.rewardsUpdater = vm.parseJsonAddress(configJson, ".eigenLayer.rewardsUpdater");
|
|
|
|
|
config.calculationIntervalSeconds =
|
|
|
|
|
uint32(vm.parseJsonUint(configJson, ".eigenLayer.calculationIntervalSeconds"));
|
|
|
|
|
config.maxRewardsDuration =
|
|
|
|
|
uint32(vm.parseJsonUint(configJson, ".eigenLayer.maxRewardsDuration"));
|
|
|
|
|
config.maxRetroactiveLength =
|
|
|
|
|
uint32(vm.parseJsonUint(configJson, ".eigenLayer.maxRetroactiveLength"));
|
|
|
|
|
config.maxFutureLength = uint32(vm.parseJsonUint(configJson, ".eigenLayer.maxFutureLength"));
|
|
|
|
|
config.genesisRewardsTimestamp =
|
|
|
|
|
uint32(vm.parseJsonUint(configJson, ".eigenLayer.genesisRewardsTimestamp"));
|
|
|
|
|
config.activationDelay = uint32(vm.parseJsonUint(configJson, ".eigenLayer.activationDelay"));
|
|
|
|
|
config.globalCommissionBips =
|
|
|
|
|
uint16(vm.parseJsonUint(configJson, ".eigenLayer.globalCommissionBips"));
|
|
|
|
|
config.executorMultisig = vm.parseJsonAddress(configJson, ".eigenLayer.executorMultisig");
|
|
|
|
|
config.operationsMultisig =
|
|
|
|
|
vm.parseJsonAddress(configJson, ".eigenLayer.operationsMultisig");
|
|
|
|
|
|
|
|
|
|
// Use default values if not specified in config
|
|
|
|
|
try vm.parseJsonUint(configJson, ".eigenLayer.minWithdrawalDelayBlocks") returns (
|
|
|
|
|
uint256 val
|
|
|
|
|
) {
|
|
|
|
|
config.minWithdrawalDelayBlocks = uint32(val);
|
|
|
|
|
} catch {
|
|
|
|
|
config.minWithdrawalDelayBlocks = 7 days / 12 seconds; // Default: 1 week in blocks at 12s per block
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try vm.parseJsonUint(configJson, ".eigenLayer.delegationWithdrawalDelayBlocks") returns (
|
|
|
|
|
uint256 val
|
|
|
|
|
) {
|
|
|
|
|
config.delegationWithdrawalDelayBlocks = uint32(val);
|
|
|
|
|
} catch {
|
|
|
|
|
config.delegationWithdrawalDelayBlocks = 7 days / 12 seconds; // Default: 1 week
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try vm.parseJsonUint(configJson, ".eigenLayer.strategyManagerInitPausedStatus") returns (
|
|
|
|
|
uint256 val
|
|
|
|
|
) {
|
|
|
|
|
config.strategyManagerInitPausedStatus = val;
|
|
|
|
|
} catch {
|
|
|
|
|
config.strategyManagerInitPausedStatus = 0; // Unpause all
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try vm.parseJsonUint(configJson, ".eigenLayer.delegationInitPausedStatus") returns (
|
|
|
|
|
uint256 val
|
|
|
|
|
) {
|
|
|
|
|
config.delegationInitPausedStatus = val;
|
|
|
|
|
} catch {
|
|
|
|
|
config.delegationInitPausedStatus = 0; // Unpause all
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try vm.parseJsonUint(configJson, ".eigenLayer.eigenPodManagerInitPausedStatus") returns (
|
|
|
|
|
uint256 val
|
|
|
|
|
) {
|
|
|
|
|
config.eigenPodManagerInitPausedStatus = val;
|
|
|
|
|
} catch {
|
|
|
|
|
config.eigenPodManagerInitPausedStatus = 0; // Unpause all
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try vm.parseJsonUint(configJson, ".eigenLayer.rewardsCoordinatorInitPausedStatus") returns (
|
|
|
|
|
uint256 val
|
|
|
|
|
) {
|
|
|
|
|
config.rewardsCoordinatorInitPausedStatus = val;
|
|
|
|
|
} catch {
|
|
|
|
|
config.rewardsCoordinatorInitPausedStatus = 0; // Unpause all
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try vm.parseJsonUint(configJson, ".eigenLayer.allocationManagerInitPausedStatus") returns (
|
|
|
|
|
uint256 val
|
|
|
|
|
) {
|
|
|
|
|
config.allocationManagerInitPausedStatus = val;
|
|
|
|
|
} catch {
|
|
|
|
|
config.allocationManagerInitPausedStatus = 0; // Unpause all
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try vm.parseJsonUint(configJson, ".eigenLayer.deallocationDelay") returns (uint256 val) {
|
|
|
|
|
config.deallocationDelay = uint32(val);
|
|
|
|
|
} catch {
|
|
|
|
|
config.deallocationDelay = 7 days; // Default: 1 week
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try vm.parseJsonUint(configJson, ".eigenLayer.allocationConfigurationDelay") returns (
|
|
|
|
|
uint256 val
|
|
|
|
|
) {
|
|
|
|
|
config.allocationConfigurationDelay = uint32(val);
|
|
|
|
|
} catch {
|
|
|
|
|
config.allocationConfigurationDelay = 1 days; // Default: 1 day
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try vm.parseJsonUint(configJson, ".eigenLayer.beaconChainGenesisTimestamp") returns (
|
|
|
|
|
uint256 val
|
|
|
|
|
) {
|
|
|
|
|
config.beaconChainGenesisTimestamp = uint64(val);
|
|
|
|
|
} catch {
|
|
|
|
|
config.beaconChainGenesisTimestamp = 1616508000; // Mainnet default
|
|
|
|
|
}
|
feat: ✨ Datahaven contracts deployment on public testnet (#123)
## Summary
This PR introduces support for deploying Datahaven contracts to
different chains (hoodi, holesky, mainnet), as well as a new cli command
to manage this deployment separately from the regular deployment, while
maintaining compatibility with it.
#### New CLI command
- **`bun cli contracts deploy`** - Deploy contracts to supported chains
(Hoodi, Holesky, Mainnet)
- **`bun cli contracts status`** - Check deployment configuration and
status
- **`bun cli contracts verify`** - Verify contracts on block explorers
- Commands need the chain parameter: `--chain <hoodi | holesky |
mainnet>`
- Right now only `hoodi` and `holesky` are supported
### Deployment
#### Hoodi & Holesky Network Support
- Added **DeployBase.s.sol** as common ground for
**DeployTestnet.s.sol** (also new) and **DeployLocal.s.sol** (existing).
- **Hoodi configuration** (`contracts/config/hoodi.json`) with deployed
EigenLayer contract addresses to reference.
- **Holesky configuration** (`contracts/config/hoodi.json`) with
deployed EigenLayer contract addresses to reference.
#### Contracts being deployed
- **DataHaven**: ServiceManager, VetoableSlasher, RewardsRegistry
- **Snowbridge**: BeefyClient, AgentExecutor, Gateway, RewardsAgent
- **EigenLayer**: References existing deployed contracts (not
re-deployed)
#### Deployment files
When the deployment is done, a new file under `contracts/deployments` is
generated with the addresses of the deployed contracts, for each chain
(it will be overriden per chain if run multiple times). So we would have
one `anvil.json`, `hoodi.json`, `holesky.json`, etc, with the addresses
of the deployed contracts for reference and for later verification.
#### Todo
- [x] Test compatibility with existing `bun cli launch` and `bun cli
deploy` commands
#### For follow-up PRs
- Fix verification issue with `foundry verify-contracts` when specifying
the `chain` or `chain-id` parameter, needed for hoodi
(https://github.com/foundry-rs/foundry/issues/7466).
- Add `redeploy` feature to only override implementation contract and
leave the proxy address untouched
## Usage Examples
```bash
# Deploy to Hoodi network
bun cli contracts deploy --chain hoodi
# Check deployment status
bun cli contracts status --chain hoodi
# Verify contracts on block explorer
bun cli contracts verify --chain hoodi
```
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added deployment and configuration support for new networks "hoodi"
and "holesky", including new configuration and deployment files.
* Introduced a CLI tool for managing contract deployments, status
checks, and verification across supported chains.
* Added example environment configuration and comprehensive deployment
documentation.
* Enabled contract verification and status reporting via the CLI with
support for block explorer integration.
* **Improvements**
* Refactored deployment scripts for modularity, supporting both local
and testnet environments.
* Centralized and extended configuration loading to support additional
contract addresses and network parameters.
* Enhanced deployment utilities and typings to support multi-network
deployments.
* **Bug Fixes**
* Improved input validation and error handling in CLI commands and
deployment scripts.
* Added explicit handling for zero address in operator strategy
retrieval.
* **Chores**
* Updated documentation and configuration templates for easier
onboarding and deployment management.
* Improved logging and output formatting for deployment and verification
processes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Steve Degosserie <723552+stiiifff@users.noreply.github.com>
Co-authored-by: Ahmad Kaouk <56095276+ahmadkaouk@users.noreply.github.com>
2025-08-21 10:02:31 +00:00
|
|
|
|
|
|
|
|
// Load EigenLayer-specific contract addresses (if they exist in config)
|
2025-10-20 08:20:59 +00:00
|
|
|
try vm.parseJsonAddress(configJson, ".eigenLayer.delegationManager") returns (
|
|
|
|
|
address addr
|
|
|
|
|
) {
|
feat: ✨ Datahaven contracts deployment on public testnet (#123)
## Summary
This PR introduces support for deploying Datahaven contracts to
different chains (hoodi, holesky, mainnet), as well as a new cli command
to manage this deployment separately from the regular deployment, while
maintaining compatibility with it.
#### New CLI command
- **`bun cli contracts deploy`** - Deploy contracts to supported chains
(Hoodi, Holesky, Mainnet)
- **`bun cli contracts status`** - Check deployment configuration and
status
- **`bun cli contracts verify`** - Verify contracts on block explorers
- Commands need the chain parameter: `--chain <hoodi | holesky |
mainnet>`
- Right now only `hoodi` and `holesky` are supported
### Deployment
#### Hoodi & Holesky Network Support
- Added **DeployBase.s.sol** as common ground for
**DeployTestnet.s.sol** (also new) and **DeployLocal.s.sol** (existing).
- **Hoodi configuration** (`contracts/config/hoodi.json`) with deployed
EigenLayer contract addresses to reference.
- **Holesky configuration** (`contracts/config/hoodi.json`) with
deployed EigenLayer contract addresses to reference.
#### Contracts being deployed
- **DataHaven**: ServiceManager, VetoableSlasher, RewardsRegistry
- **Snowbridge**: BeefyClient, AgentExecutor, Gateway, RewardsAgent
- **EigenLayer**: References existing deployed contracts (not
re-deployed)
#### Deployment files
When the deployment is done, a new file under `contracts/deployments` is
generated with the addresses of the deployed contracts, for each chain
(it will be overriden per chain if run multiple times). So we would have
one `anvil.json`, `hoodi.json`, `holesky.json`, etc, with the addresses
of the deployed contracts for reference and for later verification.
#### Todo
- [x] Test compatibility with existing `bun cli launch` and `bun cli
deploy` commands
#### For follow-up PRs
- Fix verification issue with `foundry verify-contracts` when specifying
the `chain` or `chain-id` parameter, needed for hoodi
(https://github.com/foundry-rs/foundry/issues/7466).
- Add `redeploy` feature to only override implementation contract and
leave the proxy address untouched
## Usage Examples
```bash
# Deploy to Hoodi network
bun cli contracts deploy --chain hoodi
# Check deployment status
bun cli contracts status --chain hoodi
# Verify contracts on block explorer
bun cli contracts verify --chain hoodi
```
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added deployment and configuration support for new networks "hoodi"
and "holesky", including new configuration and deployment files.
* Introduced a CLI tool for managing contract deployments, status
checks, and verification across supported chains.
* Added example environment configuration and comprehensive deployment
documentation.
* Enabled contract verification and status reporting via the CLI with
support for block explorer integration.
* **Improvements**
* Refactored deployment scripts for modularity, supporting both local
and testnet environments.
* Centralized and extended configuration loading to support additional
contract addresses and network parameters.
* Enhanced deployment utilities and typings to support multi-network
deployments.
* **Bug Fixes**
* Improved input validation and error handling in CLI commands and
deployment scripts.
* Added explicit handling for zero address in operator strategy
retrieval.
* **Chores**
* Updated documentation and configuration templates for easier
onboarding and deployment management.
* Improved logging and output formatting for deployment and verification
processes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Steve Degosserie <723552+stiiifff@users.noreply.github.com>
Co-authored-by: Ahmad Kaouk <56095276+ahmadkaouk@users.noreply.github.com>
2025-08-21 10:02:31 +00:00
|
|
|
config.delegationManager = addr;
|
|
|
|
|
} catch {
|
|
|
|
|
config.delegationManager = address(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try vm.parseJsonAddress(configJson, ".eigenLayer.strategyManager") returns (address addr) {
|
|
|
|
|
config.strategyManager = addr;
|
|
|
|
|
} catch {
|
|
|
|
|
config.strategyManager = address(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try vm.parseJsonAddress(configJson, ".eigenLayer.avsDirectory") returns (address addr) {
|
|
|
|
|
config.avsDirectory = addr;
|
|
|
|
|
} catch {
|
|
|
|
|
config.avsDirectory = address(0);
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-20 08:20:59 +00:00
|
|
|
try vm.parseJsonAddress(configJson, ".eigenLayer.rewardsCoordinator") returns (
|
|
|
|
|
address addr
|
|
|
|
|
) {
|
feat: ✨ Datahaven contracts deployment on public testnet (#123)
## Summary
This PR introduces support for deploying Datahaven contracts to
different chains (hoodi, holesky, mainnet), as well as a new cli command
to manage this deployment separately from the regular deployment, while
maintaining compatibility with it.
#### New CLI command
- **`bun cli contracts deploy`** - Deploy contracts to supported chains
(Hoodi, Holesky, Mainnet)
- **`bun cli contracts status`** - Check deployment configuration and
status
- **`bun cli contracts verify`** - Verify contracts on block explorers
- Commands need the chain parameter: `--chain <hoodi | holesky |
mainnet>`
- Right now only `hoodi` and `holesky` are supported
### Deployment
#### Hoodi & Holesky Network Support
- Added **DeployBase.s.sol** as common ground for
**DeployTestnet.s.sol** (also new) and **DeployLocal.s.sol** (existing).
- **Hoodi configuration** (`contracts/config/hoodi.json`) with deployed
EigenLayer contract addresses to reference.
- **Holesky configuration** (`contracts/config/hoodi.json`) with
deployed EigenLayer contract addresses to reference.
#### Contracts being deployed
- **DataHaven**: ServiceManager, VetoableSlasher, RewardsRegistry
- **Snowbridge**: BeefyClient, AgentExecutor, Gateway, RewardsAgent
- **EigenLayer**: References existing deployed contracts (not
re-deployed)
#### Deployment files
When the deployment is done, a new file under `contracts/deployments` is
generated with the addresses of the deployed contracts, for each chain
(it will be overriden per chain if run multiple times). So we would have
one `anvil.json`, `hoodi.json`, `holesky.json`, etc, with the addresses
of the deployed contracts for reference and for later verification.
#### Todo
- [x] Test compatibility with existing `bun cli launch` and `bun cli
deploy` commands
#### For follow-up PRs
- Fix verification issue with `foundry verify-contracts` when specifying
the `chain` or `chain-id` parameter, needed for hoodi
(https://github.com/foundry-rs/foundry/issues/7466).
- Add `redeploy` feature to only override implementation contract and
leave the proxy address untouched
## Usage Examples
```bash
# Deploy to Hoodi network
bun cli contracts deploy --chain hoodi
# Check deployment status
bun cli contracts status --chain hoodi
# Verify contracts on block explorer
bun cli contracts verify --chain hoodi
```
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added deployment and configuration support for new networks "hoodi"
and "holesky", including new configuration and deployment files.
* Introduced a CLI tool for managing contract deployments, status
checks, and verification across supported chains.
* Added example environment configuration and comprehensive deployment
documentation.
* Enabled contract verification and status reporting via the CLI with
support for block explorer integration.
* **Improvements**
* Refactored deployment scripts for modularity, supporting both local
and testnet environments.
* Centralized and extended configuration loading to support additional
contract addresses and network parameters.
* Enhanced deployment utilities and typings to support multi-network
deployments.
* **Bug Fixes**
* Improved input validation and error handling in CLI commands and
deployment scripts.
* Added explicit handling for zero address in operator strategy
retrieval.
* **Chores**
* Updated documentation and configuration templates for easier
onboarding and deployment management.
* Improved logging and output formatting for deployment and verification
processes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Steve Degosserie <723552+stiiifff@users.noreply.github.com>
Co-authored-by: Ahmad Kaouk <56095276+ahmadkaouk@users.noreply.github.com>
2025-08-21 10:02:31 +00:00
|
|
|
config.rewardsCoordinator = addr;
|
|
|
|
|
} catch {
|
|
|
|
|
config.rewardsCoordinator = address(0);
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-20 08:20:59 +00:00
|
|
|
try vm.parseJsonAddress(configJson, ".eigenLayer.allocationManager") returns (
|
|
|
|
|
address addr
|
|
|
|
|
) {
|
feat: ✨ Datahaven contracts deployment on public testnet (#123)
## Summary
This PR introduces support for deploying Datahaven contracts to
different chains (hoodi, holesky, mainnet), as well as a new cli command
to manage this deployment separately from the regular deployment, while
maintaining compatibility with it.
#### New CLI command
- **`bun cli contracts deploy`** - Deploy contracts to supported chains
(Hoodi, Holesky, Mainnet)
- **`bun cli contracts status`** - Check deployment configuration and
status
- **`bun cli contracts verify`** - Verify contracts on block explorers
- Commands need the chain parameter: `--chain <hoodi | holesky |
mainnet>`
- Right now only `hoodi` and `holesky` are supported
### Deployment
#### Hoodi & Holesky Network Support
- Added **DeployBase.s.sol** as common ground for
**DeployTestnet.s.sol** (also new) and **DeployLocal.s.sol** (existing).
- **Hoodi configuration** (`contracts/config/hoodi.json`) with deployed
EigenLayer contract addresses to reference.
- **Holesky configuration** (`contracts/config/hoodi.json`) with
deployed EigenLayer contract addresses to reference.
#### Contracts being deployed
- **DataHaven**: ServiceManager, VetoableSlasher, RewardsRegistry
- **Snowbridge**: BeefyClient, AgentExecutor, Gateway, RewardsAgent
- **EigenLayer**: References existing deployed contracts (not
re-deployed)
#### Deployment files
When the deployment is done, a new file under `contracts/deployments` is
generated with the addresses of the deployed contracts, for each chain
(it will be overriden per chain if run multiple times). So we would have
one `anvil.json`, `hoodi.json`, `holesky.json`, etc, with the addresses
of the deployed contracts for reference and for later verification.
#### Todo
- [x] Test compatibility with existing `bun cli launch` and `bun cli
deploy` commands
#### For follow-up PRs
- Fix verification issue with `foundry verify-contracts` when specifying
the `chain` or `chain-id` parameter, needed for hoodi
(https://github.com/foundry-rs/foundry/issues/7466).
- Add `redeploy` feature to only override implementation contract and
leave the proxy address untouched
## Usage Examples
```bash
# Deploy to Hoodi network
bun cli contracts deploy --chain hoodi
# Check deployment status
bun cli contracts status --chain hoodi
# Verify contracts on block explorer
bun cli contracts verify --chain hoodi
```
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added deployment and configuration support for new networks "hoodi"
and "holesky", including new configuration and deployment files.
* Introduced a CLI tool for managing contract deployments, status
checks, and verification across supported chains.
* Added example environment configuration and comprehensive deployment
documentation.
* Enabled contract verification and status reporting via the CLI with
support for block explorer integration.
* **Improvements**
* Refactored deployment scripts for modularity, supporting both local
and testnet environments.
* Centralized and extended configuration loading to support additional
contract addresses and network parameters.
* Enhanced deployment utilities and typings to support multi-network
deployments.
* **Bug Fixes**
* Improved input validation and error handling in CLI commands and
deployment scripts.
* Added explicit handling for zero address in operator strategy
retrieval.
* **Chores**
* Updated documentation and configuration templates for easier
onboarding and deployment management.
* Improved logging and output formatting for deployment and verification
processes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Steve Degosserie <723552+stiiifff@users.noreply.github.com>
Co-authored-by: Ahmad Kaouk <56095276+ahmadkaouk@users.noreply.github.com>
2025-08-21 10:02:31 +00:00
|
|
|
config.allocationManager = addr;
|
|
|
|
|
} catch {
|
|
|
|
|
config.allocationManager = address(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try vm.parseJsonAddress(configJson, ".eigenLayer.permissionController") returns (
|
|
|
|
|
address addr
|
|
|
|
|
) {
|
|
|
|
|
config.permissionController = addr;
|
|
|
|
|
} catch {
|
|
|
|
|
config.permissionController = address(0);
|
|
|
|
|
}
|
2025-04-03 17:06:32 +00:00
|
|
|
|
|
|
|
|
return config;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getETHPOSDepositAddress() public returns (address) {
|
|
|
|
|
string memory configPath = string.concat(
|
|
|
|
|
vm.projectRoot(), "/config/", vm.envOr("NETWORK", string("anvil")), ".json"
|
|
|
|
|
);
|
|
|
|
|
string memory configJson = vm.readFile(configPath);
|
|
|
|
|
|
|
|
|
|
// On mainnet, use the real ETH2 deposit contract. Otherwise, deploy a mock
|
|
|
|
|
if (block.chainid == 1) {
|
|
|
|
|
return 0x00000000219ab540356cBB839Cbe05303d7705Fa;
|
|
|
|
|
} else {
|
|
|
|
|
// For non-mainnet environments, check if there's a configured address or deploy a mock
|
|
|
|
|
try vm.parseJsonAddress(configJson, ".eigenLayer.ethPOSDepositAddress") returns (
|
|
|
|
|
address addr
|
|
|
|
|
) {
|
|
|
|
|
if (addr != address(0)) {
|
|
|
|
|
return addr;
|
|
|
|
|
}
|
|
|
|
|
} catch {}
|
|
|
|
|
|
|
|
|
|
// Deploy a mock ETH deposit contract if not configured
|
|
|
|
|
return address(new EmptyContract());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-11 23:54:20 +00:00
|
|
|
function _loadValidatorsFromConfig(
|
2025-04-03 17:06:32 +00:00
|
|
|
string memory configJson,
|
|
|
|
|
string memory path
|
|
|
|
|
) internal pure returns (bytes32[] memory) {
|
|
|
|
|
// Load validators from JSON config
|
|
|
|
|
string[] memory validatorsArray = vm.parseJsonStringArray(configJson, path);
|
|
|
|
|
bytes32[] memory validators = new bytes32[](validatorsArray.length);
|
|
|
|
|
for (uint256 i = 0; i < validatorsArray.length; i++) {
|
|
|
|
|
validators[i] = vm.parseBytes32(validatorsArray[i]);
|
|
|
|
|
}
|
|
|
|
|
return validators;
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-11 23:54:20 +00:00
|
|
|
function _loadAddressesFromConfig(
|
2025-04-03 17:06:32 +00:00
|
|
|
string memory configJson,
|
|
|
|
|
string memory path
|
|
|
|
|
) internal pure returns (address[] memory) {
|
|
|
|
|
// Load addresses from JSON config
|
|
|
|
|
string[] memory addressStrings = vm.parseJsonStringArray(configJson, path);
|
|
|
|
|
address[] memory addresses = new address[](addressStrings.length);
|
|
|
|
|
for (uint256 i = 0; i < addressStrings.length; i++) {
|
|
|
|
|
addresses[i] = vm.parseAddress(addressStrings[i]);
|
|
|
|
|
}
|
|
|
|
|
return addresses;
|
|
|
|
|
}
|
|
|
|
|
}
|