Skip to content

Commit 52e8fc7

Browse files
authored
chore: Clean contracts and tests - part1 (#330)
1 parent 564ae6b commit 52e8fc7

27 files changed

+3424
-3219
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ jobs:
2727
- name: Install dependencies
2828
run: npm ci
2929
- name: Check code formatting
30-
run: npm run check-format
30+
run: npm run format:check
3131
- name: Check documentation is up-to-date
32-
run: npm run check-doc
32+
run: npm run doc:check
3333
- name: Build
3434
run: npm run build
3535
- name: Check storage layout

abis/human-readable-abis/contracts/facets/IexecEscrow.v8.sol/IexecEscrow.json renamed to abis/human-readable-abis/contracts/abstract/IexecEscrow.sol/IexecEscrow.json

File renamed without changes.

abis/human-readable-abis/contracts/tools/testing/ReceiveApprovalTestHelper.sol/ReceiveApprovalTestHelper.json renamed to abis/human-readable-abis/contracts/tools/testing/MatchOrdersFacetMock.sol/MatchOrdersFacetMock.json

File renamed without changes.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
pragma solidity ^0.8.0;
55
import {PocoStorageLib} from "../libs/PocoStorageLib.sol";
6-
import {FacetBase} from "../abstract/FacetBase.sol";
6+
import {FacetBase} from "./FacetBase.sol";
77

88
/**
99
* @title Manage (lock/unlock/reward/seize) user funds.
1010
*/
11-
contract IexecEscrow is FacetBase {
11+
abstract contract IexecEscrow is FacetBase {
1212
event Transfer(address indexed from, address indexed to, uint256 value);
1313
event Lock(address owner, uint256 amount);
1414
event Unlock(address owner, uint256 amount);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ pragma solidity ^0.8.0;
66
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
77
import {PocoStorageLib} from "../libs/PocoStorageLib.sol";
88
import {IexecLibOrders_v5} from "../libs/IexecLibOrders_v5.sol";
9-
import {FacetBase} from "../abstract/FacetBase.sol";
9+
import {FacetBase} from "./FacetBase.sol";
1010

11-
contract IexecPocoCommon is FacetBase {
11+
abstract contract IexecPocoCommon is FacetBase {
1212
using Math for uint256;
1313
using IexecLibOrders_v5 for IexecLibOrders_v5.AppOrder;
1414
using IexecLibOrders_v5 for IexecLibOrders_v5.DatasetOrder;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ pragma solidity ^0.8.0;
66
import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";
77
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
88
import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";
9-
import {FacetBase} from "../abstract/FacetBase.sol";
9+
import {FacetBase} from "./FacetBase.sol";
1010
import {IERC734} from "../external/interfaces/IERC734.sol";
1111
import {PocoStorageLib} from "../libs/PocoStorageLib.sol";
1212

13-
contract SignatureVerifier is FacetBase {
13+
abstract contract SignatureVerifier is FacetBase {
1414
using ECDSA for bytes32;
1515

1616
/**

contracts/facets/IexecEscrowTokenFacet.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,11 @@ contract IexecEscrowTokenFacet is IexecEscrowToken, IexecTokenSpender, IexecERC2
187187
IexecLibOrders_v5.RequestOrder
188188
)
189189
);
190-
191190
// Validate that sender is the requester
192191
// This ensures the caller is authorized to create this deal
193-
if (requestorder.requester != sender) revert("caller-must-be-requester");
192+
if (requestorder.requester != sender) {
193+
revert("caller-must-be-requester");
194+
}
194195
}
195196

196197
function _deposit(address from, uint256 amount) internal {

contracts/facets/IexecOrderManagementFacet.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pragma solidity ^0.8.0;
55

66
import {IERC5313} from "@openzeppelin/contracts/interfaces/IERC5313.sol";
77
import {FacetBase} from "../abstract/FacetBase.sol";
8-
import {SignatureVerifier} from "./SignatureVerifier.sol";
8+
import {SignatureVerifier} from "../abstract/SignatureVerifier.sol";
99
import {IexecOrderManagement} from "../interfaces/IexecOrderManagement.sol";
1010
import {PocoStorageLib} from "../libs/PocoStorageLib.sol";
1111
import {IexecLibOrders_v5} from "../libs/IexecLibOrders_v5.sol";

contracts/facets/IexecPoco1Facet.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import {FacetBase} from "../abstract/FacetBase.sol";
1212
import {PocoStorageLib} from "../libs/PocoStorageLib.sol";
1313
import {IexecPoco1} from "../interfaces/IexecPoco1.sol";
1414
import {IexecPoco1Errors} from "../interfaces/IexecPoco1Errors.sol";
15-
import {IexecEscrow} from "./IexecEscrow.v8.sol";
16-
import {IexecPocoCommon} from "./IexecPocoCommon.sol";
17-
import {SignatureVerifier} from "./SignatureVerifier.sol";
15+
import {IexecEscrow} from "../abstract/IexecEscrow.sol";
16+
import {IexecPocoCommon} from "../abstract/IexecPocoCommon.sol";
17+
import {SignatureVerifier} from "../abstract/SignatureVerifier.sol";
1818

1919
struct Matching {
2020
bytes32 apporderHash;

0 commit comments

Comments
 (0)