Request form
OpenSea Seaport
  • NFT
  • Marketplace
  • NFT Marketplace
  • Protocol
  • Audited
Docs
Source
ChefGPT

OpenSea is the world's first and largest web3 marketplace for NFTs and crypto collectibles.

IERC1271 :
Interface of the ERC1271 standard signature validation method for contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271]. _Available since v4.1._
isValidSignature(bytes32,bytes) :
Should return whether the signature provided is valid for the provided data
IERC165 :
Interface of the ERC165 standard, as defined in the https://eips.ethereum.org/EIPS/eip-165[EIP]. Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}.
supportsInterface(bytes4) :
Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.
IERC2981 :
Interface for the NFT Royalty Standard. A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal support for royalty payments across all NFT marketplaces and ecosystem participants. _Available since v4.5._
royaltyInfo(uint256,uint256) :
Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
supportsInterface(bytes4) :
Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.
ERC165 :
Implementation of the {IERC165} interface. Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check for the additional interface id that will be supported. For example: ```solidity function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); } ``` Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
supportsInterface(bytes4) :
See {IERC165-supportsInterface}.
IERC165 :
Interface of the ERC165 standard, as defined in the https://eips.ethereum.org/EIPS/eip-165[EIP]. Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}.
supportsInterface(bytes4) :
Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.
ERC20 :
Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
ERC2981 :
Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the fee is specified in basis points by default. IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. _Available since v4.5._
royaltyInfo(uint256,uint256) :
Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
supportsInterface(bytes4) :
See {IERC165-supportsInterface}.
HashValidationZoneOfferer :
This contract is used to validate hashes. Use the TestTransferValidationZoneOfferer to validate transfers within the zone/offerer.
generateOrder(address,(uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256)[],bytes) :
Generates an order with the specified minimum and maximum spent items.
previewOrder(address,address,(uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256)[],bytes) :
View function to preview an order generated in response to a minimum set of received items, maximum set of spent items, and context (supplied as extraData).
ratifyOrder((uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256,address)[],bytes,bytes32[],uint256) :
Ratifies that the parties have received the correct items.
validateOrder((bytes32,address,address,(uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256,address)[],bytes,bytes32[],uint256,uint256,bytes32)) :
Validates that the parties have received the correct items.
TestTransferValidationZoneOfferer :
This contract is used to validate transfer within the zone/offerer. Use the HashValidationZoneOfferer to validate calldata via hashes.
generateOrder(address,(uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256)[],bytes) :
Generates an order with the specified minimum and maximum spent items.
previewOrder(address,address,(uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256)[],bytes) :
View function to preview an order generated in response to a minimum set of received items, maximum set of spent items, and context (supplied as extraData).
ratifyOrder((uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256,address)[],bytes,bytes32[],uint256) :
Ratifies that the parties have received the correct items.
validateOrder((bytes32,address,address,(uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256,address)[],bytes,bytes32[],uint256,uint256,bytes32)) :
Validates that the parties have received the correct items.
ExecutionHelper :
Helper contract for deriving explicit and executions from orders and fulfillment detailsTODO: move to the tests folder? not really useful for normal scripting
getBasicExecutions(OrderDetails,address,bytes32,uint256,address) :
return executions for fulfillBasicOrder and fulfillBasicOrderEfficient.
getFulfillAvailableExecutions(FulfillmentDetails,FulfillmentComponent[][],FulfillmentComponent[][],OrderDetails[]) :
get explicit and implicit executions for a fulfillAvailable call
getStandardExecutions(OrderDetails,address,bytes32,address,uint256,address) :
Return executions for fulfilOrder and fulfillAdvancedOrder.
SeaportInterface :
SeaportInterface contains all external function interfaces for Seaport.
ConsiderationInterface :
ConsiderationInterface contains all external function interfaces for Consideration.
IERC165 :
Interface of the ERC165 standard, as defined in the https://eips.ethereum.org/EIPS/eip-165[EIP]. Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}.
supportsInterface(bytes4) :
Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.
SeaportInterface :
SeaportInterface contains all external function interfaces for Seaport.
ConduitController.sol
Conduit.sol
ConduitController.sol
TokenTransferrer.sol
ConduitConstants.sol
ConduitEnums.sol
ConduitStructs.sol
ConduitControllerInterface.sol
ConduitInterface.sol
TokenTransferrerErrors.sol
TokenTransferrerConstants.sol
IERC1271.sol
IERC165.sol
IERC2981.sol
ERC165.sol
IERC165.sol
ERC1155.sol
ERC20.sol
ERC721.sol
ArrayHelpers.sol
CriteriaHelper.sol
CriteriaHelperLib.sol
ExecutionsHelper.sol
FulfillmentsHelper.sol
HelperInterface.sol
HelperItemLib.sol
MerkleLib.sol
NavigatorAdvancedOrderLib.sol
NavigatorContextLib.sol
NavigatorCriteriaResolverLib.sol
NavigatorDetailsLib.sol
NavigatorExecutionsLib.sol
NavigatorFulfillmentsLib.sol
NavigatorRequestValidatorLib.sol
NavigatorSeaportValidatorLib.sol
NavigatorSuggestedActionLib.sol
OrderAvailabilityLib.sol
OrderDetailsHelper.sol
OrderStructureLib.sol
RequestValidator.sol
SeaportNavigatorInterface.sol
SeaportNavigatorTypes.sol
SuggestedActionHelper.sol
ValidatorHelper.sol
SeaportNavigator.sol
ConsiderationTypeHashes.sol
ErrorsAndWarnings.sol
Murky.sol
ReadOnlyOrderValidator.sol
SafeStaticCall.sol
SeaportValidatorHelper.sol
SeaportValidatorInterface.sol
SeaportValidatorTypes.sol
SeaportValidator.sol
SeaportRouter.sol
ImmutableCreate2FactoryInterface.sol
ZoneInteractionErrors.sol
ZoneInterface.sol
Seaport.sol
ConduitControllerMock.sol
ConduitMock.sol
ConduitMockInvalidMagic.sol
ConduitMockRevertBytes.sol
ConduitMockRevertNoReason.sol
EIP1271Wallet.sol
ERC1155BatchRecipient.sol
ERC2981.sol
ERC721ReceiverMock.sol
ExcessReturnDataRecipient.sol
HashCalldataContractOfferer.sol
HashValidationZoneOfferer.sol
InvalidERC721Recipient.sol
InvalidEthRecipient.sol
OffererZoneFailureReason.sol
Reenterer.sol
TestBadContractOfferer.sol
TestCalldataHashContractOfferer.sol
TestContractOfferer.sol
TestContractOffererNativeToken.sol
TestERC1155.sol
TestERC1155Revert.sol
TestERC1271.sol
TestERC20.sol
TestERC20NotOk.sol
TestERC20Panic.sol
TestERC20Revert.sol
TestERC721.sol
TestERC721Fee.sol
TestERC721Funky.sol
TestERC721Revert.sol
TestInvalidContractOfferer.sol
TestInvalidContractOfferer165.sol
TestInvalidContractOffererRatifyOrder.sol
TestInvalidZone.sol
TestPostExecution.sol
TestTransferValidationZoneOfferer.sol
TestZone.sol
TypehashDirectory.sol
PausableZoneControllerInterface.sol
PausableZoneEventsAndErrors.sol
PausableZoneInterface.sol
PausableZone.sol
PausableZoneController.sol
AmountDeriver.sol
Assertions.sol
BasicOrderFulfiller.sol
Consideration.sol
ConsiderationBase.sol
ConsiderationDecoder.sol
ConsiderationEncoder.sol
CounterManager.sol
CriteriaResolution.sol
Executor.sol
FulfillmentApplier.sol
GettersAndDerivers.sol
LowLevelHelpers.sol
OrderCombiner.sol
OrderFulfiller.sol
OrderValidator.sol
ReentrancyGuard.sol
SignatureVerification.sol
Verifiers.sol
ZoneInteraction.sol
ConduitControllerInterface.sol
ConduitInterface.sol
ContractOffererInterface.sol
ExecutionHelper.sol
FulfillAvailableHelper.sol
FulfillAvailableLayout.sol
Constants.sol
FulfillmentLib.sol
MatchArrays.sol
Structs.sol
MatchFulfillmentHelper.sol
MatchFulfillmentLayout.sol
MatchFulfillmentLib.sol
AdditionalRecipientLib.sol
AdvancedOrderLib.sol
ArrayLib.sol
BasicOrderParametersLib.sol
ConsiderationItemLib.sol
CriteriaResolverLib.sol
ExecutionLib.sol
AmountDeriverHelper.sol
FulfillmentComponentLib.sol
FulfillmentLib.sol
OfferItemLib.sol
OrderComponentsLib.sol
OrderLib.sol
OrderParametersLib.sol
ReceivedItemLib.sol
SeaportArrays.sol
SeaportEnumsLib.sol
SeaportStructLib.sol
SpentItemLib.sol
StructCopier.sol
MatchComponentType.sol
ZoneParametersLib.sol
SeaportEnums.sol
SeaportInterface.sol
SeaportSol.sol
SeaportStructs.sol
Solarray.sol
SpaceEnums.sol
ZoneInterface.sol
PointerLibraries.sol
TransferHelperStructs.sol
AbridgedTokenInterfaces.sol
AmountDerivationErrors.sol
ConsiderationEventsAndErrors.sol
ConsiderationInterface.sol
ContractOffererInterface.sol
CriteriaResolutionErrors.sol
FulfillmentApplicationErrors.sol
IERC165.sol
IERC721Receiver.sol
ReentrancyErrors.sol
SeaportInterface.sol
SeaportRouterInterface.sol
SignatureVerificationErrors.sol
TransferHelperErrors.sol
TransferHelperInterface.sol
ZoneInteractionErrors.sol
ZoneInterface.sol
ConsiderationConstants.sol
ConsiderationEnums.sol
ConsiderationErrorConstants.sol
ConsiderationErrors.sol
ConsiderationStructs.sol
LibPRNG.sol
LibSort.sol

