From a550e7573b6f2f1a347bfec843ca0816cba60768 Mon Sep 17 00:00:00 2001 From: Zied <26070035+zguesmi@users.noreply.github.com> Date: Wed, 2 Sep 2026 11:57:42 +0200 Subject: [PATCH 1/9] refactor!: drop the Token suffix from the escrow and aggregate names The protocol has run in a single, token-based mode for a long time. The `Token` suffix no longer distinguishes anything, so it is dropped in favour of the naming convention the library conversion established: `Iexec*` for interfaces, `*Base` for abstracts, `*Facet` for facets, `*Lib` for libraries. contracts/IexecInterfaceToken.sol -> contracts/IexecInterface.sol contracts/interfaces/IexecEscrowToken.sol -> contracts/interfaces/IexecEscrow.sol contracts/facets/IexecEscrowTokenFacet.sol -> contracts/facets/IexecEscrowFacet.sol The two escrow test files follow the same rename so the suite keeps matching the contracts it exercises. This is a breaking change for downstream consumers. `IexecInterfaceToken` is referenced by path in the SDK and in `iexec-commons-poco`, and the published ABI moves from `abis/contracts/IexecInterfaceToken.json` to `abis/contracts/IexecInterface.json`. The contents of that file are byte for byte identical to the old one; only the name and the path change. The two hand-maintained facet lists named in the architecture notes, `utils/proxy-tools.ts#getAllLocalFacetFunctions` and the facet groups in `scripts/tools/sol-to-uml.mjs`, are updated alongside. `IexecLibCore_v5` and `IexecLibOrders_v5` are deliberately left alone. Their names leak into `config/config.json`, the link key in `deploy/0_deploy.ts`, a hard requirement in `utils/proxy-tools.ts` and the `internalType` fields of every ABI, so they deserve a separate change. Their rename markers stay in place. A note is added to the aggregate interface explaining why `IexecPocoBoost` and `IexecPocoBoostAccessors` are still absent from it: the Boost facets are not deployed on Arbitrum mainnet or Arbitrum Sepolia, so aggregating them would make the SDK advertise functions that revert. --- ...ecInterfaceToken.json => IexecInterface.json} | 0 ...crowTokenFacet.json => IexecEscrowFacet.json} | 0 .../{IexecEscrowToken.json => IexecEscrow.json} | 0 .../IexecInterface.json} | 0 .../IexecEscrowFacet.json} | 0 .../IexecEscrow.json} | 0 contracts/Diamond.sol | 4 ++-- ...execInterfaceToken.sol => IexecInterface.sol} | 14 ++++++++------ ...EscrowTokenFacet.sol => IexecEscrowFacet.sol} | 5 ++--- contracts/facets/IexecPoco1Facet.sol | 2 +- .../{IexecEscrowToken.sol => IexecEscrow.sol} | 2 +- contracts/interfaces/IexecPocoBoost.sol | 2 +- contracts/interfaces/IexecPocoBoostAccessors.sol | 2 +- contracts/libs/StakedRlcLib.sol | 2 +- deploy/0_deploy.ts | 4 ++-- docs/solidity/index.md | 10 +++++----- docs/uml/class-uml-IexecEscrows.svg | 16 ++++++++-------- docs/uml/class-uml-dir-facets.svg | 4 ++-- scripts/set-callback-gas.ts | 4 ++-- scripts/tools/sol-to-uml.mjs | 2 +- scripts/upgrades/v6.2.0.ts | 14 +++++++------- test/000_fullchain-boost.test.ts | 8 ++++---- test/000_fullchain.test.ts | 6 +++--- test/200_fullchain-bot.test.ts | 6 +++--- test/201_fullchain-multi-orders.test.ts | 6 +++--- test/300_fullchain-reopen.test.ts | 6 +++--- .../IexecAccessorsABILegacy.test.ts | 6 +++--- .../IexecCategoryManager.test.ts | 6 +++--- .../IexecConfiguration.test.ts | 8 ++++---- test/byContract/IexecERC20/IexecERC20.test.ts | 8 ++++---- ...st.ts => IexecEscrow-receiveApproval.test.ts} | 12 ++++++------ ...ecEscrowToken.test.ts => IexecEscrow.test.ts} | 13 ++++--------- .../IexecOrderManagement.test.ts | 10 +++------- test/byContract/IexecPoco/IexecPoco1.test.ts | 10 +++++----- .../IexecPoco/IexecPoco2-claim.test.ts | 8 ++++---- .../IexecPoco2-contribute-and-finalize.test.ts | 10 +++------- .../IexecPoco/IexecPoco2-contribute.test.ts | 6 +++--- .../IexecPoco/IexecPoco2-finalize.test.ts | 8 ++++---- .../IexecPoco/IexecPoco2-initialize.test.ts | 8 ++++---- .../IexecPoco/IexecPoco2-reopen.test.ts | 6 +++--- .../IexecPoco/IexecPoco2-reveal.test.ts | 6 +++--- .../IexecPocoBoost/IexecPocoBoost.test.ts | 8 ++++---- test/byContract/IexecRelay/IexecRelay.test.ts | 10 +++------- .../IexecPocoAccessors.test.ts | 10 +++------- test/byContract/registries/assets.test.ts | 8 ++++---- test/byContract/registries/registries.test.ts | 8 ++++---- test/utils/IexecWrapper.ts | 8 ++++---- test/utils/fixture-helpers.ts | 6 +++--- utils/proxy-tools.ts | 4 ++-- 49 files changed, 143 insertions(+), 163 deletions(-) rename abis/contracts/{IexecInterfaceToken.json => IexecInterface.json} (100%) rename abis/contracts/facets/{IexecEscrowTokenFacet.json => IexecEscrowFacet.json} (100%) rename abis/contracts/interfaces/{IexecEscrowToken.json => IexecEscrow.json} (100%) rename abis/human-readable-abis/contracts/{IexecInterfaceToken.sol/IexecInterfaceToken.json => IexecInterface.sol/IexecInterface.json} (100%) rename abis/human-readable-abis/contracts/facets/{IexecEscrowTokenFacet.sol/IexecEscrowTokenFacet.json => IexecEscrowFacet.sol/IexecEscrowFacet.json} (100%) rename abis/human-readable-abis/contracts/interfaces/{IexecEscrowToken.sol/IexecEscrowToken.json => IexecEscrow.sol/IexecEscrow.json} (100%) rename contracts/{IexecInterfaceToken.sol => IexecInterface.sol} (78%) rename contracts/facets/{IexecEscrowTokenFacet.sol => IexecEscrowFacet.sol} (98%) rename contracts/interfaces/{IexecEscrowToken.sol => IexecEscrow.sol} (97%) rename test/byContract/IexecEscrow/{IexecEscrowToken-receiveApproval.test.ts => IexecEscrow-receiveApproval.test.ts} (98%) rename test/byContract/IexecEscrow/{IexecEscrowToken.test.ts => IexecEscrow.test.ts} (98%) diff --git a/abis/contracts/IexecInterfaceToken.json b/abis/contracts/IexecInterface.json similarity index 100% rename from abis/contracts/IexecInterfaceToken.json rename to abis/contracts/IexecInterface.json diff --git a/abis/contracts/facets/IexecEscrowTokenFacet.json b/abis/contracts/facets/IexecEscrowFacet.json similarity index 100% rename from abis/contracts/facets/IexecEscrowTokenFacet.json rename to abis/contracts/facets/IexecEscrowFacet.json diff --git a/abis/contracts/interfaces/IexecEscrowToken.json b/abis/contracts/interfaces/IexecEscrow.json similarity index 100% rename from abis/contracts/interfaces/IexecEscrowToken.json rename to abis/contracts/interfaces/IexecEscrow.json diff --git a/abis/human-readable-abis/contracts/IexecInterfaceToken.sol/IexecInterfaceToken.json b/abis/human-readable-abis/contracts/IexecInterface.sol/IexecInterface.json similarity index 100% rename from abis/human-readable-abis/contracts/IexecInterfaceToken.sol/IexecInterfaceToken.json rename to abis/human-readable-abis/contracts/IexecInterface.sol/IexecInterface.json diff --git a/abis/human-readable-abis/contracts/facets/IexecEscrowTokenFacet.sol/IexecEscrowTokenFacet.json b/abis/human-readable-abis/contracts/facets/IexecEscrowFacet.sol/IexecEscrowFacet.json similarity index 100% rename from abis/human-readable-abis/contracts/facets/IexecEscrowTokenFacet.sol/IexecEscrowTokenFacet.json rename to abis/human-readable-abis/contracts/facets/IexecEscrowFacet.sol/IexecEscrowFacet.json diff --git a/abis/human-readable-abis/contracts/interfaces/IexecEscrowToken.sol/IexecEscrowToken.json b/abis/human-readable-abis/contracts/interfaces/IexecEscrow.sol/IexecEscrow.json similarity index 100% rename from abis/human-readable-abis/contracts/interfaces/IexecEscrowToken.sol/IexecEscrowToken.json rename to abis/human-readable-abis/contracts/interfaces/IexecEscrow.sol/IexecEscrow.json diff --git a/contracts/Diamond.sol b/contracts/Diamond.sol index 909e46a9a..1486f7f47 100644 --- a/contracts/Diamond.sol +++ b/contracts/Diamond.sol @@ -42,7 +42,7 @@ 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(); @@ -50,7 +50,7 @@ contract Diamond { /** * `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(); diff --git a/contracts/IexecInterfaceToken.sol b/contracts/IexecInterface.sol similarity index 78% rename from contracts/IexecInterfaceToken.sol rename to contracts/IexecInterface.sol index 5d0a70ce5..efd228dba 100644 --- a/contracts/IexecInterfaceToken.sol +++ b/contracts/IexecInterface.sol @@ -7,8 +7,8 @@ import {IexecAccessorsABILegacy} from "./interfaces/IexecAccessorsABILegacy.sol" import {IexecCategoryManager} from "./interfaces/IexecCategoryManager.sol"; import {IexecConfiguration} from "./interfaces/IexecConfiguration.sol"; import {IexecConfigurationExtra} from "./interfaces/IexecConfigurationExtra.sol"; +import {IexecEscrow} from "./interfaces/IexecEscrow.sol"; import {IexecEscrowEvents} from "./interfaces/IexecEscrowEvents.sol"; -import {IexecEscrowToken} from "./interfaces/IexecEscrowToken.sol"; import {IexecOrderManagement} from "./interfaces/IexecOrderManagement.sol"; import {IexecPoco1} from "./interfaces/IexecPoco1.sol"; import {IexecPoco1Errors} from "./interfaces/IexecPoco1Errors.sol"; @@ -20,23 +20,25 @@ 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`. + * the PoCo contracts. + * @dev Referenced in the SDK with the path `contracts/IexecInterface.sol`. * Changing the name or the path would cause a breaking change in the SDK. */ // 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 +// TODO Add the interfaces `IexecPocoBoost` and `IexecPocoBoostAccessors` once the Boost facets +// are deployed on every network. They are not deployed on Arbitrum mainnet nor on Arbitrum +// Sepolia today, so aggregating them here would make the SDK advertise functions that revert. +interface IexecInterface is IexecAccessorsABILegacy, IexecCategoryManager, IexecConfiguration, IexecConfigurationExtra, + IexecEscrow, IexecEscrowEvents, - IexecEscrowToken, IexecOrderManagement, IexecPoco1, IexecPoco1Errors, diff --git a/contracts/facets/IexecEscrowTokenFacet.sol b/contracts/facets/IexecEscrowFacet.sol similarity index 98% rename from contracts/facets/IexecEscrowTokenFacet.sol rename to contracts/facets/IexecEscrowFacet.sol index 2944e8dea..a5eaf3f7c 100644 --- a/contracts/facets/IexecEscrowTokenFacet.sol +++ b/contracts/facets/IexecEscrowFacet.sol @@ -5,7 +5,7 @@ pragma solidity ^0.8.0; import {FacetBase} from "../abstract/FacetBase.sol"; import {StakedRlcLib} from "../libs/StakedRlcLib.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"; @@ -23,8 +23,7 @@ import {PocoStorageLib} from "../libs/PocoStorageLib.sol"; * RLC, and the ERC-20 methods move it between accounts. The balance moves of the * escrow itself (lock, unlock, reward, seize) run over the same ledger. */ -// TODO rename to IexecEscrowFacet -contract IexecEscrowTokenFacet is IexecEscrowToken, IexecTokenSpender, FacetBase { +contract IexecEscrowFacet is IexecEscrow, IexecTokenSpender, FacetBase { /*************************************************************************** * Deposit and withdraw functions * ***************************************************************************/ diff --git a/contracts/facets/IexecPoco1Facet.sol b/contracts/facets/IexecPoco1Facet.sol index 03e4d9566..87917a36e 100644 --- a/contracts/facets/IexecPoco1Facet.sol +++ b/contracts/facets/IexecPoco1Facet.sol @@ -154,7 +154,7 @@ contract IexecPoco1Facet is IexecPoco1, IexecPoco1Errors, FacetBase { * @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. diff --git a/contracts/interfaces/IexecEscrowToken.sol b/contracts/interfaces/IexecEscrow.sol similarity index 97% rename from contracts/interfaces/IexecEscrowToken.sol rename to contracts/interfaces/IexecEscrow.sol index a25b49ed8..2a8d958dc 100644 --- a/contracts/interfaces/IexecEscrowToken.sol +++ b/contracts/interfaces/IexecEscrow.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.0; -interface IexecEscrowToken { +interface IexecEscrow { error UnsupportedOperation(bytes4 selector); error OperationFailed(); error CallerIsNotTheRequester(); diff --git a/contracts/interfaces/IexecPocoBoost.sol b/contracts/interfaces/IexecPocoBoost.sol index cf4367ad5..c66b7f887 100644 --- a/contracts/interfaces/IexecPocoBoost.sol +++ b/contracts/interfaces/IexecPocoBoost.sol @@ -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. diff --git a/contracts/interfaces/IexecPocoBoostAccessors.sol b/contracts/interfaces/IexecPocoBoostAccessors.sol index d25cbd3db..9cf19ca4d 100644 --- a/contracts/interfaces/IexecPocoBoostAccessors.sol +++ b/contracts/interfaces/IexecPocoBoostAccessors.sol @@ -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); } diff --git a/contracts/libs/StakedRlcLib.sol b/contracts/libs/StakedRlcLib.sol index fcbe1e41a..7ef7a0ff2 100644 --- a/contracts/libs/StakedRlcLib.sol +++ b/contracts/libs/StakedRlcLib.sol @@ -22,7 +22,7 @@ library StakedRlcLib { * @notice * This is the single implementation of an sRLC balance move. It backs both * the escrow operations of {EscrowLib} and the ERC-20 entry points of - * {IexecEscrowTokenFacet}. + * {IexecEscrowFacet}. * A self-transfer is a no-op on the balances and is not rejected. * * @param from The address of the spender account. diff --git a/deploy/0_deploy.ts b/deploy/0_deploy.ts index 011eb48d2..60c20c0e6 100644 --- a/deploy/0_deploy.ts +++ b/deploy/0_deploy.ts @@ -19,7 +19,7 @@ import { IexecCategoryManager__factory, IexecConfigurationExtraFacet__factory, IexecConfigurationFacet__factory, - IexecEscrowTokenFacet__factory, + IexecEscrowFacet__factory, IexecLibOrders_v5__factory, IexecOrderManagementFacet__factory, IexecPoco1Facet__factory, @@ -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(), diff --git a/docs/solidity/index.md b/docs/solidity/index.md index 7cbd1227b..65d4c4f4b 100644 --- a/docs/solidity/index.md +++ b/docs/solidity/index.md @@ -1,11 +1,11 @@ # 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`. +_Referenced in the SDK with the path `contracts/IexecInterface.sol`. Changing the name or the path would cause a breaking change in the SDK._ ## FacetBase @@ -68,7 +68,7 @@ function setTeeBroker(address _teebroker) external function setCallbackGas(uint256 _callbackgas) external ``` -## IexecEscrowTokenFacet +## IexecEscrowFacet Deposits of the base RLC token are held by the proxy and credited 1:1 as sRLC (ERC20 "Staked RLC"), managed by this facet manages. sRLC is not a @@ -304,7 +304,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 diff --git a/docs/uml/class-uml-IexecEscrows.svg b/docs/uml/class-uml-IexecEscrows.svg index 25eb235b6..b4a3e3a10 100644 --- a/docs/uml/class-uml-IexecEscrows.svg +++ b/docs/uml/class-uml-IexecEscrows.svg @@ -37,8 +37,8 @@ 8 -IexecEscrowTokenFacet -contracts/facets/IexecEscrowTokenFacet.sol +IexecEscrowFacet +contracts/facets/IexecEscrowFacet.sol Internal:    _executeOperation(sender: address, data: bytes) @@ -68,13 +68,13 @@ - + -23 +22 <<Interface>> -IexecEscrowToken -contracts/interfaces/IexecEscrowToken.sol +IexecEscrow +contracts/interfaces/IexecEscrow.sol External:     null() @@ -92,9 +92,9 @@     decreaseAllowance(address, uint256): bool     approveAndCall(address, uint256, bytes): bool - + -8->23 +8->22 diff --git a/docs/uml/class-uml-dir-facets.svg b/docs/uml/class-uml-dir-facets.svg index 7518ea546..83390cadb 100644 --- a/docs/uml/class-uml-dir-facets.svg +++ b/docs/uml/class-uml-dir-facets.svg @@ -67,8 +67,8 @@ 4 -IexecEscrowTokenFacet -contracts/facets/IexecEscrowTokenFacet.sol +IexecEscrowFacet +contracts/facets/IexecEscrowFacet.sol Internal:    _executeOperation(sender: address, data: bytes) diff --git a/scripts/set-callback-gas.ts b/scripts/set-callback-gas.ts index e545c4d25..30395c4cb 100644 --- a/scripts/set-callback-gas.ts +++ b/scripts/set-callback-gas.ts @@ -4,7 +4,7 @@ // Usage: CALLBACK_GAS= npx hardhat run scripts/set-callback-gas.ts --network import { ethers } from 'hardhat'; -import { IexecInterfaceToken__factory } from '../typechain'; +import { IexecInterface__factory } from '../typechain'; import config from '../utils/config'; import { getDeployerAndOwnerSigners } from '../utils/deploy-tools'; @@ -21,7 +21,7 @@ import { getDeployerAndOwnerSigners } from '../utils/deploy-tools'; } console.log(`Diamond proxy address: ${proxyAddress}`); const { owner } = await getDeployerAndOwnerSigners(); - const iexecPoCo = IexecInterfaceToken__factory.connect(proxyAddress, owner); + const iexecPoCo = IexecInterface__factory.connect(proxyAddress, owner); if ((await iexecPoCo.owner()) !== owner.address) { throw new Error(`Sender account ${owner.address} is not the PoCo owner.`); } diff --git a/scripts/tools/sol-to-uml.mjs b/scripts/tools/sol-to-uml.mjs index 0b7820954..aa49b8bc5 100644 --- a/scripts/tools/sol-to-uml.mjs +++ b/scripts/tools/sol-to-uml.mjs @@ -13,7 +13,7 @@ await generateClassDiagramOfDirectory('registries'); await generateClassDiagramOfContracts(['IexecPoco1Facet', 'IexecPoco2Facet'], 'IexecPocoFacets'); -await generateClassDiagramOfContracts(['IexecEscrowTokenFacet', 'EscrowLib'], 'IexecEscrows'); +await generateClassDiagramOfContracts(['IexecEscrowFacet', 'EscrowLib'], 'IexecEscrows'); await generateClassDiagramOfContracts(['IexecPocoBoostFacet'], 'IexecPocoBoostFacet'); diff --git a/scripts/upgrades/v6.2.0.ts b/scripts/upgrades/v6.2.0.ts index 3b5b2aec1..06a0d631b 100644 --- a/scripts/upgrades/v6.2.0.ts +++ b/scripts/upgrades/v6.2.0.ts @@ -6,7 +6,7 @@ import { IexecCategoryManagerFacet__factory, IexecConfigurationExtraFacet__factory, IexecConfigurationFacet__factory, - IexecEscrowTokenFacet__factory, + IexecEscrowFacet__factory, IexecOrderManagementFacet__factory, IexecPoco1Facet__factory, IexecPoco2Facet__factory, @@ -39,7 +39,7 @@ async function main() { IexecConfigurationExtraFacet: '0x7Ff117E7385Ac3E207AF1791fE7e66C7802aeCCd', IexecConfigurationFacet: '0x88eb05e62434057d3AA9e41FdaF7300A586b314D', IexecERC20Facet: '0xB0152eC6f48E64a92B66D4736aFA1b02d8D45169', // Removed from codebase - IexecEscrowTokenFacet: '0xd9EB17A161581FBBAD2Ae998c0C19746EaAD0D6E', + IexecEscrowFacet: '0xd9EB17A161581FBBAD2Ae998c0C19746EaAD0D6E', IexecOrderManagementFacet: '0x541d532E6C195Ba044a75325F367342f523627fB', IexecPoco1Facet: '0xC8dE3913fcdBC576970dCe24eE416CA25681f65f', IexecPoco2Facet: '0x5c7B589E6807B554ed278f335215B93bCB692162', @@ -53,7 +53,7 @@ async function main() { IexecConfigurationExtraFacet: '0x7Ff117E7385Ac3E207AF1791fE7e66C7802aeCCd', IexecConfigurationFacet: '0x88eb05e62434057d3AA9e41FdaF7300A586b314D', IexecERC20Facet: '0xB0152eC6f48E64a92B66D4736aFA1b02d8D45169', // Removed from codebase - IexecEscrowTokenFacet: '0xd9EB17A161581FBBAD2Ae998c0C19746EaAD0D6E', + IexecEscrowFacet: '0xd9EB17A161581FBBAD2Ae998c0C19746EaAD0D6E', IexecOrderManagementFacet: '0x541d532E6C195Ba044a75325F367342f523627fB', IexecPoco1Facet: '0x5331c0FC7DD0Cc08047B546675cd1d6d47152AEb', IexecPoco2Facet: '0x5c7B589E6807B554ed278f335215B93bCB692162', @@ -96,8 +96,8 @@ async function main() { factory: null, }, { - name: 'IexecEscrowTokenFacet', - address: addresses['IexecEscrowTokenFacet'], + name: 'IexecEscrowFacet', + address: addresses['IexecEscrowFacet'], factory: null, }, { @@ -150,9 +150,9 @@ async function main() { factory: new IexecConfigurationFacet__factory(iexecLibOrders), }, { - name: 'IexecEscrowTokenFacet', + name: 'IexecEscrowFacet', address: null, - factory: new IexecEscrowTokenFacet__factory(), + factory: new IexecEscrowFacet__factory(), }, { name: 'IexecOrderManagementFacet', diff --git a/test/000_fullchain-boost.test.ts b/test/000_fullchain-boost.test.ts index 6834332a7..186cc9e61 100644 --- a/test/000_fullchain-boost.test.ts +++ b/test/000_fullchain-boost.test.ts @@ -8,8 +8,8 @@ import { TypedDataDomain } from 'ethers'; import hre from 'hardhat'; import { IWorkerpool__factory, - IexecInterfaceToken, - IexecInterfaceToken__factory, + IexecInterface, + IexecInterface__factory, IexecOrderManagement__factory, IexecPocoBoostAccessorsFacet__factory, IexecPocoBoostFacet, @@ -50,7 +50,7 @@ const workerpoolPrice = 1_000_000_000n; describe('IexecPocoBoostFacet (IT)', function () { let domain: TypedDataDomain; let proxyAddress: string; - let iexecInstance: IexecInterfaceToken; + let iexecInstance: IexecInterface; let iexecPocoBoostInstance: IexecPocoBoostFacet; let iexecWrapper: IexecWrapper; let appAddress = ''; @@ -88,7 +88,7 @@ describe('IexecPocoBoostFacet (IT)', function () { requester: requester, }; iexecPocoBoostInstance = IexecPocoBoostFacet__factory.connect(proxyAddress, owner); - iexecInstance = IexecInterfaceToken__factory.connect(proxyAddress, anyone); + iexecInstance = IexecInterface__factory.connect(proxyAddress, anyone); domain = { name: 'iExecODB', version: '5.0.0', diff --git a/test/000_fullchain.test.ts b/test/000_fullchain.test.ts index 34644a559..ddda44e86 100644 --- a/test/000_fullchain.test.ts +++ b/test/000_fullchain.test.ts @@ -4,7 +4,7 @@ import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { expect } from 'chai'; -import { IexecInterfaceToken, IexecInterfaceToken__factory } from '../typechain'; +import { IexecInterface, IexecInterface__factory } from '../typechain'; import { TAG_STANDARD, TAG_TEE } from '../utils/constants'; import { OrdersActors, OrdersAssets, OrdersPrices, buildOrders } from '../utils/createOrders'; import { @@ -38,7 +38,7 @@ const { results, resultDigest } = buildUtf8ResultAndDigest('result'); const { resultsCallback, callbackResultDigest } = buildResultCallbackAndDigest(123); let proxyAddress: string; -let iexecPoco: IexecInterfaceToken; +let iexecPoco: IexecInterface; let iexecWrapper: IexecWrapper; let [appAddress, workerpoolAddress, datasetAddress]: string[] = []; let [ @@ -85,7 +85,7 @@ describe('Integration tests', function () { } = accounts); iexecWrapper = new IexecWrapper(proxyAddress, accounts); ({ appAddress, datasetAddress, workerpoolAddress } = await iexecWrapper.createAssets()); - iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, anyone); + iexecPoco = IexecInterface__factory.connect(proxyAddress, anyone); ordersActors = { appOwner: appProvider, datasetOwner: datasetProvider, diff --git a/test/200_fullchain-bot.test.ts b/test/200_fullchain-bot.test.ts index 70b1b5548..9012ac825 100644 --- a/test/200_fullchain-bot.test.ts +++ b/test/200_fullchain-bot.test.ts @@ -4,7 +4,7 @@ import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { expect } from 'chai'; -import { IexecInterfaceToken, IexecInterfaceToken__factory } from '../typechain'; +import { IexecInterface, IexecInterface__factory } from '../typechain'; import { TAG_STANDARD } from '../utils/constants'; import { OrdersActors, OrdersAssets, OrdersPrices, buildOrders } from '../utils/createOrders'; import { TaskStatusEnum, buildUtf8ResultAndDigest, getIexecAccounts } from '../utils/poco-tools'; @@ -16,7 +16,7 @@ const datasetPrice = 1_000_000n; const workerpoolPrice = 1_000_000_000n; let proxyAddress: string; -let iexecPoco: IexecInterfaceToken; +let iexecPoco: IexecInterface; let iexecWrapper: IexecWrapper; let [appAddress, workerpoolAddress, datasetAddress]: string[] = []; let [ @@ -59,7 +59,7 @@ describe('Integration tests', function () { } = accounts); iexecWrapper = new IexecWrapper(proxyAddress, accounts); ({ appAddress, datasetAddress, workerpoolAddress } = await iexecWrapper.createAssets()); - iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, anyone); + iexecPoco = IexecInterface__factory.connect(proxyAddress, anyone); ordersActors = { appOwner: appProvider, datasetOwner: datasetProvider, diff --git a/test/201_fullchain-multi-orders.test.ts b/test/201_fullchain-multi-orders.test.ts index 12c0ff185..4a0c5a649 100644 --- a/test/201_fullchain-multi-orders.test.ts +++ b/test/201_fullchain-multi-orders.test.ts @@ -5,7 +5,7 @@ import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { expect } from 'chai'; import { ethers } from 'hardhat'; -import { IexecInterfaceToken, IexecInterfaceToken__factory } from '../typechain'; +import { IexecInterface, IexecInterface__factory } from '../typechain'; import { TAG_STANDARD } from '../utils/constants'; import { IexecOrders, @@ -31,7 +31,7 @@ const workerpoolPrice2 = 1_000_000_025n; const { results, resultDigest } = buildUtf8ResultAndDigest('result'); let proxyAddress: string; -let iexecPoco: IexecInterfaceToken; +let iexecPoco: IexecInterface; let iexecWrapper: IexecWrapper; let [appAddress, workerpoolAddress, datasetAddress]: string[] = []; let [requester, appProvider, datasetProvider, scheduler, anyone, worker1]: SignerWithAddress[] = []; @@ -52,7 +52,7 @@ describe('Integration tests', function () { ({ requester, appProvider, datasetProvider, scheduler, anyone, worker1 } = accounts); iexecWrapper = new IexecWrapper(proxyAddress, accounts); ({ appAddress, datasetAddress, workerpoolAddress } = await iexecWrapper.createAssets()); - iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, ethers.provider); + iexecPoco = IexecInterface__factory.connect(proxyAddress, ethers.provider); ordersActors = { appOwner: appProvider, datasetOwner: datasetProvider, diff --git a/test/300_fullchain-reopen.test.ts b/test/300_fullchain-reopen.test.ts index 1ada1587e..960e916d1 100644 --- a/test/300_fullchain-reopen.test.ts +++ b/test/300_fullchain-reopen.test.ts @@ -6,7 +6,7 @@ import { loadFixture, mine } from '@nomicfoundation/hardhat-network-helpers'; import { setNextBlockTimestamp } from '@nomicfoundation/hardhat-network-helpers/dist/src/helpers/time'; import { expect } from 'chai'; import { ZeroAddress } from 'ethers'; -import { IexecInterfaceToken, IexecInterfaceToken__factory } from '../typechain'; +import { IexecInterface, IexecInterface__factory } from '../typechain'; import { OrdersActors, OrdersAssets, OrdersPrices, buildOrders } from '../utils/createOrders'; import { loadHardhatFixtureDeployment } from './utils/hardhat-fixture-deployer'; @@ -26,7 +26,7 @@ const workerpoolPrice = 1_000_000_000n; const { results, resultDigest } = buildUtf8ResultAndDigest('result'); let proxyAddress: string; -let [iexecPoco, iexecPocoAsScheduler]: IexecInterfaceToken[] = []; +let [iexecPoco, iexecPocoAsScheduler]: IexecInterface[] = []; let iexecWrapper: IexecWrapper; let [appAddress, workerpoolAddress, datasetAddress]: string[] = []; let [ @@ -67,7 +67,7 @@ describe('Integration tests', function () { } = accounts); iexecWrapper = new IexecWrapper(proxyAddress, accounts); ({ appAddress, datasetAddress, workerpoolAddress } = await iexecWrapper.createAssets()); - iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, anyone); + iexecPoco = IexecInterface__factory.connect(proxyAddress, anyone); iexecPocoAsScheduler = iexecPoco.connect(scheduler); ordersActors = { appOwner: appProvider, diff --git a/test/byContract/IexecAccessors/IexecAccessorsABILegacy.test.ts b/test/byContract/IexecAccessors/IexecAccessorsABILegacy.test.ts index db96e062e..bbff2654c 100644 --- a/test/byContract/IexecAccessors/IexecAccessorsABILegacy.test.ts +++ b/test/byContract/IexecAccessors/IexecAccessorsABILegacy.test.ts @@ -5,7 +5,7 @@ import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { expect } from 'chai'; import { Wallet, ZeroAddress } from 'ethers'; -import { IexecInterfaceToken, IexecInterfaceToken__factory } from '../../../typechain'; +import { IexecInterface, IexecInterface__factory } from '../../../typechain'; import { TAG_STANDARD } from '../../../utils/constants'; import { OrdersAssets, OrdersPrices, buildOrders } from '../../../utils/createOrders'; import { @@ -30,7 +30,7 @@ const { resultDigest } = buildUtf8ResultAndDigest('result'); const taskIndex = 0n; let proxyAddress: string; -let iexecPocoABILegacy: IexecInterfaceToken; +let iexecPocoABILegacy: IexecInterface; let iexecWrapper: IexecWrapper; let [appAddress, workerpoolAddress, datasetAddress]: string[] = []; let [ @@ -60,7 +60,7 @@ describe('IexecAccessorsABILegacy', function () { accounts); iexecWrapper = new IexecWrapper(proxyAddress, accounts); ({ appAddress, datasetAddress, workerpoolAddress } = await iexecWrapper.createAssets()); - iexecPocoABILegacy = IexecInterfaceToken__factory.connect(proxyAddress, anyone); + iexecPocoABILegacy = IexecInterface__factory.connect(proxyAddress, anyone); ordersAssets = { app: appAddress, dataset: datasetAddress, diff --git a/test/byContract/IexecCategoryManager/IexecCategoryManager.test.ts b/test/byContract/IexecCategoryManager/IexecCategoryManager.test.ts index b92b01b18..14dc8d27f 100644 --- a/test/byContract/IexecCategoryManager/IexecCategoryManager.test.ts +++ b/test/byContract/IexecCategoryManager/IexecCategoryManager.test.ts @@ -4,7 +4,7 @@ import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { expect } from 'chai'; -import { IexecInterfaceToken, IexecInterfaceToken__factory } from '../../../typechain'; +import { IexecInterface, IexecInterface__factory } from '../../../typechain'; import config from '../../../utils/config'; import { getIexecAccounts } from '../../../utils/poco-tools'; import { loadHardhatFixtureDeployment } from '../../utils/hardhat-fixture-deployer'; @@ -16,7 +16,7 @@ const args = [name, description, timeRef] as [string, string, number]; describe('CategoryManager', async () => { let proxyAddress: string; - let [iexecPoco, iexecPocoAsAnyone]: IexecInterfaceToken[] = []; + let [iexecPoco, iexecPocoAsAnyone]: IexecInterface[] = []; let [iexecAdmin, anyone]: SignerWithAddress[] = []; beforeEach('Deploy', async () => { @@ -29,7 +29,7 @@ describe('CategoryManager', async () => { async function initFixture() { const accounts = await getIexecAccounts(); ({ iexecAdmin, anyone } = accounts); - iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, iexecAdmin); + iexecPoco = IexecInterface__factory.connect(proxyAddress, iexecAdmin); iexecPocoAsAnyone = iexecPoco.connect(anyone); } diff --git a/test/byContract/IexecConfiguration/IexecConfiguration.test.ts b/test/byContract/IexecConfiguration/IexecConfiguration.test.ts index d79f51365..d87ae2f2b 100644 --- a/test/byContract/IexecConfiguration/IexecConfiguration.test.ts +++ b/test/byContract/IexecConfiguration/IexecConfiguration.test.ts @@ -9,8 +9,8 @@ import { ethers } from 'hardhat'; import { IexecConfigurationExtra, IexecConfigurationExtra__factory, - IexecInterfaceToken, - IexecInterfaceToken__factory, + IexecInterface, + IexecInterface__factory, } from '../../../typechain'; import { getIexecAccounts } from '../../../utils/poco-tools'; import { getPocoStorageSlotLocation } from '../../../utils/proxy-tools'; @@ -41,7 +41,7 @@ const someDomainSeparator = '0x0000000000000000000000000000000000000000000000000 describe('IexecConfiguration', async () => { let proxyAddress: string; - let [iexecPoco, iexecPocoAsAdmin]: IexecInterfaceToken[] = []; + let [iexecPoco, iexecPocoAsAdmin]: IexecInterface[] = []; let iexecConfigurationExtra: IexecConfigurationExtra; let [iexecAdmin, worker, anyone]: SignerWithAddress[] = []; @@ -53,7 +53,7 @@ describe('IexecConfiguration', async () => { async function initFixture() { const accounts = await getIexecAccounts(); ({ iexecAdmin, worker, anyone } = accounts); - iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, anyone); + iexecPoco = IexecInterface__factory.connect(proxyAddress, anyone); iexecPocoAsAdmin = iexecPoco.connect(iexecAdmin); iexecConfigurationExtra = IexecConfigurationExtra__factory.connect(proxyAddress, anyone); } diff --git a/test/byContract/IexecERC20/IexecERC20.test.ts b/test/byContract/IexecERC20/IexecERC20.test.ts index 6b015f438..ef69d0baa 100644 --- a/test/byContract/IexecERC20/IexecERC20.test.ts +++ b/test/byContract/IexecERC20/IexecERC20.test.ts @@ -7,8 +7,8 @@ import { expect } from 'chai'; import { AddressLike, ZeroAddress } from 'ethers'; import { ethers } from 'hardhat'; import { - IexecInterfaceToken, - IexecInterfaceToken__factory, + IexecInterface, + IexecInterface__factory, TestReceiver, TestReceiver__factory, } from '../../../typechain'; @@ -22,7 +22,7 @@ const value = 100n; describe('ERC20', async () => { let proxyAddress: string; let iexecWrapper: IexecWrapper; - let [iexecPoco, iexecPocoAsHolder, iexecPocoAsSpender]: IexecInterfaceToken[] = []; + let [iexecPoco, iexecPocoAsHolder, iexecPocoAsSpender]: IexecInterface[] = []; let [holder, recipient, spender, anyone, zeroAddressSigner]: SignerWithAddress[] = []; let totalSupplyBeforeFirstDeposit: bigint; @@ -41,7 +41,7 @@ describe('ERC20', async () => { zeroAddressSigner = await ethers.getImpersonatedSigner(ZeroAddress); await setZeroAddressBalance(); iexecWrapper = new IexecWrapper(proxyAddress, accounts); - iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, anyone); + iexecPoco = IexecInterface__factory.connect(proxyAddress, anyone); iexecPocoAsHolder = iexecPoco.connect(holder); iexecPocoAsSpender = iexecPoco.connect(spender); totalSupplyBeforeFirstDeposit = await iexecPoco.totalSupply(); diff --git a/test/byContract/IexecEscrow/IexecEscrowToken-receiveApproval.test.ts b/test/byContract/IexecEscrow/IexecEscrow-receiveApproval.test.ts similarity index 98% rename from test/byContract/IexecEscrow/IexecEscrowToken-receiveApproval.test.ts rename to test/byContract/IexecEscrow/IexecEscrow-receiveApproval.test.ts index 92c520dce..c73f8428b 100644 --- a/test/byContract/IexecEscrow/IexecEscrowToken-receiveApproval.test.ts +++ b/test/byContract/IexecEscrow/IexecEscrow-receiveApproval.test.ts @@ -9,8 +9,8 @@ import { ethers } from 'hardhat'; import { FacetCutAction } from 'hardhat-deploy/dist/types'; import { DiamondCutFacet__factory, - IexecInterfaceToken, - IexecInterfaceToken__factory, + IexecInterface, + IexecInterface__factory, MatchOrdersFacetMock__factory, RLC, RLC__factory, @@ -35,7 +35,7 @@ const workerpoolPrice = 1_000_000_000n; const volume = 1n; let proxyAddress: string; -let iexecPoco: IexecInterfaceToken; +let iexecPoco: IexecInterface; let rlcInstance: RLC; let rlcInstanceAsRequester: RLC; let [iexecAdmin, requester, scheduler, appProvider, datasetProvider, anyone]: SignerWithAddress[] = @@ -46,7 +46,7 @@ let ordersActors: OrdersActors; let ordersAssets: OrdersAssets; let ordersPrices: OrdersPrices; -describe('IexecEscrowToken-receiveApproval', () => { +describe('IexecEscrow-receiveApproval', () => { beforeEach('Deploy', async () => { proxyAddress = await loadHardhatFixtureDeployment(); await loadFixture(initFixture); @@ -56,7 +56,7 @@ describe('IexecEscrowToken-receiveApproval', () => { const accounts = await getIexecAccounts(); ({ iexecAdmin, requester, scheduler, appProvider, datasetProvider, anyone } = accounts); - iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, anyone); + iexecPoco = IexecInterface__factory.connect(proxyAddress, anyone); rlcInstance = RLC__factory.connect(await iexecPoco.token(), anyone); rlcInstanceAsRequester = rlcInstance.connect(requester); @@ -519,7 +519,7 @@ describe('IexecEscrowToken-receiveApproval', () => { */ async function matchOrdersCalldata(orders: IexecOrders) { // Calldata can also be created using - // IexecInterfaceToken__factory.createInterface().encodeFunctionData('matchOrders', orders); + // IexecInterface__factory.createInterface().encodeFunctionData('matchOrders', orders); return await iexecPoco.matchOrders .populateTransaction(...orders.toArray()) .then((tx) => tx.data); diff --git a/test/byContract/IexecEscrow/IexecEscrowToken.test.ts b/test/byContract/IexecEscrow/IexecEscrow.test.ts similarity index 98% rename from test/byContract/IexecEscrow/IexecEscrowToken.test.ts rename to test/byContract/IexecEscrow/IexecEscrow.test.ts index 10978d2ec..626135fea 100644 --- a/test/byContract/IexecEscrow/IexecEscrowToken.test.ts +++ b/test/byContract/IexecEscrow/IexecEscrow.test.ts @@ -6,21 +6,16 @@ import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { expect } from 'chai'; import { ethers } from 'hardhat'; -import { - IexecInterfaceToken, - IexecInterfaceToken__factory, - RLC, - RLC__factory, -} from '../../../typechain'; +import { IexecInterface, IexecInterface__factory, RLC, RLC__factory } from '../../../typechain'; import { getIexecAccounts } from '../../../utils/poco-tools'; import { loadHardhatFixtureDeployment } from '../../utils/hardhat-fixture-deployer'; import { setZeroAddressBalance } from '../../utils/utils'; const amount = ethers.parseUnits('100', 9); -describe('IexecEscrowToken', () => { +describe('IexecEscrow', () => { let proxyAddress: string; - let [iexecPoco, , iexecPocoAsAccountA, iexecPocoAsAdmin]: IexecInterfaceToken[] = []; + let [iexecPoco, , iexecPocoAsAccountA, iexecPocoAsAdmin]: IexecInterface[] = []; let [iexecAdmin, accountA, accountB, accountC, anyone]: SignerWithAddress[] = []; let [rlcInstance, rlcInstanceAsAccountA]: RLC[] = []; @@ -39,7 +34,7 @@ describe('IexecEscrowToken', () => { anyone, } = accounts); - iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, anyone); + iexecPoco = IexecInterface__factory.connect(proxyAddress, anyone); iexecPocoAsAccountA = iexecPoco.connect(accountA); iexecPocoAsAdmin = iexecPoco.connect(iexecAdmin); rlcInstance = RLC__factory.connect(await iexecPoco.token(), anyone); diff --git a/test/byContract/IexecOrderManagement/IexecOrderManagement.test.ts b/test/byContract/IexecOrderManagement/IexecOrderManagement.test.ts index 7b58ad427..844e97291 100644 --- a/test/byContract/IexecOrderManagement/IexecOrderManagement.test.ts +++ b/test/byContract/IexecOrderManagement/IexecOrderManagement.test.ts @@ -5,11 +5,7 @@ import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { expect } from 'chai'; import { ethers } from 'hardhat'; -import { - IexecInterfaceToken, - IexecInterfaceToken__factory, - IexecLibOrders_v5, -} from '../../../typechain'; +import { IexecInterface, IexecInterface__factory, IexecLibOrders_v5 } from '../../../typechain'; import { NULL } from '../../../utils/constants'; import { buildOrders, createOrderOperation } from '../../../utils/createOrders'; import { OrderOperationEnum, getIexecAccounts } from '../../../utils/poco-tools'; @@ -27,7 +23,7 @@ describe('OrderManagement', async () => { iexecPocoAsDatasetProvider, iexecPocoAsScheduler, iexecPocoAsRequester, - ]: IexecInterfaceToken[] = []; + ]: IexecInterface[] = []; let iexecWrapper: IexecWrapper; let [anyone, appProvider, datasetProvider, scheduler, requester]: SignerWithAddress[] = []; let appOrder: IexecLibOrders_v5.AppOrderStruct; @@ -46,7 +42,7 @@ describe('OrderManagement', async () => { ({ appProvider, datasetProvider, scheduler, requester, anyone } = accounts); iexecWrapper = new IexecWrapper(proxyAddress, accounts); const { appAddress, datasetAddress, workerpoolAddress } = await iexecWrapper.createAssets(); - iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, anyone); + iexecPoco = IexecInterface__factory.connect(proxyAddress, anyone); iexecPocoAsAppProvider = iexecPoco.connect(appProvider); iexecPocoAsDatasetProvider = iexecPoco.connect(datasetProvider); iexecPocoAsScheduler = iexecPoco.connect(scheduler); diff --git a/test/byContract/IexecPoco/IexecPoco1.test.ts b/test/byContract/IexecPoco/IexecPoco1.test.ts index 6cb07c235..8e25c2f71 100644 --- a/test/byContract/IexecPoco/IexecPoco1.test.ts +++ b/test/byContract/IexecPoco/IexecPoco1.test.ts @@ -9,8 +9,8 @@ import { ethers } from 'hardhat'; import { ERC1271Mock__factory, IERC721__factory, - IexecInterfaceToken, - IexecInterfaceToken__factory, + IexecInterface, + IexecInterface__factory, IexecLibOrders_v5, IexecPocoAccessors, IexecPocoAccessors__factory, @@ -66,8 +66,8 @@ const someWallet = Wallet.createRandom(); describe('IexecPoco1', () => { let proxyAddress: string; - let [iexecPoco, iexecPocoAsRequester]: IexecInterfaceToken[] = []; - let iexecPocoAsSponsor: IexecInterfaceToken; + let [iexecPoco, iexecPocoAsRequester]: IexecInterface[] = []; + let iexecPocoAsSponsor: IexecInterface; let iexecPocoAccessors: IexecPocoAccessors; let iexecPocoContract: Contract; let iexecWrapper: IexecWrapper; @@ -113,7 +113,7 @@ describe('IexecPoco1', () => { accounts); iexecWrapper = new IexecWrapper(proxyAddress, accounts); ({ appAddress, datasetAddress, workerpoolAddress } = await iexecWrapper.createAssets()); - iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, anyone); + iexecPoco = IexecInterface__factory.connect(proxyAddress, anyone); iexecPocoAsRequester = iexecPoco.connect(requester); iexecPocoAsSponsor = iexecPoco.connect(sponsor); iexecPocoAccessors = IexecPocoAccessors__factory.connect(proxyAddress, ethers.provider); diff --git a/test/byContract/IexecPoco/IexecPoco2-claim.test.ts b/test/byContract/IexecPoco/IexecPoco2-claim.test.ts index 98da268c4..5955529ee 100644 --- a/test/byContract/IexecPoco/IexecPoco2-claim.test.ts +++ b/test/byContract/IexecPoco/IexecPoco2-claim.test.ts @@ -5,7 +5,7 @@ import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; import { loadFixture, mine, time } from '@nomicfoundation/hardhat-network-helpers'; import { expect } from 'chai'; import { ZeroAddress, ethers } from 'ethers'; -import { IexecInterfaceToken, IexecInterfaceToken__factory } from '../../../typechain'; +import { IexecInterface, IexecInterface__factory } from '../../../typechain'; import { OrdersAssets, OrdersPrices, buildOrders } from '../../../utils/createOrders'; import { TaskStatusEnum, @@ -30,8 +30,8 @@ const enclaveAddress = ZeroAddress; describe('IexecPoco2#claim', async () => { let proxyAddress: string; - let iexecPoco: IexecInterfaceToken; - let iexecPocoAsAnyone: IexecInterfaceToken; + let iexecPoco: IexecInterface; + let iexecPocoAsAnyone: IexecInterface; let iexecWrapper: IexecWrapper; let [appAddress, datasetAddress, workerpoolAddress]: string[] = []; let [iexecAdmin, requester, sponsor, scheduler, worker1, worker2, anyone]: SignerWithAddress[] = @@ -52,7 +52,7 @@ describe('IexecPoco2#claim', async () => { iexecWrapper = new IexecWrapper(proxyAddress, accounts); ({ appAddress, datasetAddress, workerpoolAddress } = await iexecWrapper.createAssets()); await iexecWrapper.setTeeBroker('0x0000000000000000000000000000000000000000'); - iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, iexecAdmin); + iexecPoco = IexecInterface__factory.connect(proxyAddress, iexecAdmin); iexecPocoAsAnyone = iexecPoco.connect(anyone); ordersAssets = { app: appAddress, diff --git a/test/byContract/IexecPoco/IexecPoco2-contribute-and-finalize.test.ts b/test/byContract/IexecPoco/IexecPoco2-contribute-and-finalize.test.ts index 270c197fe..6a07801ea 100644 --- a/test/byContract/IexecPoco/IexecPoco2-contribute-and-finalize.test.ts +++ b/test/byContract/IexecPoco/IexecPoco2-contribute-and-finalize.test.ts @@ -5,11 +5,7 @@ import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; import { loadFixture, time } from '@nomicfoundation/hardhat-network-helpers'; import { expect } from 'chai'; import { Wallet, ZeroAddress, ethers } from 'ethers'; -import { - IexecInterfaceToken, - IexecInterfaceToken__factory, - TestClient__factory, -} from '../../../typechain'; +import { IexecInterface, IexecInterface__factory, TestClient__factory } from '../../../typechain'; import config from '../../../utils/config'; import { TAG_STANDARD, TAG_TEE } from '../../../utils/constants'; import { OrdersAssets, OrdersPrices, buildOrders } from '../../../utils/createOrders'; @@ -41,7 +37,7 @@ const noResultsData = '0x'; const { results, resultDigest } = buildUtf8ResultAndDigest('result'); let proxyAddress: string; -let [iexecPoco, iexecPocoAsWorker]: IexecInterfaceToken[] = []; +let [iexecPoco, iexecPocoAsWorker]: IexecInterface[] = []; let iexecWrapper: IexecWrapper; let [ requester, @@ -70,7 +66,7 @@ describe('IexecPoco2#contributeAndFinalize', () => { accounts); iexecWrapper = new IexecWrapper(proxyAddress, accounts); const { appAddress, datasetAddress, workerpoolAddress } = await iexecWrapper.createAssets(); - iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, anyone); + iexecPoco = IexecInterface__factory.connect(proxyAddress, anyone); iexecPocoAsWorker = iexecPoco.connect(worker); const appPrice = 1000n; const datasetPrice = 1_000_000n; diff --git a/test/byContract/IexecPoco/IexecPoco2-contribute.test.ts b/test/byContract/IexecPoco/IexecPoco2-contribute.test.ts index a8931ed6a..34bb12959 100644 --- a/test/byContract/IexecPoco/IexecPoco2-contribute.test.ts +++ b/test/byContract/IexecPoco/IexecPoco2-contribute.test.ts @@ -5,7 +5,7 @@ import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; import { loadFixture, time } from '@nomicfoundation/hardhat-network-helpers'; import { assert, expect } from 'chai'; import { ZeroAddress } from 'ethers'; -import { IexecInterfaceToken, IexecInterfaceToken__factory } from '../../../typechain'; +import { IexecInterface, IexecInterface__factory } from '../../../typechain'; import config from '../../../utils/config'; import { NULL, TAG_STANDARD, TAG_TEE } from '../../../utils/constants'; import { IexecOrders, OrdersAssets, OrdersPrices, buildOrders } from '../../../utils/createOrders'; @@ -32,7 +32,7 @@ const emptyEnclaveSignature = NULL.SIGNATURE; describe('IexecPoco2#contribute', () => { let proxyAddress: string; - let [iexecPoco, iexecPocoAsWorker]: IexecInterfaceToken[] = []; + let [iexecPoco, iexecPocoAsWorker]: IexecInterface[] = []; let iexecWrapper: IexecWrapper; let [ anyone, @@ -71,7 +71,7 @@ describe('IexecPoco2#contribute', () => { } = accounts); iexecWrapper = new IexecWrapper(proxyAddress, accounts); const { appAddress, datasetAddress, workerpoolAddress } = await iexecWrapper.createAssets(); - iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, anyone); + iexecPoco = IexecInterface__factory.connect(proxyAddress, anyone); iexecPocoAsWorker = iexecPoco.connect(worker); const appPrice = 1000n; const datasetPrice = 1_000_000n; diff --git a/test/byContract/IexecPoco/IexecPoco2-finalize.test.ts b/test/byContract/IexecPoco/IexecPoco2-finalize.test.ts index 0c1a25930..bfa46d025 100644 --- a/test/byContract/IexecPoco/IexecPoco2-finalize.test.ts +++ b/test/byContract/IexecPoco/IexecPoco2-finalize.test.ts @@ -7,8 +7,8 @@ import { expect } from 'chai'; import { AbiCoder, Wallet, ZeroAddress } from 'ethers'; import { ethers } from 'hardhat'; import { - IexecInterfaceToken, - IexecInterfaceToken__factory, + IexecInterface, + IexecInterface__factory, OwnableMock__factory, TestClient__factory, } from '../../../typechain'; @@ -38,7 +38,7 @@ const emptyEnclaveSignature = '0x'; describe('IexecPoco2#finalize', async () => { let proxyAddress: string; - let [iexecPoco, iexecPocoAsScheduler]: IexecInterfaceToken[] = []; + let [iexecPoco, iexecPocoAsScheduler]: IexecInterface[] = []; let iexecWrapper: IexecWrapper; let [appAddress, datasetAddress, workerpoolAddress]: string[] = []; let [ @@ -80,7 +80,7 @@ describe('IexecPoco2#finalize', async () => { iexecWrapper = new IexecWrapper(proxyAddress, accounts); ({ appAddress, datasetAddress, workerpoolAddress } = await iexecWrapper.createAssets()); await iexecWrapper.setTeeBroker('0x0000000000000000000000000000000000000000'); - iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, anyone); + iexecPoco = IexecInterface__factory.connect(proxyAddress, anyone); iexecPocoAsScheduler = iexecPoco.connect(scheduler); ordersAssets = { app: appAddress, diff --git a/test/byContract/IexecPoco/IexecPoco2-initialize.test.ts b/test/byContract/IexecPoco/IexecPoco2-initialize.test.ts index 7752da19c..86b546ec4 100644 --- a/test/byContract/IexecPoco/IexecPoco2-initialize.test.ts +++ b/test/byContract/IexecPoco/IexecPoco2-initialize.test.ts @@ -5,7 +5,7 @@ import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { expect } from 'chai'; import { ethers } from 'hardhat'; -import { IexecInterfaceToken, IexecInterfaceToken__factory } from '../../../typechain'; +import { IexecInterface, IexecInterface__factory } from '../../../typechain'; import { OrdersAssets, OrdersPrices, @@ -23,8 +23,8 @@ const workerpoolPrice = 1_000_000_000n; describe('IexecPoco2#initialize', async () => { let proxyAddress: string; - let iexecPoco: IexecInterfaceToken; - let iexecPocoAsAnyone: IexecInterfaceToken; + let iexecPoco: IexecInterface; + let iexecPocoAsAnyone: IexecInterface; let iexecWrapper: IexecWrapper; let [appAddress, datasetAddress, workerpoolAddress]: string[] = []; let [iexecAdmin, requester, anyone]: SignerWithAddress[] = []; @@ -44,7 +44,7 @@ describe('IexecPoco2#initialize', async () => { iexecWrapper = new IexecWrapper(proxyAddress, accounts); ({ appAddress, datasetAddress, workerpoolAddress } = await iexecWrapper.createAssets()); await iexecWrapper.setTeeBroker('0x0000000000000000000000000000000000000000'); - iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, iexecAdmin); + iexecPoco = IexecInterface__factory.connect(proxyAddress, iexecAdmin); iexecPocoAsAnyone = iexecPoco.connect(anyone); ordersAssets = { app: appAddress, diff --git a/test/byContract/IexecPoco/IexecPoco2-reopen.test.ts b/test/byContract/IexecPoco/IexecPoco2-reopen.test.ts index 5319074a3..911f880b3 100644 --- a/test/byContract/IexecPoco/IexecPoco2-reopen.test.ts +++ b/test/byContract/IexecPoco/IexecPoco2-reopen.test.ts @@ -6,7 +6,7 @@ import { loadFixture, mine, time } from '@nomicfoundation/hardhat-network-helper import { setNextBlockTimestamp } from '@nomicfoundation/hardhat-network-helpers/dist/src/helpers/time'; import { expect } from 'chai'; import { ZeroAddress, ZeroHash } from 'ethers'; -import { IexecInterfaceToken, IexecInterfaceToken__factory } from '../../../typechain'; +import { IexecInterface, IexecInterface__factory } from '../../../typechain'; import { OrdersAssets, OrdersPrices, buildOrders } from '../../../utils/createOrders'; import { ContributionStatusEnum, @@ -27,7 +27,7 @@ const resultDigest = buildUtf8ResultAndDigest('result').resultDigest; describe('IexecPoco2#reopen', async () => { let proxyAddress: string; - let [iexecPoco, iexecPocoAsScheduler, iexecPocoAsWorker]: IexecInterfaceToken[] = []; + let [iexecPoco, iexecPocoAsScheduler, iexecPocoAsWorker]: IexecInterface[] = []; let iexecWrapper: IexecWrapper; let [appAddress, datasetAddress, workerpoolAddress]: string[] = []; let [ @@ -57,7 +57,7 @@ describe('IexecPoco2#reopen', async () => { ({ requester, scheduler, worker, worker1, worker2, worker3, worker4, anyone } = accounts); iexecWrapper = new IexecWrapper(proxyAddress, accounts); ({ appAddress, datasetAddress, workerpoolAddress } = await iexecWrapper.createAssets()); - iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, anyone); + iexecPoco = IexecInterface__factory.connect(proxyAddress, anyone); iexecPocoAsScheduler = iexecPoco.connect(scheduler); iexecPocoAsWorker = iexecPoco.connect(worker); ordersAssets = { diff --git a/test/byContract/IexecPoco/IexecPoco2-reveal.test.ts b/test/byContract/IexecPoco/IexecPoco2-reveal.test.ts index 1f749b659..6fb6414f1 100644 --- a/test/byContract/IexecPoco/IexecPoco2-reveal.test.ts +++ b/test/byContract/IexecPoco/IexecPoco2-reveal.test.ts @@ -5,7 +5,7 @@ import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; import { loadFixture, time } from '@nomicfoundation/hardhat-network-helpers'; import { expect } from 'chai'; import { ZeroAddress, ethers } from 'ethers'; -import { IexecInterfaceToken, IexecInterfaceToken__factory } from '../../../typechain'; +import { IexecInterface, IexecInterface__factory } from '../../../typechain'; import { NULL, TAG_STANDARD } from '../../../utils/constants'; import { IexecOrders, OrdersAssets, OrdersPrices, buildOrders } from '../../../utils/createOrders'; import { @@ -28,7 +28,7 @@ const emptyEnclaveSignature = NULL.SIGNATURE; describe('IexecPoco2#reveal', () => { let proxyAddress: string; - let [iexecPoco, iexecPocoAsWorker]: IexecInterfaceToken[] = []; + let [iexecPoco, iexecPocoAsWorker]: IexecInterface[] = []; let iexecWrapper: IexecWrapper; let [ anyone, @@ -58,7 +58,7 @@ describe('IexecPoco2#reveal', () => { ({ scheduler, worker, worker1, worker2, worker3, worker4, requester, anyone } = accounts); iexecWrapper = new IexecWrapper(proxyAddress, accounts); const { appAddress, datasetAddress, workerpoolAddress } = await iexecWrapper.createAssets(); - iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, anyone); + iexecPoco = IexecInterface__factory.connect(proxyAddress, anyone); iexecPocoAsWorker = iexecPoco.connect(worker); const appPrice = 1000n; const datasetPrice = 1_000_000n; diff --git a/test/byContract/IexecPocoBoost/IexecPocoBoost.test.ts b/test/byContract/IexecPocoBoost/IexecPocoBoost.test.ts index 05c2a1ec9..dbdb68ad9 100644 --- a/test/byContract/IexecPocoBoost/IexecPocoBoost.test.ts +++ b/test/byContract/IexecPocoBoost/IexecPocoBoost.test.ts @@ -16,8 +16,8 @@ import { IOracleConsumer__factory, IexecConfiguration, IexecConfiguration__factory, - IexecInterfaceToken, - IexecInterfaceToken__factory, + IexecInterface, + IexecInterface__factory, IexecOrderManagement__factory, IexecPoco2__factory, IexecPocoAccessors__factory, @@ -75,7 +75,7 @@ const randomEOAAddress = randomAddress(); let proxyAddress: string; let iexecPocoBoostInstance: IexecPocoBoostFacet; let iexecConfigurationAsAdmin: IexecConfiguration; -let iexecPocoAccessor: IexecInterfaceToken; +let iexecPocoAccessor: IexecInterface; let oracleConsumerInstance: TestClient; let gasWasterClientInstance: GasWasterClient; let gasWasterClientAddress: string; @@ -130,7 +130,7 @@ describe('IexecPocoBoost', function () { proxyAddress, accounts.iexecAdmin, ); - iexecPocoAccessor = IexecInterfaceToken__factory.connect(proxyAddress, ethers.provider); + iexecPocoAccessor = IexecInterface__factory.connect(proxyAddress, ethers.provider); ordersActors = { appOwner: appProvider, datasetOwner: datasetProvider, diff --git a/test/byContract/IexecRelay/IexecRelay.test.ts b/test/byContract/IexecRelay/IexecRelay.test.ts index ac9d3a39d..1f8b40434 100644 --- a/test/byContract/IexecRelay/IexecRelay.test.ts +++ b/test/byContract/IexecRelay/IexecRelay.test.ts @@ -4,11 +4,7 @@ import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { expect } from 'chai'; import { ethers } from 'hardhat'; -import { - IexecInterfaceToken, - IexecInterfaceToken__factory, - IexecLibOrders_v5, -} from '../../../typechain'; +import { IexecInterface, IexecInterface__factory, IexecLibOrders_v5 } from '../../../typechain'; import { getIexecAccounts } from '../../../utils/poco-tools'; import { loadHardhatFixtureDeployment } from '../../utils/hardhat-fixture-deployer'; import { randomAddress } from '../../utils/utils'; @@ -25,7 +21,7 @@ let sign: string; describe('IexecRelay', async () => { let proxyAddress: string; - let iexecPoco: IexecInterfaceToken; + let iexecPoco: IexecInterface; let [app, dataset, workerpool, requester, beneficiary]: string[] = []; beforeEach('Deploy', async () => { @@ -35,7 +31,7 @@ describe('IexecRelay', async () => { async function initFixture() { const accounts = await getIexecAccounts(); - iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, accounts.anyone); + iexecPoco = IexecInterface__factory.connect(proxyAddress, accounts.anyone); [app, dataset, workerpool, requester, beneficiary] = Array(5).fill(randomAddress()); sign = await ethers.Wallet.createRandom().signMessage('sign'); } diff --git a/test/byContract/iexecPocoAccessors/IexecPocoAccessors.test.ts b/test/byContract/iexecPocoAccessors/IexecPocoAccessors.test.ts index b132006f7..fbec2be6d 100644 --- a/test/byContract/iexecPocoAccessors/IexecPocoAccessors.test.ts +++ b/test/byContract/iexecPocoAccessors/IexecPocoAccessors.test.ts @@ -6,11 +6,7 @@ import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { expect } from 'chai'; import { ZeroAddress, ZeroHash } from 'ethers'; import { deployments, ethers } from 'hardhat'; -import { - IexecInterfaceToken, - IexecInterfaceToken__factory, - IexecLibOrders_v5, -} from '../../../typechain'; +import { IexecInterface, IexecInterface__factory, IexecLibOrders_v5 } from '../../../typechain'; import { OrdersAssets, OrdersPrices, @@ -50,7 +46,7 @@ const { results, resultDigest } = buildUtf8ResultAndDigest('result'); const { resultsCallback, callbackResultDigest } = buildResultCallbackAndDigest(123); let proxyAddress: string; -let iexecPoco: IexecInterfaceToken; +let iexecPoco: IexecInterface; let iexecWrapper: IexecWrapper; let [appAddress, datasetAddress, workerpoolAddress]: string[] = []; let [requester, appProvider, datasetProvider, scheduler, worker1, anyone]: SignerWithAddress[] = []; @@ -70,7 +66,7 @@ describe('IexecPocoAccessors', async () => { ({ requester, appProvider, datasetProvider, scheduler, worker1, anyone } = accounts); iexecWrapper = new IexecWrapper(proxyAddress, accounts); ({ appAddress, datasetAddress, workerpoolAddress } = await iexecWrapper.createAssets()); - iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, ethers.provider); + iexecPoco = IexecInterface__factory.connect(proxyAddress, ethers.provider); ordersAssets = { app: appAddress, dataset: datasetAddress, diff --git a/test/byContract/registries/assets.test.ts b/test/byContract/registries/assets.test.ts index 2d9b2623b..f5be3f4f8 100644 --- a/test/byContract/registries/assets.test.ts +++ b/test/byContract/registries/assets.test.ts @@ -15,8 +15,8 @@ import { DatasetRegistry, DatasetRegistry__factory, Dataset__factory, - IexecInterfaceToken, - IexecInterfaceToken__factory, + IexecInterface, + IexecInterface__factory, Workerpool, WorkerpoolRegistry, WorkerpoolRegistry__factory, @@ -55,7 +55,7 @@ const createWorkerpoolArgs = Object.values(createWorkerpoolParams) as [string]; describe('Assets', () => { let proxyAddress: string; - let iexecPoco: IexecInterfaceToken; + let iexecPoco: IexecInterface; let [appProvider, datasetProvider, scheduler, anyone]: SignerWithAddress[] = []; let appRegistry: AppRegistry; @@ -74,7 +74,7 @@ describe('Assets', () => { async function initFixture() { ({ appProvider, datasetProvider, scheduler, anyone } = await getIexecAccounts()); - iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, anyone); + iexecPoco = IexecInterface__factory.connect(proxyAddress, anyone); appRegistry = AppRegistry__factory.connect(await iexecPoco.appregistry(), anyone); datasetRegistry = DatasetRegistry__factory.connect( diff --git a/test/byContract/registries/registries.test.ts b/test/byContract/registries/registries.test.ts index 98428c63b..1e191319c 100644 --- a/test/byContract/registries/registries.test.ts +++ b/test/byContract/registries/registries.test.ts @@ -13,8 +13,8 @@ import { DatasetRegistry, DatasetRegistry__factory, Dataset__factory, - IexecInterfaceToken, - IexecInterfaceToken__factory, + IexecInterface, + IexecInterface__factory, InitializableUpgradeabilityProxy__factory, WorkerpoolRegistry, WorkerpoolRegistry__factory, @@ -29,7 +29,7 @@ import { randomAddress } from '../../utils/utils'; describe('Registries', () => { let proxyAddress: string; - let iexecPoco: IexecInterfaceToken; + let iexecPoco: IexecInterface; let [iexecAdmin, appProvider, datasetProvider, scheduler, anyone]: SignerWithAddress[] = []; let [appRegistry, appRegistryAsAdmin]: AppRegistry[] = []; @@ -48,7 +48,7 @@ describe('Registries', () => { ({ iexecAdmin, appProvider, datasetProvider, scheduler, anyone } = await getIexecAccounts()); - iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, anyone); + iexecPoco = IexecInterface__factory.connect(proxyAddress, anyone); appRegistry = AppRegistry__factory.connect(await iexecPoco.appregistry(), anyone); appRegistryAddress = await appRegistry.getAddress(); diff --git a/test/utils/IexecWrapper.ts b/test/utils/IexecWrapper.ts index e4c38be80..d261ad74e 100644 --- a/test/utils/IexecWrapper.ts +++ b/test/utils/IexecWrapper.ts @@ -18,8 +18,8 @@ import { DatasetRegistry, DatasetRegistry__factory, IWorkerpool__factory, - IexecInterfaceToken, - IexecInterfaceToken__factory, + IexecInterface, + IexecInterface__factory, IexecLibOrders_v5, IexecPocoBoostAccessors__factory, RLC__factory, @@ -54,13 +54,13 @@ export const DATASET_CHECKSUM = '0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321'; export class IexecWrapper { proxyAddress: string; - iexecPoco: IexecInterfaceToken; + iexecPoco: IexecInterface; accounts: IexecAccounts; domain: TypedDataDomain; constructor(proxyAddress: string, accounts: IexecAccounts) { this.proxyAddress = proxyAddress; - this.iexecPoco = IexecInterfaceToken__factory.connect(this.proxyAddress, ethers.provider); + this.iexecPoco = IexecInterface__factory.connect(this.proxyAddress, ethers.provider); this.accounts = accounts; this.domain = { name: 'iExecODB', diff --git a/test/utils/fixture-helpers.ts b/test/utils/fixture-helpers.ts index 473b7b50b..bde714d58 100644 --- a/test/utils/fixture-helpers.ts +++ b/test/utils/fixture-helpers.ts @@ -3,7 +3,7 @@ import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; import { deployments, ethers } from 'hardhat'; -import { IexecInterfaceToken__factory, Registry__factory } from '../../typechain'; +import { IexecInterface__factory, Registry__factory } from '../../typechain'; import { getIexecAccounts } from '../../utils/poco-tools'; /** @@ -21,7 +21,7 @@ export async function fundAccounts(tokenAddress: string, richmanAddress: string) console.log(`Rich account ${richmanAddress} sending RLCs to other accounts..`); const richmanSigner = await ethers.getImpersonatedSigner(richmanAddress); - const tokenContract = IexecInterfaceToken__factory.connect(tokenAddress, richmanSigner); + const tokenContract = IexecInterface__factory.connect(tokenAddress, richmanSigner); for (let i = 0; i < accountsArray.length; i++) { const account = accountsArray[i]; @@ -89,7 +89,7 @@ export async function transferRegistryOwnership(registryName: string, registryAd */ export async function transferProxyOwnership(proxyAddress: string) { const accounts = await getIexecAccounts(); - const iexecPoco = IexecInterfaceToken__factory.connect(proxyAddress, ethers.provider); + const iexecPoco = IexecInterface__factory.connect(proxyAddress, ethers.provider); const pocoOwner = await iexecPoco.owner(); const newIexecAdminAddress = accounts.iexecAdmin.address; diff --git a/utils/proxy-tools.ts b/utils/proxy-tools.ts index 74c8d13ed..7d89cd5c4 100644 --- a/utils/proxy-tools.ts +++ b/utils/proxy-tools.ts @@ -15,7 +15,7 @@ import { IexecCategoryManagerFacet__factory, IexecConfigurationExtraFacet__factory, IexecConfigurationFacet__factory, - IexecEscrowTokenFacet__factory, + IexecEscrowFacet__factory, IexecOrderManagementFacet__factory, IexecPoco1Facet__factory, IexecPoco2Facet__factory, @@ -139,7 +139,7 @@ function getAllLocalFacetFunctions(): Map { IexecCategoryManagerFacet__factory.createInterface(), IexecConfigurationExtraFacet__factory.createInterface(), IexecConfigurationFacet__factory.createInterface(), - IexecEscrowTokenFacet__factory.createInterface(), + IexecEscrowFacet__factory.createInterface(), IexecOrderManagementFacet__factory.createInterface(), IexecPoco1Facet__factory.createInterface(), IexecPoco2Facet__factory.createInterface(), From 2aec8ae1d4c46c82e14138ac9dfabf18fd44a76a Mon Sep 17 00:00:00 2001 From: Zied <26070035+zguesmi@users.noreply.github.com> Date: Wed, 2 Sep 2026 12:06:17 +0200 Subject: [PATCH 2/9] refactor: hold the protocol constants in ConstantsLib FacetBase declared the eight protocol constants, which put them out of reach of the helper libraries. A library cannot inherit FacetBase, and a contract constant is not readable from outside its own contract at any visibility: solc 0.8.21 rejects `FacetBase.GROUPMEMBER_PURPOSE` from a library with "Member not found or not visible after argument-dependent lookup", with both internal and public visibility. CommonLib therefore carried a second, private copy of GROUPMEMBER_PURPOSE. A library constant carries no such restriction. ConstantsLib now holds the single declaration of all eight, CommonLib reads ConstantsLib.GROUPMEMBER_PURPOSE and drops its copy, and FacetBase keeps the eight names as aliases of the library's values. The aliases matter: the 31 bare uses in the facets and the eight public getters on IexecPocoAccessorsFacet stay exactly as they were. Measured on solc 0.8.21 with viaIR. No ABI changes anywhere. Constant folding survives the indirection: the deployed bytecode still holds one PUSH5 for 1e9 and one PUSH20 for the kitty address in each facet that reads them, so the aliases fold back to the same literals. Four facets grew a little jump-offset churn against the previous commit, IexecPoco1Facet by 8 bytes, IexecPocoBoost- Facet by 32, IexecPoco2Facet by 40 and IexecPocoAccessorsFacet by 48. The other eight facets are byte-identical once the trailing metadata is stripped. The largest, IexecPocoBoostFacet, sits at 16641 of the 24576-byte limit. --- contracts/abstract/FacetBase.sol | 32 ++++++++++++---------------- contracts/libs/CommonLib.sol | 6 ++---- contracts/libs/ConstantsLib.sol | 36 ++++++++++++++++++++++++++++++++ docs/solidity/index.md | 10 +++++++++ 4 files changed, 61 insertions(+), 23 deletions(-) create mode 100644 contracts/libs/ConstantsLib.sol diff --git a/contracts/abstract/FacetBase.sol b/contracts/abstract/FacetBase.sol index 2cd15a438..08f94c1cc 100644 --- a/contracts/abstract/FacetBase.sol +++ b/contracts/abstract/FacetBase.sol @@ -3,6 +3,7 @@ pragma solidity ^0.8.0; +import {ConstantsLib} from "../libs/ConstantsLib.sol"; import {PocoStorageLib} from "../libs/PocoStorageLib.sol"; import {IERC5313} from "@openzeppelin/contracts/interfaces/IERC5313.sol"; @@ -13,25 +14,18 @@ import {IERC5313} from "@openzeppelin/contracts/interfaces/IERC5313.sol"; * @dev Every facet must inherit from this contract. */ abstract contract FacetBase { - // TODO move these constants to a ConstantsLib library and reference them as - // ConstantsLib. in the next PR. - // CommonLib redeclares GROUPMEMBER_PURPOSE temporarily. - - // Poco - Constants - uint256 internal constant CONTRIBUTION_DEADLINE_RATIO = 7; - uint256 internal constant REVEAL_DEADLINE_RATIO = 2; - uint256 internal constant FINAL_DEADLINE_RATIO = 10; - uint256 internal constant WORKERPOOL_STAKE_RATIO = 30; - uint256 internal constant KITTY_RATIO = 10; - uint256 internal constant KITTY_MIN = 1e9; // ADJUSTEMENT VARIABLE - - // Seized funds of workerpools that do not honor their deals are sent - // out to this kitty address. - // It is determined with address(uint256(keccak256(bytes('iExecKitty'))) - 1). - address internal constant KITTY_ADDRESS = 0x99c2268479b93fDe36232351229815DF80837e23; - - // Used with ERC-734 Key Manager identity contract for authorization management. - uint256 internal constant GROUPMEMBER_PURPOSE = 4; + // Aliases of the protocol constants, so that every facet inheriting this + // contract keeps reading them under their bare names. {ConstantsLib} holds + // the single declaration; solc folds each alias back to the same literal. + uint256 internal constant CONTRIBUTION_DEADLINE_RATIO = + ConstantsLib.CONTRIBUTION_DEADLINE_RATIO; + uint256 internal constant REVEAL_DEADLINE_RATIO = ConstantsLib.REVEAL_DEADLINE_RATIO; + uint256 internal constant FINAL_DEADLINE_RATIO = ConstantsLib.FINAL_DEADLINE_RATIO; + uint256 internal constant WORKERPOOL_STAKE_RATIO = ConstantsLib.WORKERPOOL_STAKE_RATIO; + uint256 internal constant KITTY_RATIO = ConstantsLib.KITTY_RATIO; + uint256 internal constant KITTY_MIN = ConstantsLib.KITTY_MIN; + address internal constant KITTY_ADDRESS = ConstantsLib.KITTY_ADDRESS; + uint256 internal constant GROUPMEMBER_PURPOSE = ConstantsLib.GROUPMEMBER_PURPOSE; modifier onlyOwner() { require(_msgSender() == owner(), "Ownable: caller is not the owner"); diff --git a/contracts/libs/CommonLib.sol b/contracts/libs/CommonLib.sol index d394735e0..241d2da44 100644 --- a/contracts/libs/CommonLib.sol +++ b/contracts/libs/CommonLib.sol @@ -8,6 +8,7 @@ import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; import {IERC734} from "../external/interfaces/IERC734.sol"; +import {ConstantsLib} from "./ConstantsLib.sol"; import {PocoStorageLib} from "./PocoStorageLib.sol"; /** @@ -18,9 +19,6 @@ library CommonLib { using ECDSA for bytes32; using Math for uint256; - // Used with ERC-734 Key Manager identity contract for authorization management. - uint256 private constant GROUPMEMBER_PURPOSE = 4; - /** * Hash a Typed Data using the configured domain. * @param structHash The original structure hash. @@ -147,7 +145,7 @@ library CommonLib { try IERC734(restriction).keyHasPurpose( // ERC734 identity contract restriction bytes32(uint256(uint160(account))), - GROUPMEMBER_PURPOSE + ConstantsLib.GROUPMEMBER_PURPOSE ) returns (bool success) { return success; diff --git a/contracts/libs/ConstantsLib.sol b/contracts/libs/ConstantsLib.sol new file mode 100644 index 000000000..1b8edf4e1 --- /dev/null +++ b/contracts/libs/ConstantsLib.sol @@ -0,0 +1,36 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH +// SPDX-License-Identifier: Apache-2.0 + +pragma solidity ^0.8.0; + +/** + * @title The protocol constants of PoCo. + * @notice The single declaration of every protocol constant. {FacetBase} aliases + * them so the facets keep reading them under their bare names. + * @dev They live in a library, not in a base contract, because a library cannot + * inherit and a contract constant is not readable from outside its own contract + * at any visibility. A library constant carries no such restriction, so both the + * facets and the helper libraries reach the same declaration. + */ +library ConstantsLib { + // Deadline ratios, expressed as multiples of the category time frame. + uint256 internal constant CONTRIBUTION_DEADLINE_RATIO = 7; + uint256 internal constant REVEAL_DEADLINE_RATIO = 2; + uint256 internal constant FINAL_DEADLINE_RATIO = 10; + + // Share of the deal price a workerpool must stake, as a percentage. + uint256 internal constant WORKERPOOL_STAKE_RATIO = 30; + + // Share of the kitty released to a workerpool on each reward, as a + // percentage, and the floor below which the whole kitty is released. + uint256 internal constant KITTY_RATIO = 10; + uint256 internal constant KITTY_MIN = 1e9; // ADJUSTEMENT VARIABLE + + // Seized funds of workerpools that do not honor their deals are sent + // out to this kitty address. + // It is determined with address(uint256(keccak256(bytes('iExecKitty'))) - 1). + address internal constant KITTY_ADDRESS = 0x99c2268479b93fDe36232351229815DF80837e23; + + // Used with ERC-734 Key Manager identity contract for authorization management. + uint256 internal constant GROUPMEMBER_PURPOSE = 4; +} diff --git a/docs/solidity/index.md b/docs/solidity/index.md index 65d4c4f4b..8a8fd2fa3 100644 --- a/docs/solidity/index.md +++ b/docs/solidity/index.md @@ -793,6 +793,16 @@ function broadcastWorkerpoolOrder(struct IexecLibOrders_v5.WorkerpoolOrder _work function broadcastRequestOrder(struct IexecLibOrders_v5.RequestOrder _requestorder) external ``` +## ConstantsLib + +The single declaration of every protocol constant. {FacetBase} aliases +them so the facets keep reading them under their bare names. + +_They live in a library, not in a base contract, because a library cannot +inherit and a contract constant is not readable from outside its own contract +at any visibility. A library constant carries no such restriction, so both the +facets and the helper libraries reach the same declaration._ + ## EscrowLib The escrow layers on top of the sRLC ledger: it owns `m_frozens` and From aa2d79f22b6755e713392c5323bd3553854af89f Mon Sep 17 00:00:00 2001 From: Zied <26070035+zguesmi@users.noreply.github.com> Date: Thu, 3 Sep 2026 11:39:27 +0200 Subject: [PATCH 3/9] chore: clean comments --- contracts/IexecInterface.sol | 6 ++---- contracts/libs/ConstantsLib.sol | 8 +------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/contracts/IexecInterface.sol b/contracts/IexecInterface.sol index efd228dba..daa6b5234 100644 --- a/contracts/IexecInterface.sol +++ b/contracts/IexecInterface.sol @@ -24,14 +24,12 @@ import {IOwnable} from "./interfaces/IOwnable.sol"; /** * A global interface that aggregates all the interfaces needed to interact with * the PoCo contracts. - * @dev Referenced in the SDK with the path `contracts/IexecInterface.sol`. + * @dev TODO Referenced in the SDK with the old path `contracts/IexecInterfaceToken.sol`. + * The SDK should be updated to use the new path `contracts/IexecInterface.sol`. * Changing the name or the path would cause a breaking change in the SDK. */ // 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 -// TODO Add the interfaces `IexecPocoBoost` and `IexecPocoBoostAccessors` once the Boost facets -// are deployed on every network. They are not deployed on Arbitrum mainnet nor on Arbitrum -// Sepolia today, so aggregating them here would make the SDK advertise functions that revert. interface IexecInterface is IexecAccessorsABILegacy, IexecCategoryManager, diff --git a/contracts/libs/ConstantsLib.sol b/contracts/libs/ConstantsLib.sol index 1b8edf4e1..c01e4a9f4 100644 --- a/contracts/libs/ConstantsLib.sol +++ b/contracts/libs/ConstantsLib.sol @@ -4,13 +4,7 @@ pragma solidity ^0.8.0; /** - * @title The protocol constants of PoCo. - * @notice The single declaration of every protocol constant. {FacetBase} aliases - * them so the facets keep reading them under their bare names. - * @dev They live in a library, not in a base contract, because a library cannot - * inherit and a contract constant is not readable from outside its own contract - * at any visibility. A library constant carries no such restriction, so both the - * facets and the helper libraries reach the same declaration. + * @title All protocol constants. */ library ConstantsLib { // Deadline ratios, expressed as multiples of the category time frame. From c7e66dfda477d99b862fbc8a4adca92d5783c5fc Mon Sep 17 00:00:00 2001 From: Zied <26070035+zguesmi@users.noreply.github.com> Date: Thu, 3 Sep 2026 11:39:49 +0200 Subject: [PATCH 4/9] chore: add todo.md file --- TODO.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 TODO.md diff --git a/TODO.md b/TODO.md new file mode 100644 index 000000000..7ed377766 --- /dev/null +++ b/TODO.md @@ -0,0 +1,5 @@ +# TODO + +1. Move to the latest Solidity version +2. Use a standard ERC-20 implementation for sRLC +3. Drop the optimizer `details` block and use the default configuration From 0298581f18b447963f74755dbccfddf678e4393f Mon Sep 17 00:00:00 2001 From: Zied <26070035+zguesmi@users.noreply.github.com> Date: Thu, 3 Sep 2026 11:44:02 +0200 Subject: [PATCH 5/9] refactor: rename ConstantsLib to Constants and read it directly The library is renamed `Constants`, and `FacetBase` no longer aliases the eight protocol constants. Every reader now names the declaration it uses: the four facets and `CommonLib` reach `Constants.X` directly, and `FacetBase` is left with the owner helpers alone. The aliases were a compatibility layer that let the facets keep their bare names. Removing them costs 48 qualified references but leaves a single path to each constant, so a reader no longer has to check whether a bare name comes from the base contract, the file itself or an inherited interface. The public getters on `IexecPocoAccessorsFacet` keep their names and their values, so the external surface is unchanged. --- contracts/abstract/FacetBase.sol | 14 ---------- contracts/facets/IexecPoco1Facet.sol | 3 ++- contracts/facets/IexecPoco2Facet.sol | 27 ++++++++++++------- contracts/facets/IexecPocoAccessorsFacet.sol | 17 ++++++------ contracts/facets/IexecPocoBoostFacet.sol | 23 +++++++++------- contracts/libs/CommonLib.sol | 4 +-- .../libs/{ConstantsLib.sol => Constants.sol} | 2 +- docs/solidity/index.md | 13 +++------ 8 files changed, 48 insertions(+), 55 deletions(-) rename contracts/libs/{ConstantsLib.sol => Constants.sol} (98%) diff --git a/contracts/abstract/FacetBase.sol b/contracts/abstract/FacetBase.sol index 08f94c1cc..0cb63e4a1 100644 --- a/contracts/abstract/FacetBase.sol +++ b/contracts/abstract/FacetBase.sol @@ -3,7 +3,6 @@ pragma solidity ^0.8.0; -import {ConstantsLib} from "../libs/ConstantsLib.sol"; import {PocoStorageLib} from "../libs/PocoStorageLib.sol"; import {IERC5313} from "@openzeppelin/contracts/interfaces/IERC5313.sol"; @@ -14,19 +13,6 @@ import {IERC5313} from "@openzeppelin/contracts/interfaces/IERC5313.sol"; * @dev Every facet must inherit from this contract. */ abstract contract FacetBase { - // Aliases of the protocol constants, so that every facet inheriting this - // contract keeps reading them under their bare names. {ConstantsLib} holds - // the single declaration; solc folds each alias back to the same literal. - uint256 internal constant CONTRIBUTION_DEADLINE_RATIO = - ConstantsLib.CONTRIBUTION_DEADLINE_RATIO; - uint256 internal constant REVEAL_DEADLINE_RATIO = ConstantsLib.REVEAL_DEADLINE_RATIO; - uint256 internal constant FINAL_DEADLINE_RATIO = ConstantsLib.FINAL_DEADLINE_RATIO; - uint256 internal constant WORKERPOOL_STAKE_RATIO = ConstantsLib.WORKERPOOL_STAKE_RATIO; - uint256 internal constant KITTY_RATIO = ConstantsLib.KITTY_RATIO; - uint256 internal constant KITTY_MIN = ConstantsLib.KITTY_MIN; - address internal constant KITTY_ADDRESS = ConstantsLib.KITTY_ADDRESS; - uint256 internal constant GROUPMEMBER_PURPOSE = ConstantsLib.GROUPMEMBER_PURPOSE; - modifier onlyOwner() { require(_msgSender() == owner(), "Ownable: caller is not the owner"); _; diff --git a/contracts/facets/IexecPoco1Facet.sol b/contracts/facets/IexecPoco1Facet.sol index 87917a36e..440d86b65 100644 --- a/contracts/facets/IexecPoco1Facet.sol +++ b/contracts/facets/IexecPoco1Facet.sol @@ -14,6 +14,7 @@ import {IexecPoco1Errors} from "../interfaces/IexecPoco1Errors.sol"; import {FacetBase} from "../abstract/FacetBase.sol"; import {EscrowLib} from "../libs/EscrowLib.sol"; import {CommonLib} from "../libs/CommonLib.sol"; +import {Constants} from "../libs/Constants.sol"; struct Matching { bytes32 apporderHash; @@ -463,7 +464,7 @@ contract IexecPoco1Facet is IexecPoco1, IexecPoco1Errors, FacetBase { //slither-disable-next-line divide-before-multiply EscrowLib.lock( deal.workerpool.owner, - ((deal.workerpool.price * WORKERPOOL_STAKE_RATIO) / 100) * volume // ORDER IS IMPORTANT HERE! + ((deal.workerpool.price * Constants.WORKERPOOL_STAKE_RATIO) / 100) * volume // ORDER IS IMPORTANT HERE! ); /** diff --git a/contracts/facets/IexecPoco2Facet.sol b/contracts/facets/IexecPoco2Facet.sol index 6071f99c3..06b713d95 100644 --- a/contracts/facets/IexecPoco2Facet.sol +++ b/contracts/facets/IexecPoco2Facet.sol @@ -12,6 +12,7 @@ import {IexecPoco2} from "../interfaces/IexecPoco2.sol"; import {FacetBase} from "../abstract/FacetBase.sol"; import {EscrowLib} from "../libs/EscrowLib.sol"; import {CommonLib} from "../libs/CommonLib.sol"; +import {Constants} from "../libs/Constants.sol"; contract IexecPoco2Facet is IexecPoco2, FacetBase { modifier onlyScheduler(bytes32 _taskId) { @@ -28,7 +29,7 @@ contract IexecPoco2Facet is IexecPoco2, FacetBase { IexecLibCore_v5.Deal storage deal = $.m_deals[_dealid]; uint256 taskPrice = deal.app.price + deal.dataset.price + deal.workerpool.price; - uint256 poolstake = (deal.workerpool.price * WORKERPOOL_STAKE_RATIO) / 100; + uint256 poolstake = (deal.workerpool.price * Constants.WORKERPOOL_STAKE_RATIO) / 100; // Seize the payer of the task EscrowLib.seize(deal.sponsor, taskPrice, _taskid); @@ -45,11 +46,14 @@ contract IexecPoco2Facet is IexecPoco2, FacetBase { // pool reward performed by consensus manager // Retrieve part of the kitty - uint256 kitty = $.m_frozens[KITTY_ADDRESS]; + uint256 kitty = $.m_frozens[Constants.KITTY_ADDRESS]; if (kitty > 0) { // Get a fraction of the kitty where KITTY_MIN <= fraction <= kitty - kitty = Math.min(Math.max((kitty * KITTY_RATIO) / 100, KITTY_MIN), kitty); - EscrowLib.seize(KITTY_ADDRESS, kitty, _taskid); + kitty = Math.min( + Math.max((kitty * Constants.KITTY_RATIO) / 100, Constants.KITTY_MIN), + kitty + ); + EscrowLib.seize(Constants.KITTY_ADDRESS, kitty, _taskid); EscrowLib.reward(deal.workerpool.owner, kitty, _taskid); } } @@ -59,12 +63,12 @@ contract IexecPoco2Facet is IexecPoco2, FacetBase { IexecLibCore_v5.Deal memory deal = $.m_deals[_dealid]; uint256 taskPrice = deal.app.price + deal.dataset.price + deal.workerpool.price; - uint256 poolstake = (deal.workerpool.price * WORKERPOOL_STAKE_RATIO) / 100; + uint256 poolstake = (deal.workerpool.price * Constants.WORKERPOOL_STAKE_RATIO) / 100; EscrowLib.unlock(deal.sponsor, taskPrice); // Refund the payer of the task EscrowLib.seize(deal.workerpool.owner, poolstake, _taskid); // Reward kitty and lock value on it. - EscrowLib.rewardAndLock(KITTY_ADDRESS, poolstake, _taskid); // → Kitty / Burn + EscrowLib.rewardAndLock(Constants.KITTY_ADDRESS, poolstake, _taskid); // → Kitty / Burn } /*************************************************************************** @@ -85,8 +89,11 @@ contract IexecPoco2Facet is IexecPoco2, FacetBase { task.dealid = _dealid; task.idx = idx; task.timeref = $.m_categories[deal.category].workClockTimeRef; - task.contributionDeadline = deal.startTime + task.timeref * CONTRIBUTION_DEADLINE_RATIO; - task.finalDeadline = deal.startTime + task.timeref * FINAL_DEADLINE_RATIO; + task.contributionDeadline = + deal.startTime + + task.timeref * + Constants.CONTRIBUTION_DEADLINE_RATIO; + task.finalDeadline = deal.startTime + task.timeref * Constants.FINAL_DEADLINE_RATIO; // setup denominator $.m_consensus[taskid].total = 1; @@ -233,7 +240,7 @@ contract IexecPoco2Facet is IexecPoco2, FacetBase { task.status = IexecLibCore_v5.TaskStatusEnum.COMPLETED; task.consensusValue = contribution.resultHash; - task.revealDeadline = block.timestamp + task.timeref * REVEAL_DEADLINE_RATIO; + task.revealDeadline = block.timestamp + task.timeref * Constants.REVEAL_DEADLINE_RATIO; task.revealCounter = 1; task.winnerCounter = 1; task.resultDigest = _resultDigest; @@ -400,7 +407,7 @@ contract IexecPoco2Facet is IexecPoco2, FacetBase { // _msgSender() is a contributor: no need to check task.status = IexecLibCore_v5.TaskStatusEnum.REVEALING; task.consensusValue = _consensus; - task.revealDeadline = block.timestamp + task.timeref * REVEAL_DEADLINE_RATIO; + task.revealDeadline = block.timestamp + task.timeref * Constants.REVEAL_DEADLINE_RATIO; task.revealCounter = 0; task.winnerCounter = winnerCounter; diff --git a/contracts/facets/IexecPocoAccessorsFacet.sol b/contracts/facets/IexecPocoAccessorsFacet.sol index f4c0bc5fc..d991ada2a 100644 --- a/contracts/facets/IexecPocoAccessorsFacet.sol +++ b/contracts/facets/IexecPocoAccessorsFacet.sol @@ -13,6 +13,7 @@ import {IexecPocoAccessors} from "../interfaces/IexecPocoAccessors.sol"; import {IRegistry} from "../registries/IRegistry.sol"; import {FacetBase} from "../abstract/FacetBase.sol"; import {CommonLib} from "../libs/CommonLib.sol"; +import {Constants} from "../libs/Constants.sol"; /** * @title Getters contract for PoCo facets. @@ -242,35 +243,35 @@ contract IexecPocoAccessorsFacet is IexecPocoAccessors, FacetBase { // ========= Constants Accessors ========= function contribution_deadline_ratio() external pure returns (uint256) { - return CONTRIBUTION_DEADLINE_RATIO; + return Constants.CONTRIBUTION_DEADLINE_RATIO; } function reveal_deadline_ratio() external pure returns (uint256) { - return REVEAL_DEADLINE_RATIO; + return Constants.REVEAL_DEADLINE_RATIO; } function final_deadline_ratio() external pure returns (uint256) { - return FINAL_DEADLINE_RATIO; + return Constants.FINAL_DEADLINE_RATIO; } function workerpool_stake_ratio() external pure returns (uint256) { - return WORKERPOOL_STAKE_RATIO; + return Constants.WORKERPOOL_STAKE_RATIO; } function kitty_ratio() external pure returns (uint256) { - return KITTY_RATIO; + return Constants.KITTY_RATIO; } function kitty_min() external pure returns (uint256) { - return KITTY_MIN; + return Constants.KITTY_MIN; } function kitty_address() external pure returns (address) { - return KITTY_ADDRESS; + return Constants.KITTY_ADDRESS; } function groupmember_purpose() external pure returns (uint256) { - return GROUPMEMBER_PURPOSE; + return Constants.GROUPMEMBER_PURPOSE; } function eip712domain_separator() external view returns (bytes32) { diff --git a/contracts/facets/IexecPocoBoostFacet.sol b/contracts/facets/IexecPocoBoostFacet.sol index e43fa35be..e0234618c 100644 --- a/contracts/facets/IexecPocoBoostFacet.sol +++ b/contracts/facets/IexecPocoBoostFacet.sol @@ -18,6 +18,7 @@ import {FacetBase} from "../abstract/FacetBase.sol"; import {EscrowLib} from "../libs/EscrowLib.sol"; import {PocoStorageLib} from "../libs/PocoStorageLib.sol"; import {CommonLib} from "../libs/CommonLib.sol"; +import {Constants} from "../libs/Constants.sol"; // // Not deployed yet! @@ -300,7 +301,7 @@ contract IexecPocoBoostFacet is IexecPocoBoost, FacetBase { deal.botFirst = requestOrderConsumed.toUint16(); deal.deadline = (block.timestamp + $.m_categories[category].workClockTimeRef * - CONTRIBUTION_DEADLINE_RATIO).toUint40(); + Constants.CONTRIBUTION_DEADLINE_RATIO).toUint40(); deal.botSize = volume.toUint16(); /** * Store right part of tag for later use. @@ -342,7 +343,7 @@ contract IexecPocoBoostFacet is IexecPocoBoost, FacetBase { //slither-disable-next-line divide-before-multiply EscrowLib.lock( workerpoolOwner, - ((workerpoolPrice * WORKERPOOL_STAKE_RATIO) / 100) * volume + ((workerpoolPrice * Constants.WORKERPOOL_STAKE_RATIO) / 100) * volume ); // Notify workerpool. emit SchedulerNoticeBoost( @@ -458,16 +459,20 @@ contract IexecPocoBoostFacet is IexecPocoBoost, FacetBase { } // Unlock scheduler stake - EscrowLib.unlock(workerpoolOwner, (workerPoolPrice * WORKERPOOL_STAKE_RATIO) / 100); + EscrowLib.unlock( + workerpoolOwner, + (workerPoolPrice * Constants.WORKERPOOL_STAKE_RATIO) / 100 + ); // Reward scheduler - uint256 kitty = $.m_frozens[KITTY_ADDRESS]; + uint256 kitty = $.m_frozens[Constants.KITTY_ADDRESS]; if (kitty > 0) { - kitty = KITTY_MIN // 1. retrieve bare minimum from kitty + kitty = Constants + .KITTY_MIN // 1. retrieve bare minimum from kitty .max( // 2. or eventually a fraction of kitty if bigger // @dev As long as `KITTY_RATIO = 10`, we can introduce this small - kitty / KITTY_RATIO // optimization for `kitty * KITTY_RATIO / 100` + kitty / Constants.KITTY_RATIO // optimization for `kitty * KITTY_RATIO / 100` ).min(kitty); // 3. but no more than available - EscrowLib.seize(KITTY_ADDRESS, kitty, taskId); + EscrowLib.seize(Constants.KITTY_ADDRESS, kitty, taskId); } EscrowLib.reward( workerpoolOwner, @@ -515,13 +520,13 @@ contract IexecPocoBoostFacet is IexecPocoBoost, FacetBase { task.status = IexecLibCore_v5.TaskStatusEnum.FAILED; // Calculate workerpool price and task stake. uint96 workerPoolPrice = deal.workerpoolPrice; - uint256 workerpoolTaskStake = (workerPoolPrice * WORKERPOOL_STAKE_RATIO) / 100; + uint256 workerpoolTaskStake = (workerPoolPrice * Constants.WORKERPOOL_STAKE_RATIO) / 100; // Refund the payer of the task by unlocking the locked funds. EscrowLib.unlock(deal.sponsor, deal.appPrice + deal.datasetPrice + workerPoolPrice); // Seize task stake from workerpool. EscrowLib.seize(deal.workerpoolOwner, workerpoolTaskStake, taskId); // Reward kitty and lock the rewarded amount. - EscrowLib.rewardAndLock(KITTY_ADDRESS, workerpoolTaskStake, taskId); + EscrowLib.rewardAndLock(Constants.KITTY_ADDRESS, workerpoolTaskStake, taskId); emit TaskClaimed(taskId); } diff --git a/contracts/libs/CommonLib.sol b/contracts/libs/CommonLib.sol index 241d2da44..aa0deb522 100644 --- a/contracts/libs/CommonLib.sol +++ b/contracts/libs/CommonLib.sol @@ -8,7 +8,7 @@ import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; import {IERC734} from "../external/interfaces/IERC734.sol"; -import {ConstantsLib} from "./ConstantsLib.sol"; +import {Constants} from "./Constants.sol"; import {PocoStorageLib} from "./PocoStorageLib.sol"; /** @@ -145,7 +145,7 @@ library CommonLib { try IERC734(restriction).keyHasPurpose( // ERC734 identity contract restriction bytes32(uint256(uint160(account))), - ConstantsLib.GROUPMEMBER_PURPOSE + Constants.GROUPMEMBER_PURPOSE ) returns (bool success) { return success; diff --git a/contracts/libs/ConstantsLib.sol b/contracts/libs/Constants.sol similarity index 98% rename from contracts/libs/ConstantsLib.sol rename to contracts/libs/Constants.sol index c01e4a9f4..8edccc22d 100644 --- a/contracts/libs/ConstantsLib.sol +++ b/contracts/libs/Constants.sol @@ -6,7 +6,7 @@ pragma solidity ^0.8.0; /** * @title All protocol constants. */ -library ConstantsLib { +library Constants { // Deadline ratios, expressed as multiples of the category time frame. uint256 internal constant CONTRIBUTION_DEADLINE_RATIO = 7; uint256 internal constant REVEAL_DEADLINE_RATIO = 2; diff --git a/docs/solidity/index.md b/docs/solidity/index.md index 8a8fd2fa3..d22699b4d 100644 --- a/docs/solidity/index.md +++ b/docs/solidity/index.md @@ -5,7 +5,8 @@ A global interface that aggregates all the interfaces needed to interact with the PoCo contracts. -_Referenced in the SDK with the path `contracts/IexecInterface.sol`. +_TODO Referenced in the SDK with the old path `contracts/IexecInterfaceToken.sol`. +The SDK should be updated to use the new path `contracts/IexecInterface.sol`. Changing the name or the path would cause a breaking change in the SDK._ ## FacetBase @@ -793,15 +794,7 @@ function broadcastWorkerpoolOrder(struct IexecLibOrders_v5.WorkerpoolOrder _work function broadcastRequestOrder(struct IexecLibOrders_v5.RequestOrder _requestorder) external ``` -## ConstantsLib - -The single declaration of every protocol constant. {FacetBase} aliases -them so the facets keep reading them under their bare names. - -_They live in a library, not in a base contract, because a library cannot -inherit and a contract constant is not readable from outside its own contract -at any visibility. A library constant carries no such restriction, so both the -facets and the helper libraries reach the same declaration._ +## Constants ## EscrowLib From 4f2b8d32aaea6380ca00bfc9334d5c10cc51dea2 Mon Sep 17 00:00:00 2001 From: Zied <26070035+zguesmi@users.noreply.github.com> Date: Thu, 3 Sep 2026 11:51:56 +0200 Subject: [PATCH 6/9] chore: restore migration script --- scripts/upgrades/v6.2.0.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/upgrades/v6.2.0.ts b/scripts/upgrades/v6.2.0.ts index 06a0d631b..3b5b2aec1 100644 --- a/scripts/upgrades/v6.2.0.ts +++ b/scripts/upgrades/v6.2.0.ts @@ -6,7 +6,7 @@ import { IexecCategoryManagerFacet__factory, IexecConfigurationExtraFacet__factory, IexecConfigurationFacet__factory, - IexecEscrowFacet__factory, + IexecEscrowTokenFacet__factory, IexecOrderManagementFacet__factory, IexecPoco1Facet__factory, IexecPoco2Facet__factory, @@ -39,7 +39,7 @@ async function main() { IexecConfigurationExtraFacet: '0x7Ff117E7385Ac3E207AF1791fE7e66C7802aeCCd', IexecConfigurationFacet: '0x88eb05e62434057d3AA9e41FdaF7300A586b314D', IexecERC20Facet: '0xB0152eC6f48E64a92B66D4736aFA1b02d8D45169', // Removed from codebase - IexecEscrowFacet: '0xd9EB17A161581FBBAD2Ae998c0C19746EaAD0D6E', + IexecEscrowTokenFacet: '0xd9EB17A161581FBBAD2Ae998c0C19746EaAD0D6E', IexecOrderManagementFacet: '0x541d532E6C195Ba044a75325F367342f523627fB', IexecPoco1Facet: '0xC8dE3913fcdBC576970dCe24eE416CA25681f65f', IexecPoco2Facet: '0x5c7B589E6807B554ed278f335215B93bCB692162', @@ -53,7 +53,7 @@ async function main() { IexecConfigurationExtraFacet: '0x7Ff117E7385Ac3E207AF1791fE7e66C7802aeCCd', IexecConfigurationFacet: '0x88eb05e62434057d3AA9e41FdaF7300A586b314D', IexecERC20Facet: '0xB0152eC6f48E64a92B66D4736aFA1b02d8D45169', // Removed from codebase - IexecEscrowFacet: '0xd9EB17A161581FBBAD2Ae998c0C19746EaAD0D6E', + IexecEscrowTokenFacet: '0xd9EB17A161581FBBAD2Ae998c0C19746EaAD0D6E', IexecOrderManagementFacet: '0x541d532E6C195Ba044a75325F367342f523627fB', IexecPoco1Facet: '0x5331c0FC7DD0Cc08047B546675cd1d6d47152AEb', IexecPoco2Facet: '0x5c7B589E6807B554ed278f335215B93bCB692162', @@ -96,8 +96,8 @@ async function main() { factory: null, }, { - name: 'IexecEscrowFacet', - address: addresses['IexecEscrowFacet'], + name: 'IexecEscrowTokenFacet', + address: addresses['IexecEscrowTokenFacet'], factory: null, }, { @@ -150,9 +150,9 @@ async function main() { factory: new IexecConfigurationFacet__factory(iexecLibOrders), }, { - name: 'IexecEscrowFacet', + name: 'IexecEscrowTokenFacet', address: null, - factory: new IexecEscrowFacet__factory(), + factory: new IexecEscrowTokenFacet__factory(), }, { name: 'IexecOrderManagementFacet', From 9c3ed665f8042ded12dada14cbd6466380d56a5d Mon Sep 17 00:00:00 2001 From: Zied <26070035+zguesmi@users.noreply.github.com> Date: Thu, 3 Sep 2026 11:52:52 +0200 Subject: [PATCH 7/9] chore: update diagrams --- docs/uml/class-uml-IexecEscrows.svg | 628 ++++--- docs/uml/class-uml-IexecPocoBoostFacet.svg | 1331 +++++++-------- docs/uml/class-uml-IexecPocoFacets.svg | 1709 ++++++++++---------- docs/uml/class-uml-dir-libs.svg | 1341 +++++++-------- 4 files changed, 2521 insertions(+), 2488 deletions(-) diff --git a/docs/uml/class-uml-IexecEscrows.svg b/docs/uml/class-uml-IexecEscrows.svg index b4a3e3a10..b97cb0531 100644 --- a/docs/uml/class-uml-IexecEscrows.svg +++ b/docs/uml/class-uml-IexecEscrows.svg @@ -4,99 +4,89 @@ - + UmlClassDiagram - + 3 - -<<Abstract>> -FacetBase -contracts/abstract/FacetBase.sol - -Internal: -   CONTRIBUTION_DEADLINE_RATIO: uint256 -   REVEAL_DEADLINE_RATIO: uint256 -   FINAL_DEADLINE_RATIO: uint256 -   WORKERPOOL_STAKE_RATIO: uint256 -   KITTY_RATIO: uint256 -   KITTY_MIN: uint256 -   KITTY_ADDRESS: address -   GROUPMEMBER_PURPOSE: uint256 - -Internal: -    owner(): address -    _msgSender(): address -Public: -    <<modifier>> onlyOwner() + +<<Abstract>> +FacetBase +contracts/abstract/FacetBase.sol + +Internal: +    owner(): address +    _msgSender(): address +Public: +    <<modifier>> onlyOwner() 8 - -IexecEscrowFacet -contracts/facets/IexecEscrowFacet.sol - -Internal: -    _executeOperation(sender: address, data: bytes) -    _validateMatchOrders(sender: address, data: bytes) -    _deposit(from: address, amount: uint256) -    _withdraw(to: address, amount: uint256) -External: -    <<payable>> null() -    <<payable>> null() -    deposit(amount: uint256): bool -    depositFor(amount: uint256, target: address): bool -    depositForArray(amounts: uint256[], targets: address[]): bool -    withdraw(amount: uint256): bool -    withdrawTo(amount: uint256, target: address): bool -    recover(): uint256 <<onlyOwner>> -    receiveApproval(sender: address, amount: uint256, token: address, data: bytes): bool -    transfer(recipient: address, amount: uint256): bool -    approve(spender: address, value: uint256): bool -    approveAndCall(spender: address, value: uint256, extraData: bytes): bool -    transferFrom(sender: address, recipient: address, amount: uint256): bool -    increaseAllowance(spender: address, addedValue: uint256): bool -    decreaseAllowance(spender: address, subtractedValue: uint256): bool + +IexecEscrowFacet +contracts/facets/IexecEscrowFacet.sol + +Internal: +    _executeOperation(sender: address, data: bytes) +    _validateMatchOrders(sender: address, data: bytes) +    _deposit(from: address, amount: uint256) +    _withdraw(to: address, amount: uint256) +External: +    <<payable>> null() +    <<payable>> null() +    deposit(amount: uint256): bool +    depositFor(amount: uint256, target: address): bool +    depositForArray(amounts: uint256[], targets: address[]): bool +    withdraw(amount: uint256): bool +    withdrawTo(amount: uint256, target: address): bool +    recover(): uint256 <<onlyOwner>> +    receiveApproval(sender: address, amount: uint256, token: address, data: bytes): bool +    transfer(recipient: address, amount: uint256): bool +    approve(spender: address, value: uint256): bool +    approveAndCall(spender: address, value: uint256, extraData: bytes): bool +    transferFrom(sender: address, recipient: address, amount: uint256): bool +    increaseAllowance(spender: address, addedValue: uint256): bool +    decreaseAllowance(spender: address, subtractedValue: uint256): bool 8->3 - - + + 22 - -<<Interface>> -IexecEscrow -contracts/interfaces/IexecEscrow.sol - -External: -     null() -     null() -     deposit(uint256): bool -     depositFor(uint256, address): bool -     depositForArray(uint256[], address[]): bool -     withdraw(uint256): bool -     withdrawTo(uint256, address): bool -     recover(): uint256 -     transfer(address, uint256): bool -     approve(address, uint256): bool -     transferFrom(address, address, uint256): bool -     increaseAllowance(address, uint256): bool -     decreaseAllowance(address, uint256): bool -     approveAndCall(address, uint256, bytes): bool + +<<Interface>> +IexecEscrow +contracts/interfaces/IexecEscrow.sol + +External: +     null() +     null() +     deposit(uint256): bool +     depositFor(uint256, address): bool +     depositForArray(uint256[], address[]): bool +     withdraw(uint256): bool +     withdrawTo(uint256, address): bool +     recover(): uint256 +     transfer(address, uint256): bool +     approve(address, uint256): bool +     transferFrom(address, address, uint256): bool +     increaseAllowance(address, uint256): bool +     decreaseAllowance(address, uint256): bool +     approveAndCall(address, uint256, bytes): bool 8->22 - - + + @@ -121,8 +111,8 @@ 8->26 - - + + @@ -138,12 +128,12 @@ 8->33 - - + + - + -50 +51 <<Library>> IexecLibOrders_v5 @@ -171,115 +161,115 @@    hash(_workerpoolorderoperation: WorkerpoolOrderOperation): bytes32    hash(_requestorderoperation: RequestOrderOperation): bytes32 - + -8->50 - +8->51 + - - -61 - -<<Library>> -PocoStorageLib -contracts/libs/PocoStorageLib.sol - -Private: -   POCO_STORAGE_LOCATION: bytes32 - -Internal: -    getPocoStorage(): ($: PocoStorage) - - - -8->61 - - - - + 62 - -<<Struct>> -PocoStorage -contracts/libs/PocoStorageLib.sol - -m_appregistry: IRegistry -m_datasetregistry: IRegistry -m_workerpoolregistry: IRegistry -m_baseToken: IERC20 -m_name: string -m_symbol: string -m_decimals: uint8 -m_totalSupply: uint256 -m_balances: mapping(address=>uint256) -m_frozens: mapping(address=>uint256) -m_allowances: mapping(address=>mapping(address=>uint256)) -m_eip712DomainSeparator: bytes32 -m_presigned: mapping(bytes32=>address) -m_consumed: mapping(bytes32=>uint256) -m_deals: mapping(bytes32=>IexecLibCore_v5.Deal) -m_tasks: mapping(bytes32=>IexecLibCore_v5.Task) -m_consensus: mapping(bytes32=>IexecLibCore_v5.Consensus) -m_contributions: mapping(bytes32=>mapping(address=>IexecLibCore_v5.Contribution)) -m_workerScores: mapping(address=>uint256) -m_teebroker: address -m_callbackgas: uint256 -m_categories: IexecLibCore_v5.Category[] -m_v3_iexecHub: IexecHubV3Interface -m_v3_scoreImported: mapping(address=>bool) -m_dealsBoost: mapping(bytes32=>IexecLibCore_v5.DealBoost) + +<<Library>> +PocoStorageLib +contracts/libs/PocoStorageLib.sol + +Private: +   POCO_STORAGE_LOCATION: bytes32 + +Internal: +    getPocoStorage(): ($: PocoStorage) - + 8->62 - - + + - + 63 - -<<Library>> -StakedRlcLib -contracts/libs/StakedRlcLib.sol - -Internal: -    transfer(from: address, to: address, value: uint256) -    mint(account: address, amount: uint256) -    burn(account: address, amount: uint256) -    approve(owner: address, spender: address, amount: uint256) -Public: -    <<event>> Transfer(from: address, to: address, value: uint256) -    <<event>> Approval(owner: address, spender: address, value: uint256) + +<<Struct>> +PocoStorage +contracts/libs/PocoStorageLib.sol + +m_appregistry: IRegistry +m_datasetregistry: IRegistry +m_workerpoolregistry: IRegistry +m_baseToken: IERC20 +m_name: string +m_symbol: string +m_decimals: uint8 +m_totalSupply: uint256 +m_balances: mapping(address=>uint256) +m_frozens: mapping(address=>uint256) +m_allowances: mapping(address=>mapping(address=>uint256)) +m_eip712DomainSeparator: bytes32 +m_presigned: mapping(bytes32=>address) +m_consumed: mapping(bytes32=>uint256) +m_deals: mapping(bytes32=>IexecLibCore_v5.Deal) +m_tasks: mapping(bytes32=>IexecLibCore_v5.Task) +m_consensus: mapping(bytes32=>IexecLibCore_v5.Consensus) +m_contributions: mapping(bytes32=>mapping(address=>IexecLibCore_v5.Contribution)) +m_workerScores: mapping(address=>uint256) +m_teebroker: address +m_callbackgas: uint256 +m_categories: IexecLibCore_v5.Category[] +m_v3_iexecHub: IexecHubV3Interface +m_v3_scoreImported: mapping(address=>bool) +m_dealsBoost: mapping(bytes32=>IexecLibCore_v5.DealBoost) - + 8->63 - - + + + + + +64 + +<<Library>> +StakedRlcLib +contracts/libs/StakedRlcLib.sol + +Internal: +    transfer(from: address, to: address, value: uint256) +    mint(account: address, amount: uint256) +    burn(account: address, amount: uint256) +    approve(owner: address, spender: address, amount: uint256) +Public: +    <<event>> Transfer(from: address, to: address, value: uint256) +    <<event>> Approval(owner: address, spender: address, value: uint256) + + + +8->64 + + 24 - -<<Interface>> -IexecHubV3Interface -contracts/interfaces/IexecHubV3Interface.sol - -External: -     viewScore(worker: address): uint256 - - + +<<Interface>> +IexecHubV3Interface +contracts/interfaces/IexecHubV3Interface.sol + +External: +     viewScore(worker: address): uint256 + + -26->50 +26->51 - + -53 +54 <<Struct>> AppOrder @@ -295,15 +285,15 @@ salt: bytes32 sign: bytes - + -26->53 +26->54 - + -54 +55 <<Struct>> DatasetOrder @@ -319,15 +309,15 @@ salt: bytes32 sign: bytes - + -26->54 +26->55 - + -55 +56 <<Struct>> WorkerpoolOrder @@ -345,15 +335,15 @@ salt: bytes32 sign: bytes - + -26->55 +26->56 - + -56 +57 <<Struct>> RequestOrder @@ -376,61 +366,61 @@ salt: bytes32 sign: bytes - + -26->56 +26->57 - + -35 - -<<Library>> -EscrowLib -contracts/libs/EscrowLib.sol - -Internal: -    lock(account: address, value: uint256) -    unlock(account: address, value: uint256) -    reward(account: address, value: uint256, ref: bytes32) -    seize(account: address, value: uint256, ref: bytes32) -    rewardAndLock(account: address, value: uint256, ref: bytes32) -Public: -    <<event>> Reward(owner: address, amount: uint256, ref: bytes32) -    <<event>> Seize(owner: address, amount: uint256, ref: bytes32) -    <<event>> Lock(owner: address, amount: uint256) -    <<event>> Unlock(owner: address, amount: uint256) - - +36 + +<<Library>> +EscrowLib +contracts/libs/EscrowLib.sol + +Internal: +    lock(account: address, value: uint256) +    unlock(account: address, value: uint256) +    reward(account: address, value: uint256, ref: bytes32) +    seize(account: address, value: uint256, ref: bytes32) +    rewardAndLock(account: address, value: uint256, ref: bytes32) +Public: +    <<event>> Reward(owner: address, amount: uint256, ref: bytes32) +    <<event>> Seize(owner: address, amount: uint256, ref: bytes32) +    <<event>> Lock(owner: address, amount: uint256) +    <<event>> Unlock(owner: address, amount: uint256) + + -35->61 - - +36->62 + + - + -35->62 - - +36->63 + + - + -35->63 - - +36->64 + + - + -36 - -<<Library>> -IexecLibCore_v5 -contracts/libs/IexecLibCore_v5.sol +37 + +<<Library>> +IexecLibCore_v5 +contracts/libs/IexecLibCore_v5.sol - + -52 +53 <<Struct>> EIP712Domain @@ -441,39 +431,39 @@ chainId: uint256 verifyingContract: address - + -50->52 +51->53 - + -50->53 +51->54 - + -50->54 +51->55 - + -50->55 +51->56 - + -50->56 +51->57 - + -57 +58 <<Struct>> AppOrderOperation @@ -483,15 +473,15 @@ operation: OrderOperationEnum sign: bytes - + -50->57 +51->58 - + -58 +59 <<Struct>> DatasetOrderOperation @@ -501,15 +491,15 @@ operation: OrderOperationEnum sign: bytes - + -50->58 +51->59 - + -59 +60 <<Struct>> WorkerpoolOrderOperation @@ -519,15 +509,15 @@ operation: OrderOperationEnum sign: bytes - + -50->59 +51->60 - + -60 +61 <<Struct>> RequestOrderOperation @@ -537,15 +527,15 @@ operation: OrderOperationEnum sign: bytes - + -50->60 +51->61 - + -51 +52 <<Enum>> OrderOperationEnum @@ -554,166 +544,166 @@ SIGN: 0 CLOSE: 1 - + -51->50 +52->51 - + -52->50 +53->51 - + -53->50 +54->51 - + -54->50 +55->51 - + -55->50 +56->51 - + -56->50 +57->51 - + -57->50 +58->51 - + -57->51 +58->52 - + -57->53 +58->54 - + -58->50 +59->51 - + -58->51 +59->52 - + -58->54 +59->55 - + -59->50 +60->51 - + -59->51 +60->52 - + -59->55 +60->56 - + -60->50 +61->51 - + -60->51 +61->52 - + -60->56 +61->57 - + -61->62 - - +62->63 + + - + -62->24 - - +63->24 + + - + -62->36 - - +63->37 + + - + -62->61 - - +63->62 + + - + -64 - -<<Interface>> -IRegistry -contracts/registries/IRegistry.sol - -External: -     isRegistered(_entry: address): bool - - +65 + +<<Interface>> +IRegistry +contracts/registries/IRegistry.sol + +External: +     isRegistered(_entry: address): bool + + -62->64 - - +63->65 + + - + -63->61 - - +64->62 + + - + -63->62 - - +64->63 + + diff --git a/docs/uml/class-uml-IexecPocoBoostFacet.svg b/docs/uml/class-uml-IexecPocoBoostFacet.svg index e5cf871b5..8449a4632 100644 --- a/docs/uml/class-uml-IexecPocoBoostFacet.svg +++ b/docs/uml/class-uml-IexecPocoBoostFacet.svg @@ -4,864 +4,875 @@ - - + + UmlClassDiagram - + 3 - -<<Abstract>> -FacetBase -contracts/abstract/FacetBase.sol - -Internal: -   CONTRIBUTION_DEADLINE_RATIO: uint256 -   REVEAL_DEADLINE_RATIO: uint256 -   FINAL_DEADLINE_RATIO: uint256 -   WORKERPOOL_STAKE_RATIO: uint256 -   KITTY_RATIO: uint256 -   KITTY_MIN: uint256 -   KITTY_ADDRESS: address -   GROUPMEMBER_PURPOSE: uint256 - -Internal: -    owner(): address -    _msgSender(): address -Public: -    <<modifier>> onlyOwner() - - + +<<Abstract>> +FacetBase +contracts/abstract/FacetBase.sol + +Internal: +    owner(): address +    _msgSender(): address +Public: +    <<modifier>> onlyOwner() + + -68 - -<<Interface>> -IOracleConsumer -contracts/external/interfaces/IOracleConsumer.sol - -External: -     receiveResult(taskId: bytes32, resultsCallback: bytes) +69 + +<<Interface>> +IOracleConsumer +contracts/external/interfaces/IOracleConsumer.sol + +External: +     receiveResult(taskId: bytes32, resultsCallback: bytes) 15 - -IexecPocoBoostFacet -contracts/facets/IexecPocoBoostFacet.sol - -Private: -    _matchOrdersBoost(appOrder: IexecLibOrders_v5.AppOrder, datasetOrder: IexecLibOrders_v5.DatasetOrder, workerpoolOrder: IexecLibOrders_v5.WorkerpoolOrder, requestOrder: IexecLibOrders_v5.RequestOrder, sponsor: address): bytes32 -    requireTaskExistsAndUnset(taskStatus: IexecLibCore_v5.TaskStatusEnum, taskIndex: uint256, botSize: uint16) -External: -    matchOrdersBoost(appOrder: IexecLibOrders_v5.AppOrder, datasetOrder: IexecLibOrders_v5.DatasetOrder, workerpoolOrder: IexecLibOrders_v5.WorkerpoolOrder, requestOrder: IexecLibOrders_v5.RequestOrder): bytes32 -    sponsorMatchOrdersBoost(appOrder: IexecLibOrders_v5.AppOrder, datasetOrder: IexecLibOrders_v5.DatasetOrder, workerpoolOrder: IexecLibOrders_v5.WorkerpoolOrder, requestOrder: IexecLibOrders_v5.RequestOrder): bytes32 -    pushResultBoost(dealId: bytes32, index: uint256, results: bytes, resultsCallback: bytes, authorizationSign: bytes, enclaveChallenge: address, enclaveSign: bytes) -    claimBoost(dealId: bytes32, index: uint256) + +IexecPocoBoostFacet +contracts/facets/IexecPocoBoostFacet.sol + +Private: +    _matchOrdersBoost(appOrder: IexecLibOrders_v5.AppOrder, datasetOrder: IexecLibOrders_v5.DatasetOrder, workerpoolOrder: IexecLibOrders_v5.WorkerpoolOrder, requestOrder: IexecLibOrders_v5.RequestOrder, sponsor: address): bytes32 +    requireTaskExistsAndUnset(taskStatus: IexecLibCore_v5.TaskStatusEnum, taskIndex: uint256, botSize: uint16) +External: +    matchOrdersBoost(appOrder: IexecLibOrders_v5.AppOrder, datasetOrder: IexecLibOrders_v5.DatasetOrder, workerpoolOrder: IexecLibOrders_v5.WorkerpoolOrder, requestOrder: IexecLibOrders_v5.RequestOrder): bytes32 +    sponsorMatchOrdersBoost(appOrder: IexecLibOrders_v5.AppOrder, datasetOrder: IexecLibOrders_v5.DatasetOrder, workerpoolOrder: IexecLibOrders_v5.WorkerpoolOrder, requestOrder: IexecLibOrders_v5.RequestOrder): bytes32 +    pushResultBoost(dealId: bytes32, index: uint256, results: bytes, resultsCallback: bytes, authorizationSign: bytes, enclaveChallenge: address, enclaveSign: bytes) +    claimBoost(dealId: bytes32, index: uint256) 15->3 - - + + - - -15->68 - - + + +15->69 + + 30 - -<<Interface>> -IexecPocoBoost -contracts/interfaces/IexecPocoBoost.sol - -External: -     matchOrdersBoost(appOrder: IexecLibOrders_v5.AppOrder, datasetOrder: IexecLibOrders_v5.DatasetOrder, workerpoolOrder: IexecLibOrders_v5.WorkerpoolOrder, requestOrder: IexecLibOrders_v5.RequestOrder): bytes32 -     sponsorMatchOrdersBoost(appOrder: IexecLibOrders_v5.AppOrder, datasetOrder: IexecLibOrders_v5.DatasetOrder, workerpoolOrder: IexecLibOrders_v5.WorkerpoolOrder, requestOrder: IexecLibOrders_v5.RequestOrder): bytes32 -     pushResultBoost(dealId: bytes32, index: uint256, results: bytes, resultsCallback: bytes, authorizationSign: bytes, enclaveChallenge: address, enclaveSign: bytes) -     claimBoost(dealId: bytes32, index: uint256) -Public: -    <<event>> SchedulerNoticeBoost(workerpool: address, dealId: bytes32, app: address, dataset: address, category: uint256, tag: bytes32, params: string, beneficiary: address) -    <<event>> OrdersMatched(dealid: bytes32, appHash: bytes32, datasetHash: bytes32, workerpoolHash: bytes32, requestHash: bytes32, volume: uint256) -    <<event>> ResultPushedBoost(dealId: bytes32, index: uint256, results: bytes) -    <<event>> TaskClaimed(taskid: bytes32) -    <<event>> DealSponsoredBoost(dealId: bytes32, sponsor: address) + +<<Interface>> +IexecPocoBoost +contracts/interfaces/IexecPocoBoost.sol + +External: +     matchOrdersBoost(appOrder: IexecLibOrders_v5.AppOrder, datasetOrder: IexecLibOrders_v5.DatasetOrder, workerpoolOrder: IexecLibOrders_v5.WorkerpoolOrder, requestOrder: IexecLibOrders_v5.RequestOrder): bytes32 +     sponsorMatchOrdersBoost(appOrder: IexecLibOrders_v5.AppOrder, datasetOrder: IexecLibOrders_v5.DatasetOrder, workerpoolOrder: IexecLibOrders_v5.WorkerpoolOrder, requestOrder: IexecLibOrders_v5.RequestOrder): bytes32 +     pushResultBoost(dealId: bytes32, index: uint256, results: bytes, resultsCallback: bytes, authorizationSign: bytes, enclaveChallenge: address, enclaveSign: bytes) +     claimBoost(dealId: bytes32, index: uint256) +Public: +    <<event>> SchedulerNoticeBoost(workerpool: address, dealId: bytes32, app: address, dataset: address, category: uint256, tag: bytes32, params: string, beneficiary: address) +    <<event>> OrdersMatched(dealid: bytes32, appHash: bytes32, datasetHash: bytes32, workerpoolHash: bytes32, requestHash: bytes32, volume: uint256) +    <<event>> ResultPushedBoost(dealId: bytes32, index: uint256, results: bytes) +    <<event>> TaskClaimed(taskid: bytes32) +    <<event>> DealSponsoredBoost(dealId: bytes32, sponsor: address) 15->30 - - + + 34 - -<<Library>> -CommonLib -contracts/libs/CommonLib.sol - -Private: -   GROUPMEMBER_PURPOSE: uint256 - -Internal: -    toTypedDataHash(structHash: bytes32): bytes32 -    verifySignatureOfEthSignedMessage(account: address, message: bytes, signature: bytes): bool -    verifySignature(account: address, messageHash: bytes32, signature: bytes): bool -    verifyPresignature(account: address, messageHash: bytes32): bool -    verifySignatureOrPresignature(account: address, messageHash: bytes32, signature: bytes): bool -    isAccountAuthorizedByRestriction(restriction: address, account: address): bool -    computeDealVolume(appOrderVolume: uint256, appOrderTypedDataHash: bytes32, hasDataset: bool, datasetOrderVolume: uint256, datasetOrderTypedDataHash: bytes32, workerpoolOrderVolume: uint256, workerpoolOrderTypedDataHash: bytes32, requestOrderVolume: uint256, requestOrderTypedDataHash: bytes32): uint256 + +<<Library>> +CommonLib +contracts/libs/CommonLib.sol + +Internal: +    toTypedDataHash(structHash: bytes32): bytes32 +    verifySignatureOfEthSignedMessage(account: address, message: bytes, signature: bytes): bool +    verifySignature(account: address, messageHash: bytes32, signature: bytes): bool +    verifyPresignature(account: address, messageHash: bytes32): bool +    verifySignatureOrPresignature(account: address, messageHash: bytes32, signature: bytes): bool +    isAccountAuthorizedByRestriction(restriction: address, account: address): bool +    computeDealVolume(appOrderVolume: uint256, appOrderTypedDataHash: bytes32, hasDataset: bool, datasetOrderVolume: uint256, datasetOrderTypedDataHash: bytes32, workerpoolOrderVolume: uint256, workerpoolOrderTypedDataHash: bytes32, requestOrderVolume: uint256, requestOrderTypedDataHash: bytes32): uint256 15->34 - - + + 35 - -<<Library>> -EscrowLib -contracts/libs/EscrowLib.sol - -Internal: -    lock(account: address, value: uint256) -    unlock(account: address, value: uint256) -    reward(account: address, value: uint256, ref: bytes32) -    seize(account: address, value: uint256, ref: bytes32) -    rewardAndLock(account: address, value: uint256, ref: bytes32) -Public: -    <<event>> Reward(owner: address, amount: uint256, ref: bytes32) -    <<event>> Seize(owner: address, amount: uint256, ref: bytes32) -    <<event>> Lock(owner: address, amount: uint256) -    <<event>> Unlock(owner: address, amount: uint256) + +<<Library>> +Constants +contracts/libs/Constants.sol + +Internal: +   CONTRIBUTION_DEADLINE_RATIO: uint256 +   REVEAL_DEADLINE_RATIO: uint256 +   FINAL_DEADLINE_RATIO: uint256 +   WORKERPOOL_STAKE_RATIO: uint256 +   KITTY_RATIO: uint256 +   KITTY_MIN: uint256 +   KITTY_ADDRESS: address +   GROUPMEMBER_PURPOSE: uint256 15->35 - - + + 36 - -<<Library>> -IexecLibCore_v5 -contracts/libs/IexecLibCore_v5.sol + +<<Library>> +EscrowLib +contracts/libs/EscrowLib.sol + +Internal: +    lock(account: address, value: uint256) +    unlock(account: address, value: uint256) +    reward(account: address, value: uint256, ref: bytes32) +    seize(account: address, value: uint256, ref: bytes32) +    rewardAndLock(account: address, value: uint256, ref: bytes32) +Public: +    <<event>> Reward(owner: address, amount: uint256, ref: bytes32) +    <<event>> Seize(owner: address, amount: uint256, ref: bytes32) +    <<event>> Lock(owner: address, amount: uint256) +    <<event>> Unlock(owner: address, amount: uint256) - + 15->36 - - + + - + -44 - -<<Struct>> -DealBoost -contracts/libs/IexecLibCore_v5.sol - -appOwner: address -appPrice: uint96 -datasetOwner: address -datasetPrice: uint96 -workerpoolOwner: address -workerpoolPrice: uint96 -requester: address -workerReward: uint96 -callback: address -deadline: uint40 -botFirst: uint16 -botSize: uint16 -shortTag: bytes3 -sponsor: address - - - -15->44 - - +37 + +<<Library>> +IexecLibCore_v5 +contracts/libs/IexecLibCore_v5.sol + + + +15->37 + + 45 - -<<Enum>> -TaskStatusEnum -contracts/libs/IexecLibCore_v5.sol - -UNSET: 0 -ACTIVE: 1 -REVEALING: 2 -COMPLETED: 3 -FAILED: 4 + +<<Struct>> +DealBoost +contracts/libs/IexecLibCore_v5.sol + +appOwner: address +appPrice: uint96 +datasetOwner: address +datasetPrice: uint96 +workerpoolOwner: address +workerpoolPrice: uint96 +requester: address +workerReward: uint96 +callback: address +deadline: uint40 +botFirst: uint16 +botSize: uint16 +shortTag: bytes3 +sponsor: address - + 15->45 - - + + 46 - -<<Struct>> -Task -contracts/libs/IexecLibCore_v5.sol - -status: TaskStatusEnum -dealid: bytes32 -idx: uint256 -timeref: uint256 -contributionDeadline: uint256 -revealDeadline: uint256 -finalDeadline: uint256 -consensusValue: bytes32 -revealCounter: uint256 -winnerCounter: uint256 -contributors: address[] -resultDigest: bytes32 -results: bytes -resultsTimestamp: uint256 -resultsCallback: bytes + +<<Enum>> +TaskStatusEnum +contracts/libs/IexecLibCore_v5.sol + +UNSET: 0 +ACTIVE: 1 +REVEALING: 2 +COMPLETED: 3 +FAILED: 4 - + 15->46 - - + + - + -50 - -<<Library>> -IexecLibOrders_v5 -contracts/libs/IexecLibOrders_v5.sol - -Public: -   EIP712DOMAIN_TYPEHASH: bytes32 -   APPORDER_TYPEHASH: bytes32 -   DATASETORDER_TYPEHASH: bytes32 -   WORKERPOOLORDER_TYPEHASH: bytes32 -   REQUESTORDER_TYPEHASH: bytes32 -   APPORDEROPERATION_TYPEHASH: bytes32 -   DATASETORDEROPERATION_TYPEHASH: bytes32 -   WORKERPOOLORDEROPERATION_TYPEHASH: bytes32 -   REQUESTORDEROPERATION_TYPEHASH: bytes32 - -Public: -    hash(_domain: EIP712Domain): (domainhash: bytes32) -    hash(_apporder: AppOrder): (apphash: bytes32) -    hash(_datasetorder: DatasetOrder): (datasethash: bytes32) -    hash(_workerpoolorder: WorkerpoolOrder): (workerpoolhash: bytes32) -    hash(_requestorder: RequestOrder): (requesthash: bytes32) -    hash(_apporderoperation: AppOrderOperation): bytes32 -    hash(_datasetorderoperation: DatasetOrderOperation): bytes32 -    hash(_workerpoolorderoperation: WorkerpoolOrderOperation): bytes32 -    hash(_requestorderoperation: RequestOrderOperation): bytes32 - - - -15->50 - - +47 + +<<Struct>> +Task +contracts/libs/IexecLibCore_v5.sol + +status: TaskStatusEnum +dealid: bytes32 +idx: uint256 +timeref: uint256 +contributionDeadline: uint256 +revealDeadline: uint256 +finalDeadline: uint256 +consensusValue: bytes32 +revealCounter: uint256 +winnerCounter: uint256 +contributors: address[] +resultDigest: bytes32 +results: bytes +resultsTimestamp: uint256 +resultsCallback: bytes + + + +15->47 + + - - -53 - -<<Struct>> -AppOrder -contracts/libs/IexecLibOrders_v5.sol - -app: address -appprice: uint256 -volume: uint256 -tag: bytes32 -datasetrestrict: address -workerpoolrestrict: address -requesterrestrict: address -salt: bytes32 -sign: bytes - - - -15->53 - - + + +51 + +<<Library>> +IexecLibOrders_v5 +contracts/libs/IexecLibOrders_v5.sol + +Public: +   EIP712DOMAIN_TYPEHASH: bytes32 +   APPORDER_TYPEHASH: bytes32 +   DATASETORDER_TYPEHASH: bytes32 +   WORKERPOOLORDER_TYPEHASH: bytes32 +   REQUESTORDER_TYPEHASH: bytes32 +   APPORDEROPERATION_TYPEHASH: bytes32 +   DATASETORDEROPERATION_TYPEHASH: bytes32 +   WORKERPOOLORDEROPERATION_TYPEHASH: bytes32 +   REQUESTORDEROPERATION_TYPEHASH: bytes32 + +Public: +    hash(_domain: EIP712Domain): (domainhash: bytes32) +    hash(_apporder: AppOrder): (apphash: bytes32) +    hash(_datasetorder: DatasetOrder): (datasethash: bytes32) +    hash(_workerpoolorder: WorkerpoolOrder): (workerpoolhash: bytes32) +    hash(_requestorder: RequestOrder): (requesthash: bytes32) +    hash(_apporderoperation: AppOrderOperation): bytes32 +    hash(_datasetorderoperation: DatasetOrderOperation): bytes32 +    hash(_workerpoolorderoperation: WorkerpoolOrderOperation): bytes32 +    hash(_requestorderoperation: RequestOrderOperation): bytes32 + + + +15->51 + + 54 - -<<Struct>> -DatasetOrder -contracts/libs/IexecLibOrders_v5.sol - -dataset: address -datasetprice: uint256 -volume: uint256 -tag: bytes32 -apprestrict: address -workerpoolrestrict: address -requesterrestrict: address -salt: bytes32 -sign: bytes + +<<Struct>> +AppOrder +contracts/libs/IexecLibOrders_v5.sol + +app: address +appprice: uint256 +volume: uint256 +tag: bytes32 +datasetrestrict: address +workerpoolrestrict: address +requesterrestrict: address +salt: bytes32 +sign: bytes - + 15->54 - - + + 55 - -<<Struct>> -WorkerpoolOrder -contracts/libs/IexecLibOrders_v5.sol - -workerpool: address -workerpoolprice: uint256 -volume: uint256 -tag: bytes32 -category: uint256 -trust: uint256 -apprestrict: address -datasetrestrict: address -requesterrestrict: address -salt: bytes32 -sign: bytes + +<<Struct>> +DatasetOrder +contracts/libs/IexecLibOrders_v5.sol + +dataset: address +datasetprice: uint256 +volume: uint256 +tag: bytes32 +apprestrict: address +workerpoolrestrict: address +requesterrestrict: address +salt: bytes32 +sign: bytes - + 15->55 - - + + 56 - -<<Struct>> -RequestOrder -contracts/libs/IexecLibOrders_v5.sol - -app: address -appmaxprice: uint256 -dataset: address -datasetmaxprice: uint256 -workerpool: address -workerpoolmaxprice: uint256 -requester: address -volume: uint256 -tag: bytes32 -category: uint256 -trust: uint256 -beneficiary: address -callback: address -params: string -salt: bytes32 -sign: bytes + +<<Struct>> +WorkerpoolOrder +contracts/libs/IexecLibOrders_v5.sol + +workerpool: address +workerpoolprice: uint256 +volume: uint256 +tag: bytes32 +category: uint256 +trust: uint256 +apprestrict: address +datasetrestrict: address +requesterrestrict: address +salt: bytes32 +sign: bytes - + 15->56 - - + + - - -61 - -<<Library>> -PocoStorageLib -contracts/libs/PocoStorageLib.sol - -Private: -   POCO_STORAGE_LOCATION: bytes32 - -Internal: -    getPocoStorage(): ($: PocoStorage) - - - -15->61 - - + + +57 + +<<Struct>> +RequestOrder +contracts/libs/IexecLibOrders_v5.sol + +app: address +appmaxprice: uint256 +dataset: address +datasetmaxprice: uint256 +workerpool: address +workerpoolmaxprice: uint256 +requester: address +volume: uint256 +tag: bytes32 +category: uint256 +trust: uint256 +beneficiary: address +callback: address +params: string +salt: bytes32 +sign: bytes + + + +15->57 + + 62 - -<<Struct>> -PocoStorage -contracts/libs/PocoStorageLib.sol - -m_appregistry: IRegistry -m_datasetregistry: IRegistry -m_workerpoolregistry: IRegistry -m_baseToken: IERC20 -m_name: string -m_symbol: string -m_decimals: uint8 -m_totalSupply: uint256 -m_balances: mapping(address=>uint256) -m_frozens: mapping(address=>uint256) -m_allowances: mapping(address=>mapping(address=>uint256)) -m_eip712DomainSeparator: bytes32 -m_presigned: mapping(bytes32=>address) -m_consumed: mapping(bytes32=>uint256) -m_deals: mapping(bytes32=>IexecLibCore_v5.Deal) -m_tasks: mapping(bytes32=>IexecLibCore_v5.Task) -m_consensus: mapping(bytes32=>IexecLibCore_v5.Consensus) -m_contributions: mapping(bytes32=>mapping(address=>IexecLibCore_v5.Contribution)) -m_workerScores: mapping(address=>uint256) -m_teebroker: address -m_callbackgas: uint256 -m_categories: IexecLibCore_v5.Category[] -m_v3_iexecHub: IexecHubV3Interface -m_v3_scoreImported: mapping(address=>bool) -m_dealsBoost: mapping(bytes32=>IexecLibCore_v5.DealBoost) + +<<Library>> +PocoStorageLib +contracts/libs/PocoStorageLib.sol + +Private: +   POCO_STORAGE_LOCATION: bytes32 + +Internal: +    getPocoStorage(): ($: PocoStorage) - + 15->62 - - + + - - -79 - -<<Interface>> -IWorkerpool -contracts/registries/workerpools/IWorkerpool.v8.sol - -External: -     owner(): address -     m_workerpoolDescription(): string -     m_schedulerRewardRatioPolicy(): uint256 -     m_workerStakeRatioPolicy(): uint256 - - + + +63 + +<<Struct>> +PocoStorage +contracts/libs/PocoStorageLib.sol + +m_appregistry: IRegistry +m_datasetregistry: IRegistry +m_workerpoolregistry: IRegistry +m_baseToken: IERC20 +m_name: string +m_symbol: string +m_decimals: uint8 +m_totalSupply: uint256 +m_balances: mapping(address=>uint256) +m_frozens: mapping(address=>uint256) +m_allowances: mapping(address=>mapping(address=>uint256)) +m_eip712DomainSeparator: bytes32 +m_presigned: mapping(bytes32=>address) +m_consumed: mapping(bytes32=>uint256) +m_deals: mapping(bytes32=>IexecLibCore_v5.Deal) +m_tasks: mapping(bytes32=>IexecLibCore_v5.Task) +m_consensus: mapping(bytes32=>IexecLibCore_v5.Consensus) +m_contributions: mapping(bytes32=>mapping(address=>IexecLibCore_v5.Contribution)) +m_workerScores: mapping(address=>uint256) +m_teebroker: address +m_callbackgas: uint256 +m_categories: IexecLibCore_v5.Category[] +m_v3_iexecHub: IexecHubV3Interface +m_v3_scoreImported: mapping(address=>bool) +m_dealsBoost: mapping(bytes32=>IexecLibCore_v5.DealBoost) + + + +15->63 + + + + + +80 + +<<Interface>> +IWorkerpool +contracts/registries/workerpools/IWorkerpool.v8.sol + +External: +     owner(): address +     m_workerpoolDescription(): string +     m_schedulerRewardRatioPolicy(): uint256 +     m_workerStakeRatioPolicy(): uint256 + + -15->79 - - +15->80 + + 24 - -<<Interface>> -IexecHubV3Interface -contracts/interfaces/IexecHubV3Interface.sol - -External: -     viewScore(worker: address): uint256 - - - -30->50 - - - - + +<<Interface>> +IexecHubV3Interface +contracts/interfaces/IexecHubV3Interface.sol + +External: +     viewScore(worker: address): uint256 + + -30->53 - - +30->51 + + 30->54 - - + + 30->55 - - + + 30->56 - - + + - + -34->61 - - +30->57 + + 34->62 - - + + - + -35->61 - - +34->63 + + - + -35->62 - - +36->62 + + - - -63 - -<<Library>> -StakedRlcLib -contracts/libs/StakedRlcLib.sol - -Internal: -    transfer(from: address, to: address, value: uint256) -    mint(account: address, amount: uint256) -    burn(account: address, amount: uint256) -    approve(owner: address, spender: address, amount: uint256) -Public: -    <<event>> Transfer(from: address, to: address, value: uint256) -    <<event>> Approval(owner: address, spender: address, value: uint256) - - + -35->63 - - +36->63 + + - - -44->36 - - - - + + +64 + +<<Library>> +StakedRlcLib +contracts/libs/StakedRlcLib.sol + +Internal: +    transfer(from: address, to: address, value: uint256) +    mint(account: address, amount: uint256) +    burn(account: address, amount: uint256) +    approve(owner: address, spender: address, amount: uint256) +Public: +    <<event>> Transfer(from: address, to: address, value: uint256) +    <<event>> Approval(owner: address, spender: address, value: uint256) + + -45->36 - - +36->64 + + - + -46->36 - - +45->37 + + - + + +46->37 + + + + -46->45 - - +47->37 + + - - -52 - -<<Struct>> -EIP712Domain -contracts/libs/IexecLibOrders_v5.sol - -name: string -version: string -chainId: uint256 -verifyingContract: address - - - -50->52 - - + + +47->46 + + - + + +53 + +<<Struct>> +EIP712Domain +contracts/libs/IexecLibOrders_v5.sol + +name: string +version: string +chainId: uint256 +verifyingContract: address + + -50->53 - - +51->53 + + - + -50->54 - - +51->54 + + - + -50->55 - - +51->55 + + - + -50->56 - - +51->56 + + - - -57 - -<<Struct>> -AppOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: AppOrder -operation: OrderOperationEnum -sign: bytes - - + -50->57 - - +51->57 + + 58 - -<<Struct>> -DatasetOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: DatasetOrder -operation: OrderOperationEnum -sign: bytes - - + +<<Struct>> +AppOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: AppOrder +operation: OrderOperationEnum +sign: bytes + + -50->58 - - +51->58 + + 59 - -<<Struct>> -WorkerpoolOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: WorkerpoolOrder -operation: OrderOperationEnum -sign: bytes - - + +<<Struct>> +DatasetOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: DatasetOrder +operation: OrderOperationEnum +sign: bytes + + -50->59 - - +51->59 + + 60 - -<<Struct>> -RequestOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: RequestOrder -operation: OrderOperationEnum -sign: bytes - - + +<<Struct>> +WorkerpoolOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: WorkerpoolOrder +operation: OrderOperationEnum +sign: bytes + + -50->60 - - +51->60 + + - - -51 - -<<Enum>> -OrderOperationEnum -contracts/libs/IexecLibOrders_v5.sol - -SIGN: 0 -CLOSE: 1 - - - -51->50 - - + + +61 + +<<Struct>> +RequestOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: RequestOrder +operation: OrderOperationEnum +sign: bytes + + + +51->61 + + - + + +52 + +<<Enum>> +OrderOperationEnum +contracts/libs/IexecLibOrders_v5.sol + +SIGN: 0 +CLOSE: 1 + + -52->50 - - +52->51 + + - + -53->50 - - +53->51 + + - + -54->50 - - +54->51 + + - + -55->50 - - +55->51 + + - + -56->50 - - - - - -57->50 - - +56->51 + + - + 57->51 - - - - - -57->53 - - - - - -58->50 - - + + - + 58->51 - - + + - + -58->54 - - +58->52 + + - - -59->50 - - + + +58->54 + + - + 59->51 - - + + - + -59->55 - - +59->52 + + - - -60->50 - - + + +59->55 + + - + 60->51 - - + + - + -60->56 - - - - - -61->62 - - +60->52 + + - - -62->24 - - + + +60->56 + + - - -62->36 - - + + +61->51 + + - + -62->61 - - +61->52 + + - - -64 - -<<Interface>> -IRegistry -contracts/registries/IRegistry.sol - -External: -     isRegistered(_entry: address): bool - - + + +61->57 + + + + -62->64 - - +62->63 + + - + -63->61 - - +63->24 + + + + + +63->37 + + - + 63->62 - - + + + + + +65 + +<<Interface>> +IRegistry +contracts/registries/IRegistry.sol + +External: +     isRegistered(_entry: address): bool + + + +63->65 + + + + + +64->62 + + + + + +64->63 + + diff --git a/docs/uml/class-uml-IexecPocoFacets.svg b/docs/uml/class-uml-IexecPocoFacets.svg index bca055427..5c0d73943 100644 --- a/docs/uml/class-uml-IexecPocoFacets.svg +++ b/docs/uml/class-uml-IexecPocoFacets.svg @@ -4,1086 +4,1103 @@ - + UmlClassDiagram - + 3 - -<<Abstract>> -FacetBase -contracts/abstract/FacetBase.sol - -Internal: -   CONTRIBUTION_DEADLINE_RATIO: uint256 -   REVEAL_DEADLINE_RATIO: uint256 -   FINAL_DEADLINE_RATIO: uint256 -   WORKERPOOL_STAKE_RATIO: uint256 -   KITTY_RATIO: uint256 -   KITTY_MIN: uint256 -   KITTY_ADDRESS: address -   GROUPMEMBER_PURPOSE: uint256 - -Internal: -    owner(): address -    _msgSender(): address -Public: -    <<modifier>> onlyOwner() + +<<Abstract>> +FacetBase +contracts/abstract/FacetBase.sol + +Internal: +    owner(): address +    _msgSender(): address +Public: +    <<modifier>> onlyOwner() 10 - -<<Struct>> -Matching -contracts/facets/IexecPoco1Facet.sol - -apporderHash: bytes32 -appOwner: address -datasetorderHash: bytes32 -datasetOwner: address -workerpoolorderHash: bytes32 -workerpoolOwner: address -requestorderHash: bytes32 -hasDataset: bool + +<<Struct>> +Matching +contracts/facets/IexecPoco1Facet.sol + +apporderHash: bytes32 +appOwner: address +datasetorderHash: bytes32 +datasetOwner: address +workerpoolorderHash: bytes32 +workerpoolOwner: address +requestorderHash: bytes32 +hasDataset: bool 11 - -IexecPoco1Facet -contracts/facets/IexecPoco1Facet.sol - -Private: -    _matchOrders(_apporder: IexecLibOrders_v5.AppOrder, _datasetorder: IexecLibOrders_v5.DatasetOrder, _workerpoolorder: IexecLibOrders_v5.WorkerpoolOrder, _requestorder: IexecLibOrders_v5.RequestOrder, _sponsor: address): bytes32 -    _ignoreTeeFramework(tag: bytes32): bytes32 -External: -    verifySignature(_identity: address, _hash: bytes32, _signature: bytes): bool -    verifyPresignature(_identity: address, _hash: bytes32): bool -    verifyPresignatureOrSignature(_identity: address, _hash: bytes32, _signature: bytes): bool -    assertDatasetDealCompatibility(datasetOrder: IexecLibOrders_v5.DatasetOrder, dealId: bytes32) -    matchOrders(_apporder: IexecLibOrders_v5.AppOrder, _datasetorder: IexecLibOrders_v5.DatasetOrder, _workerpoolorder: IexecLibOrders_v5.WorkerpoolOrder, _requestorder: IexecLibOrders_v5.RequestOrder): bytes32 -    sponsorMatchOrders(_apporder: IexecLibOrders_v5.AppOrder, _datasetorder: IexecLibOrders_v5.DatasetOrder, _workerpoolorder: IexecLibOrders_v5.WorkerpoolOrder, _requestorder: IexecLibOrders_v5.RequestOrder): bytes32 + +IexecPoco1Facet +contracts/facets/IexecPoco1Facet.sol + +Private: +    _matchOrders(_apporder: IexecLibOrders_v5.AppOrder, _datasetorder: IexecLibOrders_v5.DatasetOrder, _workerpoolorder: IexecLibOrders_v5.WorkerpoolOrder, _requestorder: IexecLibOrders_v5.RequestOrder, _sponsor: address): bytes32 +    _ignoreTeeFramework(tag: bytes32): bytes32 +External: +    verifySignature(_identity: address, _hash: bytes32, _signature: bytes): bool +    verifyPresignature(_identity: address, _hash: bytes32): bool +    verifyPresignatureOrSignature(_identity: address, _hash: bytes32, _signature: bytes): bool +    assertDatasetDealCompatibility(datasetOrder: IexecLibOrders_v5.DatasetOrder, dealId: bytes32) +    matchOrders(_apporder: IexecLibOrders_v5.AppOrder, _datasetorder: IexecLibOrders_v5.DatasetOrder, _workerpoolorder: IexecLibOrders_v5.WorkerpoolOrder, _requestorder: IexecLibOrders_v5.RequestOrder): bytes32 +    sponsorMatchOrders(_apporder: IexecLibOrders_v5.AppOrder, _datasetorder: IexecLibOrders_v5.DatasetOrder, _workerpoolorder: IexecLibOrders_v5.WorkerpoolOrder, _requestorder: IexecLibOrders_v5.RequestOrder): bytes32 11->3 - - + + 11->10 - - + + 26 - -<<Interface>> -IexecPoco1 -contracts/interfaces/IexecPoco1.sol - -External: -     verifySignature(address, bytes32, bytes): bool -     verifyPresignature(address, bytes32): bool -     verifyPresignatureOrSignature(address, bytes32, bytes): bool -     assertDatasetDealCompatibility(datasetOrder: IexecLibOrders_v5.DatasetOrder, dealId: bytes32) -     matchOrders(IexecLibOrders_v5.AppOrder, IexecLibOrders_v5.DatasetOrder, IexecLibOrders_v5.WorkerpoolOrder, IexecLibOrders_v5.RequestOrder): bytes32 -     sponsorMatchOrders(IexecLibOrders_v5.AppOrder, IexecLibOrders_v5.DatasetOrder, IexecLibOrders_v5.WorkerpoolOrder, IexecLibOrders_v5.RequestOrder): bytes32 -Public: -    <<event>> SchedulerNotice(workerpool: address, dealid: bytes32) -    <<event>> OrdersMatched(dealid: bytes32, appHash: bytes32, datasetHash: bytes32, workerpoolHash: bytes32, requestHash: bytes32, volume: uint256) -    <<event>> DealSponsored(dealId: bytes32, sponsor: address) + +<<Interface>> +IexecPoco1 +contracts/interfaces/IexecPoco1.sol + +External: +     verifySignature(address, bytes32, bytes): bool +     verifyPresignature(address, bytes32): bool +     verifyPresignatureOrSignature(address, bytes32, bytes): bool +     assertDatasetDealCompatibility(datasetOrder: IexecLibOrders_v5.DatasetOrder, dealId: bytes32) +     matchOrders(IexecLibOrders_v5.AppOrder, IexecLibOrders_v5.DatasetOrder, IexecLibOrders_v5.WorkerpoolOrder, IexecLibOrders_v5.RequestOrder): bytes32 +     sponsorMatchOrders(IexecLibOrders_v5.AppOrder, IexecLibOrders_v5.DatasetOrder, IexecLibOrders_v5.WorkerpoolOrder, IexecLibOrders_v5.RequestOrder): bytes32 +Public: +    <<event>> SchedulerNotice(workerpool: address, dealid: bytes32) +    <<event>> OrdersMatched(dealid: bytes32, appHash: bytes32, datasetHash: bytes32, workerpoolHash: bytes32, requestHash: bytes32, volume: uint256) +    <<event>> DealSponsored(dealId: bytes32, sponsor: address) 11->26 - - + + 27 - -<<Interface>> -IexecPoco1Errors -contracts/interfaces/IexecPoco1Errors.sol + +<<Interface>> +IexecPoco1Errors +contracts/interfaces/IexecPoco1Errors.sol 11->27 - - + + 34 - -<<Library>> -CommonLib -contracts/libs/CommonLib.sol - -Private: -   GROUPMEMBER_PURPOSE: uint256 - -Internal: -    toTypedDataHash(structHash: bytes32): bytes32 -    verifySignatureOfEthSignedMessage(account: address, message: bytes, signature: bytes): bool -    verifySignature(account: address, messageHash: bytes32, signature: bytes): bool -    verifyPresignature(account: address, messageHash: bytes32): bool -    verifySignatureOrPresignature(account: address, messageHash: bytes32, signature: bytes): bool -    isAccountAuthorizedByRestriction(restriction: address, account: address): bool -    computeDealVolume(appOrderVolume: uint256, appOrderTypedDataHash: bytes32, hasDataset: bool, datasetOrderVolume: uint256, datasetOrderTypedDataHash: bytes32, workerpoolOrderVolume: uint256, workerpoolOrderTypedDataHash: bytes32, requestOrderVolume: uint256, requestOrderTypedDataHash: bytes32): uint256 + +<<Library>> +CommonLib +contracts/libs/CommonLib.sol + +Internal: +    toTypedDataHash(structHash: bytes32): bytes32 +    verifySignatureOfEthSignedMessage(account: address, message: bytes, signature: bytes): bool +    verifySignature(account: address, messageHash: bytes32, signature: bytes): bool +    verifyPresignature(account: address, messageHash: bytes32): bool +    verifySignatureOrPresignature(account: address, messageHash: bytes32, signature: bytes): bool +    isAccountAuthorizedByRestriction(restriction: address, account: address): bool +    computeDealVolume(appOrderVolume: uint256, appOrderTypedDataHash: bytes32, hasDataset: bool, datasetOrderVolume: uint256, datasetOrderTypedDataHash: bytes32, workerpoolOrderVolume: uint256, workerpoolOrderTypedDataHash: bytes32, requestOrderVolume: uint256, requestOrderTypedDataHash: bytes32): uint256 11->34 - - + + 35 - -<<Library>> -EscrowLib -contracts/libs/EscrowLib.sol - -Internal: -    lock(account: address, value: uint256) -    unlock(account: address, value: uint256) -    reward(account: address, value: uint256, ref: bytes32) -    seize(account: address, value: uint256, ref: bytes32) -    rewardAndLock(account: address, value: uint256, ref: bytes32) -Public: -    <<event>> Reward(owner: address, amount: uint256, ref: bytes32) -    <<event>> Seize(owner: address, amount: uint256, ref: bytes32) -    <<event>> Lock(owner: address, amount: uint256) -    <<event>> Unlock(owner: address, amount: uint256) + +<<Library>> +Constants +contracts/libs/Constants.sol + +Internal: +   CONTRIBUTION_DEADLINE_RATIO: uint256 +   REVEAL_DEADLINE_RATIO: uint256 +   FINAL_DEADLINE_RATIO: uint256 +   WORKERPOOL_STAKE_RATIO: uint256 +   KITTY_RATIO: uint256 +   KITTY_MIN: uint256 +   KITTY_ADDRESS: address +   GROUPMEMBER_PURPOSE: uint256 - + 11->35 - - + + 36 - -<<Library>> -IexecLibCore_v5 -contracts/libs/IexecLibCore_v5.sol + +<<Library>> +EscrowLib +contracts/libs/EscrowLib.sol + +Internal: +    lock(account: address, value: uint256) +    unlock(account: address, value: uint256) +    reward(account: address, value: uint256, ref: bytes32) +    seize(account: address, value: uint256, ref: bytes32) +    rewardAndLock(account: address, value: uint256, ref: bytes32) +Public: +    <<event>> Reward(owner: address, amount: uint256, ref: bytes32) +    <<event>> Seize(owner: address, amount: uint256, ref: bytes32) +    <<event>> Lock(owner: address, amount: uint256) +    <<event>> Unlock(owner: address, amount: uint256) - + 11->36 - - + + - - -43 - -<<Struct>> -Deal -contracts/libs/IexecLibCore_v5.sol - -app: Resource -dataset: Resource -workerpool: Resource -trust: uint256 -category: uint256 -tag: bytes32 -requester: address -beneficiary: address -callback: address -params: string -startTime: uint256 -botFirst: uint256 -botSize: uint256 -workerStake: uint256 -schedulerRewardRatio: uint256 -sponsor: address - - + + +37 + +<<Library>> +IexecLibCore_v5 +contracts/libs/IexecLibCore_v5.sol + + + +11->37 + + + + + +44 + +<<Struct>> +Deal +contracts/libs/IexecLibCore_v5.sol + +app: Resource +dataset: Resource +workerpool: Resource +trust: uint256 +category: uint256 +tag: bytes32 +requester: address +beneficiary: address +callback: address +params: string +startTime: uint256 +botFirst: uint256 +botSize: uint256 +workerStake: uint256 +schedulerRewardRatio: uint256 +sponsor: address + + -11->43 - - +11->44 + + - - -50 - -<<Library>> -IexecLibOrders_v5 -contracts/libs/IexecLibOrders_v5.sol - -Public: -   EIP712DOMAIN_TYPEHASH: bytes32 -   APPORDER_TYPEHASH: bytes32 -   DATASETORDER_TYPEHASH: bytes32 -   WORKERPOOLORDER_TYPEHASH: bytes32 -   REQUESTORDER_TYPEHASH: bytes32 -   APPORDEROPERATION_TYPEHASH: bytes32 -   DATASETORDEROPERATION_TYPEHASH: bytes32 -   WORKERPOOLORDEROPERATION_TYPEHASH: bytes32 -   REQUESTORDEROPERATION_TYPEHASH: bytes32 - -Public: -    hash(_domain: EIP712Domain): (domainhash: bytes32) -    hash(_apporder: AppOrder): (apphash: bytes32) -    hash(_datasetorder: DatasetOrder): (datasethash: bytes32) -    hash(_workerpoolorder: WorkerpoolOrder): (workerpoolhash: bytes32) -    hash(_requestorder: RequestOrder): (requesthash: bytes32) -    hash(_apporderoperation: AppOrderOperation): bytes32 -    hash(_datasetorderoperation: DatasetOrderOperation): bytes32 -    hash(_workerpoolorderoperation: WorkerpoolOrderOperation): bytes32 -    hash(_requestorderoperation: RequestOrderOperation): bytes32 - - + + +51 + +<<Library>> +IexecLibOrders_v5 +contracts/libs/IexecLibOrders_v5.sol + +Public: +   EIP712DOMAIN_TYPEHASH: bytes32 +   APPORDER_TYPEHASH: bytes32 +   DATASETORDER_TYPEHASH: bytes32 +   WORKERPOOLORDER_TYPEHASH: bytes32 +   REQUESTORDER_TYPEHASH: bytes32 +   APPORDEROPERATION_TYPEHASH: bytes32 +   DATASETORDEROPERATION_TYPEHASH: bytes32 +   WORKERPOOLORDEROPERATION_TYPEHASH: bytes32 +   REQUESTORDEROPERATION_TYPEHASH: bytes32 + +Public: +    hash(_domain: EIP712Domain): (domainhash: bytes32) +    hash(_apporder: AppOrder): (apphash: bytes32) +    hash(_datasetorder: DatasetOrder): (datasethash: bytes32) +    hash(_workerpoolorder: WorkerpoolOrder): (workerpoolhash: bytes32) +    hash(_requestorder: RequestOrder): (requesthash: bytes32) +    hash(_apporderoperation: AppOrderOperation): bytes32 +    hash(_datasetorderoperation: DatasetOrderOperation): bytes32 +    hash(_workerpoolorderoperation: WorkerpoolOrderOperation): bytes32 +    hash(_requestorderoperation: RequestOrderOperation): bytes32 + + -11->50 - - - - - -53 - -<<Struct>> -AppOrder -contracts/libs/IexecLibOrders_v5.sol - -app: address -appprice: uint256 -volume: uint256 -tag: bytes32 -datasetrestrict: address -workerpoolrestrict: address -requesterrestrict: address -salt: bytes32 -sign: bytes - - - -11->53 - - +11->51 + + 54 - -<<Struct>> -DatasetOrder -contracts/libs/IexecLibOrders_v5.sol - -dataset: address -datasetprice: uint256 -volume: uint256 -tag: bytes32 -apprestrict: address -workerpoolrestrict: address -requesterrestrict: address -salt: bytes32 -sign: bytes + +<<Struct>> +AppOrder +contracts/libs/IexecLibOrders_v5.sol + +app: address +appprice: uint256 +volume: uint256 +tag: bytes32 +datasetrestrict: address +workerpoolrestrict: address +requesterrestrict: address +salt: bytes32 +sign: bytes - + 11->54 - - + + 55 - -<<Struct>> -WorkerpoolOrder -contracts/libs/IexecLibOrders_v5.sol - -workerpool: address -workerpoolprice: uint256 -volume: uint256 -tag: bytes32 -category: uint256 -trust: uint256 -apprestrict: address -datasetrestrict: address -requesterrestrict: address -salt: bytes32 -sign: bytes + +<<Struct>> +DatasetOrder +contracts/libs/IexecLibOrders_v5.sol + +dataset: address +datasetprice: uint256 +volume: uint256 +tag: bytes32 +apprestrict: address +workerpoolrestrict: address +requesterrestrict: address +salt: bytes32 +sign: bytes - + 11->55 - - + + 56 - -<<Struct>> -RequestOrder -contracts/libs/IexecLibOrders_v5.sol - -app: address -appmaxprice: uint256 -dataset: address -datasetmaxprice: uint256 -workerpool: address -workerpoolmaxprice: uint256 -requester: address -volume: uint256 -tag: bytes32 -category: uint256 -trust: uint256 -beneficiary: address -callback: address -params: string -salt: bytes32 -sign: bytes + +<<Struct>> +WorkerpoolOrder +contracts/libs/IexecLibOrders_v5.sol + +workerpool: address +workerpoolprice: uint256 +volume: uint256 +tag: bytes32 +category: uint256 +trust: uint256 +apprestrict: address +datasetrestrict: address +requesterrestrict: address +salt: bytes32 +sign: bytes - + 11->56 - - + + - - -61 - -<<Library>> -PocoStorageLib -contracts/libs/PocoStorageLib.sol - -Private: -   POCO_STORAGE_LOCATION: bytes32 - -Internal: -    getPocoStorage(): ($: PocoStorage) - - - -11->61 - - + + +57 + +<<Struct>> +RequestOrder +contracts/libs/IexecLibOrders_v5.sol + +app: address +appmaxprice: uint256 +dataset: address +datasetmaxprice: uint256 +workerpool: address +workerpoolmaxprice: uint256 +requester: address +volume: uint256 +tag: bytes32 +category: uint256 +trust: uint256 +beneficiary: address +callback: address +params: string +salt: bytes32 +sign: bytes + + + +11->57 + + 62 - -<<Struct>> -PocoStorage -contracts/libs/PocoStorageLib.sol - -m_appregistry: IRegistry -m_datasetregistry: IRegistry -m_workerpoolregistry: IRegistry -m_baseToken: IERC20 -m_name: string -m_symbol: string -m_decimals: uint8 -m_totalSupply: uint256 -m_balances: mapping(address=>uint256) -m_frozens: mapping(address=>uint256) -m_allowances: mapping(address=>mapping(address=>uint256)) -m_eip712DomainSeparator: bytes32 -m_presigned: mapping(bytes32=>address) -m_consumed: mapping(bytes32=>uint256) -m_deals: mapping(bytes32=>IexecLibCore_v5.Deal) -m_tasks: mapping(bytes32=>IexecLibCore_v5.Task) -m_consensus: mapping(bytes32=>IexecLibCore_v5.Consensus) -m_contributions: mapping(bytes32=>mapping(address=>IexecLibCore_v5.Contribution)) -m_workerScores: mapping(address=>uint256) -m_teebroker: address -m_callbackgas: uint256 -m_categories: IexecLibCore_v5.Category[] -m_v3_iexecHub: IexecHubV3Interface -m_v3_scoreImported: mapping(address=>bool) -m_dealsBoost: mapping(bytes32=>IexecLibCore_v5.DealBoost) + +<<Library>> +PocoStorageLib +contracts/libs/PocoStorageLib.sol + +Private: +   POCO_STORAGE_LOCATION: bytes32 + +Internal: +    getPocoStorage(): ($: PocoStorage) - + 11->62 - - + + - - -79 - -<<Interface>> -IWorkerpool -contracts/registries/workerpools/IWorkerpool.v8.sol - -External: -     owner(): address -     m_workerpoolDescription(): string -     m_schedulerRewardRatioPolicy(): uint256 -     m_workerStakeRatioPolicy(): uint256 - - + + +63 + +<<Struct>> +PocoStorage +contracts/libs/PocoStorageLib.sol + +m_appregistry: IRegistry +m_datasetregistry: IRegistry +m_workerpoolregistry: IRegistry +m_baseToken: IERC20 +m_name: string +m_symbol: string +m_decimals: uint8 +m_totalSupply: uint256 +m_balances: mapping(address=>uint256) +m_frozens: mapping(address=>uint256) +m_allowances: mapping(address=>mapping(address=>uint256)) +m_eip712DomainSeparator: bytes32 +m_presigned: mapping(bytes32=>address) +m_consumed: mapping(bytes32=>uint256) +m_deals: mapping(bytes32=>IexecLibCore_v5.Deal) +m_tasks: mapping(bytes32=>IexecLibCore_v5.Task) +m_consensus: mapping(bytes32=>IexecLibCore_v5.Consensus) +m_contributions: mapping(bytes32=>mapping(address=>IexecLibCore_v5.Contribution)) +m_workerScores: mapping(address=>uint256) +m_teebroker: address +m_callbackgas: uint256 +m_categories: IexecLibCore_v5.Category[] +m_v3_iexecHub: IexecHubV3Interface +m_v3_scoreImported: mapping(address=>bool) +m_dealsBoost: mapping(bytes32=>IexecLibCore_v5.DealBoost) + + + +11->63 + + + + + +80 + +<<Interface>> +IWorkerpool +contracts/registries/workerpools/IWorkerpool.v8.sol + +External: +     owner(): address +     m_workerpoolDescription(): string +     m_schedulerRewardRatioPolicy(): uint256 +     m_workerStakeRatioPolicy(): uint256 + + -11->79 - - +11->80 + + 12 - -IexecPoco2Facet -contracts/facets/IexecPoco2Facet.sol - -Internal: -    successWork(_dealid: bytes32, _taskid: bytes32) -    failedWork(_dealid: bytes32, _taskid: bytes32) -    checkConsensus(_taskid: bytes32, _consensus: bytes32) -    distributeRewards(_taskid: bytes32) -    distributeRewardsFast(_taskid: bytes32) -    executeCallback(_taskid: bytes32, _resultsCallback: bytes) -External: -    contribute(_taskid: bytes32, _resultHash: bytes32, _resultSeal: bytes32, _enclaveChallenge: address, _enclaveSign: bytes, _authorizationSign: bytes) -    contributeAndFinalize(_taskid: bytes32, _resultDigest: bytes32, _results: bytes, _resultsCallback: bytes, _enclaveChallenge: address, _enclaveSign: bytes, _authorizationSign: bytes) -    reveal(_taskid: bytes32, _resultDigest: bytes32) -    reopen(_taskid: bytes32) <<onlyScheduler>> -    finalize(_taskid: bytes32, _results: bytes, _resultsCallback: bytes) <<onlyScheduler>> -    initializeArray(_dealid: bytes32[], _idx: uint256[]): bool -    claimArray(_taskid: bytes32[]): bool -    initializeAndClaimArray(_dealid: bytes32[], _idx: uint256[]): bool -Public: -    <<modifier>> onlyScheduler(_taskId: bytes32) -    initialize(_dealid: bytes32, idx: uint256): bytes32 -    claim(_taskid: bytes32) + +IexecPoco2Facet +contracts/facets/IexecPoco2Facet.sol + +Internal: +    successWork(_dealid: bytes32, _taskid: bytes32) +    failedWork(_dealid: bytes32, _taskid: bytes32) +    checkConsensus(_taskid: bytes32, _consensus: bytes32) +    distributeRewards(_taskid: bytes32) +    distributeRewardsFast(_taskid: bytes32) +    executeCallback(_taskid: bytes32, _resultsCallback: bytes) +External: +    contribute(_taskid: bytes32, _resultHash: bytes32, _resultSeal: bytes32, _enclaveChallenge: address, _enclaveSign: bytes, _authorizationSign: bytes) +    contributeAndFinalize(_taskid: bytes32, _resultDigest: bytes32, _results: bytes, _resultsCallback: bytes, _enclaveChallenge: address, _enclaveSign: bytes, _authorizationSign: bytes) +    reveal(_taskid: bytes32, _resultDigest: bytes32) +    reopen(_taskid: bytes32) <<onlyScheduler>> +    finalize(_taskid: bytes32, _results: bytes, _resultsCallback: bytes) <<onlyScheduler>> +    initializeArray(_dealid: bytes32[], _idx: uint256[]): bool +    claimArray(_taskid: bytes32[]): bool +    initializeAndClaimArray(_dealid: bytes32[], _idx: uint256[]): bool +Public: +    <<modifier>> onlyScheduler(_taskId: bytes32) +    initialize(_dealid: bytes32, idx: uint256): bytes32 +    claim(_taskid: bytes32) - + 12->3 - - + + 28 - -<<Interface>> -IexecPoco2 -contracts/interfaces/IexecPoco2.sol - -External: -     initialize(dealId: bytes32, index: uint256): bytes32 -     claim(taskId: bytes32) -     contribute(taskId: bytes32, resultHash: bytes32, resultSeal: bytes32, enclaveChallenge: address, enclaveSign: bytes, authorizationSign: bytes) -     contributeAndFinalize(taskId: bytes32, resultDigest: bytes32, results: bytes, resultsCallback: bytes, enclaveChallenge: address, enclaveSign: bytes, authorizationSign: bytes) -     reveal(taskId: bytes32, resultDigest: bytes32) -     reopen(taskId: bytes32) -     finalize(taskId: bytes32, results: bytes, resultsCallback: bytes) -     initializeArray(dealIds: bytes32[], indexes: uint256[]): bool -     claimArray(taskIds: bytes32[]): bool -     initializeAndClaimArray(dealIds: bytes32[], indexes: uint256[]): bool -Public: -    <<event>> AccurateContribution(worker: address, taskid: bytes32) -    <<event>> FaultyContribution(worker: address, taskid: bytes32) -    <<event>> TaskInitialize(taskid: bytes32, workerpool: address) -    <<event>> TaskContribute(taskid: bytes32, worker: address, hash: bytes32) -    <<event>> TaskConsensus(taskid: bytes32, consensus: bytes32) -    <<event>> TaskReveal(taskid: bytes32, worker: address, digest: bytes32) -    <<event>> TaskReopen(taskid: bytes32) -    <<event>> TaskFinalize(taskid: bytes32, results: bytes) -    <<event>> TaskClaimed(taskid: bytes32) + +<<Interface>> +IexecPoco2 +contracts/interfaces/IexecPoco2.sol + +External: +     initialize(dealId: bytes32, index: uint256): bytes32 +     claim(taskId: bytes32) +     contribute(taskId: bytes32, resultHash: bytes32, resultSeal: bytes32, enclaveChallenge: address, enclaveSign: bytes, authorizationSign: bytes) +     contributeAndFinalize(taskId: bytes32, resultDigest: bytes32, results: bytes, resultsCallback: bytes, enclaveChallenge: address, enclaveSign: bytes, authorizationSign: bytes) +     reveal(taskId: bytes32, resultDigest: bytes32) +     reopen(taskId: bytes32) +     finalize(taskId: bytes32, results: bytes, resultsCallback: bytes) +     initializeArray(dealIds: bytes32[], indexes: uint256[]): bool +     claimArray(taskIds: bytes32[]): bool +     initializeAndClaimArray(dealIds: bytes32[], indexes: uint256[]): bool +Public: +    <<event>> AccurateContribution(worker: address, taskid: bytes32) +    <<event>> FaultyContribution(worker: address, taskid: bytes32) +    <<event>> TaskInitialize(taskid: bytes32, workerpool: address) +    <<event>> TaskContribute(taskid: bytes32, worker: address, hash: bytes32) +    <<event>> TaskConsensus(taskid: bytes32, consensus: bytes32) +    <<event>> TaskReveal(taskid: bytes32, worker: address, digest: bytes32) +    <<event>> TaskReopen(taskid: bytes32) +    <<event>> TaskFinalize(taskid: bytes32, results: bytes) +    <<event>> TaskClaimed(taskid: bytes32) - + 12->28 - - + + - + 12->34 - - + + - + 12->35 - - + + - + 12->36 - - + + - + -12->43 - - +12->37 + + - - -46 - -<<Struct>> -Task -contracts/libs/IexecLibCore_v5.sol - -status: TaskStatusEnum -dealid: bytes32 -idx: uint256 -timeref: uint256 -contributionDeadline: uint256 -revealDeadline: uint256 -finalDeadline: uint256 -consensusValue: bytes32 -revealCounter: uint256 -winnerCounter: uint256 -contributors: address[] -resultDigest: bytes32 -results: bytes -resultsTimestamp: uint256 -resultsCallback: bytes - - - -12->46 - - + + +12->44 + + 47 - -<<Struct>> -Consensus -contracts/libs/IexecLibCore_v5.sol - -group: mapping(bytes32=>uint256) -total: uint256 + +<<Struct>> +Task +contracts/libs/IexecLibCore_v5.sol + +status: TaskStatusEnum +dealid: bytes32 +idx: uint256 +timeref: uint256 +contributionDeadline: uint256 +revealDeadline: uint256 +finalDeadline: uint256 +consensusValue: bytes32 +revealCounter: uint256 +winnerCounter: uint256 +contributors: address[] +resultDigest: bytes32 +results: bytes +resultsTimestamp: uint256 +resultsCallback: bytes - + 12->47 - - + + - - -49 - -<<Struct>> -Contribution -contracts/libs/IexecLibCore_v5.sol - -status: ContributionStatusEnum -resultHash: bytes32 -resultSeal: bytes32 -enclaveChallenge: address -weight: uint256 - - - -12->49 - - + + +48 + +<<Struct>> +Consensus +contracts/libs/IexecLibCore_v5.sol + +group: mapping(bytes32=>uint256) +total: uint256 + + + +12->48 + + - - -12->61 - - + + +50 + +<<Struct>> +Contribution +contracts/libs/IexecLibCore_v5.sol + +status: ContributionStatusEnum +resultHash: bytes32 +resultSeal: bytes32 +enclaveChallenge: address +weight: uint256 + + + +12->50 + + 12->62 - - + + + + + +12->63 + + 24 - -<<Interface>> -IexecHubV3Interface -contracts/interfaces/IexecHubV3Interface.sol - -External: -     viewScore(worker: address): uint256 - - - -26->50 - - - - + +<<Interface>> +IexecHubV3Interface +contracts/interfaces/IexecHubV3Interface.sol + +External: +     viewScore(worker: address): uint256 + + -26->53 - - +26->51 + + - + 26->54 - - + + 26->55 - - + + - -26->56 - - - - -34->61 - - +26->56 + + - + -34->62 - - +26->57 + + - + -35->61 - - +34->62 + + - + -35->62 - - +34->63 + + - - -63 - -<<Library>> -StakedRlcLib -contracts/libs/StakedRlcLib.sol - -Internal: -    transfer(from: address, to: address, value: uint256) -    mint(account: address, amount: uint256) -    burn(account: address, amount: uint256) -    approve(owner: address, spender: address, amount: uint256) -Public: -    <<event>> Transfer(from: address, to: address, value: uint256) -    <<event>> Approval(owner: address, spender: address, value: uint256) - - + -35->63 - - - - - -42 - -<<Struct>> -Resource -contracts/libs/IexecLibCore_v5.sol - -pointer: address -owner: address -price: uint256 - - - -42->36 - - +36->62 + + - - -43->36 - - - - - -43->42 - - - - - -45 - -<<Enum>> -TaskStatusEnum -contracts/libs/IexecLibCore_v5.sol - -UNSET: 0 -ACTIVE: 1 -REVEALING: 2 -COMPLETED: 3 -FAILED: 4 - - + -45->36 - - +36->63 + + - - -46->36 - - + + +64 + +<<Library>> +StakedRlcLib +contracts/libs/StakedRlcLib.sol + +Internal: +    transfer(from: address, to: address, value: uint256) +    mint(account: address, amount: uint256) +    burn(account: address, amount: uint256) +    approve(owner: address, spender: address, amount: uint256) +Public: +    <<event>> Transfer(from: address, to: address, value: uint256) +    <<event>> Approval(owner: address, spender: address, value: uint256) + + + +36->64 + + - - -46->45 - - + + +43 + +<<Struct>> +Resource +contracts/libs/IexecLibCore_v5.sol + +pointer: address +owner: address +price: uint256 + + + +43->37 + + - + -47->36 - - +44->37 + + - - -48 - -<<Enum>> -ContributionStatusEnum -contracts/libs/IexecLibCore_v5.sol - -UNSET: 0 -CONTRIBUTED: 1 -PROVED: 2 -REJECTED: 3 - - - -48->36 - - + + +44->43 + + + + + +46 + +<<Enum>> +TaskStatusEnum +contracts/libs/IexecLibCore_v5.sol + +UNSET: 0 +ACTIVE: 1 +REVEALING: 2 +COMPLETED: 3 +FAILED: 4 + + + +46->37 + + - + -49->36 - - +47->37 + + - - -49->48 - - + + +47->46 + + - - -52 - -<<Struct>> -EIP712Domain -contracts/libs/IexecLibOrders_v5.sol - -name: string -version: string -chainId: uint256 -verifyingContract: address - - - -50->52 - - + + +48->37 + + - - -50->53 - - + + +49 + +<<Enum>> +ContributionStatusEnum +contracts/libs/IexecLibCore_v5.sol + +UNSET: 0 +CONTRIBUTED: 1 +PROVED: 2 +REJECTED: 3 + + + +49->37 + + - + + +50->37 + + + + + +50->49 + + + + + +53 + +<<Struct>> +EIP712Domain +contracts/libs/IexecLibOrders_v5.sol + +name: string +version: string +chainId: uint256 +verifyingContract: address + + -50->54 - - +51->53 + + - + -50->55 - - +51->54 + + - + -50->56 - - +51->55 + + - - -57 - -<<Struct>> -AppOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: AppOrder -operation: OrderOperationEnum -sign: bytes - - + -50->57 - - +51->56 + + + + + +51->57 + + 58 - -<<Struct>> -DatasetOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: DatasetOrder -operation: OrderOperationEnum -sign: bytes - - - -50->58 - - + +<<Struct>> +AppOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: AppOrder +operation: OrderOperationEnum +sign: bytes + + + +51->58 + + 59 - -<<Struct>> -WorkerpoolOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: WorkerpoolOrder -operation: OrderOperationEnum -sign: bytes - - - -50->59 - - + +<<Struct>> +DatasetOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: DatasetOrder +operation: OrderOperationEnum +sign: bytes + + + +51->59 + + 60 - -<<Struct>> -RequestOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: RequestOrder -operation: OrderOperationEnum -sign: bytes - - - -50->60 - - - - - -51 - -<<Enum>> -OrderOperationEnum -contracts/libs/IexecLibOrders_v5.sol - -SIGN: 0 -CLOSE: 1 - - - -51->50 - - + +<<Struct>> +WorkerpoolOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: WorkerpoolOrder +operation: OrderOperationEnum +sign: bytes + + + +51->60 + + - - -52->50 - - + + +61 + +<<Struct>> +RequestOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: RequestOrder +operation: OrderOperationEnum +sign: bytes + + + +51->61 + + - + + +52 + +<<Enum>> +OrderOperationEnum +contracts/libs/IexecLibOrders_v5.sol + +SIGN: 0 +CLOSE: 1 + + -53->50 - - +52->51 + + - + -54->50 - - +53->51 + + - + -55->50 - - +54->51 + + - + -56->50 - - +55->51 + + - + -57->50 - - +56->51 + + - -57->51 - - - - - -57->53 - - - - -58->50 - - +57->51 + + - + 58->51 - - + + + + + +58->52 + + 58->54 - - - - - -59->50 - - + + - + 59->51 - - + + + + + +59->52 + + 59->55 - - - - - -60->50 - - + + - + 60->51 - - + + + + + +60->52 + + 60->56 - - + + + + + +61->51 + + - + -61->62 - - +61->52 + + - - -62->24 - - + + +61->57 + + - + -62->36 - - +62->63 + + - - -62->61 - - - - - -64 - -<<Interface>> -IRegistry -contracts/registries/IRegistry.sol - -External: -     isRegistered(_entry: address): bool - - - -62->64 - - + + +63->24 + + - + -63->61 - - +63->37 + + - + 63->62 - - + + + + + +65 + +<<Interface>> +IRegistry +contracts/registries/IRegistry.sol + +External: +     isRegistered(_entry: address): bool + + + +63->65 + + + + + +64->62 + + + + + +64->63 + + diff --git a/docs/uml/class-uml-dir-libs.svg b/docs/uml/class-uml-dir-libs.svg index 7215ddc1d..7e5b7b9da 100644 --- a/docs/uml/class-uml-dir-libs.svg +++ b/docs/uml/class-uml-dir-libs.svg @@ -4,824 +4,839 @@ - - + + UmlClassDiagram - + 0 - -<<Library>> -CommonLib -contracts/libs/CommonLib.sol - -Private: -   GROUPMEMBER_PURPOSE: uint256 - -Internal: -    toTypedDataHash(structHash: bytes32): bytes32 -    verifySignatureOfEthSignedMessage(account: address, message: bytes, signature: bytes): bool -    verifySignature(account: address, messageHash: bytes32, signature: bytes): bool -    verifyPresignature(account: address, messageHash: bytes32): bool -    verifySignatureOrPresignature(account: address, messageHash: bytes32, signature: bytes): bool -    isAccountAuthorizedByRestriction(restriction: address, account: address): bool -    computeDealVolume(appOrderVolume: uint256, appOrderTypedDataHash: bytes32, hasDataset: bool, datasetOrderVolume: uint256, datasetOrderTypedDataHash: bytes32, workerpoolOrderVolume: uint256, workerpoolOrderTypedDataHash: bytes32, requestOrderVolume: uint256, requestOrderTypedDataHash: bytes32): uint256 - - - -27 - -<<Library>> -PocoStorageLib -contracts/libs/PocoStorageLib.sol - -Private: -   POCO_STORAGE_LOCATION: bytes32 - -Internal: -    getPocoStorage(): ($: PocoStorage) - - - -0->27 - - + +<<Library>> +CommonLib +contracts/libs/CommonLib.sol + +Internal: +    toTypedDataHash(structHash: bytes32): bytes32 +    verifySignatureOfEthSignedMessage(account: address, message: bytes, signature: bytes): bool +    verifySignature(account: address, messageHash: bytes32, signature: bytes): bool +    verifyPresignature(account: address, messageHash: bytes32): bool +    verifySignatureOrPresignature(account: address, messageHash: bytes32, signature: bytes): bool +    isAccountAuthorizedByRestriction(restriction: address, account: address): bool +    computeDealVolume(appOrderVolume: uint256, appOrderTypedDataHash: bytes32, hasDataset: bool, datasetOrderVolume: uint256, datasetOrderTypedDataHash: bytes32, workerpoolOrderVolume: uint256, workerpoolOrderTypedDataHash: bytes32, requestOrderVolume: uint256, requestOrderTypedDataHash: bytes32): uint256 28 - -<<Struct>> -PocoStorage -contracts/libs/PocoStorageLib.sol - -m_appregistry: IRegistry -m_datasetregistry: IRegistry -m_workerpoolregistry: IRegistry -m_baseToken: IERC20 -m_name: string -m_symbol: string -m_decimals: uint8 -m_totalSupply: uint256 -m_balances: mapping(address=>uint256) -m_frozens: mapping(address=>uint256) -m_allowances: mapping(address=>mapping(address=>uint256)) -m_eip712DomainSeparator: bytes32 -m_presigned: mapping(bytes32=>address) -m_consumed: mapping(bytes32=>uint256) -m_deals: mapping(bytes32=>IexecLibCore_v5.Deal) -m_tasks: mapping(bytes32=>IexecLibCore_v5.Task) -m_consensus: mapping(bytes32=>IexecLibCore_v5.Consensus) -m_contributions: mapping(bytes32=>mapping(address=>IexecLibCore_v5.Contribution)) -m_workerScores: mapping(address=>uint256) -m_teebroker: address -m_callbackgas: uint256 -m_categories: IexecLibCore_v5.Category[] -m_v3_iexecHub: IexecHubV3Interface -m_v3_scoreImported: mapping(address=>bool) -m_dealsBoost: mapping(bytes32=>IexecLibCore_v5.DealBoost) + +<<Library>> +PocoStorageLib +contracts/libs/PocoStorageLib.sol + +Private: +   POCO_STORAGE_LOCATION: bytes32 + +Internal: +    getPocoStorage(): ($: PocoStorage) - + 0->28 - - - - - -1 - -<<Library>> -EscrowLib -contracts/libs/EscrowLib.sol - -Internal: -    lock(account: address, value: uint256) -    unlock(account: address, value: uint256) -    reward(account: address, value: uint256, ref: bytes32) -    seize(account: address, value: uint256, ref: bytes32) -    rewardAndLock(account: address, value: uint256, ref: bytes32) -Public: -    <<event>> Reward(owner: address, amount: uint256, ref: bytes32) -    <<event>> Seize(owner: address, amount: uint256, ref: bytes32) -    <<event>> Lock(owner: address, amount: uint256) -    <<event>> Unlock(owner: address, amount: uint256) - - - -1->27 - - - - - -1->28 - - + + 29 - -<<Library>> -StakedRlcLib -contracts/libs/StakedRlcLib.sol - -Internal: -    transfer(from: address, to: address, value: uint256) -    mint(account: address, amount: uint256) -    burn(account: address, amount: uint256) -    approve(owner: address, spender: address, amount: uint256) -Public: -    <<event>> Transfer(from: address, to: address, value: uint256) -    <<event>> Approval(owner: address, spender: address, value: uint256) - - - -1->29 - - + +<<Struct>> +PocoStorage +contracts/libs/PocoStorageLib.sol + +m_appregistry: IRegistry +m_datasetregistry: IRegistry +m_workerpoolregistry: IRegistry +m_baseToken: IERC20 +m_name: string +m_symbol: string +m_decimals: uint8 +m_totalSupply: uint256 +m_balances: mapping(address=>uint256) +m_frozens: mapping(address=>uint256) +m_allowances: mapping(address=>mapping(address=>uint256)) +m_eip712DomainSeparator: bytes32 +m_presigned: mapping(bytes32=>address) +m_consumed: mapping(bytes32=>uint256) +m_deals: mapping(bytes32=>IexecLibCore_v5.Deal) +m_tasks: mapping(bytes32=>IexecLibCore_v5.Task) +m_consensus: mapping(bytes32=>IexecLibCore_v5.Consensus) +m_contributions: mapping(bytes32=>mapping(address=>IexecLibCore_v5.Contribution)) +m_workerScores: mapping(address=>uint256) +m_teebroker: address +m_callbackgas: uint256 +m_categories: IexecLibCore_v5.Category[] +m_v3_iexecHub: IexecHubV3Interface +m_v3_scoreImported: mapping(address=>bool) +m_dealsBoost: mapping(bytes32=>IexecLibCore_v5.DealBoost) + + + +0->29 + + + + + +1 + +<<Library>> +Constants +contracts/libs/Constants.sol + +Internal: +   CONTRIBUTION_DEADLINE_RATIO: uint256 +   REVEAL_DEADLINE_RATIO: uint256 +   FINAL_DEADLINE_RATIO: uint256 +   WORKERPOOL_STAKE_RATIO: uint256 +   KITTY_RATIO: uint256 +   KITTY_MIN: uint256 +   KITTY_ADDRESS: address +   GROUPMEMBER_PURPOSE: uint256 2 - -<<Library>> -IexecLibCore_v5 -contracts/libs/IexecLibCore_v5.sol + +<<Library>> +EscrowLib +contracts/libs/EscrowLib.sol + +Internal: +    lock(account: address, value: uint256) +    unlock(account: address, value: uint256) +    reward(account: address, value: uint256, ref: bytes32) +    seize(account: address, value: uint256, ref: bytes32) +    rewardAndLock(account: address, value: uint256, ref: bytes32) +Public: +    <<event>> Reward(owner: address, amount: uint256, ref: bytes32) +    <<event>> Seize(owner: address, amount: uint256, ref: bytes32) +    <<event>> Lock(owner: address, amount: uint256) +    <<event>> Unlock(owner: address, amount: uint256) + + + +2->28 + + + + + +2->29 + + + + + +30 + +<<Library>> +StakedRlcLib +contracts/libs/StakedRlcLib.sol + +Internal: +    transfer(from: address, to: address, value: uint256) +    mint(account: address, amount: uint256) +    burn(account: address, amount: uint256) +    approve(owner: address, spender: address, amount: uint256) +Public: +    <<event>> Transfer(from: address, to: address, value: uint256) +    <<event>> Approval(owner: address, spender: address, value: uint256) + + + +2->30 + + 3 - -<<Struct>> -Account -contracts/libs/IexecLibCore_v5.sol - -stake: uint256 -locked: uint256 - - - -3->2 - - + +<<Library>> +IexecLibCore_v5 +contracts/libs/IexecLibCore_v5.sol 4 - -<<Struct>> -Category -contracts/libs/IexecLibCore_v5.sol - -name: string -description: string -workClockTimeRef: uint256 - - - -4->2 - - + +<<Struct>> +Account +contracts/libs/IexecLibCore_v5.sol + +stake: uint256 +locked: uint256 + + + +4->3 + + 5 - -<<Struct>> -DatasetInfo -contracts/libs/IexecLibCore_v5.sol - -owner: address -m_datasetName: string -m_datasetMultiaddr: bytes -m_datasetChecksum: bytes32 - - - -5->2 - - + +<<Struct>> +Category +contracts/libs/IexecLibCore_v5.sol + +name: string +description: string +workClockTimeRef: uint256 + + + +5->3 + + 6 - -<<Struct>> -AppInfo -contracts/libs/IexecLibCore_v5.sol - -owner: address -m_appName: string -m_appType: string -m_appMultiaddr: bytes -m_appChecksum: bytes32 -m_appMREnclave: bytes - - - -6->2 - - + +<<Struct>> +DatasetInfo +contracts/libs/IexecLibCore_v5.sol + +owner: address +m_datasetName: string +m_datasetMultiaddr: bytes +m_datasetChecksum: bytes32 + + + +6->3 + + 7 - -<<Struct>> -WorkerpoolInfo -contracts/libs/IexecLibCore_v5.sol - -owner: address -m_workerpoolDescription: string -m_workerStakeRatioPolicy: uint256 -m_schedulerRewardRatioPolicy: uint256 - - - -7->2 - - + +<<Struct>> +AppInfo +contracts/libs/IexecLibCore_v5.sol + +owner: address +m_appName: string +m_appType: string +m_appMultiaddr: bytes +m_appChecksum: bytes32 +m_appMREnclave: bytes + + + +7->3 + + 8 - -<<Struct>> -Resource -contracts/libs/IexecLibCore_v5.sol - -pointer: address -owner: address -price: uint256 - - - -8->2 - - + +<<Struct>> +WorkerpoolInfo +contracts/libs/IexecLibCore_v5.sol + +owner: address +m_workerpoolDescription: string +m_workerStakeRatioPolicy: uint256 +m_schedulerRewardRatioPolicy: uint256 + + + +8->3 + + 9 - -<<Struct>> -Deal -contracts/libs/IexecLibCore_v5.sol - -app: Resource -dataset: Resource -workerpool: Resource -trust: uint256 -category: uint256 -tag: bytes32 -requester: address -beneficiary: address -callback: address -params: string -startTime: uint256 -botFirst: uint256 -botSize: uint256 -workerStake: uint256 -schedulerRewardRatio: uint256 -sponsor: address - - - -9->2 - - - - - -9->8 - - + +<<Struct>> +Resource +contracts/libs/IexecLibCore_v5.sol + +pointer: address +owner: address +price: uint256 + + + +9->3 + + 10 - -<<Struct>> -DealBoost -contracts/libs/IexecLibCore_v5.sol - -appOwner: address -appPrice: uint96 -datasetOwner: address -datasetPrice: uint96 -workerpoolOwner: address -workerpoolPrice: uint96 -requester: address -workerReward: uint96 -callback: address -deadline: uint40 -botFirst: uint16 -botSize: uint16 -shortTag: bytes3 -sponsor: address - - - -10->2 - - + +<<Struct>> +Deal +contracts/libs/IexecLibCore_v5.sol + +app: Resource +dataset: Resource +workerpool: Resource +trust: uint256 +category: uint256 +tag: bytes32 +requester: address +beneficiary: address +callback: address +params: string +startTime: uint256 +botFirst: uint256 +botSize: uint256 +workerStake: uint256 +schedulerRewardRatio: uint256 +sponsor: address + + + +10->3 + + + + + +10->9 + + 11 - -<<Enum>> -TaskStatusEnum -contracts/libs/IexecLibCore_v5.sol - -UNSET: 0 -ACTIVE: 1 -REVEALING: 2 -COMPLETED: 3 -FAILED: 4 - - - -11->2 - - + +<<Struct>> +DealBoost +contracts/libs/IexecLibCore_v5.sol + +appOwner: address +appPrice: uint96 +datasetOwner: address +datasetPrice: uint96 +workerpoolOwner: address +workerpoolPrice: uint96 +requester: address +workerReward: uint96 +callback: address +deadline: uint40 +botFirst: uint16 +botSize: uint16 +shortTag: bytes3 +sponsor: address + + + +11->3 + + 12 - -<<Struct>> -Task -contracts/libs/IexecLibCore_v5.sol - -status: TaskStatusEnum -dealid: bytes32 -idx: uint256 -timeref: uint256 -contributionDeadline: uint256 -revealDeadline: uint256 -finalDeadline: uint256 -consensusValue: bytes32 -revealCounter: uint256 -winnerCounter: uint256 -contributors: address[] -resultDigest: bytes32 -results: bytes -resultsTimestamp: uint256 -resultsCallback: bytes - - - -12->2 - - - - - -12->11 - - + +<<Enum>> +TaskStatusEnum +contracts/libs/IexecLibCore_v5.sol + +UNSET: 0 +ACTIVE: 1 +REVEALING: 2 +COMPLETED: 3 +FAILED: 4 + + + +12->3 + + 13 - -<<Struct>> -Consensus -contracts/libs/IexecLibCore_v5.sol - -group: mapping(bytes32=>uint256) -total: uint256 - - - -13->2 - - + +<<Struct>> +Task +contracts/libs/IexecLibCore_v5.sol + +status: TaskStatusEnum +dealid: bytes32 +idx: uint256 +timeref: uint256 +contributionDeadline: uint256 +revealDeadline: uint256 +finalDeadline: uint256 +consensusValue: bytes32 +revealCounter: uint256 +winnerCounter: uint256 +contributors: address[] +resultDigest: bytes32 +results: bytes +resultsTimestamp: uint256 +resultsCallback: bytes + + + +13->3 + + + + + +13->12 + + 14 - -<<Enum>> -ContributionStatusEnum -contracts/libs/IexecLibCore_v5.sol - -UNSET: 0 -CONTRIBUTED: 1 -PROVED: 2 -REJECTED: 3 - - - -14->2 - - + +<<Struct>> +Consensus +contracts/libs/IexecLibCore_v5.sol + +group: mapping(bytes32=>uint256) +total: uint256 + + + +14->3 + + 15 - -<<Struct>> -Contribution -contracts/libs/IexecLibCore_v5.sol - -status: ContributionStatusEnum -resultHash: bytes32 -resultSeal: bytes32 -enclaveChallenge: address -weight: uint256 - - - -15->2 - - - - - -15->14 - - + +<<Enum>> +ContributionStatusEnum +contracts/libs/IexecLibCore_v5.sol + +UNSET: 0 +CONTRIBUTED: 1 +PROVED: 2 +REJECTED: 3 + + + +15->3 + + 16 - -<<Library>> -IexecLibOrders_v5 -contracts/libs/IexecLibOrders_v5.sol - -Public: -   EIP712DOMAIN_TYPEHASH: bytes32 -   APPORDER_TYPEHASH: bytes32 -   DATASETORDER_TYPEHASH: bytes32 -   WORKERPOOLORDER_TYPEHASH: bytes32 -   REQUESTORDER_TYPEHASH: bytes32 -   APPORDEROPERATION_TYPEHASH: bytes32 -   DATASETORDEROPERATION_TYPEHASH: bytes32 -   WORKERPOOLORDEROPERATION_TYPEHASH: bytes32 -   REQUESTORDEROPERATION_TYPEHASH: bytes32 - -Public: -    hash(_domain: EIP712Domain): (domainhash: bytes32) -    hash(_apporder: AppOrder): (apphash: bytes32) -    hash(_datasetorder: DatasetOrder): (datasethash: bytes32) -    hash(_workerpoolorder: WorkerpoolOrder): (workerpoolhash: bytes32) -    hash(_requestorder: RequestOrder): (requesthash: bytes32) -    hash(_apporderoperation: AppOrderOperation): bytes32 -    hash(_datasetorderoperation: DatasetOrderOperation): bytes32 -    hash(_workerpoolorderoperation: WorkerpoolOrderOperation): bytes32 -    hash(_requestorderoperation: RequestOrderOperation): bytes32 + +<<Struct>> +Contribution +contracts/libs/IexecLibCore_v5.sol + +status: ContributionStatusEnum +resultHash: bytes32 +resultSeal: bytes32 +enclaveChallenge: address +weight: uint256 + + + +16->3 + + - - -18 - -<<Struct>> -EIP712Domain -contracts/libs/IexecLibOrders_v5.sol - -name: string -version: string -chainId: uint256 -verifyingContract: address - - - -16->18 - - + + +16->15 + + + + + +17 + +<<Library>> +IexecLibOrders_v5 +contracts/libs/IexecLibOrders_v5.sol + +Public: +   EIP712DOMAIN_TYPEHASH: bytes32 +   APPORDER_TYPEHASH: bytes32 +   DATASETORDER_TYPEHASH: bytes32 +   WORKERPOOLORDER_TYPEHASH: bytes32 +   REQUESTORDER_TYPEHASH: bytes32 +   APPORDEROPERATION_TYPEHASH: bytes32 +   DATASETORDEROPERATION_TYPEHASH: bytes32 +   WORKERPOOLORDEROPERATION_TYPEHASH: bytes32 +   REQUESTORDEROPERATION_TYPEHASH: bytes32 + +Public: +    hash(_domain: EIP712Domain): (domainhash: bytes32) +    hash(_apporder: AppOrder): (apphash: bytes32) +    hash(_datasetorder: DatasetOrder): (datasethash: bytes32) +    hash(_workerpoolorder: WorkerpoolOrder): (workerpoolhash: bytes32) +    hash(_requestorder: RequestOrder): (requesthash: bytes32) +    hash(_apporderoperation: AppOrderOperation): bytes32 +    hash(_datasetorderoperation: DatasetOrderOperation): bytes32 +    hash(_workerpoolorderoperation: WorkerpoolOrderOperation): bytes32 +    hash(_requestorderoperation: RequestOrderOperation): bytes32 19 - -<<Struct>> -AppOrder -contracts/libs/IexecLibOrders_v5.sol - -app: address -appprice: uint256 -volume: uint256 -tag: bytes32 -datasetrestrict: address -workerpoolrestrict: address -requesterrestrict: address -salt: bytes32 -sign: bytes - - - -16->19 - - + +<<Struct>> +EIP712Domain +contracts/libs/IexecLibOrders_v5.sol + +name: string +version: string +chainId: uint256 +verifyingContract: address + + + +17->19 + + 20 - -<<Struct>> -DatasetOrder -contracts/libs/IexecLibOrders_v5.sol - -dataset: address -datasetprice: uint256 -volume: uint256 -tag: bytes32 -apprestrict: address -workerpoolrestrict: address -requesterrestrict: address -salt: bytes32 -sign: bytes - - - -16->20 - - + +<<Struct>> +AppOrder +contracts/libs/IexecLibOrders_v5.sol + +app: address +appprice: uint256 +volume: uint256 +tag: bytes32 +datasetrestrict: address +workerpoolrestrict: address +requesterrestrict: address +salt: bytes32 +sign: bytes + + + +17->20 + + 21 - -<<Struct>> -WorkerpoolOrder -contracts/libs/IexecLibOrders_v5.sol - -workerpool: address -workerpoolprice: uint256 -volume: uint256 -tag: bytes32 -category: uint256 -trust: uint256 -apprestrict: address -datasetrestrict: address -requesterrestrict: address -salt: bytes32 -sign: bytes - - - -16->21 - - + +<<Struct>> +DatasetOrder +contracts/libs/IexecLibOrders_v5.sol + +dataset: address +datasetprice: uint256 +volume: uint256 +tag: bytes32 +apprestrict: address +workerpoolrestrict: address +requesterrestrict: address +salt: bytes32 +sign: bytes + + + +17->21 + + 22 - -<<Struct>> -RequestOrder -contracts/libs/IexecLibOrders_v5.sol - -app: address -appmaxprice: uint256 -dataset: address -datasetmaxprice: uint256 -workerpool: address -workerpoolmaxprice: uint256 -requester: address -volume: uint256 -tag: bytes32 -category: uint256 -trust: uint256 -beneficiary: address -callback: address -params: string -salt: bytes32 -sign: bytes - - - -16->22 - - + +<<Struct>> +WorkerpoolOrder +contracts/libs/IexecLibOrders_v5.sol + +workerpool: address +workerpoolprice: uint256 +volume: uint256 +tag: bytes32 +category: uint256 +trust: uint256 +apprestrict: address +datasetrestrict: address +requesterrestrict: address +salt: bytes32 +sign: bytes + + + +17->22 + + 23 - -<<Struct>> -AppOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: AppOrder -operation: OrderOperationEnum -sign: bytes - - - -16->23 - - + +<<Struct>> +RequestOrder +contracts/libs/IexecLibOrders_v5.sol + +app: address +appmaxprice: uint256 +dataset: address +datasetmaxprice: uint256 +workerpool: address +workerpoolmaxprice: uint256 +requester: address +volume: uint256 +tag: bytes32 +category: uint256 +trust: uint256 +beneficiary: address +callback: address +params: string +salt: bytes32 +sign: bytes + + + +17->23 + + 24 - -<<Struct>> -DatasetOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: DatasetOrder -operation: OrderOperationEnum -sign: bytes - - - -16->24 - - + +<<Struct>> +AppOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: AppOrder +operation: OrderOperationEnum +sign: bytes + + + +17->24 + + 25 - -<<Struct>> -WorkerpoolOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: WorkerpoolOrder -operation: OrderOperationEnum -sign: bytes - - - -16->25 - - + +<<Struct>> +DatasetOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: DatasetOrder +operation: OrderOperationEnum +sign: bytes + + + +17->25 + + 26 - -<<Struct>> -RequestOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: RequestOrder -operation: OrderOperationEnum -sign: bytes - - + +<<Struct>> +WorkerpoolOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: WorkerpoolOrder +operation: OrderOperationEnum +sign: bytes + + + +17->26 + + + + + +27 + +<<Struct>> +RequestOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: RequestOrder +operation: OrderOperationEnum +sign: bytes + + -16->26 - - +17->27 + + - - -17 - -<<Enum>> -OrderOperationEnum -contracts/libs/IexecLibOrders_v5.sol - -SIGN: 0 -CLOSE: 1 - - + + +18 + +<<Enum>> +OrderOperationEnum +contracts/libs/IexecLibOrders_v5.sol + +SIGN: 0 +CLOSE: 1 + + -17->16 - - +18->17 + + - + -18->16 - - +19->17 + + - + -19->16 - - +20->17 + + - + -20->16 - - +21->17 + + - + -21->16 - - +22->17 + + - + -22->16 - - +23->17 + + - + -23->16 - - +24->17 + + - + -23->17 - - +24->18 + + - + -23->19 - - +24->20 + + - + -24->16 - - +25->17 + + - + -24->17 - - +25->18 + + - + -24->20 - - +25->21 + + - + -25->16 - - +26->17 + + - + -25->17 - - +26->18 + + - + -25->21 - - +26->22 + + - + -26->16 - - +27->17 + + - + -26->17 - - +27->18 + + - + -26->22 - - +27->23 + + - + -27->28 - - +28->29 + + - + -28->2 - - +29->3 + + - + -28->27 - - +29->28 + + - + -29->27 - - +30->28 + + - + -29->28 - - +30->29 + + From 5204f186da4c8556572d22d9e9f287ecd166fc30 Mon Sep 17 00:00:00 2001 From: Zied <26070035+zguesmi@users.noreply.github.com> Date: Thu, 3 Sep 2026 11:59:17 +0200 Subject: [PATCH 8/9] revert: keep the protocol constants in FacetBase This undoes both steps of the constants extraction: the `ConstantsLib` library added earlier and its rename to `Constants` with the qualified references. `contracts/libs/Constants.sol` is removed, `FacetBase` declares the eight constants again, the four facets read them under their bare names, and `CommonLib` goes back to its own `GROUPMEMBER_PURPOSE` copy. The rename markers that the extraction had deleted come back with it, so the work can be picked up later without re-deriving the reasoning. The external surface never moved: the getters on `IexecPocoAccessorsFacet` keep the same names and values throughout. --- contracts/abstract/FacetBase.sol | 20 +++++++++++++ contracts/facets/IexecPoco1Facet.sol | 3 +- contracts/facets/IexecPoco2Facet.sol | 27 +++++++----------- contracts/facets/IexecPocoAccessorsFacet.sol | 17 ++++++----- contracts/facets/IexecPocoBoostFacet.sol | 23 ++++++--------- contracts/libs/CommonLib.sol | 6 ++-- contracts/libs/Constants.sol | 30 -------------------- docs/solidity/index.md | 2 -- 8 files changed, 52 insertions(+), 76 deletions(-) delete mode 100644 contracts/libs/Constants.sol diff --git a/contracts/abstract/FacetBase.sol b/contracts/abstract/FacetBase.sol index 0cb63e4a1..2cd15a438 100644 --- a/contracts/abstract/FacetBase.sol +++ b/contracts/abstract/FacetBase.sol @@ -13,6 +13,26 @@ import {IERC5313} from "@openzeppelin/contracts/interfaces/IERC5313.sol"; * @dev Every facet must inherit from this contract. */ abstract contract FacetBase { + // TODO move these constants to a ConstantsLib library and reference them as + // ConstantsLib. in the next PR. + // CommonLib redeclares GROUPMEMBER_PURPOSE temporarily. + + // Poco - Constants + uint256 internal constant CONTRIBUTION_DEADLINE_RATIO = 7; + uint256 internal constant REVEAL_DEADLINE_RATIO = 2; + uint256 internal constant FINAL_DEADLINE_RATIO = 10; + uint256 internal constant WORKERPOOL_STAKE_RATIO = 30; + uint256 internal constant KITTY_RATIO = 10; + uint256 internal constant KITTY_MIN = 1e9; // ADJUSTEMENT VARIABLE + + // Seized funds of workerpools that do not honor their deals are sent + // out to this kitty address. + // It is determined with address(uint256(keccak256(bytes('iExecKitty'))) - 1). + address internal constant KITTY_ADDRESS = 0x99c2268479b93fDe36232351229815DF80837e23; + + // Used with ERC-734 Key Manager identity contract for authorization management. + uint256 internal constant GROUPMEMBER_PURPOSE = 4; + modifier onlyOwner() { require(_msgSender() == owner(), "Ownable: caller is not the owner"); _; diff --git a/contracts/facets/IexecPoco1Facet.sol b/contracts/facets/IexecPoco1Facet.sol index 440d86b65..87917a36e 100644 --- a/contracts/facets/IexecPoco1Facet.sol +++ b/contracts/facets/IexecPoco1Facet.sol @@ -14,7 +14,6 @@ import {IexecPoco1Errors} from "../interfaces/IexecPoco1Errors.sol"; import {FacetBase} from "../abstract/FacetBase.sol"; import {EscrowLib} from "../libs/EscrowLib.sol"; import {CommonLib} from "../libs/CommonLib.sol"; -import {Constants} from "../libs/Constants.sol"; struct Matching { bytes32 apporderHash; @@ -464,7 +463,7 @@ contract IexecPoco1Facet is IexecPoco1, IexecPoco1Errors, FacetBase { //slither-disable-next-line divide-before-multiply EscrowLib.lock( deal.workerpool.owner, - ((deal.workerpool.price * Constants.WORKERPOOL_STAKE_RATIO) / 100) * volume // ORDER IS IMPORTANT HERE! + ((deal.workerpool.price * WORKERPOOL_STAKE_RATIO) / 100) * volume // ORDER IS IMPORTANT HERE! ); /** diff --git a/contracts/facets/IexecPoco2Facet.sol b/contracts/facets/IexecPoco2Facet.sol index 06b713d95..6071f99c3 100644 --- a/contracts/facets/IexecPoco2Facet.sol +++ b/contracts/facets/IexecPoco2Facet.sol @@ -12,7 +12,6 @@ import {IexecPoco2} from "../interfaces/IexecPoco2.sol"; import {FacetBase} from "../abstract/FacetBase.sol"; import {EscrowLib} from "../libs/EscrowLib.sol"; import {CommonLib} from "../libs/CommonLib.sol"; -import {Constants} from "../libs/Constants.sol"; contract IexecPoco2Facet is IexecPoco2, FacetBase { modifier onlyScheduler(bytes32 _taskId) { @@ -29,7 +28,7 @@ contract IexecPoco2Facet is IexecPoco2, FacetBase { IexecLibCore_v5.Deal storage deal = $.m_deals[_dealid]; uint256 taskPrice = deal.app.price + deal.dataset.price + deal.workerpool.price; - uint256 poolstake = (deal.workerpool.price * Constants.WORKERPOOL_STAKE_RATIO) / 100; + uint256 poolstake = (deal.workerpool.price * WORKERPOOL_STAKE_RATIO) / 100; // Seize the payer of the task EscrowLib.seize(deal.sponsor, taskPrice, _taskid); @@ -46,14 +45,11 @@ contract IexecPoco2Facet is IexecPoco2, FacetBase { // pool reward performed by consensus manager // Retrieve part of the kitty - uint256 kitty = $.m_frozens[Constants.KITTY_ADDRESS]; + uint256 kitty = $.m_frozens[KITTY_ADDRESS]; if (kitty > 0) { // Get a fraction of the kitty where KITTY_MIN <= fraction <= kitty - kitty = Math.min( - Math.max((kitty * Constants.KITTY_RATIO) / 100, Constants.KITTY_MIN), - kitty - ); - EscrowLib.seize(Constants.KITTY_ADDRESS, kitty, _taskid); + kitty = Math.min(Math.max((kitty * KITTY_RATIO) / 100, KITTY_MIN), kitty); + EscrowLib.seize(KITTY_ADDRESS, kitty, _taskid); EscrowLib.reward(deal.workerpool.owner, kitty, _taskid); } } @@ -63,12 +59,12 @@ contract IexecPoco2Facet is IexecPoco2, FacetBase { IexecLibCore_v5.Deal memory deal = $.m_deals[_dealid]; uint256 taskPrice = deal.app.price + deal.dataset.price + deal.workerpool.price; - uint256 poolstake = (deal.workerpool.price * Constants.WORKERPOOL_STAKE_RATIO) / 100; + uint256 poolstake = (deal.workerpool.price * WORKERPOOL_STAKE_RATIO) / 100; EscrowLib.unlock(deal.sponsor, taskPrice); // Refund the payer of the task EscrowLib.seize(deal.workerpool.owner, poolstake, _taskid); // Reward kitty and lock value on it. - EscrowLib.rewardAndLock(Constants.KITTY_ADDRESS, poolstake, _taskid); // → Kitty / Burn + EscrowLib.rewardAndLock(KITTY_ADDRESS, poolstake, _taskid); // → Kitty / Burn } /*************************************************************************** @@ -89,11 +85,8 @@ contract IexecPoco2Facet is IexecPoco2, FacetBase { task.dealid = _dealid; task.idx = idx; task.timeref = $.m_categories[deal.category].workClockTimeRef; - task.contributionDeadline = - deal.startTime + - task.timeref * - Constants.CONTRIBUTION_DEADLINE_RATIO; - task.finalDeadline = deal.startTime + task.timeref * Constants.FINAL_DEADLINE_RATIO; + task.contributionDeadline = deal.startTime + task.timeref * CONTRIBUTION_DEADLINE_RATIO; + task.finalDeadline = deal.startTime + task.timeref * FINAL_DEADLINE_RATIO; // setup denominator $.m_consensus[taskid].total = 1; @@ -240,7 +233,7 @@ contract IexecPoco2Facet is IexecPoco2, FacetBase { task.status = IexecLibCore_v5.TaskStatusEnum.COMPLETED; task.consensusValue = contribution.resultHash; - task.revealDeadline = block.timestamp + task.timeref * Constants.REVEAL_DEADLINE_RATIO; + task.revealDeadline = block.timestamp + task.timeref * REVEAL_DEADLINE_RATIO; task.revealCounter = 1; task.winnerCounter = 1; task.resultDigest = _resultDigest; @@ -407,7 +400,7 @@ contract IexecPoco2Facet is IexecPoco2, FacetBase { // _msgSender() is a contributor: no need to check task.status = IexecLibCore_v5.TaskStatusEnum.REVEALING; task.consensusValue = _consensus; - task.revealDeadline = block.timestamp + task.timeref * Constants.REVEAL_DEADLINE_RATIO; + task.revealDeadline = block.timestamp + task.timeref * REVEAL_DEADLINE_RATIO; task.revealCounter = 0; task.winnerCounter = winnerCounter; diff --git a/contracts/facets/IexecPocoAccessorsFacet.sol b/contracts/facets/IexecPocoAccessorsFacet.sol index d991ada2a..f4c0bc5fc 100644 --- a/contracts/facets/IexecPocoAccessorsFacet.sol +++ b/contracts/facets/IexecPocoAccessorsFacet.sol @@ -13,7 +13,6 @@ import {IexecPocoAccessors} from "../interfaces/IexecPocoAccessors.sol"; import {IRegistry} from "../registries/IRegistry.sol"; import {FacetBase} from "../abstract/FacetBase.sol"; import {CommonLib} from "../libs/CommonLib.sol"; -import {Constants} from "../libs/Constants.sol"; /** * @title Getters contract for PoCo facets. @@ -243,35 +242,35 @@ contract IexecPocoAccessorsFacet is IexecPocoAccessors, FacetBase { // ========= Constants Accessors ========= function contribution_deadline_ratio() external pure returns (uint256) { - return Constants.CONTRIBUTION_DEADLINE_RATIO; + return CONTRIBUTION_DEADLINE_RATIO; } function reveal_deadline_ratio() external pure returns (uint256) { - return Constants.REVEAL_DEADLINE_RATIO; + return REVEAL_DEADLINE_RATIO; } function final_deadline_ratio() external pure returns (uint256) { - return Constants.FINAL_DEADLINE_RATIO; + return FINAL_DEADLINE_RATIO; } function workerpool_stake_ratio() external pure returns (uint256) { - return Constants.WORKERPOOL_STAKE_RATIO; + return WORKERPOOL_STAKE_RATIO; } function kitty_ratio() external pure returns (uint256) { - return Constants.KITTY_RATIO; + return KITTY_RATIO; } function kitty_min() external pure returns (uint256) { - return Constants.KITTY_MIN; + return KITTY_MIN; } function kitty_address() external pure returns (address) { - return Constants.KITTY_ADDRESS; + return KITTY_ADDRESS; } function groupmember_purpose() external pure returns (uint256) { - return Constants.GROUPMEMBER_PURPOSE; + return GROUPMEMBER_PURPOSE; } function eip712domain_separator() external view returns (bytes32) { diff --git a/contracts/facets/IexecPocoBoostFacet.sol b/contracts/facets/IexecPocoBoostFacet.sol index e0234618c..e43fa35be 100644 --- a/contracts/facets/IexecPocoBoostFacet.sol +++ b/contracts/facets/IexecPocoBoostFacet.sol @@ -18,7 +18,6 @@ import {FacetBase} from "../abstract/FacetBase.sol"; import {EscrowLib} from "../libs/EscrowLib.sol"; import {PocoStorageLib} from "../libs/PocoStorageLib.sol"; import {CommonLib} from "../libs/CommonLib.sol"; -import {Constants} from "../libs/Constants.sol"; // // Not deployed yet! @@ -301,7 +300,7 @@ contract IexecPocoBoostFacet is IexecPocoBoost, FacetBase { deal.botFirst = requestOrderConsumed.toUint16(); deal.deadline = (block.timestamp + $.m_categories[category].workClockTimeRef * - Constants.CONTRIBUTION_DEADLINE_RATIO).toUint40(); + CONTRIBUTION_DEADLINE_RATIO).toUint40(); deal.botSize = volume.toUint16(); /** * Store right part of tag for later use. @@ -343,7 +342,7 @@ contract IexecPocoBoostFacet is IexecPocoBoost, FacetBase { //slither-disable-next-line divide-before-multiply EscrowLib.lock( workerpoolOwner, - ((workerpoolPrice * Constants.WORKERPOOL_STAKE_RATIO) / 100) * volume + ((workerpoolPrice * WORKERPOOL_STAKE_RATIO) / 100) * volume ); // Notify workerpool. emit SchedulerNoticeBoost( @@ -459,20 +458,16 @@ contract IexecPocoBoostFacet is IexecPocoBoost, FacetBase { } // Unlock scheduler stake - EscrowLib.unlock( - workerpoolOwner, - (workerPoolPrice * Constants.WORKERPOOL_STAKE_RATIO) / 100 - ); + EscrowLib.unlock(workerpoolOwner, (workerPoolPrice * WORKERPOOL_STAKE_RATIO) / 100); // Reward scheduler - uint256 kitty = $.m_frozens[Constants.KITTY_ADDRESS]; + uint256 kitty = $.m_frozens[KITTY_ADDRESS]; if (kitty > 0) { - kitty = Constants - .KITTY_MIN // 1. retrieve bare minimum from kitty + kitty = KITTY_MIN // 1. retrieve bare minimum from kitty .max( // 2. or eventually a fraction of kitty if bigger // @dev As long as `KITTY_RATIO = 10`, we can introduce this small - kitty / Constants.KITTY_RATIO // optimization for `kitty * KITTY_RATIO / 100` + kitty / KITTY_RATIO // optimization for `kitty * KITTY_RATIO / 100` ).min(kitty); // 3. but no more than available - EscrowLib.seize(Constants.KITTY_ADDRESS, kitty, taskId); + EscrowLib.seize(KITTY_ADDRESS, kitty, taskId); } EscrowLib.reward( workerpoolOwner, @@ -520,13 +515,13 @@ contract IexecPocoBoostFacet is IexecPocoBoost, FacetBase { task.status = IexecLibCore_v5.TaskStatusEnum.FAILED; // Calculate workerpool price and task stake. uint96 workerPoolPrice = deal.workerpoolPrice; - uint256 workerpoolTaskStake = (workerPoolPrice * Constants.WORKERPOOL_STAKE_RATIO) / 100; + uint256 workerpoolTaskStake = (workerPoolPrice * WORKERPOOL_STAKE_RATIO) / 100; // Refund the payer of the task by unlocking the locked funds. EscrowLib.unlock(deal.sponsor, deal.appPrice + deal.datasetPrice + workerPoolPrice); // Seize task stake from workerpool. EscrowLib.seize(deal.workerpoolOwner, workerpoolTaskStake, taskId); // Reward kitty and lock the rewarded amount. - EscrowLib.rewardAndLock(Constants.KITTY_ADDRESS, workerpoolTaskStake, taskId); + EscrowLib.rewardAndLock(KITTY_ADDRESS, workerpoolTaskStake, taskId); emit TaskClaimed(taskId); } diff --git a/contracts/libs/CommonLib.sol b/contracts/libs/CommonLib.sol index aa0deb522..d394735e0 100644 --- a/contracts/libs/CommonLib.sol +++ b/contracts/libs/CommonLib.sol @@ -8,7 +8,6 @@ import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; import {IERC734} from "../external/interfaces/IERC734.sol"; -import {Constants} from "./Constants.sol"; import {PocoStorageLib} from "./PocoStorageLib.sol"; /** @@ -19,6 +18,9 @@ library CommonLib { using ECDSA for bytes32; using Math for uint256; + // Used with ERC-734 Key Manager identity contract for authorization management. + uint256 private constant GROUPMEMBER_PURPOSE = 4; + /** * Hash a Typed Data using the configured domain. * @param structHash The original structure hash. @@ -145,7 +147,7 @@ library CommonLib { try IERC734(restriction).keyHasPurpose( // ERC734 identity contract restriction bytes32(uint256(uint160(account))), - Constants.GROUPMEMBER_PURPOSE + GROUPMEMBER_PURPOSE ) returns (bool success) { return success; diff --git a/contracts/libs/Constants.sol b/contracts/libs/Constants.sol deleted file mode 100644 index 8edccc22d..000000000 --- a/contracts/libs/Constants.sol +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH -// SPDX-License-Identifier: Apache-2.0 - -pragma solidity ^0.8.0; - -/** - * @title All protocol constants. - */ -library Constants { - // Deadline ratios, expressed as multiples of the category time frame. - uint256 internal constant CONTRIBUTION_DEADLINE_RATIO = 7; - uint256 internal constant REVEAL_DEADLINE_RATIO = 2; - uint256 internal constant FINAL_DEADLINE_RATIO = 10; - - // Share of the deal price a workerpool must stake, as a percentage. - uint256 internal constant WORKERPOOL_STAKE_RATIO = 30; - - // Share of the kitty released to a workerpool on each reward, as a - // percentage, and the floor below which the whole kitty is released. - uint256 internal constant KITTY_RATIO = 10; - uint256 internal constant KITTY_MIN = 1e9; // ADJUSTEMENT VARIABLE - - // Seized funds of workerpools that do not honor their deals are sent - // out to this kitty address. - // It is determined with address(uint256(keccak256(bytes('iExecKitty'))) - 1). - address internal constant KITTY_ADDRESS = 0x99c2268479b93fDe36232351229815DF80837e23; - - // Used with ERC-734 Key Manager identity contract for authorization management. - uint256 internal constant GROUPMEMBER_PURPOSE = 4; -} diff --git a/docs/solidity/index.md b/docs/solidity/index.md index d22699b4d..0c79d22d6 100644 --- a/docs/solidity/index.md +++ b/docs/solidity/index.md @@ -794,8 +794,6 @@ function broadcastWorkerpoolOrder(struct IexecLibOrders_v5.WorkerpoolOrder _work function broadcastRequestOrder(struct IexecLibOrders_v5.RequestOrder _requestorder) external ``` -## Constants - ## EscrowLib The escrow layers on top of the sRLC ledger: it owns `m_frozens` and From 5f00870f318cc7b87ef5e9533883c9e3652c8d9e Mon Sep 17 00:00:00 2001 From: Zied <26070035+zguesmi@users.noreply.github.com> Date: Thu, 3 Sep 2026 12:03:31 +0200 Subject: [PATCH 9/9] chore: update diagrams --- docs/uml/class-uml-IexecEscrows.svg | 628 +++---- docs/uml/class-uml-IexecPocoBoostFacet.svg | 1331 ++++++++------- docs/uml/class-uml-IexecPocoFacets.svg | 1709 ++++++++++---------- docs/uml/class-uml-dir-libs.svg | 1341 ++++++++------- 4 files changed, 2488 insertions(+), 2521 deletions(-) diff --git a/docs/uml/class-uml-IexecEscrows.svg b/docs/uml/class-uml-IexecEscrows.svg index b97cb0531..b4a3e3a10 100644 --- a/docs/uml/class-uml-IexecEscrows.svg +++ b/docs/uml/class-uml-IexecEscrows.svg @@ -4,89 +4,99 @@ - + UmlClassDiagram - + 3 - -<<Abstract>> -FacetBase -contracts/abstract/FacetBase.sol - -Internal: -    owner(): address -    _msgSender(): address -Public: -    <<modifier>> onlyOwner() + +<<Abstract>> +FacetBase +contracts/abstract/FacetBase.sol + +Internal: +   CONTRIBUTION_DEADLINE_RATIO: uint256 +   REVEAL_DEADLINE_RATIO: uint256 +   FINAL_DEADLINE_RATIO: uint256 +   WORKERPOOL_STAKE_RATIO: uint256 +   KITTY_RATIO: uint256 +   KITTY_MIN: uint256 +   KITTY_ADDRESS: address +   GROUPMEMBER_PURPOSE: uint256 + +Internal: +    owner(): address +    _msgSender(): address +Public: +    <<modifier>> onlyOwner() 8 - -IexecEscrowFacet -contracts/facets/IexecEscrowFacet.sol - -Internal: -    _executeOperation(sender: address, data: bytes) -    _validateMatchOrders(sender: address, data: bytes) -    _deposit(from: address, amount: uint256) -    _withdraw(to: address, amount: uint256) -External: -    <<payable>> null() -    <<payable>> null() -    deposit(amount: uint256): bool -    depositFor(amount: uint256, target: address): bool -    depositForArray(amounts: uint256[], targets: address[]): bool -    withdraw(amount: uint256): bool -    withdrawTo(amount: uint256, target: address): bool -    recover(): uint256 <<onlyOwner>> -    receiveApproval(sender: address, amount: uint256, token: address, data: bytes): bool -    transfer(recipient: address, amount: uint256): bool -    approve(spender: address, value: uint256): bool -    approveAndCall(spender: address, value: uint256, extraData: bytes): bool -    transferFrom(sender: address, recipient: address, amount: uint256): bool -    increaseAllowance(spender: address, addedValue: uint256): bool -    decreaseAllowance(spender: address, subtractedValue: uint256): bool + +IexecEscrowFacet +contracts/facets/IexecEscrowFacet.sol + +Internal: +    _executeOperation(sender: address, data: bytes) +    _validateMatchOrders(sender: address, data: bytes) +    _deposit(from: address, amount: uint256) +    _withdraw(to: address, amount: uint256) +External: +    <<payable>> null() +    <<payable>> null() +    deposit(amount: uint256): bool +    depositFor(amount: uint256, target: address): bool +    depositForArray(amounts: uint256[], targets: address[]): bool +    withdraw(amount: uint256): bool +    withdrawTo(amount: uint256, target: address): bool +    recover(): uint256 <<onlyOwner>> +    receiveApproval(sender: address, amount: uint256, token: address, data: bytes): bool +    transfer(recipient: address, amount: uint256): bool +    approve(spender: address, value: uint256): bool +    approveAndCall(spender: address, value: uint256, extraData: bytes): bool +    transferFrom(sender: address, recipient: address, amount: uint256): bool +    increaseAllowance(spender: address, addedValue: uint256): bool +    decreaseAllowance(spender: address, subtractedValue: uint256): bool 8->3 - - + + 22 - -<<Interface>> -IexecEscrow -contracts/interfaces/IexecEscrow.sol - -External: -     null() -     null() -     deposit(uint256): bool -     depositFor(uint256, address): bool -     depositForArray(uint256[], address[]): bool -     withdraw(uint256): bool -     withdrawTo(uint256, address): bool -     recover(): uint256 -     transfer(address, uint256): bool -     approve(address, uint256): bool -     transferFrom(address, address, uint256): bool -     increaseAllowance(address, uint256): bool -     decreaseAllowance(address, uint256): bool -     approveAndCall(address, uint256, bytes): bool + +<<Interface>> +IexecEscrow +contracts/interfaces/IexecEscrow.sol + +External: +     null() +     null() +     deposit(uint256): bool +     depositFor(uint256, address): bool +     depositForArray(uint256[], address[]): bool +     withdraw(uint256): bool +     withdrawTo(uint256, address): bool +     recover(): uint256 +     transfer(address, uint256): bool +     approve(address, uint256): bool +     transferFrom(address, address, uint256): bool +     increaseAllowance(address, uint256): bool +     decreaseAllowance(address, uint256): bool +     approveAndCall(address, uint256, bytes): bool 8->22 - - + + @@ -111,8 +121,8 @@ 8->26 - - + + @@ -128,12 +138,12 @@ 8->33 - - + + - + -51 +50 <<Library>> IexecLibOrders_v5 @@ -161,115 +171,115 @@    hash(_workerpoolorderoperation: WorkerpoolOrderOperation): bytes32    hash(_requestorderoperation: RequestOrderOperation): bytes32 - + -8->51 - +8->50 + - + +61 + +<<Library>> +PocoStorageLib +contracts/libs/PocoStorageLib.sol + +Private: +   POCO_STORAGE_LOCATION: bytes32 + +Internal: +    getPocoStorage(): ($: PocoStorage) + + + +8->61 + + + + + 62 - -<<Library>> -PocoStorageLib -contracts/libs/PocoStorageLib.sol - -Private: -   POCO_STORAGE_LOCATION: bytes32 - -Internal: -    getPocoStorage(): ($: PocoStorage) + +<<Struct>> +PocoStorage +contracts/libs/PocoStorageLib.sol + +m_appregistry: IRegistry +m_datasetregistry: IRegistry +m_workerpoolregistry: IRegistry +m_baseToken: IERC20 +m_name: string +m_symbol: string +m_decimals: uint8 +m_totalSupply: uint256 +m_balances: mapping(address=>uint256) +m_frozens: mapping(address=>uint256) +m_allowances: mapping(address=>mapping(address=>uint256)) +m_eip712DomainSeparator: bytes32 +m_presigned: mapping(bytes32=>address) +m_consumed: mapping(bytes32=>uint256) +m_deals: mapping(bytes32=>IexecLibCore_v5.Deal) +m_tasks: mapping(bytes32=>IexecLibCore_v5.Task) +m_consensus: mapping(bytes32=>IexecLibCore_v5.Consensus) +m_contributions: mapping(bytes32=>mapping(address=>IexecLibCore_v5.Contribution)) +m_workerScores: mapping(address=>uint256) +m_teebroker: address +m_callbackgas: uint256 +m_categories: IexecLibCore_v5.Category[] +m_v3_iexecHub: IexecHubV3Interface +m_v3_scoreImported: mapping(address=>bool) +m_dealsBoost: mapping(bytes32=>IexecLibCore_v5.DealBoost) - + 8->62 - - + + - + 63 - -<<Struct>> -PocoStorage -contracts/libs/PocoStorageLib.sol - -m_appregistry: IRegistry -m_datasetregistry: IRegistry -m_workerpoolregistry: IRegistry -m_baseToken: IERC20 -m_name: string -m_symbol: string -m_decimals: uint8 -m_totalSupply: uint256 -m_balances: mapping(address=>uint256) -m_frozens: mapping(address=>uint256) -m_allowances: mapping(address=>mapping(address=>uint256)) -m_eip712DomainSeparator: bytes32 -m_presigned: mapping(bytes32=>address) -m_consumed: mapping(bytes32=>uint256) -m_deals: mapping(bytes32=>IexecLibCore_v5.Deal) -m_tasks: mapping(bytes32=>IexecLibCore_v5.Task) -m_consensus: mapping(bytes32=>IexecLibCore_v5.Consensus) -m_contributions: mapping(bytes32=>mapping(address=>IexecLibCore_v5.Contribution)) -m_workerScores: mapping(address=>uint256) -m_teebroker: address -m_callbackgas: uint256 -m_categories: IexecLibCore_v5.Category[] -m_v3_iexecHub: IexecHubV3Interface -m_v3_scoreImported: mapping(address=>bool) -m_dealsBoost: mapping(bytes32=>IexecLibCore_v5.DealBoost) + +<<Library>> +StakedRlcLib +contracts/libs/StakedRlcLib.sol + +Internal: +    transfer(from: address, to: address, value: uint256) +    mint(account: address, amount: uint256) +    burn(account: address, amount: uint256) +    approve(owner: address, spender: address, amount: uint256) +Public: +    <<event>> Transfer(from: address, to: address, value: uint256) +    <<event>> Approval(owner: address, spender: address, value: uint256) - -8->63 - - - - - -64 - -<<Library>> -StakedRlcLib -contracts/libs/StakedRlcLib.sol - -Internal: -    transfer(from: address, to: address, value: uint256) -    mint(account: address, amount: uint256) -    burn(account: address, amount: uint256) -    approve(owner: address, spender: address, amount: uint256) -Public: -    <<event>> Transfer(from: address, to: address, value: uint256) -    <<event>> Approval(owner: address, spender: address, value: uint256) - - -8->64 - - +8->63 + + 24 - -<<Interface>> -IexecHubV3Interface -contracts/interfaces/IexecHubV3Interface.sol - -External: -     viewScore(worker: address): uint256 - - + +<<Interface>> +IexecHubV3Interface +contracts/interfaces/IexecHubV3Interface.sol + +External: +     viewScore(worker: address): uint256 + + -26->51 +26->50 - + -54 +53 <<Struct>> AppOrder @@ -285,15 +295,15 @@ salt: bytes32 sign: bytes - + -26->54 +26->53 - + -55 +54 <<Struct>> DatasetOrder @@ -309,15 +319,15 @@ salt: bytes32 sign: bytes - + -26->55 +26->54 - + -56 +55 <<Struct>> WorkerpoolOrder @@ -335,15 +345,15 @@ salt: bytes32 sign: bytes - + -26->56 +26->55 - + -57 +56 <<Struct>> RequestOrder @@ -366,61 +376,61 @@ salt: bytes32 sign: bytes - + -26->57 +26->56 - + -36 - -<<Library>> -EscrowLib -contracts/libs/EscrowLib.sol - -Internal: -    lock(account: address, value: uint256) -    unlock(account: address, value: uint256) -    reward(account: address, value: uint256, ref: bytes32) -    seize(account: address, value: uint256, ref: bytes32) -    rewardAndLock(account: address, value: uint256, ref: bytes32) -Public: -    <<event>> Reward(owner: address, amount: uint256, ref: bytes32) -    <<event>> Seize(owner: address, amount: uint256, ref: bytes32) -    <<event>> Lock(owner: address, amount: uint256) -    <<event>> Unlock(owner: address, amount: uint256) - - +35 + +<<Library>> +EscrowLib +contracts/libs/EscrowLib.sol + +Internal: +    lock(account: address, value: uint256) +    unlock(account: address, value: uint256) +    reward(account: address, value: uint256, ref: bytes32) +    seize(account: address, value: uint256, ref: bytes32) +    rewardAndLock(account: address, value: uint256, ref: bytes32) +Public: +    <<event>> Reward(owner: address, amount: uint256, ref: bytes32) +    <<event>> Seize(owner: address, amount: uint256, ref: bytes32) +    <<event>> Lock(owner: address, amount: uint256) +    <<event>> Unlock(owner: address, amount: uint256) + + -36->62 - - +35->61 + + - + -36->63 - - +35->62 + + - + -36->64 - - +35->63 + + - + -37 - -<<Library>> -IexecLibCore_v5 -contracts/libs/IexecLibCore_v5.sol +36 + +<<Library>> +IexecLibCore_v5 +contracts/libs/IexecLibCore_v5.sol - + -53 +52 <<Struct>> EIP712Domain @@ -431,39 +441,39 @@ chainId: uint256 verifyingContract: address - + -51->53 +50->52 - + -51->54 +50->53 - + -51->55 +50->54 - + -51->56 +50->55 - + -51->57 +50->56 - + -58 +57 <<Struct>> AppOrderOperation @@ -473,15 +483,15 @@ operation: OrderOperationEnum sign: bytes - + -51->58 +50->57 - + -59 +58 <<Struct>> DatasetOrderOperation @@ -491,15 +501,15 @@ operation: OrderOperationEnum sign: bytes - + -51->59 +50->58 - + -60 +59 <<Struct>> WorkerpoolOrderOperation @@ -509,15 +519,15 @@ operation: OrderOperationEnum sign: bytes - + -51->60 +50->59 - + -61 +60 <<Struct>> RequestOrderOperation @@ -527,15 +537,15 @@ operation: OrderOperationEnum sign: bytes - + -51->61 +50->60 - + -52 +51 <<Enum>> OrderOperationEnum @@ -544,166 +554,166 @@ SIGN: 0 CLOSE: 1 - + -52->51 +51->50 - + -53->51 +52->50 - + -54->51 +53->50 - + -55->51 +54->50 - + -56->51 +55->50 - + -57->51 +56->50 - + -58->51 +57->50 - + -58->52 +57->51 - + -58->54 +57->53 - + -59->51 +58->50 - + -59->52 +58->51 - + -59->55 +58->54 - + -60->51 +59->50 - + -60->52 +59->51 - + -60->56 +59->55 - + -61->51 +60->50 - + -61->52 +60->51 - + -61->57 +60->56 - + -62->63 - - +61->62 + + - + -63->24 - - +62->24 + + - + -63->37 - - +62->36 + + - + -63->62 - - +62->61 + + - + -65 - -<<Interface>> -IRegistry -contracts/registries/IRegistry.sol - -External: -     isRegistered(_entry: address): bool - - +64 + +<<Interface>> +IRegistry +contracts/registries/IRegistry.sol + +External: +     isRegistered(_entry: address): bool + + -63->65 - - +62->64 + + - + -64->62 - - +63->61 + + - + -64->63 - - +63->62 + + diff --git a/docs/uml/class-uml-IexecPocoBoostFacet.svg b/docs/uml/class-uml-IexecPocoBoostFacet.svg index 8449a4632..e5cf871b5 100644 --- a/docs/uml/class-uml-IexecPocoBoostFacet.svg +++ b/docs/uml/class-uml-IexecPocoBoostFacet.svg @@ -4,875 +4,864 @@ - - + + UmlClassDiagram - + 3 - -<<Abstract>> -FacetBase -contracts/abstract/FacetBase.sol - -Internal: -    owner(): address -    _msgSender(): address -Public: -    <<modifier>> onlyOwner() - - + +<<Abstract>> +FacetBase +contracts/abstract/FacetBase.sol + +Internal: +   CONTRIBUTION_DEADLINE_RATIO: uint256 +   REVEAL_DEADLINE_RATIO: uint256 +   FINAL_DEADLINE_RATIO: uint256 +   WORKERPOOL_STAKE_RATIO: uint256 +   KITTY_RATIO: uint256 +   KITTY_MIN: uint256 +   KITTY_ADDRESS: address +   GROUPMEMBER_PURPOSE: uint256 + +Internal: +    owner(): address +    _msgSender(): address +Public: +    <<modifier>> onlyOwner() + + -69 - -<<Interface>> -IOracleConsumer -contracts/external/interfaces/IOracleConsumer.sol - -External: -     receiveResult(taskId: bytes32, resultsCallback: bytes) +68 + +<<Interface>> +IOracleConsumer +contracts/external/interfaces/IOracleConsumer.sol + +External: +     receiveResult(taskId: bytes32, resultsCallback: bytes) 15 - -IexecPocoBoostFacet -contracts/facets/IexecPocoBoostFacet.sol - -Private: -    _matchOrdersBoost(appOrder: IexecLibOrders_v5.AppOrder, datasetOrder: IexecLibOrders_v5.DatasetOrder, workerpoolOrder: IexecLibOrders_v5.WorkerpoolOrder, requestOrder: IexecLibOrders_v5.RequestOrder, sponsor: address): bytes32 -    requireTaskExistsAndUnset(taskStatus: IexecLibCore_v5.TaskStatusEnum, taskIndex: uint256, botSize: uint16) -External: -    matchOrdersBoost(appOrder: IexecLibOrders_v5.AppOrder, datasetOrder: IexecLibOrders_v5.DatasetOrder, workerpoolOrder: IexecLibOrders_v5.WorkerpoolOrder, requestOrder: IexecLibOrders_v5.RequestOrder): bytes32 -    sponsorMatchOrdersBoost(appOrder: IexecLibOrders_v5.AppOrder, datasetOrder: IexecLibOrders_v5.DatasetOrder, workerpoolOrder: IexecLibOrders_v5.WorkerpoolOrder, requestOrder: IexecLibOrders_v5.RequestOrder): bytes32 -    pushResultBoost(dealId: bytes32, index: uint256, results: bytes, resultsCallback: bytes, authorizationSign: bytes, enclaveChallenge: address, enclaveSign: bytes) -    claimBoost(dealId: bytes32, index: uint256) + +IexecPocoBoostFacet +contracts/facets/IexecPocoBoostFacet.sol + +Private: +    _matchOrdersBoost(appOrder: IexecLibOrders_v5.AppOrder, datasetOrder: IexecLibOrders_v5.DatasetOrder, workerpoolOrder: IexecLibOrders_v5.WorkerpoolOrder, requestOrder: IexecLibOrders_v5.RequestOrder, sponsor: address): bytes32 +    requireTaskExistsAndUnset(taskStatus: IexecLibCore_v5.TaskStatusEnum, taskIndex: uint256, botSize: uint16) +External: +    matchOrdersBoost(appOrder: IexecLibOrders_v5.AppOrder, datasetOrder: IexecLibOrders_v5.DatasetOrder, workerpoolOrder: IexecLibOrders_v5.WorkerpoolOrder, requestOrder: IexecLibOrders_v5.RequestOrder): bytes32 +    sponsorMatchOrdersBoost(appOrder: IexecLibOrders_v5.AppOrder, datasetOrder: IexecLibOrders_v5.DatasetOrder, workerpoolOrder: IexecLibOrders_v5.WorkerpoolOrder, requestOrder: IexecLibOrders_v5.RequestOrder): bytes32 +    pushResultBoost(dealId: bytes32, index: uint256, results: bytes, resultsCallback: bytes, authorizationSign: bytes, enclaveChallenge: address, enclaveSign: bytes) +    claimBoost(dealId: bytes32, index: uint256) 15->3 - - + + - - -15->69 - - + + +15->68 + + 30 - -<<Interface>> -IexecPocoBoost -contracts/interfaces/IexecPocoBoost.sol - -External: -     matchOrdersBoost(appOrder: IexecLibOrders_v5.AppOrder, datasetOrder: IexecLibOrders_v5.DatasetOrder, workerpoolOrder: IexecLibOrders_v5.WorkerpoolOrder, requestOrder: IexecLibOrders_v5.RequestOrder): bytes32 -     sponsorMatchOrdersBoost(appOrder: IexecLibOrders_v5.AppOrder, datasetOrder: IexecLibOrders_v5.DatasetOrder, workerpoolOrder: IexecLibOrders_v5.WorkerpoolOrder, requestOrder: IexecLibOrders_v5.RequestOrder): bytes32 -     pushResultBoost(dealId: bytes32, index: uint256, results: bytes, resultsCallback: bytes, authorizationSign: bytes, enclaveChallenge: address, enclaveSign: bytes) -     claimBoost(dealId: bytes32, index: uint256) -Public: -    <<event>> SchedulerNoticeBoost(workerpool: address, dealId: bytes32, app: address, dataset: address, category: uint256, tag: bytes32, params: string, beneficiary: address) -    <<event>> OrdersMatched(dealid: bytes32, appHash: bytes32, datasetHash: bytes32, workerpoolHash: bytes32, requestHash: bytes32, volume: uint256) -    <<event>> ResultPushedBoost(dealId: bytes32, index: uint256, results: bytes) -    <<event>> TaskClaimed(taskid: bytes32) -    <<event>> DealSponsoredBoost(dealId: bytes32, sponsor: address) + +<<Interface>> +IexecPocoBoost +contracts/interfaces/IexecPocoBoost.sol + +External: +     matchOrdersBoost(appOrder: IexecLibOrders_v5.AppOrder, datasetOrder: IexecLibOrders_v5.DatasetOrder, workerpoolOrder: IexecLibOrders_v5.WorkerpoolOrder, requestOrder: IexecLibOrders_v5.RequestOrder): bytes32 +     sponsorMatchOrdersBoost(appOrder: IexecLibOrders_v5.AppOrder, datasetOrder: IexecLibOrders_v5.DatasetOrder, workerpoolOrder: IexecLibOrders_v5.WorkerpoolOrder, requestOrder: IexecLibOrders_v5.RequestOrder): bytes32 +     pushResultBoost(dealId: bytes32, index: uint256, results: bytes, resultsCallback: bytes, authorizationSign: bytes, enclaveChallenge: address, enclaveSign: bytes) +     claimBoost(dealId: bytes32, index: uint256) +Public: +    <<event>> SchedulerNoticeBoost(workerpool: address, dealId: bytes32, app: address, dataset: address, category: uint256, tag: bytes32, params: string, beneficiary: address) +    <<event>> OrdersMatched(dealid: bytes32, appHash: bytes32, datasetHash: bytes32, workerpoolHash: bytes32, requestHash: bytes32, volume: uint256) +    <<event>> ResultPushedBoost(dealId: bytes32, index: uint256, results: bytes) +    <<event>> TaskClaimed(taskid: bytes32) +    <<event>> DealSponsoredBoost(dealId: bytes32, sponsor: address) 15->30 - - + + 34 - -<<Library>> -CommonLib -contracts/libs/CommonLib.sol - -Internal: -    toTypedDataHash(structHash: bytes32): bytes32 -    verifySignatureOfEthSignedMessage(account: address, message: bytes, signature: bytes): bool -    verifySignature(account: address, messageHash: bytes32, signature: bytes): bool -    verifyPresignature(account: address, messageHash: bytes32): bool -    verifySignatureOrPresignature(account: address, messageHash: bytes32, signature: bytes): bool -    isAccountAuthorizedByRestriction(restriction: address, account: address): bool -    computeDealVolume(appOrderVolume: uint256, appOrderTypedDataHash: bytes32, hasDataset: bool, datasetOrderVolume: uint256, datasetOrderTypedDataHash: bytes32, workerpoolOrderVolume: uint256, workerpoolOrderTypedDataHash: bytes32, requestOrderVolume: uint256, requestOrderTypedDataHash: bytes32): uint256 + +<<Library>> +CommonLib +contracts/libs/CommonLib.sol + +Private: +   GROUPMEMBER_PURPOSE: uint256 + +Internal: +    toTypedDataHash(structHash: bytes32): bytes32 +    verifySignatureOfEthSignedMessage(account: address, message: bytes, signature: bytes): bool +    verifySignature(account: address, messageHash: bytes32, signature: bytes): bool +    verifyPresignature(account: address, messageHash: bytes32): bool +    verifySignatureOrPresignature(account: address, messageHash: bytes32, signature: bytes): bool +    isAccountAuthorizedByRestriction(restriction: address, account: address): bool +    computeDealVolume(appOrderVolume: uint256, appOrderTypedDataHash: bytes32, hasDataset: bool, datasetOrderVolume: uint256, datasetOrderTypedDataHash: bytes32, workerpoolOrderVolume: uint256, workerpoolOrderTypedDataHash: bytes32, requestOrderVolume: uint256, requestOrderTypedDataHash: bytes32): uint256 15->34 - - + + 35 - -<<Library>> -Constants -contracts/libs/Constants.sol - -Internal: -   CONTRIBUTION_DEADLINE_RATIO: uint256 -   REVEAL_DEADLINE_RATIO: uint256 -   FINAL_DEADLINE_RATIO: uint256 -   WORKERPOOL_STAKE_RATIO: uint256 -   KITTY_RATIO: uint256 -   KITTY_MIN: uint256 -   KITTY_ADDRESS: address -   GROUPMEMBER_PURPOSE: uint256 + +<<Library>> +EscrowLib +contracts/libs/EscrowLib.sol + +Internal: +    lock(account: address, value: uint256) +    unlock(account: address, value: uint256) +    reward(account: address, value: uint256, ref: bytes32) +    seize(account: address, value: uint256, ref: bytes32) +    rewardAndLock(account: address, value: uint256, ref: bytes32) +Public: +    <<event>> Reward(owner: address, amount: uint256, ref: bytes32) +    <<event>> Seize(owner: address, amount: uint256, ref: bytes32) +    <<event>> Lock(owner: address, amount: uint256) +    <<event>> Unlock(owner: address, amount: uint256) 15->35 - - + + 36 - -<<Library>> -EscrowLib -contracts/libs/EscrowLib.sol - -Internal: -    lock(account: address, value: uint256) -    unlock(account: address, value: uint256) -    reward(account: address, value: uint256, ref: bytes32) -    seize(account: address, value: uint256, ref: bytes32) -    rewardAndLock(account: address, value: uint256, ref: bytes32) -Public: -    <<event>> Reward(owner: address, amount: uint256, ref: bytes32) -    <<event>> Seize(owner: address, amount: uint256, ref: bytes32) -    <<event>> Lock(owner: address, amount: uint256) -    <<event>> Unlock(owner: address, amount: uint256) + +<<Library>> +IexecLibCore_v5 +contracts/libs/IexecLibCore_v5.sol - + 15->36 - - + + - + -37 - -<<Library>> -IexecLibCore_v5 -contracts/libs/IexecLibCore_v5.sol - - - -15->37 - - +44 + +<<Struct>> +DealBoost +contracts/libs/IexecLibCore_v5.sol + +appOwner: address +appPrice: uint96 +datasetOwner: address +datasetPrice: uint96 +workerpoolOwner: address +workerpoolPrice: uint96 +requester: address +workerReward: uint96 +callback: address +deadline: uint40 +botFirst: uint16 +botSize: uint16 +shortTag: bytes3 +sponsor: address + + + +15->44 + + 45 - -<<Struct>> -DealBoost -contracts/libs/IexecLibCore_v5.sol - -appOwner: address -appPrice: uint96 -datasetOwner: address -datasetPrice: uint96 -workerpoolOwner: address -workerpoolPrice: uint96 -requester: address -workerReward: uint96 -callback: address -deadline: uint40 -botFirst: uint16 -botSize: uint16 -shortTag: bytes3 -sponsor: address + +<<Enum>> +TaskStatusEnum +contracts/libs/IexecLibCore_v5.sol + +UNSET: 0 +ACTIVE: 1 +REVEALING: 2 +COMPLETED: 3 +FAILED: 4 - + 15->45 - - + + 46 - -<<Enum>> -TaskStatusEnum -contracts/libs/IexecLibCore_v5.sol - -UNSET: 0 -ACTIVE: 1 -REVEALING: 2 -COMPLETED: 3 -FAILED: 4 + +<<Struct>> +Task +contracts/libs/IexecLibCore_v5.sol + +status: TaskStatusEnum +dealid: bytes32 +idx: uint256 +timeref: uint256 +contributionDeadline: uint256 +revealDeadline: uint256 +finalDeadline: uint256 +consensusValue: bytes32 +revealCounter: uint256 +winnerCounter: uint256 +contributors: address[] +resultDigest: bytes32 +results: bytes +resultsTimestamp: uint256 +resultsCallback: bytes - + 15->46 - - + + - + -47 - -<<Struct>> -Task -contracts/libs/IexecLibCore_v5.sol - -status: TaskStatusEnum -dealid: bytes32 -idx: uint256 -timeref: uint256 -contributionDeadline: uint256 -revealDeadline: uint256 -finalDeadline: uint256 -consensusValue: bytes32 -revealCounter: uint256 -winnerCounter: uint256 -contributors: address[] -resultDigest: bytes32 -results: bytes -resultsTimestamp: uint256 -resultsCallback: bytes - - - -15->47 - - - - - -51 - -<<Library>> -IexecLibOrders_v5 -contracts/libs/IexecLibOrders_v5.sol - -Public: -   EIP712DOMAIN_TYPEHASH: bytes32 -   APPORDER_TYPEHASH: bytes32 -   DATASETORDER_TYPEHASH: bytes32 -   WORKERPOOLORDER_TYPEHASH: bytes32 -   REQUESTORDER_TYPEHASH: bytes32 -   APPORDEROPERATION_TYPEHASH: bytes32 -   DATASETORDEROPERATION_TYPEHASH: bytes32 -   WORKERPOOLORDEROPERATION_TYPEHASH: bytes32 -   REQUESTORDEROPERATION_TYPEHASH: bytes32 - -Public: -    hash(_domain: EIP712Domain): (domainhash: bytes32) -    hash(_apporder: AppOrder): (apphash: bytes32) -    hash(_datasetorder: DatasetOrder): (datasethash: bytes32) -    hash(_workerpoolorder: WorkerpoolOrder): (workerpoolhash: bytes32) -    hash(_requestorder: RequestOrder): (requesthash: bytes32) -    hash(_apporderoperation: AppOrderOperation): bytes32 -    hash(_datasetorderoperation: DatasetOrderOperation): bytes32 -    hash(_workerpoolorderoperation: WorkerpoolOrderOperation): bytes32 -    hash(_requestorderoperation: RequestOrderOperation): bytes32 - - +50 + +<<Library>> +IexecLibOrders_v5 +contracts/libs/IexecLibOrders_v5.sol + +Public: +   EIP712DOMAIN_TYPEHASH: bytes32 +   APPORDER_TYPEHASH: bytes32 +   DATASETORDER_TYPEHASH: bytes32 +   WORKERPOOLORDER_TYPEHASH: bytes32 +   REQUESTORDER_TYPEHASH: bytes32 +   APPORDEROPERATION_TYPEHASH: bytes32 +   DATASETORDEROPERATION_TYPEHASH: bytes32 +   WORKERPOOLORDEROPERATION_TYPEHASH: bytes32 +   REQUESTORDEROPERATION_TYPEHASH: bytes32 + +Public: +    hash(_domain: EIP712Domain): (domainhash: bytes32) +    hash(_apporder: AppOrder): (apphash: bytes32) +    hash(_datasetorder: DatasetOrder): (datasethash: bytes32) +    hash(_workerpoolorder: WorkerpoolOrder): (workerpoolhash: bytes32) +    hash(_requestorder: RequestOrder): (requesthash: bytes32) +    hash(_apporderoperation: AppOrderOperation): bytes32 +    hash(_datasetorderoperation: DatasetOrderOperation): bytes32 +    hash(_workerpoolorderoperation: WorkerpoolOrderOperation): bytes32 +    hash(_requestorderoperation: RequestOrderOperation): bytes32 + + -15->51 - - +15->50 + + + + + +53 + +<<Struct>> +AppOrder +contracts/libs/IexecLibOrders_v5.sol + +app: address +appprice: uint256 +volume: uint256 +tag: bytes32 +datasetrestrict: address +workerpoolrestrict: address +requesterrestrict: address +salt: bytes32 +sign: bytes + + + +15->53 + + 54 - -<<Struct>> -AppOrder -contracts/libs/IexecLibOrders_v5.sol - -app: address -appprice: uint256 -volume: uint256 -tag: bytes32 -datasetrestrict: address -workerpoolrestrict: address -requesterrestrict: address -salt: bytes32 -sign: bytes + +<<Struct>> +DatasetOrder +contracts/libs/IexecLibOrders_v5.sol + +dataset: address +datasetprice: uint256 +volume: uint256 +tag: bytes32 +apprestrict: address +workerpoolrestrict: address +requesterrestrict: address +salt: bytes32 +sign: bytes - + 15->54 - - + + 55 - -<<Struct>> -DatasetOrder -contracts/libs/IexecLibOrders_v5.sol - -dataset: address -datasetprice: uint256 -volume: uint256 -tag: bytes32 -apprestrict: address -workerpoolrestrict: address -requesterrestrict: address -salt: bytes32 -sign: bytes + +<<Struct>> +WorkerpoolOrder +contracts/libs/IexecLibOrders_v5.sol + +workerpool: address +workerpoolprice: uint256 +volume: uint256 +tag: bytes32 +category: uint256 +trust: uint256 +apprestrict: address +datasetrestrict: address +requesterrestrict: address +salt: bytes32 +sign: bytes - + 15->55 - - + + 56 - -<<Struct>> -WorkerpoolOrder -contracts/libs/IexecLibOrders_v5.sol - -workerpool: address -workerpoolprice: uint256 -volume: uint256 -tag: bytes32 -category: uint256 -trust: uint256 -apprestrict: address -datasetrestrict: address -requesterrestrict: address -salt: bytes32 -sign: bytes + +<<Struct>> +RequestOrder +contracts/libs/IexecLibOrders_v5.sol + +app: address +appmaxprice: uint256 +dataset: address +datasetmaxprice: uint256 +workerpool: address +workerpoolmaxprice: uint256 +requester: address +volume: uint256 +tag: bytes32 +category: uint256 +trust: uint256 +beneficiary: address +callback: address +params: string +salt: bytes32 +sign: bytes - + 15->56 - - + + - - -57 - -<<Struct>> -RequestOrder -contracts/libs/IexecLibOrders_v5.sol - -app: address -appmaxprice: uint256 -dataset: address -datasetmaxprice: uint256 -workerpool: address -workerpoolmaxprice: uint256 -requester: address -volume: uint256 -tag: bytes32 -category: uint256 -trust: uint256 -beneficiary: address -callback: address -params: string -salt: bytes32 -sign: bytes - - - -15->57 - - + + +61 + +<<Library>> +PocoStorageLib +contracts/libs/PocoStorageLib.sol + +Private: +   POCO_STORAGE_LOCATION: bytes32 + +Internal: +    getPocoStorage(): ($: PocoStorage) + + + +15->61 + + 62 - -<<Library>> -PocoStorageLib -contracts/libs/PocoStorageLib.sol - -Private: -   POCO_STORAGE_LOCATION: bytes32 - -Internal: -    getPocoStorage(): ($: PocoStorage) + +<<Struct>> +PocoStorage +contracts/libs/PocoStorageLib.sol + +m_appregistry: IRegistry +m_datasetregistry: IRegistry +m_workerpoolregistry: IRegistry +m_baseToken: IERC20 +m_name: string +m_symbol: string +m_decimals: uint8 +m_totalSupply: uint256 +m_balances: mapping(address=>uint256) +m_frozens: mapping(address=>uint256) +m_allowances: mapping(address=>mapping(address=>uint256)) +m_eip712DomainSeparator: bytes32 +m_presigned: mapping(bytes32=>address) +m_consumed: mapping(bytes32=>uint256) +m_deals: mapping(bytes32=>IexecLibCore_v5.Deal) +m_tasks: mapping(bytes32=>IexecLibCore_v5.Task) +m_consensus: mapping(bytes32=>IexecLibCore_v5.Consensus) +m_contributions: mapping(bytes32=>mapping(address=>IexecLibCore_v5.Contribution)) +m_workerScores: mapping(address=>uint256) +m_teebroker: address +m_callbackgas: uint256 +m_categories: IexecLibCore_v5.Category[] +m_v3_iexecHub: IexecHubV3Interface +m_v3_scoreImported: mapping(address=>bool) +m_dealsBoost: mapping(bytes32=>IexecLibCore_v5.DealBoost) - + 15->62 - - + + - - -63 - -<<Struct>> -PocoStorage -contracts/libs/PocoStorageLib.sol - -m_appregistry: IRegistry -m_datasetregistry: IRegistry -m_workerpoolregistry: IRegistry -m_baseToken: IERC20 -m_name: string -m_symbol: string -m_decimals: uint8 -m_totalSupply: uint256 -m_balances: mapping(address=>uint256) -m_frozens: mapping(address=>uint256) -m_allowances: mapping(address=>mapping(address=>uint256)) -m_eip712DomainSeparator: bytes32 -m_presigned: mapping(bytes32=>address) -m_consumed: mapping(bytes32=>uint256) -m_deals: mapping(bytes32=>IexecLibCore_v5.Deal) -m_tasks: mapping(bytes32=>IexecLibCore_v5.Task) -m_consensus: mapping(bytes32=>IexecLibCore_v5.Consensus) -m_contributions: mapping(bytes32=>mapping(address=>IexecLibCore_v5.Contribution)) -m_workerScores: mapping(address=>uint256) -m_teebroker: address -m_callbackgas: uint256 -m_categories: IexecLibCore_v5.Category[] -m_v3_iexecHub: IexecHubV3Interface -m_v3_scoreImported: mapping(address=>bool) -m_dealsBoost: mapping(bytes32=>IexecLibCore_v5.DealBoost) - - - -15->63 - - - - - -80 - -<<Interface>> -IWorkerpool -contracts/registries/workerpools/IWorkerpool.v8.sol - -External: -     owner(): address -     m_workerpoolDescription(): string -     m_schedulerRewardRatioPolicy(): uint256 -     m_workerStakeRatioPolicy(): uint256 - - + + +79 + +<<Interface>> +IWorkerpool +contracts/registries/workerpools/IWorkerpool.v8.sol + +External: +     owner(): address +     m_workerpoolDescription(): string +     m_schedulerRewardRatioPolicy(): uint256 +     m_workerStakeRatioPolicy(): uint256 + + -15->80 - - +15->79 + + 24 - -<<Interface>> -IexecHubV3Interface -contracts/interfaces/IexecHubV3Interface.sol - -External: -     viewScore(worker: address): uint256 - - + +<<Interface>> +IexecHubV3Interface +contracts/interfaces/IexecHubV3Interface.sol + +External: +     viewScore(worker: address): uint256 + + + +30->50 + + + + -30->51 - - +30->53 + + 30->54 - - + + 30->55 - - + + 30->56 - - + + - + -30->57 - - +34->61 + + 34->62 - - + + - + -34->63 - - +35->61 + + - + -36->62 - - +35->62 + + - + + +63 + +<<Library>> +StakedRlcLib +contracts/libs/StakedRlcLib.sol + +Internal: +    transfer(from: address, to: address, value: uint256) +    mint(account: address, amount: uint256) +    burn(account: address, amount: uint256) +    approve(owner: address, spender: address, amount: uint256) +Public: +    <<event>> Transfer(from: address, to: address, value: uint256) +    <<event>> Approval(owner: address, spender: address, value: uint256) + + -36->63 - - +35->63 + + - - -64 - -<<Library>> -StakedRlcLib -contracts/libs/StakedRlcLib.sol - -Internal: -    transfer(from: address, to: address, value: uint256) -    mint(account: address, amount: uint256) -    burn(account: address, amount: uint256) -    approve(owner: address, spender: address, amount: uint256) -Public: -    <<event>> Transfer(from: address, to: address, value: uint256) -    <<event>> Approval(owner: address, spender: address, value: uint256) - - + + +44->36 + + + + -36->64 - - +45->36 + + - + -45->37 - - +46->36 + + - - -46->37 - - - - + -47->37 - - +46->45 + + - - -47->46 - - + + +52 + +<<Struct>> +EIP712Domain +contracts/libs/IexecLibOrders_v5.sol + +name: string +version: string +chainId: uint256 +verifyingContract: address + + + +50->52 + + - - -53 - -<<Struct>> -EIP712Domain -contracts/libs/IexecLibOrders_v5.sol - -name: string -version: string -chainId: uint256 -verifyingContract: address - - + -51->53 - - +50->53 + + - + -51->54 - - +50->54 + + - + -51->55 - - +50->55 + + - + -51->56 - - +50->56 + + - + + +57 + +<<Struct>> +AppOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: AppOrder +operation: OrderOperationEnum +sign: bytes + + -51->57 - - +50->57 + + 58 - -<<Struct>> -AppOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: AppOrder -operation: OrderOperationEnum -sign: bytes - - + +<<Struct>> +DatasetOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: DatasetOrder +operation: OrderOperationEnum +sign: bytes + + -51->58 - - +50->58 + + 59 - -<<Struct>> -DatasetOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: DatasetOrder -operation: OrderOperationEnum -sign: bytes - - + +<<Struct>> +WorkerpoolOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: WorkerpoolOrder +operation: OrderOperationEnum +sign: bytes + + -51->59 - - +50->59 + + 60 - -<<Struct>> -WorkerpoolOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: WorkerpoolOrder -operation: OrderOperationEnum -sign: bytes - - + +<<Struct>> +RequestOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: RequestOrder +operation: OrderOperationEnum +sign: bytes + + -51->60 - - +50->60 + + - - -61 - -<<Struct>> -RequestOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: RequestOrder -operation: OrderOperationEnum -sign: bytes - - - -51->61 - - + + +51 + +<<Enum>> +OrderOperationEnum +contracts/libs/IexecLibOrders_v5.sol + +SIGN: 0 +CLOSE: 1 + + + +51->50 + + - - -52 - -<<Enum>> -OrderOperationEnum -contracts/libs/IexecLibOrders_v5.sol - -SIGN: 0 -CLOSE: 1 - - + -52->51 - - +52->50 + + - + -53->51 - - +53->50 + + - + -54->51 - - +54->50 + + - + -55->51 - - +55->50 + + - + -56->51 - - +56->50 + + - + +57->50 + + + + + 57->51 - - + + - + + +57->53 + + + + -58->51 - - +58->50 + + - - -58->52 - - + + +58->51 + + - + 58->54 - - + + - + -59->51 - - +59->50 + + - - -59->52 - - + + +59->51 + + - + 59->55 - - + + - + -60->51 - - +60->50 + + - - -60->52 - - + + +60->51 + + - + 60->56 - - + + - - -61->51 - - + + +61->62 + + - - -61->52 - - + + +62->24 + + - - -61->57 - - + + +62->36 + + + + + +62->61 + + - + + +64 + +<<Interface>> +IRegistry +contracts/registries/IRegistry.sol + +External: +     isRegistered(_entry: address): bool + + -62->63 - - +62->64 + + - + -63->24 - - - - - -63->37 - - +63->61 + + - -63->62 - - - - - -65 - -<<Interface>> -IRegistry -contracts/registries/IRegistry.sol - -External: -     isRegistered(_entry: address): bool - - - -63->65 - - - - -64->62 - - - - - -64->63 - - +63->62 + + diff --git a/docs/uml/class-uml-IexecPocoFacets.svg b/docs/uml/class-uml-IexecPocoFacets.svg index 5c0d73943..bca055427 100644 --- a/docs/uml/class-uml-IexecPocoFacets.svg +++ b/docs/uml/class-uml-IexecPocoFacets.svg @@ -4,1103 +4,1086 @@ - + UmlClassDiagram - + 3 - -<<Abstract>> -FacetBase -contracts/abstract/FacetBase.sol - -Internal: -    owner(): address -    _msgSender(): address -Public: -    <<modifier>> onlyOwner() + +<<Abstract>> +FacetBase +contracts/abstract/FacetBase.sol + +Internal: +   CONTRIBUTION_DEADLINE_RATIO: uint256 +   REVEAL_DEADLINE_RATIO: uint256 +   FINAL_DEADLINE_RATIO: uint256 +   WORKERPOOL_STAKE_RATIO: uint256 +   KITTY_RATIO: uint256 +   KITTY_MIN: uint256 +   KITTY_ADDRESS: address +   GROUPMEMBER_PURPOSE: uint256 + +Internal: +    owner(): address +    _msgSender(): address +Public: +    <<modifier>> onlyOwner() 10 - -<<Struct>> -Matching -contracts/facets/IexecPoco1Facet.sol - -apporderHash: bytes32 -appOwner: address -datasetorderHash: bytes32 -datasetOwner: address -workerpoolorderHash: bytes32 -workerpoolOwner: address -requestorderHash: bytes32 -hasDataset: bool + +<<Struct>> +Matching +contracts/facets/IexecPoco1Facet.sol + +apporderHash: bytes32 +appOwner: address +datasetorderHash: bytes32 +datasetOwner: address +workerpoolorderHash: bytes32 +workerpoolOwner: address +requestorderHash: bytes32 +hasDataset: bool 11 - -IexecPoco1Facet -contracts/facets/IexecPoco1Facet.sol - -Private: -    _matchOrders(_apporder: IexecLibOrders_v5.AppOrder, _datasetorder: IexecLibOrders_v5.DatasetOrder, _workerpoolorder: IexecLibOrders_v5.WorkerpoolOrder, _requestorder: IexecLibOrders_v5.RequestOrder, _sponsor: address): bytes32 -    _ignoreTeeFramework(tag: bytes32): bytes32 -External: -    verifySignature(_identity: address, _hash: bytes32, _signature: bytes): bool -    verifyPresignature(_identity: address, _hash: bytes32): bool -    verifyPresignatureOrSignature(_identity: address, _hash: bytes32, _signature: bytes): bool -    assertDatasetDealCompatibility(datasetOrder: IexecLibOrders_v5.DatasetOrder, dealId: bytes32) -    matchOrders(_apporder: IexecLibOrders_v5.AppOrder, _datasetorder: IexecLibOrders_v5.DatasetOrder, _workerpoolorder: IexecLibOrders_v5.WorkerpoolOrder, _requestorder: IexecLibOrders_v5.RequestOrder): bytes32 -    sponsorMatchOrders(_apporder: IexecLibOrders_v5.AppOrder, _datasetorder: IexecLibOrders_v5.DatasetOrder, _workerpoolorder: IexecLibOrders_v5.WorkerpoolOrder, _requestorder: IexecLibOrders_v5.RequestOrder): bytes32 + +IexecPoco1Facet +contracts/facets/IexecPoco1Facet.sol + +Private: +    _matchOrders(_apporder: IexecLibOrders_v5.AppOrder, _datasetorder: IexecLibOrders_v5.DatasetOrder, _workerpoolorder: IexecLibOrders_v5.WorkerpoolOrder, _requestorder: IexecLibOrders_v5.RequestOrder, _sponsor: address): bytes32 +    _ignoreTeeFramework(tag: bytes32): bytes32 +External: +    verifySignature(_identity: address, _hash: bytes32, _signature: bytes): bool +    verifyPresignature(_identity: address, _hash: bytes32): bool +    verifyPresignatureOrSignature(_identity: address, _hash: bytes32, _signature: bytes): bool +    assertDatasetDealCompatibility(datasetOrder: IexecLibOrders_v5.DatasetOrder, dealId: bytes32) +    matchOrders(_apporder: IexecLibOrders_v5.AppOrder, _datasetorder: IexecLibOrders_v5.DatasetOrder, _workerpoolorder: IexecLibOrders_v5.WorkerpoolOrder, _requestorder: IexecLibOrders_v5.RequestOrder): bytes32 +    sponsorMatchOrders(_apporder: IexecLibOrders_v5.AppOrder, _datasetorder: IexecLibOrders_v5.DatasetOrder, _workerpoolorder: IexecLibOrders_v5.WorkerpoolOrder, _requestorder: IexecLibOrders_v5.RequestOrder): bytes32 11->3 - - + + 11->10 - - + + 26 - -<<Interface>> -IexecPoco1 -contracts/interfaces/IexecPoco1.sol - -External: -     verifySignature(address, bytes32, bytes): bool -     verifyPresignature(address, bytes32): bool -     verifyPresignatureOrSignature(address, bytes32, bytes): bool -     assertDatasetDealCompatibility(datasetOrder: IexecLibOrders_v5.DatasetOrder, dealId: bytes32) -     matchOrders(IexecLibOrders_v5.AppOrder, IexecLibOrders_v5.DatasetOrder, IexecLibOrders_v5.WorkerpoolOrder, IexecLibOrders_v5.RequestOrder): bytes32 -     sponsorMatchOrders(IexecLibOrders_v5.AppOrder, IexecLibOrders_v5.DatasetOrder, IexecLibOrders_v5.WorkerpoolOrder, IexecLibOrders_v5.RequestOrder): bytes32 -Public: -    <<event>> SchedulerNotice(workerpool: address, dealid: bytes32) -    <<event>> OrdersMatched(dealid: bytes32, appHash: bytes32, datasetHash: bytes32, workerpoolHash: bytes32, requestHash: bytes32, volume: uint256) -    <<event>> DealSponsored(dealId: bytes32, sponsor: address) + +<<Interface>> +IexecPoco1 +contracts/interfaces/IexecPoco1.sol + +External: +     verifySignature(address, bytes32, bytes): bool +     verifyPresignature(address, bytes32): bool +     verifyPresignatureOrSignature(address, bytes32, bytes): bool +     assertDatasetDealCompatibility(datasetOrder: IexecLibOrders_v5.DatasetOrder, dealId: bytes32) +     matchOrders(IexecLibOrders_v5.AppOrder, IexecLibOrders_v5.DatasetOrder, IexecLibOrders_v5.WorkerpoolOrder, IexecLibOrders_v5.RequestOrder): bytes32 +     sponsorMatchOrders(IexecLibOrders_v5.AppOrder, IexecLibOrders_v5.DatasetOrder, IexecLibOrders_v5.WorkerpoolOrder, IexecLibOrders_v5.RequestOrder): bytes32 +Public: +    <<event>> SchedulerNotice(workerpool: address, dealid: bytes32) +    <<event>> OrdersMatched(dealid: bytes32, appHash: bytes32, datasetHash: bytes32, workerpoolHash: bytes32, requestHash: bytes32, volume: uint256) +    <<event>> DealSponsored(dealId: bytes32, sponsor: address) 11->26 - - + + 27 - -<<Interface>> -IexecPoco1Errors -contracts/interfaces/IexecPoco1Errors.sol + +<<Interface>> +IexecPoco1Errors +contracts/interfaces/IexecPoco1Errors.sol 11->27 - - + + 34 - -<<Library>> -CommonLib -contracts/libs/CommonLib.sol - -Internal: -    toTypedDataHash(structHash: bytes32): bytes32 -    verifySignatureOfEthSignedMessage(account: address, message: bytes, signature: bytes): bool -    verifySignature(account: address, messageHash: bytes32, signature: bytes): bool -    verifyPresignature(account: address, messageHash: bytes32): bool -    verifySignatureOrPresignature(account: address, messageHash: bytes32, signature: bytes): bool -    isAccountAuthorizedByRestriction(restriction: address, account: address): bool -    computeDealVolume(appOrderVolume: uint256, appOrderTypedDataHash: bytes32, hasDataset: bool, datasetOrderVolume: uint256, datasetOrderTypedDataHash: bytes32, workerpoolOrderVolume: uint256, workerpoolOrderTypedDataHash: bytes32, requestOrderVolume: uint256, requestOrderTypedDataHash: bytes32): uint256 + +<<Library>> +CommonLib +contracts/libs/CommonLib.sol + +Private: +   GROUPMEMBER_PURPOSE: uint256 + +Internal: +    toTypedDataHash(structHash: bytes32): bytes32 +    verifySignatureOfEthSignedMessage(account: address, message: bytes, signature: bytes): bool +    verifySignature(account: address, messageHash: bytes32, signature: bytes): bool +    verifyPresignature(account: address, messageHash: bytes32): bool +    verifySignatureOrPresignature(account: address, messageHash: bytes32, signature: bytes): bool +    isAccountAuthorizedByRestriction(restriction: address, account: address): bool +    computeDealVolume(appOrderVolume: uint256, appOrderTypedDataHash: bytes32, hasDataset: bool, datasetOrderVolume: uint256, datasetOrderTypedDataHash: bytes32, workerpoolOrderVolume: uint256, workerpoolOrderTypedDataHash: bytes32, requestOrderVolume: uint256, requestOrderTypedDataHash: bytes32): uint256 11->34 - - + + 35 - -<<Library>> -Constants -contracts/libs/Constants.sol - -Internal: -   CONTRIBUTION_DEADLINE_RATIO: uint256 -   REVEAL_DEADLINE_RATIO: uint256 -   FINAL_DEADLINE_RATIO: uint256 -   WORKERPOOL_STAKE_RATIO: uint256 -   KITTY_RATIO: uint256 -   KITTY_MIN: uint256 -   KITTY_ADDRESS: address -   GROUPMEMBER_PURPOSE: uint256 + +<<Library>> +EscrowLib +contracts/libs/EscrowLib.sol + +Internal: +    lock(account: address, value: uint256) +    unlock(account: address, value: uint256) +    reward(account: address, value: uint256, ref: bytes32) +    seize(account: address, value: uint256, ref: bytes32) +    rewardAndLock(account: address, value: uint256, ref: bytes32) +Public: +    <<event>> Reward(owner: address, amount: uint256, ref: bytes32) +    <<event>> Seize(owner: address, amount: uint256, ref: bytes32) +    <<event>> Lock(owner: address, amount: uint256) +    <<event>> Unlock(owner: address, amount: uint256) - + 11->35 - - + + 36 - -<<Library>> -EscrowLib -contracts/libs/EscrowLib.sol - -Internal: -    lock(account: address, value: uint256) -    unlock(account: address, value: uint256) -    reward(account: address, value: uint256, ref: bytes32) -    seize(account: address, value: uint256, ref: bytes32) -    rewardAndLock(account: address, value: uint256, ref: bytes32) -Public: -    <<event>> Reward(owner: address, amount: uint256, ref: bytes32) -    <<event>> Seize(owner: address, amount: uint256, ref: bytes32) -    <<event>> Lock(owner: address, amount: uint256) -    <<event>> Unlock(owner: address, amount: uint256) + +<<Library>> +IexecLibCore_v5 +contracts/libs/IexecLibCore_v5.sol - -11->36 - - - - - -37 - -<<Library>> -IexecLibCore_v5 -contracts/libs/IexecLibCore_v5.sol - - -11->37 - - +11->36 + + - - -44 - -<<Struct>> -Deal -contracts/libs/IexecLibCore_v5.sol - -app: Resource -dataset: Resource -workerpool: Resource -trust: uint256 -category: uint256 -tag: bytes32 -requester: address -beneficiary: address -callback: address -params: string -startTime: uint256 -botFirst: uint256 -botSize: uint256 -workerStake: uint256 -schedulerRewardRatio: uint256 -sponsor: address - - + + +43 + +<<Struct>> +Deal +contracts/libs/IexecLibCore_v5.sol + +app: Resource +dataset: Resource +workerpool: Resource +trust: uint256 +category: uint256 +tag: bytes32 +requester: address +beneficiary: address +callback: address +params: string +startTime: uint256 +botFirst: uint256 +botSize: uint256 +workerStake: uint256 +schedulerRewardRatio: uint256 +sponsor: address + + -11->44 - - +11->43 + + - - -51 - -<<Library>> -IexecLibOrders_v5 -contracts/libs/IexecLibOrders_v5.sol - -Public: -   EIP712DOMAIN_TYPEHASH: bytes32 -   APPORDER_TYPEHASH: bytes32 -   DATASETORDER_TYPEHASH: bytes32 -   WORKERPOOLORDER_TYPEHASH: bytes32 -   REQUESTORDER_TYPEHASH: bytes32 -   APPORDEROPERATION_TYPEHASH: bytes32 -   DATASETORDEROPERATION_TYPEHASH: bytes32 -   WORKERPOOLORDEROPERATION_TYPEHASH: bytes32 -   REQUESTORDEROPERATION_TYPEHASH: bytes32 - -Public: -    hash(_domain: EIP712Domain): (domainhash: bytes32) -    hash(_apporder: AppOrder): (apphash: bytes32) -    hash(_datasetorder: DatasetOrder): (datasethash: bytes32) -    hash(_workerpoolorder: WorkerpoolOrder): (workerpoolhash: bytes32) -    hash(_requestorder: RequestOrder): (requesthash: bytes32) -    hash(_apporderoperation: AppOrderOperation): bytes32 -    hash(_datasetorderoperation: DatasetOrderOperation): bytes32 -    hash(_workerpoolorderoperation: WorkerpoolOrderOperation): bytes32 -    hash(_requestorderoperation: RequestOrderOperation): bytes32 - - + + +50 + +<<Library>> +IexecLibOrders_v5 +contracts/libs/IexecLibOrders_v5.sol + +Public: +   EIP712DOMAIN_TYPEHASH: bytes32 +   APPORDER_TYPEHASH: bytes32 +   DATASETORDER_TYPEHASH: bytes32 +   WORKERPOOLORDER_TYPEHASH: bytes32 +   REQUESTORDER_TYPEHASH: bytes32 +   APPORDEROPERATION_TYPEHASH: bytes32 +   DATASETORDEROPERATION_TYPEHASH: bytes32 +   WORKERPOOLORDEROPERATION_TYPEHASH: bytes32 +   REQUESTORDEROPERATION_TYPEHASH: bytes32 + +Public: +    hash(_domain: EIP712Domain): (domainhash: bytes32) +    hash(_apporder: AppOrder): (apphash: bytes32) +    hash(_datasetorder: DatasetOrder): (datasethash: bytes32) +    hash(_workerpoolorder: WorkerpoolOrder): (workerpoolhash: bytes32) +    hash(_requestorder: RequestOrder): (requesthash: bytes32) +    hash(_apporderoperation: AppOrderOperation): bytes32 +    hash(_datasetorderoperation: DatasetOrderOperation): bytes32 +    hash(_workerpoolorderoperation: WorkerpoolOrderOperation): bytes32 +    hash(_requestorderoperation: RequestOrderOperation): bytes32 + + -11->51 - - +11->50 + + + + + +53 + +<<Struct>> +AppOrder +contracts/libs/IexecLibOrders_v5.sol + +app: address +appprice: uint256 +volume: uint256 +tag: bytes32 +datasetrestrict: address +workerpoolrestrict: address +requesterrestrict: address +salt: bytes32 +sign: bytes + + + +11->53 + + 54 - -<<Struct>> -AppOrder -contracts/libs/IexecLibOrders_v5.sol - -app: address -appprice: uint256 -volume: uint256 -tag: bytes32 -datasetrestrict: address -workerpoolrestrict: address -requesterrestrict: address -salt: bytes32 -sign: bytes + +<<Struct>> +DatasetOrder +contracts/libs/IexecLibOrders_v5.sol + +dataset: address +datasetprice: uint256 +volume: uint256 +tag: bytes32 +apprestrict: address +workerpoolrestrict: address +requesterrestrict: address +salt: bytes32 +sign: bytes - + 11->54 - - + + 55 - -<<Struct>> -DatasetOrder -contracts/libs/IexecLibOrders_v5.sol - -dataset: address -datasetprice: uint256 -volume: uint256 -tag: bytes32 -apprestrict: address -workerpoolrestrict: address -requesterrestrict: address -salt: bytes32 -sign: bytes + +<<Struct>> +WorkerpoolOrder +contracts/libs/IexecLibOrders_v5.sol + +workerpool: address +workerpoolprice: uint256 +volume: uint256 +tag: bytes32 +category: uint256 +trust: uint256 +apprestrict: address +datasetrestrict: address +requesterrestrict: address +salt: bytes32 +sign: bytes - + 11->55 - - + + 56 - -<<Struct>> -WorkerpoolOrder -contracts/libs/IexecLibOrders_v5.sol - -workerpool: address -workerpoolprice: uint256 -volume: uint256 -tag: bytes32 -category: uint256 -trust: uint256 -apprestrict: address -datasetrestrict: address -requesterrestrict: address -salt: bytes32 -sign: bytes + +<<Struct>> +RequestOrder +contracts/libs/IexecLibOrders_v5.sol + +app: address +appmaxprice: uint256 +dataset: address +datasetmaxprice: uint256 +workerpool: address +workerpoolmaxprice: uint256 +requester: address +volume: uint256 +tag: bytes32 +category: uint256 +trust: uint256 +beneficiary: address +callback: address +params: string +salt: bytes32 +sign: bytes - + 11->56 - - + + - - -57 - -<<Struct>> -RequestOrder -contracts/libs/IexecLibOrders_v5.sol - -app: address -appmaxprice: uint256 -dataset: address -datasetmaxprice: uint256 -workerpool: address -workerpoolmaxprice: uint256 -requester: address -volume: uint256 -tag: bytes32 -category: uint256 -trust: uint256 -beneficiary: address -callback: address -params: string -salt: bytes32 -sign: bytes - - - -11->57 - - + + +61 + +<<Library>> +PocoStorageLib +contracts/libs/PocoStorageLib.sol + +Private: +   POCO_STORAGE_LOCATION: bytes32 + +Internal: +    getPocoStorage(): ($: PocoStorage) + + + +11->61 + + 62 - -<<Library>> -PocoStorageLib -contracts/libs/PocoStorageLib.sol - -Private: -   POCO_STORAGE_LOCATION: bytes32 - -Internal: -    getPocoStorage(): ($: PocoStorage) + +<<Struct>> +PocoStorage +contracts/libs/PocoStorageLib.sol + +m_appregistry: IRegistry +m_datasetregistry: IRegistry +m_workerpoolregistry: IRegistry +m_baseToken: IERC20 +m_name: string +m_symbol: string +m_decimals: uint8 +m_totalSupply: uint256 +m_balances: mapping(address=>uint256) +m_frozens: mapping(address=>uint256) +m_allowances: mapping(address=>mapping(address=>uint256)) +m_eip712DomainSeparator: bytes32 +m_presigned: mapping(bytes32=>address) +m_consumed: mapping(bytes32=>uint256) +m_deals: mapping(bytes32=>IexecLibCore_v5.Deal) +m_tasks: mapping(bytes32=>IexecLibCore_v5.Task) +m_consensus: mapping(bytes32=>IexecLibCore_v5.Consensus) +m_contributions: mapping(bytes32=>mapping(address=>IexecLibCore_v5.Contribution)) +m_workerScores: mapping(address=>uint256) +m_teebroker: address +m_callbackgas: uint256 +m_categories: IexecLibCore_v5.Category[] +m_v3_iexecHub: IexecHubV3Interface +m_v3_scoreImported: mapping(address=>bool) +m_dealsBoost: mapping(bytes32=>IexecLibCore_v5.DealBoost) - + 11->62 - - + + - - -63 - -<<Struct>> -PocoStorage -contracts/libs/PocoStorageLib.sol - -m_appregistry: IRegistry -m_datasetregistry: IRegistry -m_workerpoolregistry: IRegistry -m_baseToken: IERC20 -m_name: string -m_symbol: string -m_decimals: uint8 -m_totalSupply: uint256 -m_balances: mapping(address=>uint256) -m_frozens: mapping(address=>uint256) -m_allowances: mapping(address=>mapping(address=>uint256)) -m_eip712DomainSeparator: bytes32 -m_presigned: mapping(bytes32=>address) -m_consumed: mapping(bytes32=>uint256) -m_deals: mapping(bytes32=>IexecLibCore_v5.Deal) -m_tasks: mapping(bytes32=>IexecLibCore_v5.Task) -m_consensus: mapping(bytes32=>IexecLibCore_v5.Consensus) -m_contributions: mapping(bytes32=>mapping(address=>IexecLibCore_v5.Contribution)) -m_workerScores: mapping(address=>uint256) -m_teebroker: address -m_callbackgas: uint256 -m_categories: IexecLibCore_v5.Category[] -m_v3_iexecHub: IexecHubV3Interface -m_v3_scoreImported: mapping(address=>bool) -m_dealsBoost: mapping(bytes32=>IexecLibCore_v5.DealBoost) - - - -11->63 - - - - - -80 - -<<Interface>> -IWorkerpool -contracts/registries/workerpools/IWorkerpool.v8.sol - -External: -     owner(): address -     m_workerpoolDescription(): string -     m_schedulerRewardRatioPolicy(): uint256 -     m_workerStakeRatioPolicy(): uint256 - - + + +79 + +<<Interface>> +IWorkerpool +contracts/registries/workerpools/IWorkerpool.v8.sol + +External: +     owner(): address +     m_workerpoolDescription(): string +     m_schedulerRewardRatioPolicy(): uint256 +     m_workerStakeRatioPolicy(): uint256 + + -11->80 - - +11->79 + + 12 - -IexecPoco2Facet -contracts/facets/IexecPoco2Facet.sol - -Internal: -    successWork(_dealid: bytes32, _taskid: bytes32) -    failedWork(_dealid: bytes32, _taskid: bytes32) -    checkConsensus(_taskid: bytes32, _consensus: bytes32) -    distributeRewards(_taskid: bytes32) -    distributeRewardsFast(_taskid: bytes32) -    executeCallback(_taskid: bytes32, _resultsCallback: bytes) -External: -    contribute(_taskid: bytes32, _resultHash: bytes32, _resultSeal: bytes32, _enclaveChallenge: address, _enclaveSign: bytes, _authorizationSign: bytes) -    contributeAndFinalize(_taskid: bytes32, _resultDigest: bytes32, _results: bytes, _resultsCallback: bytes, _enclaveChallenge: address, _enclaveSign: bytes, _authorizationSign: bytes) -    reveal(_taskid: bytes32, _resultDigest: bytes32) -    reopen(_taskid: bytes32) <<onlyScheduler>> -    finalize(_taskid: bytes32, _results: bytes, _resultsCallback: bytes) <<onlyScheduler>> -    initializeArray(_dealid: bytes32[], _idx: uint256[]): bool -    claimArray(_taskid: bytes32[]): bool -    initializeAndClaimArray(_dealid: bytes32[], _idx: uint256[]): bool -Public: -    <<modifier>> onlyScheduler(_taskId: bytes32) -    initialize(_dealid: bytes32, idx: uint256): bytes32 -    claim(_taskid: bytes32) + +IexecPoco2Facet +contracts/facets/IexecPoco2Facet.sol + +Internal: +    successWork(_dealid: bytes32, _taskid: bytes32) +    failedWork(_dealid: bytes32, _taskid: bytes32) +    checkConsensus(_taskid: bytes32, _consensus: bytes32) +    distributeRewards(_taskid: bytes32) +    distributeRewardsFast(_taskid: bytes32) +    executeCallback(_taskid: bytes32, _resultsCallback: bytes) +External: +    contribute(_taskid: bytes32, _resultHash: bytes32, _resultSeal: bytes32, _enclaveChallenge: address, _enclaveSign: bytes, _authorizationSign: bytes) +    contributeAndFinalize(_taskid: bytes32, _resultDigest: bytes32, _results: bytes, _resultsCallback: bytes, _enclaveChallenge: address, _enclaveSign: bytes, _authorizationSign: bytes) +    reveal(_taskid: bytes32, _resultDigest: bytes32) +    reopen(_taskid: bytes32) <<onlyScheduler>> +    finalize(_taskid: bytes32, _results: bytes, _resultsCallback: bytes) <<onlyScheduler>> +    initializeArray(_dealid: bytes32[], _idx: uint256[]): bool +    claimArray(_taskid: bytes32[]): bool +    initializeAndClaimArray(_dealid: bytes32[], _idx: uint256[]): bool +Public: +    <<modifier>> onlyScheduler(_taskId: bytes32) +    initialize(_dealid: bytes32, idx: uint256): bytes32 +    claim(_taskid: bytes32) - + 12->3 - - + + 28 - -<<Interface>> -IexecPoco2 -contracts/interfaces/IexecPoco2.sol - -External: -     initialize(dealId: bytes32, index: uint256): bytes32 -     claim(taskId: bytes32) -     contribute(taskId: bytes32, resultHash: bytes32, resultSeal: bytes32, enclaveChallenge: address, enclaveSign: bytes, authorizationSign: bytes) -     contributeAndFinalize(taskId: bytes32, resultDigest: bytes32, results: bytes, resultsCallback: bytes, enclaveChallenge: address, enclaveSign: bytes, authorizationSign: bytes) -     reveal(taskId: bytes32, resultDigest: bytes32) -     reopen(taskId: bytes32) -     finalize(taskId: bytes32, results: bytes, resultsCallback: bytes) -     initializeArray(dealIds: bytes32[], indexes: uint256[]): bool -     claimArray(taskIds: bytes32[]): bool -     initializeAndClaimArray(dealIds: bytes32[], indexes: uint256[]): bool -Public: -    <<event>> AccurateContribution(worker: address, taskid: bytes32) -    <<event>> FaultyContribution(worker: address, taskid: bytes32) -    <<event>> TaskInitialize(taskid: bytes32, workerpool: address) -    <<event>> TaskContribute(taskid: bytes32, worker: address, hash: bytes32) -    <<event>> TaskConsensus(taskid: bytes32, consensus: bytes32) -    <<event>> TaskReveal(taskid: bytes32, worker: address, digest: bytes32) -    <<event>> TaskReopen(taskid: bytes32) -    <<event>> TaskFinalize(taskid: bytes32, results: bytes) -    <<event>> TaskClaimed(taskid: bytes32) + +<<Interface>> +IexecPoco2 +contracts/interfaces/IexecPoco2.sol + +External: +     initialize(dealId: bytes32, index: uint256): bytes32 +     claim(taskId: bytes32) +     contribute(taskId: bytes32, resultHash: bytes32, resultSeal: bytes32, enclaveChallenge: address, enclaveSign: bytes, authorizationSign: bytes) +     contributeAndFinalize(taskId: bytes32, resultDigest: bytes32, results: bytes, resultsCallback: bytes, enclaveChallenge: address, enclaveSign: bytes, authorizationSign: bytes) +     reveal(taskId: bytes32, resultDigest: bytes32) +     reopen(taskId: bytes32) +     finalize(taskId: bytes32, results: bytes, resultsCallback: bytes) +     initializeArray(dealIds: bytes32[], indexes: uint256[]): bool +     claimArray(taskIds: bytes32[]): bool +     initializeAndClaimArray(dealIds: bytes32[], indexes: uint256[]): bool +Public: +    <<event>> AccurateContribution(worker: address, taskid: bytes32) +    <<event>> FaultyContribution(worker: address, taskid: bytes32) +    <<event>> TaskInitialize(taskid: bytes32, workerpool: address) +    <<event>> TaskContribute(taskid: bytes32, worker: address, hash: bytes32) +    <<event>> TaskConsensus(taskid: bytes32, consensus: bytes32) +    <<event>> TaskReveal(taskid: bytes32, worker: address, digest: bytes32) +    <<event>> TaskReopen(taskid: bytes32) +    <<event>> TaskFinalize(taskid: bytes32, results: bytes) +    <<event>> TaskClaimed(taskid: bytes32) - + 12->28 - - + + - + 12->34 - - + + - + 12->35 - - + + - + 12->36 - - + + - + -12->37 - - +12->43 + + - - -12->44 - - + + +46 + +<<Struct>> +Task +contracts/libs/IexecLibCore_v5.sol + +status: TaskStatusEnum +dealid: bytes32 +idx: uint256 +timeref: uint256 +contributionDeadline: uint256 +revealDeadline: uint256 +finalDeadline: uint256 +consensusValue: bytes32 +revealCounter: uint256 +winnerCounter: uint256 +contributors: address[] +resultDigest: bytes32 +results: bytes +resultsTimestamp: uint256 +resultsCallback: bytes + + + +12->46 + + 47 - -<<Struct>> -Task -contracts/libs/IexecLibCore_v5.sol - -status: TaskStatusEnum -dealid: bytes32 -idx: uint256 -timeref: uint256 -contributionDeadline: uint256 -revealDeadline: uint256 -finalDeadline: uint256 -consensusValue: bytes32 -revealCounter: uint256 -winnerCounter: uint256 -contributors: address[] -resultDigest: bytes32 -results: bytes -resultsTimestamp: uint256 -resultsCallback: bytes + +<<Struct>> +Consensus +contracts/libs/IexecLibCore_v5.sol + +group: mapping(bytes32=>uint256) +total: uint256 - + 12->47 - - + + - - -48 - -<<Struct>> -Consensus -contracts/libs/IexecLibCore_v5.sol - -group: mapping(bytes32=>uint256) -total: uint256 - - - -12->48 - - + + +49 + +<<Struct>> +Contribution +contracts/libs/IexecLibCore_v5.sol + +status: ContributionStatusEnum +resultHash: bytes32 +resultSeal: bytes32 +enclaveChallenge: address +weight: uint256 + + + +12->49 + + - - -50 - -<<Struct>> -Contribution -contracts/libs/IexecLibCore_v5.sol - -status: ContributionStatusEnum -resultHash: bytes32 -resultSeal: bytes32 -enclaveChallenge: address -weight: uint256 - - - -12->50 - - + + +12->61 + + 12->62 - - - - - -12->63 - - + + 24 - -<<Interface>> -IexecHubV3Interface -contracts/interfaces/IexecHubV3Interface.sol - -External: -     viewScore(worker: address): uint256 - - + +<<Interface>> +IexecHubV3Interface +contracts/interfaces/IexecHubV3Interface.sol + +External: +     viewScore(worker: address): uint256 + + + +26->50 + + + + -26->51 - - +26->53 + + - + 26->54 - - + + 26->55 - - + + - + 26->56 - - + + - - -26->57 - - + + +34->61 + + - + 34->62 - - + + + + + +35->61 + + - + -34->63 - - +35->62 + + - + + +63 + +<<Library>> +StakedRlcLib +contracts/libs/StakedRlcLib.sol + +Internal: +    transfer(from: address, to: address, value: uint256) +    mint(account: address, amount: uint256) +    burn(account: address, amount: uint256) +    approve(owner: address, spender: address, amount: uint256) +Public: +    <<event>> Transfer(from: address, to: address, value: uint256) +    <<event>> Approval(owner: address, spender: address, value: uint256) + + -36->62 - - +35->63 + + - - -36->63 - - + + +42 + +<<Struct>> +Resource +contracts/libs/IexecLibCore_v5.sol + +pointer: address +owner: address +price: uint256 + + + +42->36 + + - - -64 - -<<Library>> -StakedRlcLib -contracts/libs/StakedRlcLib.sol - -Internal: -    transfer(from: address, to: address, value: uint256) -    mint(account: address, amount: uint256) -    burn(account: address, amount: uint256) -    approve(owner: address, spender: address, amount: uint256) -Public: -    <<event>> Transfer(from: address, to: address, value: uint256) -    <<event>> Approval(owner: address, spender: address, value: uint256) - - - -36->64 - - + + +43->36 + + - - -43 - -<<Struct>> -Resource -contracts/libs/IexecLibCore_v5.sol - -pointer: address -owner: address -price: uint256 - - - -43->37 - - + + +43->42 + + - - -44->37 - - + + +45 + +<<Enum>> +TaskStatusEnum +contracts/libs/IexecLibCore_v5.sol + +UNSET: 0 +ACTIVE: 1 +REVEALING: 2 +COMPLETED: 3 +FAILED: 4 + + + +45->36 + + - - -44->43 - - + + +46->36 + + - - -46 - -<<Enum>> -TaskStatusEnum -contracts/libs/IexecLibCore_v5.sol - -UNSET: 0 -ACTIVE: 1 -REVEALING: 2 -COMPLETED: 3 -FAILED: 4 - - - -46->37 - - + + +46->45 + + - - -47->37 - - + + +47->36 + + - - -47->46 - - + + +48 + +<<Enum>> +ContributionStatusEnum +contracts/libs/IexecLibCore_v5.sol + +UNSET: 0 +CONTRIBUTED: 1 +PROVED: 2 +REJECTED: 3 + + + +48->36 + + - - -48->37 - - + + +49->36 + + - - -49 - -<<Enum>> -ContributionStatusEnum -contracts/libs/IexecLibCore_v5.sol - -UNSET: 0 -CONTRIBUTED: 1 -PROVED: 2 -REJECTED: 3 - - - -49->37 - - + + +49->48 + + - - -50->37 - - + + +52 + +<<Struct>> +EIP712Domain +contracts/libs/IexecLibOrders_v5.sol + +name: string +version: string +chainId: uint256 +verifyingContract: address + + + +50->52 + + - - -50->49 - - + + +50->53 + + - - -53 - -<<Struct>> -EIP712Domain -contracts/libs/IexecLibOrders_v5.sol - -name: string -version: string -chainId: uint256 -verifyingContract: address - - + -51->53 - - +50->54 + + - + -51->54 - - +50->55 + + - + -51->55 - - +50->56 + + - + + +57 + +<<Struct>> +AppOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: AppOrder +operation: OrderOperationEnum +sign: bytes + + -51->56 - - - - - -51->57 - - +50->57 + + 58 - -<<Struct>> -AppOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: AppOrder -operation: OrderOperationEnum -sign: bytes - - - -51->58 - - + +<<Struct>> +DatasetOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: DatasetOrder +operation: OrderOperationEnum +sign: bytes + + + +50->58 + + 59 - -<<Struct>> -DatasetOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: DatasetOrder -operation: OrderOperationEnum -sign: bytes - - - -51->59 - - + +<<Struct>> +WorkerpoolOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: WorkerpoolOrder +operation: OrderOperationEnum +sign: bytes + + + +50->59 + + 60 - -<<Struct>> -WorkerpoolOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: WorkerpoolOrder -operation: OrderOperationEnum -sign: bytes - - - -51->60 - - + +<<Struct>> +RequestOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: RequestOrder +operation: OrderOperationEnum +sign: bytes + + + +50->60 + + - - -61 - -<<Struct>> -RequestOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: RequestOrder -operation: OrderOperationEnum -sign: bytes - - - -51->61 - - + + +51 + +<<Enum>> +OrderOperationEnum +contracts/libs/IexecLibOrders_v5.sol + +SIGN: 0 +CLOSE: 1 + + + +51->50 + + - - -52 - -<<Enum>> -OrderOperationEnum -contracts/libs/IexecLibOrders_v5.sol - -SIGN: 0 -CLOSE: 1 - - + + +52->50 + + + + -52->51 - - +53->50 + + - + -53->51 - - +54->50 + + - + -54->51 - - +55->50 + + - + -55->51 - - +56->50 + + - + -56->51 - - +57->50 + + - + 57->51 - - + + - - -58->51 - - + + +57->53 + + + + + +58->50 + + - + -58->52 - - +58->51 + + 58->54 - - + + - - -59->51 - - + + +59->50 + + - + -59->52 - - +59->51 + + 59->55 - - + + - - -60->51 - - + + +60->50 + + - + -60->52 - - +60->51 + + 60->56 - - - - - -61->51 - - + + - + -61->52 - - +61->62 + + - - -61->57 - - + + +62->24 + + - + -62->63 - - +62->36 + + - - -63->24 - - + + +62->61 + + + + + +64 + +<<Interface>> +IRegistry +contracts/registries/IRegistry.sol + +External: +     isRegistered(_entry: address): bool + + + +62->64 + + - + -63->37 - - +63->61 + + - + 63->62 - - - - - -65 - -<<Interface>> -IRegistry -contracts/registries/IRegistry.sol - -External: -     isRegistered(_entry: address): bool - - - -63->65 - - - - - -64->62 - - - - - -64->63 - - + + diff --git a/docs/uml/class-uml-dir-libs.svg b/docs/uml/class-uml-dir-libs.svg index 7e5b7b9da..7215ddc1d 100644 --- a/docs/uml/class-uml-dir-libs.svg +++ b/docs/uml/class-uml-dir-libs.svg @@ -4,839 +4,824 @@ - - + + UmlClassDiagram - + 0 - -<<Library>> -CommonLib -contracts/libs/CommonLib.sol - -Internal: -    toTypedDataHash(structHash: bytes32): bytes32 -    verifySignatureOfEthSignedMessage(account: address, message: bytes, signature: bytes): bool -    verifySignature(account: address, messageHash: bytes32, signature: bytes): bool -    verifyPresignature(account: address, messageHash: bytes32): bool -    verifySignatureOrPresignature(account: address, messageHash: bytes32, signature: bytes): bool -    isAccountAuthorizedByRestriction(restriction: address, account: address): bool -    computeDealVolume(appOrderVolume: uint256, appOrderTypedDataHash: bytes32, hasDataset: bool, datasetOrderVolume: uint256, datasetOrderTypedDataHash: bytes32, workerpoolOrderVolume: uint256, workerpoolOrderTypedDataHash: bytes32, requestOrderVolume: uint256, requestOrderTypedDataHash: bytes32): uint256 + +<<Library>> +CommonLib +contracts/libs/CommonLib.sol + +Private: +   GROUPMEMBER_PURPOSE: uint256 + +Internal: +    toTypedDataHash(structHash: bytes32): bytes32 +    verifySignatureOfEthSignedMessage(account: address, message: bytes, signature: bytes): bool +    verifySignature(account: address, messageHash: bytes32, signature: bytes): bool +    verifyPresignature(account: address, messageHash: bytes32): bool +    verifySignatureOrPresignature(account: address, messageHash: bytes32, signature: bytes): bool +    isAccountAuthorizedByRestriction(restriction: address, account: address): bool +    computeDealVolume(appOrderVolume: uint256, appOrderTypedDataHash: bytes32, hasDataset: bool, datasetOrderVolume: uint256, datasetOrderTypedDataHash: bytes32, workerpoolOrderVolume: uint256, workerpoolOrderTypedDataHash: bytes32, requestOrderVolume: uint256, requestOrderTypedDataHash: bytes32): uint256 + + + +27 + +<<Library>> +PocoStorageLib +contracts/libs/PocoStorageLib.sol + +Private: +   POCO_STORAGE_LOCATION: bytes32 + +Internal: +    getPocoStorage(): ($: PocoStorage) + + + +0->27 + + 28 - -<<Library>> -PocoStorageLib -contracts/libs/PocoStorageLib.sol - -Private: -   POCO_STORAGE_LOCATION: bytes32 - -Internal: -    getPocoStorage(): ($: PocoStorage) + +<<Struct>> +PocoStorage +contracts/libs/PocoStorageLib.sol + +m_appregistry: IRegistry +m_datasetregistry: IRegistry +m_workerpoolregistry: IRegistry +m_baseToken: IERC20 +m_name: string +m_symbol: string +m_decimals: uint8 +m_totalSupply: uint256 +m_balances: mapping(address=>uint256) +m_frozens: mapping(address=>uint256) +m_allowances: mapping(address=>mapping(address=>uint256)) +m_eip712DomainSeparator: bytes32 +m_presigned: mapping(bytes32=>address) +m_consumed: mapping(bytes32=>uint256) +m_deals: mapping(bytes32=>IexecLibCore_v5.Deal) +m_tasks: mapping(bytes32=>IexecLibCore_v5.Task) +m_consensus: mapping(bytes32=>IexecLibCore_v5.Consensus) +m_contributions: mapping(bytes32=>mapping(address=>IexecLibCore_v5.Contribution)) +m_workerScores: mapping(address=>uint256) +m_teebroker: address +m_callbackgas: uint256 +m_categories: IexecLibCore_v5.Category[] +m_v3_iexecHub: IexecHubV3Interface +m_v3_scoreImported: mapping(address=>bool) +m_dealsBoost: mapping(bytes32=>IexecLibCore_v5.DealBoost) - -0->28 - - - - - -29 - -<<Struct>> -PocoStorage -contracts/libs/PocoStorageLib.sol - -m_appregistry: IRegistry -m_datasetregistry: IRegistry -m_workerpoolregistry: IRegistry -m_baseToken: IERC20 -m_name: string -m_symbol: string -m_decimals: uint8 -m_totalSupply: uint256 -m_balances: mapping(address=>uint256) -m_frozens: mapping(address=>uint256) -m_allowances: mapping(address=>mapping(address=>uint256)) -m_eip712DomainSeparator: bytes32 -m_presigned: mapping(bytes32=>address) -m_consumed: mapping(bytes32=>uint256) -m_deals: mapping(bytes32=>IexecLibCore_v5.Deal) -m_tasks: mapping(bytes32=>IexecLibCore_v5.Task) -m_consensus: mapping(bytes32=>IexecLibCore_v5.Consensus) -m_contributions: mapping(bytes32=>mapping(address=>IexecLibCore_v5.Contribution)) -m_workerScores: mapping(address=>uint256) -m_teebroker: address -m_callbackgas: uint256 -m_categories: IexecLibCore_v5.Category[] -m_v3_iexecHub: IexecHubV3Interface -m_v3_scoreImported: mapping(address=>bool) -m_dealsBoost: mapping(bytes32=>IexecLibCore_v5.DealBoost) - - -0->29 - - +0->28 + + 1 - -<<Library>> -Constants -contracts/libs/Constants.sol - -Internal: -   CONTRIBUTION_DEADLINE_RATIO: uint256 -   REVEAL_DEADLINE_RATIO: uint256 -   FINAL_DEADLINE_RATIO: uint256 -   WORKERPOOL_STAKE_RATIO: uint256 -   KITTY_RATIO: uint256 -   KITTY_MIN: uint256 -   KITTY_ADDRESS: address -   GROUPMEMBER_PURPOSE: uint256 - - - -2 - -<<Library>> -EscrowLib -contracts/libs/EscrowLib.sol - -Internal: -    lock(account: address, value: uint256) -    unlock(account: address, value: uint256) -    reward(account: address, value: uint256, ref: bytes32) -    seize(account: address, value: uint256, ref: bytes32) -    rewardAndLock(account: address, value: uint256, ref: bytes32) -Public: -    <<event>> Reward(owner: address, amount: uint256, ref: bytes32) -    <<event>> Seize(owner: address, amount: uint256, ref: bytes32) -    <<event>> Lock(owner: address, amount: uint256) -    <<event>> Unlock(owner: address, amount: uint256) - - + +<<Library>> +EscrowLib +contracts/libs/EscrowLib.sol + +Internal: +    lock(account: address, value: uint256) +    unlock(account: address, value: uint256) +    reward(account: address, value: uint256, ref: bytes32) +    seize(account: address, value: uint256, ref: bytes32) +    rewardAndLock(account: address, value: uint256, ref: bytes32) +Public: +    <<event>> Reward(owner: address, amount: uint256, ref: bytes32) +    <<event>> Seize(owner: address, amount: uint256, ref: bytes32) +    <<event>> Lock(owner: address, amount: uint256) +    <<event>> Unlock(owner: address, amount: uint256) + + -2->28 - - +1->27 + + - + -2->29 - - - - - -30 - -<<Library>> -StakedRlcLib -contracts/libs/StakedRlcLib.sol - -Internal: -    transfer(from: address, to: address, value: uint256) -    mint(account: address, amount: uint256) -    burn(account: address, amount: uint256) -    approve(owner: address, spender: address, amount: uint256) -Public: -    <<event>> Transfer(from: address, to: address, value: uint256) -    <<event>> Approval(owner: address, spender: address, value: uint256) - - +1->28 + + + + + +29 + +<<Library>> +StakedRlcLib +contracts/libs/StakedRlcLib.sol + +Internal: +    transfer(from: address, to: address, value: uint256) +    mint(account: address, amount: uint256) +    burn(account: address, amount: uint256) +    approve(owner: address, spender: address, amount: uint256) +Public: +    <<event>> Transfer(from: address, to: address, value: uint256) +    <<event>> Approval(owner: address, spender: address, value: uint256) + + -2->30 - - +1->29 + + + + + +2 + +<<Library>> +IexecLibCore_v5 +contracts/libs/IexecLibCore_v5.sol 3 - -<<Library>> -IexecLibCore_v5 -contracts/libs/IexecLibCore_v5.sol + +<<Struct>> +Account +contracts/libs/IexecLibCore_v5.sol + +stake: uint256 +locked: uint256 + + + +3->2 + + 4 - -<<Struct>> -Account -contracts/libs/IexecLibCore_v5.sol - -stake: uint256 -locked: uint256 - - - -4->3 - - + +<<Struct>> +Category +contracts/libs/IexecLibCore_v5.sol + +name: string +description: string +workClockTimeRef: uint256 + + + +4->2 + + 5 - -<<Struct>> -Category -contracts/libs/IexecLibCore_v5.sol - -name: string -description: string -workClockTimeRef: uint256 - - - -5->3 - - + +<<Struct>> +DatasetInfo +contracts/libs/IexecLibCore_v5.sol + +owner: address +m_datasetName: string +m_datasetMultiaddr: bytes +m_datasetChecksum: bytes32 + + + +5->2 + + 6 - -<<Struct>> -DatasetInfo -contracts/libs/IexecLibCore_v5.sol - -owner: address -m_datasetName: string -m_datasetMultiaddr: bytes -m_datasetChecksum: bytes32 - - - -6->3 - - + +<<Struct>> +AppInfo +contracts/libs/IexecLibCore_v5.sol + +owner: address +m_appName: string +m_appType: string +m_appMultiaddr: bytes +m_appChecksum: bytes32 +m_appMREnclave: bytes + + + +6->2 + + 7 - -<<Struct>> -AppInfo -contracts/libs/IexecLibCore_v5.sol - -owner: address -m_appName: string -m_appType: string -m_appMultiaddr: bytes -m_appChecksum: bytes32 -m_appMREnclave: bytes - - - -7->3 - - + +<<Struct>> +WorkerpoolInfo +contracts/libs/IexecLibCore_v5.sol + +owner: address +m_workerpoolDescription: string +m_workerStakeRatioPolicy: uint256 +m_schedulerRewardRatioPolicy: uint256 + + + +7->2 + + 8 - -<<Struct>> -WorkerpoolInfo -contracts/libs/IexecLibCore_v5.sol - -owner: address -m_workerpoolDescription: string -m_workerStakeRatioPolicy: uint256 -m_schedulerRewardRatioPolicy: uint256 - - - -8->3 - - + +<<Struct>> +Resource +contracts/libs/IexecLibCore_v5.sol + +pointer: address +owner: address +price: uint256 + + + +8->2 + + 9 - -<<Struct>> -Resource -contracts/libs/IexecLibCore_v5.sol - -pointer: address -owner: address -price: uint256 - - - -9->3 - - + +<<Struct>> +Deal +contracts/libs/IexecLibCore_v5.sol + +app: Resource +dataset: Resource +workerpool: Resource +trust: uint256 +category: uint256 +tag: bytes32 +requester: address +beneficiary: address +callback: address +params: string +startTime: uint256 +botFirst: uint256 +botSize: uint256 +workerStake: uint256 +schedulerRewardRatio: uint256 +sponsor: address + + + +9->2 + + + + + +9->8 + + 10 - -<<Struct>> -Deal -contracts/libs/IexecLibCore_v5.sol - -app: Resource -dataset: Resource -workerpool: Resource -trust: uint256 -category: uint256 -tag: bytes32 -requester: address -beneficiary: address -callback: address -params: string -startTime: uint256 -botFirst: uint256 -botSize: uint256 -workerStake: uint256 -schedulerRewardRatio: uint256 -sponsor: address - - - -10->3 - - - - - -10->9 - - + +<<Struct>> +DealBoost +contracts/libs/IexecLibCore_v5.sol + +appOwner: address +appPrice: uint96 +datasetOwner: address +datasetPrice: uint96 +workerpoolOwner: address +workerpoolPrice: uint96 +requester: address +workerReward: uint96 +callback: address +deadline: uint40 +botFirst: uint16 +botSize: uint16 +shortTag: bytes3 +sponsor: address + + + +10->2 + + 11 - -<<Struct>> -DealBoost -contracts/libs/IexecLibCore_v5.sol - -appOwner: address -appPrice: uint96 -datasetOwner: address -datasetPrice: uint96 -workerpoolOwner: address -workerpoolPrice: uint96 -requester: address -workerReward: uint96 -callback: address -deadline: uint40 -botFirst: uint16 -botSize: uint16 -shortTag: bytes3 -sponsor: address - - - -11->3 - - + +<<Enum>> +TaskStatusEnum +contracts/libs/IexecLibCore_v5.sol + +UNSET: 0 +ACTIVE: 1 +REVEALING: 2 +COMPLETED: 3 +FAILED: 4 + + + +11->2 + + 12 - -<<Enum>> -TaskStatusEnum -contracts/libs/IexecLibCore_v5.sol - -UNSET: 0 -ACTIVE: 1 -REVEALING: 2 -COMPLETED: 3 -FAILED: 4 - - - -12->3 - - + +<<Struct>> +Task +contracts/libs/IexecLibCore_v5.sol + +status: TaskStatusEnum +dealid: bytes32 +idx: uint256 +timeref: uint256 +contributionDeadline: uint256 +revealDeadline: uint256 +finalDeadline: uint256 +consensusValue: bytes32 +revealCounter: uint256 +winnerCounter: uint256 +contributors: address[] +resultDigest: bytes32 +results: bytes +resultsTimestamp: uint256 +resultsCallback: bytes + + + +12->2 + + + + + +12->11 + + 13 - -<<Struct>> -Task -contracts/libs/IexecLibCore_v5.sol - -status: TaskStatusEnum -dealid: bytes32 -idx: uint256 -timeref: uint256 -contributionDeadline: uint256 -revealDeadline: uint256 -finalDeadline: uint256 -consensusValue: bytes32 -revealCounter: uint256 -winnerCounter: uint256 -contributors: address[] -resultDigest: bytes32 -results: bytes -resultsTimestamp: uint256 -resultsCallback: bytes - - - -13->3 - - - - - -13->12 - - + +<<Struct>> +Consensus +contracts/libs/IexecLibCore_v5.sol + +group: mapping(bytes32=>uint256) +total: uint256 + + + +13->2 + + 14 - -<<Struct>> -Consensus -contracts/libs/IexecLibCore_v5.sol - -group: mapping(bytes32=>uint256) -total: uint256 - - - -14->3 - - + +<<Enum>> +ContributionStatusEnum +contracts/libs/IexecLibCore_v5.sol + +UNSET: 0 +CONTRIBUTED: 1 +PROVED: 2 +REJECTED: 3 + + + +14->2 + + 15 - -<<Enum>> -ContributionStatusEnum -contracts/libs/IexecLibCore_v5.sol - -UNSET: 0 -CONTRIBUTED: 1 -PROVED: 2 -REJECTED: 3 - - - -15->3 - - + +<<Struct>> +Contribution +contracts/libs/IexecLibCore_v5.sol + +status: ContributionStatusEnum +resultHash: bytes32 +resultSeal: bytes32 +enclaveChallenge: address +weight: uint256 + + + +15->2 + + + + + +15->14 + + 16 - -<<Struct>> -Contribution -contracts/libs/IexecLibCore_v5.sol - -status: ContributionStatusEnum -resultHash: bytes32 -resultSeal: bytes32 -enclaveChallenge: address -weight: uint256 - - - -16->3 - - + +<<Library>> +IexecLibOrders_v5 +contracts/libs/IexecLibOrders_v5.sol + +Public: +   EIP712DOMAIN_TYPEHASH: bytes32 +   APPORDER_TYPEHASH: bytes32 +   DATASETORDER_TYPEHASH: bytes32 +   WORKERPOOLORDER_TYPEHASH: bytes32 +   REQUESTORDER_TYPEHASH: bytes32 +   APPORDEROPERATION_TYPEHASH: bytes32 +   DATASETORDEROPERATION_TYPEHASH: bytes32 +   WORKERPOOLORDEROPERATION_TYPEHASH: bytes32 +   REQUESTORDEROPERATION_TYPEHASH: bytes32 + +Public: +    hash(_domain: EIP712Domain): (domainhash: bytes32) +    hash(_apporder: AppOrder): (apphash: bytes32) +    hash(_datasetorder: DatasetOrder): (datasethash: bytes32) +    hash(_workerpoolorder: WorkerpoolOrder): (workerpoolhash: bytes32) +    hash(_requestorder: RequestOrder): (requesthash: bytes32) +    hash(_apporderoperation: AppOrderOperation): bytes32 +    hash(_datasetorderoperation: DatasetOrderOperation): bytes32 +    hash(_workerpoolorderoperation: WorkerpoolOrderOperation): bytes32 +    hash(_requestorderoperation: RequestOrderOperation): bytes32 - - -16->15 - - - - - -17 - -<<Library>> -IexecLibOrders_v5 -contracts/libs/IexecLibOrders_v5.sol - -Public: -   EIP712DOMAIN_TYPEHASH: bytes32 -   APPORDER_TYPEHASH: bytes32 -   DATASETORDER_TYPEHASH: bytes32 -   WORKERPOOLORDER_TYPEHASH: bytes32 -   REQUESTORDER_TYPEHASH: bytes32 -   APPORDEROPERATION_TYPEHASH: bytes32 -   DATASETORDEROPERATION_TYPEHASH: bytes32 -   WORKERPOOLORDEROPERATION_TYPEHASH: bytes32 -   REQUESTORDEROPERATION_TYPEHASH: bytes32 - -Public: -    hash(_domain: EIP712Domain): (domainhash: bytes32) -    hash(_apporder: AppOrder): (apphash: bytes32) -    hash(_datasetorder: DatasetOrder): (datasethash: bytes32) -    hash(_workerpoolorder: WorkerpoolOrder): (workerpoolhash: bytes32) -    hash(_requestorder: RequestOrder): (requesthash: bytes32) -    hash(_apporderoperation: AppOrderOperation): bytes32 -    hash(_datasetorderoperation: DatasetOrderOperation): bytes32 -    hash(_workerpoolorderoperation: WorkerpoolOrderOperation): bytes32 -    hash(_requestorderoperation: RequestOrderOperation): bytes32 + + +18 + +<<Struct>> +EIP712Domain +contracts/libs/IexecLibOrders_v5.sol + +name: string +version: string +chainId: uint256 +verifyingContract: address + + + +16->18 + + 19 - -<<Struct>> -EIP712Domain -contracts/libs/IexecLibOrders_v5.sol - -name: string -version: string -chainId: uint256 -verifyingContract: address - - - -17->19 - - + +<<Struct>> +AppOrder +contracts/libs/IexecLibOrders_v5.sol + +app: address +appprice: uint256 +volume: uint256 +tag: bytes32 +datasetrestrict: address +workerpoolrestrict: address +requesterrestrict: address +salt: bytes32 +sign: bytes + + + +16->19 + + 20 - -<<Struct>> -AppOrder -contracts/libs/IexecLibOrders_v5.sol - -app: address -appprice: uint256 -volume: uint256 -tag: bytes32 -datasetrestrict: address -workerpoolrestrict: address -requesterrestrict: address -salt: bytes32 -sign: bytes - - - -17->20 - - + +<<Struct>> +DatasetOrder +contracts/libs/IexecLibOrders_v5.sol + +dataset: address +datasetprice: uint256 +volume: uint256 +tag: bytes32 +apprestrict: address +workerpoolrestrict: address +requesterrestrict: address +salt: bytes32 +sign: bytes + + + +16->20 + + 21 - -<<Struct>> -DatasetOrder -contracts/libs/IexecLibOrders_v5.sol - -dataset: address -datasetprice: uint256 -volume: uint256 -tag: bytes32 -apprestrict: address -workerpoolrestrict: address -requesterrestrict: address -salt: bytes32 -sign: bytes - - - -17->21 - - + +<<Struct>> +WorkerpoolOrder +contracts/libs/IexecLibOrders_v5.sol + +workerpool: address +workerpoolprice: uint256 +volume: uint256 +tag: bytes32 +category: uint256 +trust: uint256 +apprestrict: address +datasetrestrict: address +requesterrestrict: address +salt: bytes32 +sign: bytes + + + +16->21 + + 22 - -<<Struct>> -WorkerpoolOrder -contracts/libs/IexecLibOrders_v5.sol - -workerpool: address -workerpoolprice: uint256 -volume: uint256 -tag: bytes32 -category: uint256 -trust: uint256 -apprestrict: address -datasetrestrict: address -requesterrestrict: address -salt: bytes32 -sign: bytes - - - -17->22 - - + +<<Struct>> +RequestOrder +contracts/libs/IexecLibOrders_v5.sol + +app: address +appmaxprice: uint256 +dataset: address +datasetmaxprice: uint256 +workerpool: address +workerpoolmaxprice: uint256 +requester: address +volume: uint256 +tag: bytes32 +category: uint256 +trust: uint256 +beneficiary: address +callback: address +params: string +salt: bytes32 +sign: bytes + + + +16->22 + + 23 - -<<Struct>> -RequestOrder -contracts/libs/IexecLibOrders_v5.sol - -app: address -appmaxprice: uint256 -dataset: address -datasetmaxprice: uint256 -workerpool: address -workerpoolmaxprice: uint256 -requester: address -volume: uint256 -tag: bytes32 -category: uint256 -trust: uint256 -beneficiary: address -callback: address -params: string -salt: bytes32 -sign: bytes - - - -17->23 - - + +<<Struct>> +AppOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: AppOrder +operation: OrderOperationEnum +sign: bytes + + + +16->23 + + 24 - -<<Struct>> -AppOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: AppOrder -operation: OrderOperationEnum -sign: bytes - - - -17->24 - - + +<<Struct>> +DatasetOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: DatasetOrder +operation: OrderOperationEnum +sign: bytes + + + +16->24 + + 25 - -<<Struct>> -DatasetOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: DatasetOrder -operation: OrderOperationEnum -sign: bytes - - - -17->25 - - + +<<Struct>> +WorkerpoolOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: WorkerpoolOrder +operation: OrderOperationEnum +sign: bytes + + + +16->25 + + 26 - -<<Struct>> -WorkerpoolOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: WorkerpoolOrder -operation: OrderOperationEnum -sign: bytes - - - -17->26 - - - - - -27 - -<<Struct>> -RequestOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: RequestOrder -operation: OrderOperationEnum -sign: bytes - - + +<<Struct>> +RequestOrderOperation +contracts/libs/IexecLibOrders_v5.sol + +order: RequestOrder +operation: OrderOperationEnum +sign: bytes + + -17->27 - - +16->26 + + - - -18 - -<<Enum>> -OrderOperationEnum -contracts/libs/IexecLibOrders_v5.sol - -SIGN: 0 -CLOSE: 1 - - + + +17 + +<<Enum>> +OrderOperationEnum +contracts/libs/IexecLibOrders_v5.sol + +SIGN: 0 +CLOSE: 1 + + -18->17 - - +17->16 + + - + -19->17 - - +18->16 + + - + -20->17 - - +19->16 + + - + -21->17 - - +20->16 + + - + -22->17 - - +21->16 + + - + -23->17 - - +22->16 + + - + -24->17 - - +23->16 + + - + -24->18 - - +23->17 + + - + -24->20 - - +23->19 + + - + -25->17 - - +24->16 + + - + -25->18 - - +24->17 + + - + -25->21 - - +24->20 + + - + -26->17 - - +25->16 + + - + -26->18 - - +25->17 + + - + -26->22 - - +25->21 + + - + -27->17 - - +26->16 + + - + -27->18 - - +26->17 + + - + -27->23 - - +26->22 + + - + -28->29 - - +27->28 + + - + -29->3 - - +28->2 + + - + -29->28 - - +28->27 + + - + -30->28 - - +29->27 + + - + -30->29 - - +29->28 + +