forked from holographxyz/holograph-protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path28_factory_deployed_contracts.ts
executable file
·171 lines (159 loc) · 6.28 KB
/
28_factory_deployed_contracts.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
declare var global: any;
import path from 'path';
import { BigNumber, Contract } from 'ethers';
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from '@holographxyz/hardhat-deploy-holographed/types';
import { getDeployer, hreSplit, txParams } from '../scripts/utils/helpers';
import { NetworkType, networks } from '@holographxyz/networks';
const func: DeployFunction = async function (hre1: HardhatRuntimeEnvironment) {
console.log(`Starting deploy script: ${path.basename(__filename)} 👇`);
let { hre, hre2 } = await hreSplit(hre1, global.__companionNetwork);
const deployer = await getDeployer(hre);
const deployerAddress = await deployer.signer.getAddress();
const salt = hre.deploymentSalt;
const currentNetworkType: NetworkType = networks[hre.networkName].type;
if (currentNetworkType !== NetworkType.local) {
const holographer: Contract | null = await hre.ethers.getContractOrNull('Holographer', deployerAddress);
if (holographer === null) {
await hre.deployments.deploy('Holographer', {
...(await txParams({
hre,
from: deployerAddress,
to: '0x0000000000000000000000000000000000000000',
gasLimit: await hre.ethers.provider.estimateGas(
(await hre.ethers.getContractFactory('Holographer')).getDeployTransaction()
),
})),
args: [],
log: true,
waitConfirmations: 1,
} as any);
console.log('Deployed a "Holographer" empty contract for block explorer verification purposes.');
}
const cxipERC721Proxy: Contract | null = await hre.ethers.getContractOrNull('CxipERC721Proxy', deployerAddress);
if (cxipERC721Proxy === null) {
await hre.deployments.deploy('CxipERC721Proxy', {
...(await txParams({
hre,
from: deployerAddress,
to: '0x0000000000000000000000000000000000000000',
gasLimit: await hre.ethers.provider.estimateGas(
(await hre.ethers.getContractFactory('CxipERC721Proxy')).getDeployTransaction()
),
})),
args: [],
log: true,
waitConfirmations: 1,
} as any);
console.log('Deployed a "CxipERC721Proxy" empty contract for block explorer verification purposes.');
}
const holographLegacyERC721Proxy: Contract | null = await hre.ethers.getContractOrNull(
'HolographLegacyERC721Proxy',
deployerAddress
);
if (holographLegacyERC721Proxy === null) {
await hre.deployments.deploy('HolographLegacyERC721Proxy', {
...(await txParams({
hre,
from: deployerAddress,
to: '0x0000000000000000000000000000000000000000',
gasLimit: await hre.ethers.provider.estimateGas(
(await hre.ethers.getContractFactory('HolographLegacyERC721Proxy')).getDeployTransaction()
),
})),
args: [],
log: true,
waitConfirmations: 1,
} as any);
console.log('Deployed a "HolographLegacyERC721Proxy" empty contract for block explorer verification purposes.');
}
const holographDropERC721Proxy: Contract | null = await hre.ethers.getContractOrNull(
'HolographDropERC721Proxy',
deployerAddress
);
if (holographDropERC721Proxy === null) {
await hre.deployments.deploy('HolographDropERC721Proxy', {
...(await txParams({
hre,
from: deployerAddress,
to: '0x0000000000000000000000000000000000000000',
gasLimit: await hre.ethers.provider.estimateGas(
(await hre.ethers.getContractFactory('HolographDropERC721Proxy')).getDeployTransaction()
),
})),
args: [],
log: true,
waitConfirmations: 1,
} as any);
console.log('Deployed a "HolographDropERC721Proxy" empty contract for block explorer verification purposes.');
}
const countdownERC721Proxy: Contract | null = await hre.ethers.getContractOrNull(
'CountdownERC721Proxy',
deployerAddress
);
if (countdownERC721Proxy === null) {
await hre.deployments.deploy('CountdownERC721Proxy', {
...(await txParams({
hre,
from: deployerAddress,
to: '0x0000000000000000000000000000000000000000',
gasLimit: await hre.ethers.provider.estimateGas(
(await hre.ethers.getContractFactory('CountdownERC721Proxy')).getDeployTransaction()
),
})),
args: [],
log: true,
waitConfirmations: 1,
} as any);
console.log('Deployed a "CountdownERC721Proxy" empty contract for block explorer verification purposes.');
}
const holographUtilityToken: Contract | null = await hre.ethers.getContractOrNull(
'HolographUtilityToken',
deployerAddress
);
if (holographUtilityToken === null) {
await hre.deployments.deploy('HolographUtilityToken', {
...(await txParams({
hre,
from: deployerAddress,
to: '0x0000000000000000000000000000000000000000',
gasLimit: await hre.ethers.provider.estimateGas(
(await hre.ethers.getContractFactory('HolographUtilityToken')).getDeployTransaction()
),
})),
args: [],
log: true,
waitConfirmations: 1,
} as any);
console.log('Deployed a "HolographUtilityToken" empty contract for block explorer verification purposes.');
}
const hTokenProxy: Contract | null = await hre.ethers.getContractOrNull('hTokenProxy', deployerAddress);
if (hTokenProxy === null) {
await hre.deployments.deploy('hTokenProxy', {
...(await txParams({
hre,
from: deployerAddress,
to: '0x0000000000000000000000000000000000000000',
gasLimit: await hre.ethers.provider.estimateGas(
(await hre.ethers.getContractFactory('hTokenProxy')).getDeployTransaction()
),
})),
args: [],
log: true,
waitConfirmations: 1,
} as any);
console.log('Deployed a "hTokenProxy" empty contract for block explorer verification purposes.');
}
}
console.log(`Exiting script: ${__filename} ✅\n`);
};
export default func;
func.tags = [
'Holographer4verify',
'CxipERC721Proxy4verify',
'HolographLegacyERC7214verify',
'HolographDropERC721Proxy4verify',
'HolographUtilityToken4verify',
'hToken4verify',
];
func.dependencies = [];