@lidofinance/lsv-cli 1.0.0-alpha.4 → 1.0.0-alpha.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -19
- package/dist/abi/BlsHarness.d.ts +178 -0
- package/dist/abi/BlsHarness.js +232 -0
- package/dist/abi/BlsHarness.js.map +1 -0
- package/dist/abi/CLProofVerifier.d.ts +188 -0
- package/dist/abi/CLProofVerifier.js +247 -0
- package/dist/abi/CLProofVerifier.js.map +1 -0
- package/dist/abi/Dashboard.d.ts +1706 -0
- package/dist/abi/Dashboard.js +1922 -0
- package/dist/abi/Dashboard.js.map +1 -0
- package/dist/abi/LidoLocator.d.ts +330 -0
- package/dist/abi/LidoLocator.js +426 -0
- package/dist/abi/LidoLocator.js.map +1 -0
- package/dist/abi/OperatorGrid.d.ts +914 -0
- package/dist/abi/OperatorGrid.js +1185 -0
- package/dist/abi/OperatorGrid.js.map +1 -0
- package/dist/abi/PredepositGuarantee.d.ts +1382 -0
- package/dist/abi/PredepositGuarantee.js +1789 -0
- package/dist/abi/PredepositGuarantee.js.map +1 -0
- package/dist/abi/ReportChecker.d.ts +83 -0
- package/dist/abi/ReportChecker.js +109 -0
- package/dist/abi/ReportChecker.js.map +1 -0
- package/dist/abi/StEth.d.ts +372 -0
- package/dist/abi/StEth.js +493 -0
- package/dist/abi/StEth.js.map +1 -0
- package/dist/abi/StakingVault.d.ts +1085 -0
- package/dist/abi/StakingVault.js +1115 -0
- package/dist/abi/StakingVault.js.map +1 -0
- package/dist/abi/TokenManager.d.ts +577 -0
- package/dist/abi/TokenManager.js +756 -0
- package/dist/abi/TokenManager.js.map +1 -0
- package/dist/abi/VaultFactory.d.ts +160 -0
- package/dist/abi/VaultFactory.js +209 -0
- package/dist/abi/VaultFactory.js.map +1 -0
- package/dist/abi/VaultHub.d.ts +1537 -0
- package/dist/abi/VaultHub.js +1257 -436
- package/dist/abi/VaultHub.js.map +1 -1
- package/dist/abi/VaultViewer.d.ts +223 -0
- package/dist/abi/VaultViewer.js +297 -0
- package/dist/abi/VaultViewer.js.map +1 -0
- package/dist/abi/Voting.d.ts +676 -0
- package/dist/abi/Voting.js +884 -0
- package/dist/abi/Voting.js.map +1 -0
- package/dist/abi/WstEth.d.ts +362 -0
- package/dist/abi/WstEth.js +478 -0
- package/dist/abi/WstEth.js.map +1 -0
- package/dist/abi/index.d.ts +15 -0
- package/dist/abi/index.js +17 -0
- package/dist/abi/index.js.map +1 -0
- package/dist/command/index.d.ts +2 -0
- package/dist/command/index.js +4 -5
- package/dist/command/index.js.map +1 -1
- package/dist/configs/constants.d.ts +36 -0
- package/dist/configs/constants.js +3 -0
- package/dist/configs/constants.js.map +1 -0
- package/dist/configs/deployed.d.ts +17 -0
- package/dist/configs/deployed.js +87 -52
- package/dist/configs/deployed.js.map +1 -1
- package/dist/configs/envs.d.ts +2 -0
- package/dist/configs/envs.js +13 -37
- package/dist/configs/envs.js.map +1 -1
- package/dist/configs/index.d.ts +3 -0
- package/dist/configs/index.js +3 -18
- package/dist/configs/index.js.map +1 -1
- package/dist/configs/utils.d.ts +4 -0
- package/dist/configs/utils.js +22 -0
- package/dist/configs/utils.js.map +1 -0
- package/dist/contracts/blsHarness.d.ts +947 -0
- package/dist/contracts/blsHarness.js +24 -0
- package/dist/contracts/blsHarness.js.map +1 -0
- package/dist/contracts/clProofVerifier.d.ts +2647 -0
- package/dist/contracts/clProofVerifier.js +23 -0
- package/dist/contracts/clProofVerifier.js.map +1 -0
- package/dist/contracts/dashboard.d.ts +4 -0
- package/dist/contracts/dashboard.js +11 -0
- package/dist/contracts/dashboard.js.map +1 -0
- package/dist/contracts/index.d.ts +15 -0
- package/dist/contracts/index.js +15 -17
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/locator.d.ts +6935 -0
- package/dist/contracts/locator.js +16 -0
- package/dist/contracts/locator.js.map +1 -0
- package/dist/contracts/operator-grid.d.ts +3 -0
- package/dist/contracts/operator-grid.js +17 -0
- package/dist/contracts/operator-grid.js.map +1 -0
- package/dist/contracts/pdg.d.ts +3 -0
- package/dist/contracts/pdg.js +17 -0
- package/dist/contracts/pdg.js.map +1 -0
- package/dist/contracts/reportChecker.d.ts +758 -0
- package/dist/contracts/reportChecker.js +23 -0
- package/dist/contracts/reportChecker.js.map +1 -0
- package/dist/contracts/steth.d.ts +27706 -0
- package/dist/contracts/steth.js +18 -0
- package/dist/contracts/steth.js.map +1 -0
- package/dist/contracts/token-manager.d.ts +3 -0
- package/dist/contracts/token-manager.js +13 -0
- package/dist/contracts/token-manager.js.map +1 -0
- package/dist/contracts/vault-factory.d.ts +2678 -0
- package/dist/contracts/vault-factory.js +14 -0
- package/dist/contracts/vault-factory.js.map +1 -0
- package/dist/contracts/vault-hub.d.ts +3 -0
- package/dist/contracts/vault-hub.js +14 -16
- package/dist/contracts/vault-hub.js.map +1 -1
- package/dist/contracts/vault-viewer.d.ts +2681 -0
- package/dist/contracts/vault-viewer.js +23 -0
- package/dist/contracts/vault-viewer.js.map +1 -0
- package/dist/contracts/vault.d.ts +3 -0
- package/dist/contracts/vault.js +11 -0
- package/dist/contracts/vault.js.map +1 -0
- package/dist/contracts/voting.d.ts +6 -0
- package/dist/contracts/voting.js +19 -0
- package/dist/contracts/voting.js.map +1 -0
- package/dist/contracts/wsteth.d.ts +24690 -0
- package/dist/contracts/wsteth.js +18 -0
- package/dist/contracts/wsteth.js.map +1 -0
- package/dist/features/dashboard.d.ts +5 -0
- package/dist/features/dashboard.js +217 -0
- package/dist/features/dashboard.js.map +1 -0
- package/dist/features/index.d.ts +7 -0
- package/dist/features/index.js +8 -0
- package/dist/features/index.js.map +1 -0
- package/dist/features/operator-grid.d.ts +2 -0
- package/dist/features/operator-grid.js +57 -0
- package/dist/features/operator-grid.js.map +1 -0
- package/dist/features/pdg.d.ts +2 -0
- package/dist/features/pdg.js +80 -0
- package/dist/features/pdg.js.map +1 -0
- package/dist/features/token-manager.d.ts +0 -0
- package/dist/features/token-manager.js +7 -0
- package/dist/features/token-manager.js.map +1 -0
- package/dist/features/vault-factory.d.ts +8 -0
- package/dist/features/vault-factory.js +57 -0
- package/dist/features/vault-factory.js.map +1 -0
- package/dist/features/vault-hub.d.ts +2 -0
- package/dist/features/vault-hub.js +81 -0
- package/dist/features/vault-hub.js.map +1 -0
- package/dist/features/vault.d.ts +2 -0
- package/dist/features/vault.js +54 -0
- package/dist/features/vault.js.map +1 -0
- package/dist/features/voting.d.ts +7 -0
- package/dist/features/voting.js +133 -0
- package/dist/features/voting.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/dist/programs/account.d.ts +1 -0
- package/dist/programs/account.js +147 -0
- package/dist/programs/account.js.map +1 -0
- package/dist/programs/config.d.ts +1 -0
- package/dist/programs/config.js +31 -0
- package/dist/programs/config.js.map +1 -0
- package/dist/programs/dashboard/config.d.ts +2 -0
- package/dist/programs/dashboard/config.js +111 -0
- package/dist/programs/dashboard/config.js.map +1 -0
- package/dist/programs/dashboard/index.d.ts +3 -0
- package/dist/programs/dashboard/index.js +4 -0
- package/dist/programs/dashboard/index.js.map +1 -0
- package/dist/programs/dashboard/main.d.ts +1 -0
- package/dist/programs/dashboard/main.js +5 -0
- package/dist/programs/dashboard/main.js.map +1 -0
- package/dist/programs/dashboard/read.d.ts +1 -0
- package/dist/programs/dashboard/read.js +88 -0
- package/dist/programs/dashboard/read.js.map +1 -0
- package/dist/programs/dashboard/write.d.ts +1 -0
- package/dist/programs/dashboard/write.js +553 -0
- package/dist/programs/dashboard/write.js.map +1 -0
- package/dist/programs/hub/config.d.ts +2 -0
- package/dist/programs/hub/config.js +123 -0
- package/dist/programs/hub/config.js.map +1 -0
- package/dist/programs/hub/index.d.ts +3 -0
- package/dist/programs/hub/index.js +4 -0
- package/dist/programs/hub/index.js.map +1 -0
- package/dist/programs/hub/main.d.ts +1 -0
- package/dist/programs/hub/main.js +5 -0
- package/dist/programs/hub/main.js.map +1 -0
- package/dist/programs/hub/read.d.ts +1 -0
- package/dist/programs/hub/read.js +57 -0
- package/dist/programs/hub/read.js.map +1 -0
- package/dist/programs/hub/write.d.ts +1 -0
- package/dist/programs/hub/write.js +246 -0
- package/dist/programs/hub/write.js.map +1 -0
- package/dist/programs/index.d.ts +11 -0
- package/dist/programs/index.js +11 -17
- package/dist/programs/index.js.map +1 -1
- package/dist/programs/operator-grid/config.d.ts +2 -0
- package/dist/programs/operator-grid/config.js +81 -0
- package/dist/programs/operator-grid/config.js.map +1 -0
- package/dist/programs/operator-grid/index.d.ts +3 -0
- package/dist/programs/operator-grid/index.js +4 -0
- package/dist/programs/operator-grid/index.js.map +1 -0
- package/dist/programs/operator-grid/main.d.ts +1 -0
- package/dist/programs/operator-grid/main.js +5 -0
- package/dist/programs/operator-grid/main.js.map +1 -0
- package/dist/programs/operator-grid/read.d.ts +1 -0
- package/dist/programs/operator-grid/read.js +24 -0
- package/dist/programs/operator-grid/read.js.map +1 -0
- package/dist/programs/operator-grid/write.d.ts +1 -0
- package/dist/programs/operator-grid/write.js +124 -0
- package/dist/programs/operator-grid/write.js.map +1 -0
- package/dist/programs/pdg/config.d.ts +2 -0
- package/dist/programs/pdg/config.js +133 -0
- package/dist/programs/pdg/config.js.map +1 -0
- package/dist/programs/pdg/index.d.ts +3 -0
- package/dist/programs/pdg/index.js +4 -0
- package/dist/programs/pdg/index.js.map +1 -0
- package/dist/programs/pdg/main.d.ts +1 -0
- package/dist/programs/pdg/main.js +5 -0
- package/dist/programs/pdg/main.js.map +1 -0
- package/dist/programs/pdg/read.d.ts +1 -0
- package/dist/programs/pdg/read.js +24 -0
- package/dist/programs/pdg/read.js.map +1 -0
- package/dist/programs/pdg/write.d.ts +1 -0
- package/dist/programs/pdg/write.js +366 -0
- package/dist/programs/pdg/write.js.map +1 -0
- package/dist/programs/pdg-helpers.d.ts +1 -0
- package/dist/programs/pdg-helpers.js +216 -0
- package/dist/programs/pdg-helpers.js.map +1 -0
- package/dist/programs/report/index.d.ts +3 -0
- package/dist/programs/report/index.js +4 -0
- package/dist/programs/report/index.js.map +1 -0
- package/dist/programs/report/main.d.ts +1 -0
- package/dist/programs/report/main.js +3 -0
- package/dist/programs/report/main.js.map +1 -0
- package/dist/programs/report/read.d.ts +1 -0
- package/dist/programs/report/read.js +61 -0
- package/dist/programs/report/read.js.map +1 -0
- package/dist/programs/report/write.d.ts +1 -0
- package/dist/programs/report/write.js +126 -0
- package/dist/programs/report/write.js.map +1 -0
- package/dist/programs/vault/config.d.ts +2 -0
- package/dist/programs/vault/config.js +70 -0
- package/dist/programs/vault/config.js.map +1 -0
- package/dist/programs/vault/index.d.ts +3 -0
- package/dist/programs/vault/index.js +4 -0
- package/dist/programs/vault/index.js.map +1 -0
- package/dist/programs/vault/main.d.ts +1 -0
- package/dist/programs/vault/main.js +3 -0
- package/dist/programs/vault/main.js.map +1 -0
- package/dist/programs/vault/read.d.ts +1 -0
- package/dist/programs/vault/read.js +25 -0
- package/dist/programs/vault/read.js.map +1 -0
- package/dist/programs/vault/write.d.ts +1 -0
- package/dist/programs/vault/write.js +247 -0
- package/dist/programs/vault/write.js.map +1 -0
- package/dist/programs/vault-factory/config.d.ts +2 -0
- package/dist/programs/vault-factory/config.js +2 -0
- package/dist/programs/vault-factory/config.js.map +1 -0
- package/dist/programs/vault-factory/index.d.ts +3 -0
- package/dist/programs/vault-factory/index.js +4 -0
- package/dist/programs/vault-factory/index.js.map +1 -0
- package/dist/programs/vault-factory/main.d.ts +1 -0
- package/dist/programs/vault-factory/main.js +5 -0
- package/dist/programs/vault-factory/main.js.map +1 -0
- package/dist/programs/vault-factory/read.d.ts +1 -0
- package/dist/programs/vault-factory/read.js +24 -0
- package/dist/programs/vault-factory/read.js.map +1 -0
- package/dist/programs/vault-factory/write.d.ts +1 -0
- package/dist/programs/vault-factory/write.js +72 -0
- package/dist/programs/vault-factory/write.js.map +1 -0
- package/dist/programs/vault-viewer/config.d.ts +2 -0
- package/dist/programs/vault-viewer/config.js +120 -0
- package/dist/programs/vault-viewer/config.js.map +1 -0
- package/dist/programs/vault-viewer/index.d.ts +2 -0
- package/dist/programs/vault-viewer/index.js +3 -0
- package/dist/programs/vault-viewer/index.js.map +1 -0
- package/dist/programs/vault-viewer/main.d.ts +1 -0
- package/dist/programs/vault-viewer/main.js +10 -0
- package/dist/programs/vault-viewer/main.js.map +1 -0
- package/dist/programs/vault-viewer/read.d.ts +1 -0
- package/dist/programs/vault-viewer/read.js +106 -0
- package/dist/programs/vault-viewer/read.js.map +1 -0
- package/dist/programs/voting.d.ts +1 -0
- package/dist/programs/voting.js +18 -0
- package/dist/programs/voting.js.map +1 -0
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.js +1 -17
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/wallet.d.ts +6897 -0
- package/dist/providers/wallet.js +43 -28
- package/dist/providers/wallet.js.map +1 -1
- package/dist/types/common.d.ts +31 -0
- package/dist/types/common.js +2 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/config.d.ts +25 -0
- package/dist/types/config.js +2 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/arguments.d.ts +13 -0
- package/dist/utils/arguments.js +67 -0
- package/dist/utils/arguments.js.map +1 -0
- package/dist/utils/bls.d.ts +21 -0
- package/dist/utils/bls.js +101 -0
- package/dist/utils/bls.js.map +1 -0
- package/dist/utils/calculate-overview.d.ts +28 -0
- package/dist/utils/calculate-overview.js +56 -0
- package/dist/utils/calculate-overview.js.map +1 -0
- package/dist/utils/commands/dashboard.d.ts +6 -0
- package/dist/utils/commands/dashboard.js +108 -0
- package/dist/utils/commands/dashboard.js.map +1 -0
- package/dist/utils/commands/index.d.ts +1 -0
- package/dist/utils/commands/index.js +2 -0
- package/dist/utils/commands/index.js.map +1 -0
- package/dist/utils/contract.d.ts +45 -0
- package/dist/utils/contract.js +170 -0
- package/dist/utils/contract.js.map +1 -0
- package/dist/utils/data-validators.d.ts +6 -0
- package/dist/utils/data-validators.js +54 -0
- package/dist/utils/data-validators.js.map +1 -0
- package/dist/utils/error-handler.d.ts +1 -0
- package/dist/utils/error-handler.js +13 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/dist/utils/fetchCL.d.ts +14 -0
- package/dist/utils/fetchCL.js +57 -0
- package/dist/utils/fetchCL.js.map +1 -0
- package/dist/utils/get-commands.d.ts +2 -0
- package/dist/utils/get-commands.js +11 -0
- package/dist/utils/get-commands.js.map +1 -0
- package/dist/utils/get-deposit-data-root.d.ts +7 -0
- package/dist/utils/get-deposit-data-root.js +40 -0
- package/dist/utils/get-deposit-data-root.js.map +1 -0
- package/dist/utils/get-value.d.ts +1 -0
- package/dist/utils/get-value.js +5 -11
- package/dist/utils/get-value.js.map +1 -1
- package/dist/utils/health/calculate-health.d.ts +11 -0
- package/dist/utils/health/calculate-health.js +22 -0
- package/dist/utils/health/calculate-health.js.map +1 -0
- package/dist/utils/health/health-utils.d.ts +27743 -0
- package/dist/utils/health/health-utils.js +74 -0
- package/dist/utils/health/health-utils.js.map +1 -0
- package/dist/utils/health/index.d.ts +2 -0
- package/dist/utils/health/index.js +3 -0
- package/dist/utils/health/index.js.map +1 -0
- package/dist/utils/index.d.ts +22 -0
- package/dist/utils/index.js +22 -17
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/ipfs.d.ts +6 -0
- package/dist/utils/ipfs.js +57 -0
- package/dist/utils/ipfs.js.map +1 -0
- package/dist/utils/logging/console.d.ts +7 -0
- package/dist/utils/logging/console.js +23 -0
- package/dist/utils/logging/console.js.map +1 -0
- package/dist/utils/logging/constants.d.ts +2 -0
- package/dist/utils/logging/constants.js +12 -0
- package/dist/utils/logging/constants.js.map +1 -0
- package/dist/utils/logging/index.d.ts +1 -0
- package/dist/utils/logging/index.js +2 -0
- package/dist/utils/logging/index.js.map +1 -0
- package/dist/utils/prompts/dashboard.d.ts +29 -0
- package/dist/utils/prompts/dashboard.js +63 -0
- package/dist/utils/prompts/dashboard.js.map +1 -0
- package/dist/utils/prompts/default.d.ts +3 -0
- package/dist/utils/prompts/default.js +17 -0
- package/dist/utils/prompts/default.js.map +1 -0
- package/dist/utils/prompts/index.d.ts +5 -0
- package/dist/utils/prompts/index.js +6 -0
- package/dist/utils/prompts/index.js.map +1 -0
- package/dist/utils/prompts/operations.d.ts +9 -0
- package/dist/utils/prompts/operations.js +41 -0
- package/dist/utils/prompts/operations.js.map +1 -0
- package/dist/utils/prompts/predeposit-guarantee.d.ts +3 -0
- package/dist/utils/prompts/predeposit-guarantee.js +22 -0
- package/dist/utils/prompts/predeposit-guarantee.js.map +1 -0
- package/dist/utils/prompts/vault.d.ts +2 -0
- package/dist/utils/prompts/vault.js +14 -0
- package/dist/utils/prompts/vault.js.map +1 -0
- package/dist/utils/proof/create-proof.d.ts +11 -0
- package/dist/utils/proof/create-proof.js +38 -0
- package/dist/utils/proof/create-proof.js.map +1 -0
- package/dist/utils/proof/first-validator-gindex.d.ts +1 -0
- package/dist/utils/proof/first-validator-gindex.js +27 -0
- package/dist/utils/proof/first-validator-gindex.js.map +1 -0
- package/dist/utils/proof/index.d.ts +4 -0
- package/dist/utils/proof/index.js +5 -0
- package/dist/utils/proof/index.js.map +1 -0
- package/dist/utils/proof/merkle-utils.d.ts +54 -0
- package/dist/utils/proof/merkle-utils.js +173 -0
- package/dist/utils/proof/merkle-utils.js.map +1 -0
- package/dist/utils/proof/proofs.d.ts +305 -0
- package/dist/utils/proof/proofs.js +52 -0
- package/dist/utils/proof/proofs.js.map +1 -0
- package/dist/utils/proof/report-proof.d.ts +5 -0
- package/dist/utils/proof/report-proof.js +26 -0
- package/dist/utils/proof/report-proof.js.map +1 -0
- package/dist/utils/read-programs-by-abi.d.ts +20 -0
- package/dist/utils/read-programs-by-abi.js +91 -0
- package/dist/utils/read-programs-by-abi.js.map +1 -0
- package/dist/utils/report.d.ts +89 -0
- package/dist/utils/report.js +72 -0
- package/dist/utils/report.js.map +1 -0
- package/dist/utils/required-lock.d.ts +5 -0
- package/dist/utils/required-lock.js +21 -0
- package/dist/utils/required-lock.js.map +1 -0
- package/dist/utils/resolve-path.d.ts +1 -0
- package/dist/utils/resolve-path.js +10 -0
- package/dist/utils/resolve-path.js.map +1 -0
- package/dist/utils/sleep.d.ts +1 -0
- package/dist/utils/sleep.js +4 -0
- package/dist/utils/sleep.js.map +1 -0
- package/dist/utils/spinner/index.d.ts +1 -0
- package/dist/utils/spinner/index.js +2 -0
- package/dist/utils/spinner/index.js.map +1 -0
- package/dist/utils/spinner/spinners.d.ts +7 -0
- package/dist/utils/spinner/spinners.js +16 -0
- package/dist/utils/spinner/spinners.js.map +1 -0
- package/dist/utils/spinner/spinners.json +119 -0
- package/dist/version/index.d.ts +1 -0
- package/dist/version/index.js +1 -0
- package/dist/version/index.js.map +1 -0
- package/package.json +64 -12
- package/dist/programs/vault-hub.js +0 -137
- package/dist/programs/vault-hub.js.map +0 -1
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { formatEther } from 'viem';
|
|
2
|
+
import { Option } from 'commander';
|
|
3
|
+
import { DashboardAbi } from '../../abi/index.js';
|
|
4
|
+
import { getDashboardBaseInfo, getDashboardRoles, getDashboardHealth, getDashboardOverview, } from '../../features/index.js';
|
|
5
|
+
import { getDashboardContract, getStakingVaultContract } from '../../contracts/index.js';
|
|
6
|
+
import { generateReadCommands, logResult, logInfo, getCommandsJson, stringToAddress, callReadMethod, getRequiredLockByShares, callReadMethodSilent, } from '../../utils/index.js';
|
|
7
|
+
import { dashboard } from './main.js';
|
|
8
|
+
import { readCommandConfig } from './config.js';
|
|
9
|
+
const dashboardRead = dashboard
|
|
10
|
+
.command('read')
|
|
11
|
+
.alias('r')
|
|
12
|
+
.description('read commands');
|
|
13
|
+
dashboardRead.addOption(new Option('-cmd2json'));
|
|
14
|
+
dashboardRead.on('option:-cmd2json', function () {
|
|
15
|
+
logInfo(getCommandsJson(dashboardRead));
|
|
16
|
+
process.exit();
|
|
17
|
+
});
|
|
18
|
+
dashboardRead
|
|
19
|
+
.command('info')
|
|
20
|
+
.description('get dashboard base info')
|
|
21
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
22
|
+
.action(async (address) => {
|
|
23
|
+
const contract = getDashboardContract(address);
|
|
24
|
+
await getDashboardBaseInfo(contract);
|
|
25
|
+
});
|
|
26
|
+
dashboardRead
|
|
27
|
+
.command('overview')
|
|
28
|
+
.description('get dashboard overview')
|
|
29
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
30
|
+
.action(async (address) => {
|
|
31
|
+
const contract = getDashboardContract(address);
|
|
32
|
+
await getDashboardOverview(contract);
|
|
33
|
+
});
|
|
34
|
+
dashboardRead
|
|
35
|
+
.command('roles')
|
|
36
|
+
.description('get dashboard roles')
|
|
37
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
38
|
+
.action(async (address) => {
|
|
39
|
+
const contract = getDashboardContract(address);
|
|
40
|
+
await getDashboardRoles(contract);
|
|
41
|
+
});
|
|
42
|
+
dashboardRead
|
|
43
|
+
.command('health')
|
|
44
|
+
.description('get vault health info')
|
|
45
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
46
|
+
.action(async (address) => {
|
|
47
|
+
const contract = getDashboardContract(address);
|
|
48
|
+
await getDashboardHealth(contract);
|
|
49
|
+
});
|
|
50
|
+
dashboardRead
|
|
51
|
+
.command('locked')
|
|
52
|
+
.description('get locked info')
|
|
53
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
54
|
+
.action(async (address) => {
|
|
55
|
+
const contract = getDashboardContract(address);
|
|
56
|
+
const vault = await callReadMethod(contract, 'stakingVault');
|
|
57
|
+
const vaultContract = getStakingVaultContract(vault);
|
|
58
|
+
await callReadMethod(vaultContract, 'locked');
|
|
59
|
+
});
|
|
60
|
+
dashboardRead
|
|
61
|
+
.command('required-lock-by-shares')
|
|
62
|
+
.alias('req-lock')
|
|
63
|
+
.description('get required lock by shares')
|
|
64
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
65
|
+
.argument('<newShares>', 'new shares')
|
|
66
|
+
.action(async (address, newShares) => {
|
|
67
|
+
const { requiredLock, currentLock } = await getRequiredLockByShares(address, newShares);
|
|
68
|
+
logResult({
|
|
69
|
+
'Required Lock (wei)': requiredLock,
|
|
70
|
+
'Required Lock (shares)': formatEther(requiredLock),
|
|
71
|
+
'Current Lock (wei)': currentLock,
|
|
72
|
+
'Current Lock (shares)': formatEther(currentLock),
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
dashboardRead
|
|
76
|
+
.command('dashboard-address-by-vault')
|
|
77
|
+
.alias('dashboard-by-vault')
|
|
78
|
+
.description('get dashboard address by vault')
|
|
79
|
+
.argument('<vault>', 'vault address', stringToAddress)
|
|
80
|
+
.action(async (vault) => {
|
|
81
|
+
const contract = getStakingVaultContract(vault);
|
|
82
|
+
const owner = await callReadMethodSilent(contract, 'owner');
|
|
83
|
+
logResult({
|
|
84
|
+
'Dashboard Address': owner,
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
generateReadCommands(DashboardAbi, getDashboardContract, dashboardRead, readCommandConfig);
|
|
88
|
+
//# sourceMappingURL=read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../../programs/dashboard/read.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,553 @@
|
|
|
1
|
+
import { parseEther, formatEther } from 'viem';
|
|
2
|
+
import { Option } from 'commander';
|
|
3
|
+
import { getDashboardContract, getStakingVaultContract } from '../../contracts/index.js';
|
|
4
|
+
import { callReadMethod, callWriteMethodWithReceipt, stringToBigIntArray, jsonToRoleAssignment, confirmOperation, stringToBigInt, mintShares, burnShares, parseDepositArray, logInfo, getCommandsJson, stringToAddress, mintSteth, burnSteth, createPDGProof, } from '../../utils/index.js';
|
|
5
|
+
import { dashboard } from './main.js';
|
|
6
|
+
const dashboardWrite = dashboard
|
|
7
|
+
.command('write')
|
|
8
|
+
.alias('w')
|
|
9
|
+
.description('write commands');
|
|
10
|
+
dashboardWrite.addOption(new Option('-cmd2json'));
|
|
11
|
+
dashboardWrite.on('option:-cmd2json', function () {
|
|
12
|
+
logInfo(getCommandsJson(dashboardWrite));
|
|
13
|
+
process.exit();
|
|
14
|
+
});
|
|
15
|
+
dashboardWrite
|
|
16
|
+
.command('ownership')
|
|
17
|
+
.description('transfers ownership of the staking vault to a new owner')
|
|
18
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
19
|
+
.argument('<newOwner>', 'address of the new owner', stringToAddress)
|
|
20
|
+
.action(async (address, newOwner) => {
|
|
21
|
+
const contract = getDashboardContract(address);
|
|
22
|
+
const vault = await callReadMethod(contract, 'stakingVault');
|
|
23
|
+
const confirm = await confirmOperation(`Are you sure you want to transfer ownership of the staking vault ${vault} to ${newOwner}?`);
|
|
24
|
+
if (!confirm)
|
|
25
|
+
return;
|
|
26
|
+
await callWriteMethodWithReceipt({
|
|
27
|
+
contract,
|
|
28
|
+
methodName: 'transferStakingVaultOwnership',
|
|
29
|
+
payload: [newOwner],
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
dashboardWrite
|
|
33
|
+
.command('disconnect')
|
|
34
|
+
.description('disconnects the staking vault from the vault hub')
|
|
35
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
36
|
+
.action(async (address) => {
|
|
37
|
+
const contract = getDashboardContract(address);
|
|
38
|
+
const vault = await callReadMethod(contract, 'stakingVault');
|
|
39
|
+
const confirm = await confirmOperation(`Are you sure you want to disconnect the staking vault ${vault}?`);
|
|
40
|
+
if (!confirm)
|
|
41
|
+
return;
|
|
42
|
+
await callWriteMethodWithReceipt({
|
|
43
|
+
contract,
|
|
44
|
+
methodName: 'voluntaryDisconnect',
|
|
45
|
+
payload: [],
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
dashboardWrite
|
|
49
|
+
.command('fund')
|
|
50
|
+
.description('funds the staking vault with ether')
|
|
51
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
52
|
+
.argument('<ether>', 'amount of ether to be funded (in ETH)')
|
|
53
|
+
.action(async (address, ether) => {
|
|
54
|
+
const contract = getDashboardContract(address);
|
|
55
|
+
const vault = await callReadMethod(contract, 'stakingVault');
|
|
56
|
+
const confirm = await confirmOperation(`Are you sure you want to fund the staking vault ${vault} with ${ether} ether?`);
|
|
57
|
+
if (!confirm)
|
|
58
|
+
return;
|
|
59
|
+
await callWriteMethodWithReceipt({
|
|
60
|
+
contract,
|
|
61
|
+
methodName: 'fund',
|
|
62
|
+
payload: [],
|
|
63
|
+
value: parseEther(ether),
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
dashboardWrite
|
|
67
|
+
.command('withdraw')
|
|
68
|
+
.description('withdraws ether from the staking vault to a recipient')
|
|
69
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
70
|
+
.argument('<recipient>', 'address of the recipient', stringToAddress)
|
|
71
|
+
.argument('<eth>', 'amount of ether to withdraw (in ETH)')
|
|
72
|
+
.action(async (address, recipient, ether) => {
|
|
73
|
+
const contract = getDashboardContract(address);
|
|
74
|
+
const vault = await callReadMethod(contract, 'stakingVault');
|
|
75
|
+
const confirm = await confirmOperation(`Are you sure you want to withdraw ${ether} from the staking vault ${vault} to ${recipient}?`);
|
|
76
|
+
if (!confirm)
|
|
77
|
+
return;
|
|
78
|
+
await callWriteMethodWithReceipt({
|
|
79
|
+
contract,
|
|
80
|
+
methodName: 'withdraw',
|
|
81
|
+
payload: [recipient, parseEther(ether)],
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
dashboardWrite
|
|
85
|
+
.command('lock')
|
|
86
|
+
.description('updates the locked amount of the staking vault')
|
|
87
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
88
|
+
.argument('<lockedAmount>', 'amount of ether to lock')
|
|
89
|
+
.action(async (address, lockedAmount) => {
|
|
90
|
+
const contract = getDashboardContract(address);
|
|
91
|
+
const vault = await callReadMethod(contract, 'stakingVault');
|
|
92
|
+
const confirm = await confirmOperation(`Are you sure you want to update the locked amount of the staking vault ${vault} to ${lockedAmount}?`);
|
|
93
|
+
if (!confirm)
|
|
94
|
+
return;
|
|
95
|
+
await callWriteMethodWithReceipt({
|
|
96
|
+
contract,
|
|
97
|
+
methodName: 'lock',
|
|
98
|
+
payload: [parseEther(lockedAmount)],
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
dashboardWrite
|
|
102
|
+
.command('exit')
|
|
103
|
+
.description('requests the exit of a validator from the staking vault')
|
|
104
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
105
|
+
.argument('<validatorPubKey>', 'public key of the validator to exit')
|
|
106
|
+
.action(async (address, validatorPubKey) => {
|
|
107
|
+
const contract = getDashboardContract(address);
|
|
108
|
+
const vault = await callReadMethod(contract, 'stakingVault');
|
|
109
|
+
const confirm = await confirmOperation(`Are you sure you want to exit the validator ${validatorPubKey} from the staking vault ${vault}?`);
|
|
110
|
+
if (!confirm)
|
|
111
|
+
return;
|
|
112
|
+
await callWriteMethodWithReceipt({
|
|
113
|
+
contract,
|
|
114
|
+
methodName: 'requestValidatorExit',
|
|
115
|
+
payload: [validatorPubKey],
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
dashboardWrite
|
|
119
|
+
.command('trigger-validator-withdrawal')
|
|
120
|
+
.description('triggers the withdrawal of a validator from the staking vault')
|
|
121
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
122
|
+
.argument('<pubkeys>', 'pubkeys of the validators to withdraw')
|
|
123
|
+
.argument('<amounts>', 'amounts of ether to withdraw', stringToBigIntArray)
|
|
124
|
+
.argument('<recipient>', 'address of the recipient', stringToAddress)
|
|
125
|
+
.action(async (address, pubkeys, amounts, recipient) => {
|
|
126
|
+
const contract = getDashboardContract(address);
|
|
127
|
+
const vault = await callReadMethod(contract, 'stakingVault');
|
|
128
|
+
const vaultContract = getStakingVaultContract(vault);
|
|
129
|
+
const fee = await callReadMethod(vaultContract, 'calculateValidatorWithdrawalFee', [BigInt(amounts.length)]);
|
|
130
|
+
const confirm = await confirmOperation(`Are you sure you want to trigger the withdrawal of the validators ${pubkeys} from the staking vault ${vault} to ${recipient} with amounts ${amounts}?`);
|
|
131
|
+
if (!confirm)
|
|
132
|
+
return;
|
|
133
|
+
await callWriteMethodWithReceipt({
|
|
134
|
+
contract,
|
|
135
|
+
methodName: 'triggerValidatorWithdrawal',
|
|
136
|
+
payload: [pubkeys, amounts, recipient],
|
|
137
|
+
value: fee,
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
dashboardWrite
|
|
141
|
+
.command('mint-shares')
|
|
142
|
+
.alias('mint')
|
|
143
|
+
.description('mints stETH tokens backed by the vault to a recipient')
|
|
144
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
145
|
+
.argument('<recipient>', 'address of the recipient', stringToAddress)
|
|
146
|
+
.argument('<amountOfShares>', 'amount of shares to mint (in Shares)')
|
|
147
|
+
.action(async (address, recipient, amountOfShares) => {
|
|
148
|
+
const contract = getDashboardContract(address);
|
|
149
|
+
await mintShares(contract, recipient, parseEther(amountOfShares), 'mintShares');
|
|
150
|
+
});
|
|
151
|
+
dashboardWrite
|
|
152
|
+
.command('mint-steth')
|
|
153
|
+
.description('mints stETH tokens backed by the vault to a recipient')
|
|
154
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
155
|
+
.argument('<recipient>', 'address of the recipient', stringToAddress)
|
|
156
|
+
.argument('<amountOfSteth>', 'amount of stETH to mint')
|
|
157
|
+
.action(async (address, recipient, amountOfSteth) => {
|
|
158
|
+
const contract = getDashboardContract(address);
|
|
159
|
+
await mintSteth(contract, recipient, parseEther(amountOfSteth));
|
|
160
|
+
});
|
|
161
|
+
dashboardWrite
|
|
162
|
+
.command('mint-wsteth')
|
|
163
|
+
.description('mints wstETH tokens backed by the vault to a recipient')
|
|
164
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
165
|
+
.argument('<recipient>', 'address of the recipient', stringToAddress)
|
|
166
|
+
.argument('<amountOfWsteth>', 'amount of wstETH to mint')
|
|
167
|
+
.action(async (address, recipient, amountOfWsteth) => {
|
|
168
|
+
const contract = getDashboardContract(address);
|
|
169
|
+
await mintShares(contract, recipient, parseEther(amountOfWsteth), 'mintWstETH');
|
|
170
|
+
});
|
|
171
|
+
dashboardWrite
|
|
172
|
+
.command('burn-shares')
|
|
173
|
+
.alias('burn')
|
|
174
|
+
.description('Burns stETH shares from the sender backed by the vault. Expects corresponding amount of stETH approved to this contract')
|
|
175
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
176
|
+
.argument('<amountOfShares>', 'amount of shares to burn (in Shares)')
|
|
177
|
+
.action(async (address, amountOfShares) => {
|
|
178
|
+
const contract = getDashboardContract(address);
|
|
179
|
+
await burnShares(contract, parseEther(amountOfShares), 'burnShares');
|
|
180
|
+
});
|
|
181
|
+
dashboardWrite
|
|
182
|
+
.command('burn-steth')
|
|
183
|
+
.description('Burns stETH shares from the sender backed by the vault. Expects stETH amount approved to this contract.')
|
|
184
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
185
|
+
.argument('<amountOfShares>', 'amount of shares to burn (in stETH)')
|
|
186
|
+
.action(async (address, amountOfShares) => {
|
|
187
|
+
const contract = getDashboardContract(address);
|
|
188
|
+
await burnSteth(contract, parseEther(amountOfShares));
|
|
189
|
+
});
|
|
190
|
+
dashboardWrite
|
|
191
|
+
.command('burn-wsteth')
|
|
192
|
+
.description('burn wstETH tokens from the sender backed by the vault')
|
|
193
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
194
|
+
.argument('<tokens>', 'amount of wstETH tokens to burn (in wstETH)')
|
|
195
|
+
.action(async (address, tokens) => {
|
|
196
|
+
const contract = getDashboardContract(address);
|
|
197
|
+
await burnShares(contract, parseEther(tokens), 'burnWstETH');
|
|
198
|
+
});
|
|
199
|
+
dashboardWrite
|
|
200
|
+
.command('rebalance')
|
|
201
|
+
.description('rebalance the vault by transferring ether')
|
|
202
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
203
|
+
.argument('<ether>', 'amount of ether to rebalance (in ETH)')
|
|
204
|
+
.action(async (address, ether) => {
|
|
205
|
+
const contract = getDashboardContract(address);
|
|
206
|
+
const vault = await callReadMethod(contract, 'stakingVault');
|
|
207
|
+
const confirm = await confirmOperation(`Are you sure you want to rebalance the vault ${vault} with ${ether} ether?`);
|
|
208
|
+
if (!confirm)
|
|
209
|
+
return;
|
|
210
|
+
await callWriteMethodWithReceipt({
|
|
211
|
+
contract,
|
|
212
|
+
methodName: 'rebalanceVault',
|
|
213
|
+
payload: [parseEther(ether)],
|
|
214
|
+
});
|
|
215
|
+
});
|
|
216
|
+
dashboardWrite
|
|
217
|
+
.command('recover-erc20')
|
|
218
|
+
.description('recovers ERC20 tokens or ether from the dashboard contract to sender')
|
|
219
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
220
|
+
.argument('<token>', 'Address of the token to recover or 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee for ether')
|
|
221
|
+
.argument('<recipient>', 'Address of the recovery recipient', stringToAddress)
|
|
222
|
+
.argument('<amount>', 'amount of ether to recover (in ETH)')
|
|
223
|
+
.action(async (address, token, recipient, amount) => {
|
|
224
|
+
const contract = getDashboardContract(address);
|
|
225
|
+
const confirm = await confirmOperation(`Are you sure you want to recover ${amount} ${token} from the dashboard contract ${address} to ${recipient}?`);
|
|
226
|
+
if (!confirm)
|
|
227
|
+
return;
|
|
228
|
+
await callWriteMethodWithReceipt({
|
|
229
|
+
contract,
|
|
230
|
+
methodName: 'recoverERC20',
|
|
231
|
+
payload: [token, recipient, parseEther(amount)],
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
dashboardWrite
|
|
235
|
+
.command('recover-erc721')
|
|
236
|
+
.description('Transfers a given token_id of an ERC721-compatible NFT (defined by the token contract address)')
|
|
237
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
238
|
+
.argument('<token>', 'an ERC721-compatible token')
|
|
239
|
+
.argument('<tokenId>', 'token id to recover')
|
|
240
|
+
.argument('<recipient>', 'Address of the recovery recipient', stringToAddress)
|
|
241
|
+
.action(async (address, token, tokenId, recipient) => {
|
|
242
|
+
const contract = getDashboardContract(address);
|
|
243
|
+
const confirm = await confirmOperation(`Are you sure you want to recover the token ${token} with id ${tokenId} from the dashboard contract ${address} to ${recipient}?`);
|
|
244
|
+
if (!confirm)
|
|
245
|
+
return;
|
|
246
|
+
await callWriteMethodWithReceipt({
|
|
247
|
+
contract,
|
|
248
|
+
methodName: 'recoverERC721',
|
|
249
|
+
payload: [token, BigInt(tokenId), recipient],
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
dashboardWrite
|
|
253
|
+
.command('deposit-pause')
|
|
254
|
+
.description('Pauses beacon chain deposits on the staking vault.')
|
|
255
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
256
|
+
.action(async (address) => {
|
|
257
|
+
const contract = getDashboardContract(address);
|
|
258
|
+
const vault = await callReadMethod(contract, 'stakingVault');
|
|
259
|
+
const confirm = await confirmOperation(`Are you sure you want to pause beacon chain deposits on the staking vault ${vault}?`);
|
|
260
|
+
if (!confirm)
|
|
261
|
+
return;
|
|
262
|
+
await callWriteMethodWithReceipt({
|
|
263
|
+
contract,
|
|
264
|
+
methodName: 'pauseBeaconChainDeposits',
|
|
265
|
+
payload: [],
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
dashboardWrite
|
|
269
|
+
.command('deposit-resume')
|
|
270
|
+
.description('Mass-grants multiple roles to multiple accounts.')
|
|
271
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
272
|
+
.action(async (address) => {
|
|
273
|
+
const contract = getDashboardContract(address);
|
|
274
|
+
const vault = await callReadMethod(contract, 'stakingVault');
|
|
275
|
+
const confirm = await confirmOperation(`Are you sure you want to resume beacon chain deposits on the staking vault ${vault}?`);
|
|
276
|
+
if (!confirm)
|
|
277
|
+
return;
|
|
278
|
+
await callWriteMethodWithReceipt({
|
|
279
|
+
contract,
|
|
280
|
+
methodName: 'resumeBeaconChainDeposits',
|
|
281
|
+
payload: [],
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
dashboardWrite
|
|
285
|
+
.command('role-grant')
|
|
286
|
+
.description('Mass-revokes multiple roles from multiple accounts.')
|
|
287
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
288
|
+
.argument('<roleAssignmentJSON>', 'JSON array of role assignments', jsonToRoleAssignment)
|
|
289
|
+
.addHelpText('after', `Role assignment format:
|
|
290
|
+
[{
|
|
291
|
+
"account": "...",
|
|
292
|
+
"role": "..."
|
|
293
|
+
}
|
|
294
|
+
{second role assignment}
|
|
295
|
+
...]`)
|
|
296
|
+
.action(async (address, roleAssignment) => {
|
|
297
|
+
const contract = getDashboardContract(address);
|
|
298
|
+
if (!Array.isArray(roleAssignment)) {
|
|
299
|
+
throw new Error('the 2nd argument should be an array of role assignments');
|
|
300
|
+
}
|
|
301
|
+
const vault = await callReadMethod(contract, 'stakingVault');
|
|
302
|
+
const confirm = await confirmOperation(`Are you sure you want to grant the roles ${roleAssignment.map((i) => JSON.stringify(i))} in the vault ${vault}?`);
|
|
303
|
+
if (!confirm)
|
|
304
|
+
return;
|
|
305
|
+
await callWriteMethodWithReceipt({
|
|
306
|
+
contract,
|
|
307
|
+
methodName: 'grantRoles',
|
|
308
|
+
payload: [roleAssignment],
|
|
309
|
+
});
|
|
310
|
+
});
|
|
311
|
+
dashboardWrite
|
|
312
|
+
.command('role-revoke')
|
|
313
|
+
.description('Resumes beacon chain deposits on the staking vault.')
|
|
314
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
315
|
+
.argument('<roleAssignmentJSON>', 'JSON array of role assignments', jsonToRoleAssignment)
|
|
316
|
+
.addHelpText('after', `Role assignment format:
|
|
317
|
+
[{
|
|
318
|
+
"account": "...",
|
|
319
|
+
"role": "..."
|
|
320
|
+
}
|
|
321
|
+
{second role assignment}
|
|
322
|
+
...]`)
|
|
323
|
+
.action(async (address, roleAssignment) => {
|
|
324
|
+
const contract = getDashboardContract(address);
|
|
325
|
+
if (!Array.isArray(roleAssignment)) {
|
|
326
|
+
throw new Error('the 2nd argument should be an array of role assignments');
|
|
327
|
+
}
|
|
328
|
+
const vault = await callReadMethod(contract, 'stakingVault');
|
|
329
|
+
const confirm = await confirmOperation(`Are you sure you want to revoke the roles ${roleAssignment.map((i) => JSON.stringify(i))} in the vault ${vault}?`);
|
|
330
|
+
if (!confirm)
|
|
331
|
+
return;
|
|
332
|
+
await callWriteMethodWithReceipt({
|
|
333
|
+
contract,
|
|
334
|
+
methodName: 'revokeRoles',
|
|
335
|
+
payload: [roleAssignment],
|
|
336
|
+
});
|
|
337
|
+
});
|
|
338
|
+
dashboardWrite
|
|
339
|
+
.command('compensate-disproven-predeposit')
|
|
340
|
+
.alias('compensate')
|
|
341
|
+
.description('Compensates ether of disproven validator`s predeposit from PDG to the recipient')
|
|
342
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
343
|
+
.argument('<pubkey>', 'validator that was proven invalid in PDG')
|
|
344
|
+
.argument('<recipient>', 'address to receive the `PDG.PREDEPOSIT_AMOUNT`', stringToAddress)
|
|
345
|
+
.action(async (address, pubkey, recipient) => {
|
|
346
|
+
const contract = getDashboardContract(address);
|
|
347
|
+
const confirm = await confirmOperation(`Are you sure you want to compensate the disproven predeposit from the Predeposit Guarantee contract ${contract} with validator public key ${pubkey} to ${recipient}?`);
|
|
348
|
+
if (!confirm)
|
|
349
|
+
return;
|
|
350
|
+
await callWriteMethodWithReceipt({
|
|
351
|
+
contract,
|
|
352
|
+
methodName: 'compensateDisprovenPredepositFromPDG',
|
|
353
|
+
payload: [pubkey, recipient],
|
|
354
|
+
});
|
|
355
|
+
});
|
|
356
|
+
dashboardWrite
|
|
357
|
+
.command('unguaranteed-deposit-to-beacon-chain')
|
|
358
|
+
.alias('unguaranteed-deposit')
|
|
359
|
+
.description('Withdraws ether from vault and deposits directly to provided validators bypassing the default PDG process')
|
|
360
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
361
|
+
.argument('<deposits>', 'array of IStakingVault.Deposit structs containing deposit data', parseDepositArray)
|
|
362
|
+
.addHelpText('after', `Deposit format:
|
|
363
|
+
'{
|
|
364
|
+
"pubkey": "...",
|
|
365
|
+
"signature": "...",
|
|
366
|
+
"amount": "...",
|
|
367
|
+
"deposit_data_root": "..."
|
|
368
|
+
}
|
|
369
|
+
{second deposit}
|
|
370
|
+
...'`)
|
|
371
|
+
.action(async (address, deposits) => {
|
|
372
|
+
const contract = getDashboardContract(address);
|
|
373
|
+
const vault = await callReadMethod(contract, 'stakingVault');
|
|
374
|
+
const confirm = await confirmOperation(`Are you sure you want to unguaranteed deposit ${deposits.length} deposits to the beacon chain in the staking vault ${vault}?
|
|
375
|
+
Deposits: ${JSON.stringify(deposits)}`);
|
|
376
|
+
if (!confirm)
|
|
377
|
+
return;
|
|
378
|
+
await callWriteMethodWithReceipt({
|
|
379
|
+
contract,
|
|
380
|
+
methodName: 'unguaranteedDepositToBeaconChain',
|
|
381
|
+
payload: [deposits],
|
|
382
|
+
});
|
|
383
|
+
});
|
|
384
|
+
dashboardWrite
|
|
385
|
+
.command('prove-unknown-validators-to-pdg')
|
|
386
|
+
.alias('prove-unknown-validators')
|
|
387
|
+
.description('Proves validators with correct vault WC if they are unknown to PDG')
|
|
388
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
389
|
+
.argument('<validatorIndex...>', 'index of the validator to prove')
|
|
390
|
+
.action(async (address, validatorIndexes) => {
|
|
391
|
+
const contract = getDashboardContract(address);
|
|
392
|
+
const vault = await callReadMethod(contract, 'stakingVault');
|
|
393
|
+
const vaultContract = getStakingVaultContract(vault);
|
|
394
|
+
const pdgContract = await callReadMethod(vaultContract, 'depositor');
|
|
395
|
+
for (const validatorIndex of validatorIndexes) {
|
|
396
|
+
const packageProof = await createPDGProof(Number(validatorIndex));
|
|
397
|
+
const { proof, pubkey, childBlockTimestamp } = packageProof;
|
|
398
|
+
const confirm = await confirmOperation(`Are you sure you want to prove ${proof.length} validators to the Predeposit Guarantee contract ${pdgContract} in the staking vault ${vault}?
|
|
399
|
+
Witnesses: ${JSON.stringify(proof)}`);
|
|
400
|
+
if (!confirm)
|
|
401
|
+
return;
|
|
402
|
+
await callWriteMethodWithReceipt({
|
|
403
|
+
contract,
|
|
404
|
+
methodName: 'proveUnknownValidatorsToPDG',
|
|
405
|
+
payload: [
|
|
406
|
+
[
|
|
407
|
+
{
|
|
408
|
+
proof,
|
|
409
|
+
pubkey,
|
|
410
|
+
validatorIndex: BigInt(validatorIndex),
|
|
411
|
+
childBlockTimestamp,
|
|
412
|
+
},
|
|
413
|
+
],
|
|
414
|
+
],
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
dashboardWrite
|
|
419
|
+
.command('authorize-lido-vault-hub')
|
|
420
|
+
.alias('authorize-hub')
|
|
421
|
+
.description('Authorizes the Lido Vault Hub to manage the staking vault.')
|
|
422
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
423
|
+
.action(async (address) => {
|
|
424
|
+
const contract = getDashboardContract(address);
|
|
425
|
+
const vault = await callReadMethod(contract, 'stakingVault');
|
|
426
|
+
const confirm = await confirmOperation(`Are you sure you want to authorize the Lido Vault Hub to manage the staking vault ${vault}?`);
|
|
427
|
+
if (!confirm)
|
|
428
|
+
return;
|
|
429
|
+
await callWriteMethodWithReceipt({
|
|
430
|
+
contract,
|
|
431
|
+
methodName: 'authorizeLidoVaultHub',
|
|
432
|
+
payload: [],
|
|
433
|
+
});
|
|
434
|
+
});
|
|
435
|
+
dashboardWrite
|
|
436
|
+
.command('deauthorize-lido-vault-hub')
|
|
437
|
+
.alias('deauthorize-hub')
|
|
438
|
+
.description('Deauthorizes the Lido Vault Hub from managing the staking vault.')
|
|
439
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
440
|
+
.action(async (address) => {
|
|
441
|
+
const contract = getDashboardContract(address);
|
|
442
|
+
const vault = await callReadMethod(contract, 'stakingVault');
|
|
443
|
+
const confirm = await confirmOperation(`Are you sure you want to deauthorize the Lido Vault Hub from managing the staking vault ${vault}?`);
|
|
444
|
+
if (!confirm)
|
|
445
|
+
return;
|
|
446
|
+
await callWriteMethodWithReceipt({
|
|
447
|
+
contract,
|
|
448
|
+
methodName: 'deauthorizeLidoVaultHub',
|
|
449
|
+
payload: [],
|
|
450
|
+
});
|
|
451
|
+
});
|
|
452
|
+
dashboardWrite
|
|
453
|
+
.command('ossify-staking-vault')
|
|
454
|
+
.alias('ossify')
|
|
455
|
+
.description('Ossifies the staking vault.')
|
|
456
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
457
|
+
.action(async (address) => {
|
|
458
|
+
const contract = getDashboardContract(address);
|
|
459
|
+
const vault = await callReadMethod(contract, 'stakingVault');
|
|
460
|
+
const confirm = await confirmOperation(`Are you sure you want to ossify the staking vault ${vault}?`);
|
|
461
|
+
if (!confirm)
|
|
462
|
+
return;
|
|
463
|
+
await callWriteMethodWithReceipt({
|
|
464
|
+
contract,
|
|
465
|
+
methodName: 'ossifyStakingVault',
|
|
466
|
+
payload: [],
|
|
467
|
+
});
|
|
468
|
+
});
|
|
469
|
+
dashboardWrite
|
|
470
|
+
.command('set-depositor')
|
|
471
|
+
.description('Updates the address of the depositor for the staking vault.')
|
|
472
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
473
|
+
.argument('<depositor>', 'address of the new depositor')
|
|
474
|
+
.action(async (address, depositor) => {
|
|
475
|
+
const contract = getDashboardContract(address);
|
|
476
|
+
const vault = await callReadMethod(contract, 'stakingVault');
|
|
477
|
+
const confirm = await confirmOperation(`Are you sure you want to set the depositor of the staking vault ${vault} to ${depositor}?`);
|
|
478
|
+
if (!confirm)
|
|
479
|
+
return;
|
|
480
|
+
await callWriteMethodWithReceipt({
|
|
481
|
+
contract,
|
|
482
|
+
methodName: 'setDepositor',
|
|
483
|
+
payload: [depositor],
|
|
484
|
+
});
|
|
485
|
+
});
|
|
486
|
+
dashboardWrite
|
|
487
|
+
.command('reset-locked')
|
|
488
|
+
.description('Zeroes the locked amount of the staking vault.')
|
|
489
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
490
|
+
.action(async (address) => {
|
|
491
|
+
const contract = getDashboardContract(address);
|
|
492
|
+
const vault = await callReadMethod(contract, 'stakingVault');
|
|
493
|
+
const confirm = await confirmOperation(`Are you sure you want to reset the locked amount of the staking vault ${vault}?`);
|
|
494
|
+
if (!confirm)
|
|
495
|
+
return;
|
|
496
|
+
await callWriteMethodWithReceipt({
|
|
497
|
+
contract,
|
|
498
|
+
methodName: 'resetLocked',
|
|
499
|
+
payload: [],
|
|
500
|
+
});
|
|
501
|
+
});
|
|
502
|
+
dashboardWrite
|
|
503
|
+
.command('request-tier-change')
|
|
504
|
+
.description('Requests a change of tier on the OperatorGrid.')
|
|
505
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
506
|
+
.argument('<tier>', 'tier to change to', stringToBigInt)
|
|
507
|
+
.action(async (address, tier) => {
|
|
508
|
+
const contract = getDashboardContract(address);
|
|
509
|
+
const vault = await callReadMethod(contract, 'stakingVault');
|
|
510
|
+
const confirm = await confirmOperation(`Are you sure you want to request a change of tier on the OperatorGrid for the staking vault ${vault} to ${tier}?`);
|
|
511
|
+
if (!confirm)
|
|
512
|
+
return;
|
|
513
|
+
await callWriteMethodWithReceipt({
|
|
514
|
+
contract,
|
|
515
|
+
methodName: 'requestTierChange',
|
|
516
|
+
payload: [tier],
|
|
517
|
+
});
|
|
518
|
+
});
|
|
519
|
+
dashboardWrite
|
|
520
|
+
.command('increase-accrued-rewards-adjustment')
|
|
521
|
+
.description('Increases the accrued rewards adjustment.')
|
|
522
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
523
|
+
.argument('<amount>', 'amount to increase the accrued rewards adjustment by (in ETH)')
|
|
524
|
+
.action(async (address, amount) => {
|
|
525
|
+
const contract = getDashboardContract(address);
|
|
526
|
+
const confirm = await confirmOperation(`Are you sure you want to increase the accrued rewards adjustment by ${amount} ETH?`);
|
|
527
|
+
if (!confirm)
|
|
528
|
+
return;
|
|
529
|
+
await callWriteMethodWithReceipt({
|
|
530
|
+
contract,
|
|
531
|
+
methodName: 'increaseAccruedRewardsAdjustment',
|
|
532
|
+
payload: [parseEther(amount)],
|
|
533
|
+
});
|
|
534
|
+
});
|
|
535
|
+
dashboardWrite
|
|
536
|
+
.command('set-accrued-rewards-adjustment')
|
|
537
|
+
.description('Sets the accrued rewards adjustment.')
|
|
538
|
+
.argument('<address>', 'dashboard address', stringToAddress)
|
|
539
|
+
.argument('<amount>', 'amount to set the accrued rewards adjustment to (in ETH)')
|
|
540
|
+
.action(async (address, amount) => {
|
|
541
|
+
const contract = getDashboardContract(address);
|
|
542
|
+
const currentAdjustment = await callReadMethod(contract, 'accruedRewardsAdjustment');
|
|
543
|
+
const confirm = await confirmOperation(`Are you sure you want to set the accrued rewards adjustment to ${amount}?
|
|
544
|
+
Current adjustment: ${formatEther(currentAdjustment)} ETH`);
|
|
545
|
+
if (!confirm)
|
|
546
|
+
return;
|
|
547
|
+
await callWriteMethodWithReceipt({
|
|
548
|
+
contract,
|
|
549
|
+
methodName: 'setAccruedRewardsAdjustment',
|
|
550
|
+
payload: [parseEther(amount), currentAdjustment],
|
|
551
|
+
});
|
|
552
|
+
});
|
|
553
|
+
//# sourceMappingURL=write.js.map
|