Skip to content
Draft
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: 2 additions & 2 deletions contracts/Diamond.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ contract Diamond {

/**
* `fallback` function must be added to the diamond with selector `0xffffffff`.
* The function is defined in the IexecEscrowToken facet.
* The function is defined in the IexecEscrow facet.
*/
fallback() external payable {
_fallback();
}

/**
* `receive` function must be added to the diamond with selector `0x00000000`.
* The function is defined in the IexecEscrowToken facet.
* The function is defined in the IexecEscrow facet.
*/
receive() external payable {
_fallback();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {IexecCategoryManager} from "./interfaces/IexecCategoryManager.sol";
import {IexecConfiguration} from "./interfaces/IexecConfiguration.sol";
import {IexecConfigurationExtra} from "./interfaces/IexecConfigurationExtra.sol";
import {IexecERC20} from "./interfaces/IexecERC20.sol";
import {IexecEscrowToken} from "./interfaces/IexecEscrowToken.sol";
import {IexecEscrow} from "./interfaces/IexecEscrow.sol";
import {IexecOrderManagement} from "./interfaces/IexecOrderManagement.sol";
import {IexecPoco1} from "./interfaces/IexecPoco1.sol";
import {IexecPoco1Errors} from "./interfaces/IexecPoco1Errors.sol";
Expand All @@ -20,23 +20,23 @@ import {IOwnable} from "./interfaces/IOwnable.sol";

// TODO see if Diamond interfaces should be added here ??
// IDiamond, IDiamondLoupe, IDiamondCut, IERC165, IERC173 (ownership)
// TODO rename to IexecInterface

/**
* 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.
* the PoCo contracts.
* @dev Referenced in the SDK. The previous path and name,
* `contracts/IexecInterfaceToken.sol` and `IexecInterfaceToken`, were retired
* with native mode; the SDK must be updated to this path and name.
*/
// TODO Remove the interface `IexecAccessorsABILegacy` when it's not used in the middleware anymore.
// https://github.com/iExecBlockchainComputing/iexec-commons-poco/blob/819cd008/generateContractWrappers#L7
interface IexecInterfaceToken is
interface IexecInterface is
IexecAccessorsABILegacy,
IexecCategoryManager,
IexecConfiguration,
IexecConfigurationExtra,
IexecERC20,
IexecEscrowToken,
IexecEscrow,
IexecOrderManagement,
IexecPoco1,
IexecPoco1Errors,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ import {FacetBase} from "./FacetBase.sol";

/**
* @title Manage (lock/unlock/reward/seize) user funds.
* @dev The revert reasons of `_transfer` keep the `IexecEscrow:` prefix on
* purpose: they are observable behavior that callers already depend on.
*/
abstract contract IexecEscrow is FacetBase, IexecERC20Events, IexecEscrowEvents {
abstract contract IexecEscrowBase is FacetBase, IexecERC20Events, IexecEscrowEvents {
/**
* Lock some value of an account.
* @param account The account where the value should be locked.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
pragma solidity ^0.8.0;

import {FacetBase} from "../abstract/FacetBase.sol";
import {IexecEscrow} from "../abstract/IexecEscrow.sol";
import {IexecEscrowBase} from "../abstract/IexecEscrowBase.sol";
import {IexecERC20} from "../interfaces/IexecERC20.sol";
import {IexecEscrowToken} from "../interfaces/IexecEscrowToken.sol";
import {IexecEscrow} from "../interfaces/IexecEscrow.sol";
import {IexecTokenSpender} from "../interfaces/IexecTokenSpender.sol";
import {IexecPoco1} from "../interfaces/IexecPoco1.sol";
import {IexecLibOrders_v5} from "../libs/IexecLibOrders_v5.sol";
import {PocoStorageLib} from "../libs/PocoStorageLib.sol";

contract IexecEscrowTokenFacet is
contract IexecEscrowFacet is
FacetBase,
IexecERC20,
IexecTokenSpender,
IexecEscrowToken,
IexecEscrow
IexecEscrow,
IexecEscrowBase
{
/***************************************************************************
* Escrow methods: public *
Expand Down
6 changes: 3 additions & 3 deletions contracts/facets/IexecPoco1Facet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {FacetBase} from "../abstract/FacetBase.sol";
import {PocoStorageLib} from "../libs/PocoStorageLib.sol";
import {IexecPoco1} from "../interfaces/IexecPoco1.sol";
import {IexecPoco1Errors} from "../interfaces/IexecPoco1Errors.sol";
import {IexecEscrow} from "../abstract/IexecEscrow.sol";
import {IexecEscrowBase} from "../abstract/IexecEscrowBase.sol";
import {IexecPocoCommon} from "../abstract/IexecPocoCommon.sol";
import {SignatureVerifier} from "../abstract/SignatureVerifier.sol";

Expand All @@ -31,7 +31,7 @@ contract IexecPoco1Facet is
IexecPoco1,
IexecPoco1Errors,
FacetBase,
IexecEscrow,
IexecEscrowBase,
SignatureVerifier,
IexecPocoCommon
{
Expand Down Expand Up @@ -149,7 +149,7 @@ contract IexecPoco1Facet is
* @notice This function does not use `msg.sender` to determine who pays for the deal.
* The sponsor is always set to `_requestorder.requester`, regardless of who calls this function.
* This design allows the function to be safely called via delegatecall from other facets
* (e.g., IexecEscrowTokenFacet.receiveApproval) without security concerns.
* (e.g., IexecEscrowFacet.receiveApproval) without security concerns.
*
* @param _apporder The app order.
* @param _datasetorder The dataset order.
Expand Down
4 changes: 2 additions & 2 deletions contracts/facets/IexecPoco2Facet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import {IexecLibCore_v5} from "../libs/IexecLibCore_v5.sol";
import {IexecLibOrders_v5} from "../libs/IexecLibOrders_v5.sol";
import {FacetBase} from "../abstract/FacetBase.sol";
import {IexecPoco2} from "../interfaces/IexecPoco2.sol";
import {IexecEscrow} from "../abstract/IexecEscrow.sol";
import {IexecEscrowBase} from "../abstract/IexecEscrowBase.sol";
import {SignatureVerifier} from "../abstract/SignatureVerifier.sol";

contract IexecPoco2Facet is IexecPoco2, FacetBase, IexecEscrow, SignatureVerifier {
contract IexecPoco2Facet is IexecPoco2, FacetBase, IexecEscrowBase, SignatureVerifier {
modifier onlyScheduler(bytes32 _taskId) {
PocoStorageLib.PocoStorage storage $ = PocoStorageLib.getPocoStorage();
require(_msgSender() == $.m_deals[$.m_tasks[_taskId].dealid].workerpool.owner);
Expand Down
4 changes: 2 additions & 2 deletions contracts/facets/IexecPocoBoostFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {IexecLibOrders_v5} from "../libs/IexecLibOrders_v5.sol";
import {IWorkerpool} from "../registries/workerpools/IWorkerpool.v8.sol";
import {FacetBase} from "../abstract/FacetBase.sol";
import {IexecPocoBoost} from "../interfaces/IexecPocoBoost.sol";
import {IexecEscrow} from "../abstract/IexecEscrow.sol";
import {IexecEscrowBase} from "../abstract/IexecEscrowBase.sol";
import {IexecPocoCommon} from "../abstract/IexecPocoCommon.sol";
import {PocoStorageLib} from "../libs/PocoStorageLib.sol";
import {SignatureVerifier} from "../abstract/SignatureVerifier.sol";
Expand All @@ -31,7 +31,7 @@ import {SignatureVerifier} from "../abstract/SignatureVerifier.sol";
contract IexecPocoBoostFacet is
IexecPocoBoost,
FacetBase,
IexecEscrow,
IexecEscrowBase,
SignatureVerifier,
IexecPocoCommon
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pragma solidity ^0.8.0;

import {IexecEscrowEvents} from "./IexecEscrowEvents.sol";

interface IexecEscrowToken is IexecEscrowEvents {
interface IexecEscrow is IexecEscrowEvents {
error UnsupportedOperation(bytes4 selector);
error OperationFailed();
error CallerIsNotTheRequester();
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IexecPocoBoost.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {IexecLibOrders_v5} from "../libs/IexecLibOrders_v5.sol";
/**
* @title Interface definition of the PoCo Boost facet.
*/
// TODO add this to IexecInterfaceToken when the facet is deployed.
// TODO add this to IexecInterface when the facet is deployed.
interface IexecPocoBoost {
/**
* @notice Emitted when a set of compatible orders are matched and a new deal is created.
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IexecPocoBoostAccessors.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pragma solidity ^0.8.0;

import {IexecLibCore_v5} from "../libs/IexecLibCore_v5.sol";

// TODO add this to IexecInterfaceToken when the facet is deployed.
// TODO add this to IexecInterface when the facet is deployed.
interface IexecPocoBoostAccessors {
function viewDealBoost(bytes32 id) external view returns (IexecLibCore_v5.DealBoost memory);
}
6 changes: 3 additions & 3 deletions contracts/tools/testing/IexecEscrowTestContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

pragma solidity ^0.8.0;

import {IexecEscrow} from "../../abstract/IexecEscrow.sol";
import {IexecEscrowBase} from "../../abstract/IexecEscrowBase.sol";
import {PocoStorageLib} from "../../libs/PocoStorageLib.sol";

/**
* @notice a wrapper contract to make internal functions of
* IexecEscrow testable.
* IexecEscrowBase testable.
*/
contract IexecEscrowTestContract is IexecEscrow {
contract IexecEscrowTestContract is IexecEscrowBase {
function lock_(address account, uint256 value) external {
lock(account, value);
}
Expand Down
4 changes: 2 additions & 2 deletions deploy/0_deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
IexecCategoryManager__factory,
IexecConfigurationExtraFacet__factory,
IexecConfigurationFacet__factory,
IexecEscrowTokenFacet__factory,
IexecEscrowFacet__factory,
IexecLibOrders_v5__factory,
IexecOrderManagementFacet__factory,
IexecPoco1Facet__factory,
Expand Down Expand Up @@ -99,7 +99,7 @@ export default async function deploy() {
new IexecCategoryManagerFacet__factory(),
new IexecConfigurationExtraFacet__factory(),
new IexecConfigurationFacet__factory(iexecLibOrders),
new IexecEscrowTokenFacet__factory(),
new IexecEscrowFacet__factory(),
new IexecOrderManagementFacet__factory(iexecLibOrders),
new IexecPoco1Facet__factory(iexecLibOrders),
new IexecPoco2Facet__factory(),
Expand Down
18 changes: 11 additions & 7 deletions docs/solidity/index.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# Solidity API

## IexecInterfaceToken
## IexecInterface

A global interface that aggregates all the interfaces needed to interact with
the PoCo contracts in token mode.
the PoCo contracts.

_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._
_Referenced in the SDK. The previous path and name,
`contracts/IexecInterfaceToken.sol` and `IexecInterfaceToken`, were retired
with native mode; the SDK must be updated to this path and name._

## FacetBase

_Every facet must inherit from this contract._

## IexecEscrow
## IexecEscrowBase

_The revert reasons of `_transfer` keep the `IexecEscrow:` prefix on
purpose: they are observable behavior that callers already depend on._

## IexecCategoryManagerFacet

Expand Down Expand Up @@ -70,7 +74,7 @@ function setTeeBroker(address _teebroker) external
function setCallbackGas(uint256 _callbackgas) external
```

## IexecEscrowTokenFacet
## IexecEscrowFacet

### receive

Expand Down Expand Up @@ -296,7 +300,7 @@ Match orders. The requester gets debited.
This function does not use `msg.sender` to determine who pays for the deal.
The sponsor is always set to `_requestorder.requester`, regardless of who calls this function.
This design allows the function to be safely called via delegatecall from other facets
(e.g., IexecEscrowTokenFacet.receiveApproval) without security concerns.
(e.g., IexecEscrowFacet.receiveApproval) without security concerns.

#### Parameters

Expand Down
36 changes: 18 additions & 18 deletions docs/uml/class-uml-IexecEscrows.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions docs/uml/class-uml-IexecPocoBoostFacet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading