diff --git a/packages/1155-contracts/src/delegation/ZoraCreator1155PremintExecutorImpl.sol b/packages/1155-contracts/src/delegation/ZoraCreator1155PremintExecutorImpl.sol index d739f2cd4..f7dd19b3d 100644 --- a/packages/1155-contracts/src/delegation/ZoraCreator1155PremintExecutorImpl.sol +++ b/packages/1155-contracts/src/delegation/ZoraCreator1155PremintExecutorImpl.sol @@ -17,7 +17,7 @@ import {PremintEncoding, ZoraCreator1155Attribution, ContractCreationConfig, Pre import {IZoraCreator1155PremintExecutor} from "../interfaces/IZoraCreator1155PremintExecutor.sol"; struct MintArguments { - // which account should receive the tokens minted. If set to address(0), then defaults to the msg.sender + // which account should receive the tokens minted. address mintRecipient; // comment to add to the mint string mintComment; diff --git a/packages/1155-contracts/src/interfaces/IZoraCreator1155Errors.sol b/packages/1155-contracts/src/interfaces/IZoraCreator1155Errors.sol index 36e1ced50..26723d60a 100644 --- a/packages/1155-contracts/src/interfaces/IZoraCreator1155Errors.sol +++ b/packages/1155-contracts/src/interfaces/IZoraCreator1155Errors.sol @@ -36,4 +36,6 @@ interface IZoraCreator1155Errors is ICreatorRoyaltyErrors, ILimitedMintPerAddres error PremintDeleted(); error InvalidSignatureVersion(); + + error ERC1155_MINT_TO_ZERO_ADDRESS(); } diff --git a/packages/1155-contracts/test/premint/ZoraCreator1155PremintExecutor.t.sol b/packages/1155-contracts/test/premint/ZoraCreator1155PremintExecutor.t.sol index 1a513e2dc..ba4a5f4e7 100644 --- a/packages/1155-contracts/test/premint/ZoraCreator1155PremintExecutor.t.sol +++ b/packages/1155-contracts/test/premint/ZoraCreator1155PremintExecutor.t.sol @@ -738,6 +738,33 @@ contract ZoraCreator1155PreminterTest is Test { assertEq(storedCreateReferral, createReferral); } + function test_premintWithNoMintRecipient_reverts() public { + ContractCreationConfig memory contractConfig = makeDefaultContractCreationConfig(); + PremintConfigV2 memory premintConfig = makeDefaultPremintConfig(); + + address contractAddress = preminter.getContractAddress(contractConfig); + + // sign and execute premint + bytes memory signature = _signPremint(contractAddress, premintConfig, creatorPrivateKey, block.chainid); + + IZoraCreator1155PremintExecutor.MintArguments memory mintArguments = IZoraCreator1155PremintExecutor.MintArguments({ + mintRecipient: address(0), + mintComment: "", + mintReferral: address(0) + }); + + uint256 quantityToMint = 3; + uint256 mintCost = mintFeeAmount * quantityToMint; + address executor = makeAddr("executor"); + vm.deal(executor, mintCost); + + // now call the premint function, using the same config that was used to generate the digest, and the signature + vm.prank(executor); + vm.expectRevert(IZoraCreator1155Errors.ERC1155_MINT_TO_ZERO_ADDRESS.selector); + + preminter.premintV2{value: mintCost}(contractConfig, premintConfig, signature, quantityToMint, mintArguments).tokenId; + } + function _signAndExecutePremint( ContractCreationConfig memory contractConfig, PremintConfigV2 memory premintConfig,