File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -59,15 +59,18 @@ abstract contract ERC2981 is IERC2981, ERC165 {
59
59
* @inheritdoc IERC2981
60
60
*/
61
61
function royaltyInfo (uint256 tokenId , uint256 salePrice ) public view virtual returns (address , uint256 ) {
62
- RoyaltyInfo memory royalty = _tokenRoyaltyInfo[tokenId];
62
+ RoyaltyInfo storage _royaltyInfo = _tokenRoyaltyInfo[tokenId];
63
+ address royaltyReceiver = _royaltyInfo.receiver;
64
+ uint96 royaltyFraction = _royaltyInfo.royaltyFraction;
63
65
64
- if (royalty.receiver == address (0 )) {
65
- royalty = _defaultRoyaltyInfo;
66
+ if (royaltyReceiver == address (0 )) {
67
+ royaltyReceiver = _defaultRoyaltyInfo.receiver;
68
+ royaltyFraction = _defaultRoyaltyInfo.royaltyFraction;
66
69
}
67
70
68
- uint256 royaltyAmount = (salePrice * royalty. royaltyFraction) / _feeDenominator ();
71
+ uint256 royaltyAmount = (salePrice * royaltyFraction) / _feeDenominator ();
69
72
70
- return (royalty.receiver , royaltyAmount);
73
+ return (royaltyReceiver , royaltyAmount);
71
74
}
72
75
73
76
/**
You can’t perform that action at this time.
0 commit comments