Skip to main content

Fee Provider

Fee provider tracks primary sales and calculates fees accordingly.

Methods

getMakerFee

function getMakerFee(address seller, address nftContract, uint256 tokenId) public view returns (uint256)

Method returns fee % for maker orders

Parameters

NameTypeDescription
selleraddressaddress of the seller account
nftContractaddressaddress of the nft collection
tokenIduint256token id for which we want to get maker fee

Returns

TypeDescription
uint256fee %, divide it by 100 to get actual (ex 1000 = 10%)

getTakerFee

function getTakerFee(address buyer) public view returns (uint256)

Method returns fee % for taker orders

Parameters

NameTypeDescription
buyeraddressaddress of the seller account

Returns

TypeDescription
uint256fee %, divide it by 100 to get actual (ex 1000 = 10%)

updateFee

function updateFee(uint256 secondarySaleMakerFee, uint256 takerFee, uint256 initialSaleFee, uint256 masterNftCut) external onlyOwner

Updates base fees, called by the fee provider contract owner.

Parameters

NameTypeDescription
secondarySaleMakerFeeuint256maker fee % for secondary sales (ex 1000 = 10%)
takerFeeuint256taker fee % (ex 1000 = 10%)
initialSaleFeeuint256primary sale fee % (ex 1000 = 10%)
masterNftCutuint256fee percentage left for master key holders

updateFee

function setInitialSaleFeePerAccount(address account, uint256 fee) external onlyOwner

Updates primary sale fee for account, called by the fee provider contract owner.

Parameters

NameTypeDescription
accountaddressaccount to change fee for
feeuint256primary sale fee % for an account (ex 1000 = 10%)

setCollectionWithoutInitialSaleFee

function setCollectionWithoutInitialSaleFee(address nftContract, bool isWithoutInitialFee) external onlyOwner

Toggles primary sale fee for a collection, called by the fee provider contract owner.

Parameters

NameTypeDescription
nftContractaddressaccount of collection to toggle primary sale fee
isWithoutInitialFeebooltrue if collection should not have primary sale fee

onInitialSale

function onInitialSale(address nftContract, uint256 tokenId) external

Triggers on primary sale for token, callable by sale contracts approved by the contract registry.

Parameters

NameTypeDescription
nftContractaddressaddress of the nft collection
tokenIduint256token id for which the primary sale happened