Payment Settings
The simplest way to manage your collection's payment settings is through developers.freenft.com.
For creators that would like to build their own integrations for managing collection payment settings - the sections below describe the functions and parameters that Payment Processor uses to apply rules to collection orders.
Payment Settings Functions
createPaymentMethodWhitelist
Callable by any account to create a new payment method whitelist. The whitelist will be owned by the address that calls the function.
Note: Due to contract size limitations and for gas efficiency the createPaymentMethodWhitelist function on Payment Processor must be called with a single calldata byte array that contains what would be the msg.data for the below function. See Encoding Details for more information.
function createPaymentMethodWhitelist(
string calldata whitelistName
) external returns (uint32 paymentMethodWhitelistId);
reassignOwnershipOfPaymentMethodWhitelist
Callable by the owner of the whitelist to assign ownership of the whitelist to a new account.
Note: Due to contract size limitations and for gas efficiency the reassignOwnershipOfPaymentMethodWhitelist function on Payment Processor must be called with a single calldata byte array that contains what would be the msg.data for the below function. See Encoding Details for more information.
function reassignOwnershipOfPaymentMethodWhitelist(
uint32 id,
address newOwner
) external;
renounceOwnershipOfPaymentMethodWhitelist
Callable by the owner of the whitelist to renounce ownership of the whitelist. Whitelists with the owner renounced can not be modified.
Note: Due to contract size limitations and for gas efficiency the renounceOwnershipOfPaymentMethodWhitelist function on Payment Processor must be called with a single calldata byte array that contains what would be the msg.data for the below function. See Encoding Details for more information.
function renounceOwnershipOfPaymentMethodWhitelist(uint32 id) external;
whitelistPaymentMethod
Callable by the owner of the whitelist to add a new payment method.
Note: Due to contract size limitations and for gas efficiency the whitelistPaymentMethod function on Payment Processor must be called with a single calldata byte array that contains what would be the msg.data for the below function. See Encoding Details for more information.
function whitelistPaymentMethod(
uint32 paymentMethodWhitelistId,
address paymentMethod
) external;
unwhitelistPaymentMethod
Callable by the owner of the whitelist to remove a payment method.
Note: Due to contract size limitations and for gas efficiency the unwhitelistPaymentMethod function on Payment Processor must be called with a single calldata byte array that contains what would be the msg.data for the below function. See Encoding Details for more information.
function unwhitelistPaymentMethod(
uint32 paymentMethodWhitelistId,
address paymentMethod
) external;
setCollectionPaymentSettings
Callable by the token contract, the owner of the token contract or any account assigned the default admin role for the token contract. This function will configure the payment settings rules to apply to all orders executed on Payment Processor.
tokenAddress: Contract address the payment settings are being set for.paymentSettings: Value from the PaymentSettings enum that defines the type of rules to apply to orders. Creators may pause trading on their collection by setting this value toPaused.paymentMethodWhitelistId: Id for a whitelist that was created with createPaymentMethodWhitelist. This is only used whenpaymentSettingsis set toCustomPaymentMethodWhitelist.constrainedPricingPaymentMethod: ERC20 token address for the payment method to use whenpaymentSettingsis set toPricingConstraints.royaltyBackfillNumerator: Royalty percentage to apply to a sale for a collection that does not utilize ERC2981 for on-chain royalties. Denominated in BPS (ex. value of 250 is 2.5% royalty, value of 1,000 is 10% royalty) with a maximum allowed value of 10,000.royaltyBackfillReceiver: Recipient of royalty payments for a collection that does not utilize ERC2981 for on-chain royalties.royaltyBountyNumerator: Percentage of the royalty amount to pay to the marketplace as a reward. Denominated in BPS (ex. value of 2,500 is 25% of the royalty amount, value of 5,000 is 50% of the royalty amount) with a maximum allowed value of 10,000.exclusiveBountyReceiver: Restricts royalty bounty payments to a single marketplace set by this parameter. If exclusiveBountyReceiver is set toaddress(0)any marketplace can receive royalty bounties for the collection.blockTradesFromUntrustedChannels: Boolean flag that when set to true will require order taker transactions to route through a Trusted Forwarder that has been approved for the collection using the addTrustedChannelForCollection function.blockBannedAccounts: Boolean flag that when set to true will block accounts that are banned by the collection owner from being the maker or taker on an order.
Note: Due to contract size limitations and for gas efficiency the setCollectionPaymentSettings function on Payment Processor must be called with a single calldata byte array that contains what would be the msg.data for the below function. See Encoding Details for more information.
function setCollectionPaymentSettings(
address tokenAddress,
PaymentSettings paymentSettings,
uint32 paymentMethodWhitelistId,
address constrainedPricingPaymentMethod,
uint16 royaltyBackfillNumerator,
address royaltyBackfillReceiver,
uint16 royaltyBountyNumerator,
address exclusiveBountyReceiver,
bool blockTradesFromUntrustedChannels,
bool blockBannedAccounts
) external;
setCollectionPricingBounds
Callable by the token contract, the owner of the token contract or any account assigned the default
admin role for the token contract. This function sets the floor and ceiling price for a collection
that is applied when the collection's PaymentSettings is set to PricingConstraints. Token pricing
bounds set in setTokenPricingBounds take precedence over collection bounds.
See PricingBounds for struct details.
Note: Due to contract size limitations and for gas efficiency the setCollectionPricingBounds function on Payment Processor must be called with a single calldata byte array that contains what would be the msg.data for the below function. See Encoding Details for more information.
function setCollectionPricingBounds(
address tokenAddress,
PricingBounds calldata pricingBounds
) external;
setTokenPricingBounds
Callable by the token contract, the owner of the token contract or any account assigned the default
admin role for the token contract. This function sets the floor and ceiling price for specific tokens
in the collection that are applied when the collection's PaymentSettings is set to PricingConstraints.
Token pricing bounds take precedence over collection bounds that are set in setCollectionPricingBounds.
See PricingBounds for struct details.
Note: Due to contract size limitations and for gas efficiency the setTokenPricingBounds function on Payment Processor must be called with a single calldata byte array that contains what would be the msg.data for the below function. See Encoding Details for more information.
function setTokenPricingBounds(
address tokenAddress,
uint256[] calldata tokenIds,
PricingBounds[] calldata pricingBounds
) external;
addTrustedChannelForCollection
Callable by the token contract, the owner of the token contract or any account assigned the default
admin role for the token contract. This function approves a channel to be allowed to execute
orders for the collection when blockTradesFromUntrustedChannels is set to true in
setCollectionPaymentSettings.
See Trusted Forwarder for more information on channels.
Note: Due to contract size limitations and for gas efficiency the addTrustedChannelForCollection function on Payment Processor must be called with a single calldata byte array that contains what would be the msg.data for the below function. See Encoding Details for more information.
function addTrustedChannelForCollection(
address tokenAddress,
address channel
) external;
removeTrustedChannelForCollection
Callable by the token contract, the owner of the token contract or any account assigned the default
admin role for the token contract. This function removes a channel's approval to execute
orders for the collection when blockTradesFromUntrustedChannels is set to true in
setCollectionPaymentSettings.
See Trusted Forwarder for more information on channels.
Note: Due to contract size limitations and for gas efficiency the removeTrustedChannelForCollection function on Payment Processor must be called with a single calldata byte array that contains what would be the msg.data for the below function. See Encoding Details for more information.
function removeTrustedChannelForCollection(
address tokenAddress,
address channel
) external;
addBannedAccountForCollection
Callable by the token contract, the owner of the token contract or any account assigned the default
admin role for the token contract. This function bans an account from being the maker or taker for an
order for the collection when blockBannedAccounts is set to true in
setCollectionPaymentSettings.
Note: Due to contract size limitations and for gas efficiency the addBannedAccountForCollection function on Payment Processor must be called with a single calldata byte array that contains what would be the msg.data for the below function. See Encoding Details for more information.
function addBannedAccountForCollection(
address tokenAddress,
address account
) external;
removeBannedAccountForCollection
Callable by the token contract, the owner of the token contract or any account assigned the default
admin role for the token contract. This function lifts a ban for an account allowing the account
to be the maker or taker for an order for the collection when blockBannedAccounts is set to true in
setCollectionPaymentSettings.
Note: Due to contract size limitations and for gas efficiency the removeBannedAccountForCollection function on Payment Processor must be called with a single calldata byte array that contains what would be the msg.data for the below function. See Encoding Details for more information.
function removeBannedAccountForCollection(
address tokenAddress,
address account
) external;
Data Structures
PricingBounds
| isSet | floorPrice | ceilingPrice |
|---|---|---|
| bool | uint120 | uint120 |
- isSet: Boolean true/false flag to indicate the pricing bounds have been set. Distinguishes set zero-value bounds from unset bounds that have default values of zero in the storage slot.
- floorPrice: Minimum value to accept for a sales price without rejecting the sale.
- ceilingPrice: Maximum value to accept for a sales price without rejecting the sale.
struct PricingBounds {
bool isSet;
uint120 floorPrice;
uint120 ceilingPrice;
}
Enums
PaymentSettings
DefaultPaymentMethodWhitelistutilizes Payment Processor's default list which includes native token (ex ETH on Ethereum, MATIC on Polygon), wrapped native token, wrapped ETH (if native token is not ETH), and USDC.AllowAnyPaymentMethodallows any payment method (native token or ERC20) for orders.CustomPaymentMethodWhitelistrequires the payment method to be one on the whitelist specified in thepaymentMethodWhitelistIdparameterPricingConstraintsrestricts payments to a single ERC20 specified in theconstrainedPricingPaymentMethodparameter and enforces sales price is within the pricing bounds specified for a token or the collection (if bounds are not defined for the specific token). Bounds are set with the setCollectionPricingBounds and setTokenPricingBounds functions.Pauseddisables all trading on the collection. f
enum PaymentSettings {
DefaultPaymentMethodWhitelist,
AllowAnyPaymentMethod,
CustomPaymentMethodWhitelist,
PricingConstraints,
Paused
}
