1
1
import { HardhatRuntimeEnvironment } from "hardhat/types" ;
2
2
import { DeployFunction } from "hardhat-deploy/types" ;
3
- import { LayeredProxy , RecoverableFuse } from "../types" ;
3
+ import { RecoverableFuse } from "../types" ;
4
4
import { ethers } from "hardhat" ;
5
- import { LibAccessLayers } from "../types/src/LayeredProxy " ;
5
+ import { LibMiddleware } from "../types/src/MiddlewareProxy " ;
6
6
7
7
const func : DeployFunction = async ( hre : HardhatRuntimeEnvironment ) => {
8
8
const { deployments, getNamedAccounts } = hre ;
@@ -11,23 +11,9 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
11
11
const { deployer, owner } = await getNamedAccounts ( ) ;
12
12
13
13
const simpleLayer = await deployments . get ( "RecoverableFuse" ) ;
14
- const simpleLayerContract = ( await ethers . getContractAt (
15
- simpleLayer . abi ,
16
- simpleLayer . address ,
17
- ) ) as RecoverableFuse ;
18
14
19
- let layer : LibAccessLayers . LayerStructStruct = {
20
- layerAddess : simpleLayer . address ,
21
- beforeSig : simpleLayerContract . interface . getSighash (
22
- simpleLayerContract . interface . functions [
23
- "beforeCallValidation(bytes,bytes4,address,uint256,bytes)"
24
- ] ,
25
- ) ,
26
- afterSig : simpleLayerContract . interface . getSighash (
27
- simpleLayerContract . interface . functions [
28
- "afterCallValidation(bytes,bytes4,address,uint256,bytes,bytes)"
29
- ] ,
30
- ) ,
15
+ let layer : LibMiddleware . LayerStructStruct = {
16
+ layerAddress : simpleLayer . address ,
31
17
layerConfigData : ethers . utils . defaultAbiCoder . encode ( [ "uint256" ] , [ 10 ] ) ,
32
18
} ;
33
19
@@ -37,9 +23,9 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
37
23
skipIfAlreadyDeployed : true ,
38
24
} ) ;
39
25
40
- const lp = await deploy ( "LayeredProxy " , {
26
+ const lp = await deploy ( "MiddlewareProxy " , {
41
27
from : deployer ,
42
- args : [ owner , [ layer ] , result . address ] ,
28
+ args : [ [ layer ] , result . address ] ,
43
29
skipIfAlreadyDeployed : true ,
44
30
} ) ;
45
31
} ;
0 commit comments