File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -62,8 +62,10 @@ const networkConfigs: NetworkConfig[] = [
62
62
{ network : 'kovan' , chainId : 42 } ,
63
63
]
64
64
65
- function getAccountMnemonic ( ) {
66
- return process . env . MNEMONIC || ''
65
+ function getAccountsKeys ( ) {
66
+ if ( process . env . MNEMONIC ) return { mnemonic : process . env . MNEMONIC }
67
+ if ( process . env . PRIVATE_KEY ) return [ process . env . PRIVATE_KEY ]
68
+ return 'remote'
67
69
}
68
70
69
71
function getDefaultProviderURL ( network : string ) {
@@ -77,9 +79,7 @@ function setupNetworkProviders(hardhatConfig) {
77
79
url : netConfig . url ? netConfig . url : getDefaultProviderURL ( netConfig . network ) ,
78
80
gas : netConfig . gas || 'auto' ,
79
81
gasPrice : netConfig . gasPrice || 'auto' ,
80
- accounts : {
81
- mnemonic : getAccountMnemonic ( ) ,
82
- } ,
82
+ accounts : getAccountsKeys ( ) ,
83
83
}
84
84
}
85
85
}
@@ -135,9 +135,8 @@ const config: HardhatUserConfig = {
135
135
hardfork : 'london' ,
136
136
} ,
137
137
localhost : {
138
- accounts : {
139
- mnemonic : DEFAULT_TEST_MNEMONIC ,
140
- } ,
138
+ accounts :
139
+ process . env . FORK === 'true' ? getAccountsKeys ( ) : { mnemonic : DEFAULT_TEST_MNEMONIC } ,
141
140
} ,
142
141
} ,
143
142
etherscan : {
You can’t perform that action at this time.
0 commit comments