595 downloads

Chains

Authors

OpenSea Seaport
  • NFT
  • Marketplace
  • NFT Marketplace
  • Protocol
  • Audited
Info
Docs
Source
ChefGPT
Expand
Share

Get Cookin'

595 downloads

Chains

Authors

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.

Deployments

Canonical Cross-chain Deployment Addresses

ContractCanonical Cross-chain Deployment Address
Seaport 1.10x00000000006c3852cbEf3e08E8dF289169EdE581
Seaport 1.20x00000000000006c7676171937C444f6BDe3D6282
Seaport 1.30x0000000000000aD24e80fd803C6ac37206a45f15
Seaport 1.40x00000000000001ad428e4906aE43D8F9852d0dD6
Seaport 1.50x00000000000000ADc04C56Bf30aC9d3c0aAF14dC
ConduitController0x00000000F9490004C11Cef243f5400493c00Ad63
SeaportValidator0x00e5F120f500006757E984F1DED400fc00370000
SeaportNavigator0x0000f00000627D293Ab4Dfb40082001724dB006F

Note: Seaport 1.2 and Seaport 1.3 both contain known limitations; proceed with caution if interacting with them, particularly when utilizing restricted or contract orders.

Deployments By EVM Chain

NetworkSeaport 1.5Seaport 1.4Seaport 1.1ConduitControllerSeaportValidatorSeaportNavigator
Ethereum

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

