-
Notifications
You must be signed in to change notification settings - Fork 14
feat: v6.2.0 upgrade script
#329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b3e970f
chore: Update upgrade script to v6.2.0 and implement Solidity v8 migr…
Le-Caignec a0dac59
Merge branch 'main' into feat/6.2-upgrade-script
Le-Caignec 8848289
fix: format
Le-Caignec a2a3ad0
Merge branch 'feat/6.2-upgrade-script' of https://github.com/iExecBlo…
Le-Caignec bef6b93
refactor: Simplify upgrade script by removing native chain check
Le-Caignec 7a33bfd
feat: Add success message to upgrade script for better user feedback
Le-Caignec 310f0ed
refactor: Update IexecEscrowFacet initialization to remove native cha…
Le-Caignec 9d1ec62
chore: Add TODO comment to IexecAccessorsABILegacyFacet factory initi…
Le-Caignec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Upgrade v6.2.0 - Solidity v8 Migration | ||
|
|
||
| - **Date**: TBD | ||
| - **Git tag**: [v6.2.0](https://github.com/iExecBlockchainComputing/PoCo/releases/tag/v6.2.0) | ||
| - **Upgrade script**: `./v6.2.0.ts` | ||
| - **Upgrade GitHub Action run**: | ||
| - **Testnet**: [run id](https://github.com/iExecBlockchainComputing/PoCo/actions/runs/<runId>) | ||
| - **Mainnet**: [run id](https://github.com/iExecBlockchainComputing/PoCo/actions/runs/<runId>) | ||
|
|
||
| ## Summary of changes | ||
|
|
||
| - Migrate all facets from Solidity v6 to Solidity v8 | ||
| - Remove IexecERC20Facet (address: `0xB0152eC6f48E64a92B66D4736aFA1b02d8D45169`) | ||
| - Deploy new Solidity v8 versions of all facets: | ||
| - IexecAccessorsABILegacyFacet | ||
| - IexecCategoryManagerFacet | ||
| - IexecConfigurationExtraFacet | ||
| - IexecConfigurationFacet | ||
| - IexecEscrowTokenFacet | ||
| - IexecOrderManagementFacet | ||
| - IexecPoco1Facet | ||
| - IexecPoco2Facet | ||
| - IexecPocoAccessorsFacet | ||
| - IexecRelayFacet | ||
|
|
||
| ## Deployment logs | ||
|
|
||
| ### Arbitrum Sepolia | ||
|
|
||
| ``` | ||
| TODO | ||
| ``` | ||
|
|
||
| ### Arbitrum Mainnet | ||
|
|
||
| ``` | ||
| TODO | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,201 @@ | ||
| // NOTE: The IexecERC20Facet__factory has been removed. | ||
| // Remember to manually remove the corresponding facet - contract address is: | ||
| // 0xB0152eC6f48E64a92B66D4736aFA1b02d8D45169 | ||
| // SPDX-FileCopyrightText: 2025 IEXEC BLOCKCHAIN TECH <contact@iex.ec> | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| import { | ||
| IexecAccessorsABILegacyFacet__factory, | ||
| IexecCategoryManagerFacet__factory, | ||
| IexecConfigurationExtraFacet__factory, | ||
| IexecConfigurationFacet__factory, | ||
| IexecEscrowTokenFacet__factory, | ||
| IexecOrderManagementFacet__factory, | ||
| IexecPoco1Facet__factory, | ||
| IexecPoco2Facet__factory, | ||
| IexecPocoAccessorsFacet__factory, | ||
| IexecRelayFacet__factory, | ||
| } from '../../typechain'; | ||
| import { | ||
| FacetDetails, | ||
| deployFacets, | ||
| getUpgradeContext, | ||
| linkFacetsToDiamond, | ||
| printOnchainDiamondDescription, | ||
| removeDanglingFacetDeploymentArtifacts, | ||
| removeFacetsFromDiamond, | ||
| saveOnchainDiamondDescription, | ||
| } from '../../utils/proxy-tools'; | ||
| import { tryVerify } from '../verify'; | ||
|
|
||
| async function main() { | ||
| console.log('Performing Solidity v8 migration upgrade (v6.2.0)...'); | ||
| const { chainId, networkName, deployer, proxyOwner, proxyAddress, iexecLibOrders } = | ||
| await getUpgradeContext(); | ||
|
|
||
| // Define all facets to remove (all existing facets except core diamond facets) | ||
| const facetAddressesPerChain: { [key: string]: { [key: string]: string } } = { | ||
| // Arbitrum Sepolia | ||
| '421614': { | ||
| IexecAccessorsABILegacyFacet: '0x56CDC32332648b1220a89172191798852706EB35', | ||
| IexecCategoryManagerFacet: '0x5f0483b9D7f959816A5CDD4C49E5C91C24561B43', | ||
| IexecConfigurationExtraFacet: '0x7Ff117E7385Ac3E207AF1791fE7e66C7802aeCCd', | ||
| IexecConfigurationFacet: '0x88eb05e62434057d3AA9e41FdaF7300A586b314D', | ||
| IexecERC20Facet: '0xB0152eC6f48E64a92B66D4736aFA1b02d8D45169', // Removed from codebase | ||
| IexecEscrowTokenFacet: '0xd9EB17A161581FBBAD2Ae998c0C19746EaAD0D6E', | ||
| IexecOrderManagementFacet: '0x541d532E6C195Ba044a75325F367342f523627fB', | ||
| IexecPoco1Facet: '0xC8dE3913fcdBC576970dCe24eE416CA25681f65f', | ||
| IexecPoco2Facet: '0x5c7B589E6807B554ed278f335215B93bCB692162', | ||
| IexecPocoAccessorsFacet: '0x56625089E6EB6F058DB163025318575AD38781fa', | ||
| IexecRelayFacet: '0x8cBf58265F74b77f0D9cCA9f7e14685205496d8f', | ||
| }, | ||
| // Arbitrum Mainnet | ||
| '42161': { | ||
| IexecAccessorsABILegacyFacet: '0x56CDC32332648b1220a89172191798852706EB35', | ||
| IexecCategoryManagerFacet: '0x5f0483b9D7f959816A5CDD4C49E5C91C24561B43', | ||
| IexecConfigurationExtraFacet: '0x7Ff117E7385Ac3E207AF1791fE7e66C7802aeCCd', | ||
| IexecConfigurationFacet: '0x88eb05e62434057d3AA9e41FdaF7300A586b314D', | ||
| IexecERC20Facet: '0xB0152eC6f48E64a92B66D4736aFA1b02d8D45169', // Removed from codebase | ||
| IexecEscrowTokenFacet: '0xd9EB17A161581FBBAD2Ae998c0C19746EaAD0D6E', | ||
| IexecOrderManagementFacet: '0x541d532E6C195Ba044a75325F367342f523627fB', | ||
| IexecPoco1Facet: '0x5331c0FC7DD0Cc08047B546675cd1d6d47152AEb', | ||
| IexecPoco2Facet: '0x5c7B589E6807B554ed278f335215B93bCB692162', | ||
| IexecPocoAccessorsFacet: '0x9BCaCA06d5173f4bA02F8ECcb28E227333F1606F', | ||
| IexecRelayFacet: '0x8cBf58265F74b77f0D9cCA9f7e14685205496d8f', | ||
| }, | ||
| }; | ||
|
|
||
| const chainIdStr = chainId.toString(); | ||
| const addresses = facetAddressesPerChain[chainIdStr]; | ||
| if (!addresses) { | ||
| throw new Error(`No facet addresses defined for chain ID ${chainId}`); | ||
| } | ||
|
|
||
| // Build list of facets to remove | ||
| const facetsToRemove: FacetDetails[] = [ | ||
| { | ||
| name: 'IexecAccessorsABILegacyFacet', | ||
| address: addresses['IexecAccessorsABILegacyFacet'], | ||
| factory: null, | ||
| }, | ||
| { | ||
| name: 'IexecCategoryManagerFacet', | ||
| address: addresses['IexecCategoryManagerFacet'], | ||
| factory: null, | ||
| }, | ||
| { | ||
| name: 'IexecConfigurationExtraFacet', | ||
| address: addresses['IexecConfigurationExtraFacet'], | ||
| factory: null, | ||
| }, | ||
| { | ||
| name: 'IexecConfigurationFacet', | ||
| address: addresses['IexecConfigurationFacet'], | ||
| factory: null, | ||
| }, | ||
| { | ||
| name: 'IexecERC20Facet', | ||
| address: addresses['IexecERC20Facet'], | ||
| factory: null, | ||
| }, | ||
| { | ||
| name: 'IexecEscrowTokenFacet', | ||
| address: addresses['IexecEscrowTokenFacet'], | ||
| factory: null, | ||
| }, | ||
| { | ||
| name: 'IexecOrderManagementFacet', | ||
| address: addresses['IexecOrderManagementFacet'], | ||
| factory: null, | ||
| }, | ||
| { | ||
| name: 'IexecPoco1Facet', | ||
| address: addresses['IexecPoco1Facet'], | ||
| factory: null, | ||
| }, | ||
| { | ||
| name: 'IexecPoco2Facet', | ||
| address: addresses['IexecPoco2Facet'], | ||
| factory: null, | ||
| }, | ||
| { | ||
| name: 'IexecPocoAccessorsFacet', | ||
| address: addresses['IexecPocoAccessorsFacet'], | ||
| factory: null, | ||
| }, | ||
| { | ||
| name: 'IexecRelayFacet', | ||
| address: addresses['IexecRelayFacet'], | ||
| factory: null, | ||
| }, | ||
| ]; | ||
|
|
||
| // Build list of facets to add (all with Solidity v8) | ||
| const facetsToAdd: FacetDetails[] = [ | ||
| { | ||
| name: 'IexecAccessorsABILegacyFacet', | ||
| address: null, | ||
| factory: new IexecAccessorsABILegacyFacet__factory(), // TODO: Check with middleware team if this facet is still needed. | ||
| }, | ||
| { | ||
| name: 'IexecCategoryManagerFacet', | ||
| address: null, | ||
| factory: new IexecCategoryManagerFacet__factory(), | ||
| }, | ||
| { | ||
| name: 'IexecConfigurationExtraFacet', | ||
| address: null, | ||
| factory: new IexecConfigurationExtraFacet__factory(), | ||
| }, | ||
| { | ||
| name: 'IexecConfigurationFacet', | ||
| address: null, | ||
| factory: new IexecConfigurationFacet__factory(iexecLibOrders), | ||
| }, | ||
| { | ||
| name: 'IexecEscrowTokenFacet', | ||
| address: null, | ||
| factory: new IexecEscrowTokenFacet__factory(), | ||
| }, | ||
| { | ||
| name: 'IexecOrderManagementFacet', | ||
| address: null, | ||
| factory: new IexecOrderManagementFacet__factory(iexecLibOrders), | ||
| }, | ||
| { | ||
| name: 'IexecPoco1Facet', | ||
| address: null, | ||
| factory: new IexecPoco1Facet__factory(iexecLibOrders), | ||
| }, | ||
| { | ||
| name: 'IexecPoco2Facet', | ||
| address: null, | ||
| factory: new IexecPoco2Facet__factory(), | ||
| }, | ||
| { | ||
| name: 'IexecPocoAccessorsFacet', | ||
| address: null, | ||
| factory: new IexecPocoAccessorsFacet__factory(iexecLibOrders), | ||
| }, | ||
| { | ||
| name: 'IexecRelayFacet', | ||
| address: null, | ||
| factory: new IexecRelayFacet__factory(), | ||
| }, | ||
| ]; | ||
|
|
||
| await printOnchainDiamondDescription(proxyAddress); | ||
| await deployFacets(deployer, chainId, facetsToAdd); | ||
| await removeFacetsFromDiamond(proxyAddress, proxyOwner, facetsToRemove); | ||
| await printOnchainDiamondDescription(proxyAddress); | ||
| await linkFacetsToDiamond(proxyAddress, proxyOwner, facetsToAdd); | ||
| await printOnchainDiamondDescription(proxyAddress); | ||
| console.log('Upgrade performed successfully!'); | ||
| await saveOnchainDiamondDescription(proxyAddress, networkName); | ||
| await removeDanglingFacetDeploymentArtifacts(proxyAddress); | ||
| await tryVerify(facetsToAdd.map((facet) => facet.name)); | ||
Le-Caignec marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| if (require.main === module) { | ||
| main().catch((error) => { | ||
| console.error(error); | ||
| process.exitCode = 1; | ||
| }); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.