forked from me-foundation/magicdrop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
249 lines (221 loc) · 8.17 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
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
import 'dotenv/config';
import '@nomiclabs/hardhat-etherscan';
import '@nomiclabs/hardhat-waffle';
import '@typechain/hardhat';
import 'hardhat-gas-reporter';
import 'hardhat-watcher';
import { HardhatUserConfig, task, types } from 'hardhat/config';
import 'solidity-coverage';
import "@openzeppelin/hardhat-upgrades";
import { deploy } from './scripts/deploy';
import { deployBA } from './scripts/deployBA';
import { mint } from './scripts/mint';
import { ownerMint } from './scripts/ownerMint';
import { setBaseURI } from './scripts/setBaseURI';
import { setCrossmintAddress } from './scripts/setCrossmintAddress';
import { setGlobalWalletLimit } from './scripts/setGlobalWalletLimit';
import { setMaxMintableSupply } from './scripts/setMaxMintableSupply';
import { setMintable } from './scripts/setMintable';
import { setStages } from './scripts/setStages';
import { setTimestampExpirySeconds } from './scripts/setTimestampExpirySeconds';
import { transferOwnership } from './scripts/transferOwnership';
import { setStartAndEndTimeUnixSeconds } from './scripts/setStartAndEndTimeUnixSeconds';
import { setMinContributionInWei } from './scripts/setMinContributionInWei';
import { sendRefund } from './scripts/sendRefund';
import { sendRefundBatch } from './scripts/sendRefundBatch';
import { sendTokensAndRefund } from './scripts/sendTokensAndRefund';
import { sendTokensAndRefundBatch } from './scripts/sendTokensAndRefundBatch';
import { setPrice } from './scripts/setPrice';
import { getPrice } from './scripts/dev/getPrice';
import { getStartTimeBA } from './scripts/dev/getStartTimeBA';
import { getEndTimeBA } from './scripts/dev/getEndTimeBA';
import { getMinContributionInWei } from './scripts/dev/getMinContributionInWei';
const config: HardhatUserConfig = {
solidity: {
version: '0.8.16',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
paths: {
artifacts: './artifacts',
cache: './cache',
sources: './contracts',
tests: './test',
},
networks: {
ropsten: {
url: process.env.ROPSTEN_URL || '',
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
goerli: {
url: process.env.GOERLI_URL || '',
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
mainnet: {
url: process.env.MAINNET_URL || '',
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
mumbai: {
url: process.env.MUMBAI_URL || '',
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
polygon: {
url: process.env.POLYGON_URL || '',
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
},
gasReporter: {
enabled: process.env.REPORT_GAS !== undefined,
currency: 'USD',
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
};
task('setStages', 'Set stages for ERC721M')
.addParam('contract', 'contract address')
.addParam('stages', 'stages json file')
.setAction(setStages);
task('setMintable', 'Set mintable state for ERC721M')
.addParam('contract', 'contract address')
.addParam('mintable', 'mintable state', 'true', types.boolean)
.setAction(setMintable);
task('deploy', 'Deploy ERC721M')
.addParam('name', 'name')
.addParam('symbol', 'symbol')
.addParam('maxsupply', 'max supply')
.addParam('tokenurisuffix', 'token uri suffix', '.json')
.addParam('globalwalletlimit', 'global wallet limit')
.addParam('timestampexpiryseconds', 'timestamp expiry in seconds')
.addOptionalParam(
'cosigner',
'cosigner address (0x00...000 if not using cosign)',
'0x0000000000000000000000000000000000000000',
)
.addFlag(
'increasesupply',
'whether or not to enable increasing supply behavior',
)
.addFlag(
'useoperatorfilterer',
'whether or not to use operator filterer',
)
.setAction(deploy);
task('setBaseURI', 'Set the base uri')
.addParam('uri', 'uri')
.addParam('contract', 'contract address')
.setAction(setBaseURI);
task('setCrossmintAddress', 'Set crossmint address')
.addParam('contract', 'contract address')
.addParam('crossmintaddress', 'new crossmint address')
.setAction(setCrossmintAddress);
task('mint', 'Mint token(s)')
.addParam('contract', 'contract address')
.addParam('qty', 'quantity to mint', '1')
.addParam('minttime', 'time of the mint')
.setAction(mint);
task('ownerMint', 'Mint token(s) as owner')
.addParam('contract', 'contract address')
.addParam('qty', 'quantity to mint', '1')
.addOptionalParam('to', 'recipient address')
.setAction(ownerMint);
task('setGlobalWalletLimit', 'Set the global wallet limit')
.addParam('contract', 'contract address')
.addParam('limit', 'global wallet limit (0 for no global limit)')
.setAction(setGlobalWalletLimit);
task('setMaxMintableSupply', 'set max mintable supply')
.addParam('contract', 'contract address')
.addParam('supply', 'new supply')
.setAction(setMaxMintableSupply);
task('deployBA', 'Deploy BucketAuction')
.addParam('name', 'name')
.addParam('symbol', 'symbol')
.addParam('maxsupply', 'max supply')
.addParam('tokenurisuffix', 'token uri suffix', '.json')
.addParam('globalwalletlimit', 'global wallet limit')
.addOptionalParam(
'cosigner',
'cosigner address (0x00...000 if not using cosign)',
'0x0000000000000000000000000000000000000000',
)
.addParam(
'mincontributioninwei',
'The minimum contribution in wei required only for the AuctionBucket',
)
.addParam('auctionstarttime', 'The start time of the bucket auction')
.addParam('auctionendtime', 'The end time of the bucket auction')
.setAction(deployBA);
task('setTimestampExpirySeconds', 'Set the timestamp expiry seconds')
.addParam('contract', 'contract address')
.addParam('timestampexpiryseconds', 'timestamp expiry in seconds')
.setAction(setTimestampExpirySeconds);
task('transferOwnership', 'transfer contract ownership')
.addParam('contract', 'contract address')
.addParam('owner', 'new owner address')
.setAction(transferOwnership);
task(
'setStartAndEndTimeUnixSeconds',
'set the start and end time for bucket auction',
)
.addParam('contract', 'contract address')
.addParam('starttime', 'start time of the bucket auction')
.addParam('endtime', 'end time of the bucket auction')
.setAction(setStartAndEndTimeUnixSeconds);
task('setMinContributionInWei', 'set the min contribution in wei for BA')
.addParam('contract', 'contract address')
.addParam('mincontributioninwei', 'min contribution in wei')
.setAction(setMinContributionInWei);
task('sendRefund', 'send refund to the specified address for BA')
.addParam('contract', 'contract address')
.addParam('to', 'address to refund')
.setAction(sendRefund);
task('sendRefundBatch', 'send refund to the specified addresses for BA')
.addParam('contract', 'contract address')
.addParam(
'addresses',
'path to the json file with an array of addresses to refund',
)
.setAction(sendRefundBatch);
task(
'sendTokensAndRefund',
'send tokens and refund the remaining to the specified address for BA',
)
.addParam('contract', 'contract address')
.addParam('to', 'address to refund')
.setAction(sendTokensAndRefund);
task(
'sendTokensAndRefundBatch',
'send tokens and refund to the specified addresses for BA',
)
.addParam('contract', 'contract address')
.addParam(
'addresses',
'path to the json file with an array of addresses to refund',
)
.setAction(sendTokensAndRefundBatch);
task('getMinContributionInWei', 'get the min contribution in wei for BA')
.addParam('contract', 'contract address')
.setAction(getMinContributionInWei);
task('getStartTimeBA', 'get the start time of BA')
.addParam('contract', 'contract address')
.setAction(getStartTimeBA);
task('getEndTimeBA', 'get the end time of BA')
.addParam('contract', 'contract address')
.setAction(getEndTimeBA);
task('getPrice', 'get the price set for BA')
.addParam('contract', 'contract address')
.setAction(getPrice);
task('setPrice', 'set the price set for BA')
.addParam('contract', 'contract address')
.addParam('priceinwei', 'price in wei')
.setAction(setPrice);
export default config;