0x00000000000001ad428e4906aE43D8F9852d0dD6

0x00000000006c3852cbEf3e08E8dF289169EdE581

0x00000000F9490004C11Cef243f5400493c00Ad63

0x00e5F120f500006757E984F1DED400fc00370000

0x0000f00000627D293Ab4Dfb40082001724dB006F

Goerli

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

0x00000000000001ad428e4906aE43D8F9852d0dD6

0x00000000006c3852cbEf3e08E8dF289169EdE581

0x00000000F9490004C11Cef243f5400493c00Ad63

0x00e5F120f500006757E984F1DED400fc00370000

0x0000f00000627D293Ab4Dfb40082001724dB006F

Sepolia

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

0x00000000000001ad428e4906aE43D8F9852d0dD6

0x00000000006c3852cbEf3e08E8dF289169EdE581

0x00000000F9490004C11Cef243f5400493c00Ad63

0x00e5F120f500006757E984F1DED400fc00370000

0x0000f00000627D293Ab4Dfb40082001724dB006F

Polygon

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

0x00000000000001ad428e4906aE43D8F9852d0dD6

0x00000000006c3852cbEf3e08E8dF289169EdE581

0x00000000F9490004C11Cef243f5400493c00Ad63

0x00e5F120f500006757E984F1DED400fc00370000

