메인 콘텐츠로 건너뛰기

StrategyCollectionOffer

This contract offers execution strategies for users to create maker bid offers for items in a collection. There are two available functions: 1. executeCollectionStrategyWithTakerAsk --> it applies to all itemIds in a collection 2. executeCollectionStrategyWithTakerAskWithProof --> it allows adding merkle proof criteria. The bidder can only bid on 1 item id at a time. 1. If ERC721, the amount must be 1. 2. If ERC1155, the amount can be greater than 1.

Use cases can include trait-based offers or rarity score offers.

executeCollectionStrategyWithTakerAsk

function executeCollectionStrategyWithTakerAsk(struct OrderStructs.Taker takerAsk, struct OrderStructs.Maker makerBid) external pure returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated)

This function validates the order under the context of the chosen strategy and returns the fulfillable items/amounts/price/nonce invalidation status. This strategy executes a collection offer against a taker ask order without the need of merkle proofs.

Parameters

NameTypeDescription
takerAskstruct OrderStructs.TakerTaker ask struct (taker ask-specific parameters for the execution)
makerBidstruct OrderStructs.MakerMaker bid struct (maker bid-specific parameters for the execution)

executeCollectionStrategyWithTakerAskWithProof

function executeCollectionStrategyWithTakerAskWithProof(struct OrderStructs.Taker takerAsk, struct OrderStructs.Maker makerBid) external pure returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated)

This function validates the order under the context of the chosen strategy and returns the fulfillable items/amounts/price/nonce invalidation status. This strategy executes a collection offer against a taker ask order with the need of a merkle proof.

The transaction reverts if the maker does not include a merkle root in the additionalParameters.

Parameters

NameTypeDescription
takerAskstruct OrderStructs.TakerTaker ask struct (taker ask-specific parameters for the execution)
makerBidstruct OrderStructs.MakerMaker bid struct (maker bid-specific parameters for the execution)

isMakerOrderValid

function isMakerOrderValid(struct OrderStructs.Maker makerBid, bytes4 functionSelector) external pure returns (bool isValid, bytes4 errorSelector)

Validate only the maker order under the context of the chosen strategy. It does not revert if the maker order is invalid. Instead it returns false and the error's 4 bytes selector.

Parameters

NameTypeDescription
makerBidstruct OrderStructs.Maker
functionSelectorbytes4Function selector for the strategy

Return Values

NameTypeDescription
isValidboolWhether the maker struct is valid
errorSelectorbytes4If isValid is false, it returns the error's 4 bytes selector