Skip to content

Commit 83b291b

Browse files
committed
work on getting hardhat to build
1 parent 1d0cfb8 commit 83b291b

35 files changed

Lines changed: 216 additions & 107 deletions

contracts/helpers/ArrayHelpers.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.13;
33

4-
import "seaport-types/helpers/PointerLibraries.sol";
4+
import "seaport-types/src/helpers/PointerLibraries.sol";
55

66
/**
77
* @author d1ll0n

contracts/helpers/SeaportRouter.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ pragma solidity ^0.8.13;
33

44
import {
55
SeaportRouterInterface
6-
} from "seaport-types/interfaces/SeaportRouterInterface.sol";
6+
} from "seaport-types/src/interfaces/SeaportRouterInterface.sol";
77

88
import {
99
SeaportInterface
10-
} from "seaport-types/interfaces/SeaportInterface.sol";
10+
} from "seaport-types/src/interfaces/SeaportInterface.sol";
1111

12-
import { ReentrancyGuard } from "seaport-core/lib/ReentrancyGuard.sol";
12+
import { ReentrancyGuard } from "seaport-core/src/lib/ReentrancyGuard.sol";
1313

1414
import {
1515
AdvancedOrder,
1616
CriteriaResolver,
1717
Execution,
1818
FulfillmentComponent
19-
} from "seaport-types/lib/ConsiderationStructs.sol";
19+
} from "seaport-types/src/lib/ConsiderationStructs.sol";
2020

2121
/**
2222
* @title SeaportRouter

contracts/helpers/TransferHelper.sol

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.13;
33

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

66
import {
77
TransferHelperItem,
88
TransferHelperItemsWithRecipient
9-
} from "seaport-types/helpers/TransferHelperStructs.sol";
9+
} from "seaport-types/src/helpers/TransferHelperStructs.sol";
1010

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

1313
import {
1414
ConduitInterface
15-
} from "seaport-types/interfaces/ConduitInterface.sol";
15+
} from "seaport-types/src/interfaces/ConduitInterface.sol";
1616

1717
import {
1818
ConduitControllerInterface
19-
} from "seaport-types/interfaces/ConduitControllerInterface.sol";
19+
} from "seaport-types/src/interfaces/ConduitControllerInterface.sol";
2020

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

2323
import {
2424
TransferHelperInterface
25-
} from "seaport-types/interfaces/TransferHelperInterface.sol";
25+
} from "seaport-types/src/interfaces/TransferHelperInterface.sol";
2626

2727
import {
2828
TransferHelperErrors
29-
} from "seaport-types/interfaces/TransferHelperErrors.sol";
29+
} from "seaport-types/src/interfaces/TransferHelperErrors.sol";
3030

3131
/**
3232
* @title TransferHelper

contracts/helpers/order-validator/SeaportValidator.sol

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.17;
33

4-
import { ItemType } from "seaport-types/lib/ConsiderationEnums.sol";
4+
import { ItemType } from "seaport-types/src/lib/ConsiderationEnums.sol";
55
import {
66
Order,
77
OrderParameters,
@@ -10,26 +10,26 @@ import {
1010
ConsiderationItem,
1111
Schema,
1212
ZoneParameters
13-
} from "seaport-types/lib/ConsiderationStructs.sol";
13+
} from "seaport-types/src/lib/ConsiderationStructs.sol";
1414
import { ConsiderationTypeHashes } from "./lib/ConsiderationTypeHashes.sol";
1515
import {
1616
ConsiderationInterface
17-
} from "seaport-types/interfaces/ConsiderationInterface.sol";
17+
} from "seaport-types/src/interfaces/ConsiderationInterface.sol";
1818
import {
1919
ConduitControllerInterface
20-
} from "seaport-types/interfaces/ConduitControllerInterface.sol";
20+
} from "seaport-types/src/interfaces/ConduitControllerInterface.sol";
2121
import {
2222
ContractOffererInterface
23-
} from "seaport-types/interfaces/ContractOffererInterface.sol";
24-
import { ZoneInterface } from "seaport-types/interfaces/ZoneInterface.sol";
25-
import { GettersAndDerivers } from "seaport-core/lib/GettersAndDerivers.sol";
23+
} from "seaport-types/src/interfaces/ContractOffererInterface.sol";
24+
import { ZoneInterface } from "seaport-types/src/interfaces/ZoneInterface.sol";
25+
import { GettersAndDerivers } from "seaport-core/src/lib/GettersAndDerivers.sol";
2626
import { SeaportValidatorInterface } from "./lib/SeaportValidatorInterface.sol";
27-
import { ZoneInterface } from "seaport-types/interfaces/ZoneInterface.sol";
27+
import { ZoneInterface } from "seaport-types/src/interfaces/ZoneInterface.sol";
2828
import {
2929
ERC20Interface,
3030
ERC721Interface,
3131
ERC1155Interface
32-
} from "seaport-types/interfaces/AbridgedTokenInterfaces.sol";
32+
} from "seaport-types/src/interfaces/AbridgedTokenInterfaces.sol";
3333
import { IERC165 } from "@openzeppelin/contracts/interfaces/IERC165.sol";
3434
import { IERC2981 } from "@openzeppelin/contracts/interfaces/IERC2981.sol";
3535
import {
@@ -57,7 +57,7 @@ import {
5757
GenericIssue,
5858
ConsiderationItemConfiguration
5959
} from "./lib/SeaportValidatorTypes.sol";
60-
import { Verifiers } from "seaport-core/lib/Verifiers.sol";
60+
import { Verifiers } from "seaport-core/src/lib/Verifiers.sol";
6161
import { SeaportValidatorHelper } from "./lib/SeaportValidatorHelper.sol";
6262

6363
/**

contracts/helpers/order-validator/lib/ConsiderationTypeHashes.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.10;
33

4-
import "seaport-types/lib/ConsiderationStructs.sol";
4+
import "seaport-types/src/lib/ConsiderationStructs.sol";
55

66
uint256 constant EIP712_Order_size = 0x180;
77
uint256 constant EIP712_OfferItem_size = 0xc0;

contracts/helpers/order-validator/lib/SeaportValidatorHelper.sol

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.17;
33

4-
import { ItemType } from "seaport-types/lib/ConsiderationEnums.sol";
4+
import { ItemType } from "seaport-types/src/lib/ConsiderationEnums.sol";
55
import {
66
Order,
77
OrderParameters,
@@ -10,28 +10,28 @@ import {
1010
ConsiderationItem,
1111
Schema,
1212
ZoneParameters
13-
} from "seaport-types/lib/ConsiderationStructs.sol";
13+
} from "seaport-types/src/lib/ConsiderationStructs.sol";
1414
import { ConsiderationTypeHashes } from "./ConsiderationTypeHashes.sol";
1515
import {
1616
ConsiderationInterface
17-
} from "seaport-types/interfaces/ConsiderationInterface.sol";
17+
} from "seaport-types/src/interfaces/ConsiderationInterface.sol";
1818
import {
1919
ConduitControllerInterface
20-
} from "seaport-types/interfaces/ConduitControllerInterface.sol";
20+
} from "seaport-types/src/interfaces/ConduitControllerInterface.sol";
2121
import {
2222
ContractOffererInterface
23-
} from "seaport-types/interfaces/ContractOffererInterface.sol";
24-
import { ZoneInterface } from "seaport-types/interfaces/ZoneInterface.sol";
25-
import { GettersAndDerivers } from "seaport-core/lib/GettersAndDerivers.sol";
23+
} from "seaport-types/src/interfaces/ContractOffererInterface.sol";
24+
import { ZoneInterface } from "seaport-types/src/interfaces/ZoneInterface.sol";
25+
import { GettersAndDerivers } from "seaport-core/src/lib/GettersAndDerivers.sol";
2626
import {
2727
SeaportValidatorInterface
2828
} from "../lib/SeaportValidatorInterface.sol";
29-
import { ZoneInterface } from "seaport-types/interfaces/ZoneInterface.sol";
29+
import { ZoneInterface } from "seaport-types/src/interfaces/ZoneInterface.sol";
3030
import {
3131
ERC20Interface,
3232
ERC721Interface,
3333
ERC1155Interface
34-
} from "seaport-types/interfaces/AbridgedTokenInterfaces.sol";
34+
} from "seaport-types/src/interfaces/AbridgedTokenInterfaces.sol";
3535
import { IERC165 } from "@openzeppelin/contracts/interfaces/IERC165.sol";
3636
import { IERC2981 } from "@openzeppelin/contracts/interfaces/IERC2981.sol";
3737
import {
@@ -60,7 +60,7 @@ import {
6060
GenericIssue,
6161
ConsiderationItemConfiguration
6262
} from "./SeaportValidatorTypes.sol";
63-
import { Verifiers } from "seaport-core/lib/Verifiers.sol";
63+
import { Verifiers } from "seaport-core/src/lib/Verifiers.sol";
6464

6565
/**
6666
* @title SeaportValidator

contracts/helpers/order-validator/lib/SeaportValidatorInterface.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.10;
33

4-
import { ItemType } from "seaport-types/lib/ConsiderationEnums.sol";
4+
import { ItemType } from "seaport-types/src/lib/ConsiderationEnums.sol";
55
import {
66
Order,
77
OrderParameters,
88
ZoneParameters
9-
} from "seaport-types/lib/ConsiderationStructs.sol";
9+
} from "seaport-types/src/lib/ConsiderationStructs.sol";
1010
import { ErrorsAndWarnings } from "./ErrorsAndWarnings.sol";
1111
import { ValidationConfiguration } from "./SeaportValidatorTypes.sol";
1212

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.13;
3+
4+
/**
5+
* @title ImmutableCreate2FactoryInterface
6+
* @author 0age
7+
* @notice This contract provides a safeCreate2 function that takes a salt value
8+
* and a block of initialization code as arguments and passes them into
9+
* inline assembly. The contract prevents redeploys by maintaining a
10+
* mapping of all contracts that have already been deployed, and
11+
* prevents frontrunning or other collisions by requiring that the first
12+
* 20 bytes of the salt are equal to the address of the caller (this can
13+
* be bypassed by setting the first 20 bytes to the null address). There
14+
* is also a view function that computes the address of the contract
15+
* that will be created when submitting a given salt or nonce along with
16+
* a given block of initialization code.
17+
*/
18+
interface ImmutableCreate2FactoryInterface {
19+
/**
20+
* @dev Create a contract using CREATE2 by submitting a given salt or nonce
21+
* along with the initialization code for the contract. Note that the
22+
* first 20 bytes of the salt must match those of the calling address,
23+
* which prevents contract creation events from being submitted by
24+
* unintended parties.
25+
*
26+
* @param salt The nonce that will be passed into the CREATE2
27+
* call.
28+
* @param initializationCode The initialization code that will be passed
29+
* into the CREATE2 call.
30+
*
31+
* @return deploymentAddress Address of the contract that will be created.
32+
*/
33+
function safeCreate2(
34+
bytes32 salt,
35+
bytes calldata initializationCode
36+
) external payable returns (address deploymentAddress);
37+
38+
/**
39+
* @dev Compute the address of the contract that will be created when
40+
* submitting a given salt or nonce to the contract along with the
41+
* contract's initialization code. The CREATE2 address is computed in
42+
* accordance with EIP-1014, and adheres to the formula therein of
43+
* `keccak256( 0xff ++ address ++ salt ++ keccak256(init_code)))[12:]`
44+
* when performing the computation. The computed address is then
45+
* checked for any existing contract code - if so, the null address
46+
* will be returned instead.
47+
*
48+
* @param salt The nonce passed into the CREATE2 address calculation.
49+
* @param initCode The contract initialization code to be used that will be
50+
* passed into the CREATE2 address calculation.
51+
*
52+
* @return deploymentAddress Address of the contract that will be created,
53+
* or the null address if a contract already
54+
* exists at that address.
55+
*/
56+
function findCreate2Address(
57+
bytes32 salt,
58+
bytes calldata initCode
59+
) external view returns (address deploymentAddress);
60+
61+
/**
62+
* @dev Compute the address of the contract that will be created when
63+
* submitting a given salt or nonce to the contract along with the
64+
* keccak256 hash of the contract's initialization code. The CREATE2
65+
* address is computed in accordance with EIP-1014, and adheres to the
66+
* `keccak256( 0xff ++ address ++ salt ++ keccak256(init_code)))[12:]`
67+
* formula when performing the computation. The computed address is
68+
* then checked for any existing contract code - if so, the null
69+
* address will be returned instead.
70+
*
71+
* @param salt The nonce passed into the CREATE2 address
72+
* calculation.
73+
* @param initCodeHash The keccak256 hash of the initialization code that
74+
* will be passed into the CREATE2 address calculation.
75+
*
76+
* @return deploymentAddress Address of the contract that will be created,
77+
* or the null address if a contract already
78+
* exists at that address.
79+
*/
80+
function findCreate2AddressViaHash(
81+
bytes32 salt,
82+
bytes32 initCodeHash
83+
) external view returns (address deploymentAddress);
84+
85+
/**
86+
* @dev Determine if a contract has already been deployed by the factory to
87+
* a given address.
88+
*
89+
* @param deploymentAddress The contract address to check.
90+
*
91+
* @return True if the contract has been deployed, false otherwise.
92+
*/
93+
function hasBeenDeployed(
94+
address deploymentAddress
95+
) external view returns (bool);
96+
}

contracts/interfaces/ZoneInterface.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ pragma solidity ^0.8.13;
44
import {
55
ZoneParameters,
66
Schema
7-
} from "seaport-types/lib/ConsiderationStructs.sol";
7+
} from "seaport-types/src/lib/ConsiderationStructs.sol";
88

9-
import { IERC165 } from "seaport-types/interfaces/IERC165.sol";
9+
import { IERC165 } from "seaport-types/src/interfaces/IERC165.sol";
1010

1111
/**
1212
* @title ZoneInterface

contracts/test/ConduitControllerMock.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ pragma solidity ^0.8.13;
33

44
import {
55
ConduitControllerInterface
6-
} from "seaport-types/interfaces/ConduitControllerInterface.sol";
6+
} from "seaport-types/src/interfaces/ConduitControllerInterface.sol";
77

88
import {
99
ConduitInterface
10-
} from "seaport-types/interfaces/ConduitInterface.sol";
10+
} from "seaport-types/src/interfaces/ConduitInterface.sol";
1111

1212
import { ConduitMock } from "../test/ConduitMock.sol";
1313

0 commit comments

Comments
 (0)