Skip to content

Commit

Permalink
Merge pull request #1295 from anna-carroll/anna/lint
Browse files Browse the repository at this point in the history
fix: run linter
  • Loading branch information
0age authored Jan 4, 2024
2 parents 0585f2f + bbd6db6 commit 70a457d
Show file tree
Hide file tree
Showing 28 changed files with 149 additions and 70 deletions.
4 changes: 3 additions & 1 deletion contracts/conduit/Conduit.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ import { Conduit as CoreConduit } from "seaport-core/src/conduit/Conduit.sol";
* approved ERC20/721/1155 tokens to be taken immediately — be extremely
* cautious with what conduits you give token approvals to!*
*/
contract LocalConduit is CoreConduit {}
contract LocalConduit is CoreConduit {

}
8 changes: 6 additions & 2 deletions contracts/conduit/ConduitController.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import { ConduitController as CoreConduitController } from "seaport-core/src/conduit/ConduitController.sol";
import {
ConduitController as CoreConduitController
} from "seaport-core/src/conduit/ConduitController.sol";

/**
* @title ConduitController
Expand All @@ -10,4 +12,6 @@ import { ConduitController as CoreConduitController } from "seaport-core/src/con
* contracts that allow registered callers (or open "channels") to
* transfer approved ERC20/721/1155 tokens on their behalf.
*/
contract LocalConduitController is CoreConduitController {}
contract LocalConduitController is CoreConduitController {

}
12 changes: 9 additions & 3 deletions contracts/helpers/TransferHelper.sol
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import { IERC721Receiver } from "seaport-types/src/interfaces/IERC721Receiver.sol";
import {
IERC721Receiver
} from "seaport-types/src/interfaces/IERC721Receiver.sol";

import {
TransferHelperItem,
TransferHelperItemsWithRecipient
} from "seaport-types/src/helpers/TransferHelperStructs.sol";

import { ConduitItemType } from "seaport-types/src/conduit/lib/ConduitEnums.sol";
import {
ConduitItemType
} from "seaport-types/src/conduit/lib/ConduitEnums.sol";

import {
ConduitInterface
Expand All @@ -18,7 +22,9 @@ import {
ConduitControllerInterface
} from "seaport-types/src/interfaces/ConduitControllerInterface.sol";

import { ConduitTransfer } from "seaport-types/src/conduit/lib/ConduitStructs.sol";
import {
ConduitTransfer
} from "seaport-types/src/conduit/lib/ConduitStructs.sol";

import {
TransferHelperInterface
Expand Down
34 changes: 17 additions & 17 deletions contracts/helpers/order-validator/lib/Murky.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ contract Murky {
********************/

/// ascending sort and concat prior to hashing
function _hashLeafPairs(bytes32 left, bytes32 right)
internal
pure
returns (bytes32 _hash)
{
function _hashLeafPairs(
bytes32 left,
bytes32 right
) internal pure returns (bytes32 _hash) {
assembly {
switch lt(left, right)
case 0 {
Expand All @@ -58,7 +57,9 @@ contract Murky {
* PROOF GENERATION *
********************/

function _getRoot(uint256[] memory data)
function _getRoot(
uint256[] memory data
)
internal
pure
returns (bytes32 result, ErrorsAndWarnings memory errorsAndWarnings)
Expand Down Expand Up @@ -159,7 +160,10 @@ contract Murky {
}
}

function _getProof(uint256[] memory data, uint256 node)
function _getProof(
uint256[] memory data,
uint256 node
)
internal
pure
returns (
Expand Down Expand Up @@ -316,11 +320,9 @@ contract Murky {
/**
* Hashes each element of the input array in place using keccak256
*/
function _processInput(uint256[] memory data)
private
pure
returns (bool sorted)
{
function _processInput(
uint256[] memory data
) private pure returns (bool sorted) {
sorted = true;

// Hash inputs with keccak256
Expand Down Expand Up @@ -352,11 +354,9 @@ contract Murky {
bytes32 hash;
}

function _sortUint256ByHash(uint256[] memory values)
internal
pure
returns (uint256[] memory sortedValues)
{
function _sortUint256ByHash(
uint256[] memory values
) internal pure returns (uint256[] memory sortedValues) {
HashAndIntTuple[] memory toSort = new HashAndIntTuple[](values.length);
for (uint256 i = 0; i < values.length; i++) {
toSort[i] = HashAndIntTuple(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ import {
ContractOffererInterface
} from "seaport-types/src/interfaces/ContractOffererInterface.sol";
import { ZoneInterface } from "seaport-types/src/interfaces/ZoneInterface.sol";
import { GettersAndDerivers } from "seaport-core/src/lib/GettersAndDerivers.sol";
import {
GettersAndDerivers
} from "seaport-core/src/lib/GettersAndDerivers.sol";
import {
SeaportValidatorInterface
} from "../lib/SeaportValidatorInterface.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ImmutableCreate2FactoryInterface.sol
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ interface ImmutableCreate2FactoryInterface {
function hasBeenDeployed(
address deploymentAddress
) external view returns (bool);
}
}
4 changes: 3 additions & 1 deletion contracts/test/ERC721ReceiverMock.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import { IERC721Receiver } from "seaport-types/src/interfaces/IERC721Receiver.sol";
import {
IERC721Receiver
} from "seaport-types/src/interfaces/IERC721Receiver.sol";

contract ERC721ReceiverMock is IERC721Receiver {
enum Error {
Expand Down
4 changes: 3 additions & 1 deletion reference/conduit/ReferenceConduit.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import {
ConduitInterface
} from "seaport-types/src/interfaces/ConduitInterface.sol";

import { ConduitItemType } from "seaport-types/src/conduit/lib/ConduitEnums.sol";
import {
ConduitItemType
} from "seaport-types/src/conduit/lib/ConduitEnums.sol";

import {
ReferenceTokenTransferrer
Expand Down
4 changes: 3 additions & 1 deletion reference/lib/ReferenceAssertions.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import { OrderParameters } from "seaport-types/src/lib/ConsiderationStructs.sol";
import {
OrderParameters
} from "seaport-types/src/lib/ConsiderationStructs.sol";

import { ReferenceGettersAndDerivers } from "./ReferenceGettersAndDerivers.sol";

Expand Down
9 changes: 7 additions & 2 deletions reference/lib/ReferenceConsiderationStructs.sol
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import { ItemType, OrderType } from "seaport-types/src/lib/ConsiderationEnums.sol";
import {
ItemType,
OrderType
} from "seaport-types/src/lib/ConsiderationEnums.sol";

import {
ReceivedItem,
SpentItem
} from "seaport-types/src/lib/ConsiderationStructs.sol";

import { ConduitTransfer } from "seaport-types/src/conduit/lib/ConduitStructs.sol";
import {
ConduitTransfer
} from "seaport-types/src/conduit/lib/ConduitStructs.sol";

// This file should only be used by the Reference Implementation

Expand Down
8 changes: 6 additions & 2 deletions reference/lib/ReferenceExecutor.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import { ConduitItemType } from "seaport-types/src/conduit/lib/ConduitEnums.sol";
import {
ConduitItemType
} from "seaport-types/src/conduit/lib/ConduitEnums.sol";

import {
ConduitInterface
} from "seaport-types/src/interfaces/ConduitInterface.sol";

import { ConduitTransfer } from "seaport-types/src/conduit/lib/ConduitStructs.sol";
import {
ConduitTransfer
} from "seaport-types/src/conduit/lib/ConduitStructs.sol";

import { ItemType } from "seaport-types/src/lib/ConsiderationEnums.sol";

Expand Down
38 changes: 22 additions & 16 deletions reference/lib/ReferenceOrderCombiner.sol
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,17 @@ contract ReferenceOrderCombiner is
returns (bool[] memory availableOrders, Execution[] memory executions)
{
// Validate orders, apply amounts, & determine if they use conduits.
(bytes32[] memory orderHashes, bool containsNonOpen) = _validateOrdersAndPrepareToFulfill(
advancedOrders,
ordersToExecute,
criteriaResolvers,
false, // Signifies that invalid orders should NOT revert.
maximumFulfilled,
recipient
);
(
bytes32[] memory orderHashes,
bool containsNonOpen
) = _validateOrdersAndPrepareToFulfill(
advancedOrders,
ordersToExecute,
criteriaResolvers,
false, // Signifies that invalid orders should NOT revert.
maximumFulfilled,
recipient
);

// Execute transfers.
(availableOrders, executions) = _executeAvailableFulfillments(
Expand Down Expand Up @@ -908,14 +911,17 @@ contract ReferenceOrderCombiner is
);

// Validate orders, apply amounts, & determine if they utilize conduits.
(bytes32[] memory orderHashes, bool containsNonOpen) = _validateOrdersAndPrepareToFulfill(
advancedOrders,
ordersToExecute,
criteriaResolvers,
true, // Signifies that invalid orders should revert.
advancedOrders.length,
recipient
);
(
bytes32[] memory orderHashes,
bool containsNonOpen
) = _validateOrdersAndPrepareToFulfill(
advancedOrders,
ordersToExecute,
criteriaResolvers,
true, // Signifies that invalid orders should revert.
advancedOrders.length,
recipient
);

// Emit OrdersMatched event.
emit OrdersMatched(orderHashes);
Expand Down
5 changes: 4 additions & 1 deletion reference/lib/ReferenceOrderFulfiller.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import { ItemType, OrderType } from "seaport-types/src/lib/ConsiderationEnums.sol";
import {
ItemType,
OrderType
} from "seaport-types/src/lib/ConsiderationEnums.sol";

import {
AdvancedOrder,
Expand Down
5 changes: 4 additions & 1 deletion reference/lib/ReferenceOrderValidator.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import { OrderType, ItemType } from "seaport-types/src/lib/ConsiderationEnums.sol";
import {
OrderType,
ItemType
} from "seaport-types/src/lib/ConsiderationEnums.sol";

import {
AdvancedOrder,
Expand Down
5 changes: 4 additions & 1 deletion reference/lib/ReferenceZoneInteraction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import {
ContractOffererInterface
} from "seaport-types/src/interfaces/ContractOffererInterface.sol";

import { ItemType, OrderType } from "seaport-types/src/lib/ConsiderationEnums.sol";
import {
ItemType,
OrderType
} from "seaport-types/src/lib/ConsiderationEnums.sol";

import {
AdditionalRecipient,
Expand Down
5 changes: 4 additions & 1 deletion test/foundry/FulfillAdvancedOrder.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

pragma solidity ^0.8.17;

import { OrderType, ItemType } from "seaport-types/src/lib/ConsiderationEnums.sol";
import {
OrderType,
ItemType
} from "seaport-types/src/lib/ConsiderationEnums.sol";

import {
ConsiderationInterface
Expand Down
5 changes: 4 additions & 1 deletion test/foundry/FulfillAvailableAdvancedOrder.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

pragma solidity ^0.8.17;

import { OrderType, ItemType } from "seaport-types/src/lib/ConsiderationEnums.sol";
import {
OrderType,
ItemType
} from "seaport-types/src/lib/ConsiderationEnums.sol";

import {
ConsiderationInterface
Expand Down
5 changes: 4 additions & 1 deletion test/foundry/FullfillAvailableOrder.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

pragma solidity ^0.8.17;

import { OrderType, ItemType } from "seaport-types/src/lib/ConsiderationEnums.sol";
import {
OrderType,
ItemType
} from "seaport-types/src/lib/ConsiderationEnums.sol";

import {
ConsiderationInterface
Expand Down
5 changes: 4 additions & 1 deletion test/foundry/MatchAdvancedOrder.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

pragma solidity ^0.8.17;

import { OrderType, ItemType } from "seaport-types/src/lib/ConsiderationEnums.sol";
import {
OrderType,
ItemType
} from "seaport-types/src/lib/ConsiderationEnums.sol";

import {
ConsiderationInterface
Expand Down
5 changes: 4 additions & 1 deletion test/foundry/MatchOrders.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

pragma solidity ^0.8.17;

import { OrderType, ItemType } from "seaport-types/src/lib/ConsiderationEnums.sol";
import {
OrderType,
ItemType
} from "seaport-types/src/lib/ConsiderationEnums.sol";

import {
Order,
Expand Down
8 changes: 6 additions & 2 deletions test/foundry/TransferHelperMultipleRecipientsTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import {
ConduitInterface
} from "seaport-types/src/interfaces/ConduitInterface.sol";

import { ConduitItemType } from "seaport-types/src/conduit/lib/ConduitEnums.sol";
import {
ConduitItemType
} from "seaport-types/src/conduit/lib/ConduitEnums.sol";

import { TransferHelper } from "../../contracts/helpers/TransferHelper.sol";

Expand Down Expand Up @@ -46,7 +48,9 @@ import {
TransferHelperErrors
} from "seaport-types/src/interfaces/TransferHelperErrors.sol";

import { IERC721Receiver } from "seaport-types/src/interfaces/IERC721Receiver.sol";
import {
IERC721Receiver
} from "seaport-types/src/interfaces/IERC721Receiver.sol";

import {
ERC721ReceiverMock
Expand Down
Loading

0 comments on commit 70a457d

Please sign in to comment.