Skip to content

Add support for RoyaltyRegistry / RoyaltyEngine #418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Jul 7, 2023

Conversation

kumaryash90
Copy link
Member

No description provided.

@kumaryash90 kumaryash90 marked this pull request as draft July 3, 2023 15:36
// Payout royalties
{
// Get royalty recipients and amounts
(address payable[] memory recipients, uint256[] memory amounts) = RoyaltyPaymentsLogic(address(this))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use the general/widespread recognizable IRoyaltyEngineV1 interface to make the call, instead of our own custom RoyaltyPaymentsLogic

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code in getRoyalty of RoyaltyPaymentsLogic handles the case when royalty-engine is not present on some network (needed for any evm).
Hence, I guess using IRoyaltyEngine interface to make the call will be confusing to read, since we're not directly calling the engine, and marketplace-contract is not an engine either.

// Payout royalties
{
// Get royalty recipients and amounts
(address payable[] memory recipients, uint256[] memory amounts) = RoyaltyPaymentsLogic(address(this))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, let's use IRoyaltyEngineV1 instead of RoyaltyPaymentsLogic

// Payout royalties
{
// Get royalty recipients and amounts
(address payable[] memory recipients, uint256[] memory amounts) = RoyaltyPaymentsLogic(address(this))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, let's use IRoyaltyEngineV1 instead of RoyaltyPaymentsLogic

// Payout royalties
{
// Get royalty recipients and amounts
(address payable[] memory recipients, uint256[] memory amounts) = RoyaltyPaymentsLogic(address(this))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we call the external function getRoyalty instead of the view function getRoyaltyView?

I see that the IRoyaltyEngineV1 has both functions in there. What's the difference in usage?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getRoyalty saves the spec of a token's royalty setup in a cache, if not present. (For e.g., whether using ERC-2981, or any other).
Further calls to this function will be same as getRoyaltyView.

@nkrishang nkrishang marked this pull request as ready for review July 7, 2023 17:58
@nkrishang nkrishang merged commit bb651ad into main Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants