@@ -4,36 +4,21 @@ import { deployUpgradable } from "./utils/deployUpgradable";
44import { HomeChains , isSkipped } from "./utils" ;
55
66const deployUpgradeKlerosCore : DeployFunction = async ( hre : HardhatRuntimeEnvironment ) => {
7- const { ethers, deployments, getNamedAccounts, getChainId } = hre ;
8- const { ZeroAddress } = hre . ethers ;
7+ const { deployments, getNamedAccounts, getChainId } = hre ;
98
109 // fallback to hardhat node signers on local network
1110 const deployer = ( await getNamedAccounts ( ) ) . deployer ?? ( await hre . ethers . getSigners ( ) ) [ 0 ] . address ;
1211 const chainId = Number ( await getChainId ( ) ) ;
13- console . log ( "upgrading to %s with deployer %s" , HomeChains [ chainId ] , deployer ) ;
12+ console . log ( "upgrading on %s with deployer %s" , HomeChains [ chainId ] , deployer ) ;
1413
1514 try {
16- const pnk = await deployments . get ( "PNK" ) ;
17- const disputeKit = await deployments . get ( "DisputeKitClassic" ) ;
18- const minStake = 2n * 10n ** 20n ;
19- const alpha = 10000 ;
20- const feeForJuror = 10n * 17n ;
21- const sortitionModule = await deployments . get ( "SortitionModule" ) ;
22-
23- console . log ( "upgrading the KlerosCore..." ) ;
24- await deployUpgradable ( deployments , "KlerosCore" , {
15+ console . log ( "upgrading KlerosCoreNeo..." ) ;
16+ await deployUpgradable ( deployments , "KlerosCoreNeo" , {
17+ newImplementation : "KlerosCoreNeo" ,
18+ initializer : "initialize" ,
2519 from : deployer ,
26- args : [
27- deployer ,
28- pnk ,
29- ZeroAddress ,
30- disputeKit . address ,
31- false ,
32- [ minStake , alpha , feeForJuror , 256 ] , // minStake, alpha, feeForJuror, jurorsForCourtJump
33- [ 0 , 0 , 0 , 10 ] , // evidencePeriod, commitPeriod, votePeriod, appealPeriod
34- ethers . toBeHex ( 5 ) , // Extra data for sortition module will return the default value of K
35- sortitionModule . address ,
36- ] ,
20+ // Warning: do not reinitialize everything, only the new variables
21+ args : [ ] ,
3722 } ) ;
3823 } catch ( err ) {
3924 console . error ( err ) ;
0 commit comments