1
1
import assert from 'assert'
2
-
3
2
import { type DeployFunction } from 'hardhat-deploy/types'
4
3
5
4
const feeBps = 10 ;
6
5
7
6
const networkAddresses = {
8
- arbitrumSepolia :{
9
- "owner" : "0xfcB068B43AB08aA9210F52eabd261A7a3b0C8357" ,
10
- "bridger" : "0xfcB068B43AB08aA9210F52eabd261A7a3b0C8357" ,
11
- "ethx" : "0x52312ea29135A468417F0C71d6A75CfEA75351b7" ,
12
- "ethxOracle" : "0x2b700f8b3F03798e7Db0e67a5aB48c12D10046DE"
13
- } ,
14
-
15
- arbitrum :{
16
- "owner" : "0xe85F0d083D0CD18485E531c1A8B8a05ad2C0308f" ,
17
- "bridger" : "0xc6160F5bC3C673AC390f11c492E8ED0d0693579A" ,
18
- "ethx" : "0xED65C5085a18Fa160Af0313E60dcc7905E944Dc7" ,
19
- "ethxOracle" : "0xB4AC4078DDA43d0eB6Bb9e08b8C12A73f9FEAA7d"
7
+ arbitrumsepolia : {
8
+ owner : "0xfcB068B43AB08aA9210F52eabd261A7a3b0C8357" ,
9
+ manager : "0xfcB068B43AB08aA9210F52eabd261A7a3b0C8357" ,
10
+ ethx : "0x52312ea29135A468417F0C71d6A75CfEA75351b7" ,
11
+ ethxOracle : "0x2b700f8b3F03798e7Db0e67a5aB48c12D10046DE"
12
+ } ,
13
+ arbitrumone : {
14
+ owner : "0xe85F0d083D0CD18485E531c1A8B8a05ad2C0308f" ,
15
+ manager : "0xc6160F5bC3C673AC390f11c492E8ED0d0693579A" ,
16
+ ethx : "0xED65C5085a18Fa160Af0313E60dcc7905E944Dc7" ,
17
+ ethxOracle : "0xB4AC4078DDA43d0eB6Bb9e08b8C12A73f9FEAA7d"
20
18
}
21
19
}
22
20
23
21
const deployETHxPool : DeployFunction = async ( hre ) => {
24
22
const { getNamedAccounts, deployments } = hre
25
-
26
23
const { deploy } = deployments
27
24
const { deployer } = await getNamedAccounts ( )
28
25
@@ -31,24 +28,35 @@ const deployETHxPool: DeployFunction = async (hre) => {
31
28
console . log ( `Network: ${ hre . network . name } ` )
32
29
console . log ( `Deployer: ${ deployer } ` )
33
30
34
- const { arbitrumSepolia } = networkAddresses
31
+ const networkName = hre . network . name . toLowerCase ( )
32
+ const networkConfig = networkAddresses [ networkName ]
33
+ console . log ( networkConfig ) ;
35
34
35
+
36
+ assert ( networkConfig , `No network configuration found for ${ networkName } ` )
37
+
36
38
const ethxPool = await deploy ( "ETHxPoolV1" , {
37
39
from : deployer ,
38
40
contract : "ETHxPoolV1" ,
39
41
proxy : {
40
- owner : arbitrumSepolia . owner ,
41
- proxyContract : "OpenZeppelinTransparentProxy" ,
42
- execute : {
43
- methodName : "initialize" ,
44
- args : [ arbitrumSepolia . owner , arbitrumSepolia . bridger , arbitrumSepolia . ethx , feeBps , arbitrumSepolia . ethxOracle ] ,
45
- } ,
42
+ owner : networkConfig . owner ,
43
+ proxyContract : "OpenZeppelinTransparentProxy" ,
44
+ execute : {
45
+ methodName : "initialize" ,
46
+ args : [
47
+ networkConfig . owner ,
48
+ networkConfig . manager ,
49
+ networkConfig . ethx ,
50
+ feeBps ,
51
+ networkConfig . ethxOracle
52
+ ] ,
53
+ } ,
46
54
} ,
47
55
autoMine : true ,
48
56
log : true ,
49
- } ) ;
57
+ } ) ;
50
58
51
- console . log ( `Deployed contract: ${ " ETHxPoolV1" } , network: ${ hre . network . name } , address: ${ ethxPool . address } ` )
59
+ console . log ( `Deployed contract: ETHxPoolV1, network: ${ hre . network . name } , address: ${ ethxPool . address } ` )
52
60
}
53
61
54
62
deployETHxPool . tags = [ "ETHxPoolV1" ]
0 commit comments