1
1
import { HardhatRuntimeEnvironment } from "hardhat/types" ;
2
2
import { DeployFunction } from "hardhat-deploy/types" ;
3
- import { LayeredProxy , SampleLayer } from "../types" ;
3
+ import { LayeredProxy , RecoverableFuse } from "../types" ;
4
4
import { ethers } from "hardhat" ;
5
5
import { LibAccessLayers } from "../types/src/LayeredProxy" ;
6
6
@@ -10,11 +10,11 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
10
10
11
11
const { deployer, owner } = await getNamedAccounts ( ) ;
12
12
13
- const simpleLayer = await deployments . get ( "SampleLayer " ) ;
13
+ const simpleLayer = await deployments . get ( "RecoverableFuse " ) ;
14
14
const simpleLayerContract = ( await ethers . getContractAt (
15
15
simpleLayer . abi ,
16
16
simpleLayer . address ,
17
- ) ) as SampleLayer ;
17
+ ) ) as RecoverableFuse ;
18
18
19
19
let layer : LibAccessLayers . LayerStructStruct = {
20
20
layerAddess : simpleLayer . address ,
@@ -28,15 +28,20 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
28
28
"afterCallValidation(bytes,bytes4,address,uint256,bytes,bytes)"
29
29
] ,
30
30
) ,
31
- layerConfigData : "" ,
31
+ layerConfigData : ethers . utils . defaultAbiCoder . encode ( [ "uint256" ] , [ 10 ] ) ,
32
32
} ;
33
33
34
- const result = await deploy ( "LayeredProxy " , {
34
+ const result = await deploy ( "MockERC20 " , {
35
35
from : deployer ,
36
- args : [ owner , [ layer ] ] ,
36
+ args : [ ] ,
37
+ skipIfAlreadyDeployed : true ,
38
+ } ) ;
39
+
40
+ const lp = await deploy ( "LayeredProxy" , {
41
+ from : deployer ,
42
+ args : [ owner , [ layer ] , result . address ] ,
37
43
skipIfAlreadyDeployed : true ,
38
44
} ) ;
39
- console . log ( "deployed at" , result . address ) ;
40
45
} ;
41
46
42
47
export default func ;
0 commit comments