|
| 1 | +# Deploying Aligned Contracts |
| 2 | + |
| 3 | +## Eigenlayer Contracts |
| 4 | + |
| 5 | +These contracts are not deployed by Aligned. Current EigenLayer contracts: |
| 6 | + |
| 7 | +- [Holesky Contracts](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/script/configs/holesky/eigenlayer_addresses_testnet.config.json) |
| 8 | +- [Mainnet Contracts](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/script/configs/mainnet/mainnet-addresses.config.json) |
| 9 | + |
| 10 | +## Aligned Contracts |
| 11 | + |
| 12 | +### Deploy Service Manager |
| 13 | + |
| 14 | +To deploy the AlignedLayer contracts, you will need to set environment variables in a `.env` file in the same |
| 15 | +directory as the deployment script (`contracts/scripts/`). |
| 16 | + |
| 17 | +The necessary environment variables are: |
| 18 | + |
| 19 | +| Variable Name | Description | Holesky | Mainnet | |
| 20 | +|---------------------------------|-----------------------------------------------------------------------|-------------------------------------------------------------|-------------------------------------| |
| 21 | +| `RPC_URL` | The RPC URL of the network you want to deploy to. | https://ethereum-holesky-rpc.publicnode.com | https://ethereum-rpc.publicnode.com | |
| 22 | +| `PRIVATE_KEY` | The private key of the account you want to deploy the contracts with. | <your_private_key> | <your_private_key> | |
| 23 | +| `EXISTING_DEPLOYMENT_INFO_PATH` | The path to the file containing the deployment info about EigenLayer. | ./script/output/holesky/eigenlayer_deployment_output.json | TBD | |
| 24 | +| `DEPLOY_CONFIG_PATH` | The path to the deployment config file for the Service Manager. | ./script/deploy/config/holesky/aligned.holesky.config.json | TBD | |
| 25 | +| `OUTPUT_PATH` | The path to the file where the deployment info will be saved. | ./script/output/holesky/alignedlayer_deployment_output.json | TBD | |
| 26 | +| `ETHERSCAN_API_KEY` | API KEY to verify the contracts in Etherscan. | <your_etherscan_api_key> | <your_etherscan_api_key> | |
| 27 | + |
| 28 | +You can find an example `.env` file in [.env.example.holesky](../../contracts/scripts/.env.example.holesky) |
| 29 | + |
| 30 | +> [!Warning] |
| 31 | +> All file paths must be inside the `script/` directory, as shown in `.env.example.holesky` because of `foundry`'s permissions to read and write files. |
| 32 | +
|
| 33 | +You need to complete the `DEPLOY_CONFIG_PATH` file with the following information: |
| 34 | + |
| 35 | +```json |
| 36 | +{ |
| 37 | + "chainInfo": { |
| 38 | + "chainId": "<chain_id>" |
| 39 | + }, |
| 40 | + "permissions": { |
| 41 | + "owner": "<owner_address>", |
| 42 | + "aggregator": "<aggregator_address>", |
| 43 | + "upgrader": "<upgrader_address>", |
| 44 | + "churner": "<churner_address>", |
| 45 | + "ejector": "<ejector_address>", |
| 46 | + "deployer": "<deployer_address>", |
| 47 | + "initalPausedStatus": 0 |
| 48 | + }, |
| 49 | + "minimumStakes": [], |
| 50 | + "strategyWeights": [], |
| 51 | + "operatorSetParams": [], |
| 52 | + "uri": "" |
| 53 | +} |
| 54 | +``` |
| 55 | + |
| 56 | +You can find an example config file in [aligned.holesky.config.json](../../contracts/script/deploy/config/holesky/aligned.holesky.config.json). |
| 57 | + |
| 58 | +> [!Note] |
| 59 | +> |
| 60 | +> You can find the list of Mainnet strategies for the `strategyWeights` field [here](https://github.com/Layr-Labs/eigenlayer-contracts?tab=readme-ov-file#current-mainnet-deployment) |
| 61 | +> |
| 62 | +> You can find the list of Holesky strategies for the `strategyWeights` field [here](https://github.com/Layr-Labs/eigenlayer-contracts?tab=readme-ov-file#current-testnet-deployment) |
| 63 | +
|
| 64 | +If you are using a Multisig for the contracts management (like upgrades or pauses), you need to set the Multisig address in the `permissions` sections. |
| 65 | + |
| 66 | +For example, if you are using a Multisig for the `upgrader` permission, you need to set the Multisig address in the `upgrader` field. |
| 67 | + |
| 68 | +Then run the following command: |
| 69 | + |
| 70 | +```bash |
| 71 | +make deploy_aligned_contracts |
| 72 | +``` |
| 73 | + |
| 74 | +Once the contracts are deployed, you will see the following output at `OUTPUT_PATH` file: |
| 75 | + |
| 76 | +```json |
| 77 | +{ |
| 78 | + "addresses": { |
| 79 | + "alignedLayerProxyAdmin": "<aligned_layer_proxy_admin_address>", |
| 80 | + "alignedLayerServiceManager": "<aligned_layer_service_manager_address>", |
| 81 | + "alignedLayerServiceManagerImplementation": "<aligned_layer_service_manager_implementation_address>", |
| 82 | + "blsApkRegistry": "<bls_apk_registry_address>", |
| 83 | + "blsApkRegistryImplementation": "<bls_apk_registry_implementation_address>", |
| 84 | + "indexRegistry": "<index_registry_address>", |
| 85 | + "indexRegistryImplementation": "<index_registry_implementation_address>", |
| 86 | + "operatorStateRetriever": "<operator_state_retriever_address>", |
| 87 | + "registryCoordinator": "<registry_coordinator_address>", |
| 88 | + "registryCoordinatorImplementation": "<registry_coordinator_implementation_address>", |
| 89 | + "serviceManagerRouter": "<service_manager_router_address>", |
| 90 | + "stakeRegistry": "<stake_registry_address>", |
| 91 | + "stakeRegistryImplementation": "<stake_registry_implementation_address>", |
| 92 | + "batcherPaymentService": "<batcher_payment_service_address>", |
| 93 | + "batcherPaymentServiceImplementation": "<batcher_payment_service_implementation_address>" |
| 94 | + }, |
| 95 | + "chainInfo": { |
| 96 | + "chainId": 17000, |
| 97 | + "deploymentBlock": 1628199 |
| 98 | + }, |
| 99 | + "permissions": { |
| 100 | + "alignedLayerAggregator": "<aligned_layer_aggregator_address>", |
| 101 | + "alignedLayerChurner": "<aligned_layer_churner_address>", |
| 102 | + "alignedLayerEjector": "<aligned_layer_ejector_address>", |
| 103 | + "alignedLayerOwner": "<aligned_layer_owner_address>", |
| 104 | + "alignedLayerUpgrader": "<aligned_layer_upgrader_address>", |
| 105 | + "pauserRegistry": "<pauser_registry_address>" |
| 106 | + } |
| 107 | +} |
| 108 | +``` |
| 109 | + |
| 110 | +### Deploy Batcher Payment Service |
| 111 | + |
| 112 | +To deploy the Batcher Payment Service contract, you will need to set environment variables in a `.env` file in the same |
| 113 | +directory as the deployment script (`contracts/scripts/`). |
| 114 | + |
| 115 | +The necessary environment variables are: |
| 116 | + |
| 117 | +| Variable Name | Description | Holesky | Mainnet | |
| 118 | +|---------------------------------------|-------------------------------------------------------------------------|----------------------------------------------------------------------------|-------------------------------------| |
| 119 | +| `RPC_URL` | The RPC URL of the network you want to deploy to. | https://ethereum-holesky-rpc.publicnode.com | https://ethereum-rpc.publicnode.com | |
| 120 | +| `PRIVATE_KEY` | The private key of the account you want to deploy the contracts with. | <your_private_key> | <your_private_key> | |
| 121 | +| `EXISTING_DEPLOYMENT_INFO_PATH` | The path to the file containing the deployment info about EigenLayer. | ./script/output/holesky/eigenlayer_deployment_output.json | TBD | |
| 122 | +| `DEPLOY_CONFIG_PATH` | The path to the deployment config file for the Service Manager. | ./script/deploy/config/holesky/batcher_payment_service.holesky.config.json | TBD | |
| 123 | +| `BATCHER_PAYMENT_SERVICE_CONFIG_PATH` | The path to the deployment config file for the Batcher Payment Service. | ./script/deploy/config/holesky/batcher-payment-service.holesky.config.json | TBD | |
| 124 | +| `OUTPUT_PATH` | The path to the file where the deployment info will be saved. | ./script/output/holesky/alignedlayer_deployment_output.json | TBD | |
| 125 | +| `ETHERSCAN_API_KEY` | API KEY to verify the contracts in Etherscan. | <your_etherscan_api_key> | <your_etherscan_api_key> | |
| 126 | + |
| 127 | +You can find an example `.env` file in [.env.example.holesky](../../contracts/scripts/.env.example.holesky) |
| 128 | + |
| 129 | +You need to complete the `BATCHER_PAYMENT_SERVICE_CONFIG_PATH` file with the following information: |
| 130 | + |
| 131 | +```json |
| 132 | +{ |
| 133 | + "address": { |
| 134 | + "batcherWallet": "<batcher_wallet_address>", |
| 135 | + "alignedLayerServiceManager": "<aligned_layer_service_manager_address>" |
| 136 | + }, |
| 137 | + "permissions": { |
| 138 | + "owner": "<owner_address>" |
| 139 | + }, |
| 140 | + "eip712": { |
| 141 | + "noncedVerificationDataTypeHash": "0x41817b5c5b0c3dcda70ccb43ba175fdcd7e586f9e0484422a2c6bba678fdf4a3" |
| 142 | + } |
| 143 | +} |
| 144 | +``` |
| 145 | + |
| 146 | +If you are using a Multisig for the contracts management (like upgrades or pauses), you need to set the Multisig address in the `permissions` sections. |
| 147 | + |
| 148 | +For the batcher payment service, you can set the Multisig address in the `owner` field. This will allow the Multisig to upgrade and pause the contract with the Multisig. |
| 149 | + |
| 150 | + |
| 151 | +Then run the following command: |
| 152 | + |
| 153 | +```bash |
| 154 | +make deploy_batcher_payment_service |
| 155 | +``` |
| 156 | + |
| 157 | +Once the contracts are deployed, you will see the following output at `OUTPUT_PATH` file: |
| 158 | + |
| 159 | +```json |
| 160 | +{ |
| 161 | + "addresses": { |
| 162 | + "alignedLayerProxyAdmin": "<aligned_layer_proxy_admin_address>", |
| 163 | + "alignedLayerServiceManager": "<aligned_layer_service_manager_address>", |
| 164 | + "alignedLayerServiceManagerImplementation": "<aligned_layer_service_manager_implementation_address>", |
| 165 | + "blsApkRegistry": "<bls_apk_registry_address>", |
| 166 | + "blsApkRegistryImplementation": "<bls_apk_registry_implementation_address>", |
| 167 | + "indexRegistry": "<index_registry_address>", |
| 168 | + "indexRegistryImplementation": "<index_registry_implementation_address>", |
| 169 | + "operatorStateRetriever": "<operator_state_retriever_address>", |
| 170 | + "registryCoordinator": "<registry_coordinator_address>", |
| 171 | + "registryCoordinatorImplementation": "<registry_coordinator_implementation_address>", |
| 172 | + "serviceManagerRouter": "<service_manager_router_address>", |
| 173 | + "stakeRegistry": "<stake_registry_address>", |
| 174 | + "stakeRegistryImplementation": "<stake_registry_implementation_address>", |
| 175 | + "batcherPaymentService": "<batcher_payment_service_address>", |
| 176 | + "batcherPaymentServiceImplementation": "<batcher_payment_service_implementation_address>" |
| 177 | + }, |
| 178 | + "chainInfo": { |
| 179 | + "chainId": 17000, |
| 180 | + "deploymentBlock": 1628199 |
| 181 | + }, |
| 182 | + "permissions": { |
| 183 | + "alignedLayerAggregator": "<aligned_layer_aggregator_address>", |
| 184 | + "alignedLayerChurner": "<aligned_layer_churner_address>", |
| 185 | + "alignedLayerEjector": "<aligned_layer_ejector_address>", |
| 186 | + "alignedLayerOwner": "<aligned_layer_owner_address>", |
| 187 | + "alignedLayerUpgrader": "<aligned_layer_upgrader_address>", |
| 188 | + "pauserRegistry": "<pauser_registry_address>" |
| 189 | + } |
| 190 | +} |
| 191 | +``` |
| 192 | + |
0 commit comments