Skip to content

Commit 637224b

Browse files
committed
update poc with ERC terminology
1 parent 9df1a8a commit 637224b

13 files changed

+7345
-5569
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -273,4 +273,5 @@ build/
273273
types/typechain
274274
bin/
275275

276-
abi/
276+
abi/
277+
types/

deploy/layered_proxy.ts

+6-20
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { HardhatRuntimeEnvironment } from "hardhat/types";
22
import { DeployFunction } from "hardhat-deploy/types";
3-
import { LayeredProxy, RecoverableFuse } from "../types";
3+
import { RecoverableFuse } from "../types";
44
import { ethers } from "hardhat";
5-
import { LibAccessLayers } from "../types/src/LayeredProxy";
5+
import { LibMiddleware } from "../types/src/MiddlewareProxy";
66

77
const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
88
const { deployments, getNamedAccounts } = hre;
@@ -11,23 +11,9 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
1111
const { deployer, owner } = await getNamedAccounts();
1212

1313
const simpleLayer = await deployments.get("RecoverableFuse");
14-
const simpleLayerContract = (await ethers.getContractAt(
15-
simpleLayer.abi,
16-
simpleLayer.address,
17-
)) as RecoverableFuse;
1814

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,
3117
layerConfigData: ethers.utils.defaultAbiCoder.encode(["uint256"], [10]),
3218
};
3319

@@ -37,9 +23,9 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
3723
skipIfAlreadyDeployed: true,
3824
});
3925

40-
const lp = await deploy("LayeredProxy", {
26+
const lp = await deploy("MiddlewareProxy", {
4127
from: deployer,
42-
args: [owner, [layer], result.address],
28+
args: [[layer], result.address],
4329
skipIfAlreadyDeployed: true,
4430
});
4531
};

0 commit comments

Comments
 (0)