@@ -10,8 +10,12 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
1010 const { deploy } = deployments ;
1111 const { deployer } = await ethers . getNamedSigners ( ) ;
1212 const json = await import ( './networks/' + network . name + '.json' ) ;
13- let governor = json . governor ;
14- const guardian = json . guardian ;
13+ let governor ;
14+ let guardian ;
15+ let name ;
16+ name = 'CoreBorrow' ;
17+ governor = json . governor ;
18+ guardian = json . guardian ;
1519 const angleLabs = json . angleLabs ;
1620 let proxyAdmin : string ;
1721
@@ -20,15 +24,22 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
2024 proxyAdmin = CONTRACTS_ADDRESSES [ ChainId . MAINNET ] ?. ProxyAdmin ! ;
2125 } else {
2226 // Otherwise, we're using the proxy admin address from the desired network
23- proxyAdmin = ( await deployments . get ( 'ProxyAdminGuardian ' ) ) . address ;
27+ proxyAdmin = ( await deployments . get ( 'ProxyAdmin ' ) ) . address ;
2428 }
2529
30+ // TODO: uncomment if deploying CoreMerkl
31+
32+ governor = angleLabs ;
33+ name = 'CoreMerkl' ;
34+ proxyAdmin = ( await deployments . get ( 'ProxyAdminGuardian' ) ) . address ;
35+
2636 console . log ( 'Let us get started with deployment' ) ;
2737
28- /*
2938 console . log ( 'Now deploying CoreBorrow' ) ;
3039 console . log ( 'Starting with the implementation' ) ;
3140
41+ // TODO: comment if implementation has already been deployed
42+ /*
3243 await deploy('CoreBorrow_Implementation', {
3344 contract: 'CoreBorrow',
3445 from: deployer.address,
@@ -43,26 +54,24 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
4354
4455 const coreBorrowInterface = CoreBorrow__factory . createInterface ( ) ;
4556
46- governor = angleLabs ;
47-
4857 const dataCoreBorrow = new ethers . Contract (
4958 coreBorrowImplementation ,
5059 coreBorrowInterface ,
5160 ) . interface . encodeFunctionData ( 'initialize' , [ governor , guardian ] ) ;
5261
53- console . log ( ' Now deploying the Proxy' ) ;
62+ console . log ( ` Now deploying the Proxy for ${ name } ` ) ;
5463 console . log ( 'The contract will be initialized with the following governor and guardian addresses' ) ;
5564 console . log ( governor , guardian ) ;
5665
57- await deploy ( 'CoreMerkl' , {
66+ await deploy ( name , {
5867 contract : 'TransparentUpgradeableProxy' ,
5968 from : deployer . address ,
6069 args : [ coreBorrowImplementation , proxyAdmin , dataCoreBorrow ] ,
6170 log : ! argv . ci ,
6271 } ) ;
6372
64- const coreBorrow = ( await deployments . get ( 'CoreMerkl' ) ) . address ;
65- console . log ( `Successfully deployed CoreBorrow at the address ${ coreBorrow } ` ) ;
73+ const coreBorrow = ( await deployments . get ( name ) ) . address ;
74+ console . log ( `Successfully deployed ${ name } at the address ${ coreBorrow } ` ) ;
6675
6776 console . log ( `${ coreBorrow } ${ coreBorrowImplementation } ${ proxyAdmin } ${ dataCoreBorrow } ` ) ;
6877 console . log ( '' ) ;
0 commit comments