@@ -3,7 +3,7 @@ import { DeployFunction } from "hardhat-deploy/types";
3
3
import { prompt , print } from "gluegun" ;
4
4
import { deployUpgradable } from "./utils/deployUpgradable" ;
5
5
import { HomeChains , isSkipped } from "./utils" ;
6
- import { getContractNamesFromNetwork } from "../scripts/utils/contracts" ;
6
+ import { getContractNames , getContractNamesFromNetwork } from "../scripts/utils/contracts" ;
7
7
8
8
const { bold } = print . colors ;
9
9
@@ -21,7 +21,23 @@ const deployUpgradeAll: DeployFunction = async (hre: HardhatRuntimeEnvironment)
21
21
const upgrade = async ( contractName : string , initializer : string , args : any [ ] ) => {
22
22
try {
23
23
print . highlight ( `🔍 Validating upgrade of ${ bold ( contractName ) } ` ) ;
24
- await hre . run ( "compare-storage" , { contract : contractName } ) ;
24
+
25
+ const contractNameWithoutNeo = contractName . replace ( / N e o .* $ / , "" ) ;
26
+ let compareStorageOptions = { contract : contractName } as any ;
27
+ if ( hre . network . name === "arbitrum" ) {
28
+ switch ( contractName ) {
29
+ case "KlerosCoreNeo" :
30
+ case "SortitionModuleNeo" :
31
+ compareStorageOptions = { deployedArtifact : `${ contractName } _Implementation` , contract : contractName } ;
32
+ break ;
33
+ default :
34
+ compareStorageOptions = {
35
+ deployedArtifact : `${ contractName } _Implementation` ,
36
+ contract : contractNameWithoutNeo ,
37
+ } ;
38
+ }
39
+ }
40
+ await hre . run ( "compare-storage" , compareStorageOptions ) ;
25
41
print . newline ( ) ;
26
42
print . highlight ( `💣 Upgrading ${ bold ( contractName ) } ` ) ;
27
43
const { confirm } = await prompt . ask ( {
@@ -35,13 +51,25 @@ const deployUpgradeAll: DeployFunction = async (hre: HardhatRuntimeEnvironment)
35
51
}
36
52
print . info ( `Upgrading ${ contractName } ...` ) ;
37
53
38
- await deployUpgradable ( deployments , contractName , {
39
- newImplementation : contractName ,
40
- initializer,
41
- from : deployer ,
42
- args, // Warning: do not reinitialize existing state variables, only the new ones
43
- } ) ;
44
-
54
+ switch ( contractName ) {
55
+ case "DisputeKitClassicNeo" :
56
+ case "DisputeResolverNeo" :
57
+ await deployUpgradable ( deployments , contractName , {
58
+ contract : contractName ,
59
+ newImplementation : contractNameWithoutNeo ,
60
+ initializer,
61
+ from : deployer ,
62
+ args, // Warning: do not reinitialize existing state variables, only the new ones
63
+ } ) ;
64
+ break ;
65
+ default :
66
+ await deployUpgradable ( deployments , contractName , {
67
+ newImplementation : contractName ,
68
+ initializer,
69
+ from : deployer ,
70
+ args, // Warning: do not reinitialize existing state variables, only the new ones
71
+ } ) ;
72
+ }
45
73
print . info ( `Verifying ${ contractName } on Etherscan...` ) ;
46
74
await hre . run ( "etherscan-verify" , { contractName : `${ contractName } _Implementation` } ) ;
47
75
} catch ( err ) {
0 commit comments