-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from multiversx/tasks-changes
Tasks fixes & improvements
- Loading branch information
Showing
7 changed files
with
90 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import "@nomicfoundation/hardhat-toolbox"; | ||
import fs from "fs"; | ||
|
||
task("get-token-properties", "Returns the token's properties") | ||
.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 | ||
.totalBalances(address) | ||
.then((balance: any) => { | ||
console.log(`Token ${address} has a set balance of: ${balance.toString()}`); | ||
}) | ||
.catch((err: any) => { | ||
console.log(err); | ||
}); | ||
|
||
await contract | ||
.mintBalances(address) | ||
.then((balance: any) => { | ||
console.log(`Token ${address} has a set mint balance of: ${balance.toString()}`); | ||
}) | ||
.catch((err: any) => { | ||
console.log(err); | ||
}); | ||
|
||
await contract | ||
.burnBalances(address) | ||
.then((balance: any) => { | ||
console.log(`Token ${address} has a set burn balance of: ${balance.toString()}`); | ||
}) | ||
.catch((err: any) => { | ||
console.log(err); | ||
}); | ||
|
||
await contract | ||
.nativeTokens(address) | ||
.then((isNative: any) => { | ||
console.log(`Token ${address} is native: ${isNative.toString()}`); | ||
}) | ||
.catch((err: any) => { | ||
console.log(err); | ||
}); | ||
|
||
await contract | ||
.mintBurnTokens(address) | ||
.then((isMintBurn: any) => { | ||
console.log(`Token ${address} is mint-burn: ${isMintBurn.toString()}`); | ||
}) | ||
.catch((err: any) => { | ||
console.log(err); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import "@nomicfoundation/hardhat-toolbox"; | ||
|
||
task("mintburn-test-tokens", "Mints tests tokens and sends them to the recipientAddress") | ||
.addParam("address", "Address of wallet to be funded") | ||
.setAction(async (taskArgs, hre) => { | ||
const fs = require("fs"); | ||
const filename = "setup.config.json"; | ||
let config = JSON.parse(fs.readFileSync(filename, "utf8")); | ||
const address = taskArgs.address; | ||
|
||
for (let token of config["tokens"]) { | ||
console.log("minting tokens for contract: ", token); | ||
const tokenContract = (await hre.ethers.getContractFactory("MintBurnERC20")).attach(token); | ||
|
||
await tokenContract.mint(address, "10000000000000000"); | ||
console.log("minted tokens for contract: ", token, address); | ||
} | ||
}); |
This file was deleted.
Oops, something went wrong.