0x0000f00000627D293Ab4Dfb40082001724dB006F

Mumbai

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

0x00000000000001ad428e4906aE43D8F9852d0dD6

0x00000000006c3852cbEf3e08E8dF289169EdE581

0x00000000F9490004C11Cef243f5400493c00Ad63

0x00e5F120f500006757E984F1DED400fc00370000

0x0000f00000627D293Ab4Dfb40082001724dB006F

Optimism

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

0x00000000000001ad428e4906aE43D8F9852d0dD6

0x00000000006c3852cbEf3e08E8dF289169EdE581

0x00000000F9490004C11Cef243f5400493c00Ad63

0x00e5F120f500006757E984F1DED400fc00370000

0x0000f00000627D293Ab4Dfb40082001724dB006F

Optimistic Goerli

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

0x00000000000001ad428e4906aE43D8F9852d0dD6

0x00000000006c3852cbEf3e08E8dF289169EdE581

0x00000000F9490004C11Cef243f5400493c00Ad63

0x00e5F120f500006757E984F1DED400fc00370000

0x0000f00000627D293Ab4Dfb40082001724dB006F

Arbitrum

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

0x00000000000001ad428e4906aE43D8F9852d0dD6

0x00000000006c3852cbEf3e08E8dF289169EdE581

0x00000000F9490004C11Cef243f5400493c00Ad63

0x00e5F120f500006757E984F1DED400fc00370000

0x0000f00000627D293Ab4Dfb40082001724dB006F

Arbitrum Goerli

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

0x00000000000001ad428e4906aE43D8F9852d0dD6

0x00000000006c3852cbEf3e08E8dF289169EdE581

0x00000000F9490004C11Cef243f5400493c00Ad63

0x00e5F120f500006757E984F1DED400fc00370000

0x0000f00000627D293Ab4Dfb40082001724dB006F

Arbitrum Nova

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

0x00000000000001ad428e4906aE43D8F9852d0dD6

0x00000000006c3852cbEf3e08E8dF289169EdE581

0x00000000F9490004C11Cef243f5400493c00Ad63

0x00e5F120f500006757E984F1DED400fc00370000

0x0000f00000627D293Ab4Dfb40082001724dB006F

Base

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

Not deployed

Not deployed

0x00000000F9490004C11Cef243f5400493c00Ad63

0x00e5F120f500006757E984F1DED400fc00370000

0x0000f00000627D293Ab4Dfb40082001724dB006F

Base Goerli

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

Not deployed

Not deployed

0x00000000F9490004C11Cef243f5400493c00Ad63

0x00e5F120f500006757E984F1DED400fc00370000

0x0000f00000627D293Ab4Dfb40082001724dB006F

Avalanche C-Chain

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

0x00000000000001ad428e4906aE43D8F9852d0dD6

0x00000000006c3852cbEf3e08E8dF289169EdE581

0x00000000F9490004C11Cef243f5400493c00Ad63

0x00e5F120f500006757E984F1DED400fc00370000

0x0000f00000627D293Ab4Dfb40082001724dB006F

Avalanche Fuji

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

0x00000000000001ad428e4906aE43D8F9852d0dD6

0x00000000006c3852cbEf3e08E8dF289169EdE581

0x00000000F9490004C11Cef243f5400493c00Ad63

0x00e5F120f500006757E984F1DED400fc00370000

0x0000f00000627D293Ab4Dfb40082001724dB006F

Gnosis Chain

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

0x00000000000001ad428e4906aE43D8F9852d0dD6

0x00000000006c3852cbEf3e08E8dF289169EdE581

0x00000000F9490004C11Cef243f5400493c00Ad63

Not deployed

Not deployed

Chiado

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

Not deployed

Not deployed

0x00000000F9490004C11Cef243f5400493c00Ad63

