You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The royalty recipient IDs are 1-based in the Boson Protocol system, however, they are expected to be passed in as 0-based in the SellerHandlerFacet::updateRoyaltyRecipients function.
Example:
function updateRoyaltyRecipients(
uint256_sellerId,
uint256[] calldata_royaltyRecipientIds,
RoyaltyRecipient[] calldata_royaltyRecipients
) external sellersNotPaused nonReentrant {
// Cache protocol lookups and sender for reference
ProtocolLib.ProtocolLookups storage lookups =protocolLookups();
// Make sure admin is the caller and get the selleraddress treasury;
{
(Seller storageseller, ) =validateAdminStatus(lookups, _sellerId);
treasury = seller.treasury;
}
if (_royaltyRecipientIds.length!= _royaltyRecipients.length) revertArrayLengthMismatch();
RoyaltyRecipient[] storage royaltyRecipients = lookups.royaltyRecipientsBySeller[_sellerId];
// uint256 royaltyRecipientIdsLength = _royaltyRecipientIds.length; // TODO can be optimized?uint256 royaltyRecipientsLength = royaltyRecipients.length;
for (uint256 i =0; i < _royaltyRecipientIds.length; ) {
uint256 royaltyRecipientId = _royaltyRecipientIds[i];
if (royaltyRecipientId >= royaltyRecipientsLength) revertInvalidRoyaltyRecipientId();
Recommendation:
Given that the current implementation is efficient, we advise proper documentation to be introduced to the SellerHandlerFacet::updateRoyaltyRecipients function indicating that the IDs are meant to be passed in as 0-based.
The text was updated successfully, but these errors were encountered:
SHF-02C: Non-Uniform Royalty Recipient ID Definition
Description:
The royalty recipient IDs are 1-based in the Boson Protocol system, however, they are expected to be passed in as 0-based in the
SellerHandlerFacet::updateRoyaltyRecipients
function.Example:
Recommendation:
Given that the current implementation is efficient, we advise proper documentation to be introduced to the
SellerHandlerFacet::updateRoyaltyRecipients
function indicating that the IDs are meant to be passed in as 0-based.The text was updated successfully, but these errors were encountered: