forked from meterio/tokenERC721
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
103 lines (89 loc) · 2.97 KB
/
hardhat.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import "hardhat-typechain";
import "@nomiclabs/hardhat-ethers";
import "@nomiclabs/hardhat-etherscan";
import "@openzeppelin/hardhat-upgrades";
import { task } from "hardhat/config";
import { Signer, utils } from "ethers";
import { compileSetting, allowVerifyChain } from "./scripts/deployTool";
import { RPCS } from "./scripts/network";
import {
deployContract,
BN,
getContract,
getContractJson,
MINTER_ROLE,
} from "./scripts/helper";
import { getSign } from "./scripts/permitSign"
// import { ERC20MintablePauseable, ERC20MintablePauseableUpgradeable } from './typechain'
const dotenv = require("dotenv");
dotenv.config();
// import Colors = require("colors.ts");
// Colors.enable();
task("accounts", "Prints the list of accounts", async (taskArgs, bre) => {
const accounts = await bre.ethers.getSigners();
for (const account of accounts) {
let address = await account.getAddress();
console.log(
address,
(await bre.ethers.provider.getBalance(address)).toString()
);
}
});
// npx hardhat deploy --name ttt --symbol ttt --supply 1000000000000000000000000 --owner 0x319a0cfD7595b0085fF6003643C7eD685269F851 --network metermain
// task("deploy", "deploy contract")
// .addParam("name", "Token name")
// .addParam("symbol", "Token symbol")
// .addParam("supply", "Token initialSupply require decimal")
// .addParam("owner", "Token will mint to owner address")
// .setAction(
// async ({ name, symbol, supply, owner }, { ethers, run, network }) => {
// await run("compile");
// const signers = await ethers.getSigners();
// const token = await deployContract(
// ethers,
// "ERC20MintablePauseable",
// network.name,
// signers[0],
// [name, symbol, supply, owner]
// ) as ERC20MintablePauseable;
// }
// );
// npx hardhat mint --to 0x319a0cfD7595b0085fF6003643C7eD685269F851 --amount 10000000000000000000000 --network metermain
// task("mint", "mint token")
// .addParam("to", "mint to address")
// .addParam("amount", "mint amount")
// .setAction(
// async ({ to, amount }, { ethers, run, network }) => {
// await run("compile");
// const signers = await ethers.getSigners();
// let token = (await ethers.getContractAt(
// "ERC20MintablePauseableUpgradeable",
// getContract(network.name, "ERC20MintablePauseableUpgradeable"),
// signers[0]
// )) as ERC20MintablePauseableUpgradeable;
// await token.mint(to, amount);
// }
// );
// npx hardhat veri
task("veri", "verify contracts").setAction(
async ({ }, { ethers, run, network }) => {
if (allowVerifyChain.indexOf(network.name) > -1) {
await run(
"verify:verify",
getContractJson(network.name, "ERC20MintablePauseableUpgradeable")
);
}
}
);
export default {
networks: RPCS,
etherscan: {
apiKey: process.env.ETHERSCAN_APIKEY,
},
solidity: {
compilers: [compileSetting("0.8.4", 200)],
},
mocha: {
timeout: 200000,
},
};