Skip to content

Commit d2e367c

Browse files
Consolidate Immutable Seaport contracts into monorepo (#152)
1 parent 6e2f536 commit d2e367c

33 files changed

+4028
-10
lines changed

.github/workflows/test.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Install Foundry
1717
uses: foundry-rs/foundry-toolchain@v1
1818
- name: Install dependencies
19-
run: yarn install --frozen-lockfile
19+
run: yarn install --frozen-lockfile --network-concurrency 2
2020
- name: Run tests
2121
run: forge test -vvv
2222
hardhat-test:
@@ -29,8 +29,9 @@ jobs:
2929
uses: actions/setup-node@v3
3030
with:
3131
node-version: lts/*
32+
cache: 'yarn'
3233
- name: Install dependencies
33-
run: yarn install --frozen-lockfile
34+
run: yarn install --frozen-lockfile --network-concurrency 2
3435
- name: Run Tests
3536
run: yarn test
3637
lint:
@@ -43,8 +44,9 @@ jobs:
4344
uses: actions/setup-node@v3
4445
with:
4546
node-version: lts/*
47+
cache: 'yarn'
4648
- name: Install dependencies
47-
run: yarn install --frozen-lockfile
49+
run: yarn install --frozen-lockfile --network-concurrency 2
4850
- name: Run eslint
4951
run: yarn lint
5052
publish:
@@ -58,8 +60,9 @@ jobs:
5860
with:
5961
node-version-file: ".nvmrc"
6062
registry-url: https://registry.npmjs.org/
63+
cache: 'yarn'
6164
- name: Install dependencies
62-
run: yarn install --frozen-lockfile
65+
run: yarn install --frozen-lockfile --network-concurrency 2
6366
- name: Compile contracts
6467
run: yarn compile
6568
- name: Build dist files

audits/202308-audit-information.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Immutable Seaport
2+
Immutable Seaport is a minor fork and extension of OpenSea's [Seaport](https://github.com/ProjectOpenSea/seaport) NFT settlement contract. The intension of the extension is to ensure that royalties and other platform fees (protocol, marketplace) are enforceable. This has been achieved with the use of a custom zone contract that implements [SIP7](https://github.com/ProjectOpenSea/SIPs/blob/main/SIPS/sip-7.md).
3+
4+
## Seaport Fork Details
5+
OpenSea split their Seaport implementation into 3 repositories:
6+
- [seaport-types](https://github.com/ProjectOpenSea/seaport-types): This repo contains the core Seaport structs, enums, and interfaces for use in other Seaport repos.
7+
- [seaport-core](https://github.com/ProjectOpenSea/seaport-core): This repo contains the core Seaport smart contracts (with no reference contracts, helpers, or tests) and is meant to facilitate building on Seaport without needing to grapple with long compile times or other complications.
8+
- [seaport](https://github.com/ProjectOpenSea/seaport): This repo contains reference implementation contracts and testing utilities
9+
10+
### Seaport Types
11+
No fork
12+
13+
### Seaport Core
14+
The function signatures in the `seaport-core` Consideration contract have [been updated](https://github.com/ProjectOpenSea/seaport-core/compare/main...immutable:seaport-core:1.5.0+im.1) to be `virtual` so that the `ImmutableSeaport` Consideration contract can add additional validation prior to calling the underlying `Consideration` implementation.
15+
16+
### Seaport
17+
Immutable use [the fork](https://github.com/ProjectOpenSea/seaport/compare/main...immutable:seaport:1.5.0+im.1) to strictly pin the version of the upstream `seaport` contract implementations, which are currently on version 1.5. The fork also exposed testing utilities so that they can be used from the Immutable Seaport repository.
18+
19+
## Immutable Seaport Implementation
20+
To ensure that the fees on an order meet the requirements of the Immutable ecosystem, all orders passed for consideration **must** be signed by an Immutable signer prior to fulfilment. This is achieved through the implementation of a SIP7 zone contract and by extending seaport consideration methods to ensure all fulfillments are validated by said zone.
21+
22+
### Extension to Seaport Consideration
23+
The extension applies to all methods that can be used for order fulfilment and is always fundamentally the same; the order / orders being passed for fulfilment must be either `PARTIAL_RESTRICTED` or `FULL_RESTRICTED` and they must reference an allowed zone.
24+
25+
### Immutable Signed Zone
26+
The [Immutable Signed Zone](https://github.com/immutable/immutable-seaport/blob/main/contracts/zones/ImmutableSignedZone.sol) is an implementation of the SIP-7 specification with sub-standards 3 and 4.
27+
28+
The `zone` of an order is a mandatory (in the case of `Immutable Seaport`) secondary account attached to the order with two additional privileges:
29+
- The zone may cancel orders where it is named as the zone by calling `cancel`. (Note that offerers can also cancel their own orders, either individually or for all orders signed with their current counter at once by calling `incrementCounter`).
30+
- "Restricted" orders (as specified by the order type) can be executed by anyone but must be approved by the zone indicated by a call to `validateOrder` on the zone.
31+
32+
The critical piece for the Immutable Seaport implementation is that all order executions make a call to `validateOrder` on the `Immutable Signed Zone`. If this check fails, the order will not be fulfilled.
33+
34+
## Other Contracts
35+
We use some other contracts from the seaport ecosystem. These are unmodified and just reference the OpenSea upstream. These include:
36+
- ReadOnlyOrderValidator
37+
- SeaportValidator
38+
- SeaportValidatorHelper
39+
- ConduitController

0 commit comments

Comments
 (0)