Seaport is a new marketplace protocol for safely and efficiently buying and selling NFTs.
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.
Contract | Canonical Cross-chain Deployment Address |
---|---|
Seaport 1.1 | 0x00000000006c3852cbEf3e08E8dF289169EdE581 |
Seaport 1.2 | 0x00000000000006c7676171937C444f6BDe3D6282 |
ConduitController | 0x00000000F9490004C11Cef243f5400493c00Ad63 |
Network | Seaport 1.1 | Seaport 1.2 | ConduitController |
---|---|---|---|
Ethereum | |||
Goerli | |||
Sepolia | |||
Polygon | |||
Mumbai | |||
Klaytn | |||
Baobab | |||
Optimism | |||
Optimistic Goerli | |||
Arbitrum | |||
Arbitrum Goerli | |||
Arbitrum Nova | |||
Avalanche C-Chain | |||
Avalanche Fuji | |||
Gnosis Chain | |||
BSC | |||
BSC Testnet |
To be deployed on other EVM chains, such as:
- Skale
- Celo
- Fantom
- RSK
To deploy to a new EVM chain, follow the steps outlined here.
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.
To install dependencies and compile contracts:
git clone https://github.com/ProjectOpenSea/seaport && cd seaport
yarn install
yarn build
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
Seaport also includes a suite of fuzzing tests written in solidity with Foundry.
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 must 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 && genhtml lcov.info -o html --branch
open html/index.htmlg
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.
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",
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.
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:
- All tests pass.
- Code coverage remains at 100% (coverage tests must currently be written in hardhat).
- All new code adheres to the style guide:
- All lint checks pass.
- Code is thoroughly commented with natspec where relevant.
- If making a change to the contracts:
- Gas snapshots are provided and demonstrate an improvement (or an acceptable deficit given other improvements).
- Reference contracts are modified correspondingly if relevant.
- New tests (ideally via foundry) are included for all new features or code paths.
- If making a modification to third-party dependencies,
yarn audit
passes. - A descriptive summary of the PR has been provided.
MIT Copyright 2023 Ozone Networks, Inc.