Home

Awesome

Seaport

Version Test CI Code Coverage License Docs Discussions JS Library Discord

Seaport

Seaport is a marketplace protocol for safely and efficiently buying and selling NFTs.

Table of Contents

Background

Seaport is a marketplace protocol for safely and efficiently buying and selling NFTs. Each listing contains an arbitrary number of items that the offerer is willing to give (the "offer") along with an arbitrary number of items that must be received along with their respective receivers (the "consideration").

See the documentation, the interface, and the full interface documentation for more information on Seaport.

This repository is also split into smaller repositories for easier use and integration:

Deployments

Canonical Cross-chain Deployment Addresses

<table> <tr> <th>Contract</th> <th>Canonical Cross-chain Deployment Address</th> </tr> <tr> <td>Seaport 1.1</td> <td><code>0x00000000006c3852cbEf3e08E8dF289169EdE581</code></td> </tr> <tr> <td>Seaport 1.2*</td> <td><code>0x00000000000006c7676171937C444f6BDe3D6282</code></td> </tr> <tr> <td>Seaport 1.3*</td> <td><code>0x0000000000000aD24e80fd803C6ac37206a45f15</code></td> </tr> <tr> <td>Seaport 1.4*</td> <td><code>0x00000000000001ad428e4906aE43D8F9852d0dD6</code></td> </tr> <tr> <td>Seaport 1.5</td> <td><code>0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC</code></td> </tr> <tr> <td>Seaport 1.6</td> <td><code>0x0000000000000068F116a894984e2DB1123eB395</code></td> </tr> <tr> <td>ConduitController</td> <td><code>0x00000000F9490004C11Cef243f5400493c00Ad63</code></td> </tr> <tr> <td>SeaportValidator</td> <td><code>0x00e5F120f500006757E984F1DED400fc00370000</code></td> </tr> <tr> <td>SeaportNavigator</td> <td><code>0x0000f00000627D293Ab4Dfb40082001724dB006F</code></td> </tr> </table>

*Note: Seaport 1.2 through 1.4 contain known limitations; proceed with caution if interacting with them, particularly when utilizing restricted or contract orders.

Deployments By EVM Chain

<table> <tr> <th>Network</th> <th>Seaport 1.6</th> <th>Seaport 1.5</th> <th>Seaport 1.1</th> <th>ConduitController</th> <th>SeaportValidator</th> <th>SeaportNavigator</th> </tr> <tr><td>Ethereum</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

0x00000000006c3852cbEf3e08E8dF289169EdE581

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

0x00e5F120f500006757E984F1DED400fc00370000

</td><td>

0x0000f00000627D293Ab4Dfb40082001724dB006F

</td></tr> <tr><td>Sepolia</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

0x00000000006c3852cbEf3e08E8dF289169EdE581

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

0x00e5F120f500006757E984F1DED400fc00370000

</td><td>

0x0000f00000627D293Ab4Dfb40082001724dB006F

</td></tr> <tr><td>Polygon</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

0x00000000006c3852cbEf3e08E8dF289169EdE581

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

0x00e5F120f500006757E984F1DED400fc00370000

</td><td>

0x0000f00000627D293Ab4Dfb40082001724dB006F

</td></tr> <tr><td>Amoy</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

0x00000000006c3852cbEf3e08E8dF289169EdE581

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

0x00e5F120f500006757E984F1DED400fc00370000

</td><td>

0x0000f00000627D293Ab4Dfb40082001724dB006F

</td></tr> <tr><td>Optimism</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

0x00000000006c3852cbEf3e08E8dF289169EdE581

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

0x00e5F120f500006757E984F1DED400fc00370000

</td><td>

0x0000f00000627D293Ab4Dfb40082001724dB006F

</td></tr> <tr><td>Optimism Sepolia</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

Not deployed

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

0x00e5F120f500006757E984F1DED400fc00370000

</td><td>

0x0000f00000627D293Ab4Dfb40082001724dB006F

</td></tr> <tr><td>Arbitrum</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

0x00000000006c3852cbEf3e08E8dF289169EdE581

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

