@@ -6,7 +6,7 @@ import { changeCurrencyRate } from "./utils/klerosCoreHelper";
66import { HomeChains , isSkipped , isDevnet , PNK , ETH } from "./utils" ;
77import { getContractOrDeploy , getContractOrDeployUpgradable } from "./utils/getContractOrDeploy" ;
88import { deployERC20AndFaucet , deployERC721 } from "./utils/deployTokens" ;
9- import { ChainlinkRNG , DisputeKitClassic , KlerosCoreNeo , RNGWithFallback } from "../typechain-types" ;
9+ import { DisputeKitClassic , KlerosCore , RNGWithFallback } from "../typechain-types" ;
1010
1111const deployArbitration : DeployFunction = async ( hre : HardhatRuntimeEnvironment ) => {
1212 const { ethers, deployments, getNamedAccounts, getChainId } = hre ;
@@ -29,26 +29,25 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
2929 await deployUpgradable ( deployments , "EvidenceModule" , { from : deployer , args : [ deployer ] , log : true } ) ;
3030
3131 const classicDisputeKitID = 1 ; // Classic DK
32- const disputeKit = await deployUpgradable ( deployments , "DisputeKitClassicNeo " , {
32+ const disputeKit = await deployUpgradable ( deployments , "DisputeKitClassic " , {
3333 from : deployer ,
34- contract : "DisputeKitClassic" ,
3534 args : [ deployer , ZeroAddress , weth . target , classicDisputeKitID ] ,
3635 log : true ,
3736 } ) ;
3837
39- let klerosCoreAddress = await deployments . getOrNull ( "KlerosCoreNeo " ) . then ( ( deployment ) => deployment ?. address ) ;
38+ let klerosCoreAddress = await deployments . getOrNull ( "KlerosCore " ) . then ( ( deployment ) => deployment ?. address ) ;
4039 if ( ! klerosCoreAddress ) {
4140 const nonce = await ethers . provider . getTransactionCount ( deployer ) ;
4241 klerosCoreAddress = getContractAddress ( deployer , nonce + 3 ) ; // deployed on the 4th tx (nonce+3): SortitionModule Impl tx, SortitionModule Proxy tx, KlerosCore Impl tx, KlerosCore Proxy tx
43- console . log ( "calculated future KlerosCoreNeo address for nonce %d: %s" , nonce + 3 , klerosCoreAddress ) ;
42+ console . log ( "calculated future KlerosCore address for nonce %d: %s" , nonce + 3 , klerosCoreAddress ) ;
4443 }
4544 const devnet = isDevnet ( hre . network ) ;
4645 const minStakingTime = devnet ? 180 : 1800 ;
4746 const maxFreezingTime = devnet ? 600 : 1800 ;
4847 const rngWithFallback = await ethers . getContract < RNGWithFallback > ( "RNGWithFallback" ) ;
4948 const maxStakePerJuror = PNK ( 2_000 ) ;
5049 const maxTotalStaked = PNK ( 2_000_000 ) ;
51- const sortitionModule = await deployUpgradable ( deployments , "SortitionModuleNeo " , {
50+ const sortitionModule = await deployUpgradable ( deployments , "SortitionModule " , {
5251 from : deployer ,
5352 args : [
5453 deployer ,
@@ -66,7 +65,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
6665 const alpha = 10000 ;
6766 const feeForJuror = ETH ( 0.1 ) ;
6867 const jurorsForCourtJump = 256 ;
69- const klerosCore = await deployUpgradable ( deployments , "KlerosCoreNeo " , {
68+ const klerosCore = await deployUpgradable ( deployments , "KlerosCore " , {
7069 from : deployer ,
7170 args : [
7271 deployer ,
@@ -79,14 +78,14 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
7978 [ 0 , 0 , 0 , 10 ] , // evidencePeriod, commitPeriod, votePeriod, appealPeriod
8079 ethers . toBeHex ( 5 ) , // Extra data for sortition module will return the default value of K
8180 sortitionModule . address ,
82- nft . target ,
8381 weth . target ,
82+ nft . target ,
8483 ] ,
8584 log : true ,
8685 } ) ; // nonce+2 (implementation), nonce+3 (proxy)
8786
8887 // disputeKit.changeCore() only if necessary
89- const disputeKitContract = await hre . ethers . getContract < DisputeKitClassic > ( "DisputeKitClassicNeo " ) ;
88+ const disputeKitContract = await hre . ethers . getContract < DisputeKitClassic > ( "DisputeKitClassic " ) ;
9089 const currentCore = await disputeKitContract . core ( ) ;
9190 if ( currentCore !== klerosCore . address ) {
9291 console . log ( `disputeKit.changeCore(${ klerosCore . address } )` ) ;
@@ -100,7 +99,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
10099 await rngWithFallback . changeConsumer ( sortitionModule . address ) ;
101100 }
102101
103- const core = await hre . ethers . getContract < KlerosCoreNeo > ( "KlerosCoreNeo " ) ;
102+ const core = await hre . ethers . getContract < KlerosCore > ( "KlerosCore " ) ;
104103 try {
105104 await changeCurrencyRate ( core , await weth . getAddress ( ) , true , 1 , 1 ) ;
106105 } catch ( e ) {
@@ -113,12 +112,13 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
113112 log : true ,
114113 } ) ;
115114
116- const resolver = await deploy ( "DisputeResolverNeo " , {
115+ const resolver = await deploy ( "DisputeResolver " , {
117116 from : deployer ,
118- contract : "DisputeResolver" ,
119117 args : [ core . target , disputeTemplateRegistry . target ] ,
120118 log : true ,
121119 } ) ;
120+ console . log ( `core.changeArbitrableWhitelistEnabled(true)` ) ;
121+ await core . changeArbitrableWhitelistEnabled ( true ) ;
122122 console . log ( `core.changeArbitrableWhitelist(${ resolver . address } , true)` ) ;
123123 await core . changeArbitrableWhitelist ( resolver . address , true ) ;
124124
@@ -155,7 +155,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
155155 } ) ;
156156} ;
157157
158- deployArbitration . tags = [ "ArbitrationNeo " ] ;
158+ deployArbitration . tags = [ "ArbitrationMainnet " ] ;
159159deployArbitration . dependencies = [ "ChainlinkRNG" ] ;
160160deployArbitration . skip = async ( { network } ) => {
161161 return isSkipped ( network , ! HomeChains [ network . config . chainId ?? 0 ] ) ;
0 commit comments