Seaport is a generalized ETH/ERC20/ERC721/ERC1155 marketplace. It minimizes external calls to the greatest extent possible and provides lightweight methods for common routes as well as more flexible methods for composing advanced orders.

SeaportInterface contains all external function interfaces for Seaport.

fulfillBasicOrder

function fulfillBasicOrder(struct BasicOrderParameters parameters) external payable returns (bool fulfilled)

Fulfill an order offering an ERC721 token by supplying Ether (or the native token for the given chain) as consideration for the order. An arbitrary number of "additional recipients" may also be supplied which will each receive native tokens from the fulfiller as consideration.

NameTypeDescription
parametersstruct BasicOrderParametersAdditional information on the fulfilled order. Note that the offerer must first approve this contract (or their preferred conduit if indicated by the order) for their offered ERC721 token to be transferred.
NameTypeDescription
fulfilledboolA boolean indicating whether the order has been successfully fulfilled.

fulfillOrder

function fulfillOrder(struct Order order, bytes32 fulfillerConduitKey) external payable returns (bool fulfilled)

Fulfill an order with an arbitrary number of items for offer and consideration. Note that this function does not support criteria-based orders or partial filling of orders (though filling the remainder of a partially-filled order is supported).

NameTypeDescription
orderstruct OrderThe order to fulfill. Note that both the offerer and the fulfiller must first approve this contract (or the corresponding conduit if indicated) to transfer any relevant tokens on their behalf and that contracts must implement `onERC1155Received` to receive ERC1155 tokens as consideration.
fulfillerConduitKeybytes32A bytes32 value indicating what conduit, if any, to source the fulfiller's token approvals from. The zero hash signifies that no conduit should be used, with direct approvals set on Seaport.
NameTypeDescription
fulfilledboolA boolean indicating whether the order has been successfully fulfilled.

fulfillAdvancedOrder

function fulfillAdvancedOrder(struct AdvancedOrder advancedOrder, struct CriteriaResolver[] criteriaResolvers, bytes32 fulfillerConduitKey, address recipient) external payable returns (bool fulfilled)

Fill an order, fully or partially, with an arbitrary number of items for offer and consideration alongside criteria resolvers containing specific token identifiers and associated proofs.

NameTypeDescription
advancedOrderstruct AdvancedOrderThe order to fulfill along with the fraction of the order to attempt to fill. Note that both the offerer and the fulfiller must first approve this contract (or their preferred conduit if indicated by the order) to transfer any relevant tokens on their behalf and that contracts must implement `onERC1155Received` to receive ERC1155 tokens as consideration. Also note that all offer and consideration components must have no remainder after multiplication of the respective amount with the supplied fraction for the partial fill to be considered valid.
criteriaResolversstruct CriteriaResolver[]An array where each element contains a reference to a specific offer or consideration, a token identifier, and a proof that the supplied token identifier is contained in the merkle root held by the item in question's criteria element. Note that an empty criteria indicates that any (transferable) token identifier on the token in question is valid and that no associated proof needs to be supplied.
fulfillerConduitKeybytes32A bytes32 value indicating what conduit, if any, to source the fulfiller's token approvals from. The zero hash signifies that no conduit should be used, with direct approvals set on Seaport.
recipientaddressThe intended recipient for all received items, with `address(0)` indicating that the caller should receive the items.
NameTypeDescription
fulfilledboolA boolean indicating whether the order has been successfully fulfilled.

fulfillAvailableOrders

function fulfillAvailableOrders(struct Order[] orders, struct FulfillmentComponent[][] offerFulfillments, struct FulfillmentComponent[][] considerationFulfillments, bytes32 fulfillerConduitKey, uint256 maximumFulfilled) external payable returns (bool[] availableOrders, struct Execution[] executions)

Attempt to fill a group of orders, each with an arbitrary number of items for offer and consideration. Any order that is not currently active, has already been fully filled, or has been cancelled will be omitted. Remaining offer and consideration items will then be aggregated where possible as indicated by the supplied offer and consideration component arrays and aggregated items will be transferred to the fulfiller or to each intended recipient, respectively. Note that a failing item transfer or an issue with order formatting will cause the entire batch to fail. Note that this function does not support criteria-based orders or partial filling of orders (though filling the remainder of a partially-filled order is supported).

