Skip to content

Commit bb90871

Browse files
committed
feat: add connect-and-accept-tier, update documentation
1 parent 56a6470 commit bb90871

File tree

20 files changed

+263
-42
lines changed

20 files changed

+263
-42
lines changed

docs/cli/commands/vault-operations.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Vault Operations commands manage the core functionality of Lido Staking Vaults i
5353
| change-tier-by-no (ct-no) \<tierId> | vault tier change by node operator with multi-role confirmation |
5454
| change-tier (ct) \<tierId> | vault tier change with multi-role confirmation |
5555
| sync-tier (st) | requests a sync of tier on the OperatorGrid |
56+
| connect-and-accept-tier (connect-and-accept) | changes the tier of the vault and connects to VaultHub |
5657
| role-grant | mass-grants multiple roles to multiple accounts |
5758
| role-revoke | mass-revokes multiple roles from multiple accounts |
5859
| create-vault | creates a new StakingVault and Dashboard contracts |
@@ -814,6 +815,51 @@ yarn start vo w st [options]
814815

815816
**Use Case:** Synchronize vault tier configuration when changes need to be applied from the OperatorGrid system.
816817

818+
### connect-and-accept-tier (connect-and-accept)
819+
820+
Changes the tier of the vault and connects to VaultHub.
821+
822+
**Usage:**
823+
824+
```bash
825+
yarn start vo write connect-and-accept-tier <tier> <requestedShareLimit> [options]
826+
```
827+
828+
Or using aliases:
829+
830+
```bash
831+
yarn start vo w connect-and-accept <tier> <requestedShareLimit> [options]
832+
```
833+
834+
**Arguments:**
835+
836+
- `<tier>`: Tier ID to change to (numeric value)
837+
- `<requestedShareLimit>`: Requested new share limit for the vault (in shares, e.g., 1000.0)
838+
839+
**Options:**
840+
841+
- `-v, --vault <address>`: Specify vault address (optional - prompts for selection if not provided)
842+
- `-f, --fund`: Optional fund the vault with 1 ETH (default: false)
843+
844+
**Process:**
845+
846+
1. Reads current `settledGrowth` from the dashboard
847+
2. If `--fund` flag is NOT provided (default):
848+
- Checks vault's available balance against required connect deposit
849+
- If balance is insufficient, prompts for confirmation to fund with required amount
850+
- Adds funding value to transaction if confirmed
851+
3. Displays confirmation with target tier, share limit, settled growth, and funding details
852+
4. Submits transaction to change tier and connect to VaultHub
853+
854+
- Optionally funds the vault with 1 ETH if confirmed
855+
856+
**Requirements:**
857+
858+
- Vault must be in a state allowing connection
859+
- Caller must have appropriate permissions
860+
- Reverts if `settledGrowth` is not corrected after the vault is disconnected
861+
- Vault must have sufficient balance OR user confirms additional funding
862+
817863
### role-grant
818864

819865
Mass-grants multiple roles to multiple accounts on the vault.

docs/cli/get-started/additional-helpers.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
2-
sidebar_position: 7
2+
title: Additional Helpers
3+
description: Useful utility commands for working with Lido Staking Vaults
4+
sidebar_position: 8
35
---
46

57
# Additional Helpers

docs/cli/get-started/configuration.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,45 @@
11
---
2+
title: Configuration
3+
description: Configure your environment variables and wallet settings
24
sidebar_position: 1
35
---
46

57
# Configuration
68

79
Before using the Lido Staking Vault CLI, you need to configure your environment variables and wallet settings. This guide covers all necessary configuration steps to get started.
810

11+
## Installation
12+
13+
### Clone from Repository
14+
15+
```bash
16+
git clone git@github.com:lidofinance/lido-staking-vault-cli.git
17+
cd lido-staking-vault-cli
18+
```
19+
20+
### Choosing a Branch
21+
22+
The repository maintains two primary branches:
23+
24+
- **`main`** (Recommended): Stable, tested, and production-ready releases. Use this branch for reliable operation with verified features.
25+
- **`develop`**: Latest features and ongoing development. Choose this branch if you want access to cutting-edge functionality and are comfortable with potentially unstable features.
26+
27+
```bash
28+
# For stable releases (recommended)
29+
git checkout main
30+
31+
# For latest features in development
32+
git checkout develop
33+
```
34+
35+
### Install Dependencies
36+
37+
After cloning and selecting your branch, install dependencies:
38+
39+
```bash
40+
yarn install
41+
```
42+
943
## Environment Variables
1044

1145
Configure your environment by creating a `.env` file in your project root:

docs/cli/get-started/create-vault.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
2-
sidebar_position: 2
2+
title: Creating a Vault
3+
description: Create new Lido Staking Vaults using the CLI
4+
sidebar_position: 3
35
---
46

57
# Creating a Vault

docs/cli/get-started/deposits.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
2-
sidebar_position: 6
2+
title: Validator Deposits
3+
description: Validator deposit operations in Lido Staking Vaults
4+
sidebar_position: 7
35
---
46

57
# Validator Deposits

docs/cli/get-started/mint-burn.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
2-
sidebar_position: 4
2+
title: Mint and Burn Tokens
3+
description: Mint and burn stETH-based tokens in Lido Staking Vaults
4+
sidebar_position: 5
35
---
46

57
# Mint and Burn Tokens

docs/cli/get-started/reports.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
2-
sidebar_position: 5
2+
title: Reports
3+
description: Vault reporting operations for Lido Staking Vaults
4+
sidebar_position: 6
35
---
46

57
# Reports

docs/cli/get-started/supply-withdrawal.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
2-
sidebar_position: 3
2+
title: Supply (Fund) and Withdrawal
3+
description: Funding and withdrawing ETH from Lido Staking Vaults
4+
sidebar_position: 4
35
---
46

57
# Supply (Fund) and Withdrawal

docs/cli/get-started/wallet-connect.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: WalletConnect (WC)
33
description: Use WalletConnect with the CLI to sign and send transactions from your mobile/desktop wallet
4-
sidebar_position: 3
4+
sidebar_position: 2
55
---
66

77
# WalletConnect Integration

features/utils/connection.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { Address } from 'viem';
2+
3+
import { getVaultHubContract } from 'contracts';
4+
import { callReadMethodSilent, logInfo } from 'utils';
5+
6+
export const checkIsDisconnected = async (vault: Address) => {
7+
const vaultHubContract = await getVaultHubContract();
8+
const connection = await callReadMethodSilent(
9+
vaultHubContract,
10+
'vaultConnection',
11+
[vault],
12+
);
13+
14+
const isDisconnected =
15+
connection.owner === '0x0000000000000000000000000000000000000000' ||
16+
connection.vaultIndex === 0n;
17+
18+
if (isDisconnected) {
19+
logInfo('⚠️ The vault is not connected to VaultHub ⚠️');
20+
return true;
21+
}
22+
23+
return false;
24+
};

0 commit comments

Comments
 (0)