Not deployed

Not deployed

BSC

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

0x00000000000001ad428e4906aE43D8F9852d0dD6

0x00000000006c3852cbEf3e08E8dF289169EdE581

0x00000000F9490004C11Cef243f5400493c00Ad63

0x00e5F120f500006757E984F1DED400fc00370000

0x0000f00000627D293Ab4Dfb40082001724dB006F

BSC Testnet

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

0x00000000000001ad428e4906aE43D8F9852d0dD6

0x00000000006c3852cbEf3e08E8dF289169EdE581

0x00000000F9490004C11Cef243f5400493c00Ad63

0x00e5F120f500006757E984F1DED400fc00370000

0x0000f00000627D293Ab4Dfb40082001724dB006F

Klaytn

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

0x00000000000001ad428e4906aE43D8F9852d0dD6

0x00000000006c3852cbEf3e08E8dF289169EdE581

0x00000000F9490004C11Cef243f5400493c00Ad63

0x00e5F120f500006757E984F1DED400fc00370000

0x0000f00000627D293Ab4Dfb40082001724dB006F

Baobab

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

0x00000000000001ad428e4906aE43D8F9852d0dD6

0x00000000006c3852cbEf3e08E8dF289169EdE581

0x00000000F9490004C11Cef243f5400493c00Ad63

0x00e5F120f500006757E984F1DED400fc00370000

0x0000f00000627D293Ab4Dfb40082001724dB006F

Moonbeam

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

Not deployed

Not deployed

0x00000000F9490004C11Cef243f5400493c00Ad63

Not deployed

Not deployed

Moonriver

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

Not deployed

0x00000000006c3852cbEf3e08E8dF289169EdE581

0x00000000F9490004C11Cef243f5400493c00Ad63

Not deployed

Not deployed

Canto

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

0x00000000000001ad428e4906aE43D8F9852d0dD6

0x00000000006c3852cbEf3e08E8dF289169EdE581

0x00000000F9490004C11Cef243f5400493c00Ad63

Not deployed

Not deployed

Fantom

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

Not deployed

Not deployed

0x00000000F9490004C11Cef243f5400493c00Ad63

Not deployed

Not deployed

Celo

0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

Not deployed

Not deployed

0x00000000F9490004C11Cef243f5400493c00Ad63

Not deployed

Not deployed

To be deployed on other EVM chains, such as:

  • RSK
  • Boba
  • Aurora

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:

  • 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.

License

MIT Copyright 2023 Ozone Networks, Inc.