NameTypeDescription
ordersstruct Order[]The orders to fulfill. Note that both the offerer and the fulfiller must first approve this contract (or the corresponding conduit if indicated) to transfer any relevant tokens on their behalf and that contracts must implement `onERC1155Received` to receive ERC1155 tokens as consideration.
offerFulfillmentsstruct FulfillmentComponent[][]An array of FulfillmentComponent arrays indicating which offer items to attempt to aggregate when preparing executions.
considerationFulfillmentsstruct FulfillmentComponent[][]An array of FulfillmentComponent arrays indicating which consideration items to attempt to aggregate when preparing executions.
fulfillerConduitKeybytes32A bytes32 value indicating what conduit, if any, to source the fulfiller's token approvals from. The zero hash signifies that no conduit should be used, with direct approvals set on this contract.
maximumFulfilleduint256The maximum number of orders to fulfill.
NameTypeDescription
availableOrdersbool[]An array of booleans indicating if each order with an index corresponding to the index of the returned boolean was fulfillable or not.
executionsstruct Execution[]An array of elements indicating the sequence of transfers performed as part of matching the given orders.

fulfillAvailableAdvancedOrders

function fulfillAvailableAdvancedOrders(struct AdvancedOrder[] advancedOrders, struct CriteriaResolver[] criteriaResolvers, struct FulfillmentComponent[][] offerFulfillments, struct FulfillmentComponent[][] considerationFulfillments, bytes32 fulfillerConduitKey, address recipient, uint256 maximumFulfilled) external payable returns (bool[] availableOrders, struct Execution[] executions)

Attempt to fill a group of orders, fully or partially, with an arbitrary number of items for offer and consideration per order alongside criteria resolvers containing specific token identifiers and associated proofs. Any order that is not currently active, has already been fully filled, or has been cancelled will be omitted. Remaining offer and consideration items will then be aggregated where possible as indicated by the supplied offer and consideration component arrays and aggregated items will be transferred to the fulfiller or to each intended recipient, respectively. Note that a failing item transfer or an issue with order formatting will cause the entire batch to fail.

NameTypeDescription
advancedOrdersstruct AdvancedOrder[]The orders to fulfill along with the fraction of those orders to attempt to fill. Note that both the offerer and the fulfiller must first approve this contract (or their preferred conduit if indicated by the order) to transfer any relevant tokens on their behalf and that contracts must implement `onERC1155Received` to enable receipt of ERC1155 tokens as consideration. Also note that all offer and consideration components must have no remainder after multiplication of the respective amount with the supplied fraction for an order's partial fill amount to be considered valid.
criteriaResolversstruct CriteriaResolver[]An array where each element contains a reference to a specific offer or consideration, a token identifier, and a proof that the supplied token identifier is contained in the merkle root held by the item in question's criteria element. Note that an empty criteria indicates that any (transferable) token identifier on the token in question is valid and that no associated proof needs to be supplied.
offerFulfillmentsstruct FulfillmentComponent[][]An array of FulfillmentComponent arrays indicating which offer items to attempt to aggregate when preparing executions.
considerationFulfillmentsstruct FulfillmentComponent[][]An array of FulfillmentComponent arrays indicating which consideration items to attempt to aggregate when preparing executions.
fulfillerConduitKeybytes32A bytes32 value indicating what conduit, if any, to source the fulfiller's token approvals from. The zero hash signifies that no conduit should be used, with direct approvals set on this contract.
recipientaddressThe intended recipient for all received items, with `address(0)` indicating that the caller should receive the items.
maximumFulfilleduint256The maximum number of orders to fulfill.
NameTypeDescription
availableOrdersbool[]An array of booleans indicating if each order with an index corresponding to the index of the returned boolean was fulfillable or not.
executionsstruct Execution[]An array of elements indicating the sequence of transfers performed as part of matching the given orders.

matchOrders

function matchOrders(struct Order[] orders, struct Fulfillment[] fulfillments) external payable returns (struct Execution[] executions)

Match an arbitrary number of orders, each with an arbitrary number of items for offer and consideration along with a set of fulfillments allocating offer components to consideration components. Note that this function does not support criteria-based or partial filling of orders (though filling the remainder of a partially-filled order is supported).

NameTypeDescription
ordersstruct Order[]The orders to match. Note that both the offerer and fulfiller on each order must first approve this contract (or their conduit if indicated by the order) to transfer any relevant tokens on their behalf and each consideration recipient must implement `onERC1155Received` to enable ERC1155 token receipt.
fulfillmentsstruct Fulfillment[]An array of elements allocating offer components to consideration components. Note that each consideration component must be fully met for the match operation to be valid.
NameTypeDescription
executionsstruct Execution[]An array of elements indicating the sequence of transfers performed as part of matching the given orders.

