Closed tim-becker closed 9 months ago
For context, we need this because many of our scripts (which run via hardhat run
) need to access contracts from multiple networks at once
Hi @wighawag, is there any chance of getting this merged?
Included in v0.11.45 Thanks!
Currently the
companionNetworks
are only initialized during thedeploy
task, making them unusable in other tasks (such astest
,run
,console
, etc.)This PR moves the companion network initialization to the
extendEnvironment
call, so it applies to all tasks. This required making theinitCompanionNetworks
function synchronous, which is doable by using hardhat'sLazyInitializationProviderAdapter
to construct the companion network providers.Unfortunately this new dependency in ethers throws errors with the current
tsconfig.json
of this project, so this also modifies thetsconfig.json
to silence those errors. Otherwise, runningtsc
fails with