@@ -71,13 +71,19 @@ contract DropERC1155 is
7171 /// @dev Mapping from token ID => maximum possible total circulating supply of tokens with that ID.
7272 mapping (uint256 => uint256 ) public maxTotalSupply;
7373
74+ /// @dev Mapping from token ID => the address of the recipient of primary sales.
75+ mapping (uint256 => address ) public saleRecipient;
76+
7477 /*///////////////////////////////////////////////////////////////
7578 Events
7679 //////////////////////////////////////////////////////////////*/
7780
7881 /// @dev Emitted when the global max supply of a token is updated.
7982 event MaxTotalSupplyUpdated (uint256 tokenId , uint256 maxTotalSupply );
8083
84+ /// @dev Emitted when the sale recipient for a particular tokenId is updated.
85+ event SaleRecipientForTokenUpdated (uint256 indexed tokenId , address saleRecipient );
86+
8187 /*///////////////////////////////////////////////////////////////
8288 Constructor + initializer logic
8389 //////////////////////////////////////////////////////////////*/
@@ -206,6 +212,12 @@ contract DropERC1155 is
206212 emit MaxTotalSupplyUpdated (_tokenId, _maxTotalSupply);
207213 }
208214
215+ /// @dev Lets a contract admin set the recipient for all primary sales.
216+ function setSaleRecipientForToken (uint256 _tokenId , address _saleRecipient ) external onlyRole (DEFAULT_ADMIN_ROLE) {
217+ saleRecipient[_tokenId] = _saleRecipient;
218+ emit SaleRecipientForTokenUpdated (_tokenId, _saleRecipient);
219+ }
220+
209221 /*///////////////////////////////////////////////////////////////
210222 Internal functions
211223 //////////////////////////////////////////////////////////////*/
@@ -231,6 +243,7 @@ contract DropERC1155 is
231243
232244 /// @dev Collects and distributes the primary sale value of NFTs being claimed.
233245 function collectPriceOnClaim (
246+ uint256 _tokenId ,
234247 address _primarySaleRecipient ,
235248 uint256 _quantityToClaim ,
236249 address _currency ,
@@ -242,7 +255,9 @@ contract DropERC1155 is
242255
243256 (address platformFeeRecipient , uint16 platformFeeBps ) = getPlatformFeeInfo ();
244257
245- address saleRecipient = _primarySaleRecipient == address (0 ) ? primarySaleRecipient () : _primarySaleRecipient;
258+ address _saleRecipient = _primarySaleRecipient == address (0 )
259+ ? (saleRecipient[_tokenId] == address (0 ) ? primarySaleRecipient () : saleRecipient[_tokenId])
260+ : _primarySaleRecipient;
246261
247262 uint256 totalPrice = _quantityToClaim * _pricePerToken;
248263 uint256 platformFees = (totalPrice * platformFeeBps) / MAX_BPS;
@@ -254,7 +269,7 @@ contract DropERC1155 is
254269 }
255270
256271 CurrencyTransferLib.transferCurrency (_currency, _msgSender (), platformFeeRecipient, platformFees);
257- CurrencyTransferLib.transferCurrency (_currency, _msgSender (), saleRecipient , totalPrice - platformFees);
272+ CurrencyTransferLib.transferCurrency (_currency, _msgSender (), _saleRecipient , totalPrice - platformFees);
258273 }
259274
260275 /// @dev Transfers the NFTs being claimed.
0 commit comments