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

Name
Type
Description

_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

Name
Type
Description

tokenId

uint256

undefined

Returns

Name
Type
Description

_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

Name
Type
Description

tokenId

uint256

undefined

salePrice

uint256

undefined

Returns

Name
Type
Description

receiver

address

undefined

royaltyAmount

uint256

undefined

setDefaultRoyaltyInfo

Lets a module admin update the royalty bps and recipient.

Parameters

Name
Type
Description

_royaltyRecipient

address

undefined

_royaltyBps

uint256

undefined

setRoyaltyInfoForToken

Lets a module admin set the royalty recipient for a particular token Id.

Parameters

Name
Type
Description

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

Name
Type
Description

interfaceId

bytes4

undefined

Returns

Name
Type
Description

_0

bool

undefined

Events

DefaultRoyalty

Emitted when royalty info is updated.

Parameters

Name
Type
Description

newRoyaltyRecipient indexed

address

undefined

newRoyaltyBps

uint256

undefined

RoyaltyForToken

Emitted when royalty recipient for tokenId is set

Parameters

Name
Type
Description

tokenId indexed

uint256

undefined

royaltyRecipient indexed

address

undefined

royaltyBps

uint256

undefined

Last updated