-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
63 lines (55 loc) · 1.56 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
import { task, HardhatUserConfig } from 'hardhat/config';
import '@nomicfoundation/hardhat-toolbox';
import { WinnerCoBadge } from './typechain-types/contracts/WinnerCoBadge';
import dotenv from 'dotenv';
import "@nomiclabs/hardhat-etherscan";
dotenv.config();
task('setBaseURI', 'Sets the BaseURI for the collection')
.setAction(async (taskArgs: any, env) => {
const address = taskArgs.address;
const uri = taskArgs.uri;
console.log(`Setting BaseURI to ${uri} at contract address ${address}`);
const signer = (await env.ethers.getSigners())[0];
const deployedContract = (await (
await env.ethers.getContractAt('WinnerCoBadge', address, signer)
).deployed()) as WinnerCoBadge;
const tx = await deployedContract.setBaseURI(uri);
console.log(`Transaction hash: ${tx.hash}`);
})
.addParam('address', 'The contract address')
.addParam('uri', 'The new Base URI');
const config: HardhatUserConfig = {
solidity: {
version: '0.8.15',
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
},
etherscan: {
apiKey: {
rinkeby: process.env.ETHERSCANKEY ?? ''
}
},
networks: {
rinkeby: {
chainId: 4,
accounts: {
mnemonic: process.env.RINKEBY_MNEMONIC ?? ''
},
url: process.env.RINKEBY_URL ?? ''
},
mainnet: {
chainId: 1,
gasPrice: 100000000000, // 100 gwei
gasMultiplier: 1.5,
accounts: {
mnemonic: process.env.MAINNET_MNEMONIC ?? ''
},
url: process.env.MAINNET_URL ?? ''
},
}
};
export default config;