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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

- Migrate proxy to Diamond pattern (ERC-2535):
- Format all solidity files (#233)
- Rename ERC1538 architure to diamond Proxy architecture(#226, #229, #230)
- Rename ERC1538 architure to diamond Proxy architecture(#226, #229, #230, #234)
- Remove ENS module (#225)
- Add Diamond contract unit tests (#224)
- Fix `fallback` and `receive` (#223)
Expand Down
4 changes: 2 additions & 2 deletions contracts/IexecInterfaceNative.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "./modules/interfaces/IexecAccessors.sol";
import "./modules/interfaces/IexecCategoryManager.sol";
import "./modules/interfaces/IexecERC20.sol";
import "./modules/interfaces/IexecEscrowNative.sol";
import "./modules/interfaces/IexecMaintenance.sol";
import "./modules/interfaces/IexecConfiguration.sol";
import "./modules/interfaces/IexecOrderManagement.sol";
import "./modules/interfaces/IexecPoco1.sol";
import "./modules/interfaces/IexecPoco2.sol";
Expand All @@ -22,7 +22,7 @@ interface IexecInterfaceNative is
IexecCategoryManager,
IexecERC20,
IexecEscrowNative,
IexecMaintenance,
IexecConfiguration,
IexecOrderManagement,
IexecPoco1,
IexecPoco2,
Expand Down
4 changes: 2 additions & 2 deletions contracts/IexecInterfaceNativeABILegacy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import "./modules/interfaces/IexecAccessorsABILegacy.sol";
import "./modules/interfaces/IexecCategoryManager.sol";
import "./modules/interfaces/IexecERC20.sol";
import "./modules/interfaces/IexecEscrowNative.sol";
import "./modules/interfaces/IexecMaintenance.sol";
import "./modules/interfaces/IexecConfiguration.sol";
import "./modules/interfaces/IexecOrderManagement.sol";
import "./modules/interfaces/IexecPoco1.sol";
import "./modules/interfaces/IexecPoco2.sol";
Expand All @@ -24,7 +24,7 @@ interface IexecInterfaceNativeABILegacy is
IexecCategoryManager,
IexecERC20,
IexecEscrowNative,
IexecMaintenance,
IexecConfiguration,
IexecOrderManagement,
IexecPoco1,
IexecPoco2,
Expand Down
4 changes: 2 additions & 2 deletions contracts/IexecInterfaceToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import "./modules/interfaces/IexecCategoryManager.sol";
import "./modules/interfaces/IexecERC20.sol";
import "./modules/interfaces/IexecEscrowToken.sol";
import "./modules/interfaces/IexecEscrowTokenSwap.sol";
import "./modules/interfaces/IexecMaintenance.sol";
import "./modules/interfaces/IexecConfiguration.sol";
import "./modules/interfaces/IexecOrderManagement.sol";
import "./modules/interfaces/IexecPoco1.sol";
import "./modules/interfaces/IexecPoco2.sol";
Expand All @@ -24,7 +24,7 @@ interface IexecInterfaceToken is
IexecERC20,
IexecEscrowToken,
IexecEscrowTokenSwap,
IexecMaintenance,
IexecConfiguration,
IexecOrderManagement,
IexecPoco1,
IexecPoco2,
Expand Down
4 changes: 2 additions & 2 deletions contracts/IexecInterfaceTokenABILegacy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import "./modules/interfaces/IexecCategoryManager.sol";
import "./modules/interfaces/IexecERC20.sol";
import "./modules/interfaces/IexecEscrowToken.sol";
import "./modules/interfaces/IexecEscrowTokenSwap.sol";
import "./modules/interfaces/IexecMaintenance.sol";
import "./modules/interfaces/IexecConfiguration.sol";
import "./modules/interfaces/IexecOrderManagement.sol";
import "./modules/interfaces/IexecPoco1.sol";
import "./modules/interfaces/IexecPoco2.sol";
Expand All @@ -26,7 +26,7 @@ interface IexecInterfaceTokenABILegacy is
IexecERC20,
IexecEscrowToken,
IexecEscrowTokenSwap,
IexecMaintenance,
IexecConfiguration,
IexecOrderManagement,
IexecPoco1,
IexecPoco2,
Expand Down
8 changes: 4 additions & 4 deletions contracts/Store.v8.sol
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ abstract contract Store {
/**
* @dev EIP-712 domain hash.
*/
// Modified in IexecMaintenanceFacet.updateDomainSeparator
// Modified in IexecConfigurationFacet.updateDomainSeparator
//slither-disable-next-line constable-states
bytes32 internal EIP712DOMAIN_SEPARATOR;

Expand Down Expand Up @@ -125,14 +125,14 @@ abstract contract Store {
/**
* @dev Address of a trusted TEE authority that manages enclave challenges.
*/
// Modified in IexecMaintenanceFacet.setTeeBroker
// Modified in IexecConfigurationFacet.setTeeBroker
//slither-disable-next-line constable-states
address internal m_teebroker;

/**
* @dev Max amount of gas to be used with callbacks.
*/
// Modified in IexecMaintenanceFacet.setCallbackGas
// Modified in IexecConfigurationFacet.setCallbackGas
//slither-disable-next-line constable-states
uint256 internal m_callbackgas;

Expand All @@ -142,7 +142,7 @@ abstract contract Store {
IexecLibCore_v5.Category[] internal m_categories;

// Backward compatibility
// Modified in IexecMaintenanceFacet.configure
// Modified in IexecConfigurationFacet.configure
//slither-disable-next-line constable-states
address internal m_v3_iexecHub; // IexecHubInterface
mapping(address => bool) internal m_v3_scoreImported;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;

import "../FacetBase.sol";
import "../interfaces/IexecMaintenanceExtra.sol";
import "../interfaces/IexecConfigurationExtra.sol";

contract IexecMaintenanceExtraFacet is IexecMaintenanceExtra, FacetBase {
contract IexecConfigurationExtraFacet is IexecConfigurationExtra, FacetBase {
function changeRegistries(
address _appregistryAddress,
address _datasetregistryAddress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

import "../FacetBase.sol";
import "../interfaces/IexecMaintenance.sol";
import "../interfaces/IexecConfiguration.sol";

contract IexecMaintenanceFacet is IexecMaintenance, FacetBase {
contract IexecConfigurationFacet is IexecConfiguration, FacetBase {
using SafeMathExtended for uint256;
using IexecLibOrders_v5 for IexecLibOrders_v5.EIP712Domain;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pragma experimental ABIEncoderV2;

import "../../libs/IexecLibOrders_v5.sol";

interface IexecMaintenance {
interface IexecConfiguration {
function configure(
address,
string calldata,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;

interface IexecMaintenanceExtra {
interface IexecConfigurationExtra {
function changeRegistries(address, address, address) external;
}
10 changes: 5 additions & 5 deletions deploy/0_deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import {
IexecAccessors__factory,
IexecCategoryManagerFacet__factory,
IexecCategoryManager__factory,
IexecConfigurationExtraFacet__factory,
IexecConfigurationFacet__factory,
IexecERC20Facet__factory,
IexecEscrowNativeFacet__factory,
IexecEscrowTokenFacet__factory,
IexecLibOrders_v5__factory,
IexecMaintenanceExtraFacet__factory,
IexecMaintenanceFacet__factory,
IexecOrderManagementFacet__factory,
IexecPoco1Facet__factory,
IexecPoco2Facet__factory,
Expand Down Expand Up @@ -89,12 +89,12 @@ export default async function deploy() {
new IexecCategoryManagerFacet__factory(),
new IexecERC20Facet__factory(),
isTokenMode ? new IexecEscrowTokenFacet__factory() : new IexecEscrowNativeFacet__factory(),
new IexecMaintenanceFacet__factory(iexecLibOrders),
new IexecConfigurationFacet__factory(iexecLibOrders),
new IexecOrderManagementFacet__factory(iexecLibOrders),
new IexecPoco1Facet__factory(iexecLibOrders),
new IexecPoco2Facet__factory(),
new IexecRelayFacet__factory(),
new IexecMaintenanceExtraFacet__factory(),
new IexecConfigurationExtraFacet__factory(),
new IexecPocoAccessorsFacet__factory(iexecLibOrders),
new IexecPocoBoostFacet__factory(iexecLibOrders),
new IexecPocoBoostAccessorsFacet__factory(),
Expand Down Expand Up @@ -176,7 +176,7 @@ export default async function deploy() {
const iexecInitialized = (await iexecAccessorsInstance.eip712domain_separator()) != ZeroHash;
if (!iexecInitialized) {
// TODO replace this with DiamondInit.init().
await IexecMaintenanceFacet__factory.connect(diamondProxyAddress, owner)
await IexecConfigurationFacet__factory.connect(diamondProxyAddress, owner)
.configure(
rlcInstanceAddress,
'Staked RLC',
Expand Down
4 changes: 2 additions & 2 deletions scripts/set-callback-gas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import { deployments, ethers } from 'hardhat';
import { IexecAccessors__factory, IexecMaintenanceFacet__factory } from '../typechain';
import { IexecAccessors__factory, IexecConfigurationFacet__factory } from '../typechain';

(async () => {
const requestedCallbackGas = Number(process.env.CALLBACK_GAS);
Expand All @@ -18,7 +18,7 @@ import { IexecAccessors__factory, IexecMaintenanceFacet__factory } from '../type
.toNumber()
.toLocaleString();
const callbackGasBefore = await viewCallbackGas();
await IexecMaintenanceFacet__factory.connect(diamondProxyAddress, owner)
await IexecConfigurationFacet__factory.connect(diamondProxyAddress, owner)
.setCallbackGas(requestedCallbackGas)
.then((tx) => tx.wait());
console.log(`Changed callback-gas from ${callbackGasBefore} to ${await viewCallbackGas()}`);
Expand Down
2 changes: 1 addition & 1 deletion scripts/upgrades/upgrade-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async function printBlockTime() {
}
}

// TODO: update this function to use DiamonLoup
// TODO: update this function to use DiamondLoup
async function printFunctions(diamondProxyAddress: string) {
const diamondQueryInstance: ERC1538Query = ERC1538Query__factory.connect(
diamondProxyAddress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers';
import { loadFixture, setStorageAt } from '@nomicfoundation/hardhat-network-helpers';
import { expect } from 'chai';
import { TypedDataEncoder, ZeroHash } from 'ethers';
import { ZeroHash } from 'ethers';
import { ethers } from 'hardhat';
import {
IexecConfigurationExtra,
IexecConfigurationExtra__factory,
IexecInterfaceNative,
IexecInterfaceNative__factory,
IexecLibOrders_v5,
IexecMaintenanceExtra,
IexecMaintenanceExtra__factory,
} from '../../../typechain';
import { getIexecAccounts } from '../../../utils/poco-tools';
import { loadHardhatFixtureDeployment } from '../../utils/hardhat-fixture-deployer';
Expand Down Expand Up @@ -40,10 +39,10 @@ const configureArgs = Object.values(configureParams) as [
];
const someDomainSeparator = '0x0000000000000000000000000000000000000000000000000000000000000001';

describe('IexecMaintenance', async () => {
describe('IexecConfiguration', async () => {
let proxyAddress: string;
let [iexecPoco, iexecPocoAsAdmin]: IexecInterfaceNative[] = [];
let iexecMaintenanceExtra: IexecMaintenanceExtra;
let iexecConfigurationExtra: IexecConfigurationExtra;
let [iexecAdmin, worker, anyone]: SignerWithAddress[] = [];

beforeEach('Deploy', async () => {
Expand All @@ -56,7 +55,7 @@ describe('IexecMaintenance', async () => {
({ iexecAdmin, worker, anyone } = accounts);
iexecPoco = IexecInterfaceNative__factory.connect(proxyAddress, anyone);
iexecPocoAsAdmin = iexecPoco.connect(iexecAdmin);
iexecMaintenanceExtra = IexecMaintenanceExtra__factory.connect(proxyAddress, anyone);
iexecConfigurationExtra = IexecConfigurationExtra__factory.connect(proxyAddress, anyone);
}

describe('Configure', () => {
Expand Down Expand Up @@ -177,7 +176,7 @@ describe('IexecMaintenance', async () => {
const appRegistry = randomAddress();
const datasetRegistry = randomAddress();
const workerpoolRegistry = randomAddress();
await iexecMaintenanceExtra
await iexecConfigurationExtra
.connect(iexecAdmin)
.changeRegistries(appRegistry, datasetRegistry, workerpoolRegistry)
.then((tx) => tx.wait());
Expand All @@ -188,7 +187,7 @@ describe('IexecMaintenance', async () => {

it('Should not change registries when sender is not the owner', async () => {
await expect(
iexecMaintenanceExtra.changeRegistries(
iexecConfigurationExtra.changeRegistries(
randomAddress(),
randomAddress(),
randomAddress(),
Expand Down
12 changes: 6 additions & 6 deletions test/byContract/IexecPocoBoost/IexecPocoBoost.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import {
IOracleConsumer__factory,
IexecAccessors,
IexecAccessors__factory,
IexecMaintenance,
IexecMaintenance__factory,
IexecConfiguration,
IexecConfiguration__factory,
IexecOrderManagement__factory,
IexecPoco2__factory,
IexecPocoAccessors__factory,
Expand Down Expand Up @@ -73,7 +73,7 @@ const randomEOAAddress = ethers.Wallet.createRandom().address;

let proxyAddress: string;
let iexecPocoBoostInstance: IexecPocoBoostFacet;
let iexecMaintenanceAsAdmin: IexecMaintenance;
let iexecConfigurationAsAdmin: IexecConfiguration;
let iexecAccessor: IexecAccessors;
let oracleConsumerInstance: TestClient;
let gasWasterClientInstance: GasWasterClient;
Expand Down Expand Up @@ -125,7 +125,7 @@ describe('IexecPocoBoost', function () {
domain = iexecWrapper.getDomain();
({ appAddress, datasetAddress, workerpoolAddress } = await iexecWrapper.createAssets());
iexecPocoBoostInstance = IexecPocoBoostFacet__factory.connect(proxyAddress, anyone);
iexecMaintenanceAsAdmin = IexecMaintenance__factory.connect(
iexecConfigurationAsAdmin = IexecConfiguration__factory.connect(
proxyAddress,
accounts.iexecAdmin,
);
Expand Down Expand Up @@ -1539,7 +1539,7 @@ describe('IexecPocoBoost', function () {
requester: requester.address,
tag: teeDealTag,
});
await iexecMaintenanceAsAdmin.setTeeBroker(sms.address).then((tx) => tx.wait());
await iexecConfigurationAsAdmin.setTeeBroker(sms.address).then((tx) => tx.wait());

await signOrders(domain, orders, ordersActors);
const dealId = getDealId(domain, orders.requester, taskIndex);
Expand Down Expand Up @@ -1908,7 +1908,7 @@ describe('IexecPocoBoost', function () {
assets: ordersAssets,
requester: requester.address,
});
await iexecMaintenanceAsAdmin.setTeeBroker(sms.address).then((tx) => tx.wait());
await iexecConfigurationAsAdmin.setTeeBroker(sms.address).then((tx) => tx.wait());

await signOrders(domain, orders, ordersActors);
await iexecPocoBoostInstance
Expand Down
4 changes: 2 additions & 2 deletions test/utils/IexecWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import {
DatasetRegistry,
DatasetRegistry__factory,
IexecAccessors__factory,
IexecConfigurationFacet__factory,
IexecInterfaceNative__factory,
IexecLibOrders_v5,
IexecMaintenanceFacet__factory,
IexecPoco2__factory,
IexecPocoAccessors__factory,
IexecPocoBoostAccessors__factory,
Expand Down Expand Up @@ -176,7 +176,7 @@ export class IexecWrapper {
}

async setTeeBroker(brokerAddress: string) {
await IexecMaintenanceFacet__factory.connect(this.proxyAddress, this.accounts.iexecAdmin)
await IexecConfigurationFacet__factory.connect(this.proxyAddress, this.accounts.iexecAdmin)
.setTeeBroker(brokerAddress)
.then((tx) => tx.wait());
}
Expand Down