diff --git a/hardhat.config.ts b/hardhat.config.ts index 50599d2..3684e83 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -31,6 +31,8 @@ import "./tasks/get-statuses-after-execution"; import "./tasks/depositSC"; import "./tasks/set-batch-settle-limit-on-safe" import "./tasks/deploy"; +import "./tasks/native-tokens" +import "./tasks/mintburn-tokens" import { resolve } from "path"; diff --git a/tasks/mintburn-tokens.ts b/tasks/mintburn-tokens.ts new file mode 100644 index 0000000..e4e14fa --- /dev/null +++ b/tasks/mintburn-tokens.ts @@ -0,0 +1,24 @@ +import "@nomicfoundation/hardhat-toolbox"; +import fs from "fs"; + +task("mintburn-tokens", "Returns if the token is mint-burn or not") + .addParam("address", "Address of the token") + .setAction(async (taskArgs, hre) => { + const address = taskArgs.address; + + const filename = "setup.config.json"; + const config = JSON.parse(fs.readFileSync(filename, "utf8")); + const safeAddress = config["erc20Safe"]; + + const safeContractFactory = await hre.ethers.getContractFactory("ERC20Safe"); + const contract = safeContractFactory.attach(safeAddress) + + await contract + .mintBurnTokens(address) + .then((isMintBurn: any) => { + console.log(`Token ${address} is mint-burn: ${isMintBurn.toString()}`); + }) + .catch((err: any) => { + console.log(err); + }); + }); diff --git a/tasks/native-tokens.ts b/tasks/native-tokens.ts new file mode 100644 index 0000000..72fdb39 --- /dev/null +++ b/tasks/native-tokens.ts @@ -0,0 +1,24 @@ +import "@nomicfoundation/hardhat-toolbox"; +import fs from "fs"; + +task("native-tokens", "Returns if the token is native or not") + .addParam("address", "Address of the token") + .setAction(async (taskArgs, hre) => { + const address = taskArgs.address; + + const filename = "setup.config.json"; + const config = JSON.parse(fs.readFileSync(filename, "utf8")); + const safeAddress = config["erc20Safe"]; + + const safeContractFactory = await hre.ethers.getContractFactory("ERC20Safe"); + const contract = safeContractFactory.attach(safeAddress) + + await contract + .nativeTokens(address) + .then((isNative: any) => { + console.log(`Token ${address} is native: ${isNative.toString()}`); + }) + .catch((err: any) => { + console.log(err); + }); + });