Skip to content

Commit

Permalink
Merge pull request #62 from multiversx/fix-add-to-whitelist-task
Browse files Browse the repository at this point in the history
  • Loading branch information
dragos-rebegea authored Sep 13, 2024
2 parents e651958 + 02aa5f4 commit ac815b3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tasks/add-to-whitelist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@ task("add-to-whitelist", "Whitelists a new address in the bridge.")
.addOptionalParam("price", "Gas price in gwei for this transaction", undefined)
.addOptionalParam("mintburn", "flag if the token is mintable/burnable", false, types.boolean)
.addOptionalParam("native", "flag if the token is native", true, types.boolean)
.addOptionalParam("totalBalance", "total balance")
.addOptionalParam("mintBalance", "minted balance")
.addOptionalParam("burnBalance", "burn balance")
.setAction(async (taskArgs, hre) => {
const minAmount = taskArgs.min ?? 25;
const maxAmount = taskArgs.max ?? 100;
const address = taskArgs.address;
const mintBurn = taskArgs.mintburn ?? false;
const native = taskArgs.native ?? false;
const totalBalance = taskArgs.totalBalance ?? 0
const mintBalance = taskArgs.mintBalance ?? 0
const burnBalance = taskArgs.burnBalance ?? 0
const [adminWallet] = await hre.ethers.getSigners();
const fs = require("fs");
const filename = "setup.config.json";
Expand All @@ -22,7 +28,7 @@ task("add-to-whitelist", "Whitelists a new address in the bridge.")
const safeContractFactory = await hre.ethers.getContractFactory("ERC20Safe");
const safe = safeContractFactory.attach(safeAddress).connect(adminWallet);

await safe.whitelistToken(address, minAmount, maxAmount, mintBurn, native, getDeployOptions(taskArgs));
await safe.whitelistToken(address, minAmount, maxAmount, mintBurn, native, totalBalance, mintBalance, burnBalance, getDeployOptions(taskArgs));

if (config.tokens === undefined) {
config.tokens = {};
Expand Down

0 comments on commit ac815b3

Please sign in to comment.