Skip to content

Commit 32dafa4

Browse files
committed
docs: add multisig and deploy tutorials
1 parent 276c152 commit 32dafa4

File tree

9 files changed

+261
-0
lines changed

9 files changed

+261
-0
lines changed

docs/0_internal/0_guides.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Deployment of Aligned Contracts
2+
3+
This guide will walk you through the deployment of the Aligned Layer contracts.
4+
5+
## Prerequisites
6+
7+
- Clone the repository
8+
```
9+
git clone https://github.com/yetanotherco/aligned_layer.git
10+
```
11+
12+
## Setup
13+
14+
1. If you want to manage AlignedLayer contracts (like upgrades or pauses) using a Multisig wallet, you can follow the [Multisig Wallet Creation Guide](./1_multisig_creation.md).
15+
16+
After finishing the setup of the multisig, you will have a multisig address.
17+
18+
2. To deploy the contracts, you can follow the [Deployment Guide](./2_deployment.md).
19+
20+
After finishing the deployment, you will have the deployed contract addresses.
21+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Create a Multisig Wallet using SAFE
2+
3+
> [!WARNING]
4+
> Safe Multisig Wallet is not currently supported in Holesky Testnet.
5+
6+
> [!WARNING]
7+
> You need at least one wallet with funds to deploy the Multisig.
8+
9+
10+
You can create a Multisig wallet using [Safe](https://safe.global/).
11+
12+
1. Go to [Safe](https://app.safe.global/welcome/accounts).
13+
14+
2. Click on `Create Account`.
15+
16+
![Create Account](images/1_multisig_2.png)
17+
18+
3. Connect your wallet.
19+
20+
![Connect Wallet](images/1_multisig_1.png)
21+
22+
4. Set a name for your Multisig (it is just a local name) and choose a network where you want to deploy it. Then click on `Next`.
23+
24+
![Name and Network](images/1_multisig_3.png)
25+
26+
For `Ethereum Sepolia` network set `Sepolia`.
27+
28+
For `Ethereum Mainnet` network set `Ethereum`.
29+
30+
In this tutorial, we are using `Sepolia` network.
31+
32+
5. Add the signers for your Multisig and the required threshold. Then click on `Next`.
33+
34+
![Signers and Threshold](images/1_multisig_4.png)
35+
36+
This example shows a 2/3 Multisig, which means that 2 out of 3 signers are required to approve a transaction.
37+
38+
6. Review the information, choose `Pay now` option and click on `Create Account`.
39+
40+
![Review](images/1_multisig_5.png)
41+
42+
7. Confirm the transaction on your wallet.
43+
44+
8. Wait until the transaction is confirmed. Then, you will see your Multisig wallet.
45+
46+
![Multisig Wallet](images/1_multisig_6.png)
47+
48+
After finishing this tutorial, you will have your Multisig wallet created. In this tutorial, we created a
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
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+
90.1 KB
Loading
46.9 KB
Loading
103 KB
Loading
127 KB
Loading
152 KB
Loading
248 KB
Loading

0 commit comments

Comments
 (0)