IRoyalty
Thirdweb's Royalty
is a contract extension to be used with any base contract. It exposes functions for setting and reading the recipient of royalty fee and the royalty fee basis points, and lets the inheriting contract perform conditional logic that uses information about royalty fees, if desired. The Royalty
contract is ERC2981 compliant.
Methods
getDefaultRoyaltyInfo
Returns the royalty recipient and fee bps.
Returns
_0
address
undefined
_1
uint16
undefined
getRoyaltyInfoForToken
Returns the royalty recipient for a particular token Id.
Parameters
tokenId
uint256
undefined
Returns
_0
address
undefined
_1
uint16
undefined
royaltyInfo
Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of exchange. The royalty amount is denominated and should be payed in that same unit of exchange.
Parameters
tokenId
uint256
undefined
salePrice
uint256
undefined
Returns
receiver
address
undefined
royaltyAmount
uint256
undefined
setDefaultRoyaltyInfo
Lets a module admin update the royalty bps and recipient.
Parameters
_royaltyRecipient
address
undefined
_royaltyBps
uint256
undefined
setRoyaltyInfoForToken
Lets a module admin set the royalty recipient for a particular token Id.
Parameters
tokenId
uint256
undefined
recipient
address
undefined
bps
uint256
undefined
supportsInterface
Returns true if this contract implements the interface defined by interfaceId
. See the corresponding EIP section to learn more about how these ids are created. This function call must use less than 30 000 gas.
Parameters
interfaceId
bytes4
undefined
Returns
_0
bool
undefined
Events
DefaultRoyalty
Emitted when royalty info is updated.
Parameters
newRoyaltyRecipient indexed
address
undefined
newRoyaltyBps
uint256
undefined
RoyaltyForToken
Emitted when royalty recipient for tokenId is set
Parameters
tokenId indexed
uint256
undefined
royaltyRecipient indexed
address
undefined
royaltyBps
uint256
undefined
Last updated