Overview
3.0.0 (2024-11-19)
New Features
-
Support permissionless deployment of Payment Processor by any wallet on any EVM chain so it is freely deployable by the community.
-
Add Limit Break's deterministic, permissionlessly deployable Wrapped Native token as a default payment method.
-
Added Bulk Order Signing - listings and bids may be bulk signed. A bulk listing or bulk bid may include up to 1024 individual orders signed by the maker with a single signature.
-
Added Permit-C Integration - sellers may optionally list NFTs using Permit-C approvals vs of
approvalForAll. When accepting bids, the seller also has the option to sign a permit as part of the bid acceptance process or useapprovalForAll. This can increase asset security for collectors. -
Added ability for creators to specify royalty backfill as the primary source of royalties - this saves gas querying collections that do not implement 2981 royalties, and it allows collections that have an unused
royaltyInfoimplementation to collect royalties using the backfill instead. -
Added Creator Settings Lazy Loading - from V3.0.0 onwards, creators will no longer have to apply their settings to every new Payment Processor instance, as they will be loaded one-time automatically from a settings registry upon the first trade on each collection. Lists such as custom payment method whitelists, trusted channel lists, and token-level pricing bounds are loaded and cached locally on an as-needed basis.
-
Add Tstorish re-entrancy guard for gas-cost effective, more comprehensive reentrancy protections while allowing down stream payment composability. This allowed removal of native push payment gas limits and gas limit overrides and also allowed native refunds to be securely issued directly instead of wrapping refunds.
-
Add mutable protocol fee that can be adjusted up or down by permissioned
FEE_MANAGERrole, based on market conditions or to initiate a migration to future versions of Payment Processor. Protocol fee versioning system allows for fee version grace periods to ensure orders are not instantly invalidated and that exchange integrators have built-in time to integrate new versions. -
Unless otherwise adjusted after deployment, the protocol fees are initialized by default to 0.25% minimum protocol fee, 15% tax on exchange fees, and 25% tax on fee on top. When exchange fee tax is insufficient to cover the minimum, the shortfall is deducted from the seller's proceeds. When the exchange fee tax fully covers the minimum protocol fee, the seller's proceeds are unaffected.
-
Exchanges can stay current on protocol fees by subscribing to the new
ProtocolFeesUpdatedevent.
Interface Changes
-
Domain Separator has been removed from all trading function calldata. Instead, domain separator is looked up from a cached immutable variable, making trades more gas efficient. Marketplaces/exchanges should use the new v3.0.0
PaymentProcessorEncodercontract when generating calldata to ensure compatibility. -
Added a collection-level only Pricing Constraints payment type. This saves gas for collections that do not use token-level min/max floors.
-
Remove banned accounts feature - this is moving to the core Creator Token Standards in order to persist across marketplace versions.
-
Calldata format has changed for all trading functions - use the new v3.0.0
PaymentProcessorEncoderto ensure compatibility. -
Order digest for partial fills no longer includes the full EIP-712 type hash and domain separator. Instead, partially fillable ERC1155 orders are now tracked solely through the hash of the order data itself.
-
Replace
bool isCollectionLevelOrderfield in offers withuint256 offerTypefield, simplifying offer processing logic. -
Remove
bytes32 rootHashfield fromTokenSetProofstruct, as it is more gas efficient to simply compute therootHashduring proof verification than passing it in via calldata. -
Add
uint256 protocolFeeVersionfield to EIP-712 typed data hashes (SALE_APPROVAL_HASH,PERMITTED_TRANSFER_SALE_APPROVAL,PERMITTED_ORDER_SALE_APPROVAL, allBULK_SALE_APPROVALtype hashes). -
Add
uint256 protocolFeeVersionfield toOrderstruct. -
Cap item prices at type(uint240).max. This should not impact operations but allows more gas efficient math when computing payment splits.
-
Note: These breaking interface changes result in new trading function selectors and an update to calldata encoding, so use latest
PaymentProcessorEncoder.
Payment Processor Encoder - Modified Functions
encodeBuyListingCalldataencodeAcceptOfferCalldataencodeBulkBuyListingsCalldataencodeBulkAcceptOffersCalldataencodeSweepCollectionCalldata
Payment Processor Encoder - Added Functions
encodeBuyListingAdvancedCalldataencodeAcceptOfferAdvancedCalldataencodeBulkBuyListingsAdvancedCalldataencodeBulkAcceptOffersAdvancedCalldataencodeSweepCollectionAdvancedCalldata
Payment Processor Encoder - Removed Functions
encodeCreatePaymentMethodWhitelistCalldataencodeReassignOwnershipOfPaymentMethodWhitelistCalldataencodeRenounceOwnershipOfPaymentMethodWhitelistCalldataencodeWhitelistPaymentMethodCalldataencodeUnwhitelistPaymentMethodCalldataencodeSetCollectionPaymentSettingsCalldataencodeSetCollectionPricingBoundsCalldataencodeSetTokenPricingBoundsCalldataencodeAddTrustedChannelForCollectionCalldataencodeRemoveTrustedChannelForCollectionCalldataencodeAddBannedAccountForCollectionCalldataencodeRemoveBannedAccountForCollectionCalldata
EIP-712 Typehashes
The following type hashes were modified or added.
Modified Typehashes
// SALE_APPROVAL_HASH - Added protocol fee version field to be acknowledged by seller
// v2.0.1
// 0x938786a8256d04dc45d6d5b997005aa07c0c9e3e4925d0d6c33128d240096ebc
SaleApproval(uint8 protocol,address cosigner,address seller,address marketplace,address fallbackRoyaltyRecipient,address paymentMethod,address tokenAddress,uint256 tokenId,uint256 amount,uint256 itemPrice,uint256 expiration,uint256 marketplaceFeeNumerator,uint256 maxRoyaltyFeeNumerator,uint256 nonce,uint256 masterNonce)
// v3.0.0
// 0x36e5aab0dde52c07206863cf8fe7b4b1a25be63a3ae5286f8fe80d159c154c4f
SaleApproval(uint8 protocol,address cosigner,address seller,address marketplace,address fallbackRoyaltyRecipient,address paymentMethod,address tokenAddress,uint256 tokenId,uint256 amount,uint256 itemPrice,uint256 expiration,uint256 marketplaceFeeNumerator,uint256 maxRoyaltyFeeNumerator,uint256 nonce,uint256 masterNonce,uint256 protocolFeeVersion)
Added Typehashes
-
Added PermitC compliant sale approval typehashes. See docs for details.
-
Added bulk order typehashes to support signing up to 1024 orders with a single signature. Read docs for details.
Events
The following events were modified, added or removed.
Modified Events
// OrderDigestOpened - Changed `orderStartAmount` from uint248 to uint256
// v2.0.1
event OrderDigestOpened(
bytes32 indexed orderDigest,
address indexed account,
uint248 orderStartAmount);
// v3.0.0
event OrderDigestOpened(
bytes32 indexed orderDigest,
address indexed account,
uint256 orderStartAmount);
// OrderDigestItemsFilled - Changed `amountFilled` from uint248 to uint256
// v2.0.1
event OrderDigestItemsFilled(
bytes32 indexed orderDigest,
address indexed account,
uint248 amountFilled);
// v3.0.0
event OrderDigestItemsFilled(
bytes32 indexed orderDigest,
address indexed account,
uint256 amountFilled);
// OrderDigestItemsRestored - Changed `amountRestoredToOrder` from uint248 to uint256
// v2.0.1
event OrderDigestItemsRestored(
bytes32 indexed orderDigest,
address indexed account,
uint248 amountRestoredToOrder);
// v3.0.0
event OrderDigestItemsRestored(
bytes32 indexed orderDigest,
address indexed account,
uint256 amountRestoredToOrder);
// OrderDigestItemsRestored - Replaced `blockBannedAccounts` with `useRoyaltyBackfillAsRoyaltySource`
// v2.0.1
event UpdatedCollectionPaymentSettings(
address indexed tokenAddress,
PaymentSettings paymentSettings,
uint32 indexed paymentMethodWhitelistId,
address indexed constrainedPricingPaymentMethod,
uint16 royaltyBackfillNumerator,
address royaltyBackfillReceiver,
uint16 royaltyBountyNumerator,
address exclusiveBountyReceiver,
bool blockTradesFromUntrustedChannels,
bool blockBannedAccounts);
// v3.0.0
event UpdatedCollectionPaymentSettings(
address indexed tokenAddress,
PaymentSettings paymentSettings,
uint32 indexed paymentMethodWhitelistId,
address indexed constrainedPricingPaymentMethod,
uint16 royaltyBackfillNumerator,
address royaltyBackfillReceiver,
uint16 royaltyBountyNumerator,
address exclusiveBountyReceiver,
bool blockTradesFromUntrustedChannels,
bool useRoyaltyBackfillAsRoyaltySource);
Added Events
event PermittedOrderNonceInvalidated(
uint256 indexed permitNonce,
uint256 indexed orderNonce,
address indexed account,
bool wasCancellation);
event ProtocolFeesUpdated(
address indexed newProtocolFeeRecipient,
uint16 minimumProtocolFeeBps,
uint16 marketplaceFeeProtocolTaxBps,
uint16 feeOnTopProtocolTaxBps,
uint48 gracePeriodExpiration);
event TrustedPermitProcessorAdded(address indexed permitProcessor);
event TrustedPermitProcessorRemoved(address indexed permitProcessor);
Removed Events
event BannedAccountAddedForCollection(
address indexed tokenAddress,
address indexed account);
event BannedAccountRemovedForCollection(
address indexed tokenAddress,
address indexed account);
Bug Fixes
-
Fix burning of order nonce/partial fill order digest when NFT transfer fails.
-
Fix edge case caused by fallback functions.
Gas Optimizations
-
Removed domain separator from calldata and used cached immutable domain separator instead.
-
Replace OpenZeppelin SafeERC20 library with new Limit Break ERC20 transfer library.
-
Refactor payments for fee on top to optimize payout flow for protocol fees.
-
Limit item price to
type(uint240).maxto allow for unchecked math in payment split computation. -
Change diamond storage slot from the hash of a string value to
0x9A1D. -
Allow malleable signatures since order replay is prevented by order hash.
-
Replace standard ABI encoding/hashing with new Limit Break Efficient Hash library.
-
Remove token set proof root hash from calldata, calculate based on item + proof and validate with offer signature.
-
Change optimization runs from 30,000 to 40,000.
-
Other various gas optimizations for trading flows.
