RMRKRoyalties
RMRK team
RMRKRoyalties
Smart contract of the RMRK Royalties module.
Methods
getRoyaltyPercentage
function getRoyaltyPercentage() external view returns (uint256 royaltyPercentageBps)Used to retrieve the specified royalty percentage.
Returns
| Name | Type | Description |
|---|---|---|
| royaltyPercentageBps | uint256 | The royalty percentage expressed in the basis points |
getRoyaltyRecipient
function getRoyaltyRecipient() external view returns (address recipient)Used to retrieve the recipient of royalties.
Returns
| Name | Type | Description |
|---|---|---|
| recipient | address | Address of the recipient of royalties |
royaltyInfo
function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount)Used to retrieve the information about who shall receive royalties of a sale of the specified token and how much they will be.
Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | ID of the token for which the royalty info is being retrieved |
| salePrice | uint256 | Price of the token sale |
Returns
| Name | Type | Description |
|---|---|---|
| receiver | address | The beneficiary receiving royalties of the sale |
| royaltyAmount | uint256 | The value of the royalties recieved by the receiver from the sale |
updateRoyaltyRecipient
function updateRoyaltyRecipient(address newRoyaltyRecipient) external nonpayableUsed to update recipient of royalties.
Custom access control has to be implemented to ensure that only the intended actors can update the beneficiary.
Parameters
| Name | Type | Description |
|---|---|---|
| newRoyaltyRecipient | address | Address of the new recipient of royalties |
Errors
RMRKRoyaltiesTooHigh
error RMRKRoyaltiesTooHigh()Attempting to set the royalties to a value higher than 100% (10000 in basis points)