Skip to content

Commit 64bfac3

Browse files
committed
feat: update changelog and refactor encodeModuleProxyUpdate function in upgrade-helper
1 parent c69de7d commit 64bfac3

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## vNEXT
44

55
- Migrate proxy to Diamond pattern (ERC-2535):
6+
- Fix script folder (#235)
67
- Format all solidity files (#233)
78
- Rename ERC1538 architure to diamond Proxy architecture(#226, #229, #230, #234)
89
- Remove ENS module (#225)

scripts/upgrades/upgrade-helper.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
11
// SPDX-FileCopyrightText: 2024-2025 IEXEC BLOCKCHAIN TECH <[email protected]>
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import { Interface, ZeroAddress } from 'ethers';
4+
import { ContractFactory, ZeroAddress } from 'ethers';
55
import { ethers } from 'hardhat';
66
import { FacetCutAction } from 'hardhat-deploy/dist/types';
77
import { DiamondCutFacet__factory, DiamondLoupeFacet__factory } from '../../typechain';
8+
import { getFunctionSelectors } from '../../utils/proxy-tools';
89

9-
function encodeModuleProxyUpdate(ModuleInterface: Interface, moduleAddress: string) {
10-
// Get function selectors from the interface
11-
const functionSelectors: string[] = [];
12-
ModuleInterface.forEachFunction((functionFragment) => {
13-
const func = functionFragment.format();
14-
console.log(`- ${func}`);
15-
const selector = ModuleInterface.getFunction(functionFragment.name)?.selector;
16-
if (selector) {
17-
functionSelectors.push(selector);
18-
}
19-
});
10+
function encodeModuleProxyUpdate(contractFactory: ContractFactory, moduleAddress: string) {
11+
// Get function selectors from the contract factory
12+
const functionSelectors = getFunctionSelectors(contractFactory);
2013

2114
// Create FacetCut for adding the module
2215
const facetCut = {

0 commit comments

Comments
 (0)