From a0fb56bd889628f57d3bc425b45261e85c470a55 Mon Sep 17 00:00:00 2001 From: Zied <26070035+zguesmi@users.noreply.github.com> Date: Mon, 22 Apr 2024 17:19:39 +0200 Subject: [PATCH 1/2] Format solidity interfaces --- contracts/IexecInterfaceNative.sol | 45 ++---- contracts/IexecInterfaceNativeABILegacy.sol | 47 ++----- contracts/IexecInterfaceToken.sol | 49 +++---- contracts/IexecInterfaceTokenABILegacy.sol | 51 +++---- contracts/external/interfaces/IERC734.sol | 17 +-- .../modules/interfaces/ENSIntegration.sol | 23 +--- contracts/modules/interfaces/IOwnable.sol | 29 +--- .../modules/interfaces/IexecAccessors.sol | 119 +++++++++------- .../interfaces/IexecAccessorsABILegacy.sol | 128 +++++++----------- .../interfaces/IexecCategoryManager.sol | 25 +--- contracts/modules/interfaces/IexecERC20.sol | 40 ++---- .../modules/interfaces/IexecERC20Common.sol | 29 +--- .../modules/interfaces/IexecEscrowNative.sol | 44 +++--- .../modules/interfaces/IexecEscrowToken.sol | 41 ++---- .../interfaces/IexecEscrowTokenSwap.sol | 85 ++++++------ .../modules/interfaces/IexecMaintenance.sol | 45 +++--- .../interfaces/IexecMaintenanceExtra.sol | 23 +--- .../interfaces/IexecOrderManagement.sol | 46 +++---- contracts/modules/interfaces/IexecRelay.sol | 38 ++---- .../modules/interfaces/IexecTokenSpender.sol | 23 +--- contracts/registries/IRegistry.sol | 22 +-- 21 files changed, 345 insertions(+), 624 deletions(-) diff --git a/contracts/IexecInterfaceNative.sol b/contracts/IexecInterfaceNative.sol index c7a3f35d2..295b03894 100644 --- a/contracts/IexecInterfaceNative.sol +++ b/contracts/IexecInterfaceNative.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2024 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; @@ -32,19 +17,17 @@ import "./modules/interfaces/IexecRelay.sol"; import "./modules/interfaces/IexecTokenSpender.sol"; import "./modules/interfaces/ENSIntegration.sol"; - interface IexecInterfaceNative is - IOwnable, - IexecAccessors, - IexecCategoryManager, - IexecERC20, - IexecEscrowNative, - IexecMaintenance, - IexecOrderManagement, - IexecPoco1, - IexecPoco2, - IexecRelay, - IexecTokenSpender, - ENSIntegration -{ -} + IOwnable, + IexecAccessors, + IexecCategoryManager, + IexecERC20, + IexecEscrowNative, + IexecMaintenance, + IexecOrderManagement, + IexecPoco1, + IexecPoco2, + IexecRelay, + IexecTokenSpender, + ENSIntegration +{} diff --git a/contracts/IexecInterfaceNativeABILegacy.sol b/contracts/IexecInterfaceNativeABILegacy.sol index 141068e9a..08312a681 100644 --- a/contracts/IexecInterfaceNativeABILegacy.sol +++ b/contracts/IexecInterfaceNativeABILegacy.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2024 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; @@ -33,20 +18,18 @@ import "./modules/interfaces/IexecRelay.sol"; import "./modules/interfaces/IexecTokenSpender.sol"; import "./modules/interfaces/ENSIntegration.sol"; - interface IexecInterfaceNativeABILegacy is - IOwnable, - IexecAccessors, - IexecAccessorsABILegacy, - IexecCategoryManager, - IexecERC20, - IexecEscrowNative, - IexecMaintenance, - IexecOrderManagement, - IexecPoco1, - IexecPoco2, - IexecRelay, - IexecTokenSpender, - ENSIntegration -{ -} + IOwnable, + IexecAccessors, + IexecAccessorsABILegacy, + IexecCategoryManager, + IexecERC20, + IexecEscrowNative, + IexecMaintenance, + IexecOrderManagement, + IexecPoco1, + IexecPoco2, + IexecRelay, + IexecTokenSpender, + ENSIntegration +{} diff --git a/contracts/IexecInterfaceToken.sol b/contracts/IexecInterfaceToken.sol index 550c6bc86..dd3973fa1 100644 --- a/contracts/IexecInterfaceToken.sol +++ b/contracts/IexecInterfaceToken.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2024 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; @@ -33,22 +18,22 @@ import "./modules/interfaces/IexecRelay.sol"; import "./modules/interfaces/IexecTokenSpender.sol"; import "./modules/interfaces/ENSIntegration.sol"; - interface IexecInterfaceToken is - IOwnable, - IexecAccessors, - IexecCategoryManager, - IexecERC20, - IexecEscrowToken, - IexecEscrowTokenSwap, - IexecMaintenance, - IexecOrderManagement, - IexecPoco1, - IexecPoco2, - IexecRelay, - IexecTokenSpender, - ENSIntegration + IOwnable, + IexecAccessors, + IexecCategoryManager, + IexecERC20, + IexecEscrowToken, + IexecEscrowTokenSwap, + IexecMaintenance, + IexecOrderManagement, + IexecPoco1, + IexecPoco2, + IexecRelay, + IexecTokenSpender, + ENSIntegration { - receive() external override(IexecEscrowToken, IexecEscrowTokenSwap) payable; - fallback() external override(IexecEscrowToken, IexecEscrowTokenSwap) payable; + receive() external payable override(IexecEscrowToken, IexecEscrowTokenSwap); + + fallback() external payable override(IexecEscrowToken, IexecEscrowTokenSwap); } diff --git a/contracts/IexecInterfaceTokenABILegacy.sol b/contracts/IexecInterfaceTokenABILegacy.sol index d1baf6275..2c56d923c 100644 --- a/contracts/IexecInterfaceTokenABILegacy.sol +++ b/contracts/IexecInterfaceTokenABILegacy.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2024 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; @@ -34,23 +19,23 @@ import "./modules/interfaces/IexecRelay.sol"; import "./modules/interfaces/IexecTokenSpender.sol"; import "./modules/interfaces/ENSIntegration.sol"; - interface IexecInterfaceTokenABILegacy is - IOwnable, - IexecAccessors, - IexecAccessorsABILegacy, - IexecCategoryManager, - IexecERC20, - IexecEscrowToken, - IexecEscrowTokenSwap, - IexecMaintenance, - IexecOrderManagement, - IexecPoco1, - IexecPoco2, - IexecRelay, - IexecTokenSpender, - ENSIntegration + IOwnable, + IexecAccessors, + IexecAccessorsABILegacy, + IexecCategoryManager, + IexecERC20, + IexecEscrowToken, + IexecEscrowTokenSwap, + IexecMaintenance, + IexecOrderManagement, + IexecPoco1, + IexecPoco2, + IexecRelay, + IexecTokenSpender, + ENSIntegration { - receive() external override(IexecEscrowToken, IexecEscrowTokenSwap) payable; - fallback() external override(IexecEscrowToken, IexecEscrowTokenSwap) payable; + receive() external payable override(IexecEscrowToken, IexecEscrowTokenSwap); + + fallback() external payable override(IexecEscrowToken, IexecEscrowTokenSwap); } diff --git a/contracts/external/interfaces/IERC734.sol b/contracts/external/interfaces/IERC734.sol index 2a5dc8d7b..d51e3308a 100644 --- a/contracts/external/interfaces/IERC734.sol +++ b/contracts/external/interfaces/IERC734.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2023-2024 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/modules/interfaces/ENSIntegration.sol b/contracts/modules/interfaces/ENSIntegration.sol index cafc1a579..5cc633215 100644 --- a/contracts/modules/interfaces/ENSIntegration.sol +++ b/contracts/modules/interfaces/ENSIntegration.sol @@ -1,26 +1,9 @@ +// SPDX-FileCopyrightText: 2020-2024 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 ENSIntegration -{ - function setName(address ens, string calldata name) external; +interface ENSIntegration { + function setName(address ens, string calldata name) external; } diff --git a/contracts/modules/interfaces/IOwnable.sol b/contracts/modules/interfaces/IOwnable.sol index 47d3af917..fca7b2260 100644 --- a/contracts/modules/interfaces/IOwnable.sol +++ b/contracts/modules/interfaces/IOwnable.sol @@ -1,30 +1,15 @@ +// SPDX-FileCopyrightText: 2020-2024 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); + + function owner() external view returns (address); -interface IOwnable -{ - event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); + function renounceOwnership() external; - function owner() external view returns (address); - function renounceOwnership() external; - function transferOwnership(address) external; + function transferOwnership(address) external; } diff --git a/contracts/modules/interfaces/IexecAccessors.sol b/contracts/modules/interfaces/IexecAccessors.sol index 764015015..0d1aed90b 100644 --- a/contracts/modules/interfaces/IexecAccessors.sol +++ b/contracts/modules/interfaces/IexecAccessors.sol @@ -1,21 +1,6 @@ +// SPDX-FileCopyrightText: 2020-2024 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,70 @@ 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); - - 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); +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 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..97eddb739 100644 --- a/contracts/modules/interfaces/IexecAccessorsABILegacy.sol +++ b/contracts/modules/interfaces/IexecAccessorsABILegacy.sol @@ -1,89 +1,55 @@ +// SPDX-FileCopyrightText: 2020-2024 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..c899ad43e 100644 --- a/contracts/modules/interfaces/IexecCategoryManager.sol +++ b/contracts/modules/interfaces/IexecCategoryManager.sol @@ -1,28 +1,11 @@ +// SPDX-FileCopyrightText: 2020-2024 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..1e913920d 100644 --- a/contracts/modules/interfaces/IexecERC20.sol +++ b/contracts/modules/interfaces/IexecERC20.sol @@ -1,34 +1,22 @@ +// SPDX-FileCopyrightText: 2020-2024 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); + + 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); -interface IexecERC20 -{ - event Transfer(address indexed from, address indexed to, uint256 value); - event Approval(address indexed owner, address indexed spender, uint256 value); + function decreaseAllowance(address, uint256) 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); + 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..f2474c2a3 100644 --- a/contracts/modules/interfaces/IexecERC20Common.sol +++ b/contracts/modules/interfaces/IexecERC20Common.sol @@ -1,29 +1,12 @@ +// SPDX-FileCopyrightText: 2020-2024 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..3dbe0e04f 100644 --- a/contracts/modules/interfaces/IexecEscrowNative.sol +++ b/contracts/modules/interfaces/IexecEscrowNative.sol @@ -1,34 +1,26 @@ +// SPDX-FileCopyrightText: 2020-2024 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; + + 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); -interface IexecEscrowNative -{ - receive() external payable; - fallback() external payable; + function withdrawTo(uint256, address) external returns (bool); - 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 recover() external returns (uint256); } diff --git a/contracts/modules/interfaces/IexecEscrowToken.sol b/contracts/modules/interfaces/IexecEscrowToken.sol index 474598505..589e4ddb4 100644 --- a/contracts/modules/interfaces/IexecEscrowToken.sol +++ b/contracts/modules/interfaces/IexecEscrowToken.sol @@ -1,34 +1,23 @@ +// SPDX-FileCopyrightText: 2020-2024 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; + + 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); -interface IexecEscrowToken -{ - receive() external payable; - fallback() external payable; + function withdrawTo(uint256, address) external returns (bool); - 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 recover() external returns (uint256); } diff --git a/contracts/modules/interfaces/IexecEscrowTokenSwap.sol b/contracts/modules/interfaces/IexecEscrowTokenSwap.sol index 7720d6439..f1ee56045 100644 --- a/contracts/modules/interfaces/IexecEscrowTokenSwap.sol +++ b/contracts/modules/interfaces/IexecEscrowTokenSwap.sol @@ -1,54 +1,51 @@ +// SPDX-FileCopyrightText: 2020-2024 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; -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); + 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..67953f5fd 100644 --- a/contracts/modules/interfaces/IexecMaintenance.sol +++ b/contracts/modules/interfaces/IexecMaintenance.sol @@ -1,33 +1,30 @@ +// SPDX-FileCopyrightText: 2020-2024 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; -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; + function setCallbackGas(uint256) external; } diff --git a/contracts/modules/interfaces/IexecMaintenanceExtra.sol b/contracts/modules/interfaces/IexecMaintenanceExtra.sol index 53b228002..6043c1eb4 100644 --- a/contracts/modules/interfaces/IexecMaintenanceExtra.sol +++ b/contracts/modules/interfaces/IexecMaintenanceExtra.sol @@ -1,26 +1,9 @@ +// SPDX-FileCopyrightText: 2020-2024 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..a9bb8c711 100644 --- a/contracts/modules/interfaces/IexecOrderManagement.sol +++ b/contracts/modules/interfaces/IexecOrderManagement.sol @@ -1,40 +1,26 @@ +// SPDX-FileCopyrightText: 2020-2024 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); + + function manageAppOrder(IexecLibOrders_v5.AppOrderOperation calldata) external; + + function manageDatasetOrder(IexecLibOrders_v5.DatasetOrderOperation calldata) external; -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 manageWorkerpoolOrder(IexecLibOrders_v5.WorkerpoolOrderOperation 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; + function manageRequestOrder(IexecLibOrders_v5.RequestOrderOperation calldata) external; } diff --git a/contracts/modules/interfaces/IexecRelay.sol b/contracts/modules/interfaces/IexecRelay.sol index 365ec6bca..9d822ddac 100644 --- a/contracts/modules/interfaces/IexecRelay.sol +++ b/contracts/modules/interfaces/IexecRelay.sol @@ -1,36 +1,22 @@ +// SPDX-FileCopyrightText: 2020-2024 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); + + function broadcastAppOrder(IexecLibOrders_v5.AppOrder calldata) external; + + function broadcastDatasetOrder(IexecLibOrders_v5.DatasetOrder calldata) external; -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 broadcastWorkerpoolOrder(IexecLibOrders_v5.WorkerpoolOrder 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; + function broadcastRequestOrder(IexecLibOrders_v5.RequestOrder calldata) external; } diff --git a/contracts/modules/interfaces/IexecTokenSpender.sol b/contracts/modules/interfaces/IexecTokenSpender.sol index 70643cb2e..e98ebb076 100644 --- a/contracts/modules/interfaces/IexecTokenSpender.sol +++ b/contracts/modules/interfaces/IexecTokenSpender.sol @@ -1,26 +1,9 @@ +// SPDX-FileCopyrightText: 2020-2024 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 02c899d0a..576734763 100644 --- a/contracts/registries/IRegistry.sol +++ b/contracts/registries/IRegistry.sol @@ -1,26 +1,10 @@ +// SPDX-FileCopyrightText: 2020-2024 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"; -interface IRegistry is IERC721Enumerable -{ - function isRegistered(address _entry) external view returns (bool); +interface IRegistry is IERC721Enumerable { + function isRegistered(address _entry) external view returns (bool); } From 394a04a850f2a686059509732c2d7effb55e7db6 Mon Sep 17 00:00:00 2001 From: Zied <26070035+zguesmi@users.noreply.github.com> Date: Mon, 22 Apr 2024 17:22:27 +0200 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e0500c13..fc8256082 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - Migrate to `SignatureVerifier.v8` - Change MNEMONIC var name for production & clean Hardhat file. (#53) - Format files & update copyright notices: + - Solidity interfaces (#68) - DelegateBase, IexecERC20Core (#64) - PoCo2 contracts (#54) - PoCo1 contracts (#52)