@@ -3,7 +3,7 @@ import { DeployFunction } from "hardhat-deploy/types";
33import { prompt , print } from "gluegun" ;
44import { deployUpgradable } from "./utils/deployUpgradable" ;
55import { HomeChains , isSkipped } from "./utils" ;
6- import { getContractNamesFromNetwork } from "../scripts/utils/contracts" ;
6+ import { getContractNames , getContractNamesFromNetwork } from "../scripts/utils/contracts" ;
77
88const { bold } = print . colors ;
99
@@ -21,7 +21,23 @@ const deployUpgradeAll: DeployFunction = async (hre: HardhatRuntimeEnvironment)
2121 const upgrade = async ( contractName : string , initializer : string , args : any [ ] ) => {
2222 try {
2323 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 ) ;
2541 print . newline ( ) ;
2642 print . highlight ( `💣 Upgrading ${ bold ( contractName ) } ` ) ;
2743 const { confirm } = await prompt . ask ( {
@@ -35,13 +51,25 @@ const deployUpgradeAll: DeployFunction = async (hre: HardhatRuntimeEnvironment)
3551 }
3652 print . info ( `Upgrading ${ contractName } ...` ) ;
3753
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+ }
4573 print . info ( `Verifying ${ contractName } on Etherscan...` ) ;
4674 await hre . run ( "etherscan-verify" , { contractName : `${ contractName } _Implementation` } ) ;
4775 } catch ( err ) {
0 commit comments