Skip to content

Commit 406c10b

Browse files
committed
refactor: sepolia arbitrum enhance proxy owner signer logic and encapsulate constant function removal for
1 parent 09ff593 commit 406c10b

File tree

1 file changed

+26
-22
lines changed

1 file changed

+26
-22
lines changed

scripts/upgrades/accessors/deploy-and-update-accessor-facet.ts

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import { printFunctions } from '../upgrade-helper';
3939

4040
// Use impersonated signer only for fork testing, otherwise use account signer
4141
const proxyOwnerSigner =
42-
process.env.ARBITRUM_FORK === 'true'
42+
process.env.ARBITRUM_FORK === 'true' || process.env.ARBITRUM_SEPOLIA_FORK === 'true'
4343
? await ethers.getImpersonatedSigner(proxyOwnerAddress)
4444
: account;
4545
const diamondProxyAsOwner = DiamondCutFacet__factory.connect(
@@ -73,27 +73,31 @@ import { printFunctions } from '../upgrade-helper';
7373
await printFunctions(diamondProxyAddress);
7474

7575
const removalCuts: IDiamond.FacetCutStruct[] = [];
76-
const constantFunctionSignatures = [
77-
'CONTRIBUTION_DEADLINE_RATIO()',
78-
'FINAL_DEADLINE_RATIO()',
79-
'GROUPMEMBER_PURPOSE()',
80-
'KITTY_ADDRESS()',
81-
'KITTY_MIN()',
82-
'KITTY_RATIO()',
83-
'REVEAL_DEADLINE_RATIO()',
84-
'WORKERPOOL_STAKE_RATIO()',
85-
];
86-
const constantFunctionsToRemove = constantFunctionSignatures.map((sig) =>
87-
ethers.id(sig).slice(0, 10),
88-
);
89-
console.log(
90-
`Removing specific constant functions from diamond Proxy - will remove ${constantFunctionsToRemove.length} specific constant functions`,
91-
);
92-
removalCuts.push({
93-
facetAddress: ZeroAddress,
94-
action: FacetCutAction.Remove,
95-
functionSelectors: constantFunctionsToRemove,
96-
});
76+
77+
// constant functions are deployed within IexecAccessorsFacet on arbitrum sepolia
78+
if (process.env.ARBITRUM_FORK === 'true' || chainId == 42161n) {
79+
const constantFunctionSignatures = [
80+
'CONTRIBUTION_DEADLINE_RATIO()',
81+
'FINAL_DEADLINE_RATIO()',
82+
'GROUPMEMBER_PURPOSE()',
83+
'KITTY_ADDRESS()',
84+
'KITTY_MIN()',
85+
'KITTY_RATIO()',
86+
'REVEAL_DEADLINE_RATIO()',
87+
'WORKERPOOL_STAKE_RATIO()',
88+
];
89+
const constantFunctionsToRemove = constantFunctionSignatures.map((sig) =>
90+
ethers.id(sig).slice(0, 10),
91+
);
92+
console.log(
93+
`Removing specific constant functions from diamond Proxy - will remove ${constantFunctionsToRemove.length} specific constant functions`,
94+
);
95+
removalCuts.push({
96+
facetAddress: ZeroAddress,
97+
action: FacetCutAction.Remove,
98+
functionSelectors: constantFunctionsToRemove,
99+
});
100+
}
97101

98102
const oldAccessorFacets = [
99103
'0xEa232be31ab0112916505Aeb7A2a94b5571DCc6b', //IexecAccessorsFacet

0 commit comments

Comments
 (0)