-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgemforge.config.cjs
186 lines (182 loc) · 6.76 KB
/
gemforge.config.cjs
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
require("dotenv").config();
const fs = require("fs");
const { mnemonicToAccount } = require("viem/accounts");
const MNEMONIC = fs.existsSync("./nayms_mnemonic.txt") ? fs.readFileSync("./nayms_mnemonic.txt").toString().trim() : "test test test test test test test test test test test junk";
const sysAdminAddress = mnemonicToAccount(MNEMONIC).address;
const mainnetSysAdminAddress = process.env.NAYM_SYS_ADMIN_ADDRESS;
console.log("The sysAdminAddress is: ", sysAdminAddress);
console.log("The mainnetSysAdminAddress is: ", mainnetSysAdminAddress);
module.exports = {
// Configuration file version
version: 2,
// Compiler configuration
solc: {
// SPDX License - to be inserted in all generated .sol files
license: "MIT",
// Solidity compiler version - to be inserted in all generated .sol files
version: "0.8.20",
},
// commands to execute
commands: {
// the build command
build: "forge build",
},
paths: {
// contract built artifacts folder
artifacts: "out",
// source files
src: {
// file patterns to include in facet parsing
facets: [
// include all .sol files in the facets directory ending "Facet"
"src/facets/*Facet.sol",
],
},
// folders for gemforge-generated files
generated: {
// output folder for generated .sol files
solidity: "src/generated",
// output folder for support scripts and files
support: ".gemforge",
// deployments JSON file
deployments: "gemforge.deployments.json",
},
// library source code
lib: {
// diamond library
diamond: "lib/diamond-2-hardhat",
},
},
// artifacts configuration
artifacts: {
// artifact format - "foundry" or "hardhat"
format: "foundry",
},
// generator options
generator: {
// proxy interface options
proxyInterface: {
// imports to include in the generated IDiamondProxy interface
imports: ["src/shared/FreeStructs.sol"],
},
},
// diamond configuration
diamond: {
// Whether to include public methods when generating the IDiamondProxy interface. Default is to only include external methods.
publicMethods: true,
init: {
contract: "InitDiamond",
function: "init",
},
// Names of core facet contracts - these will not be modified/removed once deployed and are also reserved names.
// This default list is taken from the diamond-2-hardhat library.
// NOTE: WE RECOMMEND NOT CHANGING ANY OF THESE EXISTING NAMES UNLESS YOU KNOW WHAT YOU ARE DOING.
coreFacets: ["DiamondCutFacet", "DiamondLoupeFacet", "NaymsOwnershipFacet", "ACLFacet", "GovernanceFacet"],
},
// lifecycle shell command hooks
hooks: {
preBuild: "",
postBuild: "",
preDeploy: "",
postDeploy: "",
},
// Wallets to use for deployment
wallets: {
// nayms owner
devOwnerWallet: {
type: "mnemonic",
config: {
words: MNEMONIC,
index: 19,
},
},
// nayms sys admin
devSysAdminWallet: {
type: "mnemonic",
config: {
words: MNEMONIC,
index: 0,
},
},
deployerWallet: {
type: "private-key",
config: {
key: process.env.NAYM_TOKEN_DEPLOYER_KEY || "",
},
},
},
networks: {
local: { rpcUrl: "http://localhost:8545" },
sepolia: {
rpcUrl: process.env.ETH_SEPOLIA_RPC_URL,
contractVerification: {
foundry: {
apiUrl: "https://api-sepolia.etherscan.io/api",
apiKey: () => process.env.ETHERSCAN_API_KEY,
},
},
},
mainnet: {
rpcUrl: process.env.ETH_MAINNET_RPC_URL,
contractVerification: {
foundry: {
apiUrl: "https://api.etherscan.io/api",
apiKey: () => process.env.ETHERSCAN_API_KEY,
},
},
},
baseSepolia: {
rpcUrl: process.env.BASE_SEPOLIA_RPC_URL,
contractVerification: {
foundry: {
apiUrl: "https://api-sepolia.basescan.org/api",
apiKey: () => process.env.BASESCAN_API_KEY,
},
},
},
base: {
rpcUrl: process.env.BASE_MAINNET_RPC_URL,
contractVerification: {
foundry: {
apiUrl: "https://api.basescan.org/api",
apiKey: () => process.env.BASESCAN_API_KEY,
},
},
},
aurora: {
rpcUrl: process.env.AURORA_MAINNET_RPC_URL,
contractVerification: {
foundry: {
apiUrl: "https://explorer.mainnet.aurora.dev/api",
apiKey: () => process.env.BLOCKSCOUT_API_KEY,
},
},
},
auroraTestnet: {
rpcUrl: process.env.AURORA_TESTNET_RPC_URL,
contractVerification: {
foundry: {
apiUrl: "https://explorer.testnet.aurora.dev/api",
apiKey: () => process.env.BLOCKSCOUT_API_KEY,
},
},
},
},
targets: {
// `governance` attribute is only releveant for testnets, it's a wallet to use to auto approve the upgrade ID within the script
local: { network: "local", wallet: "devOwnerWallet", governance: "devSysAdminWallet", initArgs: [sysAdminAddress] },
sepolia: { network: "sepolia", wallet: "devOwnerWallet", governance: "devSysAdminWallet", initArgs: [sysAdminAddress] },
sepoliaFork: { network: "local", wallet: "devOwnerWallet", governance: "devSysAdminWallet", initArgs: [sysAdminAddress] },
mainnet: { network: "mainnet", wallet: "deployerWallet", initArgs: [mainnetSysAdminAddress], create3Salt: process.env.NAYM_TOKEN_SALT },
mainnetFork: { network: "local", wallet: "deployerWallet", initArgs: [mainnetSysAdminAddress], create3Salt: process.env.NAYM_TOKEN_SALT },
baseSepolia: { network: "baseSepolia", wallet: "devOwnerWallet", governance: "devSysAdminWallet", initArgs: [sysAdminAddress] },
baseSepoliaFork: { network: "local", wallet: "devOwnerWallet", governance: "devSysAdminWallet", initArgs: [sysAdminAddress] },
base: { network: "base", wallet: "deployerWallet", initArgs: [mainnetSysAdminAddress], create3Salt: process.env.NAYM_TOKEN_SALT },
baseFork: { network: "local", wallet: "deployerWallet", governance: "devSysAdminWallet", initArgs: [mainnetSysAdminAddress], create3Salt: process.env.NAYM_TOKEN_SALT },
baseForkDev: { network: "local", wallet: "devOwnerWallet", governance: "devSysAdminWallet", initArgs: [mainnetSysAdminAddress], create3Salt: process.env.NAYM_TOKEN_SALT },
aurora: { network: "aurora", wallet: "deployerWallet", initArgs: [mainnetSysAdminAddress], create3Salt: process.env.NAYM_TOKEN_SALT },
auroraFork: { network: "local", wallet: "devOwnerWallet", initArgs: [mainnetSysAdminAddress] },
auroraTestnet: { network: "auroraTestnet", wallet: "devOwnerWallet", governance: "devSysAdminWallet", initArgs: [sysAdminAddress] },
auroraTestnetFork: { network: "local", wallet: "devOwnerWallet", governance: "devSysAdminWallet", initArgs: [sysAdminAddress] },
},
};