Skip to content

Commit

Permalink
Update RoyaltiesRegistry.sol
Browse files Browse the repository at this point in the history
pass in tokenId for other implementations of IRoyaltiesProvider.  Currently only allows external implementations of IRoyaltiesProvider to support a default royalty (specified as tokenId 0, which may also conflict with actual token identifiers).
  • Loading branch information
wwhchung authored Jun 6, 2021
1 parent 32985c0 commit 5094e67
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions royalties-registry/contracts/RoyaltiesRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ contract RoyaltiesRegistry is IRoyaltiesProvider, OwnableUpgradeable {
if (royaltiesSet.initialized) {
return royaltiesSet.royalties;
}
(bool result, LibPart.Part[] memory resultRoyalties) = providerExtractor(token);
(bool result, LibPart.Part[] memory resultRoyalties) = providerExtractor(token, tokenId);
if (result == false) {
resultRoyalties = royaltiesFromContract(token, tokenId);
}
Expand Down Expand Up @@ -117,11 +117,11 @@ contract RoyaltiesRegistry is IRoyaltiesProvider, OwnableUpgradeable {
return feesRecipients;
}

function providerExtractor(address token) internal returns (bool result, LibPart.Part[] memory royalties) {
function providerExtractor(address token, uint tokenId) internal returns (bool result, LibPart.Part[] memory royalties) {
address provider = royaltiesProviders[token];
if (provider != address(0x0)) {
IRoyaltiesProvider withRoyalties = IRoyaltiesProvider(provider);
try withRoyalties.getRoyalties(token, 0x0) returns (LibPart.Part[] memory royaltiesByProvider) {
try withRoyalties.getRoyalties(token, tokenId) returns (LibPart.Part[] memory royaltiesByProvider) {
royalties = royaltiesByProvider;
result = true;
} catch { }
Expand Down

0 comments on commit 5094e67

Please sign in to comment.