Skip to content

Commit b93171b

Browse files
committed
add overflow comment
1 parent d475d8e commit b93171b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

contracts/token/common/ERC2981/ERC2981Internal.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ abstract contract ERC2981Internal is IERC2981Internal {
2424
{
2525
uint256 royaltyBPS = _getRoyaltyBPS(tokenId);
2626
if (royaltyBPS > 10000) revert ERC2981Internal__RoyaltyExceedsMax();
27+
28+
// intermediate multiplication overflow is theoretically possible here, but
29+
// not an issue in practice because of practical constraints of salePrice
2730
return (_getRoyaltyReceiver(tokenId), (royaltyBPS * salePrice) / 10000);
2831
}
2932

0 commit comments

Comments
 (0)