编译器
0.8.17+commit.8df45f5f
文件 1 的 13:Address.sol
pragma solidity ^0.8.1;
library Address {
function isContract(address account) internal view returns (bool) {
return account.code.length > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
文件 2 的 13:BaseExchangeModule.sol
pragma solidity ^0.8.9;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import {BaseModule} from "../BaseModule.sol";
abstract contract BaseExchangeModule is BaseModule {
using SafeERC20 for IERC20;
struct ETHListingParams {
address fillTo;
address refundTo;
bool revertIfIncomplete;
uint256 amount;
}
struct ERC20ListingParams {
address fillTo;
address refundTo;
bool revertIfIncomplete;
IERC20 token;
uint256 amount;
}
struct OfferParams {
address fillTo;
address refundTo;
bool revertIfIncomplete;
}
struct Fee {
address recipient;
uint256 amount;
}
address public immutable router;
error UnsuccessfulFill();
constructor(address routerAddress) {
router = routerAddress;
}
modifier refundETHLeftover(address refundTo) {
_;
uint256 leftover = address(this).balance;
if (leftover > 0) {
_sendETH(refundTo, leftover);
}
}
modifier refundERC20Leftover(address refundTo, IERC20 token) {
_;
uint256 leftover = token.balanceOf(address(this));
if (leftover > 0) {
token.safeTransfer(refundTo, leftover);
}
}
modifier chargeETHFees(Fee[] calldata fees, uint256 amount) {
if (fees.length == 0) {
_;
} else {
uint256 balanceBefore = address(this).balance;
_;
uint256 length = fees.length;
if (length > 0) {
uint256 balanceAfter = address(this).balance;
uint256 actualPaid = balanceBefore - balanceAfter;
uint256 actualFee;
for (uint256 i = 0; i < length; ) {
actualFee = (fees[i].amount * actualPaid) / amount;
if (actualFee > 0) {
_sendETH(fees[i].recipient, actualFee);
}
unchecked {
++i;
}
}
}
}
}
modifier chargeERC20Fees(
Fee[] calldata fees,
IERC20 token,
uint256 amount
) {
if (fees.length == 0) {
_;
} else {
uint256 balanceBefore = token.balanceOf(address(this));
_;
uint256 length = fees.length;
if (length > 0) {
uint256 balanceAfter = token.balanceOf(address(this));
uint256 actualPaid = balanceBefore - balanceAfter;
uint256 actualFee;
for (uint256 i = 0; i < length; ) {
actualFee = (fees[i].amount * actualPaid) / amount;
if (actualFee > 0) {
token.safeTransfer(fees[i].recipient, actualFee);
}
unchecked {
++i;
}
}
}
}
}
function _sendAllETH(address to) internal {
_sendETH(to, address(this).balance);
}
function _sendAllERC20(address to, IERC20 token) internal {
uint256 balance = token.balanceOf(address(this));
if (balance > 0) {
token.safeTransfer(to, balance);
}
}
function _sendAllERC721(address to, IERC721 token, uint256 tokenId) internal {
if (token.ownerOf(tokenId) == address(this)) {
token.safeTransferFrom(address(this), to, tokenId);
}
}
function _sendAllERC1155(address to, IERC1155 token, uint256 tokenId) internal {
uint256 balance = token.balanceOf(address(this), tokenId);
if (balance > 0) {
token.safeTransferFrom(address(this), to, tokenId, balance, "");
}
}
function _approveERC20IfNeeded(IERC20 token, address spender, uint256 amount) internal {
uint256 allowance = token.allowance(address(this), spender);
if (allowance < amount) {
token.approve(spender, amount);
}
}
function _approveERC721IfNeeded(IERC721 token, address operator) internal {
bool isApproved = token.isApprovedForAll(address(this), operator);
if (!isApproved) {
token.setApprovalForAll(operator, true);
}
}
function _approveERC1155IfNeeded(IERC1155 token, address operator) internal {
bool isApproved = token.isApprovedForAll(address(this), operator);
if (!isApproved) {
token.setApprovalForAll(operator, true);
}
}
}
文件 3 的 13:BaseModule.sol
pragma solidity ^0.8.9;
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {TwoStepOwnable} from "../../misc/TwoStepOwnable.sol";
abstract contract BaseModule is TwoStepOwnable, ReentrancyGuard {
using SafeERC20 for IERC20;
event CallExecuted(address target, bytes data, uint256 value);
error UnsuccessfulCall();
error UnsuccessfulPayment();
error WrongParams();
constructor(address owner) TwoStepOwnable(owner) {}
function makeCalls(
address[] calldata targets,
bytes[] calldata data,
uint256[] calldata values
) external payable onlyOwner nonReentrant {
uint256 length = targets.length;
for (uint256 i = 0; i < length; ) {
_makeCall(targets[i], data[i], values[i]);
emit CallExecuted(targets[i], data[i], values[i]);
unchecked {
++i;
}
}
}
function _sendETH(address to, uint256 amount) internal {
if (amount > 0) {
(bool success, ) = payable(to).call{value: amount}("");
if (!success) {
revert UnsuccessfulPayment();
}
}
}
function _sendERC20(
address to,
uint256 amount,
IERC20 token
) internal {
if (amount > 0) {
token.safeTransfer(to, amount);
}
}
function _makeCall(
address target,
bytes memory data,
uint256 value
) internal {
(bool success, ) = payable(target).call{value: value}(data);
if (!success) {
revert UnsuccessfulCall();
}
}
}
文件 4 的 13:IERC1155.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC1155 is IERC165 {
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
event URI(string value, uint256 indexed id);
function balanceOf(address account, uint256 id) external view returns (uint256);
function balanceOfBatch(
address[] calldata accounts,
uint256[] calldata ids
) external view returns (uint256[] memory);
function setApprovalForAll(address operator, bool approved) external;
function isApprovedForAll(address account, address operator) external view returns (bool);
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}
文件 5 的 13:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 6 的 13:IERC20.sol
pragma solidity ^0.8.0;
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
文件 7 的 13:IERC20Permit.sol
pragma solidity ^0.8.0;
interface IERC20Permit {
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
function nonces(address owner) external view returns (uint256);
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
文件 8 的 13:IERC721.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
function safeTransferFrom(address from, address to, uint256 tokenId) external;
function transferFrom(address from, address to, uint256 tokenId) external;
function approve(address to, uint256 tokenId) external;
function setApprovalForAll(address operator, bool approved) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
文件 9 的 13:ISeaport.sol
pragma solidity ^0.8.9;
interface ISeaport {
enum OrderType {
FULL_OPEN,
PARTIAL_OPEN,
FULL_RESTRICTED,
PARTIAL_RESTRICTED
}
enum ItemType {
NATIVE,
ERC20,
ERC721,
ERC1155,
ERC721_WITH_CRITERIA,
ERC1155_WITH_CRITERIA
}
enum Side {
OFFER,
CONSIDERATION
}
struct OfferItem {
ItemType itemType;
address token;
uint256 identifierOrCriteria;
uint256 startAmount;
uint256 endAmount;
}
struct ConsiderationItem {
ItemType itemType;
address token;
uint256 identifierOrCriteria;
uint256 startAmount;
uint256 endAmount;
address recipient;
}
struct SpentItem {
ItemType itemType;
address token;
uint256 identifier;
uint256 amount;
}
struct ReceivedItem {
ItemType itemType;
address token;
uint256 identifier;
uint256 amount;
address recipient;
}
struct OrderComponents {
address offerer;
address zone;
OfferItem[] offer;
ConsiderationItem[] consideration;
OrderType orderType;
uint256 startTime;
uint256 endTime;
bytes32 zoneHash;
uint256 salt;
bytes32 conduitKey;
uint256 counter;
}
struct OrderParameters {
address offerer;
address zone;
OfferItem[] offer;
ConsiderationItem[] consideration;
OrderType orderType;
uint256 startTime;
uint256 endTime;
bytes32 zoneHash;
uint256 salt;
bytes32 conduitKey;
uint256 totalOriginalConsiderationItems;
}
struct Order {
OrderParameters parameters;
bytes signature;
}
struct AdvancedOrder {
OrderParameters parameters;
uint120 numerator;
uint120 denominator;
bytes signature;
bytes extraData;
}
struct CriteriaResolver {
uint256 orderIndex;
Side side;
uint256 index;
uint256 identifier;
bytes32[] criteriaProof;
}
struct FulfillmentComponent {
uint256 orderIndex;
uint256 itemIndex;
}
struct Fulfillment {
FulfillmentComponent[] offerComponents;
FulfillmentComponent[] considerationComponents;
}
struct Execution {
ReceivedItem item;
address offerer;
bytes32 conduitKey;
}
struct ZoneParameters {
bytes32 orderHash;
address fulfiller;
address offerer;
SpentItem[] offer;
ReceivedItem[] consideration;
bytes extraData;
bytes32[] orderHashes;
uint256 startTime;
uint256 endTime;
bytes32 zoneHash;
}
struct Schema {
uint256 id;
bytes metadata;
}
function getOrderHash(OrderComponents calldata order) external view returns (bytes32 orderHash);
function getOrderStatus(bytes32 orderHash)
external
view
returns (
bool isValidated,
bool isCancelled,
uint256 totalFilled,
uint256 totalSize
);
function getCounter(address offerer) external view returns (uint256 counter);
function fulfillAdvancedOrder(
AdvancedOrder calldata advancedOrder,
CriteriaResolver[] calldata criteriaResolvers,
bytes32 fulfillerConduitKey,
address recipient
) external payable returns (bool fulfilled);
function fulfillAvailableAdvancedOrders(
AdvancedOrder[] memory advancedOrders,
CriteriaResolver[] calldata criteriaResolvers,
FulfillmentComponent[][] calldata offerFulfillments,
FulfillmentComponent[][] calldata considerationFulfillments,
bytes32 fulfillerConduitKey,
address recipient,
uint256 maximumFulfilled
) external payable returns (bool[] memory availableOrders, Execution[] memory executions);
function matchOrders(Order[] calldata orders, Fulfillment[] calldata fulfillments)
external
payable
returns (Execution[] memory executions);
function matchAdvancedOrders(
AdvancedOrder[] calldata advancedOrders,
CriteriaResolver[] calldata criteriaResolvers,
Fulfillment[] calldata fulfillments
) external payable returns (Execution[] memory executions);
}
文件 10 的 13:ReentrancyGuard.sol
pragma solidity ^0.8.0;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
}
function _nonReentrantAfter() private {
_status = _NOT_ENTERED;
}
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}
文件 11 的 13:SafeERC20.sol
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";
library SafeERC20 {
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
(bool success, bytes memory returndata) = address(token).call(data);
return
success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
}
}
文件 12 的 13:SeaportV15Module.sol
pragma solidity ^0.8.9;
import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {BaseExchangeModule} from "./BaseExchangeModule.sol";
import {BaseModule} from "../BaseModule.sol";
import {ISeaport} from "../../../interfaces/ISeaport.sol";
contract SeaportV15Module is BaseExchangeModule {
struct SeaportETHListingWithPrice {
ISeaport.AdvancedOrder order;
uint256 price;
}
ISeaport public immutable EXCHANGE;
constructor(
address owner,
address router,
address exchange
) BaseModule(owner) BaseExchangeModule(router) {
EXCHANGE = ISeaport(exchange);
}
receive() external payable {}
function acceptETHListing(
ISeaport.AdvancedOrder calldata order,
ETHListingParams calldata params,
Fee[] calldata fees
)
external
payable
nonReentrant
refundETHLeftover(params.refundTo)
chargeETHFees(fees, params.amount)
{
params.revertIfIncomplete
? _fillSingleOrderWithRevertIfIncomplete(
order,
new ISeaport.CriteriaResolver[](0),
params.fillTo,
params.amount
)
: _fillSingleOrder(order, new ISeaport.CriteriaResolver[](0), params.fillTo, params.amount);
}
function acceptERC20Listing(
ISeaport.AdvancedOrder calldata order,
ERC20ListingParams calldata params,
Fee[] calldata fees
)
external
nonReentrant
refundERC20Leftover(params.refundTo, params.token)
chargeERC20Fees(fees, params.token, params.amount)
{
_approveERC20IfNeeded(params.token, address(EXCHANGE), params.amount);
params.revertIfIncomplete
? _fillSingleOrderWithRevertIfIncomplete(
order,
new ISeaport.CriteriaResolver[](0),
params.fillTo,
0
)
: _fillSingleOrder(order, new ISeaport.CriteriaResolver[](0), params.fillTo, 0);
}
function acceptETHListings(
SeaportETHListingWithPrice[] calldata orders,
ETHListingParams calldata params,
Fee[] calldata fees
)
external
payable
nonReentrant
refundETHLeftover(params.refundTo)
chargeETHFees(fees, params.amount)
{
uint256 length = orders.length;
ISeaport.CriteriaResolver[] memory criteriaResolvers = new ISeaport.CriteriaResolver[](0);
if (params.revertIfIncomplete) {
for (uint256 i; i < length; ) {
_fillSingleOrderWithRevertIfIncomplete(
orders[i].order,
criteriaResolvers,
params.fillTo,
orders[i].price
);
unchecked {
++i;
}
}
} else {
for (uint256 i; i < length; ) {
_fillSingleOrder(orders[i].order, criteriaResolvers, params.fillTo, orders[i].price);
unchecked {
++i;
}
}
}
}
function acceptERC20Listings(
ISeaport.AdvancedOrder[] calldata orders,
ERC20ListingParams calldata params,
Fee[] calldata fees
)
external
nonReentrant
refundERC20Leftover(params.refundTo, params.token)
chargeERC20Fees(fees, params.token, params.amount)
{
_approveERC20IfNeeded(params.token, address(EXCHANGE), params.amount);
uint256 length = orders.length;
ISeaport.CriteriaResolver[] memory criteriaResolvers = new ISeaport.CriteriaResolver[](0);
if (params.revertIfIncomplete) {
for (uint256 i; i < length; ) {
_fillSingleOrderWithRevertIfIncomplete(orders[i], criteriaResolvers, params.fillTo, 0);
unchecked {
++i;
}
}
} else {
for (uint256 i; i < length; ) {
_fillSingleOrder(orders[i], criteriaResolvers, params.fillTo, 0);
unchecked {
++i;
}
}
}
}
function acceptERC721Offer(
ISeaport.AdvancedOrder calldata order,
ISeaport.CriteriaResolver[] memory criteriaResolvers,
OfferParams calldata params,
Fee[] calldata fees
) external nonReentrant {
ISeaport.ConsiderationItem calldata nftItem = order.parameters.consideration[0];
if (
nftItem.itemType != ISeaport.ItemType.ERC721 &&
nftItem.itemType != ISeaport.ItemType.ERC721_WITH_CRITERIA
) {
revert WrongParams();
}
IERC721 nftToken = IERC721(nftItem.token);
ISeaport.OfferItem calldata paymentItem = order.parameters.offer[0];
IERC20 paymentToken = IERC20(paymentItem.token);
_approveERC721IfNeeded(nftToken, address(EXCHANGE));
_approveERC20IfNeeded(paymentToken, address(EXCHANGE), type(uint256).max);
params.revertIfIncomplete
? _fillSingleOrderWithRevertIfIncomplete(order, criteriaResolvers, address(this), 0)
: _fillSingleOrder(order, criteriaResolvers, address(this), 0);
uint256 identifier = nftItem.itemType == ISeaport.ItemType.ERC721
? nftItem.identifierOrCriteria
: criteriaResolvers[0].identifier;
if (nftToken.ownerOf(identifier) != address(this)) {
uint256 feesLength = fees.length;
for (uint256 i; i < feesLength; ) {
Fee memory fee = fees[i];
_sendERC20(fee.recipient, fee.amount, paymentToken);
unchecked {
++i;
}
}
}
_sendAllERC721(params.refundTo, nftToken, identifier);
_sendAllERC20(params.fillTo, paymentToken);
}
function acceptERC1155Offer(
ISeaport.AdvancedOrder calldata order,
ISeaport.CriteriaResolver[] memory criteriaResolvers,
OfferParams calldata params,
Fee[] calldata fees
) external nonReentrant {
ISeaport.ConsiderationItem calldata nftItem = order.parameters.consideration[0];
if (
nftItem.itemType != ISeaport.ItemType.ERC1155 &&
nftItem.itemType != ISeaport.ItemType.ERC1155_WITH_CRITERIA
) {
revert WrongParams();
}
IERC1155 nftToken = IERC1155(nftItem.token);
ISeaport.OfferItem calldata paymentItem = order.parameters.offer[0];
IERC20 paymentToken = IERC20(paymentItem.token);
_approveERC1155IfNeeded(nftToken, address(EXCHANGE));
_approveERC20IfNeeded(paymentToken, address(EXCHANGE), type(uint256).max);
uint256 identifier = nftItem.itemType == ISeaport.ItemType.ERC1155
? nftItem.identifierOrCriteria
: criteriaResolvers[0].identifier;
uint256 balanceBefore = nftToken.balanceOf(address(this), identifier);
params.revertIfIncomplete
? _fillSingleOrderWithRevertIfIncomplete(order, criteriaResolvers, address(this), 0)
: _fillSingleOrder(order, criteriaResolvers, address(this), 0);
uint256 balanceAfter = nftToken.balanceOf(address(this), identifier);
uint256 amountFilled = balanceBefore - balanceAfter;
if (amountFilled > 0) {
uint256 feesLength = fees.length;
for (uint256 i; i < feesLength; ) {
Fee memory fee = fees[i];
_sendERC20(
fee.recipient,
(fee.amount * amountFilled) / order.numerator,
paymentToken
);
unchecked {
++i;
}
}
}
_sendAllERC1155(params.refundTo, nftToken, identifier);
_sendAllERC20(params.fillTo, paymentToken);
}
function matchOrders(
ISeaport.Order[] calldata orders,
ISeaport.Fulfillment[] calldata fulfillments
) external nonReentrant {
EXCHANGE.matchOrders(orders, fulfillments);
}
function onERC721Received(
address,
address,
uint256,
bytes calldata data
) external returns (bytes4) {
if (data.length > 0) {
_makeCall(router, data, 0);
}
return this.onERC721Received.selector;
}
function onERC1155Received(
address,
address,
uint256,
uint256,
bytes calldata data
) external returns (bytes4) {
if (data.length > 0) {
_makeCall(router, data, 0);
}
return this.onERC1155Received.selector;
}
function _fillSingleOrder(
ISeaport.AdvancedOrder calldata order,
ISeaport.CriteriaResolver[] memory criteriaResolvers,
address receiver,
uint256 value
) internal {
try
EXCHANGE.fulfillAdvancedOrder{value: value}(order, criteriaResolvers, bytes32(0), receiver)
{} catch {}
}
function _fillSingleOrderWithRevertIfIncomplete(
ISeaport.AdvancedOrder calldata order,
ISeaport.CriteriaResolver[] memory criteriaResolvers,
address receiver,
uint256 value
) internal {
bytes32 orderHash = _getOrderHash(order.parameters);
uint256 beforeFilledAmount = _getFilledAmount(orderHash, order.denominator);
bool success;
try
EXCHANGE.fulfillAdvancedOrder{value: value}(order, criteriaResolvers, bytes32(0), receiver)
returns (bool fulfilled) {
success = fulfilled;
} catch {
revert UnsuccessfulFill();
}
if (!success) {
revert UnsuccessfulFill();
} else {
uint256 afterFilledAmount = _getFilledAmount(orderHash, order.denominator);
if (afterFilledAmount - beforeFilledAmount != order.numerator) {
revert UnsuccessfulFill();
}
}
}
function _getOrderHash(
ISeaport.OrderParameters memory orderParameters
) internal view returns (bytes32 orderHash) {
ISeaport.OrderComponents memory orderComponents;
assembly {
orderComponents := orderParameters
}
orderComponents.counter = EXCHANGE.getCounter(orderParameters.offerer);
orderHash = EXCHANGE.getOrderHash(orderComponents);
}
function _getFilledAmount(
bytes32 orderHash,
uint256 adjustedTotalSize
) internal view returns (uint256 adjustedTotalFilled) {
(, , uint256 totalFilled, uint256 totalSize) = EXCHANGE.getOrderStatus(orderHash);
adjustedTotalFilled = totalSize > 0 ? (totalFilled * adjustedTotalSize) / totalSize : 0;
}
}
文件 13 的 13:TwoStepOwnable.sol
pragma solidity ^0.8.9;
contract TwoStepOwnable {
address public owner;
address public pendingOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
error InvalidParams();
error Unauthorized();
modifier onlyOwner() {
if (msg.sender != owner) {
revert Unauthorized();
}
_;
}
constructor(address initialOwner) {
owner = initialOwner;
emit OwnershipTransferred(address(0), initialOwner);
}
function transferOwnership(address newOwner) public onlyOwner {
pendingOwner = newOwner;
}
function claimOwnership() public {
address _pendingOwner = pendingOwner;
if (msg.sender != _pendingOwner) {
revert Unauthorized();
}
owner = _pendingOwner;
pendingOwner = address(0);
emit OwnershipTransferred(owner, _pendingOwner);
}
}
{
"compilationTarget": {
"contracts/router/modules/exchanges/SeaportV15Module.sol": "SeaportV15Module"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": [],
"viaIR": true
}
[{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"router","type":"address"},{"internalType":"address","name":"exchange","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidParams","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"UnsuccessfulCall","type":"error"},{"inputs":[],"name":"UnsuccessfulFill","type":"error"},{"inputs":[],"name":"UnsuccessfulPayment","type":"error"},{"inputs":[],"name":"WrongParams","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"CallExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"EXCHANGE","outputs":[{"internalType":"contract ISeaport","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"offerer","type":"address"},{"internalType":"address","name":"zone","type":"address"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"}],"internalType":"struct ISeaport.OfferItem[]","name":"offer","type":"tuple[]"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"internalType":"struct ISeaport.ConsiderationItem[]","name":"consideration","type":"tuple[]"},{"internalType":"enum ISeaport.OrderType","name":"orderType","type":"uint8"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"bytes32","name":"zoneHash","type":"bytes32"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes32","name":"conduitKey","type":"bytes32"},{"internalType":"uint256","name":"totalOriginalConsiderationItems","type":"uint256"}],"internalType":"struct ISeaport.OrderParameters","name":"parameters","type":"tuple"},{"internalType":"uint120","name":"numerator","type":"uint120"},{"internalType":"uint120","name":"denominator","type":"uint120"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct ISeaport.AdvancedOrder","name":"order","type":"tuple"},{"components":[{"internalType":"uint256","name":"orderIndex","type":"uint256"},{"internalType":"enum ISeaport.Side","name":"side","type":"uint8"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"identifier","type":"uint256"},{"internalType":"bytes32[]","name":"criteriaProof","type":"bytes32[]"}],"internalType":"struct ISeaport.CriteriaResolver[]","name":"criteriaResolvers","type":"tuple[]"},{"components":[{"internalType":"address","name":"fillTo","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"}],"internalType":"struct BaseExchangeModule.OfferParams","name":"params","type":"tuple"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.Fee[]","name":"fees","type":"tuple[]"}],"name":"acceptERC1155Offer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"offerer","type":"address"},{"internalType":"address","name":"zone","type":"address"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"}],"internalType":"struct ISeaport.OfferItem[]","name":"offer","type":"tuple[]"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"internalType":"struct ISeaport.ConsiderationItem[]","name":"consideration","type":"tuple[]"},{"internalType":"enum ISeaport.OrderType","name":"orderType","type":"uint8"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"bytes32","name":"zoneHash","type":"bytes32"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes32","name":"conduitKey","type":"bytes32"},{"internalType":"uint256","name":"totalOriginalConsiderationItems","type":"uint256"}],"internalType":"struct ISeaport.OrderParameters","name":"parameters","type":"tuple"},{"internalType":"uint120","name":"numerator","type":"uint120"},{"internalType":"uint120","name":"denominator","type":"uint120"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct ISeaport.AdvancedOrder","name":"order","type":"tuple"},{"components":[{"internalType":"address","name":"fillTo","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.ERC20ListingParams","name":"params","type":"tuple"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.Fee[]","name":"fees","type":"tuple[]"}],"name":"acceptERC20Listing","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"offerer","type":"address"},{"internalType":"address","name":"zone","type":"address"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"}],"internalType":"struct ISeaport.OfferItem[]","name":"offer","type":"tuple[]"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"internalType":"struct ISeaport.ConsiderationItem[]","name":"consideration","type":"tuple[]"},{"internalType":"enum ISeaport.OrderType","name":"orderType","type":"uint8"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"bytes32","name":"zoneHash","type":"bytes32"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes32","name":"conduitKey","type":"bytes32"},{"internalType":"uint256","name":"totalOriginalConsiderationItems","type":"uint256"}],"internalType":"struct ISeaport.OrderParameters","name":"parameters","type":"tuple"},{"internalType":"uint120","name":"numerator","type":"uint120"},{"internalType":"uint120","name":"denominator","type":"uint120"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct ISeaport.AdvancedOrder[]","name":"orders","type":"tuple[]"},{"components":[{"internalType":"address","name":"fillTo","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.ERC20ListingParams","name":"params","type":"tuple"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.Fee[]","name":"fees","type":"tuple[]"}],"name":"acceptERC20Listings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"offerer","type":"address"},{"internalType":"address","name":"zone","type":"address"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"}],"internalType":"struct ISeaport.OfferItem[]","name":"offer","type":"tuple[]"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"internalType":"struct ISeaport.ConsiderationItem[]","name":"consideration","type":"tuple[]"},{"internalType":"enum ISeaport.OrderType","name":"orderType","type":"uint8"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"bytes32","name":"zoneHash","type":"bytes32"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes32","name":"conduitKey","type":"bytes32"},{"internalType":"uint256","name":"totalOriginalConsiderationItems","type":"uint256"}],"internalType":"struct ISeaport.OrderParameters","name":"parameters","type":"tuple"},{"internalType":"uint120","name":"numerator","type":"uint120"},{"internalType":"uint120","name":"denominator","type":"uint120"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct ISeaport.AdvancedOrder","name":"order","type":"tuple"},{"components":[{"internalType":"uint256","name":"orderIndex","type":"uint256"},{"internalType":"enum ISeaport.Side","name":"side","type":"uint8"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"identifier","type":"uint256"},{"internalType":"bytes32[]","name":"criteriaProof","type":"bytes32[]"}],"internalType":"struct ISeaport.CriteriaResolver[]","name":"criteriaResolvers","type":"tuple[]"},{"components":[{"internalType":"address","name":"fillTo","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"}],"internalType":"struct BaseExchangeModule.OfferParams","name":"params","type":"tuple"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.Fee[]","name":"fees","type":"tuple[]"}],"name":"acceptERC721Offer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"offerer","type":"address"},{"internalType":"address","name":"zone","type":"address"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"}],"internalType":"struct ISeaport.OfferItem[]","name":"offer","type":"tuple[]"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"internalType":"struct ISeaport.ConsiderationItem[]","name":"consideration","type":"tuple[]"},{"internalType":"enum ISeaport.OrderType","name":"orderType","type":"uint8"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"bytes32","name":"zoneHash","type":"bytes32"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes32","name":"conduitKey","type":"bytes32"},{"internalType":"uint256","name":"totalOriginalConsiderationItems","type":"uint256"}],"internalType":"struct ISeaport.OrderParameters","name":"parameters","type":"tuple"},{"internalType":"uint120","name":"numerator","type":"uint120"},{"internalType":"uint120","name":"denominator","type":"uint120"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct ISeaport.AdvancedOrder","name":"order","type":"tuple"},{"components":[{"internalType":"address","name":"fillTo","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.ETHListingParams","name":"params","type":"tuple"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.Fee[]","name":"fees","type":"tuple[]"}],"name":"acceptETHListing","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"components":[{"components":[{"internalType":"address","name":"offerer","type":"address"},{"internalType":"address","name":"zone","type":"address"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"}],"internalType":"struct ISeaport.OfferItem[]","name":"offer","type":"tuple[]"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"internalType":"struct ISeaport.ConsiderationItem[]","name":"consideration","type":"tuple[]"},{"internalType":"enum ISeaport.OrderType","name":"orderType","type":"uint8"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"bytes32","name":"zoneHash","type":"bytes32"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes32","name":"conduitKey","type":"bytes32"},{"internalType":"uint256","name":"totalOriginalConsiderationItems","type":"uint256"}],"internalType":"struct ISeaport.OrderParameters","name":"parameters","type":"tuple"},{"internalType":"uint120","name":"numerator","type":"uint120"},{"internalType":"uint120","name":"denominator","type":"uint120"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct ISeaport.AdvancedOrder","name":"order","type":"tuple"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct SeaportV15Module.SeaportETHListingWithPrice[]","name":"orders","type":"tuple[]"},{"components":[{"internalType":"address","name":"fillTo","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.ETHListingParams","name":"params","type":"tuple"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.Fee[]","name":"fees","type":"tuple[]"}],"name":"acceptETHListings","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"targets","type":"address[]"},{"internalType":"bytes[]","name":"data","type":"bytes[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"makeCalls","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"offerer","type":"address"},{"internalType":"address","name":"zone","type":"address"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"}],"internalType":"struct ISeaport.OfferItem[]","name":"offer","type":"tuple[]"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"internalType":"struct ISeaport.ConsiderationItem[]","name":"consideration","type":"tuple[]"},{"internalType":"enum ISeaport.OrderType","name":"orderType","type":"uint8"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"bytes32","name":"zoneHash","type":"bytes32"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes32","name":"conduitKey","type":"bytes32"},{"internalType":"uint256","name":"totalOriginalConsiderationItems","type":"uint256"}],"internalType":"struct ISeaport.OrderParameters","name":"parameters","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct ISeaport.Order[]","name":"orders","type":"tuple[]"},{"components":[{"components":[{"internalType":"uint256","name":"orderIndex","type":"uint256"},{"internalType":"uint256","name":"itemIndex","type":"uint256"}],"internalType":"struct ISeaport.FulfillmentComponent[]","name":"offerComponents","type":"tuple[]"},{"components":[{"internalType":"uint256","name":"orderIndex","type":"uint256"},{"internalType":"uint256","name":"itemIndex","type":"uint256"}],"internalType":"struct ISeaport.FulfillmentComponent[]","name":"considerationComponents","type":"tuple[]"}],"internalType":"struct ISeaport.Fulfillment[]","name":"fulfillments","type":"tuple[]"}],"name":"matchOrders","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]