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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
## vNEXT

- Migrate proxy to Diamond pattern (ERC-2535):
- Restore compatibility with iExec SDK. (#240)
- Target latest EVM version (#239)
- Adapt contracts file tree (#238)
- Use namespaced storage (#236, #237)
- Format all solidity files (#233)
- Rename ERC1538 architure to diamond Proxy architecture(#226, #229, #230, #234)
- Remove ENS module (#225)
Expand Down
37 changes: 37 additions & 0 deletions contracts/IexecInterfaceNative.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH <contact@iex.ec>
// SPDX-License-Identifier: Apache-2.0

pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;

import "./interfaces/IOwnable.sol";
import "./interfaces/IexecAccessors.sol";
import "./interfaces/IexecCategoryManager.sol";
import "./interfaces/IexecERC20.sol";
import "./interfaces/IexecEscrowNative.sol";
import "./interfaces/IexecConfiguration.sol";
import "./interfaces/IexecOrderManagement.sol";
import "./interfaces/IexecPoco1.sol";
import "./interfaces/IexecPoco2.sol";
import "./interfaces/IexecRelay.sol";
import "./interfaces/IexecTokenSpender.sol";

/**
* A global interface that aggregates all the interfaces needed to interact with
* the PoCo contracts in native mode.
* @dev Referenced in the SDK with the current path `contracts/IexecInterfaceNative.sol`.
* Changing the name or the path would cause a breaking change in the SDK.
*/
interface IexecInterfaceNative is
IOwnable,
IexecAccessors,
IexecCategoryManager,
IexecERC20,
IexecEscrowNative,
IexecConfiguration,
IexecOrderManagement,
IexecPoco1,
IexecPoco2,
IexecRelay,
IexecTokenSpender
{}
36 changes: 36 additions & 0 deletions contracts/IexecInterfaceNativeABILegacy.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH <contact@iex.ec>
// SPDX-License-Identifier: Apache-2.0

pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;

import "./interfaces/IOwnable.sol";
import "./interfaces/IexecAccessors.sol";
import "./interfaces/IexecAccessorsABILegacy.sol";
import "./interfaces/IexecCategoryManager.sol";
import "./interfaces/IexecERC20.sol";
import "./interfaces/IexecEscrowNative.sol";
import "./interfaces/IexecConfiguration.sol";
import "./interfaces/IexecOrderManagement.sol";
import "./interfaces/IexecPoco1.sol";
import "./interfaces/IexecPoco2.sol";
import "./interfaces/IexecRelay.sol";
import "./interfaces/IexecTokenSpender.sol";

/**
* TODO: Remove this interface in the future when IexecInterfaceTokenABILegacy is removed.
*/
interface IexecInterfaceNativeABILegacy is
IOwnable,
IexecAccessors,
IexecAccessorsABILegacy,
IexecCategoryManager,
IexecERC20,
IexecEscrowNative,
IexecConfiguration,
IexecOrderManagement,
IexecPoco1,
IexecPoco2,
IexecRelay,
IexecTokenSpender
{}
42 changes: 42 additions & 0 deletions contracts/IexecInterfaceToken.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH <contact@iex.ec>
// SPDX-License-Identifier: Apache-2.0

pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;

import "./interfaces/IOwnable.sol";
import "./interfaces/IexecAccessors.sol";
import "./interfaces/IexecCategoryManager.sol";
import "./interfaces/IexecERC20.sol";
import "./interfaces/IexecEscrowToken.sol";
import "./interfaces/IexecEscrowTokenSwap.sol";
import "./interfaces/IexecConfiguration.sol";
import "./interfaces/IexecOrderManagement.sol";
import "./interfaces/IexecPoco1.sol";
import "./interfaces/IexecPoco2.sol";
import "./interfaces/IexecRelay.sol";
import "./interfaces/IexecTokenSpender.sol";

/**
* A global interface that aggregates all the interfaces needed to interact with
* the PoCo contracts in token mode.
* @dev Referenced in the SDK with the current path `contracts/IexecInterfaceToken.sol`.
* Changing the name or the path would cause a breaking change in the SDK.
*/
interface IexecInterfaceToken is
IOwnable,
IexecAccessors,
IexecCategoryManager,
IexecERC20,
IexecEscrowToken,
IexecEscrowTokenSwap,
IexecConfiguration,
IexecOrderManagement,
IexecPoco1,
IexecPoco2,
IexecRelay,
IexecTokenSpender
{
receive() external payable override(IexecEscrowToken, IexecEscrowTokenSwap);
fallback() external payable override(IexecEscrowToken, IexecEscrowTokenSwap);
}
43 changes: 43 additions & 0 deletions contracts/IexecInterfaceTokenABILegacy.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH <contact@iex.ec>
// SPDX-License-Identifier: Apache-2.0

pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;

import "./interfaces/IOwnable.sol";
import "./interfaces/IexecAccessors.sol";
import "./interfaces/IexecAccessorsABILegacy.sol";
import "./interfaces/IexecCategoryManager.sol";
import "./interfaces/IexecERC20.sol";
import "./interfaces/IexecEscrowToken.sol";
import "./interfaces/IexecEscrowTokenSwap.sol";
import "./interfaces/IexecConfiguration.sol";
import "./interfaces/IexecOrderManagement.sol";
import "./interfaces/IexecPoco1.sol";
import "./interfaces/IexecPoco2.sol";
import "./interfaces/IexecRelay.sol";
import "./interfaces/IexecTokenSpender.sol";

/**
* TODO: Remove this interface in the future.
* Currently Used in the middleware:
* https://github.com/iExecBlockchainComputing/iexec-commons-poco/blob/819cd008/generateContractWrappers#L7
*/
interface IexecInterfaceTokenABILegacy is
IOwnable,
IexecAccessors,
IexecAccessorsABILegacy,
IexecCategoryManager,
IexecERC20,
IexecEscrowToken,
IexecEscrowTokenSwap,
IexecConfiguration,
IexecOrderManagement,
IexecPoco1,
IexecPoco2,
IexecRelay,
IexecTokenSpender
{
receive() external payable override(IexecEscrowToken, IexecEscrowTokenSwap);
fallback() external payable override(IexecEscrowToken, IexecEscrowTokenSwap);
}
22 changes: 11 additions & 11 deletions contracts/Store.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,28 +61,28 @@ abstract contract Store {
// In order to use the protocol, users have to deposit RLC
// and allow PoCo smart contracts to manage them. This state
// variable keeps track of users balances.
mapping(address => uint256) m_balances;
mapping(address /* account */ => uint256 /* amount */) m_balances;
// When a deal is created, the protocol temporarily locks an amount
// of RLC tokens from the balances of both the requester and the workerpool owners.
// This is to guarantee the payment of different actors later. Frozen funds
// are released when the computation is completed and the result is pushed.
mapping(address => uint256) m_frozens;
mapping(address => mapping(address => uint256)) m_allowances;
mapping(address /* account */ => uint256 /* amount */) m_frozens;
mapping(address /* owner */ => mapping(address /* spender */ => uint256 /* amount */)) m_allowances;
// EIP-712 domain hash.
// Modified in IexecConfigurationFacet.updateDomainSeparator
bytes32 m_eip712DomainSeparator;
// Mapping an order hash to its owner. Since a smart contract cannot sign orders
// with a private key, it adds an entry to this mapping to provide presigned orders.
mapping(bytes32 => address) m_presigned;
mapping(bytes32 /* orderHash */ => address /* owner */) m_presigned;
// Each order has a volume (>=1). This tracks how much is consumed from
// the volume of each order. Mapping an order hash to its consumed amount.
mapping(bytes32 => uint256) m_consumed;
mapping(bytes32 /* orderHash */ => uint256 /* consumedAmount */) m_consumed;
// a mapping to store PoCo classic deals.
mapping(bytes32 => IexecLibCore_v5.Deal) m_deals;
mapping(bytes32 => IexecLibCore_v5.Task) m_tasks; // per task
mapping(bytes32 => IexecLibCore_v5.Consensus) m_consensus; // per task
mapping(bytes32 => mapping(address => IexecLibCore_v5.Contribution)) m_contributions; // per task-worker
mapping(address => uint256) m_workerScores; // per worker
mapping(bytes32 /* dealId */ => IexecLibCore_v5.Deal) m_deals;
mapping(bytes32 /* taskId */ => IexecLibCore_v5.Task) m_tasks;
mapping(bytes32 /* taskId */ => IexecLibCore_v5.Consensus) m_consensus;
mapping(bytes32 /* taskId */ => mapping(address /* worker */ => IexecLibCore_v5.Contribution)) m_contributions;
mapping(address /* worker */ => uint256 /* score */) m_workerScores;
// Poco - Settings
// Address of a trusted TEE authority that manages enclave challenges.
// Modified in IexecConfigurationFacet.setTeeBroker
Expand All @@ -95,7 +95,7 @@ abstract contract Store {
// Backward compatibility
// Modified in IexecConfigurationFacet.configure
IexecHubInterface m_v3_iexecHub;
mapping(address => bool) m_v3_scoreImported;
mapping(address /* worker */ => bool) m_v3_scoreImported;
}

function getPocoStorage() internal pure returns (PocoStorage storage $) {
Expand Down
24 changes: 12 additions & 12 deletions contracts/Store.v8.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,28 +55,28 @@ abstract contract Store {
// In order to use the protocol, users have to deposit RLC
// and allow PoCo smart contracts to manage them. This state
// variable keeps track of users balances.
mapping(address => uint256) m_balances;
mapping(address /* account */ => uint256 /* amount */) m_balances;
// When a deal is created, the protocol temporarily locks an amount
// of RLC tokens from the balances of both the requester and the workerpool owners.
// This is to guarantee the payment of different actors later. Frozen funds
// are released when the computation is completed and the result is pushed.
mapping(address => uint256) m_frozens;
mapping(address => mapping(address => uint256)) m_allowances;
mapping(address /* account */ => uint256 /* amount */) m_frozens;
mapping(address /* owner */ => mapping(address /* spender */ => uint256 /* amount */)) m_allowances;
// EIP-712 domain hash.
// Modified in IexecConfigurationFacet.updateDomainSeparator
bytes32 m_eip712DomainSeparator;
// Mapping an order hash to its owner. Since a smart contract cannot sign orders
// with a private key, it adds an entry to this mapping to provide presigned orders.
mapping(bytes32 => address) m_presigned;
mapping(bytes32 /* orderHash */ => address /* owner */) m_presigned;
// Each order has a volume (>=1). This tracks how much is consumed from
// the volume of each order. Mapping an order hash to its consumed amount.
mapping(bytes32 => uint256) m_consumed;
mapping(bytes32 /* orderHash */ => uint256 /* consumedAmount */) m_consumed;
// a mapping to store PoCo classic deals.
mapping(bytes32 => IexecLibCore_v5.Deal) m_deals;
mapping(bytes32 => IexecLibCore_v5.Task) m_tasks; // per task
mapping(bytes32 => IexecLibCore_v5.Consensus) m_consensus; // per task
mapping(bytes32 => mapping(address => IexecLibCore_v5.Contribution)) m_contributions; // per task-worker
mapping(address => uint256) m_workerScores; // per worker
mapping(bytes32 /* dealId */ => IexecLibCore_v5.Deal) m_deals;
mapping(bytes32 /* taskId */ => IexecLibCore_v5.Task) m_tasks;
mapping(bytes32 /* taskId */ => IexecLibCore_v5.Consensus) m_consensus;
mapping(bytes32 /* taskId */ => mapping(address /* worker */ => IexecLibCore_v5.Contribution)) m_contributions;
mapping(address /* worker */ => uint256 /* score */) m_workerScores;
// Poco - Settings
// Address of a trusted TEE authority that manages enclave challenges.
// Modified in IexecConfigurationFacet.setTeeBroker
Expand All @@ -89,10 +89,10 @@ abstract contract Store {
// Backward compatibility
// Modified in IexecConfigurationFacet.configure
address m_v3_iexecHub; // IexecHubInterface
mapping(address => bool) m_v3_scoreImported;
mapping(address /* worker */ => bool) m_v3_scoreImported;
// /!\ New storage variables not present in v6 store.
// A mapping to store PoCo Boost deals.
mapping(bytes32 => IexecLibCore_v5.DealBoost) m_dealsBoost;
mapping(bytes32 /* dealId */ => IexecLibCore_v5.DealBoost) m_dealsBoost;
}

function getPocoStorage() internal pure returns (PocoStorage storage $) {
Expand Down
5 changes: 5 additions & 0 deletions contracts/interfaces/IexecAccessorsABILegacy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ pragma experimental ABIEncoderV2;

import "../libs/IexecLibCore_v5.sol";

/**
* TODO: Remove this interface in the future.
* Currently Used in the middleware:
* https://github.com/iExecBlockchainComputing/iexec-commons-poco/blob/819cd008/src/main/java/com/iexec/commons/poco/chain/IexecHubAbstractService.java#L265
*/
interface IexecAccessorsABILegacy {
function viewAccountABILegacy(address _user) external view returns (uint256, uint256);

Expand Down
31 changes: 0 additions & 31 deletions contracts/interfaces/IexecInterfaceNative.sol

This file was deleted.

33 changes: 0 additions & 33 deletions contracts/interfaces/IexecInterfaceNativeABILegacy.sol

This file was deleted.

36 changes: 0 additions & 36 deletions contracts/interfaces/IexecInterfaceToken.sol

This file was deleted.

Loading