Skip to content

Commit b3e970f

Browse files
committed
chore: Update upgrade script to v6.2.0 and implement Solidity v8 migration
1 parent 55729ad commit b3e970f

File tree

3 files changed

+247
-4
lines changed

3 files changed

+247
-4
lines changed

.github/workflows/upgrade-facets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
contents: write # Required to commit artifacts.
3434
pull-requests: write # Required to create pull requests.
3535
env:
36-
UPGRADE_SCRIPT: 'v6.1.0-bulk-processing.ts' # Update this for each specific upgrade.
36+
UPGRADE_SCRIPT: 'v6.2.0.ts' # Update this for each specific upgrade.
3737
COMMIT_MESSAGE: 'chore: Save upgrade artifacts - ${{ inputs.network }} (runId:${{ github.run_id }})'
3838
GHA_BOT_NAME: 'GitHub Actions Bot'
3939
GHA_BOT_EMAIL: 'github-actions[bot]@users.noreply.github.com'

scripts/upgrades/v6.2.0.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Upgrade v6.2.0 - Solidity v8 Migration
2+
3+
- **Date**: TBD
4+
- **Git tag**: [v6.2.0](https://github.com/iExecBlockchainComputing/PoCo/releases/tag/v6.2.0)
5+
- **Upgrade script**: `./v6.2.0.ts`
6+
- **Upgrade GitHub Action run**:
7+
- **Testnet**: [run id](https://github.com/iExecBlockchainComputing/PoCo/actions/runs/<runId>)
8+
- **Mainnet**: [run id](https://github.com/iExecBlockchainComputing/PoCo/actions/runs/<runId>)
9+
10+
## Summary of changes
11+
12+
- Migrate all facets from Solidity v6 to Solidity v8
13+
- Remove IexecERC20Facet (address: `0xB0152eC6f48E64a92B66D4736aFA1b02d8D45169`)
14+
- Deploy new Solidity v8 versions of all facets:
15+
- IexecAccessorsABILegacyFacet
16+
- IexecCategoryManagerFacet
17+
- IexecConfigurationExtraFacet
18+
- IexecConfigurationFacet
19+
- IexecEscrowTokenFacet
20+
- IexecOrderManagementFacet
21+
- IexecPoco1Facet
22+
- IexecPoco2Facet
23+
- IexecPocoAccessorsFacet
24+
- IexecRelayFacet
25+
26+
## Deployment logs
27+
28+
### Arbitrum Sepolia
29+
30+
```
31+
TODO
32+
```
33+
34+
### Arbitrum Mainnet
35+
36+
```
37+
TODO
38+
```

scripts/upgrades/v6.2.0.ts

Lines changed: 208 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,208 @@
1-
// NOTE: The IexecERC20Facet__factory has been removed.
2-
// Remember to manually remove the corresponding facet - contract address is:
3-
// 0xB0152eC6f48E64a92B66D4736aFA1b02d8D45169
1+
// SPDX-FileCopyrightText: 2025 IEXEC BLOCKCHAIN TECH <[email protected]>
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
import {
5+
IexecAccessorsABILegacyFacet__factory,
6+
IexecCategoryManagerFacet__factory,
7+
IexecConfigurationExtraFacet__factory,
8+
IexecConfigurationFacet__factory,
9+
IexecEscrowNativeFacet__factory,
10+
IexecEscrowTokenFacet__factory,
11+
IexecOrderManagementFacet__factory,
12+
IexecPoco1Facet__factory,
13+
IexecPoco2Facet__factory,
14+
IexecPocoAccessorsFacet__factory,
15+
IexecRelayFacet__factory,
16+
} from '../../typechain';
17+
import { getChainConfig, isNativeChain } from '../../utils/config';
18+
import {
19+
FacetDetails,
20+
deployFacets,
21+
getUpgradeContext,
22+
linkFacetsToDiamond,
23+
printOnchainDiamondDescription,
24+
removeDanglingFacetDeploymentArtifacts,
25+
removeFacetsFromDiamond,
26+
saveOnchainDiamondDescription,
27+
} from '../../utils/proxy-tools';
28+
import { tryVerify } from '../verify';
29+
30+
async function main() {
31+
console.log('Performing Solidity v8 migration upgrade (v6.2.0)...');
32+
const { chainId, networkName, deployer, proxyOwner, proxyAddress, iexecLibOrders } =
33+
await getUpgradeContext();
34+
35+
// Determine if this is a native or token chain
36+
const chainConfig = getChainConfig(chainId);
37+
const isNative = isNativeChain(chainConfig);
38+
39+
// Define all facets to remove (all existing facets except core diamond facets)
40+
const facetAddressesPerChain: { [key: string]: { [key: string]: string } } = {
41+
// Arbitrum Sepolia
42+
'421614': {
43+
IexecAccessorsABILegacyFacet: '0x56CDC32332648b1220a89172191798852706EB35',
44+
IexecCategoryManagerFacet: '0x5f0483b9D7f959816A5CDD4C49E5C91C24561B43',
45+
IexecConfigurationExtraFacet: '0x7Ff117E7385Ac3E207AF1791fE7e66C7802aeCCd',
46+
IexecConfigurationFacet: '0x88eb05e62434057d3AA9e41FdaF7300A586b314D',
47+
IexecERC20Facet: '0xB0152eC6f48E64a92B66D4736aFA1b02d8D45169', // Removed from codebase
48+
IexecEscrowTokenFacet: '0xd9EB17A161581FBBAD2Ae998c0C19746EaAD0D6E',
49+
IexecOrderManagementFacet: '0x541d532E6C195Ba044a75325F367342f523627fB',
50+
IexecPoco1Facet: '0xC8dE3913fcdBC576970dCe24eE416CA25681f65f',
51+
IexecPoco2Facet: '0x5c7B589E6807B554ed278f335215B93bCB692162',
52+
IexecPocoAccessorsFacet: '0x56625089E6EB6F058DB163025318575AD38781fa',
53+
IexecRelayFacet: '0x8cBf58265F74b77f0D9cCA9f7e14685205496d8f',
54+
},
55+
// Arbitrum Mainnet
56+
'42161': {
57+
IexecAccessorsABILegacyFacet: '0x56CDC32332648b1220a89172191798852706EB35',
58+
IexecCategoryManagerFacet: '0x5f0483b9D7f959816A5CDD4C49E5C91C24561B43',
59+
IexecConfigurationExtraFacet: '0x7Ff117E7385Ac3E207AF1791fE7e66C7802aeCCd',
60+
IexecConfigurationFacet: '0x88eb05e62434057d3AA9e41FdaF7300A586b314D',
61+
IexecERC20Facet: '0xB0152eC6f48E64a92B66D4736aFA1b02d8D45169', // Removed from codebase
62+
IexecEscrowTokenFacet: '0xd9EB17A161581FBBAD2Ae998c0C19746EaAD0D6E',
63+
IexecOrderManagementFacet: '0x541d532E6C195Ba044a75325F367342f523627fB',
64+
IexecPoco1Facet: '0x5331c0FC7DD0Cc08047B546675cd1d6d47152AEb',
65+
IexecPoco2Facet: '0x5c7B589E6807B554ed278f335215B93bCB692162',
66+
IexecPocoAccessorsFacet: '0x9BCaCA06d5173f4bA02F8ECcb28E227333F1606F',
67+
IexecRelayFacet: '0x8cBf58265F74b77f0D9cCA9f7e14685205496d8f',
68+
},
69+
};
70+
71+
const chainIdStr = chainId.toString();
72+
const addresses = facetAddressesPerChain[chainIdStr];
73+
if (!addresses) {
74+
throw new Error(`No facet addresses defined for chain ID ${chainId}`);
75+
}
76+
77+
// Build list of facets to remove
78+
const facetsToRemove: FacetDetails[] = [
79+
{
80+
name: 'IexecAccessorsABILegacyFacet',
81+
address: addresses['IexecAccessorsABILegacyFacet'],
82+
factory: null,
83+
},
84+
{
85+
name: 'IexecCategoryManagerFacet',
86+
address: addresses['IexecCategoryManagerFacet'],
87+
factory: null,
88+
},
89+
{
90+
name: 'IexecConfigurationExtraFacet',
91+
address: addresses['IexecConfigurationExtraFacet'],
92+
factory: null,
93+
},
94+
{
95+
name: 'IexecConfigurationFacet',
96+
address: addresses['IexecConfigurationFacet'],
97+
factory: null,
98+
},
99+
{
100+
name: 'IexecERC20Facet',
101+
address: addresses['IexecERC20Facet'],
102+
factory: null,
103+
},
104+
{
105+
name: isNative ? 'IexecEscrowNativeFacet' : 'IexecEscrowTokenFacet',
106+
address: addresses['IexecEscrowTokenFacet'], // Both chains use token mode
107+
factory: null,
108+
},
109+
{
110+
name: 'IexecOrderManagementFacet',
111+
address: addresses['IexecOrderManagementFacet'],
112+
factory: null,
113+
},
114+
{
115+
name: 'IexecPoco1Facet',
116+
address: addresses['IexecPoco1Facet'],
117+
factory: null,
118+
},
119+
{
120+
name: 'IexecPoco2Facet',
121+
address: addresses['IexecPoco2Facet'],
122+
factory: null,
123+
},
124+
{
125+
name: 'IexecPocoAccessorsFacet',
126+
address: addresses['IexecPocoAccessorsFacet'],
127+
factory: null,
128+
},
129+
{
130+
name: 'IexecRelayFacet',
131+
address: addresses['IexecRelayFacet'],
132+
factory: null,
133+
},
134+
];
135+
136+
// Build list of facets to add (all with Solidity v8)
137+
const facetsToAdd: FacetDetails[] = [
138+
{
139+
name: 'IexecAccessorsABILegacyFacet',
140+
address: null,
141+
factory: new IexecAccessorsABILegacyFacet__factory(),
142+
},
143+
{
144+
name: 'IexecCategoryManagerFacet',
145+
address: null,
146+
factory: new IexecCategoryManagerFacet__factory(),
147+
},
148+
{
149+
name: 'IexecConfigurationExtraFacet',
150+
address: null,
151+
factory: new IexecConfigurationExtraFacet__factory(),
152+
},
153+
{
154+
name: 'IexecConfigurationFacet',
155+
address: null,
156+
factory: new IexecConfigurationFacet__factory(iexecLibOrders),
157+
},
158+
{
159+
name: isNative ? 'IexecEscrowNativeFacet' : 'IexecEscrowTokenFacet',
160+
address: null,
161+
factory: isNative
162+
? new IexecEscrowNativeFacet__factory()
163+
: new IexecEscrowTokenFacet__factory(),
164+
},
165+
{
166+
name: 'IexecOrderManagementFacet',
167+
address: null,
168+
factory: new IexecOrderManagementFacet__factory(iexecLibOrders),
169+
},
170+
{
171+
name: 'IexecPoco1Facet',
172+
address: null,
173+
factory: new IexecPoco1Facet__factory(iexecLibOrders),
174+
},
175+
{
176+
name: 'IexecPoco2Facet',
177+
address: null,
178+
factory: new IexecPoco2Facet__factory(),
179+
},
180+
{
181+
name: 'IexecPocoAccessorsFacet',
182+
address: null,
183+
factory: new IexecPocoAccessorsFacet__factory(iexecLibOrders),
184+
},
185+
{
186+
name: 'IexecRelayFacet',
187+
address: null,
188+
factory: new IexecRelayFacet__factory(),
189+
},
190+
];
191+
192+
await printOnchainDiamondDescription(proxyAddress);
193+
await deployFacets(deployer, chainId, facetsToAdd);
194+
await removeFacetsFromDiamond(proxyAddress, proxyOwner, facetsToRemove);
195+
await printOnchainDiamondDescription(proxyAddress);
196+
await linkFacetsToDiamond(proxyAddress, proxyOwner, facetsToAdd);
197+
await printOnchainDiamondDescription(proxyAddress);
198+
await saveOnchainDiamondDescription(proxyAddress, networkName);
199+
await removeDanglingFacetDeploymentArtifacts(proxyAddress);
200+
await tryVerify(facetsToAdd.map((facet) => facet.name));
201+
}
202+
203+
if (require.main === module) {
204+
main().catch((error) => {
205+
console.error(error);
206+
process.exitCode = 1;
207+
});
208+
}

0 commit comments

Comments
 (0)