diff --git a/CHANGELOG.md b/CHANGELOG.md index 47fb02857..bde676b74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## vNEXT +- Include `IexecOrderManagement` module in Poco sponsoring upgrade. (#132) - Update function visibilities to `external` in `IexecPoco` and `IexecOrderManagement` modules. (#131) - Fix configs native and token. (#129) - Bump dependencies: (#127) diff --git a/scripts/sponsoring/0_deploy-modules.ts b/scripts/sponsoring/0_deploy-modules.ts index 40c9bb57f..e9adf7439 100644 --- a/scripts/sponsoring/0_deploy-modules.ts +++ b/scripts/sponsoring/0_deploy-modules.ts @@ -2,6 +2,7 @@ import { deployments, ethers } from 'hardhat'; import CONFIG from '../../config/config.json'; import { GenericFactory__factory, + IexecOrderManagementDelegate__factory, IexecPoco1Delegate__factory, IexecPoco2Delegate__factory, IexecPocoAccessorsDelegate__factory, @@ -17,6 +18,13 @@ const genericFactoryAddress = require('@amxx/factory/deployments/GenericFactory. const salt = deploymentOptions.salt; const modules = [ + { + name: 'IexecOrderManagementDelegate', + bytecode: IexecOrderManagementDelegate__factory.linkBytecode({ + ['contracts/libs/IexecLibOrders_v5.sol:IexecLibOrders_v5']: + deploymentOptions.IexecLibOrders_v5, + }), + }, { name: 'IexecPoco1Delegate', bytecode: IexecPoco1Delegate__factory.linkBytecode({ diff --git a/scripts/sponsoring/1_add-modules-to-proxy.ts b/scripts/sponsoring/1_add-modules-to-proxy.ts index d4f894607..c81768c89 100644 --- a/scripts/sponsoring/1_add-modules-to-proxy.ts +++ b/scripts/sponsoring/1_add-modules-to-proxy.ts @@ -4,6 +4,7 @@ import { time } from '@nomicfoundation/hardhat-network-helpers'; import hre, { ethers } from 'hardhat'; import CONFIG from '../../config/config.json'; import { + IexecOrderManagementDelegate__factory, IexecPoco1Delegate__factory, IexecPoco2Delegate__factory, IexecPocoAccessorsDelegate__factory, @@ -22,6 +23,8 @@ import { const deploymentOptions = CONFIG.chains[chainId].v5; console.log('Link functions to proxy:'); const erc1538ProxyAddress = deploymentOptions.ERC1538Proxy; + const iexecOrderManagementAddress = (await hre.deployments.get('IexecOrderManagementDelegate')) + .address; const iexecPoco1DelegateAddress = (await hre.deployments.get('IexecPoco1Delegate')).address; const iexecPoco2DelegateAddress = (await hre.deployments.get('IexecPoco2Delegate')).address; const iexecPocoAccessorsDelegateAddress = ( @@ -34,6 +37,10 @@ import { erc1538ProxyAddress, ethers.provider, ).owner(); + const iexecOrderManagementProxyUpdate = encodeModuleProxyUpdate( + IexecOrderManagementDelegate__factory.createInterface(), + iexecOrderManagementAddress, + ); const iexecPoco1ProxyUpdate = encodeModuleProxyUpdate( IexecPoco1Delegate__factory.createInterface(), iexecPoco1DelegateAddress, @@ -46,9 +53,15 @@ import { IexecPocoAccessorsDelegate__factory.createInterface(), iexecPocoAccessorsDelegateAddress, ); - // Salt but must be the same for schedule & execute - const operationSalt = '0x0be814a62c44af32241a2c964e5680d1b25c783473c6e7875cbc8071770d7ff0'; // Random - const updates = [iexecPoco1ProxyUpdate, iexecPoco2ProxyUpdate, iexecPocoAccessorsProxyUpdate]; + // The salt must be the same for a given schedule & execute operation set + // Please increment salt in case of operation ID collision + const operationSalt = '0x0000000000000000000000000000000000000000000000000000000000000001'; + const updates = [ + iexecOrderManagementProxyUpdate, + iexecPoco1ProxyUpdate, + iexecPoco2ProxyUpdate, + iexecPocoAccessorsProxyUpdate, + ]; const updateProxyArgs = [ Array(updates.length).fill(erc1538ProxyAddress), Array(updates.length).fill(0),