-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathhardhat.config.js
78 lines (71 loc) · 2.58 KB
/
hardhat.config.js
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
require("@nomicfoundation/hardhat-toolbox");
require("@nomicfoundation/hardhat-chai-matchers");
require("@nomiclabs/hardhat-ethers");
// Import dotenv module to access variables stored in the .env file
require("dotenv").config();
// Define Hardhat tasks here, which can be accessed in our test file (test/rpc.js) by using hre.run('taskName')
task("show-balance", async () => {
const showBalance = require("./scripts/showBalance");
return showBalance();
});
task("deploy-contract", async () => {
const deployContract = require("./scripts/deployContract");
return deployContract();
});
task("contract-view-call", async (taskArgs) => {
const contractViewCall = require("./scripts/contractViewCall");
return contractViewCall(taskArgs.contractAddress);
});
task("contract-call", async (taskArgs) => {
const contractCall = require("./scripts/contractCall");
return contractCall(taskArgs.contractAddress, taskArgs.msg);
});
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
mocha: {
timeout: 3600000,
},
solidity: {
version: "0.8.9",
settings: {
optimizer: {
enabled: true,
runs: 500,
},
},
},
// This specifies network configurations used when running Hardhat tasks
defaultNetwork: "local",
networks: {
local: {
// Your Hedera Local Node address pulled from the .env file
url: process.env.LOCAL_NODE_ENDPOINT,
// Your local node operator private key pulled from the .env file
accounts: [process.env.LOCAL_NODE_OPERATOR_PRIVATE_KEY],
},
testnet: {
// HashIO testnet endpoint from the TESTNET_ENDPOINT variable in the .env file
url: process.env.TESTNET_ENDPOINT,
// Your ECDSA account private key pulled from the .env file
accounts: [process.env.TESTNET_OPERATOR_PRIVATE_KEY],
},
/**
* Uncomment the following to add a mainnet network configuration
*/
// mainnet: {
// // HashIO mainnet endpoint from the MAINNET_ENDPOINT variable in the .env file
// url: process.env.MAINNET_ENDPOINT,
// // Your ECDSA account private key pulled from the .env file
// accounts: [process.env.MAINNET_OPERATOR_PRIVATE_KEY],
// },
/**
* Uncomment the following to add a previewnet network configuration
*/
// previewnet: {
// // HashIO previewnet endpoint from the PREVIEWNET_ENDPOINT variable in the .env file
// url: process.env.PREVIEWNET_ENDPOINT,
// // Your ECDSA account private key pulled from the .env file
// accounts: [process.env.PREVIEWNET_OPERATOR_PRIVATE_KEY],
// },
},
};