diff --git a/.solcover.js b/.solcover.js index 2900cd7d..4d2eefc8 100644 --- a/.solcover.js +++ b/.solcover.js @@ -13,6 +13,6 @@ module.exports = { mocha: { timeout: 600000, // double timeout }, - skipFiles: ['facets/SignatureVerifier.sol', 'tools/'], + skipFiles: ['tools/'], istanbulFolder: './coverage', }; diff --git a/abis/human-readable-abis/@iexec/solidity/contracts/ERC1271/IERC1271.sol/IERC1271.json b/abis/human-readable-abis/@iexec/solidity/contracts/ERC1271/IERC1271.sol/IERC1271.json deleted file mode 100644 index 5d1f035c..00000000 --- a/abis/human-readable-abis/@iexec/solidity/contracts/ERC1271/IERC1271.sol/IERC1271.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "function isValidSignature(bytes,bytes) view returns (bytes4)" -] diff --git a/abis/human-readable-abis/@iexec/solidity/contracts/ERC1654/IERC1654.sol/IERC1654.json b/abis/human-readable-abis/@iexec/solidity/contracts/ERC1654/IERC1654.sol/IERC1654.json deleted file mode 100644 index 0e313bfd..00000000 --- a/abis/human-readable-abis/@iexec/solidity/contracts/ERC1654/IERC1654.sol/IERC1654.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "function isValidSignature(bytes32,bytes) view returns (bytes4)" -] diff --git a/abis/human-readable-abis/@iexec/solidity/contracts/ERC734/IERC734.sol/IERC734.json b/abis/human-readable-abis/@iexec/solidity/contracts/ERC734/IERC734.sol/IERC734.json deleted file mode 100644 index 08980491..00000000 --- a/abis/human-readable-abis/@iexec/solidity/contracts/ERC734/IERC734.sol/IERC734.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - "event Approved(uint256 indexed,bool)", - "event Executed(uint256 indexed,address indexed,uint256 indexed,bytes)", - "event ExecutionFailed(uint256 indexed,address indexed,uint256 indexed,bytes)", - "event ExecutionRequested(uint256 indexed,address indexed,uint256 indexed,bytes)", - "event KeyAdded(bytes32 indexed,uint256 indexed,uint256 indexed)", - "event KeyRemoved(bytes32 indexed,uint256 indexed,uint256 indexed)", - "function ACTION_KEY() view returns (uint256)", - "function CLAIM_SIGNER_KEY() view returns (uint256)", - "function ECDSA_TYPE() view returns (uint256)", - "function ENCRYPTION_KEY() view returns (uint256)", - "function MANAGEMENT_KEY() view returns (uint256)", - "function RSA_TYPE() view returns (uint256)", - "function addKey(bytes32,uint256,uint256) returns (bool)", - "function approve(uint256,bool) returns (bool)", - "function execute(address,uint256,bytes) returns (uint256)", - "function getKey(bytes32) view returns (uint256[], uint256, bytes32)", - "function getKeysByPurpose(uint256) view returns (bytes32[])", - "function keyHasPurpose(bytes32,uint256) view returns (bool)", - "function removeKey(bytes32,uint256) returns (bool)" -] diff --git a/contracts/facets/IexecOrderManagementFacet.sol b/contracts/facets/IexecOrderManagementFacet.sol index 81f0c9bf..bde717f7 100644 --- a/contracts/facets/IexecOrderManagementFacet.sol +++ b/contracts/facets/IexecOrderManagementFacet.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; import {IERC5313} from "@openzeppelin/contracts-v5/interfaces/IERC5313.sol"; -import {SignatureVerifier} from "./SignatureVerifier.v8.sol"; +import {SignatureVerifier} from "./SignatureVerifier.sol"; import {FacetBase} from "./FacetBase.v8.sol"; import {IexecOrderManagement} from "../interfaces/IexecOrderManagement.sol"; import {PocoStorageLib} from "../libs/PocoStorageLib.v8.sol"; diff --git a/contracts/facets/IexecPoco1Facet.sol b/contracts/facets/IexecPoco1Facet.sol index 15e73550..d81e7655 100644 --- a/contracts/facets/IexecPoco1Facet.sol +++ b/contracts/facets/IexecPoco1Facet.sol @@ -14,7 +14,7 @@ import {IexecPoco1} from "../interfaces/IexecPoco1.sol"; import {IexecPoco1Errors} from "../interfaces/IexecPoco1Errors.sol"; import {IexecEscrow} from "./IexecEscrow.v8.sol"; import {IexecPocoCommon} from "./IexecPocoCommon.sol"; -import {SignatureVerifier} from "./SignatureVerifier.v8.sol"; +import {SignatureVerifier} from "./SignatureVerifier.sol"; struct Matching { bytes32 apporderHash; diff --git a/contracts/facets/IexecPoco2Facet.sol b/contracts/facets/IexecPoco2Facet.sol index 18c130fa..f0c2499c 100644 --- a/contracts/facets/IexecPoco2Facet.sol +++ b/contracts/facets/IexecPoco2Facet.sol @@ -11,7 +11,7 @@ import {IexecLibOrders_v5} from "../libs/IexecLibOrders_v5.sol"; import {FacetBase} from "./FacetBase.v8.sol"; import {IexecPoco2} from "../interfaces/IexecPoco2.sol"; import {IexecEscrow} from "./IexecEscrow.v8.sol"; -import {SignatureVerifier} from "./SignatureVerifier.v8.sol"; +import {SignatureVerifier} from "./SignatureVerifier.sol"; contract IexecPoco2Facet is IexecPoco2, FacetBase, IexecEscrow, SignatureVerifier { modifier onlyScheduler(bytes32 _taskId) { diff --git a/contracts/facets/IexecPocoAccessorsFacet.sol b/contracts/facets/IexecPocoAccessorsFacet.sol index 9377ecf1..db5736ff 100644 --- a/contracts/facets/IexecPocoAccessorsFacet.sol +++ b/contracts/facets/IexecPocoAccessorsFacet.sol @@ -12,7 +12,7 @@ import {IApp} from "../registries/apps/IApp.v8.sol"; import {IWorkerpool} from "../registries/workerpools/IWorkerpool.v8.sol"; import {IexecPocoAccessors} from "../interfaces/IexecPocoAccessors.sol"; import {IexecPocoCommon} from "./IexecPocoCommon.sol"; -import {SignatureVerifier} from "./SignatureVerifier.v8.sol"; +import {SignatureVerifier} from "./SignatureVerifier.sol"; /** * @title Getters contract for PoCo facets. diff --git a/contracts/facets/IexecPocoBoostFacet.sol b/contracts/facets/IexecPocoBoostFacet.sol index 46e0b31b..3b4d9954 100644 --- a/contracts/facets/IexecPocoBoostFacet.sol +++ b/contracts/facets/IexecPocoBoostFacet.sol @@ -17,7 +17,7 @@ import {FacetBase} from "./FacetBase.v8.sol"; import {IexecPocoBoost} from "../interfaces/IexecPocoBoost.sol"; import {IexecEscrow} from "./IexecEscrow.v8.sol"; import {IexecPocoCommon} from "./IexecPocoCommon.sol"; -import {SignatureVerifier} from "./SignatureVerifier.v8.sol"; +import {SignatureVerifier} from "./SignatureVerifier.sol"; import {PocoStorageLib} from "../libs/PocoStorageLib.v8.sol"; // diff --git a/contracts/facets/SignatureVerifier.sol b/contracts/facets/SignatureVerifier.sol index 00dbd9c4..c1f6e468 100644 --- a/contracts/facets/SignatureVerifier.sol +++ b/contracts/facets/SignatureVerifier.sol @@ -1,159 +1,153 @@ // SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -pragma solidity ^0.6.0; -pragma experimental ABIEncoderV2; +pragma solidity ^0.8.0; -import "@iexec/solidity/contracts/ERC734/IERC734.sol"; -import "@iexec/solidity/contracts/ERC1271/IERC1271.sol"; -import "@iexec/solidity/contracts/ERC1654/IERC1654.sol"; -import {PocoStorageLib} from "../libs/PocoStorageLib.sol"; -import "./FacetBase.sol"; +import {IERC1271} from "@openzeppelin/contracts-v5/interfaces/IERC1271.sol"; +import {ECDSA} from "@openzeppelin/contracts-v5/utils/cryptography/ECDSA.sol"; +import {MessageHashUtils} from "@openzeppelin/contracts-v5/utils/cryptography/MessageHashUtils.sol"; +import {FacetBase} from "./FacetBase.v8.sol"; +import {IERC734} from "../external/interfaces/IERC734.sol"; +import {PocoStorageLib} from "../libs/PocoStorageLib.v8.sol"; contract SignatureVerifier is FacetBase { + using ECDSA for bytes32; + /** - * Prepare message/structure predicat used for signing + * Hash a Typed Data using the configured domain. + * @param structHash The original structure hash. */ - function _toEthSignedMessage(bytes32 _msgHash) internal pure returns (bytes memory) { - return abi.encodePacked("\x19Ethereum Signed Message:\n32", _msgHash); + function _toTypedDataHash(bytes32 structHash) internal view returns (bytes32) { + PocoStorageLib.PocoStorage storage $ = PocoStorageLib.getPocoStorage(); + return MessageHashUtils.toTypedDataHash($.m_eip712DomainSeparator, structHash); } - function _toEthTypedStruct( - bytes32 _structHash, - bytes32 _domainHash - ) internal pure returns (bytes memory) { - return abi.encodePacked("\x19\x01", _domainHash, _structHash); + /** + * @notice Verify that an Ethereum Signed Message is signed by a particular account. + * @param account The expected signer account. + * @param message The original message that was signed. + * @param signature The signature to be verified. + */ + function _verifySignatureOfEthSignedMessage( + address account, + bytes memory message, + bytes calldata signature + ) internal view returns (bool) { + return + _verifySignature( + account, + MessageHashUtils.toEthSignedMessageHash(keccak256(message)), + signature + ); } /** - * recover EOA signature (support both 65 bytes traditional and 64 bytes format EIP2098 format) + * @notice Verify that a message is signed by an EOA or an ERC1271 smart contract. + * + * It supports short signatures. + * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] + * & https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4915 + * https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.0/contracts/utils/cryptography/ECDSA.sol#L112 + * + * @param account The expected signer account. + * @param messageHash The message hash that was signed. + * @param signature The signature to be verified. */ - function _recover(bytes32 _hash, bytes memory _sign) internal pure returns (address) { - bytes32 r; - bytes32 s; - uint8 v; - - if (_sign.length == 65) // 65bytes: (r,s,v) form - { - assembly { - r := mload(add(_sign, 0x20)) - s := mload(add(_sign, 0x40)) - v := byte(0, mload(add(_sign, 0x60))) - } - } else if (_sign.length == 64) // 64bytes: (r,vs) form → see EIP2098 - { - assembly { - r := mload(add(_sign, 0x20)) - s := and( - mload(add(_sign, 0x40)), - 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - ) - v := shr(7, byte(0, mload(add(_sign, 0x40)))) - } + function _verifySignature( + address account, + bytes32 messageHash, + bytes calldata signature + ) internal view returns (bool) { + // When the account is a smart contract, delegate signature verification. + if (account.code.length > 0) { + try IERC1271(account).isValidSignature(messageHash, signature) returns (bytes4 result) { + return result == IERC1271.isValidSignature.selector; + } catch {} + return false; + } + // When the account is an EoA, check signature validity. + address recoveredAddress = address(0); // Initialize local variable + if (signature.length == 65) { + //slither-disable-next-line unused-return + (recoveredAddress, , ) = messageHash.tryRecover(signature); + } else if (signature.length == 64) { + //slither-disable-next-line unused-return + (recoveredAddress, , ) = messageHash.tryRecover( // short signature + bytes32(signature[:32]), + bytes32(signature[32:]) + ); } else { revert("invalid-signature-format"); } - - if (v < 27) v += 27; - require(v == 27 || v == 28, "invalid-signature-v"); - return ecrecover(_hash, v, r, s); + return recoveredAddress == account; } /** - * Check if contract exist, otherwize assumed to be EOA + * @notice Verify that a message hash is presigned by a particular account. + * @param account The expected presigner account. + * @param messageHash The message hash that was presigned. */ - function _isContract(address account) internal view returns (bool) { - // According to EIP-1052, 0x0 is the value returned for not-yet created accounts - // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned - // for accounts without code, i.e. `keccak256('')` - bytes32 codehash; - bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; - // solhint-disable-next-line no-inline-assembly - assembly { - codehash := extcodehash(account) - } - return (codehash != accountHash && codehash != 0x0); + function _verifyPresignature( + address account, + bytes32 messageHash + ) internal view returns (bool) { + PocoStorageLib.PocoStorage storage $ = PocoStorageLib.getPocoStorage(); + return account != address(0) && account == $.m_presigned[messageHash]; } /** - * Address to bytes32 casting to ERC734 + * @notice Verify that a message hash is signed or presigned by a particular account. + * @param account The expected signer or presigner account. + * @param messageHash The message hash that was signed or presigned. + * @param signature The signature to be verified. Not required for a presignature. */ - function _addrToKey(address _addr) internal pure returns (bytes32) { - return bytes32(uint256(_addr)); + function _verifySignatureOrPresignature( + address account, + bytes32 messageHash, + bytes calldata signature + ) internal view returns (bool) { + return + _verifyPresignature(account, messageHash) || + _verifySignature(account, messageHash, signature); } /** - * Identity verification + * @notice + * This function makes an external call to an untrusted contract. It has to + * be carefully called to avoid creating re-entrancy vulnerabilities. Calls to this function + * has to be done before updating state variables. + * + * @notice Verify that an account is authorized based on a given restriction. + * The given restriction can be: + * (1) `0x`: No restriction, accept any address; + * (2) `0x`: Only accept the exact same address; + * (3) `0x`: Accept any address in a group (having + * the given `GROUPMEMBER` purpose) inside an ERC734 Key Manager identity + * contract. + * @param restriction A simple address or an ERC734 identity contract + * that might whitelist a given address in a group. + * @param account An address to be checked. */ - function _checkIdentity( - address _identity, - address _candidate, - uint256 _purpose - ) internal view returns (bool valid) { - return - _identity == _candidate || - IERC734(_identity).keyHasPurpose(_addrToKey(_candidate), _purpose); // Simple address || ERC 734 identity contract - } - - function _checkPresignature(address _identity, bytes32 _hash) internal view returns (bool) { - PocoStorageLib.PocoStorage storage $ = PocoStorageLib.getPocoStorage(); - return _identity != address(0) && _identity == $.m_presigned[_hash]; - } - - function _checkSignature( - address _identity, - bytes32 _hash, - bytes memory _signature + function _isAccountAuthorizedByRestriction( + address restriction, + address account ) internal view returns (bool) { - if (_isContract(_identity)) { - try IERC1654(_identity).isValidSignature(_hash, _signature) returns (bytes4 value) { - return value == IERC1654(0).isValidSignature.selector; - } catch (bytes memory /*lowLevelData*/) {} - - return false; - } else { - return _recover(_hash, _signature) == _identity; + if ( + restriction == address(0) || // No restriction + restriction == account // Simple address restriction + ) { + return true; } - } - - function _checkSignature( - address _identity, - bytes memory _predicat, - bytes memory _signature - ) internal view returns (bool) { - if (_isContract(_identity)) { - try IERC1271(_identity).isValidSignature(_predicat, _signature) returns (bytes4 value) { - return value == IERC1271(0).isValidSignature.selector; - } catch (bytes memory /*lowLevelData*/) {} - - try IERC1654(_identity).isValidSignature(keccak256(_predicat), _signature) returns ( - bytes4 value - ) { - return value == IERC1654(0).isValidSignature.selector; - } catch (bytes memory /*lowLevelData*/) {} - - return false; - } else { - return _recover(keccak256(_predicat), _signature) == _identity; + if (restriction.code.length > 0) { + try + IERC734(restriction).keyHasPurpose( // ERC734 identity contract restriction + bytes32(uint256(uint160(account))), + GROUPMEMBER_PURPOSE + ) + returns (bool success) { + return success; + } catch {} } - } - - function _checkPresignatureOrSignature( - address _identity, - bytes32 _hash, - bytes memory _signature - ) internal view returns (bool) { - return - _checkPresignature(_identity, _hash) || _checkSignature(_identity, _hash, _signature); - } - - function _checkPresignatureOrSignature( - address _identity, - bytes memory _predicat, - bytes memory _signature - ) internal view returns (bool) { - return - _checkPresignature(_identity, keccak256(_predicat)) || - _checkSignature(_identity, _predicat, _signature); + return false; } } diff --git a/contracts/facets/SignatureVerifier.v8.sol b/contracts/facets/SignatureVerifier.v8.sol deleted file mode 100644 index 4f8a9bda..00000000 --- a/contracts/facets/SignatureVerifier.v8.sol +++ /dev/null @@ -1,153 +0,0 @@ -// SPDX-FileCopyrightText: 2024-2025 IEXEC BLOCKCHAIN TECH -// SPDX-License-Identifier: Apache-2.0 - -pragma solidity ^0.8.0; - -import {IERC1271} from "@openzeppelin/contracts-v5/interfaces/IERC1271.sol"; -import {ECDSA} from "@openzeppelin/contracts-v5/utils/cryptography/ECDSA.sol"; -import {MessageHashUtils} from "@openzeppelin/contracts-v5/utils/cryptography/MessageHashUtils.sol"; -import {FacetBase} from "./FacetBase.v8.sol"; -import {IERC734} from "../external/interfaces/IERC734.sol"; -import {PocoStorageLib} from "../libs/PocoStorageLib.v8.sol"; - -contract SignatureVerifier is FacetBase { - using ECDSA for bytes32; - - /** - * Hash a Typed Data using the configured domain. - * @param structHash The original structure hash. - */ - function _toTypedDataHash(bytes32 structHash) internal view returns (bytes32) { - PocoStorageLib.PocoStorage storage $ = PocoStorageLib.getPocoStorage(); - return MessageHashUtils.toTypedDataHash($.m_eip712DomainSeparator, structHash); - } - - /** - * @notice Verify that an Ethereum Signed Message is signed by a particular account. - * @param account The expected signer account. - * @param message The original message that was signed. - * @param signature The signature to be verified. - */ - function _verifySignatureOfEthSignedMessage( - address account, - bytes memory message, - bytes calldata signature - ) internal view returns (bool) { - return - _verifySignature( - account, - MessageHashUtils.toEthSignedMessageHash(keccak256(message)), - signature - ); - } - - /** - * @notice Verify that a message is signed by an EOA or an ERC1271 smart contract. - * - * It supports short signatures. - * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] - * & https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4915 - * https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.0/contracts/utils/cryptography/ECDSA.sol#L112 - * - * @param account The expected signer account. - * @param messageHash The message hash that was signed. - * @param signature The signature to be verified. - */ - function _verifySignature( - address account, - bytes32 messageHash, - bytes calldata signature - ) internal view returns (bool) { - // When the account is a smart contract, delegate signature verification. - if (account.code.length > 0) { - try IERC1271(account).isValidSignature(messageHash, signature) returns (bytes4 result) { - return result == IERC1271.isValidSignature.selector; - } catch {} - return false; - } - // When the account is an EoA, check signature validity. - address recoveredAddress = address(0); // Initialize local variable - if (signature.length == 65) { - //slither-disable-next-line unused-return - (recoveredAddress, , ) = messageHash.tryRecover(signature); - } else if (signature.length == 64) { - //slither-disable-next-line unused-return - (recoveredAddress, , ) = messageHash.tryRecover( // short signature - bytes32(signature[:32]), - bytes32(signature[32:]) - ); - } else { - revert("invalid-signature-format"); - } - return recoveredAddress == account; - } - - /** - * @notice Verify that a message hash is presigned by a particular account. - * @param account The expected presigner account. - * @param messageHash The message hash that was presigned. - */ - function _verifyPresignature( - address account, - bytes32 messageHash - ) internal view returns (bool) { - PocoStorageLib.PocoStorage storage $ = PocoStorageLib.getPocoStorage(); - return account != address(0) && account == $.m_presigned[messageHash]; - } - - /** - * @notice Verify that a message hash is signed or presigned by a particular account. - * @param account The expected signer or presigner account. - * @param messageHash The message hash that was signed or presigned. - * @param signature The signature to be verified. Not required for a presignature. - */ - function _verifySignatureOrPresignature( - address account, - bytes32 messageHash, - bytes calldata signature - ) internal view returns (bool) { - return - _verifyPresignature(account, messageHash) || - _verifySignature(account, messageHash, signature); - } - - /** - * @notice - * This function makes an external call to an untrusted contract. It has to - * be carefully called to avoid creating re-entrancy vulnerabilities. Calls to this function - * has to be done before updating state variables. - * - * @notice Verify that an account is authorized based on a given restriction. - * The given restriction can be: - * (1) `0x`: No restriction, accept any address; - * (2) `0x`: Only accept the exact same address; - * (3) `0x`: Accept any address in a group (having - * the given `GROUPMEMBER` purpose) inside an ERC734 Key Manager identity - * contract. - * @param restriction A simple address or an ERC734 identity contract - * that might whitelist a given address in a group. - * @param account An address to be checked. - */ - function _isAccountAuthorizedByRestriction( - address restriction, - address account - ) internal view returns (bool) { - if ( - restriction == address(0) || // No restriction - restriction == account // Simple address restriction - ) { - return true; - } - if (restriction.code.length > 0) { - try - IERC734(restriction).keyHasPurpose( // ERC734 identity contract restriction - bytes32(uint256(uint160(account))), - GROUPMEMBER_PURPOSE - ) - returns (bool success) { - return success; - } catch {} - } - return false; - } -} diff --git a/docs/uml/class-uml-IexecEscrows.svg b/docs/uml/class-uml-IexecEscrows.svg index a7ca0c00..9a48db4a 100644 --- a/docs/uml/class-uml-IexecEscrows.svg +++ b/docs/uml/class-uml-IexecEscrows.svg @@ -4,824 +4,314 @@ - - + + UmlClassDiagram - + 5 - -<<Abstract>> -FacetBase -contracts/facets/FacetBase.v8.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: -    _msgSender(): address + +<<Abstract>> +FacetBase +contracts/facets/FacetBase.v8.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: +    _msgSender(): address 10 - -IexecERC20Core -contracts/facets/IexecERC20Core.sol - -Internal: -    _transferUnchecked(sender: address, recipient: address, amount: uint256) -    _transfer(sender: address, recipient: address, amount: 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) + +IexecERC20Core +contracts/facets/IexecERC20Core.sol + +Internal: +    _transferUnchecked(sender: address, recipient: address, amount: uint256) +    _transfer(sender: address, recipient: address, amount: 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) 12 - -IexecEscrow -contracts/facets/IexecEscrow.v8.sol - -Private: -    _transfer(from: address, to: address, value: uint256) -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) -Public: -    <<event>> Transfer(from: address, to: address, value: uint256) -    <<event>> Lock(owner: address, amount: uint256) -    <<event>> Unlock(owner: address, amount: uint256) -    <<event>> Reward(owner: address, amount: uint256, ref: bytes32) -    <<event>> Seize(owner: address, amount: uint256, ref: bytes32) + +IexecEscrow +contracts/facets/IexecEscrow.v8.sol + +Private: +    _transfer(from: address, to: address, value: uint256) +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) +Public: +    <<event>> Transfer(from: address, to: address, value: uint256) +    <<event>> Lock(owner: address, amount: uint256) +    <<event>> Unlock(owner: address, amount: uint256) +    <<event>> Reward(owner: address, amount: uint256, ref: bytes32) +    <<event>> Seize(owner: address, amount: uint256, ref: bytes32) 12->5 - - + + - - -73 - -<<Library>> -PocoStorageLib -contracts/libs/PocoStorageLib.v8.sol - -Private: -   POCO_STORAGE_LOCATION: bytes32 - -Internal: -    getPocoStorage(): ($: PocoStorage) - - + + +70 + +<<Library>> +PocoStorageLib +contracts/libs/PocoStorageLib.v8.sol + +Private: +   POCO_STORAGE_LOCATION: bytes32 + +Internal: +    getPocoStorage(): ($: PocoStorage) + + -12->73 - - - - - -74 - -<<Struct>> -PocoStorage -contracts/libs/PocoStorageLib.v8.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: address -m_v3_scoreImported: mapping(address=>bool) -m_dealsBoost: mapping(bytes32=>IexecLibCore_v5.DealBoost) +12->70 + + - + + +71 + +<<Struct>> +PocoStorage +contracts/libs/PocoStorageLib.v8.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: address +m_v3_scoreImported: mapping(address=>bool) +m_dealsBoost: mapping(bytes32=>IexecLibCore_v5.DealBoost) + + -12->74 - - +12->71 + + 13 - -IexecEscrowNativeFacet -contracts/facets/IexecEscrowNativeFacet.sol - -Internal: -   nRLCtoWei: uint256 - -Internal: -    _deposit(target: address) -    _withdraw(to: address, value: uint256) -External: -    <<payable>> null() -    <<payable>> null() -    <<payable>> deposit(): bool -    <<payable>> depositFor(target: address): bool -    <<payable>> depositForArray(amounts: uint256[], targets: address[]): bool -    withdraw(amount: uint256): bool -    withdrawTo(amount: uint256, target: address): bool -    recover(): uint256 <<onlyOwner>> + +IexecEscrowNativeFacet +contracts/facets/IexecEscrowNativeFacet.sol + +Internal: +   nRLCtoWei: uint256 + +Internal: +    _deposit(target: address) +    _withdraw(to: address, value: uint256) +External: +    <<payable>> null() +    <<payable>> null() +    <<payable>> deposit(): bool +    <<payable>> depositFor(target: address): bool +    <<payable>> depositForArray(amounts: uint256[], targets: address[]): bool +    withdraw(amount: uint256): bool +    withdrawTo(amount: uint256, target: address): bool +    recover(): uint256 <<onlyOwner>> 13->10 - - + + - - -34 - -<<Interface>> -IexecEscrowNative -contracts/interfaces/IexecEscrowNative.sol - -External: -     null() -     null() -     deposit(): bool -     depositFor(address): bool -     depositForArray(uint256[], address[]): bool -     withdraw(uint256): bool -     withdrawTo(uint256, address): bool -     recover(): uint256 - - + + +32 + +<<Interface>> +IexecEscrowNative +contracts/interfaces/IexecEscrowNative.sol + +External: +     null() +     null() +     deposit(): bool +     depositFor(address): bool +     depositForArray(uint256[], address[]): bool +     withdraw(uint256): bool +     withdrawTo(uint256, address): bool +     recover(): uint256 + + -13->34 - - +13->32 + + 14 - -IexecEscrowTokenFacet -contracts/facets/IexecEscrowTokenFacet.sol - -Internal: -    _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, bytes): bool + +IexecEscrowTokenFacet +contracts/facets/IexecEscrowTokenFacet.sol + +Internal: +    _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, bytes): bool 14->10 - - - - - -35 - -<<Interface>> -IexecEscrowToken -contracts/interfaces/IexecEscrowToken.sol - -External: -     null() -     null() -     deposit(uint256): bool -     depositFor(uint256, address): bool -     depositForArray(uint256[], address[]): bool -     withdraw(uint256): bool -     withdrawTo(uint256, address): bool -     recover(): uint256 + + - + + +33 + +<<Interface>> +IexecEscrowToken +contracts/interfaces/IexecEscrowToken.sol + +External: +     null() +     null() +     deposit(uint256): bool +     depositFor(uint256, address): bool +     depositForArray(uint256[], address[]): bool +     withdraw(uint256): bool +     withdrawTo(uint256, address): bool +     recover(): uint256 + + -14->35 - - - - - -45 - -<<Interface>> -IexecTokenSpender -contracts/interfaces/IexecTokenSpender.sol - -External: -     receiveApproval(address, uint256, address, bytes): bool +14->33 + + - + + +42 + +<<Interface>> +IexecTokenSpender +contracts/interfaces/IexecTokenSpender.sol + +External: +     receiveApproval(address, uint256, address, bytes): bool + + -14->45 - - - - - -15 - -IexecEscrowTokenSwapFacet -contracts/facets/IexecEscrowTokenSwapFacet.sol - -Internal: -   router: IUniswapV2Router02 - -Internal: -    _eth2token(): address[] -    _token2eth(): address[] -    _deposit(target: address, value: uint256, minimum: uint256) -    _request(target: address, value: uint256, amount: uint256) -    _withdraw(target: address, amount: uint256, minimum: uint256) -External: -    <<payable>> null() -    <<payable>> null() -    <<payable>> depositEth() -    <<payable>> depositEthFor(target: address) -    <<payable>> safeDepositEth(minimum: uint256) -    <<payable>> safeDepositEthFor(minimum: uint256, target: address) -    <<payable>> requestToken(amount: uint256) -    <<payable>> requestTokenFor(amount: uint256, target: address) -    UniswapV2Router(): IUniswapV2Router02 -    estimateDepositEthSent(eth: uint256): (token: uint256) -    estimateDepositTokenWanted(token: uint256): (eth: uint256) -    estimateWithdrawTokenSent(token: uint256): (eth: uint256) -    estimateWithdrawEthWanted(eth: uint256): (token: uint256) -    withdrawEth(amount: uint256) -    withdrawEthTo(amount: uint256, target: address) -    safeWithdrawEth(amount: uint256, minimum: uint256) -    safeWithdrawEthTo(amount: uint256, minimum: uint256, target: address) -Public: -    <<payable>> matchOrdersWithEth(_apporder: IexecLibOrders_v5.AppOrder, _datasetorder: IexecLibOrders_v5.DatasetOrder, _workerpoolorder: IexecLibOrders_v5.WorkerpoolOrder, _requestorder: IexecLibOrders_v5.RequestOrder): bytes32 - - - -15->10 - - +14->42 + + - + 25 - -SignatureVerifier -contracts/facets/SignatureVerifier.sol - -Internal: -    _toEthSignedMessage(_msgHash: bytes32): bytes -    _toEthTypedStruct(_structHash: bytes32, _domainHash: bytes32): bytes -    _recover(_hash: bytes32, _sign: bytes): address -    _isContract(account: address): bool -    _addrToKey(_addr: address): bytes32 -    _checkIdentity(_identity: address, _candidate: address, _purpose: uint256): (valid: bool) -    _checkPresignature(_identity: address, _hash: bytes32): bool -    _checkSignature(_identity: address, _hash: bytes32, _signature: bytes): bool -    _checkSignature(_identity: address, _predicat: bytes, _signature: bytes): bool -    _checkPresignatureOrSignature(_identity: address, _hash: bytes32, _signature: bytes): bool -    _checkPresignatureOrSignature(_identity: address, _predicat: bytes, _signature: bytes): bool - - - -15->25 - - - - - -36 - -<<Interface>> -IexecEscrowTokenSwap -contracts/interfaces/IexecEscrowTokenSwap.sol - -External: -     null() -     null() -     UniswapV2Router(): IUniswapV2Router02 -     estimateDepositEthSent(uint256): uint256 -     estimateDepositTokenWanted(uint256): uint256 -     estimateWithdrawTokenSent(uint256): uint256 -     estimateWithdrawEthWanted(uint256): uint256 -     depositEth() -     depositEthFor(address) -     safeDepositEth(uint256) -     safeDepositEthFor(uint256, address) -     requestToken(uint256) -     requestTokenFor(uint256, address) -     withdrawEth(uint256) -     withdrawEthTo(uint256, address) -     safeWithdrawEth(uint256, uint256) -     safeWithdrawEthTo(uint256, uint256, address) -     matchOrdersWithEth(IexecLibOrders_v5.AppOrder, IexecLibOrders_v5.DatasetOrder, IexecLibOrders_v5.WorkerpoolOrder, IexecLibOrders_v5.RequestOrder): bytes32 - - - -15->36 - - + +<<Interface>> +IOwnable +contracts/interfaces/IOwnable.sol + +External: +     owner(): address +     renounceOwnership() +     transferOwnership(address) +Public: +    <<event>> OwnershipTransferred(previousOwner: address, newOwner: address) + + + +43 + +<<Library>> +IexecLibCore_v5 +contracts/libs/IexecLibCore_v5.sol - - -38 - -<<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) + + +70->71 + + - + -15->38 - - - - - -27 - -<<Interface>> -IOwnable -contracts/interfaces/IOwnable.sol - -External: -     owner(): address -     renounceOwnership() -     transferOwnership(address) -Public: -    <<event>> OwnershipTransferred(previousOwner: address, newOwner: address) - - - -60 - -<<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 - - - -36->60 - - - - - -38->60 - - - - - -63 - -<<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 - - - -38->63 - - - - - -64 - -<<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 - - - -38->64 - - - - - -65 - -<<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 - - - -38->65 - - - - - -66 - -<<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 - - - -38->66 - - +71->43 + + - - -46 - -<<Library>> -IexecLibCore_v5 -contracts/libs/IexecLibCore_v5.sol - - - -62 - -<<Struct>> -EIP712Domain -contracts/libs/IexecLibOrders_v5.sol - -name: string -version: string -chainId: uint256 -verifyingContract: address - - - -60->62 - - - - - -60->63 - - - - - -60->64 - - - - - -60->65 - - - - - -60->66 - - - - - -67 - -<<Struct>> -AppOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: AppOrder -operation: OrderOperationEnum -sign: bytes - - - -60->67 - - - - - -68 - -<<Struct>> -DatasetOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: DatasetOrder -operation: OrderOperationEnum -sign: bytes - - - -60->68 - - - - - -69 - -<<Struct>> -WorkerpoolOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: WorkerpoolOrder -operation: OrderOperationEnum -sign: bytes - - - -60->69 - - - - - -70 - -<<Struct>> -RequestOrderOperation -contracts/libs/IexecLibOrders_v5.sol - -order: RequestOrder -operation: OrderOperationEnum -sign: bytes - - - -60->70 - - - - - -61 - -<<Enum>> -OrderOperationEnum -contracts/libs/IexecLibOrders_v5.sol - -SIGN: 0 -CLOSE: 1 - - - -61->60 - - - - - -62->60 - - - - - -63->60 - - - - - -64->60 - - - - - -65->60 - - - - - -66->60 - - - - - -67->60 - - - - - -67->61 - - - - - -67->63 - - - - - -68->60 - - - - - -68->61 - - - - - -68->64 - - - - - -69->60 - - - - - -69->61 - - - - - -69->65 - - - - - -70->60 - - - - - -70->61 - - - - - -70->66 - - - - - -73->74 - - - - - -74->46 - - - - - -74->73 - - - - - -75 - -<<Interface>> -IRegistry -contracts/libs/PocoStorageLib.v8.sol - -External: -     isRegistered(_entry: address): bool + + +71->70 + + - - -74->75 - - + + +72 + +<<Interface>> +IRegistry +contracts/libs/PocoStorageLib.v8.sol + +External: +     isRegistered(_entry: address): bool + + + +71->72 + + diff --git a/docs/uml/class-uml-IexecPocoBoostFacet.svg b/docs/uml/class-uml-IexecPocoBoostFacet.svg index 25a9ac68..57c11163 100644 --- a/docs/uml/class-uml-IexecPocoBoostFacet.svg +++ b/docs/uml/class-uml-IexecPocoBoostFacet.svg @@ -9,9 +9,9 @@ UmlClassDiagram - + -81 +77 <<Interface>> IOracleConsumer @@ -68,9 +68,9 @@ - + -73 +70 <<Library>> PocoStorageLib @@ -82,15 +82,15 @@ Internal:    getPocoStorage(): ($: PocoStorage) - + -12->73 +12->70 - + -74 +71 <<Struct>> PocoStorage @@ -122,15 +122,15 @@ m_v3_scoreImported: mapping(address=>bool) m_dealsBoost: mapping(bytes32=>IexecLibCore_v5.DealBoost) - + -12->74 +12->71 - + -22 +21 IexecPocoBoostFacet contracts/facets/IexecPocoBoostFacet.sol @@ -144,27 +144,27 @@    pushResultBoost(dealId: bytes32, index: uint256, results: bytes, resultsCallback: bytes, authorizationSign: bytes, enclaveChallenge: address, enclaveSign: bytes)    claimBoost(dealId: bytes32, index: uint256) - + -22->81 +21->77 - + -22->5 +21->5 - + -22->12 +21->12 - + -23 +22 IexecPocoCommon contracts/facets/IexecPocoCommon.sol @@ -172,18 +172,18 @@ Internal:    _computeDealVolume(appOrderVolume: uint256, appOrderTypedDataHash: bytes32, hasDataset: bool, datasetOrderVolume: uint256, datasetOrderTypedDataHash: bytes32, workerpoolOrderVolume: uint256, workerpoolOrderTypedDataHash: bytes32, requestOrderVolume: uint256, requestOrderTypedDataHash: bytes32): uint256 - + -22->23 +21->22 - + -26 +24 SignatureVerifier -contracts/facets/SignatureVerifier.v8.sol +contracts/facets/SignatureVerifier.sol Internal:    _toTypedDataHash(structHash: bytes32): bytes32 @@ -193,15 +193,15 @@    _verifySignatureOrPresignature(account: address, messageHash: bytes32, signature: bytes): bool    _isAccountAuthorizedByRestriction(restriction: address, account: address): bool - + -22->26 +21->24 - + -42 +39 <<Interface>> IexecPocoBoost @@ -219,29 +219,29 @@    <<event>> TaskClaimed(taskid: bytes32)    <<event>> DealSponsoredBoost(dealId: bytes32, sponsor: address) - + -22->42 +21->39 - + -46 +43 <<Library>> IexecLibCore_v5 contracts/libs/IexecLibCore_v5.sol - + -22->46 +21->43 - + -54 +51 <<Struct>> DealBoost @@ -262,15 +262,15 @@ shortTag: bytes3 sponsor: address - + -22->54 +21->51 - + -55 +52 <<Enum>> TaskStatusEnum @@ -282,15 +282,15 @@ COMPLETED: 3 FAILED: 4 - + -22->55 +21->52 - + -56 +53 <<Struct>> Task @@ -312,15 +312,15 @@ resultsTimestamp: uint256 resultsCallback: bytes - + -22->56 +21->53 - + -60 +57 <<Library>> IexecLibOrders_v5 @@ -348,15 +348,15 @@    hash(_workerpoolorderoperation: WorkerpoolOrderOperation): bytes32    hash(_requestorderoperation: RequestOrderOperation): bytes32 - + -22->60 +21->57 - + -63 +60 <<Struct>> AppOrder @@ -372,15 +372,15 @@ salt: bytes32 sign: bytes - + -22->63 +21->60 - + -64 +61 <<Struct>> DatasetOrder @@ -396,15 +396,15 @@ salt: bytes32 sign: bytes - + -22->64 +21->61 - + -65 +62 <<Struct>> WorkerpoolOrder @@ -422,15 +422,15 @@ salt: bytes32 sign: bytes - + -22->65 +21->62 - + -66 +63 <<Struct>> RequestOrder @@ -453,27 +453,27 @@ salt: bytes32 sign: bytes - + -22->66 +21->63 - + -22->73 +21->70 - + -22->74 +21->71 - + -88 +84 <<Interface>> IWorkerpool @@ -485,111 +485,111 @@     m_schedulerRewardRatioPolicy(): uint256     m_workerStakeRatioPolicy(): uint256 - + -22->88 +21->84 - + -23->5 +22->5 - + -23->60 +22->57 - + -23->73 +22->70 - + -23->74 +22->71 - + -26->5 +24->5 - + -26->73 +24->70 - + -26->74 +24->71 - + -42->60 +39->57 - + -42->63 +39->60 - + -42->64 +39->61 - + -42->65 +39->62 - + -42->66 +39->63 - + -54->46 +51->43 - + -55->46 +52->43 - + -56->46 +53->43 - + -56->55 +53->52 - + -62 +59 <<Struct>> EIP712Domain @@ -600,39 +600,39 @@ chainId: uint256 verifyingContract: address - + -60->62 +57->59 - + -60->63 +57->60 - + -60->64 +57->61 - + -60->65 +57->62 - + -60->66 +57->63 - + -67 +64 <<Struct>> AppOrderOperation @@ -642,15 +642,15 @@ operation: OrderOperationEnum sign: bytes - + -60->67 +57->64 - + -68 +65 <<Struct>> DatasetOrderOperation @@ -660,15 +660,15 @@ operation: OrderOperationEnum sign: bytes - + -60->68 +57->65 - + -69 +66 <<Struct>> WorkerpoolOrderOperation @@ -678,15 +678,15 @@ operation: OrderOperationEnum sign: bytes - + -60->69 +57->66 - + -70 +67 <<Struct>> RequestOrderOperation @@ -696,15 +696,15 @@ operation: OrderOperationEnum sign: bytes - + -60->70 +57->67 - + -61 +58 <<Enum>> OrderOperationEnum @@ -713,135 +713,135 @@ SIGN: 0 CLOSE: 1 - + -61->60 +58->57 - + -62->60 +59->57 - + -63->60 +60->57 - + -64->60 +61->57 - + -65->60 +62->57 - + -66->60 +63->57 - + -67->60 +64->57 - + -67->61 +64->58 - + -67->63 +64->60 - + -68->60 +65->57 - + -68->61 +65->58 - + -68->64 +65->61 - + -69->60 +66->57 - + -69->61 +66->58 - + -69->65 +66->62 - + -70->60 +67->57 - + -70->61 +67->58 - + -70->66 +67->63 - + -73->74 +70->71 - + -74->46 +71->43 - + -74->73 +71->70 - + -75 +72 <<Interface>> IRegistry @@ -850,9 +850,9 @@ External:     isRegistered(_entry: address): bool - + -74->75 +71->72 diff --git a/docs/uml/class-uml-IexecPocoFacets.svg b/docs/uml/class-uml-IexecPocoFacets.svg index 6c3a17fc..1bf0a710 100644 --- a/docs/uml/class-uml-IexecPocoFacets.svg +++ b/docs/uml/class-uml-IexecPocoFacets.svg @@ -57,9 +57,9 @@ - + -73 +70 <<Library>> PocoStorageLib @@ -71,15 +71,15 @@ Internal:    getPocoStorage(): ($: PocoStorage) - + -12->73 +12->70 - + -74 +71 <<Struct>> PocoStorage @@ -111,15 +111,15 @@ m_v3_scoreImported: mapping(address=>bool) m_dealsBoost: mapping(bytes32=>IexecLibCore_v5.DealBoost) - + -12->74 +12->71 - + -17 +16 <<Struct>> Matching @@ -134,9 +134,9 @@ requestorderHash: bytes32 hasDataset: bool - + -18 +17 IexecPoco1Facet contracts/facets/IexecPoco1Facet.sol @@ -151,27 +151,27 @@    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 - + -18->5 +17->5 - + -18->12 +17->12 - + -18->17 +17->16 - + -23 +22 IexecPocoCommon contracts/facets/IexecPocoCommon.sol @@ -179,18 +179,18 @@ Internal:    _computeDealVolume(appOrderVolume: uint256, appOrderTypedDataHash: bytes32, hasDataset: bool, datasetOrderVolume: uint256, datasetOrderTypedDataHash: bytes32, workerpoolOrderVolume: uint256, workerpoolOrderTypedDataHash: bytes32, requestOrderVolume: uint256, requestOrderTypedDataHash: bytes32): uint256 - + -18->23 +17->22 - + -26 +24 SignatureVerifier -contracts/facets/SignatureVerifier.v8.sol +contracts/facets/SignatureVerifier.sol Internal:    _toTypedDataHash(structHash: bytes32): bytes32 @@ -200,15 +200,15 @@    _verifySignatureOrPresignature(account: address, messageHash: bytes32, signature: bytes): bool    _isAccountAuthorizedByRestriction(restriction: address, account: address): bool - + -18->26 +17->24 - + -38 +35 <<Interface>> IexecPoco1 @@ -226,43 +226,43 @@    <<event>> OrdersMatched(dealid: bytes32, appHash: bytes32, datasetHash: bytes32, workerpoolHash: bytes32, requestHash: bytes32, volume: uint256)    <<event>> DealSponsored(dealId: bytes32, sponsor: address) - + -18->38 +17->35 - + -39 +36 <<Interface>> IexecPoco1Errors contracts/interfaces/IexecPoco1Errors.sol - + -18->39 +17->36 - + -46 +43 <<Library>> IexecLibCore_v5 contracts/libs/IexecLibCore_v5.sol - + -18->46 +17->43 - + -53 +50 <<Struct>> Deal @@ -285,15 +285,15 @@ schedulerRewardRatio: uint256 sponsor: address - + -18->53 +17->50 - + -60 +57 <<Library>> IexecLibOrders_v5 @@ -321,15 +321,15 @@    hash(_workerpoolorderoperation: WorkerpoolOrderOperation): bytes32    hash(_requestorderoperation: RequestOrderOperation): bytes32 - + -18->60 +17->57 - + -63 +60 <<Struct>> AppOrder @@ -345,15 +345,15 @@ salt: bytes32 sign: bytes - + -18->63 +17->60 - + -64 +61 <<Struct>> DatasetOrder @@ -369,15 +369,15 @@ salt: bytes32 sign: bytes - + -18->64 +17->61 - + -65 +62 <<Struct>> WorkerpoolOrder @@ -395,15 +395,15 @@ salt: bytes32 sign: bytes - + -18->65 +17->62 - + -66 +63 <<Struct>> RequestOrder @@ -426,27 +426,27 @@ salt: bytes32 sign: bytes - + -18->66 +17->63 - + -18->73 +17->70 - + -18->74 +17->71 - + -88 +84 <<Interface>> IWorkerpool @@ -458,15 +458,15 @@     m_schedulerRewardRatioPolicy(): uint256     m_workerStakeRatioPolicy(): uint256 - + -18->88 +17->84 - + -19 +18 IexecPoco2Facet contracts/facets/IexecPoco2Facet.sol @@ -492,27 +492,27 @@    initialize(_dealid: bytes32, idx: uint256): bytes32    claim(_taskid: bytes32) - + -19->5 +18->5 - + -19->12 +18->12 - + -19->26 +18->24 - + -40 +37 <<Interface>> IexecPoco2 @@ -540,27 +540,27 @@    <<event>> TaskFinalize(taskid: bytes32, results: bytes)    <<event>> TaskClaimed(taskid: bytes32) - + -19->40 +18->37 - + -19->46 +18->43 - + -19->53 +18->50 - + -56 +53 <<Struct>> Task @@ -582,15 +582,15 @@ resultsTimestamp: uint256 resultsCallback: bytes - + -19->56 +18->53 - + -57 +54 <<Struct>> Consensus @@ -599,15 +599,15 @@ group: mapping(bytes32=>uint256) total: uint256 - + -19->57 +18->54 - + -59 +56 <<Struct>> Contribution @@ -619,99 +619,99 @@ enclaveChallenge: address weight: uint256 - + -19->59 +18->56 - + -19->73 +18->70 - + -19->74 +18->71 - + -23->5 +22->5 - + -23->60 +22->57 - + -23->73 +22->70 - + -23->74 +22->71 - + -26->5 +24->5 - + -26->73 +24->70 - + -26->74 +24->71 - + -38->60 +35->57 - + -38->63 +35->60 - + -38->64 +35->61 - + -38->65 +35->62 - + -38->66 +35->63 - + -52 +49 <<Struct>> Resource @@ -721,27 +721,27 @@ owner: address price: uint256 - + -52->46 +49->43 - + -53->46 +50->43 - + -53->52 +50->49 - + -55 +52 <<Enum>> TaskStatusEnum @@ -753,33 +753,33 @@ COMPLETED: 3 FAILED: 4 - + -55->46 +52->43 - + -56->46 +53->43 - + -56->55 +53->52 - + -57->46 +54->43 - + -58 +55 <<Enum>> ContributionStatusEnum @@ -790,27 +790,27 @@ PROVED: 2 REJECTED: 3 - + -58->46 +55->43 - + -59->46 +56->43 - + -59->58 +56->55 - + -62 +59 <<Struct>> EIP712Domain @@ -821,39 +821,39 @@ chainId: uint256 verifyingContract: address - + -60->62 +57->59 - + -60->63 +57->60 - + -60->64 +57->61 - + -60->65 +57->62 - + -60->66 +57->63 - + -67 +64 <<Struct>> AppOrderOperation @@ -863,15 +863,15 @@ operation: OrderOperationEnum sign: bytes - + -60->67 +57->64 - + -68 +65 <<Struct>> DatasetOrderOperation @@ -881,15 +881,15 @@ operation: OrderOperationEnum sign: bytes - + -60->68 +57->65 - + -69 +66 <<Struct>> WorkerpoolOrderOperation @@ -899,15 +899,15 @@ operation: OrderOperationEnum sign: bytes - + -60->69 +57->66 - + -70 +67 <<Struct>> RequestOrderOperation @@ -917,15 +917,15 @@ operation: OrderOperationEnum sign: bytes - + -60->70 +57->67 - + -61 +58 <<Enum>> OrderOperationEnum @@ -934,135 +934,135 @@ SIGN: 0 CLOSE: 1 - + -61->60 +58->57 - + -62->60 +59->57 - + -63->60 +60->57 - + -64->60 +61->57 - + -65->60 +62->57 - + -66->60 +63->57 - + -67->60 +64->57 - + -67->61 +64->58 - + -67->63 +64->60 - + -68->60 +65->57 - + -68->61 +65->58 - + -68->64 +65->61 - + -69->60 +66->57 - + -69->61 +66->58 - + -69->65 +66->62 - + -70->60 +67->57 - + -70->61 +67->58 - + -70->66 +67->63 - + -73->74 +70->71 - + -74->46 +71->43 - + -74->73 +71->70 - + -75 +72 <<Interface>> IRegistry @@ -1071,9 +1071,9 @@ External:     isRegistered(_entry: address): bool - + -74->75 +71->72 diff --git a/docs/uml/class-uml-dir-facets.svg b/docs/uml/class-uml-dir-facets.svg index ec918ac8..9bb07e18 100644 --- a/docs/uml/class-uml-dir-facets.svg +++ b/docs/uml/class-uml-dir-facets.svg @@ -4,55 +4,55 @@ - + UmlClassDiagram - + 0 - -<<Abstract>> -FacetBase -contracts/facets/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/facets/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() 1 - -<<Abstract>> -FacetBase -contracts/facets/FacetBase.v8.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: -    _msgSender(): address + +<<Abstract>> +FacetBase +contracts/facets/FacetBase.v8.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: +    _msgSender(): address @@ -73,8 +73,8 @@ 2->0 - - + + @@ -89,8 +89,8 @@ 3->0 - - + + @@ -105,8 +105,8 @@ 4->0 - - + + @@ -129,8 +129,8 @@ 5->0 - - + + @@ -152,521 +152,440 @@ 6->0 - - + + 7 - -IexecERC20Facet -contracts/facets/IexecERC20Facet.sol - -External: -    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 + +IexecERC20Facet +contracts/facets/IexecERC20Facet.sol + +External: +    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 7->0 - - + + 7->6 - - + + 8 - -IexecEscrow -contracts/facets/IexecEscrow.v8.sol - -Private: -    _transfer(from: address, to: address, value: uint256) -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) -Public: -    <<event>> Transfer(from: address, to: address, value: uint256) -    <<event>> Lock(owner: address, amount: uint256) -    <<event>> Unlock(owner: address, amount: uint256) -    <<event>> Reward(owner: address, amount: uint256, ref: bytes32) -    <<event>> Seize(owner: address, amount: uint256, ref: bytes32) + +IexecEscrow +contracts/facets/IexecEscrow.v8.sol + +Private: +    _transfer(from: address, to: address, value: uint256) +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) +Public: +    <<event>> Transfer(from: address, to: address, value: uint256) +    <<event>> Lock(owner: address, amount: uint256) +    <<event>> Unlock(owner: address, amount: uint256) +    <<event>> Reward(owner: address, amount: uint256, ref: bytes32) +    <<event>> Seize(owner: address, amount: uint256, ref: bytes32) 8->1 - - + + 9 - -IexecEscrowNativeFacet -contracts/facets/IexecEscrowNativeFacet.sol - -Internal: -   nRLCtoWei: uint256 - -Internal: -    _deposit(target: address) -    _withdraw(to: address, value: uint256) -External: -    <<payable>> null() -    <<payable>> null() -    <<payable>> deposit(): bool -    <<payable>> depositFor(target: address): bool -    <<payable>> depositForArray(amounts: uint256[], targets: address[]): bool -    withdraw(amount: uint256): bool -    withdrawTo(amount: uint256, target: address): bool -    recover(): uint256 <<onlyOwner>> + +IexecEscrowNativeFacet +contracts/facets/IexecEscrowNativeFacet.sol + +Internal: +   nRLCtoWei: uint256 + +Internal: +    _deposit(target: address) +    _withdraw(to: address, value: uint256) +External: +    <<payable>> null() +    <<payable>> null() +    <<payable>> deposit(): bool +    <<payable>> depositFor(target: address): bool +    <<payable>> depositForArray(amounts: uint256[], targets: address[]): bool +    withdraw(amount: uint256): bool +    withdrawTo(amount: uint256, target: address): bool +    recover(): uint256 <<onlyOwner>> 9->0 - - + + 9->6 - - + + 10 - -IexecEscrowTokenFacet -contracts/facets/IexecEscrowTokenFacet.sol - -Internal: -    _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, bytes): bool + +IexecEscrowTokenFacet +contracts/facets/IexecEscrowTokenFacet.sol + +Internal: +    _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, bytes): bool 10->0 - - + + 10->6 - - + + 11 - -IexecEscrowTokenSwapFacet -contracts/facets/IexecEscrowTokenSwapFacet.sol - -Internal: -   router: IUniswapV2Router02 - -Internal: -    _eth2token(): address[] -    _token2eth(): address[] -    _deposit(target: address, value: uint256, minimum: uint256) -    _request(target: address, value: uint256, amount: uint256) -    _withdraw(target: address, amount: uint256, minimum: uint256) -External: -    <<payable>> null() -    <<payable>> null() -    <<payable>> depositEth() -    <<payable>> depositEthFor(target: address) -    <<payable>> safeDepositEth(minimum: uint256) -    <<payable>> safeDepositEthFor(minimum: uint256, target: address) -    <<payable>> requestToken(amount: uint256) -    <<payable>> requestTokenFor(amount: uint256, target: address) -    UniswapV2Router(): IUniswapV2Router02 -    estimateDepositEthSent(eth: uint256): (token: uint256) -    estimateDepositTokenWanted(token: uint256): (eth: uint256) -    estimateWithdrawTokenSent(token: uint256): (eth: uint256) -    estimateWithdrawEthWanted(eth: uint256): (token: uint256) -    withdrawEth(amount: uint256) -    withdrawEthTo(amount: uint256, target: address) -    safeWithdrawEth(amount: uint256, minimum: uint256) -    safeWithdrawEthTo(amount: uint256, minimum: uint256, target: address) -Public: -    <<payable>> matchOrdersWithEth(_apporder: IexecLibOrders_v5.AppOrder, _datasetorder: IexecLibOrders_v5.DatasetOrder, _workerpoolorder: IexecLibOrders_v5.WorkerpoolOrder, _requestorder: IexecLibOrders_v5.RequestOrder): bytes32 - - + +IexecOrderManagementFacet +contracts/facets/IexecOrderManagementFacet.sol + +External: +    manageAppOrder(_apporderoperation: IexecLibOrders_v5.AppOrderOperation) +    manageDatasetOrder(_datasetorderoperation: IexecLibOrders_v5.DatasetOrderOperation) +    manageWorkerpoolOrder(_workerpoolorderoperation: IexecLibOrders_v5.WorkerpoolOrderOperation) +    manageRequestOrder(_requestorderoperation: IexecLibOrders_v5.RequestOrderOperation) + + -11->0 - - +11->1 + + - + + +20 + +SignatureVerifier +contracts/facets/SignatureVerifier.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 + + -11->6 - - - - - -21 - -SignatureVerifier -contracts/facets/SignatureVerifier.sol - -Internal: -    _toEthSignedMessage(_msgHash: bytes32): bytes -    _toEthTypedStruct(_structHash: bytes32, _domainHash: bytes32): bytes -    _recover(_hash: bytes32, _sign: bytes): address -    _isContract(account: address): bool -    _addrToKey(_addr: address): bytes32 -    _checkIdentity(_identity: address, _candidate: address, _purpose: uint256): (valid: bool) -    _checkPresignature(_identity: address, _hash: bytes32): bool -    _checkSignature(_identity: address, _hash: bytes32, _signature: bytes): bool -    _checkSignature(_identity: address, _predicat: bytes, _signature: bytes): bool -    _checkPresignatureOrSignature(_identity: address, _hash: bytes32, _signature: bytes): bool -    _checkPresignatureOrSignature(_identity: address, _predicat: bytes, _signature: bytes): bool - - - -11->21 - - +11->20 + + 12 - -IexecOrderManagementFacet -contracts/facets/IexecOrderManagementFacet.sol - -External: -    manageAppOrder(_apporderoperation: IexecLibOrders_v5.AppOrderOperation) -    manageDatasetOrder(_datasetorderoperation: IexecLibOrders_v5.DatasetOrderOperation) -    manageWorkerpoolOrder(_workerpoolorderoperation: IexecLibOrders_v5.WorkerpoolOrderOperation) -    manageRequestOrder(_requestorderoperation: IexecLibOrders_v5.RequestOrderOperation) - - - -12->1 - - - - - -22 - -SignatureVerifier -contracts/facets/SignatureVerifier.v8.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 - - - -12->22 - - + +<<Struct>> +Matching +contracts/facets/IexecPoco1Facet.sol + +apporderHash: bytes32 +appOwner: address +datasetorderHash: bytes32 +datasetOwner: address +workerpoolorderHash: bytes32 +workerpoolOwner: address +requestorderHash: bytes32 +hasDataset: bool 13 - -<<Struct>> -Matching -contracts/facets/IexecPoco1Facet.sol - -apporderHash: bytes32 -appOwner: address -datasetorderHash: bytes32 -datasetOwner: address -workerpoolorderHash: bytes32 -workerpoolOwner: address -requestorderHash: bytes32 -hasDataset: bool + +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 +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 + + + +13->1 + + + + + +13->8 + + + + + +13->12 + + + + + +18 + +IexecPocoCommon +contracts/facets/IexecPocoCommon.sol + +Internal: +    _computeDealVolume(appOrderVolume: uint256, appOrderTypedDataHash: bytes32, hasDataset: bool, datasetOrderVolume: uint256, datasetOrderTypedDataHash: bytes32, workerpoolOrderVolume: uint256, workerpoolOrderTypedDataHash: bytes32, requestOrderVolume: uint256, requestOrderTypedDataHash: bytes32): uint256 + + + +13->18 + + + + + +13->20 + + 14 - -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 -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 + +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) - + 14->1 - - + + - + 14->8 - - + + - + -14->13 - - - - - -19 - -IexecPocoCommon -contracts/facets/IexecPocoCommon.sol - -Internal: -    _computeDealVolume(appOrderVolume: uint256, appOrderTypedDataHash: bytes32, hasDataset: bool, datasetOrderVolume: uint256, datasetOrderTypedDataHash: bytes32, workerpoolOrderVolume: uint256, workerpoolOrderTypedDataHash: bytes32, requestOrderVolume: uint256, requestOrderTypedDataHash: bytes32): uint256 - - - -14->19 - - - - - -14->22 - - +14->20 + + 15 - -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) + +IexecPocoAccessorsFacet +contracts/facets/IexecPocoAccessorsFacet.sol + +External: +    viewDeal(id: bytes32): (deal: IexecLibCore_v5.Deal) +    viewTask(id: bytes32): IexecLibCore_v5.Task +    computeDealVolume(appOrder: IexecLibOrders_v5.AppOrder, datasetOrder: IexecLibOrders_v5.DatasetOrder, workerpoolOrder: IexecLibOrders_v5.WorkerpoolOrder, requestOrder: IexecLibOrders_v5.RequestOrder): uint256 +    viewConsumed(_id: bytes32): (consumed: uint256) +    viewPresigned(_id: bytes32): (signer: address) +    viewContribution(_taskid: bytes32, _worker: address): IexecLibCore_v5.Contribution +    viewScore(_worker: address): uint256 +    resultFor(id: bytes32): bytes +    name(): string +    symbol(): string +    decimals(): uint8 +    totalSupply(): uint256 +    balanceOf(account: address): uint256 +    frozenOf(account: address): uint256 +    allowance(account: address, spender: address): uint256 +    viewAccount(account: address): IexecLibCore_v5.Account +    token(): address +    viewCategory(_catid: uint256): (category: IexecLibCore_v5.Category) +    countCategory(): (count: uint256) +    appregistry(): IRegistry +    datasetregistry(): IRegistry +    workerpoolregistry(): IRegistry +    teebroker(): address +    callbackgas(): uint256 +    viewDataset(dataset: address): IexecLibCore_v5.DatasetInfo +    viewApp(app: address): IexecLibCore_v5.AppInfo +    viewWorkerpool(workerpool: address): IexecLibCore_v5.WorkerpoolInfo +    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 +    eip712domain_separator(): bytes32 15->1 - - + + - - -15->8 - - - - + -15->22 - - +15->18 + + + + + +15->20 + + 16 - -IexecPocoAccessorsFacet -contracts/facets/IexecPocoAccessorsFacet.sol - -External: -    viewDeal(id: bytes32): (deal: IexecLibCore_v5.Deal) -    viewTask(id: bytes32): IexecLibCore_v5.Task -    computeDealVolume(appOrder: IexecLibOrders_v5.AppOrder, datasetOrder: IexecLibOrders_v5.DatasetOrder, workerpoolOrder: IexecLibOrders_v5.WorkerpoolOrder, requestOrder: IexecLibOrders_v5.RequestOrder): uint256 -    viewConsumed(_id: bytes32): (consumed: uint256) -    viewPresigned(_id: bytes32): (signer: address) -    viewContribution(_taskid: bytes32, _worker: address): IexecLibCore_v5.Contribution -    viewScore(_worker: address): uint256 -    resultFor(id: bytes32): bytes -    name(): string -    symbol(): string -    decimals(): uint8 -    totalSupply(): uint256 -    balanceOf(account: address): uint256 -    frozenOf(account: address): uint256 -    allowance(account: address, spender: address): uint256 -    viewAccount(account: address): IexecLibCore_v5.Account -    token(): address -    viewCategory(_catid: uint256): (category: IexecLibCore_v5.Category) -    countCategory(): (count: uint256) -    appregistry(): IRegistry -    datasetregistry(): IRegistry -    workerpoolregistry(): IRegistry -    teebroker(): address -    callbackgas(): uint256 -    viewDataset(dataset: address): IexecLibCore_v5.DatasetInfo -    viewApp(app: address): IexecLibCore_v5.AppInfo -    viewWorkerpool(workerpool: address): IexecLibCore_v5.WorkerpoolInfo -    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 -    eip712domain_separator(): bytes32 + +IexecPocoBoostAccessorsFacet +contracts/facets/IexecPocoBoostAccessorsFacet.sol + +External: +    viewDealBoost(id: bytes32): (deal: IexecLibCore_v5.DealBoost) 16->1 - - - - - -16->19 - - - - - -16->22 - - + + 17 - -IexecPocoBoostAccessorsFacet -contracts/facets/IexecPocoBoostAccessorsFacet.sol - -External: -    viewDealBoost(id: bytes32): (deal: IexecLibCore_v5.DealBoost) + +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) - + 17->1 - - + + - - -18 - -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) + + +17->8 + + - + -18->1 - - +17->18 + + - - -18->8 - - + + +17->20 + + - - -18->19 - - + + +18->1 + + - + + +19 + +IexecRelayFacet +contracts/facets/IexecRelayFacet.sol + +External: +    broadcastAppOrder(_apporder: IexecLibOrders_v5.AppOrder) +    broadcastDatasetOrder(_datasetorder: IexecLibOrders_v5.DatasetOrder) +    broadcastWorkerpoolOrder(_workerpoolorder: IexecLibOrders_v5.WorkerpoolOrder) +    broadcastRequestOrder(_requestorder: IexecLibOrders_v5.RequestOrder) + + -18->22 - - +19->0 + + - - -19->1 - - - - - -20 - -IexecRelayFacet -contracts/facets/IexecRelayFacet.sol - -External: -    broadcastAppOrder(_apporder: IexecLibOrders_v5.AppOrder) -    broadcastDatasetOrder(_datasetorder: IexecLibOrders_v5.DatasetOrder) -    broadcastWorkerpoolOrder(_workerpoolorder: IexecLibOrders_v5.WorkerpoolOrder) -    broadcastRequestOrder(_requestorder: IexecLibOrders_v5.RequestOrder) - - - -20->0 - - - - - -21->0 - - - - - -22->1 - - + + +20->1 + + diff --git a/hardhat.config.ts b/hardhat.config.ts index d3363f31..80504cdd 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -244,7 +244,6 @@ const config: HardhatUserConfig = { // kept for events 'facets/IexecEscrow.v8.sol', // contains only internal/private 'facets/IexecPocoCommon.sol', // contains only internal/private 'facets/SignatureVerifier.sol', // contains only internal/private - 'facets/SignatureVerifier.v8.sol', 'interfaces', // interesting for events but too much doc duplication if enabled 'tools', 'Diamond.sol', // not relevant