@@ -2,32 +2,44 @@ import { HardhatRuntimeEnvironment } from "hardhat/types";
22import { DeployFunction } from "hardhat-deploy/types" ;
33import { HomeChains , isSkipped } from "./utils" ;
44import { EscrowUniversal } from "../typechain-types" ;
5+ import { getContracts } from "./utils/getContracts" ;
6+
7+ const config = {
8+ arbitrumSepoliaDevnet : {
9+ feeTimeout : 600 , // 10 minutes
10+ settlementTimeout : 600 , // 10 minutes
11+ jurors : 1 ,
12+ courtId : 1 ,
13+ } ,
14+ arbitrum : {
15+ feeTimeout : 302400 , // 84 hours
16+ settlementTimeout : 172800 , // 48 hours
17+ jurors : 3 ,
18+ courtId : 1 ,
19+ } ,
20+ } ;
521
622const deploy : DeployFunction = async ( hre : HardhatRuntimeEnvironment ) => {
7- const { deployments, getNamedAccounts, getChainId, ethers } = hre ;
23+ const { deployments, getNamedAccounts, getChainId, ethers, network } = hre ;
824 const { deploy } = deployments ;
925
1026 // fallback to hardhat node signers on local network
1127 const deployer = ( await getNamedAccounts ( ) ) . deployer ?? ( await hre . ethers . getSigners ( ) ) [ 0 ] . address ;
1228 const chainId = Number ( await getChainId ( ) ) ;
1329 console . log ( "deploying to %s with deployer %s" , HomeChains [ chainId ] , deployer ) ;
1430
15- const klerosCore = await deployments . get ( "KlerosCore" ) ;
16- const disputeTemplateRegistry = await deployments . get ( "DisputeTemplateRegistry" ) ;
17- const feeTimeout = 600 ; // 10 minutes
18- const settlementTimeout = 600 ; // 10 minutes
19-
20- // General court, 3 jurors
21- const extraData = ethers . AbiCoder . defaultAbiCoder ( ) . encode ( [ "uint96" , "uint96" ] , [ 1 , 3 ] ) ;
31+ const { disputeTemplateRegistry, klerosCore } = await getContracts ( hre ) ;
32+ const { feeTimeout, settlementTimeout, jurors, courtId } = config [ network . name ] ;
33+ const extraData = ethers . AbiCoder . defaultAbiCoder ( ) . encode ( [ "uint96" , "uint96" ] , [ courtId , jurors ] ) ;
2234
2335 await deploy ( "EscrowUniversal" , {
2436 from : deployer ,
2537 args : [
26- klerosCore . address ,
38+ klerosCore . target ,
2739 extraData ,
2840 "" , // configured in the next step by setDisputeTemplate
2941 "" , // configured in the next step by setDisputeTemplate
30- disputeTemplateRegistry . address ,
42+ disputeTemplateRegistry . target ,
3143 feeTimeout ,
3244 settlementTimeout ,
3345 ] ,
@@ -54,7 +66,6 @@ const deploy: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
5466 gasLimit : 50000000 ,
5567 log : true ,
5668 } ) ;
57-
5869} ;
5970
6071deploy . tags = [ "Escrow" ] ;
0 commit comments