Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
8 changes: 8 additions & 0 deletions scripts/sponsoring/0_deploy-modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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({
Expand Down
19 changes: 16 additions & 3 deletions scripts/sponsoring/1_add-modules-to-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 = (
Expand All @@ -34,6 +37,10 @@ import {
erc1538ProxyAddress,
ethers.provider,
).owner();
const iexecOrderManagementProxyUpdate = encodeModuleProxyUpdate(
IexecOrderManagementDelegate__factory.createInterface(),
iexecOrderManagementAddress,
);
const iexecPoco1ProxyUpdate = encodeModuleProxyUpdate(
IexecPoco1Delegate__factory.createInterface(),
iexecPoco1DelegateAddress,
Expand All @@ -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),
Expand Down