Skip to content

Commit 772c460

Browse files
committed
cli: add function to expose accounts and provider in the console
1 parent b154330 commit 772c460

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

cli/defaults.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Options } from 'yargs'
2-
import { Overrides } from 'ethers'
2+
import { Overrides, utils } from 'ethers'
33

44
export const local = {
55
mnemonic: 'myth like bonus scare over problem client lizard pioneer submit female collect',
@@ -8,6 +8,7 @@ export const local = {
88
graphConfigPath: './graph.config.yml',
99
accountNumber: '0',
1010
}
11+
1112
export const defaultOverrides: Overrides = {
1213
// gasPrice: utils.parseUnits('25', 'gwei'), // auto
1314
// gasLimit: 2000000, // auto

cli/env.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const loadEnv = async (argv: CLIArgs, wallet?: Wallet): Promise<CLIEnviro
4949
logger.info(
5050
`Connected Wallet: address=${walletAddress} nonce=${nonce} balance=${formatEther(balance)}\n`,
5151
)
52-
logger.info('Gas settings:', displayGasOverrides(), '\n')
52+
logger.info(`Gas settings: ${JSON.stringify(displayGasOverrides())}`)
5353

5454
return {
5555
balance,

tasks/gre.ts

+4
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,8 @@ extendEnvironment((hre: HardhatRuntimeEnvironment) => {
4141

4242
return contracts
4343
})
44+
hre['provider'] = lazyObject(() => hre.ethers.provider)
45+
hre['accounts'] = function () {
46+
return hre.ethers.getSigners()
47+
}
4448
})

0 commit comments

Comments
 (0)