@@ -151,7 +151,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
151151 const numWords = 1 ;
152152 const vrfCoordinator = vrfCoordinatorByChain . get ( Number ( await getChainId ( ) ) ) ?? AddressZero ;
153153 // Deploy the VRF Subscription Manager contract on Arbitrum, a mock contract on Hardhat node or nothing on other networks.
154- const vrfSubscriptionManagerDeploy = vrfCoordinator
154+ const vrfSubscriptionManager = vrfCoordinator
155155 ? chainId === HomeChains . HARDHAT
156156 ? await deploy ( "VRFSubscriptionManagerV2Mock" , {
157157 from : deployer ,
@@ -166,14 +166,14 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
166166 : AddressZero ;
167167
168168 // Execute the setup transactions for using VRF and deploy the Consumer contract on Hardhat node
169- if ( vrfSubscriptionManagerDeploy ) {
169+ if ( vrfSubscriptionManager ) {
170170 if ( chainId === HomeChains . HARDHAT ) {
171- const vrfSubscriptionManager = ( await hre . ethers . getContract (
171+ const vrfSubscriptionManagerContract = ( await hre . ethers . getContract (
172172 "VRFSubscriptionManagerV2Mock"
173173 ) ) as VRFSubscriptionManagerV2Mock ;
174- await vrfSubscriptionManager . createNewSubscription ( ) ;
175- await vrfSubscriptionManager . topUpSubscription ( BigNumber . from ( 10 ) . pow ( 20 ) ) ; // 100 LINK
176- const subId = await vrfSubscriptionManager . subscriptionId ( ) ;
174+ await vrfSubscriptionManagerContract . createNewSubscription ( ) ;
175+ await vrfSubscriptionManagerContract . topUpSubscription ( BigNumber . from ( 10 ) . pow ( 20 ) ) ; // 100 LINK
176+ const subId = await vrfSubscriptionManagerContract . subscriptionId ( ) ;
177177 const vrfConsumer = await deploy ( "VRFConsumerV2" , {
178178 from : deployer ,
179179 args : [
@@ -188,9 +188,9 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
188188 ] ,
189189 log : true ,
190190 } ) ;
191- await vrfSubscriptionManager . addConsumer ( vrfConsumer . address ) ;
192- const sortModule = ( await hre . ethers . getContract ( "SortitionModule" ) ) as SortitionModule ;
193- await sortModule . changeRandomNumberGenerator ( vrfConsumer . address , RNG_LOOKAHEAD ) ;
191+ await vrfSubscriptionManagerContract . addConsumer ( vrfConsumer . address ) ;
192+ const sortitionModuleContract = ( await hre . ethers . getContract ( "SortitionModule" ) ) as SortitionModule ;
193+ await sortitionModuleContract . changeRandomNumberGenerator ( vrfConsumer . address , RNG_LOOKAHEAD ) ;
194194 }
195195 }
196196} ;
0 commit comments