@@ -16,116 +16,114 @@ function mapFullKeyToShortKey(networks: Networks, fullKey: string) {
16
16
}
17
17
18
18
const func : DeployFunction = async function ( hre : HardhatRuntimeEnvironment ) {
19
- console . log ( `Starting deploy script: ${ path . basename ( __filename ) } 👇` ) ;
20
-
21
- if ( process . env . TENDERLY_ENABLED === 'true' ) {
22
- const currentNetworkType : NetworkType = networks [ hre . network . name ] . type ;
23
- if ( currentNetworkType === NetworkType . local ) {
24
- console . log ( 'Not verifying contracts on localhost networks.' ) ;
25
- return ;
26
- }
27
- const accounts = await hre . ethers . getSigners ( ) ;
28
- let deployer : SignerWithAddress = accounts [ 0 ] ;
29
- let network = networks [ hre . network . name ] ;
30
- const environment : Environment = getEnvironment ( ) ;
31
- // const currentNetworkType: NetworkType = network.type;
32
- const definedOracleNames = {
33
- avalanche : 'Avalanche' ,
34
- avalancheTestnet : 'AvalancheTestnet' ,
35
- binanceSmartChain : 'BinanceSmartChain' ,
36
- binanceSmartChainTestnet : 'BinanceSmartChainTestnet' ,
37
- ethereum : 'Ethereum' ,
38
- ethereumTestnetSepolia : 'EthereumTestnetSepolia' ,
39
- polygon : 'Polygon' ,
40
- polygonTestnet : 'PolygonTestnet' ,
41
- optimism : 'Optimism' ,
42
- optimismTestnetSepolia : 'OptimismTestnetSepolia' ,
43
- arbitrumNova : 'ArbitrumNova' ,
44
- arbitrumOne : 'ArbitrumOne' ,
45
- arbitrumTestnetSepolia : 'ArbitrumTestnetSepolia' ,
46
- zora : 'Zora' ,
47
- zoraTestnetSepolia : 'ZoraTestnetSepolia' ,
48
- linea : 'Linea' ,
49
- lineaTestnetGoerli : 'LineaTestnetGoerli' ,
50
- lineaTestnetSepolia : 'LineaTestnetSepolia' ,
51
- base : 'base' ,
52
- baseTestnetSepolia : 'baseTestnetSepolia' ,
53
- mantle : 'Mantle' ,
54
- mantleTestnet : 'MantleTestnet' ,
55
- } ;
56
- let targetDropsPriceOracle = 'DummyDropsPriceOracle' ;
57
- if ( network . key in definedOracleNames ) {
58
- targetDropsPriceOracle = 'DropsPriceOracle' + definedOracleNames [ network . key ] ;
59
- } else {
60
- if (
61
- environment === Environment . mainnet ||
62
- ( network . key !== 'localhost' && network . key !== 'localhost2' && network . key !== 'hardhat' )
63
- ) {
64
- throw new Error ( 'Drops price oracle not created for network yet!' ) ;
65
- }
66
- }
67
- let contracts : string [ ] = [
68
- 'HolographUtilityToken' ,
69
- 'hToken' ,
70
- 'Holograph' ,
71
- 'HolographBridge' ,
72
- 'HolographBridgeProxy' ,
73
- 'Holographer' ,
74
- 'HolographERC20' ,
75
- 'HolographERC721' ,
76
- 'HolographDropERC721' ,
77
- 'HolographDropERC721Proxy' ,
78
- 'HolographFactory' ,
79
- 'HolographFactoryProxy' ,
80
- 'HolographGeneric' ,
81
- 'HolographGenesis' ,
82
- 'HolographOperator' ,
83
- 'HolographOperatorProxy' ,
84
- 'HolographRegistry' ,
85
- 'HolographRegistryProxy' ,
86
- 'HolographTreasury' ,
87
- 'HolographTreasuryProxy' ,
88
- 'HolographInterfaces' ,
89
- 'HolographRoyalties' ,
90
- 'CxipERC721' ,
91
- 'CxipERC721Proxy' ,
92
- 'Faucet' ,
93
- 'LayerZeroModule' ,
94
- 'EditionsMetadataRenderer' ,
95
- 'EditionsMetadataRendererProxy' ,
96
- 'OVM_GasPriceOracle' ,
97
- 'DropsPriceOracleProxy' ,
98
- targetDropsPriceOracle ,
99
- ] ;
100
- // Tenderly only supports short network names defined in a private object
101
- // so this converts the full network name to the short name before passing into tenderly to fix the issue
102
- // with errors thrown when toString is called on a network not defined in the private object
103
- //
104
- // Reference to the issue below to open an issue or PR for hardhat-tenderly to fix this
105
- // Instead of using a private object, it should use the networks object defined in hardhat.config.ts
106
- // chainId = NETWORK_NAME_CHAIN_ID_MAP[network.toLowerCase()].toString();
107
- network = mapFullKeyToShortKey ( networks , hre . network . name ) ;
108
- tenderly . env . hardhatArguments . network = network ;
109
- tenderly . env . network . name = network ;
110
- console . log ( 'Verifying contracts on Tenderly...' ) ;
111
- for ( let i : number = 0 , l : number = contracts . length ; i < l ; i ++ ) {
112
- try {
113
- let contract : string = contracts [ i ] ;
114
- const contractAddress = await ( await hre . deployments . get ( contract ) ) . address ;
115
- console . log ( contract , contractAddress ) ;
116
- await tenderly . verify ( {
117
- address : contractAddress ,
118
- name : contract ,
119
- } ) ;
120
- } catch ( error ) {
121
- console . log ( `Failed to run tenderly verify -> ${ error } ` ) ;
122
- }
123
- }
124
- } else {
125
- console . log ( 'Tenderly is not enabled... skipping tenderly contract verification.' ) ;
126
- }
127
-
128
- console . log ( `Exiting script: ${ __filename } ✅\n` ) ;
19
+ // console.log(`Starting deploy script: ${path.basename(__filename)} 👇`);
20
+ // if (process.env.TENDERLY_ENABLED === 'true') {
21
+ // const currentNetworkType: NetworkType = networks[hre.network.name].type;
22
+ // if (currentNetworkType === NetworkType.local) {
23
+ // console.log('Not verifying contracts on localhost networks.');
24
+ // return;
25
+ // }
26
+ // const accounts = await hre.ethers.getSigners();
27
+ // let deployer: SignerWithAddress = accounts[0];
28
+ // let network = networks[hre.network.name];
29
+ // const environment: Environment = getEnvironment();
30
+ // // const currentNetworkType: NetworkType = network.type;
31
+ // const definedOracleNames = {
32
+ // avalanche: 'Avalanche',
33
+ // avalancheTestnet: 'AvalancheTestnet',
34
+ // binanceSmartChain: 'BinanceSmartChain',
35
+ // binanceSmartChainTestnet: 'BinanceSmartChainTestnet',
36
+ // ethereum: 'Ethereum',
37
+ // ethereumTestnetSepolia: 'EthereumTestnetSepolia',
38
+ // polygon: 'Polygon',
39
+ // polygonTestnet: 'PolygonTestnet',
40
+ // optimism: 'Optimism',
41
+ // optimismTestnetSepolia: 'OptimismTestnetSepolia',
42
+ // arbitrumNova: 'ArbitrumNova',
43
+ // arbitrumOne: 'ArbitrumOne',
44
+ // arbitrumTestnetSepolia: 'ArbitrumTestnetSepolia',
45
+ // zora: 'Zora',
46
+ // zoraTestnetSepolia: 'ZoraTestnetSepolia',
47
+ // linea: 'Linea',
48
+ // lineaTestnetGoerli: 'LineaTestnetGoerli',
49
+ // lineaTestnetSepolia: 'LineaTestnetSepolia',
50
+ // base: 'base',
51
+ // baseTestnetSepolia: 'baseTestnetSepolia',
52
+ // mantle: 'Mantle',
53
+ // mantleTestnet: 'MantleTestnet',
54
+ // };
55
+ // let targetDropsPriceOracle = 'DummyDropsPriceOracle';
56
+ // if (network.key in definedOracleNames) {
57
+ // targetDropsPriceOracle = 'DropsPriceOracle' + definedOracleNames[network.key];
58
+ // } else {
59
+ // if (
60
+ // environment === Environment.mainnet ||
61
+ // (network.key !== 'localhost' && network.key !== 'localhost2' && network.key !== 'hardhat')
62
+ // ) {
63
+ // throw new Error('Drops price oracle not created for network yet!');
64
+ // }
65
+ // }
66
+ // let contracts: string[] = [
67
+ // 'HolographUtilityToken',
68
+ // 'hToken',
69
+ // 'Holograph',
70
+ // 'HolographBridge',
71
+ // 'HolographBridgeProxy',
72
+ // 'Holographer',
73
+ // 'HolographERC20',
74
+ // 'HolographERC721',
75
+ // 'HolographDropERC721',
76
+ // 'HolographDropERC721Proxy',
77
+ // 'HolographFactory',
78
+ // 'HolographFactoryProxy',
79
+ // 'HolographGeneric',
80
+ // 'HolographGenesis',
81
+ // 'HolographOperator',
82
+ // 'HolographOperatorProxy',
83
+ // 'HolographRegistry',
84
+ // 'HolographRegistryProxy',
85
+ // 'HolographTreasury',
86
+ // 'HolographTreasuryProxy',
87
+ // 'HolographInterfaces',
88
+ // 'HolographRoyalties',
89
+ // 'CxipERC721',
90
+ // 'CxipERC721Proxy',
91
+ // 'Faucet',
92
+ // 'LayerZeroModule',
93
+ // 'EditionsMetadataRenderer',
94
+ // 'EditionsMetadataRendererProxy',
95
+ // 'OVM_GasPriceOracle',
96
+ // 'DropsPriceOracleProxy',
97
+ // targetDropsPriceOracle,
98
+ // ];
99
+ // // Tenderly only supports short network names defined in a private object
100
+ // // so this converts the full network name to the short name before passing into tenderly to fix the issue
101
+ // // with errors thrown when toString is called on a network not defined in the private object
102
+ // //
103
+ // // Reference to the issue below to open an issue or PR for hardhat-tenderly to fix this
104
+ // // Instead of using a private object, it should use the networks object defined in hardhat.config.ts
105
+ // // chainId = NETWORK_NAME_CHAIN_ID_MAP[network.toLowerCase()].toString();
106
+ // network = mapFullKeyToShortKey(networks, hre.network.name);
107
+ // tenderly.env.hardhatArguments.network = network;
108
+ // tenderly.env.network.name = network;
109
+ // console.log('Verifying contracts on Tenderly...');
110
+ // for (let i: number = 0, l: number = contracts.length; i < l; i++) {
111
+ // try {
112
+ // let contract: string = contracts[i];
113
+ // const contractAddress = await (await hre.deployments.get(contract)).address;
114
+ // console.log(contract, contractAddress);
115
+ // await tenderly.verify({
116
+ // address: contractAddress,
117
+ // name: contract,
118
+ // });
119
+ // } catch (error) {
120
+ // console.log(`Failed to run tenderly verify -> ${error}`);
121
+ // }
122
+ // }
123
+ // } else {
124
+ // console.log('Tenderly is not enabled... skipping tenderly contract verification.');
125
+ // }
126
+ // console.log(`Exiting script: ${__filename} ✅\n`);
129
127
} ;
130
128
131
129
export default func ;
0 commit comments