0x00e5F120f500006757E984F1DED400fc00370000

</td><td>

0x0000f00000627D293Ab4Dfb40082001724dB006F

</td></tr> <tr><td>Arbitrum Sepolia</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

Not deployed

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

0x00e5F120f500006757E984F1DED400fc00370000

</td><td>

0x0000f00000627D293Ab4Dfb40082001724dB006F

</td></tr> <tr><td>Arbitrum Nova</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

0x00000000006c3852cbEf3e08E8dF289169EdE581

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

0x00e5F120f500006757E984F1DED400fc00370000

</td><td>

0x0000f00000627D293Ab4Dfb40082001724dB006F

</td></tr> <tr><td>Base</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

Not deployed

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

0x00e5F120f500006757E984F1DED400fc00370000

</td><td>

0x0000f00000627D293Ab4Dfb40082001724dB006F

</td></tr> <tr><td>Base Sepolia</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

Not deployed

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

0x00e5F120f500006757E984F1DED400fc00370000

</td><td>

0x0000f00000627D293Ab4Dfb40082001724dB006F

</td></tr> <tr><td>Avalanche C-Chain</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

0x00000000006c3852cbEf3e08E8dF289169EdE581

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

0x00e5F120f500006757E984F1DED400fc00370000

</td><td>

0x0000f00000627D293Ab4Dfb40082001724dB006F

</td></tr> <tr><td>Avalanche Fuji</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

0x00000000006c3852cbEf3e08E8dF289169EdE581

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

0x00e5F120f500006757E984F1DED400fc00370000

</td><td>

0x0000f00000627D293Ab4Dfb40082001724dB006F

</td></tr> <tr><td>Gnosis Chain</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

0x00000000006c3852cbEf3e08E8dF289169EdE581

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

Not deployed

</td></tr> <tr><td>Chiado</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

Not deployed

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

Not deployed

</td><td>

Not deployed

</td></tr> <tr><td>BSC</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

0x00000000006c3852cbEf3e08E8dF289169EdE581

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

0x00e5F120f500006757E984F1DED400fc00370000

</td><td>

0x0000f00000627D293Ab4Dfb40082001724dB006F

</td></tr> <tr><td>BSC Testnet</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

0x00000000006c3852cbEf3e08E8dF289169EdE581

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

0x00e5F120f500006757E984F1DED400fc00370000

</td><td>

0x0000f00000627D293Ab4Dfb40082001724dB006F

</td></tr> <tr><td>Klaytn</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

0x00000000006c3852cbEf3e08E8dF289169EdE581

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

0x00e5F120f500006757E984F1DED400fc00370000

</td><td>

0x0000f00000627D293Ab4Dfb40082001724dB006F

</td></tr> <tr><td>Baobab</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

0x00000000006c3852cbEf3e08E8dF289169EdE581

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

0x00e5F120f500006757E984F1DED400fc00370000

</td><td>

0x0000f00000627D293Ab4Dfb40082001724dB006F

</td></tr> <tr><td>Moonbeam</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

Not deployed

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

Not deployed

</td><td>

Not deployed

</td></tr> <tr><td>Moonriver</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

0x00000000006c3852cbEf3e08E8dF289169EdE581

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

Not deployed

</td><td>

Not deployed

</td></tr> <tr><td>Canto</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

0x00000000006c3852cbEf3e08E8dF289169EdE581

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

Not deployed

</td><td>

Not deployed

</td></tr> <tr><td>Fantom</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

Not deployed

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

Not deployed

</td><td>

Not deployed

</td></tr> <tr><td>Celo</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

Not deployed

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

Not deployed

</td><td>

Not deployed

</td></tr> <tr><td>Zora</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

Not deployed

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

0x00e5F120f500006757E984F1DED400fc00370000

</td><td>

0x0000f00000627D293Ab4Dfb40082001724dB006F

</td></tr> <tr><td>Zora Sepolia</td><td>

0x0000000000000068F116a894984e2DB1123eB395

</td><td>

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

</td><td>

Not deployed

</td><td>

0x00000000F9490004C11Cef243f5400493c00Ad63

</td><td>

