diff --git a/contracts/drop/DropERC1155.sol b/contracts/drop/DropERC1155.sol index f5fbefabd..4038104d8 100644 --- a/contracts/drop/DropERC1155.sol +++ b/contracts/drop/DropERC1155.sol @@ -597,6 +597,12 @@ contract DropERC1155 is emit PrimarySaleRecipientUpdated(_saleRecipient); } + /// @dev Lets a contract admin set the recipient for all primary sales. + function setSaleRecipientForToken(uint256 _tokenId, address _saleRecipient) external onlyRole(DEFAULT_ADMIN_ROLE) { + saleRecipient[_tokenId] = _saleRecipient; + emit SaleRecipientForTokenUpdated(_tokenId, _saleRecipient); + } + /// @dev Lets a contract admin update the default royalty recipient and bps. function setDefaultRoyaltyInfo(address _royaltyRecipient, uint256 _royaltyBps) external diff --git a/contracts/drop/DropERC20.sol b/contracts/drop/DropERC20.sol index 7e6359121..ac759c2e5 100644 --- a/contracts/drop/DropERC20.sol +++ b/contracts/drop/DropERC20.sol @@ -321,7 +321,16 @@ contract DropERC20 is } CurrencyTransferLib.transferCurrency(_currency, _msgSender(), platformFeeRecipient, platformFees); +<<<<<<< HEAD CurrencyTransferLib.transferCurrency(_currency, _msgSender(), primarySaleRecipient, totalPrice - platformFees); +======= + CurrencyTransferLib.transferCurrency( + _currency, + _msgSender(), + primarySaleRecipient, + totalPrice - platformFees + ); +>>>>>>> b00169bb4f25ccd10ebe36429d714cc5f919af63 } /// @dev Transfers the tokens being claimed. diff --git a/contracts/drop/DropERC721.sol b/contracts/drop/DropERC721.sol index a79f55473..c662f9643 100644 --- a/contracts/drop/DropERC721.sol +++ b/contracts/drop/DropERC721.sol @@ -461,7 +461,16 @@ contract DropERC721 is } CurrencyTransferLib.transferCurrency(_currency, _msgSender(), platformFeeRecipient, platformFees); +<<<<<<< HEAD CurrencyTransferLib.transferCurrency(_currency, _msgSender(), primarySaleRecipient, totalPrice - platformFees); +======= + CurrencyTransferLib.transferCurrency( + _currency, + _msgSender(), + primarySaleRecipient, + totalPrice - platformFees + ); +>>>>>>> b00169bb4f25ccd10ebe36429d714cc5f919af63 } /// @dev Transfers the NFTs being claimed. diff --git a/contracts/interfaces/drop/IDropERC1155.sol b/contracts/interfaces/drop/IDropERC1155.sol index 3f30dff71..bbd443d56 100644 --- a/contracts/interfaces/drop/IDropERC1155.sol +++ b/contracts/interfaces/drop/IDropERC1155.sol @@ -46,6 +46,9 @@ interface IDropERC1155 is IERC1155Upgradeable, IDropClaimCondition { /// @dev Emitted when the max wallet claim count for a given tokenId is updated. event MaxWalletClaimCountUpdated(uint256 tokenId, uint256 count); + /// @dev Emitted when the sale recipient for a particular tokenId is updated. + event SaleRecipientForTokenUpdated(uint256 indexed tokenId, address saleRecipient); + /** * @notice Lets an account with `MINTER_ROLE` lazy mint 'n' NFTs. * The URIs for each token is the provided `_baseURIForTokens` + `{tokenId}`. diff --git a/docs/DropERC1155.md b/docs/DropERC1155.md index ff2b2d5fa..a7edece62 100644 --- a/docs/DropERC1155.md +++ b/docs/DropERC1155.md @@ -951,6 +951,23 @@ function setRoyaltyInfoForToken(uint256 _tokenId, address _recipient, uint256 _b | _recipient | address | undefined | _bps | uint256 | undefined +### setSaleRecipientForToken + +```solidity +function setSaleRecipientForToken(uint256 _tokenId, address _saleRecipient) external nonpayable +``` + + + +*Lets a contract admin set the recipient for all primary sales.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _tokenId | uint256 | undefined +| _saleRecipient | address | undefined + ### setWalletClaimCount ```solidity @@ -1337,6 +1354,23 @@ event RoyaltyForToken(uint256 indexed tokenId, address royaltyRecipient, uint256 | royaltyRecipient | address | undefined | | royaltyBps | uint256 | undefined | +### SaleRecipientForTokenUpdated + +```solidity +event SaleRecipientForTokenUpdated(uint256 indexed tokenId, address saleRecipient) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| tokenId `indexed` | uint256 | undefined | +| saleRecipient | address | undefined | + ### TokensClaimed ```solidity diff --git a/docs/IDropERC1155.md b/docs/IDropERC1155.md index e3fbe1642..0d19f09f4 100644 --- a/docs/IDropERC1155.md +++ b/docs/IDropERC1155.md @@ -288,6 +288,23 @@ event MaxWalletClaimCountUpdated(uint256 tokenId, uint256 count) | tokenId | uint256 | undefined | | count | uint256 | undefined | +### SaleRecipientForTokenUpdated + +```solidity +event SaleRecipientForTokenUpdated(uint256 indexed tokenId, address saleRecipient) +``` + + + +*Emitted when the sale recipient for a particular tokenId is updated.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| tokenId `indexed` | uint256 | undefined | +| saleRecipient | address | undefined | + ### TokensClaimed ```solidity diff --git a/src/test/drop/DropERC721.t.sol b/src/test/drop/DropERC721.t.sol index ef6b85dfc..13529eaf5 100644 --- a/src/test/drop/DropERC721.t.sol +++ b/src/test/drop/DropERC721.t.sol @@ -10,6 +10,7 @@ import "../utils/BaseTest.sol"; contract SubExploitContract is ERC721Holder, ERC1155Holder { DropERC721 internal drop; address payable internal master; + // using Strings for uint256; // using Strings for uint256;