Skip to content

Commit

Permalink
chore(simulation): opNEWOaggr on tenderly
Browse files Browse the repository at this point in the history
  • Loading branch information
fiqureshi1 committed Jun 1, 2022
1 parent 0540acc commit b1c4d23
Show file tree
Hide file tree
Showing 28 changed files with 3 additions and 2 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions tasks/actions/vault-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { getAddress } from "@ethersproject/address";
import { TypedTokens } from "../../helpers/data";
import { Vault } from "../../typechain";
import { getAllowWhitelistState } from "../../helpers/utils";
import { BigNumber } from "ethers";

task(TASKS.ACTION_TASKS.VAULT_ACTIONS.NAME, TASKS.ACTION_TASKS.VAULT_ACTIONS.DESCRIPTION)
.addParam("vault", "the address of vault", "", types.string)
Expand All @@ -18,7 +19,7 @@ task(TASKS.ACTION_TASKS.VAULT_ACTIONS.NAME, TASKS.ACTION_TASKS.VAULT_ACTIONS.DES
.addParam("user", "account address of the user", "", types.string)
.addParam("merkleProof", "user merkle proof", "", types.string)
.addOptionalParam("useall", "use whole balance", false, types.boolean)
.addOptionalParam("amount", "amount of token", 0, types.int)
.addOptionalParam("amount", "amount of token", "0", types.string)
.setAction(async ({ vault, action, user, amount, useall, merkleProof }, hre) => {
const ACTIONS = ["DEPOSIT", "WITHDRAW", "REBALANCE", "VAULT-DEPOSIT-ALL-TO-STRATEGY"];
if (vault === "") {
Expand All @@ -33,7 +34,7 @@ task(TASKS.ACTION_TASKS.VAULT_ACTIONS.NAME, TASKS.ACTION_TASKS.VAULT_ACTIONS.DES
throw new Error("action is invalid");
}

if (!useall && amount <= 0 && action.toUpperCase() != "REBALANCE") {
if (!useall && !BigNumber.from(amount).gt("0") && action.toUpperCase() != "REBALANCE") {
throw new Error("amount is not set");
}

Expand Down

0 comments on commit b1c4d23

Please sign in to comment.