diff --git a/CHANGELOG.md b/CHANGELOG.md index 932fe79dc..5c3125386 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## vNEXT - Migrate proxy to Diamond pattern (ERC-2535): + - Format all solidity files (#233) - Rename ERC1538 architure to diamond Proxy architecture(#226, #229, #230) - Remove ENS module (#225) - Add Diamond contract unit tests (#224) diff --git a/contracts/IexecInterfaceNative.sol b/contracts/IexecInterfaceNative.sol index 8ed2d3d79..b94d563fd 100644 --- a/contracts/IexecInterfaceNative.sol +++ b/contracts/IexecInterfaceNative.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; diff --git a/contracts/IexecInterfaceNativeABILegacy.sol b/contracts/IexecInterfaceNativeABILegacy.sol index 0a266ccaa..386106b71 100644 --- a/contracts/IexecInterfaceNativeABILegacy.sol +++ b/contracts/IexecInterfaceNativeABILegacy.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; diff --git a/contracts/IexecInterfaceToken.sol b/contracts/IexecInterfaceToken.sol index 59c2a99d2..10a483b58 100644 --- a/contracts/IexecInterfaceToken.sol +++ b/contracts/IexecInterfaceToken.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; diff --git a/contracts/IexecInterfaceTokenABILegacy.sol b/contracts/IexecInterfaceTokenABILegacy.sol index d9dd25308..3fd808964 100644 --- a/contracts/IexecInterfaceTokenABILegacy.sol +++ b/contracts/IexecInterfaceTokenABILegacy.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; diff --git a/contracts/Store.sol b/contracts/Store.sol index 1376c4fef..6285cb88b 100644 --- a/contracts/Store.sol +++ b/contracts/Store.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2020-2024 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.0; @@ -25,51 +25,50 @@ import "./registries/IRegistry.sol"; // TODO replace with diamond AppStorage using namespaced storage. // TODO check storage padding. -abstract contract Store -{ - // Registries - IRegistry internal m_appregistry; - IRegistry internal m_datasetregistry; - IRegistry internal m_workerpoolregistry; +abstract contract Store { + // Registries + IRegistry internal m_appregistry; + IRegistry internal m_datasetregistry; + IRegistry internal m_workerpoolregistry; - // Escrow - IERC20 internal m_baseToken; - string internal m_name; - string internal m_symbol; - uint8 internal m_decimals; - uint256 internal m_totalSupply; - mapping (address => uint256 ) internal m_balances; - mapping (address => uint256 ) internal m_frozens; - mapping (address => mapping (address => uint256)) internal m_allowances; + // Escrow + IERC20 internal m_baseToken; + string internal m_name; + string internal m_symbol; + uint8 internal m_decimals; + uint256 internal m_totalSupply; + mapping(address => uint256) internal m_balances; + mapping(address => uint256) internal m_frozens; + mapping(address => mapping(address => uint256)) internal m_allowances; - // 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 = 1000000000; // ADJUSTEMENT VARIABLE - address internal constant KITTY_ADDRESS = 0x99c2268479b93fDe36232351229815DF80837e23; // address(uint256(keccak256(bytes('iExecKitty'))) - 1); - uint256 internal constant GROUPMEMBER_PURPOSE = 4; - bytes32 internal EIP712DOMAIN_SEPARATOR; + // 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 = 1000000000; // ADJUSTEMENT VARIABLE + address internal constant KITTY_ADDRESS = 0x99c2268479b93fDe36232351229815DF80837e23; // address(uint256(keccak256(bytes('iExecKitty'))) - 1); + uint256 internal constant GROUPMEMBER_PURPOSE = 4; + bytes32 internal EIP712DOMAIN_SEPARATOR; - // Poco - Storage - mapping(bytes32 => address ) internal m_presigned; // per order - mapping(bytes32 => uint256 ) internal m_consumed; // per order - mapping(bytes32 => IexecLibCore_v5.Deal ) internal m_deals; // per deal - mapping(bytes32 => IexecLibCore_v5.Task ) internal m_tasks; // per task - mapping(bytes32 => IexecLibCore_v5.Consensus ) internal m_consensus; // per task - mapping(bytes32 => mapping(address => IexecLibCore_v5.Contribution)) internal m_contributions; // per task-worker - mapping(address => uint256 ) internal m_workerScores; // per worker + // Poco - Storage + mapping(bytes32 => address) internal m_presigned; // per order + mapping(bytes32 => uint256) internal m_consumed; // per order + mapping(bytes32 => IexecLibCore_v5.Deal) internal m_deals; // per deal + mapping(bytes32 => IexecLibCore_v5.Task) internal m_tasks; // per task + mapping(bytes32 => IexecLibCore_v5.Consensus) internal m_consensus; // per task + mapping(bytes32 => mapping(address => IexecLibCore_v5.Contribution)) internal m_contributions; // per task-worker + mapping(address => uint256) internal m_workerScores; // per worker - // Poco - Settings - address internal m_teebroker; - uint256 internal m_callbackgas; + // Poco - Settings + address internal m_teebroker; + uint256 internal m_callbackgas; - // Categories - IexecLibCore_v5.Category[] internal m_categories; + // Categories + IexecLibCore_v5.Category[] internal m_categories; - // Backward compatibility - IexecHubInterface internal m_v3_iexecHub; - mapping(address => bool) internal m_v3_scoreImported; + // Backward compatibility + IexecHubInterface internal m_v3_iexecHub; + mapping(address => bool) internal m_v3_scoreImported; } diff --git a/contracts/Store.v8.sol b/contracts/Store.v8.sol index 479acc1ff..289ff289c 100644 --- a/contracts/Store.v8.sol +++ b/contracts/Store.v8.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023-2024 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2023-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; diff --git a/contracts/external/interfaces/IERC734.sol b/contracts/external/interfaces/IERC734.sol index 2a5dc8d7b..57f774cd2 100644 --- a/contracts/external/interfaces/IERC734.sol +++ b/contracts/external/interfaces/IERC734.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2023-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2023 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.8.0; /** diff --git a/contracts/libs/IexecLibOrders_v5.sol b/contracts/libs/IexecLibOrders_v5.sol index 8fbc55c68..7fb18a979 100644 --- a/contracts/libs/IexecLibOrders_v5.sol +++ b/contracts/libs/IexecLibOrders_v5.sol @@ -1,34 +1,19 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity >=0.6.0; pragma experimental ABIEncoderV2; library IexecLibOrders_v5 { - // bytes32 public constant EIP712DOMAIN_TYPEHASH = keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'); - // bytes32 public constant APPORDER_TYPEHASH = keccak256('AppOrder(address app,uint256 appprice,uint256 volume,bytes32 tag,address datasetrestrict,address workerpoolrestrict,address requesterrestrict,bytes32 salt)'); - // bytes32 public constant DATASETORDER_TYPEHASH = keccak256('DatasetOrder(address dataset,uint256 datasetprice,uint256 volume,bytes32 tag,address apprestrict,address workerpoolrestrict,address requesterrestrict,bytes32 salt)'); - // bytes32 public constant WORKERPOOLORDER_TYPEHASH = keccak256('WorkerpoolOrder(address workerpool,uint256 workerpoolprice,uint256 volume,bytes32 tag,uint256 category,uint256 trust,address apprestrict,address datasetrestrict,address requesterrestrict,bytes32 salt)'); - // bytes32 public constant REQUESTORDER_TYPEHASH = keccak256('RequestOrder(address app,uint256 appmaxprice,address dataset,uint256 datasetmaxprice,address workerpool,uint256 workerpoolmaxprice,address requester,uint256 volume,bytes32 tag,uint256 category,uint256 trust,address beneficiary,address callback,string params,bytes32 salt)'); - // bytes32 public constant APPORDEROPERATION_TYPEHASH = keccak256('AppOrderOperation(AppOrder order,uint256 operation)AppOrder(address app,uint256 appprice,uint256 volume,bytes32 tag,address datasetrestrict,address workerpoolrestrict,address requesterrestrict,bytes32 salt)'); - // bytes32 public constant DATASETORDEROPERATION_TYPEHASH = keccak256('DatasetOrderOperation(DatasetOrder order,uint256 operation)DatasetOrder(address dataset,uint256 datasetprice,uint256 volume,bytes32 tag,address apprestrict,address workerpoolrestrict,address requesterrestrict,bytes32 salt)'); + // bytes32 public constant EIP712DOMAIN_TYPEHASH = keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'); + // bytes32 public constant APPORDER_TYPEHASH = keccak256('AppOrder(address app,uint256 appprice,uint256 volume,bytes32 tag,address datasetrestrict,address workerpoolrestrict,address requesterrestrict,bytes32 salt)'); + // bytes32 public constant DATASETORDER_TYPEHASH = keccak256('DatasetOrder(address dataset,uint256 datasetprice,uint256 volume,bytes32 tag,address apprestrict,address workerpoolrestrict,address requesterrestrict,bytes32 salt)'); + // bytes32 public constant WORKERPOOLORDER_TYPEHASH = keccak256('WorkerpoolOrder(address workerpool,uint256 workerpoolprice,uint256 volume,bytes32 tag,uint256 category,uint256 trust,address apprestrict,address datasetrestrict,address requesterrestrict,bytes32 salt)'); + // bytes32 public constant REQUESTORDER_TYPEHASH = keccak256('RequestOrder(address app,uint256 appmaxprice,address dataset,uint256 datasetmaxprice,address workerpool,uint256 workerpoolmaxprice,address requester,uint256 volume,bytes32 tag,uint256 category,uint256 trust,address beneficiary,address callback,string params,bytes32 salt)'); + // bytes32 public constant APPORDEROPERATION_TYPEHASH = keccak256('AppOrderOperation(AppOrder order,uint256 operation)AppOrder(address app,uint256 appprice,uint256 volume,bytes32 tag,address datasetrestrict,address workerpoolrestrict,address requesterrestrict,bytes32 salt)'); + // bytes32 public constant DATASETORDEROPERATION_TYPEHASH = keccak256('DatasetOrderOperation(DatasetOrder order,uint256 operation)DatasetOrder(address dataset,uint256 datasetprice,uint256 volume,bytes32 tag,address apprestrict,address workerpoolrestrict,address requesterrestrict,bytes32 salt)'); // bytes32 public constant WORKERPOOLORDEROPERATION_TYPEHASH = keccak256('WorkerpoolOrderOperation(WorkerpoolOrder order,uint256 operation)WorkerpoolOrder(address workerpool,uint256 workerpoolprice,uint256 volume,bytes32 tag,uint256 category,uint256 trust,address apprestrict,address datasetrestrict,address requesterrestrict,bytes32 salt)'); - // bytes32 public constant REQUESTORDEROPERATION_TYPEHASH = keccak256('RequestOrderOperation(RequestOrder order,uint256 operation)RequestOrder(address app,uint256 appmaxprice,address dataset,uint256 datasetmaxprice,address workerpool,uint256 workerpoolmaxprice,address requester,uint256 volume,bytes32 tag,uint256 category,uint256 trust,address beneficiary,address callback,string params,bytes32 salt)'); + // bytes32 public constant REQUESTORDEROPERATION_TYPEHASH = keccak256('RequestOrderOperation(RequestOrder order,uint256 operation)RequestOrder(address app,uint256 appmaxprice,address dataset,uint256 datasetmaxprice,address workerpool,uint256 workerpoolmaxprice,address requester,uint256 volume,bytes32 tag,uint256 category,uint256 trust,address beneficiary,address callback,string params,bytes32 salt)'); bytes32 public constant EIP712DOMAIN_TYPEHASH = 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f; bytes32 public constant APPORDER_TYPEHASH = diff --git a/contracts/modules/FacetBase.sol b/contracts/modules/FacetBase.sol index 56e3c7535..826cc07d2 100644 --- a/contracts/modules/FacetBase.sol +++ b/contracts/modules/FacetBase.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2020-2024 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.0; diff --git a/contracts/modules/FacetBase.v8.sol b/contracts/modules/FacetBase.v8.sol index 23b43b5d9..9e0c6065b 100644 --- a/contracts/modules/FacetBase.v8.sol +++ b/contracts/modules/FacetBase.v8.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2023-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; diff --git a/contracts/modules/facets/IexecAccessorsABILegacyFacet.sol b/contracts/modules/facets/IexecAccessorsABILegacyFacet.sol index 116614cf7..5a105138a 100644 --- a/contracts/modules/facets/IexecAccessorsABILegacyFacet.sol +++ b/contracts/modules/facets/IexecAccessorsABILegacyFacet.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; diff --git a/contracts/modules/facets/IexecAccessorsFacet.sol b/contracts/modules/facets/IexecAccessorsFacet.sol index d3f653e54..1ed9855b2 100644 --- a/contracts/modules/facets/IexecAccessorsFacet.sol +++ b/contracts/modules/facets/IexecAccessorsFacet.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; diff --git a/contracts/modules/facets/IexecCategoryManagerFacet.sol b/contracts/modules/facets/IexecCategoryManagerFacet.sol index ae028dea6..827b6c907 100644 --- a/contracts/modules/facets/IexecCategoryManagerFacet.sol +++ b/contracts/modules/facets/IexecCategoryManagerFacet.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; diff --git a/contracts/modules/facets/IexecERC20Core.sol b/contracts/modules/facets/IexecERC20Core.sol index 59a461f7b..c558cf0ea 100644 --- a/contracts/modules/facets/IexecERC20Core.sol +++ b/contracts/modules/facets/IexecERC20Core.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2020-2024 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.0; diff --git a/contracts/modules/facets/IexecERC20Facet.sol b/contracts/modules/facets/IexecERC20Facet.sol index 6bd9c6c7a..19d082fce 100644 --- a/contracts/modules/facets/IexecERC20Facet.sol +++ b/contracts/modules/facets/IexecERC20Facet.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; diff --git a/contracts/modules/facets/IexecEscrow.v8.sol b/contracts/modules/facets/IexecEscrow.v8.sol index 9018742d2..0b6126fc8 100644 --- a/contracts/modules/facets/IexecEscrow.v8.sol +++ b/contracts/modules/facets/IexecEscrow.v8.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2023-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; diff --git a/contracts/modules/facets/IexecEscrowNativeFacet.sol b/contracts/modules/facets/IexecEscrowNativeFacet.sol index c2afe779e..47fe3bf29 100644 --- a/contracts/modules/facets/IexecEscrowNativeFacet.sol +++ b/contracts/modules/facets/IexecEscrowNativeFacet.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; diff --git a/contracts/modules/facets/IexecEscrowTokenFacet.sol b/contracts/modules/facets/IexecEscrowTokenFacet.sol index f8368e834..656bbdec4 100644 --- a/contracts/modules/facets/IexecEscrowTokenFacet.sol +++ b/contracts/modules/facets/IexecEscrowTokenFacet.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; diff --git a/contracts/modules/facets/IexecEscrowTokenSwapFacet.sol b/contracts/modules/facets/IexecEscrowTokenSwapFacet.sol index cf2b0cb91..23bd49c9f 100644 --- a/contracts/modules/facets/IexecEscrowTokenSwapFacet.sol +++ b/contracts/modules/facets/IexecEscrowTokenSwapFacet.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; diff --git a/contracts/modules/facets/IexecMaintenanceExtraFacet.sol b/contracts/modules/facets/IexecMaintenanceExtraFacet.sol index da617f4ee..ee5ef60f5 100644 --- a/contracts/modules/facets/IexecMaintenanceExtraFacet.sol +++ b/contracts/modules/facets/IexecMaintenanceExtraFacet.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; diff --git a/contracts/modules/facets/IexecMaintenanceFacet.sol b/contracts/modules/facets/IexecMaintenanceFacet.sol index ec611f478..540be7e20 100644 --- a/contracts/modules/facets/IexecMaintenanceFacet.sol +++ b/contracts/modules/facets/IexecMaintenanceFacet.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2020-2024 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.0; diff --git a/contracts/modules/facets/IexecOrderManagementFacet.sol b/contracts/modules/facets/IexecOrderManagementFacet.sol index c95c74d79..b412c9a77 100644 --- a/contracts/modules/facets/IexecOrderManagementFacet.sol +++ b/contracts/modules/facets/IexecOrderManagementFacet.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2020-2024 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; diff --git a/contracts/modules/facets/IexecPoco1Facet.sol b/contracts/modules/facets/IexecPoco1Facet.sol index db7880f02..f4e8804b2 100644 --- a/contracts/modules/facets/IexecPoco1Facet.sol +++ b/contracts/modules/facets/IexecPoco1Facet.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2020-2024 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; diff --git a/contracts/modules/facets/IexecPoco2Facet.sol b/contracts/modules/facets/IexecPoco2Facet.sol index 22a5e7ca4..2c87bc22b 100644 --- a/contracts/modules/facets/IexecPoco2Facet.sol +++ b/contracts/modules/facets/IexecPoco2Facet.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2020-2024 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; @@ -12,8 +12,6 @@ import {IexecPoco2} from "../interfaces/IexecPoco2.v8.sol"; import {IexecEscrow} from "./IexecEscrow.v8.sol"; import {SignatureVerifier} from "./SignatureVerifier.v8.sol"; -// TODO: Revert with custom errors - contract IexecPoco2Facet is IexecPoco2, FacetBase, IexecEscrow, SignatureVerifier { modifier onlyScheduler(bytes32 _taskId) { require(_msgSender() == m_deals[m_tasks[_taskId].dealid].workerpool.owner); diff --git a/contracts/modules/facets/IexecPocoAccessorsFacet.sol b/contracts/modules/facets/IexecPocoAccessorsFacet.sol index fbc35dcb0..7b6c1905d 100644 --- a/contracts/modules/facets/IexecPocoAccessorsFacet.sol +++ b/contracts/modules/facets/IexecPocoAccessorsFacet.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2024-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; diff --git a/contracts/modules/facets/IexecPocoBoostAccessorsFacet.sol b/contracts/modules/facets/IexecPocoBoostAccessorsFacet.sol index 91136bf2c..5242a4fcf 100644 --- a/contracts/modules/facets/IexecPocoBoostAccessorsFacet.sol +++ b/contracts/modules/facets/IexecPocoBoostAccessorsFacet.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2023-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; diff --git a/contracts/modules/facets/IexecPocoBoostFacet.sol b/contracts/modules/facets/IexecPocoBoostFacet.sol index 37731fac3..28caf7368 100644 --- a/contracts/modules/facets/IexecPocoBoostFacet.sol +++ b/contracts/modules/facets/IexecPocoBoostFacet.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023-2024 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2023-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; diff --git a/contracts/modules/facets/IexecPocoCommonFacet.sol b/contracts/modules/facets/IexecPocoCommonFacet.sol index 9f55cc338..3bba0a733 100644 --- a/contracts/modules/facets/IexecPocoCommonFacet.sol +++ b/contracts/modules/facets/IexecPocoCommonFacet.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2024-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; diff --git a/contracts/modules/facets/IexecRelayFacet.sol b/contracts/modules/facets/IexecRelayFacet.sol index 39e2d5176..b97d9baf5 100644 --- a/contracts/modules/facets/IexecRelayFacet.sol +++ b/contracts/modules/facets/IexecRelayFacet.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; diff --git a/contracts/modules/facets/SignatureVerifier.sol b/contracts/modules/facets/SignatureVerifier.sol index 79eef1f34..b8e297d8d 100644 --- a/contracts/modules/facets/SignatureVerifier.sol +++ b/contracts/modules/facets/SignatureVerifier.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; diff --git a/contracts/modules/facets/SignatureVerifier.v8.sol b/contracts/modules/facets/SignatureVerifier.v8.sol index c537f280a..71450dbb3 100644 --- a/contracts/modules/facets/SignatureVerifier.v8.sol +++ b/contracts/modules/facets/SignatureVerifier.v8.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2024-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; diff --git a/contracts/modules/interfaces/IOwnable.sol b/contracts/modules/interfaces/IOwnable.sol index 47d3af917..a7b5a8291 100644 --- a/contracts/modules/interfaces/IOwnable.sol +++ b/contracts/modules/interfaces/IOwnable.sol @@ -1,30 +1,13 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; +interface IOwnable { + event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); -interface IOwnable -{ - event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); - - function owner() external view returns (address); - function renounceOwnership() external; - function transferOwnership(address) external; + function owner() external view returns (address); + function renounceOwnership() external; + function transferOwnership(address) external; } diff --git a/contracts/modules/interfaces/IexecAccessors.sol b/contracts/modules/interfaces/IexecAccessors.sol index 764015015..56289eb49 100644 --- a/contracts/modules/interfaces/IexecAccessors.sol +++ b/contracts/modules/interfaces/IexecAccessors.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; @@ -23,40 +8,42 @@ import "@iexec/solidity/contracts/ERC1154/IERC1154.sol"; import "../../libs/IexecLibCore_v5.sol"; import "../../registries/IRegistry.sol"; -interface IexecAccessors is IOracle -{ - function name() external view returns (string memory); - function symbol() external view returns (string memory); - function decimals() external view returns (uint8); - function totalSupply() external view returns (uint256); - function balanceOf(address) external view returns (uint256); - function frozenOf(address) external view returns (uint256); - function allowance(address,address) external view returns (uint256); - function viewAccount(address) external view returns (IexecLibCore_v5.Account memory); - function token() external view returns (address); - function viewDeal(bytes32) external view returns (IexecLibCore_v5.Deal memory); - function viewConsumed(bytes32) external view returns (uint256); - function viewPresigned(bytes32) external view returns (address); - function viewTask(bytes32) external view returns (IexecLibCore_v5.Task memory); - function viewContribution(bytes32,address) external view returns (IexecLibCore_v5.Contribution memory); - function viewScore(address) external view returns (uint256); - // function resultFor(bytes32) external view returns (bytes memory); // Already part of IOracle - function viewCategory(uint256) external view returns (IexecLibCore_v5.Category memory); - function countCategory() external view returns (uint256); +interface IexecAccessors is IOracle { + function name() external view returns (string memory); + function symbol() external view returns (string memory); + function decimals() external view returns (uint8); + function totalSupply() external view returns (uint256); + function balanceOf(address) external view returns (uint256); + function frozenOf(address) external view returns (uint256); + function allowance(address, address) external view returns (uint256); + function viewAccount(address) external view returns (IexecLibCore_v5.Account memory); + function token() external view returns (address); + function viewDeal(bytes32) external view returns (IexecLibCore_v5.Deal memory); + function viewConsumed(bytes32) external view returns (uint256); + function viewPresigned(bytes32) external view returns (address); + function viewTask(bytes32) external view returns (IexecLibCore_v5.Task memory); + function viewContribution( + bytes32, + address + ) external view returns (IexecLibCore_v5.Contribution memory); + function viewScore(address) external view returns (uint256); + // function resultFor(bytes32) external view returns (bytes memory); // Already part of IOracle + function viewCategory(uint256) external view returns (IexecLibCore_v5.Category memory); + function countCategory() external view returns (uint256); - function appregistry() external view returns (IRegistry); - function datasetregistry() external view returns (IRegistry); - function workerpoolregistry() external view returns (IRegistry); - function teebroker() external view returns (address); - function callbackgas() external view returns (uint256); + function appregistry() external view returns (IRegistry); + function datasetregistry() external view returns (IRegistry); + function workerpoolregistry() external view returns (IRegistry); + function teebroker() external view returns (address); + function callbackgas() external view returns (uint256); - function contribution_deadline_ratio() external view returns (uint256); - function reveal_deadline_ratio() external view returns (uint256); - function final_deadline_ratio() external view returns (uint256); - function workerpool_stake_ratio() external view returns (uint256); - function kitty_ratio() external view returns (uint256); - function kitty_min() external view returns (uint256); - function kitty_address() external view returns (address); - function groupmember_purpose() external view returns (uint256); - function eip712domain_separator() external view returns (bytes32); + function contribution_deadline_ratio() external view returns (uint256); + function reveal_deadline_ratio() external view returns (uint256); + function final_deadline_ratio() external view returns (uint256); + function workerpool_stake_ratio() external view returns (uint256); + function kitty_ratio() external view returns (uint256); + function kitty_min() external view returns (uint256); + function kitty_address() external view returns (address); + function groupmember_purpose() external view returns (uint256); + function eip712domain_separator() external view returns (bytes32); } diff --git a/contracts/modules/interfaces/IexecAccessorsABILegacy.sol b/contracts/modules/interfaces/IexecAccessorsABILegacy.sol index 54890a2f8..9f6f6e427 100644 --- a/contracts/modules/interfaces/IexecAccessorsABILegacy.sol +++ b/contracts/modules/interfaces/IexecAccessorsABILegacy.sol @@ -1,89 +1,55 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "../../libs/IexecLibCore_v5.sol"; - -interface IexecAccessorsABILegacy -{ - function viewAccountABILegacy(address _user) - external view returns (uint256, uint256); - - function viewDealABILegacy_pt1(bytes32 _id) - external view returns - ( address - , address - , uint256 - , address - , address - , uint256 - , address - , address - , uint256 - ); - - function viewDealABILegacy_pt2(bytes32 _id) - external view returns - ( uint256 - , bytes32 - , address - , address - , address - , string memory - ); - - function viewTaskABILegacy(bytes32 _taskid) - external view returns - ( IexecLibCore_v5.TaskStatusEnum - , bytes32 - , uint256 - , uint256 - , uint256 - , uint256 - , uint256 - , bytes32 - , uint256 - , uint256 - , address[] memory - , bytes memory - ); - - function viewContributionABILegacy(bytes32 _taskid, address _worker) - external view returns - ( IexecLibCore_v5.ContributionStatusEnum - , bytes32 - , bytes32 - , address - ); - - function viewCategoryABILegacy(uint256 _catid) - external view returns (string memory, string memory, uint256); - - function viewConfigABILegacy(bytes32 _id) - external view returns - ( uint256 - , uint256 - , uint256 - , uint256 - , uint256 - , uint256 - ); +interface IexecAccessorsABILegacy { + function viewAccountABILegacy(address _user) external view returns (uint256, uint256); + + function viewDealABILegacy_pt1( + bytes32 _id + ) + external + view + returns (address, address, uint256, address, address, uint256, address, address, uint256); + + function viewDealABILegacy_pt2( + bytes32 _id + ) external view returns (uint256, bytes32, address, address, address, string memory); + + function viewTaskABILegacy( + bytes32 _taskid + ) + external + view + returns ( + IexecLibCore_v5.TaskStatusEnum, + bytes32, + uint256, + uint256, + uint256, + uint256, + uint256, + bytes32, + uint256, + uint256, + address[] memory, + bytes memory + ); + + function viewContributionABILegacy( + bytes32 _taskid, + address _worker + ) external view returns (IexecLibCore_v5.ContributionStatusEnum, bytes32, bytes32, address); + + function viewCategoryABILegacy( + uint256 _catid + ) external view returns (string memory, string memory, uint256); + + function viewConfigABILegacy( + bytes32 _id + ) external view returns (uint256, uint256, uint256, uint256, uint256, uint256); } diff --git a/contracts/modules/interfaces/IexecCategoryManager.sol b/contracts/modules/interfaces/IexecCategoryManager.sol index 9008da5d5..67137b1fa 100644 --- a/contracts/modules/interfaces/IexecCategoryManager.sol +++ b/contracts/modules/interfaces/IexecCategoryManager.sol @@ -1,28 +1,11 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; +interface IexecCategoryManager { + event CreateCategory(uint256 catid, string name, string description, uint256 workClockTimeRef); -interface IexecCategoryManager -{ - event CreateCategory(uint256 catid, string name, string description, uint256 workClockTimeRef); - - function createCategory(string calldata,string calldata,uint256) external returns (uint256); + function createCategory(string calldata, string calldata, uint256) external returns (uint256); } diff --git a/contracts/modules/interfaces/IexecERC20.sol b/contracts/modules/interfaces/IexecERC20.sol index 8d1b37d14..ccbb3b274 100644 --- a/contracts/modules/interfaces/IexecERC20.sol +++ b/contracts/modules/interfaces/IexecERC20.sol @@ -1,34 +1,17 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; +interface IexecERC20 { + event Transfer(address indexed from, address indexed to, uint256 value); + event Approval(address indexed owner, address indexed spender, uint256 value); -interface IexecERC20 -{ - event Transfer(address indexed from, address indexed to, uint256 value); - event Approval(address indexed owner, address indexed spender, uint256 value); - - function transfer(address,uint256) external returns (bool); - function approve(address,uint256) external returns (bool); - function transferFrom(address,address,uint256) external returns (bool); - function increaseAllowance(address,uint256) external returns (bool); - function decreaseAllowance(address,uint256) external returns (bool); - function approveAndCall(address,uint256,bytes calldata) external returns (bool); + function transfer(address, uint256) external returns (bool); + function approve(address, uint256) external returns (bool); + function transferFrom(address, address, uint256) external returns (bool); + function increaseAllowance(address, uint256) external returns (bool); + function decreaseAllowance(address, uint256) external returns (bool); + function approveAndCall(address, uint256, bytes calldata) external returns (bool); } diff --git a/contracts/modules/interfaces/IexecERC20Common.sol b/contracts/modules/interfaces/IexecERC20Common.sol index 9b6a88647..95aa667f3 100644 --- a/contracts/modules/interfaces/IexecERC20Common.sol +++ b/contracts/modules/interfaces/IexecERC20Common.sol @@ -1,29 +1,12 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; - -interface IexecERC20Common -{ - event Reward(address owner, uint256 amount, bytes32 ref); - event Seize (address owner, uint256 amount, bytes32 ref); - event Lock (address owner, uint256 amount); - event Unlock(address owner, uint256 amount); +interface IexecERC20Common { + event Reward(address owner, uint256 amount, bytes32 ref); + event Seize(address owner, uint256 amount, bytes32 ref); + event Lock(address owner, uint256 amount); + event Unlock(address owner, uint256 amount); } diff --git a/contracts/modules/interfaces/IexecEscrowNative.sol b/contracts/modules/interfaces/IexecEscrowNative.sol index f6f23c95f..97f5aede3 100644 --- a/contracts/modules/interfaces/IexecEscrowNative.sol +++ b/contracts/modules/interfaces/IexecEscrowNative.sol @@ -1,34 +1,20 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; +interface IexecEscrowNative { + receive() external payable; + fallback() external payable; -interface IexecEscrowNative -{ - receive() external payable; - fallback() external payable; - - function deposit() external payable returns (bool); - function depositFor(address) external payable returns (bool); - function depositForArray(uint256[] calldata,address[] calldata) external payable returns (bool); - function withdraw(uint256) external returns (bool); - function withdrawTo(uint256,address) external returns (bool); - function recover() external returns (uint256); + function deposit() external payable returns (bool); + function depositFor(address) external payable returns (bool); + function depositForArray( + uint256[] calldata, + address[] calldata + ) external payable returns (bool); + function withdraw(uint256) external returns (bool); + function withdrawTo(uint256, address) external returns (bool); + function recover() external returns (uint256); } diff --git a/contracts/modules/interfaces/IexecEscrowToken.sol b/contracts/modules/interfaces/IexecEscrowToken.sol index 474598505..43d6d0092 100644 --- a/contracts/modules/interfaces/IexecEscrowToken.sol +++ b/contracts/modules/interfaces/IexecEscrowToken.sol @@ -1,34 +1,17 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; +interface IexecEscrowToken { + receive() external payable; + fallback() external payable; -interface IexecEscrowToken -{ - receive() external payable; - fallback() external payable; - - function deposit(uint256) external returns (bool); - function depositFor(uint256,address) external returns (bool); - function depositForArray(uint256[] calldata,address[] calldata) external returns (bool); - function withdraw(uint256) external returns (bool); - function withdrawTo(uint256,address) external returns (bool); - function recover() external returns (uint256); + function deposit(uint256) external returns (bool); + function depositFor(uint256, address) external returns (bool); + function depositForArray(uint256[] calldata, address[] calldata) external returns (bool); + function withdraw(uint256) external returns (bool); + function withdrawTo(uint256, address) external returns (bool); + function recover() external returns (uint256); } diff --git a/contracts/modules/interfaces/IexecEscrowTokenSwap.sol b/contracts/modules/interfaces/IexecEscrowTokenSwap.sol index 7720d6439..d4dbf33e5 100644 --- a/contracts/modules/interfaces/IexecEscrowTokenSwap.sol +++ b/contracts/modules/interfaces/IexecEscrowTokenSwap.sol @@ -1,54 +1,37 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol"; import "../../libs/IexecLibOrders_v5.sol"; - -interface IexecEscrowTokenSwap -{ - receive() external payable; - fallback() external payable; - - function UniswapV2Router () external view returns (IUniswapV2Router02); - function estimateDepositEthSent (uint256) external view returns (uint256); - function estimateDepositTokenWanted(uint256) external view returns (uint256); - function estimateWithdrawTokenSent (uint256) external view returns (uint256); - function estimateWithdrawEthWanted (uint256) external view returns (uint256); - - function depositEth ( ) external payable; - function depositEthFor ( address) external payable; - function safeDepositEth ( uint256 ) external payable; - function safeDepositEthFor( uint256, address) external payable; - function requestToken (uint256 ) external payable; - function requestTokenFor (uint256, address) external payable; - function withdrawEth (uint256 ) external; - function withdrawEthTo (uint256, address) external; - function safeWithdrawEth (uint256, uint256 ) external; - function safeWithdrawEthTo(uint256, uint256, address) external; - - function matchOrdersWithEth( - IexecLibOrders_v5.AppOrder memory, - IexecLibOrders_v5.DatasetOrder memory, - IexecLibOrders_v5.WorkerpoolOrder memory, - IexecLibOrders_v5.RequestOrder memory) - external payable returns (bytes32); +interface IexecEscrowTokenSwap { + receive() external payable; + fallback() external payable; + + function UniswapV2Router() external view returns (IUniswapV2Router02); + function estimateDepositEthSent(uint256) external view returns (uint256); + function estimateDepositTokenWanted(uint256) external view returns (uint256); + function estimateWithdrawTokenSent(uint256) external view returns (uint256); + function estimateWithdrawEthWanted(uint256) external view returns (uint256); + + function depositEth() external payable; + function depositEthFor(address) external payable; + function safeDepositEth(uint256) external payable; + function safeDepositEthFor(uint256, address) external payable; + function requestToken(uint256) external payable; + function requestTokenFor(uint256, address) external payable; + function withdrawEth(uint256) external; + function withdrawEthTo(uint256, address) external; + function safeWithdrawEth(uint256, uint256) external; + function safeWithdrawEthTo(uint256, uint256, address) external; + + function matchOrdersWithEth( + IexecLibOrders_v5.AppOrder memory, + IexecLibOrders_v5.DatasetOrder memory, + IexecLibOrders_v5.WorkerpoolOrder memory, + IexecLibOrders_v5.RequestOrder memory + ) external payable returns (bytes32); } diff --git a/contracts/modules/interfaces/IexecMaintenance.sol b/contracts/modules/interfaces/IexecMaintenance.sol index 5f907ef4d..f84628aa2 100644 --- a/contracts/modules/interfaces/IexecMaintenance.sol +++ b/contracts/modules/interfaces/IexecMaintenance.sol @@ -1,33 +1,25 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "../../libs/IexecLibOrders_v5.sol"; - -interface IexecMaintenance -{ - function configure(address,string calldata,string calldata,uint8,address,address,address,address) external; - function domain() external view returns (IexecLibOrders_v5.EIP712Domain memory); - function updateDomainSeparator() external; - function importScore(address) external; - function setTeeBroker(address) external; - function setCallbackGas(uint256) external; +interface IexecMaintenance { + function configure( + address, + string calldata, + string calldata, + uint8, + address, + address, + address, + address + ) external; + function domain() external view returns (IexecLibOrders_v5.EIP712Domain memory); + function updateDomainSeparator() external; + function importScore(address) external; + function setTeeBroker(address) external; + function setCallbackGas(uint256) external; } diff --git a/contracts/modules/interfaces/IexecMaintenanceExtra.sol b/contracts/modules/interfaces/IexecMaintenanceExtra.sol index 53b228002..7ba27e22a 100644 --- a/contracts/modules/interfaces/IexecMaintenanceExtra.sol +++ b/contracts/modules/interfaces/IexecMaintenanceExtra.sol @@ -1,26 +1,9 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; - -interface IexecMaintenanceExtra -{ - function changeRegistries(address,address,address) external; +interface IexecMaintenanceExtra { + function changeRegistries(address, address, address) external; } diff --git a/contracts/modules/interfaces/IexecOrderManagement.sol b/contracts/modules/interfaces/IexecOrderManagement.sol index 45f7a6f7d..539614774 100644 --- a/contracts/modules/interfaces/IexecOrderManagement.sol +++ b/contracts/modules/interfaces/IexecOrderManagement.sol @@ -1,40 +1,23 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "../../libs/IexecLibOrders_v5.sol"; +interface IexecOrderManagement { + event SignedAppOrder(bytes32 appHash); + event SignedDatasetOrder(bytes32 datasetHash); + event SignedWorkerpoolOrder(bytes32 workerpoolHash); + event SignedRequestOrder(bytes32 requestHash); + event ClosedAppOrder(bytes32 appHash); + event ClosedDatasetOrder(bytes32 datasetHash); + event ClosedWorkerpoolOrder(bytes32 workerpoolHash); + event ClosedRequestOrder(bytes32 requestHash); -interface IexecOrderManagement -{ - event SignedAppOrder (bytes32 appHash); - event SignedDatasetOrder (bytes32 datasetHash); - event SignedWorkerpoolOrder(bytes32 workerpoolHash); - event SignedRequestOrder (bytes32 requestHash); - event ClosedAppOrder (bytes32 appHash); - event ClosedDatasetOrder (bytes32 datasetHash); - event ClosedWorkerpoolOrder(bytes32 workerpoolHash); - event ClosedRequestOrder (bytes32 requestHash); - - function manageAppOrder (IexecLibOrders_v5.AppOrderOperation calldata) external; - function manageDatasetOrder (IexecLibOrders_v5.DatasetOrderOperation calldata) external; - function manageWorkerpoolOrder(IexecLibOrders_v5.WorkerpoolOrderOperation calldata) external; - function manageRequestOrder (IexecLibOrders_v5.RequestOrderOperation calldata) external; + function manageAppOrder(IexecLibOrders_v5.AppOrderOperation calldata) external; + function manageDatasetOrder(IexecLibOrders_v5.DatasetOrderOperation calldata) external; + function manageWorkerpoolOrder(IexecLibOrders_v5.WorkerpoolOrderOperation calldata) external; + function manageRequestOrder(IexecLibOrders_v5.RequestOrderOperation calldata) external; } diff --git a/contracts/modules/interfaces/IexecOrderManagement.v8.sol b/contracts/modules/interfaces/IexecOrderManagement.v8.sol index b8c9fdfe5..2bef3972b 100644 --- a/contracts/modules/interfaces/IexecOrderManagement.v8.sol +++ b/contracts/modules/interfaces/IexecOrderManagement.v8.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2024-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; diff --git a/contracts/modules/interfaces/IexecPoco1.sol b/contracts/modules/interfaces/IexecPoco1.sol index 47827c53e..2f2f682f6 100644 --- a/contracts/modules/interfaces/IexecPoco1.sol +++ b/contracts/modules/interfaces/IexecPoco1.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2020-2024 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.0; diff --git a/contracts/modules/interfaces/IexecPoco1.v8.sol b/contracts/modules/interfaces/IexecPoco1.v8.sol index 73d70352e..1516b5eea 100644 --- a/contracts/modules/interfaces/IexecPoco1.v8.sol +++ b/contracts/modules/interfaces/IexecPoco1.v8.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2024-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; diff --git a/contracts/modules/interfaces/IexecPoco2.sol b/contracts/modules/interfaces/IexecPoco2.sol index b39b88822..89ab8139b 100644 --- a/contracts/modules/interfaces/IexecPoco2.sol +++ b/contracts/modules/interfaces/IexecPoco2.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2020-2024 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.0; diff --git a/contracts/modules/interfaces/IexecPoco2.v8.sol b/contracts/modules/interfaces/IexecPoco2.v8.sol index f08e2ba37..88dc1f762 100644 --- a/contracts/modules/interfaces/IexecPoco2.v8.sol +++ b/contracts/modules/interfaces/IexecPoco2.v8.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2020-2024 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; diff --git a/contracts/modules/interfaces/IexecPocoAccessors.sol b/contracts/modules/interfaces/IexecPocoAccessors.sol index 7907cc1eb..fb13aab41 100644 --- a/contracts/modules/interfaces/IexecPocoAccessors.sol +++ b/contracts/modules/interfaces/IexecPocoAccessors.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2024-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; diff --git a/contracts/modules/interfaces/IexecPocoBoost.sol b/contracts/modules/interfaces/IexecPocoBoost.sol index ab0dc65dc..0652de4b6 100644 --- a/contracts/modules/interfaces/IexecPocoBoost.sol +++ b/contracts/modules/interfaces/IexecPocoBoost.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023-2024 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2023-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; diff --git a/contracts/modules/interfaces/IexecPocoBoostAccessors.sol b/contracts/modules/interfaces/IexecPocoBoostAccessors.sol index 5928ff723..8023a3d01 100644 --- a/contracts/modules/interfaces/IexecPocoBoostAccessors.sol +++ b/contracts/modules/interfaces/IexecPocoBoostAccessors.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2023-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; diff --git a/contracts/modules/interfaces/IexecRelay.sol b/contracts/modules/interfaces/IexecRelay.sol index 365ec6bca..ae8ce22d9 100644 --- a/contracts/modules/interfaces/IexecRelay.sol +++ b/contracts/modules/interfaces/IexecRelay.sol @@ -1,36 +1,19 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "../../libs/IexecLibOrders_v5.sol"; +interface IexecRelay { + event BroadcastAppOrder(IexecLibOrders_v5.AppOrder apporder); + event BroadcastDatasetOrder(IexecLibOrders_v5.DatasetOrder datasetorder); + event BroadcastWorkerpoolOrder(IexecLibOrders_v5.WorkerpoolOrder workerpoolorder); + event BroadcastRequestOrder(IexecLibOrders_v5.RequestOrder requestorder); -interface IexecRelay -{ - event BroadcastAppOrder (IexecLibOrders_v5.AppOrder apporder ); - event BroadcastDatasetOrder (IexecLibOrders_v5.DatasetOrder datasetorder ); - event BroadcastWorkerpoolOrder(IexecLibOrders_v5.WorkerpoolOrder workerpoolorder); - event BroadcastRequestOrder (IexecLibOrders_v5.RequestOrder requestorder ); - - function broadcastAppOrder (IexecLibOrders_v5.AppOrder calldata) external; - function broadcastDatasetOrder (IexecLibOrders_v5.DatasetOrder calldata) external; - function broadcastWorkerpoolOrder(IexecLibOrders_v5.WorkerpoolOrder calldata) external; - function broadcastRequestOrder (IexecLibOrders_v5.RequestOrder calldata) external; + function broadcastAppOrder(IexecLibOrders_v5.AppOrder calldata) external; + function broadcastDatasetOrder(IexecLibOrders_v5.DatasetOrder calldata) external; + function broadcastWorkerpoolOrder(IexecLibOrders_v5.WorkerpoolOrder calldata) external; + function broadcastRequestOrder(IexecLibOrders_v5.RequestOrder calldata) external; } diff --git a/contracts/modules/interfaces/IexecTokenSpender.sol b/contracts/modules/interfaces/IexecTokenSpender.sol index 70643cb2e..80bbb6c3b 100644 --- a/contracts/modules/interfaces/IexecTokenSpender.sol +++ b/contracts/modules/interfaces/IexecTokenSpender.sol @@ -1,26 +1,9 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; - -interface IexecTokenSpender -{ - function receiveApproval(address,uint256,address,bytes calldata) external returns (bool); +interface IexecTokenSpender { + function receiveApproval(address, uint256, address, bytes calldata) external returns (bool); } diff --git a/contracts/registries/IRegistry.sol b/contracts/registries/IRegistry.sol index 0734d296e..ccdd27b18 100644 --- a/contracts/registries/IRegistry.sol +++ b/contracts/registries/IRegistry.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; import "@openzeppelin/contracts/token/ERC721/IERC721Enumerable.sol"; diff --git a/contracts/registries/Registry.sol b/contracts/registries/Registry.sol index 806e7c0f4..6b924378b 100644 --- a/contracts/registries/Registry.sol +++ b/contracts/registries/Registry.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; import "@iexec/solidity/contracts/Upgradeability/InitializableUpgradeabilityProxy.sol"; diff --git a/contracts/registries/RegistryEntry.sol b/contracts/registries/RegistryEntry.sol index 696d6d5d6..a3a873f7d 100644 --- a/contracts/registries/RegistryEntry.sol +++ b/contracts/registries/RegistryEntry.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; import "./Registry.sol"; diff --git a/contracts/registries/apps/App.sol b/contracts/registries/apps/App.sol index c7321dcf5..7196cd4d2 100644 --- a/contracts/registries/apps/App.sol +++ b/contracts/registries/apps/App.sol @@ -1,53 +1,35 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; import "../RegistryEntry.sol"; +contract App is RegistryEntry { + /** + * Members + */ + string public m_appName; + string public m_appType; + bytes public m_appMultiaddr; + bytes32 public m_appChecksum; + bytes public m_appMREnclave; -contract App is RegistryEntry -{ - /** - * Members - */ - string public m_appName; - string public m_appType; - bytes public m_appMultiaddr; - bytes32 public m_appChecksum; - bytes public m_appMREnclave; - - /** - * Constructor - */ - function initialize( - string memory _appName, - string memory _appType, - bytes memory _appMultiaddr, - bytes32 _appChecksum, - bytes memory _appMREnclave) - public - { - _initialize(msg.sender); - m_appName = _appName; - m_appType = _appType; - m_appMultiaddr = _appMultiaddr; - m_appChecksum = _appChecksum; - m_appMREnclave = _appMREnclave; - } + /** + * Constructor + */ + function initialize( + string memory _appName, + string memory _appType, + bytes memory _appMultiaddr, + bytes32 _appChecksum, + bytes memory _appMREnclave + ) public { + _initialize(msg.sender); + m_appName = _appName; + m_appType = _appType; + m_appMultiaddr = _appMultiaddr; + m_appChecksum = _appChecksum; + m_appMREnclave = _appMREnclave; + } } diff --git a/contracts/registries/apps/AppRegistry.sol b/contracts/registries/apps/AppRegistry.sol index 550f25dd8..7c1acbbe4 100644 --- a/contracts/registries/apps/AppRegistry.sol +++ b/contracts/registries/apps/AppRegistry.sol @@ -1,82 +1,84 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; -import '../Registry.sol'; -import './App.sol'; - +import "../Registry.sol"; +import "./App.sol"; -contract AppRegistry is Registry -{ - /** - * Constructor - */ - constructor() - public Registry( - address(new App()), - 'iExec Application Registry (V5)', - 'iExecAppsV5') - { - } +contract AppRegistry is Registry { + /** + * Constructor + */ + constructor() + public + Registry(address(new App()), "iExec Application Registry (V5)", "iExecAppsV5") + {} - /** - * App creation - */ - function encodeInitializer( - string memory _appName, - string memory _appType, - bytes memory _appMultiaddr, - bytes32 _appChecksum, - bytes memory _appMREnclave) - internal pure returns (bytes memory) - { - return abi.encodeWithSignature( - 'initialize(string,string,bytes,bytes32,bytes)' - , _appName - , _appType - , _appMultiaddr - , _appChecksum - , _appMREnclave - ); - } + /** + * App creation + */ + function encodeInitializer( + string memory _appName, + string memory _appType, + bytes memory _appMultiaddr, + bytes32 _appChecksum, + bytes memory _appMREnclave + ) internal pure returns (bytes memory) { + return + abi.encodeWithSignature( + "initialize(string,string,bytes,bytes32,bytes)", + _appName, + _appType, + _appMultiaddr, + _appChecksum, + _appMREnclave + ); + } - function createApp( - address _appOwner, - string calldata _appName, - string calldata _appType, - bytes calldata _appMultiaddr, - bytes32 _appChecksum, - bytes calldata _appMREnclave) - external returns (App) - { - return App(_mintCreate(_appOwner, encodeInitializer(_appName, _appType, _appMultiaddr, _appChecksum, _appMREnclave))); - } + function createApp( + address _appOwner, + string calldata _appName, + string calldata _appType, + bytes calldata _appMultiaddr, + bytes32 _appChecksum, + bytes calldata _appMREnclave + ) external returns (App) { + return + App( + _mintCreate( + _appOwner, + encodeInitializer( + _appName, + _appType, + _appMultiaddr, + _appChecksum, + _appMREnclave + ) + ) + ); + } - function predictApp( - address _appOwner, - string calldata _appName, - string calldata _appType, - bytes calldata _appMultiaddr, - bytes32 _appChecksum, - bytes calldata _appMREnclave) - external view returns (App) - { - return App(_mintPredict(_appOwner, encodeInitializer(_appName, _appType, _appMultiaddr, _appChecksum, _appMREnclave))); - } + function predictApp( + address _appOwner, + string calldata _appName, + string calldata _appType, + bytes calldata _appMultiaddr, + bytes32 _appChecksum, + bytes calldata _appMREnclave + ) external view returns (App) { + return + App( + _mintPredict( + _appOwner, + encodeInitializer( + _appName, + _appType, + _appMultiaddr, + _appChecksum, + _appMREnclave + ) + ) + ); + } } diff --git a/contracts/registries/datasets/Dataset.sol b/contracts/registries/datasets/Dataset.sol index 831a23fe3..158b4e3a3 100644 --- a/contracts/registries/datasets/Dataset.sol +++ b/contracts/registries/datasets/Dataset.sol @@ -1,47 +1,29 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; import "../RegistryEntry.sol"; +contract Dataset is RegistryEntry { + /** + * Members + */ + string public m_datasetName; + bytes public m_datasetMultiaddr; + bytes32 public m_datasetChecksum; -contract Dataset is RegistryEntry -{ - /** - * Members - */ - string public m_datasetName; - bytes public m_datasetMultiaddr; - bytes32 public m_datasetChecksum; - - /** - * Constructor - */ - function initialize( - string memory _datasetName, - bytes memory _datasetMultiaddr, - bytes32 _datasetChecksum) - public - { - _initialize(msg.sender); - m_datasetName = _datasetName; - m_datasetMultiaddr = _datasetMultiaddr; - m_datasetChecksum = _datasetChecksum; - } + /** + * Constructor + */ + function initialize( + string memory _datasetName, + bytes memory _datasetMultiaddr, + bytes32 _datasetChecksum + ) public { + _initialize(msg.sender); + m_datasetName = _datasetName; + m_datasetMultiaddr = _datasetMultiaddr; + m_datasetChecksum = _datasetChecksum; + } } diff --git a/contracts/registries/datasets/DatasetRegistry.sol b/contracts/registries/datasets/DatasetRegistry.sol index 83cd2e9b9..56b65e421 100644 --- a/contracts/registries/datasets/DatasetRegistry.sol +++ b/contracts/registries/datasets/DatasetRegistry.sol @@ -1,74 +1,64 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; -import '../Registry.sol'; -import './Dataset.sol'; - +import "../Registry.sol"; +import "./Dataset.sol"; -contract DatasetRegistry is Registry -{ - /** - * Constructor - */ - constructor() - public Registry( - address(new Dataset()), - 'iExec Dataset Registry (V5)', - 'iExecDatasetsV5') - { - } +contract DatasetRegistry is Registry { + /** + * Constructor + */ + constructor() + public + Registry(address(new Dataset()), "iExec Dataset Registry (V5)", "iExecDatasetsV5") + {} - /** - * Dataset creation - */ - function encodeInitializer( - string memory _datasetName, - bytes memory _datasetMultiaddr, - bytes32 _datasetChecksum) - internal pure returns (bytes memory) - { - return abi.encodeWithSignature( - 'initialize(string,bytes,bytes32)' - , _datasetName - , _datasetMultiaddr - , _datasetChecksum - ); - } + /** + * Dataset creation + */ + function encodeInitializer( + string memory _datasetName, + bytes memory _datasetMultiaddr, + bytes32 _datasetChecksum + ) internal pure returns (bytes memory) { + return + abi.encodeWithSignature( + "initialize(string,bytes,bytes32)", + _datasetName, + _datasetMultiaddr, + _datasetChecksum + ); + } - function createDataset( - address _datasetOwner, - string calldata _datasetName, - bytes calldata _datasetMultiaddr, - bytes32 _datasetChecksum) - external returns (Dataset) - { - return Dataset(_mintCreate(_datasetOwner, encodeInitializer(_datasetName, _datasetMultiaddr, _datasetChecksum))); - } + function createDataset( + address _datasetOwner, + string calldata _datasetName, + bytes calldata _datasetMultiaddr, + bytes32 _datasetChecksum + ) external returns (Dataset) { + return + Dataset( + _mintCreate( + _datasetOwner, + encodeInitializer(_datasetName, _datasetMultiaddr, _datasetChecksum) + ) + ); + } - function predictDataset( - address _datasetOwner, - string calldata _datasetName, - bytes calldata _datasetMultiaddr, - bytes32 _datasetChecksum) - external view returns (Dataset) - { - return Dataset(_mintPredict(_datasetOwner, encodeInitializer(_datasetName, _datasetMultiaddr, _datasetChecksum))); - } + function predictDataset( + address _datasetOwner, + string calldata _datasetName, + bytes calldata _datasetMultiaddr, + bytes32 _datasetChecksum + ) external view returns (Dataset) { + return + Dataset( + _mintPredict( + _datasetOwner, + encodeInitializer(_datasetName, _datasetMultiaddr, _datasetChecksum) + ) + ); + } } diff --git a/contracts/registries/workerpools/IWorkerpool.v8.sol b/contracts/registries/workerpools/IWorkerpool.v8.sol index 2ed7c9d58..4d428a550 100644 --- a/contracts/registries/workerpools/IWorkerpool.v8.sol +++ b/contracts/registries/workerpools/IWorkerpool.v8.sol @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023-2024 IEXEC BLOCKCHAIN TECH +// SPDX-FileCopyrightText: 2023-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; diff --git a/contracts/registries/workerpools/Workerpool.sol b/contracts/registries/workerpools/Workerpool.sol index 90729ff08..693996431 100644 --- a/contracts/registries/workerpools/Workerpool.sol +++ b/contracts/registries/workerpools/Workerpool.sol @@ -1,68 +1,52 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; import "../RegistryEntry.sol"; - -contract Workerpool is RegistryEntry -{ - /** - * Parameters - */ - string public m_workerpoolDescription; - uint256 public m_workerStakeRatioPolicy; // % of reward to stake - uint256 public m_schedulerRewardRatioPolicy; // % of reward given to scheduler - - /** - * Events - */ - event PolicyUpdate( - uint256 oldWorkerStakeRatioPolicy, uint256 newWorkerStakeRatioPolicy, - uint256 oldSchedulerRewardRatioPolicy, uint256 newSchedulerRewardRatioPolicy); - - /** - * Constructor - */ - function initialize( - string memory _workerpoolDescription) - public - { - _initialize(msg.sender); - m_workerpoolDescription = _workerpoolDescription; - m_workerStakeRatioPolicy = 30; // mutable - m_schedulerRewardRatioPolicy = 1; // mutable - } - - function changePolicy( - uint256 _newWorkerStakeRatioPolicy, - uint256 _newSchedulerRewardRatioPolicy) - external onlyOwner() - { - require(_newSchedulerRewardRatioPolicy <= 100); - - emit PolicyUpdate( - m_workerStakeRatioPolicy, _newWorkerStakeRatioPolicy, - m_schedulerRewardRatioPolicy, _newSchedulerRewardRatioPolicy - ); - - m_workerStakeRatioPolicy = _newWorkerStakeRatioPolicy; - m_schedulerRewardRatioPolicy = _newSchedulerRewardRatioPolicy; - } +contract Workerpool is RegistryEntry { + /** + * Parameters + */ + string public m_workerpoolDescription; + uint256 public m_workerStakeRatioPolicy; // % of reward to stake + uint256 public m_schedulerRewardRatioPolicy; // % of reward given to scheduler + + /** + * Events + */ + event PolicyUpdate( + uint256 oldWorkerStakeRatioPolicy, + uint256 newWorkerStakeRatioPolicy, + uint256 oldSchedulerRewardRatioPolicy, + uint256 newSchedulerRewardRatioPolicy + ); + + /** + * Constructor + */ + function initialize(string memory _workerpoolDescription) public { + _initialize(msg.sender); + m_workerpoolDescription = _workerpoolDescription; + m_workerStakeRatioPolicy = 30; // mutable + m_schedulerRewardRatioPolicy = 1; // mutable + } + + function changePolicy( + uint256 _newWorkerStakeRatioPolicy, + uint256 _newSchedulerRewardRatioPolicy + ) external onlyOwner { + require(_newSchedulerRewardRatioPolicy <= 100); + + emit PolicyUpdate( + m_workerStakeRatioPolicy, + _newWorkerStakeRatioPolicy, + m_schedulerRewardRatioPolicy, + _newSchedulerRewardRatioPolicy + ); + + m_workerStakeRatioPolicy = _newWorkerStakeRatioPolicy; + m_schedulerRewardRatioPolicy = _newSchedulerRewardRatioPolicy; + } } diff --git a/contracts/registries/workerpools/WorkerpoolRegistry.sol b/contracts/registries/workerpools/WorkerpoolRegistry.sol index b3958cdcf..319ad5871 100644 --- a/contracts/registries/workerpools/WorkerpoolRegistry.sol +++ b/contracts/registries/workerpools/WorkerpoolRegistry.sol @@ -1,66 +1,41 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; -import '../Registry.sol'; -import './Workerpool.sol'; - - -contract WorkerpoolRegistry is Registry -{ - /** - * Constructor - */ - constructor() - public Registry( - address(new Workerpool()), - 'iExec Workerpool Registry (V5)', - 'iExecWorkerpoolV5') - { - } - - /** - * Pool creation - */ - function encodeInitializer( - string memory _workerpoolDescription) - internal pure returns (bytes memory) - { - return abi.encodeWithSignature( - 'initialize(string)' - , _workerpoolDescription - ); - } - - function createWorkerpool( - address _workerpoolOwner, - string calldata _workerpoolDescription) - external returns (Workerpool) - { - return Workerpool(_mintCreate(_workerpoolOwner, encodeInitializer(_workerpoolDescription))); - } - - function predictWorkerpool( - address _workerpoolOwner, - string calldata _workerpoolDescription) - external view returns (Workerpool) - { - return Workerpool(_mintPredict(_workerpoolOwner, encodeInitializer(_workerpoolDescription))); - } +import "../Registry.sol"; +import "./Workerpool.sol"; + +contract WorkerpoolRegistry is Registry { + /** + * Constructor + */ + constructor() + public + Registry(address(new Workerpool()), "iExec Workerpool Registry (V5)", "iExecWorkerpoolV5") + {} + + /** + * Pool creation + */ + function encodeInitializer( + string memory _workerpoolDescription + ) internal pure returns (bytes memory) { + return abi.encodeWithSignature("initialize(string)", _workerpoolDescription); + } + + function createWorkerpool( + address _workerpoolOwner, + string calldata _workerpoolDescription + ) external returns (Workerpool) { + return Workerpool(_mintCreate(_workerpoolOwner, encodeInitializer(_workerpoolDescription))); + } + + function predictWorkerpool( + address _workerpoolOwner, + string calldata _workerpoolDescription + ) external view returns (Workerpool) { + return + Workerpool(_mintPredict(_workerpoolOwner, encodeInitializer(_workerpoolDescription))); + } } diff --git a/contracts/tools/TimelockController.sol b/contracts/tools/TimelockController.sol index 9615b641c..5253a575f 100644 --- a/contracts/tools/TimelockController.sol +++ b/contracts/tools/TimelockController.sol @@ -1,4 +1,5 @@ -// SPDX-License-Identifier: MIT +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH +// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; diff --git a/contracts/tools/testing/TestClient.sol b/contracts/tools/testing/TestClient.sol index 5943c3a9a..f5e11e949 100644 --- a/contracts/tools/testing/TestClient.sol +++ b/contracts/tools/testing/TestClient.sol @@ -1,43 +1,21 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; import "@iexec/solidity/contracts/ERC1154/IERC1154.sol"; +contract TestClient is IOracleConsumer { + event GotResult(bytes32 indexed id, bytes result); -contract TestClient is IOracleConsumer -{ - event GotResult(bytes32 indexed id, bytes result); - - mapping(bytes32 => uint256) public gstore; - mapping(bytes32 => bytes ) public store; - - constructor() - public - { - } + mapping(bytes32 => uint256) public gstore; + mapping(bytes32 => bytes) public store; - function receiveResult(bytes32 id, bytes calldata result) external override - { - gstore[id] = gasleft(); - store[id] = result; - emit GotResult(id, result); - } + constructor() public {} + function receiveResult(bytes32 id, bytes calldata result) external override { + gstore[id] = gasleft(); + store[id] = result; + emit GotResult(id, result); + } } diff --git a/contracts/tools/testing/TestReceiver.sol b/contracts/tools/testing/TestReceiver.sol index e4ce8fda1..d357f9064 100644 --- a/contracts/tools/testing/TestReceiver.sol +++ b/contracts/tools/testing/TestReceiver.sol @@ -1,51 +1,26 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -/****************************************************************************** - * Copyright 2020 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ - pragma solidity ^0.6.0; import "../../modules/interfaces/IexecTokenSpender.sol"; - -contract TestReceiver is IexecTokenSpender -{ - event GotApproval(address sender, uint256 value, address token, bytes extraData); - - constructor() - public - { - } - - function receiveApproval( - address _sender, - uint256 _value, - address _token, - bytes calldata _extraData) - external override returns (bool) - { - if (_value == 0) - { - return false; - } - else - { - emit GotApproval(_sender, _value, _token, _extraData); - return true; - } - } - +contract TestReceiver is IexecTokenSpender { + event GotApproval(address sender, uint256 value, address token, bytes extraData); + + constructor() public {} + + function receiveApproval( + address _sender, + uint256 _value, + address _token, + bytes calldata _extraData + ) external override returns (bool) { + if (_value == 0) { + return false; + } else { + emit GotApproval(_sender, _value, _token, _extraData); + return true; + } + } }