@lidofinance/lsv-cli 1.0.0-alpha.10 → 1.0.0-alpha.11
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/dist/abi/Dashboard.js +1 -4
- package/dist/abi/Dashboard.js.map +1 -1
- package/dist/abi/Delegation.js +1 -4
- package/dist/abi/Delegation.js.map +1 -1
- package/dist/abi/LidoLocator.js +1 -4
- package/dist/abi/LidoLocator.js.map +1 -1
- package/dist/abi/StEth.js +1 -4
- package/dist/abi/StEth.js.map +1 -1
- package/dist/abi/StakingVault.js +1 -4
- package/dist/abi/StakingVault.js.map +1 -1
- package/dist/abi/TokenManager.js +1 -4
- package/dist/abi/TokenManager.js.map +1 -1
- package/dist/abi/VaultFactory.js +1 -4
- package/dist/abi/VaultFactory.js.map +1 -1
- package/dist/abi/VaultHub.js +1 -4
- package/dist/abi/VaultHub.js.map +1 -1
- package/dist/abi/Voting.js +1 -4
- package/dist/abi/Voting.js.map +1 -1
- package/dist/abi/index.js +9 -25
- package/dist/abi/index.js.map +1 -1
- package/dist/command/index.js +5 -8
- package/dist/command/index.js.map +1 -1
- package/dist/configs/constants.js +2 -5
- package/dist/configs/constants.js.map +1 -1
- package/dist/configs/deployed.js +63 -96
- package/dist/configs/deployed.js.map +1 -1
- package/dist/configs/envs.js +9 -45
- package/dist/configs/envs.js.map +1 -1
- package/dist/configs/index.js +3 -19
- package/dist/configs/index.js.map +1 -1
- package/dist/configs/utils.js +10 -16
- package/dist/configs/utils.js.map +1 -1
- package/dist/contracts/dashboard.js +7 -11
- package/dist/contracts/dashboard.js.map +1 -1
- package/dist/contracts/delegation.js +7 -11
- package/dist/contracts/delegation.js.map +1 -1
- package/dist/contracts/index.js +9 -25
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/locator.js +11 -15
- package/dist/contracts/locator.js.map +1 -1
- package/dist/contracts/steth.js +11 -15
- package/dist/contracts/steth.js.map +1 -1
- package/dist/contracts/token-manager.js +11 -15
- package/dist/contracts/token-manager.js.map +1 -1
- package/dist/contracts/vault-factory.js +11 -15
- package/dist/contracts/vault-factory.js.map +1 -1
- package/dist/contracts/vault-hub.js +12 -16
- package/dist/contracts/vault-hub.js.map +1 -1
- package/dist/contracts/vault.js +9 -13
- package/dist/contracts/vault.js.map +1 -1
- package/dist/contracts/voting.js +11 -15
- package/dist/contracts/voting.js.map +1 -1
- package/dist/features/advanced-config.js +7 -12
- package/dist/features/advanced-config.js.map +1 -1
- package/dist/features/dashboard-delegation.js +3 -7
- package/dist/features/dashboard-delegation.js.map +1 -1
- package/dist/features/index.js +4 -20
- package/dist/features/index.js.map +1 -1
- package/dist/features/token-manager.js +5 -4
- package/dist/features/token-manager.js.map +1 -1
- package/dist/features/vault-factory.js +15 -22
- package/dist/features/vault-factory.js.map +1 -1
- package/dist/features/voting.js +49 -52
- package/dist/features/voting.js.map +1 -1
- package/dist/index.js +3 -5
- package/dist/index.js.map +1 -1
- package/dist/programs/config.js +12 -14
- package/dist/programs/config.js.map +1 -1
- package/dist/programs/dashboard.js +218 -220
- package/dist/programs/dashboard.js.map +1 -1
- package/dist/programs/delegation.js +319 -343
- package/dist/programs/delegation.js.map +1 -1
- package/dist/programs/index.js +6 -22
- package/dist/programs/index.js.map +1 -1
- package/dist/programs/vault-factory.js +41 -38
- package/dist/programs/vault-factory.js.map +1 -1
- package/dist/programs/vault-hub.js +130 -126
- package/dist/programs/vault-hub.js.map +1 -1
- package/dist/programs/vault.js +141 -136
- package/dist/programs/vault.js.map +1 -1
- package/dist/programs/voting.js +32 -30
- package/dist/programs/voting.js.map +1 -1
- package/dist/providers/index.js +1 -17
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/wallet.js +18 -24
- package/dist/providers/wallet.js.map +1 -1
- package/dist/types/common.js +1 -2
- package/dist/types/config.js +1 -2
- package/dist/types/index.js +2 -18
- package/dist/types/index.js.map +1 -1
- package/dist/utils/call-contract.js +9 -14
- package/dist/utils/call-contract.js.map +1 -1
- package/dist/utils/data-validators.js +12 -15
- package/dist/utils/data-validators.js.map +1 -1
- package/dist/utils/error-handler.js +3 -7
- package/dist/utils/error-handler.js.map +1 -1
- package/dist/utils/get-value.js +5 -11
- package/dist/utils/get-value.js.map +1 -1
- package/dist/utils/index.js +6 -22
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/resolve-path.js +9 -12
- package/dist/utils/resolve-path.js.map +1 -1
- package/dist/utils/sleep.js +1 -5
- package/dist/utils/sleep.js.map +1 -1
- package/package.json +38 -3
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
.
|
|
10
|
-
delegation
|
|
11
|
-
.
|
|
12
|
-
.description("get delegation contract roles info")
|
|
13
|
-
.argument("<address>", "delegation contract address")
|
|
1
|
+
import { program } from '../command/index.js';
|
|
2
|
+
import { getDelegationContract, getStakingVaultContract } from '../contracts/index.js';
|
|
3
|
+
import { callWriteMethod, callReadMethod } from '../utils/index.js';
|
|
4
|
+
import { getBaseInfo } from '../features/index.js';
|
|
5
|
+
const delegation = program
|
|
6
|
+
.command('delegation')
|
|
7
|
+
.description('delegation contract');
|
|
8
|
+
delegation
|
|
9
|
+
.command('roles')
|
|
10
|
+
.description('get delegation contract roles info')
|
|
11
|
+
.argument('<address>', 'delegation contract address')
|
|
14
12
|
.action(async (address) => {
|
|
15
|
-
const contract =
|
|
13
|
+
const contract = getDelegationContract(address);
|
|
16
14
|
try {
|
|
17
15
|
const CURATOR_ROLE = await contract.read.CURATOR_ROLE();
|
|
18
16
|
const NODE_OPERATOR_MANAGER_ROLE = await contract.read.NODE_OPERATOR_MANAGER_ROLE();
|
|
@@ -44,86 +42,86 @@ delegation
|
|
|
44
42
|
}
|
|
45
43
|
catch (err) {
|
|
46
44
|
if (err instanceof Error) {
|
|
47
|
-
console.
|
|
45
|
+
console.info('Error when getting roles:\n', err.message);
|
|
48
46
|
}
|
|
49
47
|
}
|
|
50
48
|
});
|
|
51
49
|
delegation
|
|
52
|
-
.command(
|
|
53
|
-
.description(
|
|
54
|
-
.argument(
|
|
50
|
+
.command('base-info')
|
|
51
|
+
.description('get delegation base info')
|
|
52
|
+
.argument('<address>', 'delegation address')
|
|
55
53
|
.action(async (address) => {
|
|
56
|
-
const contract =
|
|
57
|
-
await
|
|
54
|
+
const contract = getDelegationContract(address);
|
|
55
|
+
await getBaseInfo(contract);
|
|
58
56
|
});
|
|
59
57
|
delegation
|
|
60
|
-
.command(
|
|
58
|
+
.command('voting-lifetime')
|
|
61
59
|
.description("get committee's voting lifetime period")
|
|
62
|
-
.argument(
|
|
60
|
+
.argument('<address>', 'delegation contract address')
|
|
63
61
|
.action(async (address) => {
|
|
64
|
-
const contract =
|
|
65
|
-
await
|
|
62
|
+
const contract = getDelegationContract(address);
|
|
63
|
+
await callReadMethod(contract, 'voteLifetime');
|
|
66
64
|
});
|
|
67
65
|
delegation
|
|
68
|
-
.command(
|
|
69
|
-
.description(
|
|
70
|
-
.argument(
|
|
66
|
+
.command('is-healthy')
|
|
67
|
+
.description('get vault healthy info')
|
|
68
|
+
.argument('<address>', 'vault address')
|
|
71
69
|
.action(async (address) => {
|
|
72
|
-
const contract =
|
|
70
|
+
const contract = getDelegationContract(address);
|
|
73
71
|
try {
|
|
74
72
|
const valuation = await contract.read.valuation();
|
|
75
73
|
const curatorUnclaimedFee = await contract.read.curatorUnclaimedFee();
|
|
76
74
|
const nodeOperatorUnclaimedFee = await contract.read.nodeOperatorUnclaimedFee();
|
|
77
75
|
const minted = await contract.read.sharesMinted();
|
|
78
76
|
const { vault } = await contract.read.vaultSocket();
|
|
79
|
-
const vaultContract =
|
|
77
|
+
const vaultContract = getStakingVaultContract(vault);
|
|
80
78
|
const locked = await vaultContract.read.locked();
|
|
81
79
|
const reserved = locked + curatorUnclaimedFee + nodeOperatorUnclaimedFee;
|
|
82
80
|
const valuationPerc = (valuation / (reserved + minted)) * 100n;
|
|
83
81
|
const isHealthy = valuationPerc >= 100n;
|
|
84
82
|
console.table({
|
|
85
|
-
|
|
83
|
+
'Vault Healthy': isHealthy,
|
|
86
84
|
Valuation: valuation,
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
'Curator Unclaimed Fee': curatorUnclaimedFee,
|
|
86
|
+
'Node Operator Unclaimed Fee': nodeOperatorUnclaimedFee,
|
|
89
87
|
Minted: minted,
|
|
90
88
|
Reserved: reserved,
|
|
91
89
|
});
|
|
92
90
|
}
|
|
93
91
|
catch (err) {
|
|
94
92
|
if (err instanceof Error) {
|
|
95
|
-
console.
|
|
93
|
+
console.info('Error when getting info:\n', err.message);
|
|
96
94
|
}
|
|
97
95
|
}
|
|
98
96
|
});
|
|
99
97
|
delegation
|
|
100
|
-
.command(
|
|
101
|
-
.description(
|
|
102
|
-
.argument(
|
|
103
|
-
.argument(
|
|
104
|
-
.argument(
|
|
98
|
+
.command('voting-info')
|
|
99
|
+
.description('get committee votes')
|
|
100
|
+
.argument('<address>', 'delegation contract address')
|
|
101
|
+
.argument('<callId>', 'voting id')
|
|
102
|
+
.argument('<role>', 'role that voted')
|
|
105
103
|
.action(async (address, callId, role) => {
|
|
106
|
-
const contract =
|
|
107
|
-
await
|
|
104
|
+
const contract = getDelegationContract(address);
|
|
105
|
+
await callReadMethod(contract, 'votings', [callId, role]);
|
|
108
106
|
});
|
|
109
107
|
delegation
|
|
110
|
-
.command(
|
|
111
|
-
.description(
|
|
112
|
-
.argument(
|
|
108
|
+
.command('cf')
|
|
109
|
+
.description('Curator fee in basis points')
|
|
110
|
+
.argument('<address>', 'delegation contract address')
|
|
113
111
|
.action(async (address) => {
|
|
114
|
-
const contract =
|
|
115
|
-
await
|
|
112
|
+
const contract = getDelegationContract(address);
|
|
113
|
+
await callReadMethod(contract, 'curatorFeeBP');
|
|
116
114
|
});
|
|
117
115
|
delegation
|
|
118
|
-
.command(
|
|
119
|
-
.description(
|
|
120
|
-
.argument(
|
|
116
|
+
.command('cf-report')
|
|
117
|
+
.description('The last report for which curator fee was claimed. Updated on each claim.')
|
|
118
|
+
.argument('<address>', 'delegation contract address')
|
|
121
119
|
.action(async (address) => {
|
|
122
|
-
const contract =
|
|
123
|
-
await
|
|
120
|
+
const contract = getDelegationContract(address);
|
|
121
|
+
await callReadMethod(contract, 'curatorFeeClaimedReport');
|
|
124
122
|
});
|
|
125
123
|
delegation
|
|
126
|
-
.command(
|
|
124
|
+
.command('cf-unclaimed')
|
|
127
125
|
.description(`Returns the accumulated unclaimed curator fee in ether,
|
|
128
126
|
calculated as: U = (R * F) / T
|
|
129
127
|
where:
|
|
@@ -131,55 +129,55 @@ delegation
|
|
|
131
129
|
- R is the StakingVault rewards accrued since the last curator fee claim;
|
|
132
130
|
- F is curatorFeeBP
|
|
133
131
|
- T is the total basis points, 10,000.`)
|
|
134
|
-
.argument(
|
|
132
|
+
.argument('<address>', 'delegation contract address')
|
|
135
133
|
.action(async (address) => {
|
|
136
|
-
const contract =
|
|
137
|
-
await
|
|
134
|
+
const contract = getDelegationContract(address);
|
|
135
|
+
await callReadMethod(contract, 'curatorUnclaimedFee');
|
|
138
136
|
});
|
|
139
137
|
delegation
|
|
140
|
-
.command(
|
|
141
|
-
.description(
|
|
142
|
-
.argument(
|
|
143
|
-
.argument(
|
|
138
|
+
.command('cf-set')
|
|
139
|
+
.description('sets the curator fee')
|
|
140
|
+
.argument('<address>', 'delegation contract address')
|
|
141
|
+
.argument('<newCuratorFee>', 'curator fee in basis points')
|
|
144
142
|
.action(async (address, newCuratorFee) => {
|
|
145
|
-
const contract =
|
|
146
|
-
|
|
143
|
+
const contract = getDelegationContract(address);
|
|
144
|
+
await callWriteMethod(contract, 'setCuratorFeeBP', [BigInt(newCuratorFee)]);
|
|
147
145
|
});
|
|
148
146
|
delegation
|
|
149
|
-
.command(
|
|
150
|
-
.description(
|
|
151
|
-
.argument(
|
|
152
|
-
.argument(
|
|
147
|
+
.command('cf-claim')
|
|
148
|
+
.description('claims the curator fee')
|
|
149
|
+
.argument('<address>', 'delegation contract address')
|
|
150
|
+
.argument('<recipient>', 'address to which the curator fee will be sent')
|
|
153
151
|
.action(async (address, recipient) => {
|
|
154
|
-
const contract =
|
|
155
|
-
|
|
152
|
+
const contract = getDelegationContract(address);
|
|
153
|
+
await callWriteMethod(contract, 'claimCuratorFee', [recipient]);
|
|
156
154
|
});
|
|
157
155
|
delegation
|
|
158
|
-
.command(
|
|
159
|
-
.description(
|
|
160
|
-
.argument(
|
|
156
|
+
.command('nof')
|
|
157
|
+
.description('Node operator fee in basis points')
|
|
158
|
+
.argument('<address>', 'delegation contract address')
|
|
161
159
|
.action(async (address) => {
|
|
162
|
-
const contract =
|
|
160
|
+
const contract = getDelegationContract(address);
|
|
163
161
|
try {
|
|
164
162
|
const nodeOperatorFeeBP = await contract.read.nodeOperatorFeeBP();
|
|
165
|
-
console.table({
|
|
163
|
+
console.table({ 'Node Operator Fee BP:': nodeOperatorFeeBP });
|
|
166
164
|
}
|
|
167
165
|
catch (err) {
|
|
168
166
|
if (err instanceof Error) {
|
|
169
|
-
console.
|
|
167
|
+
console.info('Error when getting Node Operator Fee BP:\n', err.message);
|
|
170
168
|
}
|
|
171
169
|
}
|
|
172
170
|
});
|
|
173
171
|
delegation
|
|
174
|
-
.command(
|
|
175
|
-
.description(
|
|
176
|
-
.argument(
|
|
172
|
+
.command('nof-report')
|
|
173
|
+
.description('The last report for which node operator fee was claimed. Updated on each claim.')
|
|
174
|
+
.argument('<address>', 'delegation contract address')
|
|
177
175
|
.action(async (address) => {
|
|
178
|
-
const contract =
|
|
179
|
-
await
|
|
176
|
+
const contract = getDelegationContract(address);
|
|
177
|
+
await callReadMethod(contract, 'nodeOperatorFeeClaimedReport');
|
|
180
178
|
});
|
|
181
179
|
delegation
|
|
182
|
-
.command(
|
|
180
|
+
.command('nof-unclaimed')
|
|
183
181
|
.description(`Returns the accumulated unclaimed node operator fee in ether,
|
|
184
182
|
calculated as: U = (R * F) / T
|
|
185
183
|
where:
|
|
@@ -187,46 +185,46 @@ delegation
|
|
|
187
185
|
- R is the StakingVault rewards accrued since the last node operator fee claim;
|
|
188
186
|
- F is nodeOperatorFeeBP
|
|
189
187
|
- T is the total basis points, 10,000.`)
|
|
190
|
-
.argument(
|
|
188
|
+
.argument('<address>', 'delegation contract address')
|
|
191
189
|
.action(async (address) => {
|
|
192
|
-
const contract =
|
|
193
|
-
await
|
|
190
|
+
const contract = getDelegationContract(address);
|
|
191
|
+
await callReadMethod(contract, 'nodeOperatorUnclaimedFee');
|
|
194
192
|
});
|
|
195
193
|
delegation
|
|
196
|
-
.command(
|
|
197
|
-
.description(
|
|
198
|
-
.argument(
|
|
199
|
-
.argument(
|
|
194
|
+
.command('nof-set')
|
|
195
|
+
.description('sets the node operator fee')
|
|
196
|
+
.argument('<address>', 'delegation contract address')
|
|
197
|
+
.argument('<newNodeOperatorFeeBP>', 'The new node operator fee in basis points')
|
|
200
198
|
.action(async (address, newNodeOperatorFeeBP) => {
|
|
201
|
-
const contract =
|
|
202
|
-
|
|
199
|
+
const contract = getDelegationContract(address);
|
|
200
|
+
await callWriteMethod(contract, 'setNodeOperatorFeeBP', [
|
|
203
201
|
BigInt(newNodeOperatorFeeBP),
|
|
204
202
|
]);
|
|
205
203
|
});
|
|
206
204
|
delegation
|
|
207
|
-
.command(
|
|
208
|
-
.description(
|
|
209
|
-
.argument(
|
|
210
|
-
.argument(
|
|
205
|
+
.command('nof-claim')
|
|
206
|
+
.description('claims the node operator fee')
|
|
207
|
+
.argument('<address>', 'delegation contract address')
|
|
208
|
+
.argument('<recipient>', 'address to which the node operator fee will be sent')
|
|
211
209
|
.action(async (address, recipient) => {
|
|
212
|
-
const contract =
|
|
213
|
-
|
|
210
|
+
const contract = getDelegationContract(address);
|
|
211
|
+
await callWriteMethod(contract, 'claimNodeOperatorFee', [recipient]);
|
|
214
212
|
});
|
|
215
213
|
delegation
|
|
216
|
-
.command(
|
|
217
|
-
.description(
|
|
218
|
-
.argument(
|
|
214
|
+
.command('unreserved')
|
|
215
|
+
.description('returns the unreserved amount of ether')
|
|
216
|
+
.argument('<address>', 'delegation contract address')
|
|
219
217
|
.action(async (address) => {
|
|
220
|
-
const contract =
|
|
221
|
-
await
|
|
218
|
+
const contract = getDelegationContract(address);
|
|
219
|
+
await callReadMethod(contract, 'unreserved');
|
|
222
220
|
});
|
|
223
221
|
delegation
|
|
224
|
-
.command(
|
|
225
|
-
.description(
|
|
226
|
-
.argument(
|
|
222
|
+
.command('vc')
|
|
223
|
+
.description('returns the voting committee')
|
|
224
|
+
.argument('<address>', 'delegation contract address')
|
|
227
225
|
.action(async (address) => {
|
|
228
|
-
const contract =
|
|
229
|
-
const committeeList = await
|
|
226
|
+
const contract = getDelegationContract(address);
|
|
227
|
+
const committeeList = await callReadMethod(contract, 'votingCommittee');
|
|
230
228
|
const committee = {
|
|
231
229
|
CURATOR_ROLE: committeeList[0],
|
|
232
230
|
NODE_OPERATOR_MANAGER_ROLE: committeeList[1],
|
|
@@ -234,372 +232,350 @@ delegation
|
|
|
234
232
|
console.table({ committee });
|
|
235
233
|
});
|
|
236
234
|
delegation
|
|
237
|
-
.command(
|
|
238
|
-
.description(
|
|
239
|
-
.argument(
|
|
240
|
-
.argument(
|
|
235
|
+
.command('fund')
|
|
236
|
+
.description('funds the StakingVault with ether')
|
|
237
|
+
.argument('<address>', 'delegation contract address')
|
|
238
|
+
.argument('<ether>', 'ether to fund')
|
|
241
239
|
.action(async (address, ether) => {
|
|
242
|
-
const contract =
|
|
243
|
-
await
|
|
240
|
+
const contract = getDelegationContract(address);
|
|
241
|
+
await callWriteMethod(contract, 'fund', [], BigInt(ether));
|
|
244
242
|
});
|
|
245
243
|
delegation
|
|
246
|
-
.command(
|
|
247
|
-
.description(
|
|
248
|
-
.argument(
|
|
249
|
-
.argument(
|
|
250
|
-
.argument(
|
|
244
|
+
.command('withdraw')
|
|
245
|
+
.description('withdraws ether from the StakingVault')
|
|
246
|
+
.argument('<address>', 'delegation contract address')
|
|
247
|
+
.argument('<recipient>', 'address to which the ether will be sent')
|
|
248
|
+
.argument('<ether>', 'ether to found')
|
|
251
249
|
.action(async (address, recipient, ether) => {
|
|
252
|
-
const contract =
|
|
253
|
-
await
|
|
250
|
+
const contract = getDelegationContract(address);
|
|
251
|
+
await callWriteMethod(contract, 'withdraw', [recipient, BigInt(ether)]);
|
|
254
252
|
});
|
|
255
253
|
delegation
|
|
256
|
-
.command(
|
|
257
|
-
.description(
|
|
258
|
-
.argument(
|
|
259
|
-
.argument(
|
|
260
|
-
.argument("<amountOfShares>", "amount of shares to mint")
|
|
261
|
-
.action(async (address, recipient, amountOfShares) => {
|
|
262
|
-
const contract = (0, _contracts_1.getDelegationContract)(address);
|
|
263
|
-
(0, _utils_1.callWriteMethod)(contract, "mintShares", [
|
|
264
|
-
recipient,
|
|
265
|
-
BigInt(amountOfShares),
|
|
266
|
-
]);
|
|
267
|
-
});
|
|
268
|
-
delegation
|
|
269
|
-
.command("burn")
|
|
270
|
-
.description("burns shares for a given recipient")
|
|
271
|
-
.argument("<address>", "delegation contract address")
|
|
272
|
-
.argument("<amountOfShares>", "amount of shares to mint")
|
|
273
|
-
.action(async (address, amountOfShares) => {
|
|
274
|
-
const contract = (0, _contracts_1.getDelegationContract)(address);
|
|
275
|
-
(0, _utils_1.callWriteMethod)(contract, "burnShares", [BigInt(amountOfShares)]);
|
|
276
|
-
});
|
|
277
|
-
delegation
|
|
278
|
-
.command("rebalance")
|
|
279
|
-
.description("rebalances the StakingVault with a given amount of ether")
|
|
280
|
-
.argument("<address>", "delegation contract address")
|
|
281
|
-
.argument("<ether>", "amount of ether to rebalance with")
|
|
254
|
+
.command('rebalance')
|
|
255
|
+
.description('rebalances the StakingVault with a given amount of ether')
|
|
256
|
+
.argument('<address>', 'delegation contract address')
|
|
257
|
+
.argument('<ether>', 'amount of ether to rebalance with')
|
|
282
258
|
.action(async (address, ether) => {
|
|
283
|
-
const contract =
|
|
284
|
-
await
|
|
259
|
+
const contract = getDelegationContract(address);
|
|
260
|
+
await callWriteMethod(contract, 'rebalanceVault', [BigInt(ether)]);
|
|
285
261
|
});
|
|
286
262
|
delegation
|
|
287
|
-
.command(
|
|
288
|
-
.description(
|
|
289
|
-
.argument(
|
|
290
|
-
.argument(
|
|
263
|
+
.command('set-vote-lt')
|
|
264
|
+
.description('sets the vote lifetime')
|
|
265
|
+
.argument('<address>', 'delegation contract address')
|
|
266
|
+
.argument('<newVoteLifetime>', 'new vote lifetime in seconds')
|
|
291
267
|
.action(async (address, newVoteLifetime) => {
|
|
292
|
-
const contract =
|
|
293
|
-
|
|
268
|
+
const contract = getDelegationContract(address);
|
|
269
|
+
await callWriteMethod(contract, 'setVoteLifetime', [
|
|
270
|
+
BigInt(newVoteLifetime),
|
|
271
|
+
]);
|
|
294
272
|
});
|
|
273
|
+
// TODO: test without voting
|
|
295
274
|
delegation
|
|
296
|
-
.command(
|
|
297
|
-
.description(
|
|
298
|
-
.argument(
|
|
299
|
-
.argument(
|
|
275
|
+
.command('t-ownership')
|
|
276
|
+
.description('transfers the ownership of the StakingVault')
|
|
277
|
+
.argument('<address>', 'delegation contract address')
|
|
278
|
+
.argument('<newOwner>', 'address to which the ownership will be transferred')
|
|
300
279
|
.action(async (address, newOwner) => {
|
|
301
|
-
const contract =
|
|
302
|
-
await
|
|
280
|
+
const contract = getDelegationContract(address);
|
|
281
|
+
await callWriteMethod(contract, 'transferStakingVaultOwnership', [
|
|
303
282
|
newOwner,
|
|
304
283
|
]);
|
|
305
284
|
});
|
|
306
285
|
delegation
|
|
307
|
-
.command(
|
|
308
|
-
.description(
|
|
309
|
-
.argument(
|
|
286
|
+
.command('disconnect')
|
|
287
|
+
.description('voluntarily disconnects a StakingVault from VaultHub')
|
|
288
|
+
.argument('<address>', 'delegation contract address')
|
|
310
289
|
.action(async (address) => {
|
|
311
|
-
const contract =
|
|
312
|
-
|
|
290
|
+
const contract = getDelegationContract(address);
|
|
291
|
+
await callWriteMethod(contract, 'voluntaryDisconnect', []);
|
|
313
292
|
});
|
|
314
293
|
delegation
|
|
315
|
-
.command(
|
|
316
|
-
.description(
|
|
317
|
-
.argument(
|
|
294
|
+
.command('deposit-pause')
|
|
295
|
+
.description('Pauses deposits to beacon chain from the StakingVault.')
|
|
296
|
+
.argument('<address>', 'delegation contract address')
|
|
318
297
|
.action(async (address) => {
|
|
319
|
-
const contract =
|
|
320
|
-
await
|
|
298
|
+
const contract = getDelegationContract(address);
|
|
299
|
+
await callWriteMethod(contract, 'pauseBeaconChainDeposits', []);
|
|
321
300
|
});
|
|
322
301
|
delegation
|
|
323
|
-
.command(
|
|
324
|
-
.description(
|
|
325
|
-
.argument(
|
|
302
|
+
.command('deposit-resume')
|
|
303
|
+
.description('Resumes deposits to beacon chain from the StakingVault.')
|
|
304
|
+
.argument('<address>', 'delegation contract address')
|
|
326
305
|
.action(async (address) => {
|
|
327
|
-
const contract =
|
|
328
|
-
await
|
|
306
|
+
const contract = getDelegationContract(address);
|
|
307
|
+
await callWriteMethod(contract, 'resumeBeaconChainDeposits', []);
|
|
329
308
|
});
|
|
330
309
|
delegation
|
|
331
|
-
.command(
|
|
332
|
-
.description(
|
|
333
|
-
.argument(
|
|
310
|
+
.command('vault')
|
|
311
|
+
.description('vault info')
|
|
312
|
+
.argument('<address>', 'delegation address')
|
|
334
313
|
.action(async (address) => {
|
|
335
|
-
const contract =
|
|
336
|
-
await
|
|
314
|
+
const contract = getDelegationContract(address);
|
|
315
|
+
await callReadMethod(contract, 'vaultSocket');
|
|
337
316
|
});
|
|
338
317
|
delegation
|
|
339
|
-
.command(
|
|
340
|
-
.description(
|
|
341
|
-
.argument(
|
|
318
|
+
.command('s-limit')
|
|
319
|
+
.description('shares limit')
|
|
320
|
+
.argument('<address>', 'delegation address')
|
|
342
321
|
.action(async (address) => {
|
|
343
|
-
const contract =
|
|
344
|
-
await
|
|
322
|
+
const contract = getDelegationContract(address);
|
|
323
|
+
await callReadMethod(contract, 'shareLimit');
|
|
345
324
|
});
|
|
346
325
|
delegation
|
|
347
|
-
.command(
|
|
348
|
-
.description(
|
|
349
|
-
.argument(
|
|
326
|
+
.command('s-minted')
|
|
327
|
+
.description('shares minted')
|
|
328
|
+
.argument('<address>', 'delegation address')
|
|
350
329
|
.action(async (address) => {
|
|
351
|
-
const contract =
|
|
352
|
-
await
|
|
330
|
+
const contract = getDelegationContract(address);
|
|
331
|
+
await callReadMethod(contract, 'sharesMinted');
|
|
353
332
|
});
|
|
354
333
|
delegation
|
|
355
|
-
.command(
|
|
356
|
-
.description(
|
|
357
|
-
.argument(
|
|
334
|
+
.command('reserve-ratio')
|
|
335
|
+
.description('vault reserve ratio of the vault')
|
|
336
|
+
.argument('<address>', 'delegation address')
|
|
358
337
|
.action(async (address) => {
|
|
359
|
-
const contract =
|
|
360
|
-
await
|
|
338
|
+
const contract = getDelegationContract(address);
|
|
339
|
+
await callReadMethod(contract, 'reserveRatioBP');
|
|
361
340
|
});
|
|
362
341
|
delegation
|
|
363
|
-
.command(
|
|
364
|
-
.description(
|
|
365
|
-
.argument(
|
|
342
|
+
.command('t-reserve-ratio')
|
|
343
|
+
.description('threshold reserve ratio of the vault')
|
|
344
|
+
.argument('<address>', 'delegation address')
|
|
366
345
|
.action(async (address) => {
|
|
367
|
-
const contract =
|
|
368
|
-
await
|
|
346
|
+
const contract = getDelegationContract(address);
|
|
347
|
+
await callReadMethod(contract, 'thresholdReserveRatioBP');
|
|
369
348
|
});
|
|
370
349
|
delegation
|
|
371
|
-
.command(
|
|
372
|
-
.description(
|
|
373
|
-
.argument(
|
|
350
|
+
.command('t-fee')
|
|
351
|
+
.description('treasury fee basis points')
|
|
352
|
+
.argument('<address>', 'delegation address')
|
|
374
353
|
.action(async (address) => {
|
|
375
|
-
const contract =
|
|
376
|
-
await
|
|
354
|
+
const contract = getDelegationContract(address);
|
|
355
|
+
await callReadMethod(contract, 'treasuryFee');
|
|
377
356
|
});
|
|
378
357
|
delegation
|
|
379
|
-
.command(
|
|
380
|
-
.description(
|
|
381
|
-
.argument(
|
|
358
|
+
.command('valuation')
|
|
359
|
+
.description('valuation of the vault in ether')
|
|
360
|
+
.argument('<address>', 'delegation address')
|
|
382
361
|
.action(async (address) => {
|
|
383
|
-
const contract =
|
|
384
|
-
await
|
|
362
|
+
const contract = getDelegationContract(address);
|
|
363
|
+
await callReadMethod(contract, 'valuation');
|
|
385
364
|
});
|
|
386
365
|
delegation
|
|
387
|
-
.command(
|
|
388
|
-
.description(
|
|
389
|
-
.argument(
|
|
366
|
+
.command('t-shares')
|
|
367
|
+
.description('total of shares that can be minted on the vault')
|
|
368
|
+
.argument('<address>', 'delegation address')
|
|
390
369
|
.action(async (address) => {
|
|
391
|
-
const contract =
|
|
392
|
-
await
|
|
370
|
+
const contract = getDelegationContract(address);
|
|
371
|
+
await callReadMethod(contract, 'totalMintableShares');
|
|
393
372
|
});
|
|
394
373
|
delegation
|
|
395
|
-
.command(
|
|
396
|
-
.description(
|
|
397
|
-
.argument(
|
|
398
|
-
.argument(
|
|
374
|
+
.command('get-shares')
|
|
375
|
+
.description('maximum number of shares that can be minted with deposited ether')
|
|
376
|
+
.argument('<address>', 'delegation address')
|
|
377
|
+
.argument('<ether>', 'amount of ether to be funded')
|
|
399
378
|
.action(async (address, ether) => {
|
|
400
|
-
const contract =
|
|
401
|
-
await
|
|
379
|
+
const contract = getDelegationContract(address);
|
|
380
|
+
await callReadMethod(contract, 'projectedNewMintableShares', [
|
|
402
381
|
BigInt(ether),
|
|
403
382
|
]);
|
|
404
383
|
});
|
|
405
384
|
delegation
|
|
406
|
-
.command(
|
|
407
|
-
.description(
|
|
408
|
-
.argument(
|
|
385
|
+
.command('withdrawable-eth')
|
|
386
|
+
.description('amount of ether that can be withdrawn from the staking vault')
|
|
387
|
+
.argument('<address>', 'delegation address')
|
|
409
388
|
.action(async (address) => {
|
|
410
|
-
const contract =
|
|
411
|
-
await
|
|
412
|
-
});
|
|
413
|
-
// TODO: test without voting
|
|
414
|
-
delegation
|
|
415
|
-
.command("ownership")
|
|
416
|
-
.description("transfers ownership of the staking vault to a new owner")
|
|
417
|
-
.argument("<address>", "delegation address")
|
|
418
|
-
.argument("<newOwner>", "address of the new owner")
|
|
419
|
-
.action(async (address, newOwner) => {
|
|
420
|
-
const contract = (0, _contracts_1.getDelegationContract)(address);
|
|
421
|
-
await (0, _utils_1.callWriteMethod)(contract, "transferStakingVaultOwnership", [
|
|
422
|
-
newOwner,
|
|
423
|
-
]);
|
|
389
|
+
const contract = getDelegationContract(address);
|
|
390
|
+
await callReadMethod(contract, 'withdrawableEther');
|
|
424
391
|
});
|
|
425
392
|
delegation
|
|
426
|
-
.command(
|
|
427
|
-
.description(
|
|
428
|
-
.argument(
|
|
429
|
-
.argument(
|
|
393
|
+
.command('fund-weth')
|
|
394
|
+
.description('funds the staking vault with wrapped ether')
|
|
395
|
+
.argument('<address>', 'delegation address')
|
|
396
|
+
.argument('<wethAmount>', 'amount of weth to be funded')
|
|
430
397
|
.action(async (address, wethAmount) => {
|
|
431
|
-
const contract =
|
|
432
|
-
await
|
|
398
|
+
const contract = getDelegationContract(address);
|
|
399
|
+
await callWriteMethod(contract, 'fundWeth', [BigInt(wethAmount)]);
|
|
433
400
|
});
|
|
434
401
|
delegation
|
|
435
|
-
.command(
|
|
436
|
-
.description(
|
|
437
|
-
.argument(
|
|
438
|
-
.argument(
|
|
439
|
-
.argument(
|
|
402
|
+
.command('withdraw-weth')
|
|
403
|
+
.description('withdraws stETH tokens from the staking vault to wrapped ether')
|
|
404
|
+
.argument('<address>', 'delegation address')
|
|
405
|
+
.argument('<recipient>', 'address of the recipient')
|
|
406
|
+
.argument('<ether>', 'amount of ether to withdraw')
|
|
440
407
|
.action(async (address, recipient, ether) => {
|
|
441
|
-
const contract =
|
|
442
|
-
await
|
|
408
|
+
const contract = getDelegationContract(address);
|
|
409
|
+
await callWriteMethod(contract, 'withdrawWETH', [recipient, BigInt(ether)]);
|
|
443
410
|
});
|
|
444
411
|
delegation
|
|
445
|
-
.command(
|
|
446
|
-
.description(
|
|
447
|
-
.argument(
|
|
448
|
-
.argument(
|
|
412
|
+
.command('exit')
|
|
413
|
+
.description('requests the exit of a validator from the staking vault')
|
|
414
|
+
.argument('<address>', 'delegation address')
|
|
415
|
+
.argument('<validatorPubKey>', 'public key of the validator to exit')
|
|
449
416
|
.action(async (address, validatorPubKey) => {
|
|
450
|
-
const contract =
|
|
451
|
-
await
|
|
417
|
+
const contract = getDelegationContract(address);
|
|
418
|
+
await callWriteMethod(contract, 'requestValidatorExit', [validatorPubKey]);
|
|
452
419
|
});
|
|
453
420
|
delegation
|
|
454
|
-
.command(
|
|
455
|
-
.description(
|
|
456
|
-
.argument(
|
|
457
|
-
.argument(
|
|
458
|
-
.argument(
|
|
421
|
+
.command('mint-shares')
|
|
422
|
+
.description('mints stETH tokens backed by the vault to a recipient')
|
|
423
|
+
.argument('<address>', 'delegation address')
|
|
424
|
+
.argument('<recipient>', 'address of the recipient')
|
|
425
|
+
.argument('<amountOfShares>', 'amount of shares to mint')
|
|
459
426
|
.action(async (address, recipient, amountOfShares) => {
|
|
460
|
-
const contract =
|
|
461
|
-
await
|
|
427
|
+
const contract = getDelegationContract(address);
|
|
428
|
+
await callWriteMethod(contract, 'mintShares', [
|
|
462
429
|
recipient,
|
|
463
430
|
BigInt(amountOfShares),
|
|
464
431
|
]);
|
|
465
432
|
});
|
|
466
433
|
delegation
|
|
467
|
-
.command(
|
|
468
|
-
.description(
|
|
469
|
-
.argument(
|
|
470
|
-
.argument(
|
|
471
|
-
.argument(
|
|
434
|
+
.command('mint-steth')
|
|
435
|
+
.description('mints stETH tokens backed by the vault to a recipient')
|
|
436
|
+
.argument('<address>', 'delegation address')
|
|
437
|
+
.argument('<recipient>', 'address of the recipient')
|
|
438
|
+
.argument('<amountOfShares>', 'amount of shares to mint')
|
|
472
439
|
.action(async (address, recipient, amountOfShares) => {
|
|
473
|
-
const contract =
|
|
474
|
-
await
|
|
440
|
+
const contract = getDelegationContract(address);
|
|
441
|
+
await callWriteMethod(contract, 'mintStETH', [
|
|
475
442
|
recipient,
|
|
476
443
|
BigInt(amountOfShares),
|
|
477
444
|
]);
|
|
478
445
|
});
|
|
479
446
|
delegation
|
|
480
|
-
.command(
|
|
481
|
-
.description(
|
|
482
|
-
.argument(
|
|
483
|
-
.argument(
|
|
484
|
-
.argument(
|
|
447
|
+
.command('mint-wsteth')
|
|
448
|
+
.description('mints wstETH tokens backed by the vault to a recipient')
|
|
449
|
+
.argument('<address>', 'delegation address')
|
|
450
|
+
.argument('<recipient>', 'address of the recipient')
|
|
451
|
+
.argument('<tokens>', 'amount of tokens to mint')
|
|
485
452
|
.action(async (address, recipient, tokens) => {
|
|
486
|
-
const contract =
|
|
487
|
-
await
|
|
453
|
+
const contract = getDelegationContract(address);
|
|
454
|
+
await callWriteMethod(contract, 'mintWstETH', [recipient, BigInt(tokens)]);
|
|
488
455
|
});
|
|
489
456
|
delegation
|
|
490
|
-
.command(
|
|
491
|
-
.description(
|
|
492
|
-
.argument(
|
|
493
|
-
.argument(
|
|
457
|
+
.command('burn-shares')
|
|
458
|
+
.description('Burns stETH shares from the sender backed by the vault. Expects corresponding amount of stETH approved to this contract')
|
|
459
|
+
.argument('<address>', 'delegation address')
|
|
460
|
+
.argument('<amountOfShares>', 'amount of shares to burn')
|
|
494
461
|
.action(async (address, amountOfShares) => {
|
|
495
|
-
const contract =
|
|
496
|
-
|
|
462
|
+
const contract = getDelegationContract(address);
|
|
463
|
+
await callWriteMethod(contract, 'burnShares', [BigInt(amountOfShares)]);
|
|
497
464
|
});
|
|
498
465
|
delegation
|
|
499
|
-
.command(
|
|
500
|
-
.description(
|
|
501
|
-
.argument(
|
|
502
|
-
.argument(
|
|
466
|
+
.command('burn-steth')
|
|
467
|
+
.description('Burns stETH shares from the sender backed by the vault. Expects stETH amount approved to this contract.')
|
|
468
|
+
.argument('<address>', 'delegation address')
|
|
469
|
+
.argument('<amountOfShares>', 'amount of shares to burn')
|
|
503
470
|
.action(async (address, amountOfShares) => {
|
|
504
|
-
const contract =
|
|
505
|
-
|
|
471
|
+
const contract = getDelegationContract(address);
|
|
472
|
+
await callWriteMethod(contract, 'burnStETH', [BigInt(amountOfShares)]);
|
|
506
473
|
});
|
|
507
474
|
delegation
|
|
508
|
-
.command(
|
|
509
|
-
.description(
|
|
510
|
-
.argument(
|
|
511
|
-
.argument(
|
|
475
|
+
.command('burn-wsteth')
|
|
476
|
+
.description('burn wstETH tokens from the sender backed by the vault')
|
|
477
|
+
.argument('<address>', 'delegation address')
|
|
478
|
+
.argument('<tokens>', 'amount of wstETH tokens to burn')
|
|
512
479
|
.action(async (address, tokens) => {
|
|
513
|
-
const contract =
|
|
514
|
-
|
|
480
|
+
const contract = getDelegationContract(address);
|
|
481
|
+
await callWriteMethod(contract, 'burnWstETH', [BigInt(tokens)]);
|
|
515
482
|
});
|
|
516
483
|
delegation
|
|
517
|
-
.command(
|
|
518
|
-
.description(
|
|
519
|
-
.argument(
|
|
520
|
-
.argument(
|
|
521
|
-
.argument(
|
|
484
|
+
.command('burn-shares-permit')
|
|
485
|
+
.description('Burns stETH tokens (in shares) backed by the vault from the sender using permit (with value in stETH).')
|
|
486
|
+
.argument('<address>', 'delegation address')
|
|
487
|
+
.argument('<tokens>', 'amount of stETH tokens to burn')
|
|
488
|
+
.argument('<permitJSON>', 'JSON data required for the stETH.permit() method to set the allowance')
|
|
522
489
|
.action(async (address, tokens, permitJSON) => {
|
|
523
490
|
const permit = JSON.parse(permitJSON);
|
|
524
|
-
const contract =
|
|
525
|
-
|
|
491
|
+
const contract = getDelegationContract(address);
|
|
492
|
+
await callWriteMethod(contract, 'burnSharesWithPermit', [
|
|
493
|
+
BigInt(tokens),
|
|
494
|
+
permit,
|
|
495
|
+
]);
|
|
526
496
|
});
|
|
527
497
|
delegation
|
|
528
|
-
.command(
|
|
529
|
-
.description(
|
|
530
|
-
.argument(
|
|
531
|
-
.argument(
|
|
532
|
-
.argument(
|
|
498
|
+
.command('burn-steth-permit')
|
|
499
|
+
.description('Burns stETH tokens backed by the vault from the sender using permit.')
|
|
500
|
+
.argument('<address>', 'delegation address')
|
|
501
|
+
.argument('<tokens>', 'amount of stETH tokens to burn')
|
|
502
|
+
.argument('<permitJSON>', 'JSON data required for the stETH.permit() method to set the allowance')
|
|
533
503
|
.action(async (address, tokens, permitJSON) => {
|
|
534
504
|
const permit = JSON.parse(permitJSON);
|
|
535
|
-
const contract =
|
|
536
|
-
|
|
505
|
+
const contract = getDelegationContract(address);
|
|
506
|
+
await callWriteMethod(contract, 'burnStETHWithPermit', [
|
|
507
|
+
BigInt(tokens),
|
|
508
|
+
permit,
|
|
509
|
+
]);
|
|
537
510
|
});
|
|
538
511
|
delegation
|
|
539
|
-
.command(
|
|
540
|
-
.description(
|
|
541
|
-
.argument(
|
|
542
|
-
.argument(
|
|
543
|
-
.argument(
|
|
512
|
+
.command('burn-wsteth-permit')
|
|
513
|
+
.description('burn wstETH tokens from the sender backed by the vault using EIP-2612 Permit')
|
|
514
|
+
.argument('<address>', 'delegation address')
|
|
515
|
+
.argument('<tokens>', 'amount of wstETH tokens to burn')
|
|
516
|
+
.argument('<permitJSON>', 'JSON data required for the wstETH.permit() method to set the allowance')
|
|
544
517
|
.action(async (address, tokens, permitJSON) => {
|
|
545
518
|
const permit = JSON.parse(permitJSON);
|
|
546
|
-
const contract =
|
|
547
|
-
|
|
519
|
+
const contract = getDelegationContract(address);
|
|
520
|
+
await callWriteMethod(contract, 'burnWstETHWithPermit', [
|
|
521
|
+
BigInt(tokens),
|
|
522
|
+
permit,
|
|
523
|
+
]);
|
|
548
524
|
});
|
|
549
525
|
delegation
|
|
550
|
-
.command(
|
|
551
|
-
.description(
|
|
552
|
-
.argument(
|
|
553
|
-
.argument(
|
|
554
|
-
.argument(
|
|
555
|
-
.argument(
|
|
526
|
+
.command('recover-erc20')
|
|
527
|
+
.description('recovers ERC20 tokens or ether from the delegation contract to sender')
|
|
528
|
+
.argument('<address>', 'delegation address')
|
|
529
|
+
.argument('<token>', 'Address of the token to recover or 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee for ether')
|
|
530
|
+
.argument('<recipient>', 'Address of the recovery recipient')
|
|
531
|
+
.argument('<amount>', 'amount of ether to recover')
|
|
556
532
|
.action(async (address, token, recipient, amount) => {
|
|
557
|
-
const contract =
|
|
558
|
-
|
|
533
|
+
const contract = getDelegationContract(address);
|
|
534
|
+
await callWriteMethod(contract, 'recoverERC20', [
|
|
559
535
|
token,
|
|
560
536
|
recipient,
|
|
561
537
|
BigInt(amount),
|
|
562
538
|
]);
|
|
563
539
|
});
|
|
564
540
|
delegation
|
|
565
|
-
.command(
|
|
566
|
-
.description(
|
|
567
|
-
.argument(
|
|
568
|
-
.argument(
|
|
569
|
-
.argument(
|
|
570
|
-
.argument(
|
|
541
|
+
.command('recover-erc721')
|
|
542
|
+
.description('Transfers a given token_id of an ERC721-compatible NFT (defined by the token contract address)')
|
|
543
|
+
.argument('<address>', 'delegation address')
|
|
544
|
+
.argument('<token>', 'an ERC721-compatible token')
|
|
545
|
+
.argument('<tokenId>', 'token id to recover')
|
|
546
|
+
.argument('<recipient>', 'Address of the recovery recipient')
|
|
571
547
|
.action(async (address, token, tokenId, recipient) => {
|
|
572
|
-
const contract =
|
|
573
|
-
await
|
|
548
|
+
const contract = getDelegationContract(address);
|
|
549
|
+
await callWriteMethod(contract, 'recoverERC721', [
|
|
574
550
|
token,
|
|
575
551
|
BigInt(tokenId),
|
|
576
552
|
recipient,
|
|
577
553
|
]);
|
|
578
554
|
});
|
|
579
555
|
delegation
|
|
580
|
-
.command(
|
|
581
|
-
.description(
|
|
582
|
-
.argument(
|
|
583
|
-
.argument(
|
|
556
|
+
.command('role-grant')
|
|
557
|
+
.description('Mass-revokes multiple roles from multiple accounts.')
|
|
558
|
+
.argument('<address>', 'delegation address')
|
|
559
|
+
.argument('<roleAssignmentJSON>', 'JSON array of role assignments')
|
|
584
560
|
.action(async (address, roleAssignmentJSON) => {
|
|
585
|
-
const contract =
|
|
561
|
+
const contract = getDelegationContract(address);
|
|
586
562
|
const payload = JSON.parse(roleAssignmentJSON);
|
|
587
563
|
if (!Array.isArray(payload)) {
|
|
588
|
-
throw new Error(
|
|
564
|
+
throw new Error('the 2nd argument should be an array of role assignments');
|
|
589
565
|
}
|
|
590
|
-
await
|
|
566
|
+
await callWriteMethod(contract, 'grantRoles', [payload]);
|
|
591
567
|
});
|
|
592
568
|
delegation
|
|
593
|
-
.command(
|
|
594
|
-
.description(
|
|
595
|
-
.argument(
|
|
596
|
-
.argument(
|
|
569
|
+
.command('role-revoke')
|
|
570
|
+
.description('Resumes beacon chain deposits on the staking vault.')
|
|
571
|
+
.argument('<address>', 'delegation address')
|
|
572
|
+
.argument('<roleAssignmentJSON>', 'JSON array of role assignments')
|
|
597
573
|
.action(async (address, roleAssignmentJSON) => {
|
|
598
|
-
const contract =
|
|
574
|
+
const contract = getDelegationContract(address);
|
|
599
575
|
const payload = JSON.parse(roleAssignmentJSON);
|
|
600
576
|
if (!Array.isArray(payload)) {
|
|
601
|
-
throw new Error(
|
|
577
|
+
throw new Error('the 2nd argument should be an array of role assignments');
|
|
602
578
|
}
|
|
603
|
-
await
|
|
579
|
+
await callWriteMethod(contract, 'revokeRoles', [payload]);
|
|
604
580
|
});
|
|
605
581
|
//# sourceMappingURL=delegation.js.map
|