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
function getDefaultRoyaltyInfo() external view returns (address, uint16)
Returns the royalty recipient and fee bps.
Returns
_0
address
undefined
_1
uint16
undefined
getRoyaltyInfoForToken
function getRoyaltyInfoForToken(uint256 tokenId) external view returns (address, uint16)
Returns the royalty recipient for a particular token Id.
Parameters
tokenId
uint256
undefined
Returns
_0
address
undefined
_1
uint16
undefined
royaltyInfo
function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount)
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
function setDefaultRoyaltyInfo(address _royaltyRecipient, uint256 _royaltyBps) external nonpayable
Lets a module admin update the royalty bps and recipient.
Parameters
_royaltyRecipient
address
undefined
_royaltyBps
uint256
undefined
setRoyaltyInfoForToken
function setRoyaltyInfoForToken(uint256 tokenId, address recipient, uint256 bps) external nonpayable
Lets a module admin set the royalty recipient for a particular token Id.
Parameters
tokenId
uint256
undefined
recipient
address
undefined
bps
uint256
undefined
supportsInterface
function supportsInterface(bytes4 interfaceId) external view returns (bool)
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
event DefaultRoyalty(address indexed newRoyaltyRecipient, uint256 newRoyaltyBps)
Emitted when royalty info is updated.
Parameters
newRoyaltyRecipient indexed
address
undefined
newRoyaltyBps
uint256
undefined
RoyaltyForToken
event RoyaltyForToken(uint256 indexed tokenId, address indexed royaltyRecipient, uint256 royaltyBps)
Emitted when royalty recipient for tokenId is set
Parameters
tokenId indexed
uint256
undefined
royaltyRecipient indexed
address
undefined
royaltyBps
uint256
undefined
Last updated