Skip to content

Commit a5430f6

Browse files
committed
Changed execute option to dryrun
1 parent aab52bb commit a5430f6

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

contracts/tasks/tasks.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2148,9 +2148,9 @@ subtask(
21482148
types.int
21492149
)
21502150
.addParam(
2151-
"execute",
2152-
"Whether to execute the withdrawals or just display them",
2153-
true,
2151+
"dryrun",
2152+
"Do not send any txs to the staking strategy contract",
2153+
false,
21542154
types.boolean
21552155
)
21562156
.setAction(async (taskArgs) => {

contracts/tasks/validatorCompound.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ async function autoValidatorWithdrawals({
244244
buffer: bufferBps = 100, // 1% buffer
245245
minValidatorWithdrawAmount = BigInt(10e18),
246246
minStrategyWithdrawAmount = parseUnits("0.1", 18),
247-
execute = true,
247+
dryrun = false,
248248
}) {
249249
const networkName = await getNetworkName();
250250
const wethAddress = addresses[networkName].WETH;
@@ -353,7 +353,7 @@ async function autoValidatorWithdrawals({
353353
)} ETH/WETH from the strategy`
354354
);
355355

356-
if (execute) {
356+
if (!dryrun) {
357357
const tx = await strategy
358358
.connect(signer)
359359
.withdraw(vaultAddress, wethAddress, withdrawAmount);
@@ -389,7 +389,6 @@ async function autoValidatorWithdrawals({
389389
const sortedValidators = validators.sort((a, b) =>
390390
a.balanceWei.lt(b.balanceWei) ? -1 : 1
391391
);
392-
log(sortedValidators);
393392

394393
// For each validator
395394
for (const validator of sortedValidators) {
@@ -419,7 +418,7 @@ async function autoValidatorWithdrawals({
419418
}`
420419
);
421420

422-
if (execute) {
421+
if (!dryrun) {
423422
// Call strategy to partially withdraw from the validator
424423
await strategy
425424
.connect(signer)

0 commit comments

Comments
 (0)