@@ -162,7 +162,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
162162 const numWords = 1 ;
163163 const vrfCoordinator = vrfCoordinatorByChain . get ( Number ( await getChainId ( ) ) ) ?? AddressZero ;
164164 // Deploy the VRF Subscription Manager contract on Arbitrum, a mock contract on Hardhat node or nothing on other networks.
165- const vrfSubscriptionManagerDeploy = vrfCoordinator
165+ const vrfSubscriptionManager = vrfCoordinator
166166 ? chainId === HomeChains . HARDHAT
167167 ? await deploy ( "VRFSubscriptionManagerV2Mock" , {
168168 from : deployer ,
@@ -177,14 +177,14 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
177177 : AddressZero ;
178178
179179 // Execute the setup transactions for using VRF and deploy the Consumer contract on Hardhat node
180- if ( vrfSubscriptionManagerDeploy ) {
180+ if ( vrfSubscriptionManager ) {
181181 if ( chainId === HomeChains . HARDHAT ) {
182- const vrfSubscriptionManager = ( await hre . ethers . getContract (
182+ const vrfSubscriptionManagerContract = ( await hre . ethers . getContract (
183183 "VRFSubscriptionManagerV2Mock"
184184 ) ) as VRFSubscriptionManagerV2Mock ;
185- await vrfSubscriptionManager . createNewSubscription ( ) ;
186- await vrfSubscriptionManager . topUpSubscription ( BigNumber . from ( 10 ) . pow ( 20 ) ) ; // 100 LINK
187- const subId = await vrfSubscriptionManager . subscriptionId ( ) ;
185+ await vrfSubscriptionManagerContract . createNewSubscription ( ) ;
186+ await vrfSubscriptionManagerContract . topUpSubscription ( BigNumber . from ( 10 ) . pow ( 20 ) ) ; // 100 LINK
187+ const subId = await vrfSubscriptionManagerContract . subscriptionId ( ) ;
188188 const vrfConsumer = await deploy ( "VRFConsumerV2" , {
189189 from : deployer ,
190190 args : [
@@ -199,9 +199,9 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
199199 ] ,
200200 log : true ,
201201 } ) ;
202- await vrfSubscriptionManager . addConsumer ( vrfConsumer . address ) ;
203- const sortModule = ( await hre . ethers . getContract ( "SortitionModule" ) ) as SortitionModule ;
204- await sortModule . changeRandomNumberGenerator ( vrfConsumer . address , RNG_LOOKAHEAD ) ;
202+ await vrfSubscriptionManagerContract . addConsumer ( vrfConsumer . address ) ;
203+ const sortitionModuleContract = ( await hre . ethers . getContract ( "SortitionModule" ) ) as SortitionModule ;
204+ await sortitionModuleContract . changeRandomNumberGenerator ( vrfConsumer . address , RNG_LOOKAHEAD ) ;
205205 }
206206 }
207207} ;
0 commit comments