matchAdvancedOrders

function matchAdvancedOrders(struct AdvancedOrder[] orders, struct CriteriaResolver[] criteriaResolvers, struct Fulfillment[] fulfillments) external payable returns (struct Execution[] executions)

Match an arbitrary number of full or partial orders, each with an arbitrary number of items for offer and consideration, supplying criteria resolvers containing specific token identifiers and associated proofs as well as fulfillments allocating offer components to consideration components.

NameTypeDescription
ordersstruct AdvancedOrder[]The advanced orders to match. Note that both the offerer and fulfiller on each order must first approve this contract (or a preferred conduit if indicated by the order) to transfer any relevant tokens on their behalf and each consideration recipient must implement `onERC1155Received` in order to receive ERC1155 tokens. Also note that the offer and consideration components for each order must have no remainder after multiplying the respective amount with the supplied fraction in order for the group of partial fills to be considered valid.
criteriaResolversstruct CriteriaResolver[]An array where each element contains a reference to a specific order as well as that order's offer or consideration, a token identifier, and a proof that the supplied token identifier is contained in the order's merkle root. Note that an empty root indicates that any (transferable) token identifier is valid and that no associated proof needs to be supplied.
fulfillmentsstruct Fulfillment[]An array of elements allocating offer components to consideration components. Note that each consideration component must be fully met in order for the match operation to be valid.
NameTypeDescription
executionsstruct Execution[]An array of elements indicating the sequence of transfers performed as part of matching the given orders.

cancel

function cancel(struct OrderComponents[] orders) external returns (bool cancelled)

Cancel an arbitrary number of orders. Note that only the offerer or the zone of a given order may cancel it. Callers should ensure that the intended order was cancelled by calling `getOrderStatus` and confirming that `isCancelled` returns `true`.

NameTypeDescription
ordersstruct OrderComponents[]The orders to cancel.
NameTypeDescription
cancelledboolA boolean indicating whether the supplied orders have been successfully cancelled.

validate

function validate(struct Order[] orders) external returns (bool validated)

Validate an arbitrary number of orders, thereby registering their signatures as valid and allowing the fulfiller to skip signature verification on fulfillment. Note that validated orders may still be unfulfillable due to invalid item amounts or other factors; callers should determine whether validated orders are fulfillable by simulating the fulfillment call prior to execution. Also note that anyone can validate a signed order, but only the offerer can validate an order without supplying a signature.

NameTypeDescription
ordersstruct Order[]The orders to validate.
NameTypeDescription
validatedboolA boolean indicating whether the supplied orders have been successfully validated.

incrementCounter

function incrementCounter() external returns (uint256 newCounter)

Cancel all orders from a given offerer with a given zone in bulk by incrementing a counter. Note that only the offerer may increment the counter.

NameTypeDescription
newCounteruint256The new counter.

getOrderHash

function getOrderHash(struct OrderComponents order) external view returns (bytes32 orderHash)

Retrieve the order hash for a given order.

NameTypeDescription
orderstruct OrderComponentsThe components of the order.
NameTypeDescription
orderHashbytes32The order hash.

getOrderStatus

function getOrderStatus(bytes32 orderHash) external view returns (bool isValidated, bool isCancelled, uint256 totalFilled, uint256 totalSize)

Retrieve the status of a given order by hash, including whether the order has been cancelled or validated and the fraction of the order that has been filled.

NameTypeDescription
orderHashbytes32The order hash in question.
NameTypeDescription
isValidatedboolA boolean indicating whether the order in question has been validated (i.e. previously approved or partially filled).
isCancelledboolA boolean indicating whether the order in question has been cancelled.
totalFilleduint256The total portion of the order that has been filled (i.e. the "numerator").
totalSizeuint256The total size of the order that is either filled or unfilled (i.e. the "denominator").

getCounter

function getCounter(address offerer) external view returns (uint256 counter)

Retrieve the current counter for a given offerer.

NameTypeDescription
offereraddressThe offerer in question.
NameTypeDescription
counteruint256The current counter.

information

function information() external view returns (string version, bytes32 domainSeparator, address conduitController)

Retrieve configuration information for this contract.

NameTypeDescription
versionstringThe contract version.
domainSeparatorbytes32The domain separator for this contract.
conduitControlleraddressThe conduit Controller set for this contract.

name

function name() external view returns (string contractName)

Retrieve the name of this contract.

NameTypeDescription
contractNamestringThe name of this contract.