-
Notifications
You must be signed in to change notification settings - Fork 21
/
hardhat.config.ts
126 lines (114 loc) · 3.3 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import "dotenv/config";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { HardhatUserConfig, task } from "hardhat/config";
import {
deployDirect,
deployProxy,
upgradeProxy,
} from "./script/hardhat-scripts/tasks";
import "@nomicfoundation/hardhat-toolbox";
import "@nomicfoundation/hardhat-foundry";
import "@openzeppelin/hardhat-upgrades";
task("deployBnbXProxy", "Deploy BnbX Proxy only")
.addPositionalParam("admin")
.setAction(async ({ admin }, hre: HardhatRuntimeEnvironment) => {
await deployProxy(hre, "BnbX", admin);
});
task("upgradeBnbXProxy", "Upgrade BnbX Proxy")
.addPositionalParam("proxyAddress")
.setAction(async ({ proxyAddress }, hre: HardhatRuntimeEnvironment) => {
await upgradeProxy(hre, "BnbX", proxyAddress);
});
task("deployBnbXImpl", "Deploy BnbX Implementation only").setAction(
async (args, hre: HardhatRuntimeEnvironment) => {
await deployDirect(hre, "BnbX");
}
);
task("deployStakeManagerProxy", "Deploy StakeManager Proxy only")
.addPositionalParam("bnbX")
.addPositionalParam("admin")
.addPositionalParam("manager")
.addPositionalParam("tokenHub")
.addPositionalParam("bcDepositWallet")
.addPositionalParam("bot")
.addPositionalParam("feeBps")
.setAction(
async (
{ bnbX, admin, manager, tokenHub, bcDepositWallet, bot, feeBps },
hre: HardhatRuntimeEnvironment
) => {
await deployProxy(
hre,
"StakeManager",
bnbX,
admin,
manager,
tokenHub,
bcDepositWallet,
bot,
feeBps
);
}
);
task("upgradeStakeManagerProxy", "Upgrade StakeManager Proxy")
.addPositionalParam("proxyAddress")
.setAction(async ({ proxyAddress }, hre: HardhatRuntimeEnvironment) => {
await upgradeProxy(hre, "StakeManager", proxyAddress);
});
task(
"deployStakeManagerImpl",
"Deploy StakeManager Implementation only"
).setAction(async (args, hre: HardhatRuntimeEnvironment) => {
await deployDirect(hre, "StakeManager");
});
task("deployReferralContract", "Deploy KOL Referral Contract")
.addPositionalParam("admin")
.addPositionalParam("trustedForwarder")
.setAction(
async ({ admin, trustedForwarder }, hre: HardhatRuntimeEnvironment) => {
await deployProxy(hre, "KOLReferral", admin, trustedForwarder);
}
);
task("upgradeReferralContract", "Upgrade KOL Referral Contract")
.addPositionalParam("proxyAddress")
.setAction(async ({ proxyAddress }, hre: HardhatRuntimeEnvironment) => {
await upgradeProxy(hre, "KOLReferral", proxyAddress);
});
const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: "0.8.25",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
evmVersion: "cancun",
outputSelection: {
"*": {
"*": ["storageLayout"],
},
},
},
},
],
},
defaultNetwork: "hardhat",
networks: {
mainnet: {
url: `${process.env.BSC_MAINNET_RPC_URL}`,
chainId: 56,
accounts: [process.env.DEV_PRIVATE_KEY ?? ""],
},
testnet: {
url: `${process.env.BSC_TESTNET_RPC_URL}`,
chainId: 97,
accounts: [process.env.DEV_PRIVATE_KEY ?? ""],
},
},
etherscan: {
apiKey: process.env.BSC_SCAN_API_KEY,
},
};
export default config;