Skip to content

feat: Add LB Payment Processor to Benchmarks #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 72 additions & 31 deletions src/BaseMarketConfig.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.7;

import { SetupCall, TestOrderPayload, TestOrderContext, TestCallParameters, TestItem20, TestItem721, TestItem1155 } from "./Types.sol";
import "./Types.sol";

abstract contract BaseMarketConfig {
/**
Expand Down Expand Up @@ -101,7 +101,6 @@ abstract contract BaseMarketConfig {
uint256 /* ethAmount */
)
external
view
virtual
returns (
TestOrderPayload memory /* execution */
Expand Down Expand Up @@ -194,7 +193,6 @@ abstract contract BaseMarketConfig {
TestItem20 calldata /* erc20 */
)
external
view
virtual
returns (
TestOrderPayload memory /* execution */
Expand Down Expand Up @@ -278,7 +276,6 @@ abstract contract BaseMarketConfig {
TestItem1155 calldata /* nft */
)
external
view
virtual
returns (
TestOrderPayload memory /* execution */
Expand Down Expand Up @@ -354,7 +351,6 @@ abstract contract BaseMarketConfig {
uint256 /* feeEthAmount */
)
external
view
virtual
returns (
TestOrderPayload memory /* execution */
Expand Down Expand Up @@ -386,7 +382,6 @@ abstract contract BaseMarketConfig {
uint256 /* feeEthAmount2 */
)
external
view
virtual
returns (
TestOrderPayload memory /* execution */
Expand Down Expand Up @@ -418,6 +413,67 @@ abstract contract BaseMarketConfig {
_notImplemented();
}

/**
* @dev Get call parameters to execute an order selling many 721 tokens for Ether.
* If `context.listOnChain` is true and marketplace does not support on-chain
* listing, this function must revert with NotImplemented.
* Each token is priced individually as royalties can exist per individual NFT
* and context is lost when pricing the entire bundle.
* @param context Order context, including the buyer and seller and whether the
* order should be listed on chain.
* @param nfts Array of Address and ID for ERC721 tokens to be sold.
* @param ethAmounts Array of Ether amounts to be received for each NFT.
*/
function getPayload_BuyOfferedManyERC721WithEtherItemsPricedIndividually(
TestOrderContext calldata context,
TestItem721[] calldata nfts,
uint256[] calldata ethAmounts
) external virtual returns (TestOrderPayload memory execution) {
_notImplemented();
}

/**
* @dev Get call parameters to execute an order selling many 721 tokens for Ether with one fee recipient.
* If `context.listOnChain` is true and marketplace does not support on-chain
* listing, this function must revert with NotImplemented.
* Each token is priced individually as royalties can exist per individual NFT
* and context is lost when pricing the entire bundle.
* @param args Struct containing the data needed to create the payload:
* args.context Order context, including the buyer and seller and whether the
* order should be listed on chain.
* args.nfts Array of Address and ID for ERC721 tokens to be sold.
* args.ethAmounts Array of Ether amounts to be received for each NFT.
* args.feeRecipient Address to send fee to.
* args.feeEthAmounts Amount of Ether to send for fee.
*/
function getPayload_BuyOfferedManyERC721WithEtherItemsPricedIndividuallyOneFeeRecipient(
TestBundleOrderWithSingleFeeReceiver memory args
) external virtual returns (TestOrderPayload memory execution) {
_notImplemented();
}

/**
* @dev Get call parameters to execute an order selling many 721 tokens for Ether with one fee recipient.
* If `context.listOnChain` is true and marketplace does not support on-chain
* listing, this function must revert with NotImplemented.
* Each token is priced individually as royalties can exist per individual NFT
* and context is lost when pricing the entire bundle.
* @param args Struct containing the data needed to create the payload:
* args.context Order context, including the buyer and seller and whether the
* order should be listed on chain.
* args.nfts Array of Address and ID for ERC721 tokens to be sold.
* args.ethAmounts Array of Ether amounts to be received for each NFT.
* args.feeRecipient1 Address to send fee 1 to.
* args.feeEthAmount1 Amount of Ether to send for fee 1.
* args.feeRecipient2 Address to send fee 2 to.
* args.feeEthAmount2 Amount of Ether to send for fee 2.
*/
function getPayload_BuyOfferedManyERC721WithEtherItemsPricedIndividuallyTwoFeeRecipients(
TestBundleOrderWithTwoFeeReceivers memory args
) external virtual returns (TestOrderPayload memory execution) {
_notImplemented();
}

/**
* @dev Get call parameters to execute an order "sweeping the floor" buy filling 10 distinct
* ERC-721->ETH orders at once. Same seller on each order. If the market does not support the
Expand All @@ -432,7 +488,6 @@ abstract contract BaseMarketConfig {
uint256[] calldata /* ethAmounts */
)
external
view
virtual
returns (
TestOrderPayload memory /* execution */
Expand All @@ -451,18 +506,11 @@ abstract contract BaseMarketConfig {
* @ param erc20Amounts Array of Erc20 amounts to be received for the NFTs in each order
*/
function getPayload_BuyOfferedManyERC721WithErc20DistinctOrders(
TestOrderContext[] calldata, /* contexts */
address, /* erc20Address */
TestItem721[] calldata, /* nfts */
uint256[] calldata /* erc20Amounts */
)
external
view
virtual
returns (
TestOrderPayload memory /* execution */
)
{
TestOrderContext[] calldata contexts,
address erc20Address,
TestItem721[] calldata nfts,
uint256[] calldata erc20Amounts
) external virtual returns (TestOrderPayload memory execution) {
_notImplemented();
}

Expand All @@ -476,18 +524,11 @@ abstract contract BaseMarketConfig {
* @ param erc20Amounts Array of WETH amounts to be received for the NFTs in each order
*/
function getPayload_BuyOfferedManyERC721WithWETHDistinctOrders(
TestOrderContext[] calldata, /* contexts */
address, /* erc20Address */
TestItem721[] calldata, /* nfts */
uint256[] calldata /* erc20Amounts */
)
external
view
virtual
returns (
TestOrderPayload memory /* execution */
)
{
TestOrderContext[] calldata contexts,
address erc20Address,
TestItem721[] calldata nfts,
uint256[] calldata erc20Amounts
) external virtual returns (TestOrderPayload memory execution) {
_notImplemented();
}

Expand Down
18 changes: 18 additions & 0 deletions src/Types.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,21 @@ struct TestOrderPayload {
// Call needed to actually execute the order
TestCallParameters executeOrder;
}

struct TestBundleOrderWithSingleFeeReceiver {
TestOrderContext context;
TestItem721[] nfts;
uint256[] itemPrices;
address feeRecipient;
uint256 feeRate;
}

struct TestBundleOrderWithTwoFeeReceivers {
TestOrderContext context;
TestItem721[] nfts;
uint256[] itemPrices;
address feeRecipient1;
uint256 feeRate1;
address feeRecipient2;
uint256 feeRate2;
}
Loading