From 68566fce0dc204685816038ea6ffd981bffa631c Mon Sep 17 00:00:00 2001 From: Dan Oved Date: Mon, 20 Nov 2023 16:56:09 -0800 Subject: [PATCH] fix premint uid bug --- .changeset/tame-chairs-obey.md | 5 +++++ .../src/delegation/ZoraCreator1155Attribution.sol | 2 ++ .../test/premint/ZoraCreator1155PremintExecutor.t.sol | 1 + 3 files changed, 8 insertions(+) create mode 100644 .changeset/tame-chairs-obey.md diff --git a/.changeset/tame-chairs-obey.md b/.changeset/tame-chairs-obey.md new file mode 100644 index 000000000..0e031e43c --- /dev/null +++ b/.changeset/tame-chairs-obey.md @@ -0,0 +1,5 @@ +--- +"@zoralabs/zora-1155-contracts": patch +--- + +Fixed setting uid when doing a premint v1 diff --git a/packages/1155-contracts/src/delegation/ZoraCreator1155Attribution.sol b/packages/1155-contracts/src/delegation/ZoraCreator1155Attribution.sol index 55a1b7cc6..cc3b1b822 100644 --- a/packages/1155-contracts/src/delegation/ZoraCreator1155Attribution.sol +++ b/packages/1155-contracts/src/delegation/ZoraCreator1155Attribution.sol @@ -457,6 +457,8 @@ library DelegatedTokenCreation { ) private view returns (DelegatedTokenSetup memory params, bytes[] memory tokenSetupActions) { validatePremint(premintConfig.tokenConfig.mintStart, premintConfig.deleted); + params.uid = premintConfig.uid; + tokenSetupActions = PremintTokenSetup.makeSetupNewTokenCalls(nextTokenId, premintConfig.tokenConfig); params.tokenURI = premintConfig.tokenConfig.tokenURI; diff --git a/packages/1155-contracts/test/premint/ZoraCreator1155PremintExecutor.t.sol b/packages/1155-contracts/test/premint/ZoraCreator1155PremintExecutor.t.sol index 9ff66fc4e..eac1417e1 100644 --- a/packages/1155-contracts/test/premint/ZoraCreator1155PremintExecutor.t.sol +++ b/packages/1155-contracts/test/premint/ZoraCreator1155PremintExecutor.t.sol @@ -143,6 +143,7 @@ contract ZoraCreator1155PreminterTest is Test { IZoraCreator1155 created1155Contract = IZoraCreator1155(contractAddress); // get the created contract, and make sure that tokens have been minted to the address assertEq(created1155Contract.balanceOf(premintExecutor, tokenId), quantityToMint); + assertEq(ZoraCreator1155Impl(address(created1155Contract)).delegatedTokenId(premintConfig.uid), tokenId); } function test_successfullyMintsTokens() external {