-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhardhat.config.ts
More file actions
113 lines (93 loc) · 2.44 KB
/
hardhat.config.ts
File metadata and controls
113 lines (93 loc) · 2.44 KB
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
104
105
106
import * as dotenv from "dotenv";
import { HardhatUserConfig, task } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
dotenv.config();
export async function verifyContract(
hre : any,
address : string,
args : undefined,
contract : string | undefined
) {
const verifyObj = { address } as any;
if (args) {
verifyObj.constructorArguments = args;
}
if (contract) {
verifyObj.contract = contract;
}
return hre
.run("verify:verify", verifyObj)
.then(() => console.log("Contract address verified:", address))
.catch((err : any) => {
console.log(`Verify Error`, err);
});
}
task("deploy-MultiCall", "Deploy MultiCall", async (taskArgs, hre) => {
const normal = await hre.ethers.getContractFactory("MultiCall3");
const deployTx = await normal.deploy();
await deployTx.deployTransaction.wait(5);
console.log("MultiCall3: ", deployTx.address);
await verifyContract(
hre,
deployTx.address,
undefined,
"contracts/Multicall3.sol:Multicall3");
});
const config: HardhatUserConfig = {
solidity: "0.8.14",
networks: {
posichaintestnet: {
url: "http://api.s0.t.posichain.org",
chainId: 910000,
accounts: []
},
posichaindevnet: {
url: "http://api.s0.d.posichain.org",
chainId: 920000,
accounts: [ ]
},
posichainmainnet: {
url: "https://api.posichain.org/",
chainId: 900000,
accounts: [ ]
}
},
gasReporter: {
enabled: process.env.REPORT_GAS !== undefined,
currency: "USD",
},
etherscan: {
apiKey: process.env.API_KEY,
customChains: [
{
network: "posichaintestnet",
chainId: 910000,
urls: {
apiURL: "https://apex-testnet.posichain.org/contract-verifier/verify",
browserURL: "https://explorer-testnet.posichain.org/"
}
},
{
network: "posichaindevnet",
chainId: 920000,
urls: {
apiURL: "https://apex-devnet.posichain.org/contract-verifier/verify",
browserURL: "http://explorer-qc.nonprodposi.com/"
}
},
{
network: "posichainmainnet",
chainId: 900000,
urls: {
apiURL: "https://apex.posichain.org/contract-verifier/verify",
browserURL: "https://explorer.posichain.org/"
}
},
]
},
typechain: {
outDir: "typeChain",
target: "ethers-v5",
},
};
export default config;