OpenSea is the world's first and largest web3 marketplace for NFTs and crypto collectibles.
IERC1271 :
Interface of the ERC1271 standard signature validation method for contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271]. _Available since v4.1._
isValidSignature(bytes32,bytes) :
Should return whether the signature provided is valid for the provided data
IERC165 :
Interface of the ERC165 standard, as defined in the https://eips.ethereum.org/EIPS/eip-165[EIP]. Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}.
supportsInterface(bytes4) :
Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.
IERC2981 :
Interface for the NFT Royalty Standard. A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal support for royalty payments across all NFT marketplaces and ecosystem participants. _Available since v4.5._
royaltyInfo(uint256,uint256) :
Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
supportsInterface(bytes4) :
Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.
ERC165 :
Implementation of the {IERC165} interface. Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check for the additional interface id that will be supported. For example: ```solidity function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); } ``` Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
supportsInterface(bytes4) :
See {IERC165-supportsInterface}.
IERC165 :
Interface of the ERC165 standard, as defined in the https://eips.ethereum.org/EIPS/eip-165[EIP]. Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}.
supportsInterface(bytes4) :
Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.
ERC20 :
Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
ERC2981 :
Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the fee is specified in basis points by default. IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. _Available since v4.5._
royaltyInfo(uint256,uint256) :
Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
supportsInterface(bytes4) :
See {IERC165-supportsInterface}.
HashValidationZoneOfferer :
This contract is used to validate hashes. Use the TestTransferValidationZoneOfferer to validate transfers within the zone/offerer.
generateOrder(address,(uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256)[],bytes) :
Generates an order with the specified minimum and maximum spent items.
previewOrder(address,address,(uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256)[],bytes) :
View function to preview an order generated in response to a minimum set of received items, maximum set of spent items, and context (supplied as extraData).
ratifyOrder((uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256,address)[],bytes,bytes32[],uint256) :
Ratifies that the parties have received the correct items.
validateOrder((bytes32,address,address,(uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256,address)[],bytes,bytes32[],uint256,uint256,bytes32)) :
Validates that the parties have received the correct items.
TestTransferValidationZoneOfferer :
This contract is used to validate transfer within the zone/offerer. Use the HashValidationZoneOfferer to validate calldata via hashes.
generateOrder(address,(uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256)[],bytes) :
Generates an order with the specified minimum and maximum spent items.
previewOrder(address,address,(uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256)[],bytes) :
View function to preview an order generated in response to a minimum set of received items, maximum set of spent items, and context (supplied as extraData).
ratifyOrder((uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256,address)[],bytes,bytes32[],uint256) :
Ratifies that the parties have received the correct items.
validateOrder((bytes32,address,address,(uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256,address)[],bytes,bytes32[],uint256,uint256,bytes32)) :
Validates that the parties have received the correct items.
ExecutionHelper :
Helper contract for deriving explicit and executions from orders and fulfillment detailsTODO: move to the tests folder? not really useful for normal scripting
getBasicExecutions(OrderDetails,address,bytes32,uint256,address) :
return executions for fulfillBasicOrder and fulfillBasicOrderEfficient.
getFulfillAvailableExecutions(FulfillmentDetails,FulfillmentComponent[][],FulfillmentComponent[][],OrderDetails[]) :
get explicit and implicit executions for a fulfillAvailable call
getStandardExecutions(OrderDetails,address,bytes32,address,uint256,address) :
Return executions for fulfilOrder and fulfillAdvancedOrder.
SeaportInterface :
SeaportInterface contains all external function interfaces for Seaport.
ConsiderationInterface :
ConsiderationInterface contains all external function interfaces for Consideration.
IERC165 :
Interface of the ERC165 standard, as defined in the https://eips.ethereum.org/EIPS/eip-165[EIP]. Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}.
supportsInterface(bytes4) :
Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.
SeaportInterface :
SeaportInterface contains all external function interfaces for Seaport.
ConduitController.sol
Conduit.sol
ConduitController.sol
TokenTransferrer.sol
ConduitConstants.sol
ConduitEnums.sol
ConduitStructs.sol
ConduitControllerInterface.sol
ConduitInterface.sol
TokenTransferrerErrors.sol
TokenTransferrerConstants.sol
IERC1271.sol
IERC165.sol
IERC2981.sol
ERC165.sol
IERC165.sol
ERC1155.sol
ERC20.sol
ERC721.sol
ArrayHelpers.sol
CriteriaHelper.sol
CriteriaHelperLib.sol
ExecutionsHelper.sol
FulfillmentsHelper.sol
HelperInterface.sol
HelperItemLib.sol
MerkleLib.sol
NavigatorAdvancedOrderLib.sol
NavigatorContextLib.sol
NavigatorCriteriaResolverLib.sol
NavigatorDetailsLib.sol
NavigatorExecutionsLib.sol
NavigatorFulfillmentsLib.sol
NavigatorRequestValidatorLib.sol
NavigatorSeaportValidatorLib.sol
NavigatorSuggestedActionLib.sol
OrderAvailabilityLib.sol
OrderDetailsHelper.sol
OrderStructureLib.sol
RequestValidator.sol
SeaportNavigatorInterface.sol
SeaportNavigatorTypes.sol
SuggestedActionHelper.sol
ValidatorHelper.sol
SeaportNavigator.sol
ConsiderationTypeHashes.sol
ErrorsAndWarnings.sol
Murky.sol
ReadOnlyOrderValidator.sol
SafeStaticCall.sol
SeaportValidatorHelper.sol
SeaportValidatorInterface.sol
SeaportValidatorTypes.sol
SeaportValidator.sol
SeaportRouter.sol
ImmutableCreate2FactoryInterface.sol
ZoneInteractionErrors.sol
ZoneInterface.sol
Seaport.sol
ConduitControllerMock.sol
ConduitMock.sol
ConduitMockInvalidMagic.sol
ConduitMockRevertBytes.sol
ConduitMockRevertNoReason.sol
EIP1271Wallet.sol
ERC1155BatchRecipient.sol
ERC2981.sol
ERC721ReceiverMock.sol
ExcessReturnDataRecipient.sol
HashCalldataContractOfferer.sol
HashValidationZoneOfferer.sol
InvalidERC721Recipient.sol
InvalidEthRecipient.sol
OffererZoneFailureReason.sol
Reenterer.sol
TestBadContractOfferer.sol
TestCalldataHashContractOfferer.sol
TestContractOfferer.sol
TestContractOffererNativeToken.sol
TestERC1155.sol
TestERC1155Revert.sol
TestERC1271.sol
TestERC20.sol
TestERC20NotOk.sol
TestERC20Panic.sol
TestERC20Revert.sol
TestERC721.sol
TestERC721Fee.sol
TestERC721Funky.sol
TestERC721Revert.sol
TestInvalidContractOfferer.sol
TestInvalidContractOfferer165.sol
TestInvalidContractOffererRatifyOrder.sol
TestInvalidZone.sol
TestPostExecution.sol
TestTransferValidationZoneOfferer.sol
TestZone.sol
TypehashDirectory.sol
PausableZoneControllerInterface.sol
PausableZoneEventsAndErrors.sol
PausableZoneInterface.sol
PausableZone.sol
PausableZoneController.sol
AmountDeriver.sol
Assertions.sol
BasicOrderFulfiller.sol
Consideration.sol
ConsiderationBase.sol
ConsiderationDecoder.sol
ConsiderationEncoder.sol
CounterManager.sol
CriteriaResolution.sol
Executor.sol
FulfillmentApplier.sol
GettersAndDerivers.sol
LowLevelHelpers.sol
OrderCombiner.sol
OrderFulfiller.sol
OrderValidator.sol
ReentrancyGuard.sol
SignatureVerification.sol
Verifiers.sol
ZoneInteraction.sol
ConduitControllerInterface.sol
ConduitInterface.sol
ContractOffererInterface.sol
ExecutionHelper.sol
FulfillAvailableHelper.sol
FulfillAvailableLayout.sol
Constants.sol
FulfillmentLib.sol
MatchArrays.sol
Structs.sol
MatchFulfillmentHelper.sol
MatchFulfillmentLayout.sol
MatchFulfillmentLib.sol
AdditionalRecipientLib.sol
AdvancedOrderLib.sol
ArrayLib.sol
BasicOrderParametersLib.sol
ConsiderationItemLib.sol
CriteriaResolverLib.sol
ExecutionLib.sol
AmountDeriverHelper.sol
FulfillmentComponentLib.sol
FulfillmentLib.sol
OfferItemLib.sol
OrderComponentsLib.sol
OrderLib.sol
OrderParametersLib.sol
ReceivedItemLib.sol
SeaportArrays.sol
SeaportEnumsLib.sol
SeaportStructLib.sol
SpentItemLib.sol
StructCopier.sol
MatchComponentType.sol
ZoneParametersLib.sol
SeaportEnums.sol
SeaportInterface.sol
SeaportSol.sol
SeaportStructs.sol
Solarray.sol
SpaceEnums.sol
ZoneInterface.sol
PointerLibraries.sol
TransferHelperStructs.sol
AbridgedTokenInterfaces.sol
AmountDerivationErrors.sol
ConsiderationEventsAndErrors.sol
ConsiderationInterface.sol
ContractOffererInterface.sol
CriteriaResolutionErrors.sol
FulfillmentApplicationErrors.sol
IERC165.sol
IERC721Receiver.sol
ReentrancyErrors.sol
SeaportInterface.sol
SeaportRouterInterface.sol
SignatureVerificationErrors.sol
TransferHelperErrors.sol
TransferHelperInterface.sol
ZoneInteractionErrors.sol
ZoneInterface.sol
ConsiderationConstants.sol
ConsiderationEnums.sol
ConsiderationErrorConstants.sol
ConsiderationErrors.sol
ConsiderationStructs.sol
LibPRNG.sol
LibSort.sol