0x00e5F120f500006757E984F1DED400fc00370000

</td><td>

0x0000f00000627D293Ab4Dfb40082001724dB006F

</td></tr> </table>

To deploy to a new EVM chain, follow the steps outlined here.

Diagram

graph TD
    Offer & Consideration --> Order
    zone & conduitKey --> Order

    subgraph Seaport[ ]
    Order --> Fulfill & Match
    Order --> Validate & Cancel
    end

    Validate --> Verify
    Cancel --> OrderStatus

    Fulfill & Match --> OrderCombiner --> OrderFulfiller

    OrderCombiner --> BasicOrderFulfiller --> OrderValidator
    OrderCombiner --> FulfillmentApplier

    OrderFulfiller --> CriteriaResolution
    OrderFulfiller --> AmountDeriver
    OrderFulfiller --> OrderValidator

    OrderValidator --> ZoneInteraction
    OrderValidator --> Executor --> TokenTransferrer
    Executor --> Conduit --> TokenTransferrer
    Executor --> Verify

    subgraph Verifiers[ ]
    Verify --> Time & Signature & OrderStatus
    end

For a more thorough flowchart see Seaport diagram.

Docs

Install

To install dependencies and compile contracts:

git clone --recurse-submodules https://github.com/ProjectOpenSea/seaport && cd seaport
yarn install
yarn build

Usage

To run hardhat tests written in javascript:

yarn test
yarn coverage

Note: artifacts and cache folders may occasionally need to be removed between standard and coverage test runs.

To run hardhat tests against reference contracts:

yarn test:ref
yarn coverage:ref

To open the generated Hardhat coverage report locally after running yarn coverage or yarn coverage:ref:

open coverage/index.html

To profile gas usage:

yarn profile

Foundry Tests

Seaport also includes a suite of fuzzing tests written in Solidity with Foundry.

Before running these tests, you will need to compile an optimized build by running:

FOUNDRY_PROFILE=optimized forge build

This should create an optimized-out/ directory in your project root.

To run tests with full traces and debugging with source, create an .env file with the following line:

FOUNDRY_PROFILE=debug

You may then run tests with forge test, optionally specifying a level of verbosity (anywhere from one to five v's, eg, -vvv)

This will compile tests and contracts without via-ir enabled, which is much faster, but will not exactly match the deployed bytecode.

To run tests against the actual bytecode intended to be deployed on networks, you will need to pre-compile the contracts, and remove the FOUNDRY_PROFILE variable from your .env file. Note that informative error traces may not be available, and the Forge debugger will not show the accompanying source code.

FOUNDRY_PROFILE=optimized forge build
FOUNDRY_PROFILE=reference forge build

To run Forge coverage tests and open the generated coverage report locally:

brew install lcov
SEAPORT_COVERAGE=true forge coverage --report summary --report lcov && lcov -o lcov.info --remove lcov.info --rc lcov_branch_coverage=1 --rc lcov_function_coverage=1 "test/*" "script/*" && genhtml lcov.info -o html --branch
open html/index.html

When working on the test suite based around FuzzEngine.sol, using FOUNDRY_PROFILE=moat_debug will cut compile times roughly in half.

Note that Forge does not yet ignore specific filepaths when running coverage tests.

For information on Foundry, including installation and testing, see the Foundry Book.

Linting

To run lint checks:

yarn lint:check

Lint checks utilize prettier, prettier-plugin-solidity, and solhint.

"prettier": "^2.5.1",
"prettier-plugin-solidity": "^1.0.0-beta.19",

Audits

OpenSea engaged Trail of Bits to audit the security of Seaport. From April 18th to May 12th 2022, a team of Trail of Bits consultants conducted a security review of Seaport. The audit did not uncover significant flaws that could result in the compromise of a smart contract, loss of funds, or unexpected behavior in the target system. Their full report is available here.

Contributing

Contributions to Seaport are welcome by anyone interested in writing more tests, improving readability, optimizing for gas efficiency, or extending the protocol via new zone contracts or other features.

When making a pull request, ensure that:

License

MIT Copyright 2023 Ozone Networks, Inc.