@@ -14,7 +14,6 @@ import 'solidity-docgen';
1414import { cleanupDeployments , copyDeployments } from './scripts/tools/copy-deployments' ;
1515import chainConfig from './utils/config' ;
1616
17- const ZERO_PRIVATE_KEY = '0x0000000000000000000000000000000000000000000000000000000000000000' ;
1817const isNativeChainType = chainConfig . isNativeChain ( ) ;
1918const isLocalFork = process . env . LOCAL_FORK == 'true' ;
2019const isFujiFork = process . env . FUJI_FORK == 'true' ;
@@ -90,6 +89,20 @@ const config: HardhatUserConfig = {
9089 { version : '0.4.11' , settings } , // RLC contracts
9190 ] ,
9291 } ,
92+ namedAccounts : {
93+ deployer : {
94+ default : 0 ,
95+ bellecour : chainConfig . chains [ '134' ] . deployer || 0 ,
96+ arbitrum : chainConfig . chains [ '42161' ] . deployer || 0 ,
97+ arbitrumSepolia : chainConfig . chains [ '421614' ] . deployer || 0 ,
98+ } ,
99+ owner : {
100+ default : 1 ,
101+ bellecour : chainConfig . chains [ '134' ] . owner || 1 ,
102+ arbitrum : chainConfig . chains [ '42161' ] . owner || 1 ,
103+ arbitrumSepolia : chainConfig . chains [ '421614' ] . owner || 1 ,
104+ } ,
105+ } ,
93106 networks : {
94107 hardhat : {
95108 accounts : {
@@ -178,41 +191,29 @@ const config: HardhatUserConfig = {
178191 process . env . FUJI_RPC_URL || // Used in local development
179192 process . env . RPC_URL || // Defined in Github Actions environments
180193 'https://api.avax-test.network/ext/bc/C/rpc' ,
181- accounts : [
182- process . env . DEPLOYER_PRIVATE_KEY || ZERO_PRIVATE_KEY ,
183- process . env . ADMIN_PRIVATE_KEY || ZERO_PRIVATE_KEY ,
184- ] ,
194+ accounts : _getPrivateKeys ( ) ,
185195 ...fujiBaseConfig ,
186196 } ,
187197 arbitrum : {
188198 url :
189199 process . env . ARBITRUM_RPC_URL || // Used in local development
190200 process . env . RPC_URL || // Defined in Github Actions environments
191201 'https://arbitrum.gateway.tenderly.co' ,
192- accounts : [
193- process . env . DEPLOYER_PRIVATE_KEY || ZERO_PRIVATE_KEY ,
194- process . env . ADMIN_PRIVATE_KEY || ZERO_PRIVATE_KEY ,
195- ] ,
202+ accounts : _getPrivateKeys ( ) ,
196203 ...arbitrumBaseConfig ,
197204 } ,
198205 arbitrumSepolia : {
199206 url :
200207 process . env . ARBITRUM_SEPOLIA_RPC_URL || // Used in local development
201208 process . env . RPC_URL || // Defined in Github Actions environments
202209 'https://sepolia-rollup.arbitrum.io/rpc' ,
203- accounts : [
204- process . env . DEPLOYER_PRIVATE_KEY || ZERO_PRIVATE_KEY ,
205- process . env . ADMIN_PRIVATE_KEY || ZERO_PRIVATE_KEY ,
206- ] ,
210+ accounts : _getPrivateKeys ( ) ,
207211 ...arbitrumSepoliaBaseConfig ,
208212 } ,
209213 bellecour : {
210214 chainId : 134 ,
211215 url : 'https://bellecour.iex.ec' ,
212- accounts : [
213- process . env . DEPLOYER_PRIVATE_KEY || ZERO_PRIVATE_KEY ,
214- process . env . ADMIN_PRIVATE_KEY || ZERO_PRIVATE_KEY ,
215- ] ,
216+ accounts : _getPrivateKeys ( ) ,
216217 ...bellecourBaseConfig ,
217218 verify : {
218219 etherscan : {
@@ -365,4 +366,11 @@ task('abis', 'Generate contract ABIs').setAction(async (taskArgs, hre) => {
365366 console . log ( `Saved ${ contracts . length } ABI files to ${ abisDir } folder` ) ;
366367} ) ;
367368
369+ function _getPrivateKeys ( ) {
370+ const ZERO_PRIVATE_KEY = '0x0000000000000000000000000000000000000000000000000000000000000000' ;
371+ const deployerKey = process . env . DEPLOYER_PRIVATE_KEY || ZERO_PRIVATE_KEY ;
372+ const adminKey = process . env . ADMIN_PRIVATE_KEY || ZERO_PRIVATE_KEY ;
373+ return [ deployerKey , adminKey ] ;
374+ }
375+
368376export default config ;
0 commit comments